Definition
Determines how often OnBarUpdate() is called for each bar. OnBarClose means once at the close of the bar
However the code below shows that it actually is called twice for every bar.
Does it always run twice ? is the manual wrong ? Can I make it run only once ?
int onBarUpdateCounter = 0; protected override void OnBarUpdate() { if (State!=State.Historical) { Print("onBarUpdateCounter: " + ++onBarUpdateCounter + "Current Bar " + CurrentBar); } }
outputs:
onBarUpdateCounter: 2Current Bar 3855
onBarUpdateCounter: 3Current Bar 3856
onBarUpdateCounter: 4Current Bar 3856
onBarUpdateCounter: 5Current Bar 3857
onBarUpdateCounter: 6Current Bar 3857
Comment