I'm trying to ensure that there's only one entry per day per symbol. Currently I have code like this:
Code: Select all
[AllowSendOrdersAlways = true]
RecalcLastBarAfter(5);
...
If EntriesToday(date) = 0 then begin
Buy next bar at XX limit;
end;
I'm assuming that after the first order was filled, the value for EntriesToday(date) wasn't updated until the next bar. When a new tick occurred within the same bar, the strategy didn't "know" that an order had already been filled, so it submitted the second order.
Is my understanding correct? Would anyone know of a workaround for this?
Thanks much in advance.