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 charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
60 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
147 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
161 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
97 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
284 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment