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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
157 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
91 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
143 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
131 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
107 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment