When trying to calc the % change a stock has made from its opening price,
I use the formula (Last - Open) / PreviousClose.
In code:
____________________________________
Add(PeriodType.Day, 1); // Add a 1 day Bars object - BarsInProgres index = 1
Closes [0][0] - Opens[1][0] / Closes [1][0]
___________________________________________
However, I have realized that: because the
CalculateOnBarClose = true;
Closes[1][0] returns yesterdays close (desired) and similarly, Opens [1][0] returns yesterdays open ....not desired.
I want
CalculateOnBarClose = true;
to remain as is in general, but is there a syntax in whicjh i can set it to false for only the Opens[2][0] bar?
Thanks in advance,
Andrew
Comment