Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to add text on bar using onrender
Collapse
X
-
Hello r3n3v,
Thanks for your post.
I have attached an example that demonstrates using SharpDX rendering in place of drawing objects to give further direction here. The example uses a Series<bool> to identify if something should be drawn on that bar. Text is also drawn with SharpDX in the example.
To get more acquainted with SharpDX rendering, please see the Help Guide article below, and please see the SampleCustomRender indicator that comes with NinjaTrader.
https://ninjatrader.com/support/help..._rendering.htm
We look forward to assisting.Attached Files
-
Hello r3n3v,
You can use a Series<bool> to store information that something should be drawn on that bar, and you can use other Series objects or private variables to store what should be drawn. In OnRender, when you loop through visible bars, you would check to see what should be drawn from the Series<bool> and then use information from your custom Series objects, or from a PriceSeries.
If you do not want to use a Series<bool> to signal which bars should have something drawn, you can simply loop through ChartBars.FromIndex and ChartBars.ToIndex in OnRender, and then draw text for each visible bar. (You can reference data from custom Series<double>'s or from the PriceSeries of the script for what should be drawn.) I.E. You can ignore line 115 where the Series<bool> is checked if something should be drawn.
We look forward to assisting.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
344 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
557 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment