protected override void OnRender(ChartControl chartControl, ChartScale chartScale) { // Loop through each Plot Values on the chart and draw short line above the bar }
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
Need help drawing custom plots.
Collapse
X
-
Need help drawing custom plots.
I want to simply draw a short horizontal line for each data point value except if the plot value price is zero. Not sure how to get the x/y coordinate right for drawing lines.
Code: -
Hello bryanhill7, and thank you for your question.
Attached is a code sample that accomplishes this goal. Code samples we provide are for educational purposes, and are not intended for live trading, and are not guaranteed to accomplish any user goal or to be maintained.
Please let us know if there are any other ways we can help.Attached FilesJessica P.NinjaTrader Customer Service
-
-
-
There was a code error in the previous version which survived my initial tests. The code attached to this post has been verified to draw correctly in the most recent version of NinjaTrader.
This said the code error in the original version was not related to your query directly. Please, in either the version attached to this post or the previous post, run a New -> NinjaScript Output Window prior to loading this indicator. This contains information directly related to your query. Both the code attached to this reply and the previous code will print information which shows you X and Y pixel coordinates, and comparing this output to the Print statement that generated it will resolve your query.
The code attached to the previous post will be easier to read, as it will generate less output. I removed this filtering in order to draw objects you can see onto your chart, as objects not rendered during each call of OnRender will be erased. This is the cause of the increased level of output between scripts.Attached FilesLast edited by NinjaTrader_JessicaP; 04-17-2017, 10:16 AM.Jessica P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
147 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
5 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
4 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,282 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
Comment