Magic number 0 means that the order was closed manually.
You can monitor OrdersTotal() for increase and decrease in orders.
Magic number 0 means that the order was closed manually.
You can monitor OrdersTotal() for increase and decrease in orders.
ORDER_REASON_CLIENT
ORDER_REASON_EXPERT
Thank @marco @fxsaber
What i'm trying to do is to count the monthly/weekly profit for a given pair. Sometimes when price goes against trend I close my position manually and I realized that my code doesnt manage orders closed manually.
After trying many things I think I have to loop on positions and not on deals because positions keeps the magic number info like MT4.
So my next steps are:
Do you think it's the good way to achieve it ?
I ask because it's what I tried but I think I do something wrong when handle the array
You agree to website policy and terms of use
Hi everyone,
I'm trying to detect an order opened by my EA and closed manually.
I tried with magic number but, unfortunately, get only 0 for manually closed orders.
Anyone know how to reliable detect an order opened by an EA and closed manually ?
Thank you