I trade with MB Trading (MBT) and I turned on their email alerts so they will email me when an order is submitted, executed, cancelled, rejected and changed.
Now when my exit order got triggered I received the following email alerts from MBT:
email 1 - 10:04:23 - order submitted
email 2 - 10:04:28 - order cancelled
email 3 - 10:04:29 - order submitted
email 4 - 10:04:31 - order cancelled
email 5 - 10:04:32 - order submitted
email 6 - 10:04:33 - order executed
So for some reason my order was submitted and cancelled twice before actually being executed. Is there something wrong with my code or is something happening at the brokers end?
Here is my exit code:
Code: Select all
if marketposition = 1 then begin
If close >= (entryprice + Profit points) then begin
Sell ("profit") next bar at market ;
end;
If close <= (entryprice - loss points) then begin
Sell ("Stop Loss") next bar at market ;
end;
end;