thx!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
indicator of a multiintrument
Collapse
X
-
indicator of a multiintrument
I am trying to set up a strategy in which one of the checks is to see if the price is greater than to lower Bollinger Band. However when i call on the Bollinger (or just SMA) it is giving me crazy results as it uses the input of all instruments. Can you please advise?
thx!Tags: None
-
-
ok so for example to get the closing price of the first instrument i would have:
Closes[0][0]
...of the second instrument...
Closes[1][0]
How can I see if Closes[1][0] is > than the Lower Bollinger Band of instrument [1]
Comment
-
You can use BarsArray [ ] in the Bollinger expression.
if (Closes[1][0] > Bollinger(BarsArray[1], 13, 3).Lower[0])
Ryan M.NinjaTrader Customer Service
Comment
-
tried it but am now getting:
Error on calling 'OnBarUpdate' method for indicator '_' on bar 1: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
using:
Print ("wma 50-10: "+ WMA(BarsArray[0],50)[10]);
I know in a strategy I have to increase the look back period, how do I fix this in an indicator, which as I understood should start plotting/returning data once enough bars are gathered?
thx!
Comment
-
You need to follow principles here:
Make sure you have enough bars in the data series you are accessing
You may need a check similar to
if (CurrentBar < 10) return;
If you need this check for another series, it's with CurrentBars [ ] and then an index value indicating the series.
Ryan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
647 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 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
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment