Calling Opens[1][0] results in previous month open value (since in Historical state indicator runs in OnBarClose mode only and so there is no yet closed/formed bar for the current month).
Here is my code snippet:
...
else if (State == State.Configure){
AddDataSeries(BarsPeriodType.Month,1);
}
...
protected override void OnBarUpdate(){
if (CurrentBars[1] < 0) return;
if (BarsInProgress == 0){
double open = Opens[1][0];
Print(open.ToString());
}
}
Comment