Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Add a self-created price marker
Collapse
X
-
Add a self-created price marker
Hi, i would like to add a price marker to the line generated in onRender(), just like the orderlines in the charttrader. is this possible? how would i have to create the price marker directly in the strategy or a drawing tool or indicator? what would be the best solution for this? second question would be how to move the line with the mouse, i would like to recreate the same functions as in charttrader. maybe someone here has a tip on how I can best work on the implementation ;-)
Tags: None
-
Hello sidlercom80,
Thank you for your post.
I'd probably recommend using a drawing tool - the below Labeled Lines Drawing Tool add-on from our publicly available User App Share would be a good place to start:
This is an expansion of the the NinjaTrader Lines Drawing Tool(s) that adds text boxes to each line that will show prices associated with the endpoint or where the line crosses the price scale. Vertical lines will show time stamps. Your own messages can be added to each text box. New settings can be set […]
If you want to make the label look different, you can use PathGeometry to make something that looks more like the Chart Trader price markers.
As far as capturing mouse events to create a click/drag functionality, that would be primarily out of the NinjaScript realm of support and more into C#, but there's useful information on this post that should help you get started:
Please let us know if we may be of further assistance to you.
The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
-
Hi _Kate thank you for your post,
when the mouse pointer is in the rectangle and the left mouse button is pressed, an action is executed. that fits so far, but how can i prevent that when moving the mouse with pressed mouse button, the chart is not moved? is there something like chartControl.IsEnabled = false; that would work here? if the conditions are fulfilled, switch off chart moving ( chartControl.IsEnabled = false) and switch it on again with (chartControl.IsEnabled = true).
Comment
-
Hello sidlercom80,
Thank you for your reply.
There are no documented NinjaScript methods for this and this would require custom C# coding.
You might add a handler to the PreviewMouseDown event to detect the chart has been clicked on and instead of the default logic, execute your own logic for clicking and dragging.
Below is a link to an indicator example that uses this.
https://ninjatrader.com/support/foru...624#post792624
Please let us know if we may be of further assistance to you.
- Likes 1
Comment
-
Hi _Kate, thank you for the tip with "PreviewMouseDown", it was very helpful ;-)
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
51 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
127 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment