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:
https://ninjatraderecosystem.com/use...-drawing-tool/
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.
https://ninjatrader.com/support/help...thgeometry.htm
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:
https://ninjatrader.com/support/foru...380#post803380
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.
Kate W.NinjaTrader Customer Service
-
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.Kate W.NinjaTrader Customer Service
- 1 like
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by parkinsonbr, Today, 04:13 PM
|
0 responses
1 view
0 likes
|
Last Post
![]()
by parkinsonbr
Today, 04:13 PM
|
||
Started by robforee2, Today, 01:05 PM
|
1 response
7 views
0 likes
|
Last Post
|
||
Started by SpikeLGWG, Today, 12:35 PM
|
1 response
11 views
0 likes
|
Last Post
|
||
Started by Kaalhus, Today, 12:47 PM
|
2 responses
27 views
0 likes
|
Last Post
![]()
by Kaalhus
Today, 01:05 PM
|
||
Started by Johnny, Today, 11:55 AM
|
3 responses
21 views
0 likes
|
Last Post
|
Comment