I'm trying to ensure that there's only one entry per day per symbol. Currently I have code like this:
Unfortunately, I had a situation this morning where one order was filled at 06:45:32:950. Just milliseconds later (at 06:45:32:962), MultiCharts transmitted a second order for the same symbol. The second order was filled a second later, so I ended up with two filled orders for this symbol instead of just one.
Code: Select all
[AllowSendOrdersAlways = true]
If EntriesToday(date) = 0 then begin
Buy next bar at XX limit;
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.