Download MetaTrader 5
To add comments, please log in or register
Publish the program in the Market and sell it to millions of traders!
fred06100 2014.06.10 12:52 
Hi community !
I am not an expert in the developement of an EA, this why i need some help from you. 
I will appreciated any information or advice :)
I am currently using an EA that looks like an hedging method.
In result i have in real time many opened trade...some one have TP and SL with the same value...
In the perfect case, this trades should be closed in same time when the value is reached (TP/SL). (98% is working fine).
But somes times, i am not sur why (maybe slippage), one trade can be closed but the other stay opened...
I would like to force and close all trades if one trade among all others is closed. Because if one has been reached by the value of TP or SL, normaly every all others trades should be reached too and closed. 
I would like to be sure that if my trades are not closed properly in same time by the SL and TP value. That my EA force automatically a close action for all.
If someone know or already develope this condition... 
If you need further information, let me know.
Many thanks for your helps
Best Regards
qjol 2014.06.10 14:08  
for(...)                   // loop all the open orders
   OrderSelect(...);       // select them one by one
   if (OrderClosePrice >= (<=) TP || OrderClosePrice >= (<=) SL) // check if reached the SL/TP
   OrderClose(...);        // close the order
fred06100 2014.06.11 13:42  
Hi Qjol,
Thanks for your answer !
I will try to implement this part of code in the EA ASAP.
I let you know.
And thanks again for the time spent to reply.
kind regards
To add comments, please log in or register