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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
561 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
325 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
547 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment