MRO (() => Highs[1][0] > Closes[1][0]), that it won't recognize the Highs[1][0] or Closes[1][0] of the secondary series?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
MRO and LRO method for secondary series
Collapse
X
-
MRO and LRO method for secondary series
I see in the Help guide that the MRO and LRO methods do NOT work on multi-series strategies and indicators. So does this mean that if I add a secondary series and have the following:
MRO (() => Highs[1][0] > Closes[1][0]), that it won't recognize the Highs[1][0] or Closes[1][0] of the secondary series?Tags: None
-
Hello Lance El Camino,
MRO / LRO will be looping back on the primary series and not on the secondary series.
Sure you can use those values from the other series, but they may be not the bar relative to the primary bar you think it is and you could run into index errors.
In other words, as it loops back to the previous Closes[0][0] bar, Closes[1][0] may not be the previous bar, depending on if its using the same interval as the primary.Chelsea B.NinjaTrader Customer Service
-
Thanks for the confirmation. A simple workaround is to create a bool that is true on the primary series when a condition is met on the secondary series and apply MRO/LRO to when that variable was last true.
Comment
-
Hello Lance El Camino,
If you need to know when the condition is true looping through the added series indexes, you might just use a loop.
Thats what MRO and LRO are doing internally.
int conditionFoundBarsAgo = -1;
for (int index = 0; index < 10; index++)
{
if ( Highs[1][index] < Closes[1][index] )
{
conditionFoundBarsAgo = index;
}
}
Print(conditionFoundBarsAgo);Chelsea B.NinjaTrader Customer Service
Comment
-
Thank you. Do LowestBar and HighestBar operate in the same way, not being able to use secondary series?
Comment
-
Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by reynoldsn, 01-06-2025, 06:21 PM
|
3 responses
30 views
0 likes
|
Last Post
by reynoldsn
Today, 10:39 AM
|
||
Started by azh_ali, Today, 09:15 AM
|
4 responses
13 views
0 likes
|
Last Post
by azh_ali
Today, 10:32 AM
|
||
Started by morong0414, 11-21-2022, 09:23 AM
|
126 responses
15,623 views
1 like
|
Last Post
by Kmace20
Today, 10:15 AM
|
||
Started by Orion1504, Today, 09:27 AM
|
1 response
11 views
0 likes
|
Last Post Today, 09:59 AM | ||
Started by steinberg123, Yesterday, 02:43 AM
|
10 responses
52 views
0 likes
|
Last Post Today, 09:53 AM |
Comment