protected override void Initialize()
{
Add(PeriodType.Minute, 30);
SMA(50).Plots[0].Pen.Color = Color.Blue;
Add(SMA(50));
SMA(BarsArray[1], 10).Plots[0].Pen.Color = Color.Orange;
SMA(BarsArray[1], 10).Plots[0].Pen.DashStyle = DashStyle.Dot;
Add(SMA(BarsArray[1], 10));
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Plot indicators using multibar data periods
Collapse
X
-
Plot indicators using multibar data periods
Why doesn't the following display the SMA(10) curve for the second 30-minute timeframe?
What would be the correct way to do this? (Ignore the fact that an SMA might be restated in terms of the highest-frequency timeframe, since for many other indicators that relationship doesn't hold.)Code:Tags: None
-
Hello Dbooksta,
Thank you for your post.
You would not be able to add an indicator with a different data series than the primary.
The reason for this in the method you provided, the BarsArray has not loaded and would not always work.
It is not recommended to use the BarsArray in the Initialize() methodCal H.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
160 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
307 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
244 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
348 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
178 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment