How do I add my own Snap Mode so it can be used across all drawing tools?
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Create a custom "Snap Mode"
Collapse
X
-
Create a custom "Snap Mode"
I have a formula I want to use for snap mode but I had to create a custom drawing tool to use it.
How do I add my own Snap Mode so it can be used across all drawing tools?Tags: None
-
Would you be receptive to adding a new snap mode that incorporates the Euclidean distance formula to snap to the nearest open, high, low, or close price relative to the position of the mouse pointer? I can provide the function I use to determine the nearest price I use for my drawing tool.
Comment
-
Hi, I will be happy to submit a feature request to our development team. Please provide as much detail as possible about the function of the new snap mode and I will also add a request of generalizing it to make the snap behavior overrideable for full customization.
Kind regards,
-ChrisLChris L.NinjaTrader Customer Service
Comment
-
Thanks.
First attachment is an enhancement to the "Price" snap mode. The function finds the nearest price to snap to using the distance between the pointer and every OHLC price on screen. The code is integrated into my Fibonacci drawing tool with this one line of code:Code:dataPoint.Price = nearest_price(chartControl, chartPanel, chartScale, dataPoint);
Code:PriceAndTime p = nearest_price_and_time(chartControl, chartPanel, chartScale, dataPoint); dataPoint.Price = p.Price; dataPoint.Time = p.Time;
Here's a video demonstration:
Last edited by hurleydood; 03-17-2023, 08:19 PM.
- Likes 2
Comment
-
-
hurleydood, any thoughts on how to snap to the plots also?
I think it is possible to extract the logic from "AddPlotNames" indicator ( https://ninjatraderecosystem.com/use.../addplotnames/ ) to do this.Last edited by rafaelcoisa; 05-24-2023, 04:50 PM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by WHICKED, Today, 12:45 PM
|
2 responses
18 views
0 likes
|
Last Post
by WHICKED
Today, 03:36 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
15 responses
3,275 views
0 likes
|
Last Post Today, 03:15 PM | ||
Started by Tim-c, Today, 02:10 PM
|
1 response
8 views
0 likes
|
Last Post Today, 02:52 PM | ||
Started by Taddypole, Today, 02:47 PM
|
0 responses
3 views
0 likes
|
Last Post
by Taddypole
Today, 02:47 PM
|
||
Started by chbruno, 04-24-2024, 04:10 PM
|
4 responses
51 views
0 likes
|
Last Post
by chbruno
Today, 02:38 PM
|
Comment