Would someone kindly shed some light on the particulars of how "open next bar" command alters how the code is interpreted?
I have it running in some of my code, just to check that I'm going to send stop orders that won't be rejected due to a large change in the opening price of the next bar vs the close of the current bar.
However, I've noticed that it's changed the behaviour of sessionlastbar, eventough sessionlastbar and open next bar do not interact with each other in my codes logic.
By simply adding a token "open next bar" command anywhere the following happens:
Code: Select all
if sessionlastbar=true then value1=1 else value1=0
if open next bar >0 then begin
if value1=1 then buy next bar at market
end;
If you remove "open next bar", it will create an entry on the next bar along instead.
Is that expected behaviour? So are all variables recalculated at the start of the bar if one uses "open next bar"?