In any bar we gets many number of updates/Ajdustment/changes.
How come I know in IStrategy.onBar event that this particular call is for particular bar(time period) and nextone ll be for new bar/timeperiod.
I tried above using following code
Period oldPeriod;
public void onBar(Instrument instr,Period pr, IBar askbar, IBar bidBar){
if(oldPeriod != null && oldPeriod != pr) {
System.out.println("New bar started");
}
oldperiod = pr;
}
But it is failing in 30 minute and 1 hour chart, as it returns 10 sec period on each event.
How to resolve this issue please let me know.
It is very critical for us.