protected override void OnBarUpdate()
{
// Prints the high price of the most recent up bar over the last 10 bars (current bar + look back period's 9 bars before that)
int barsAgo = MRO(() => Close[0] > Open[0], 1, 9);
if (barsAgo > -1)
Print("The bar high was " + High[barsAgo]);
In this example, instead of the last 10 bars, which the 9 represents, how can I code for Yesterdays Bar through 10 bars ago? Another words I do not want to include the current bar in the look back period.
I tried:
int barsAgo = MRO(() => Close[0] > Open[0], 1, (CurrentBar - 1) - 9);
and
int barsAgo = MRO(() => Close[0] > Open[0], 1, 1 - 9);
this did not seem to work.
Thanks as always for your help.
Ryan
Comment