How do I know which data series the draw object is drawn against?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Draw objects from different series
Collapse
X
-
Draw objects from different series
Is there a way to draw a line on current chart based on bars from a different time frame, primarily how to handle bars ago?
How do I know which data series the draw object is drawn against?Last edited by shildebrand324; 02-07-2022, 09:12 PM.Tags: None
-
Hello shildebrand324,
Thanks for your post.
Please see the attached example script demonstrating how to draw a line on the primary data series and have that line calculated from a secondary added data series.
To accomplish this, you would add a secondary series to your script using AddDataSeries(). In OnBarUpdate() you would check if the primary series is processing by checking if BarsInProgress == 0. Then, you would call your Draw.Line() method and use values from the secondary price series, such as Closes[1][0].
Note that the drawing object will draw in the primary series if you call Draw.Line() in your BarsInProgress == 0 condition check.
See the help guide documentation below for more information.
PriceSeries<T>: https://ninjatrader.com/support/help...riceseries.htm
Closes: https://ninjatrader.com/support/help...nt8/closes.htm
Draw.Line: https://ninjatrader.com/support/help.../draw_line.htm
BarsInProgress: https://ninjatrader.com/support/help...inprogress.htm
AddDataSeries: https://ninjatrader.com/support/help...dataseries.htm
Let us know if we may assist further.Attached FilesLast edited by NinjaTrader_BrandonH; 02-08-2022, 10:04 AM.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
603 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
349 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
104 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
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
560 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment