EA opens position with magic number set, then TP or SL closes it how to link to EA

 

Gen'l'm'n how to tell if a position closed by TP or by SL was opened by EA?

For example:

EA send buy order with SL and TP set -> order results into one position -> position is closed by TP or by SL,  is technically new order to the opposite direction, but this order has no magic number linking it to the EA. Now, can I identify this order belonging to the EA or must I use alteratives here? My guess is no.

Thank you.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM - Documentation on MQL5
 
Candles:

Gen'l'm'n how to tell if a position closed by TP or by SL was opened by EA?

For example:

EA send buy order with SL and TP set -> order results into one position -> position is closed by TP or by SL,  is technically new order to the opposite direction, but this order has no magic number linking it to the EA. Now, can I identify this order belonging to the EA or must I use alteratives here? My guess is no.

Thank you.

If you are using "official" SL/TP with your EA, that means no manual trading and other EA can trade this symbol. So by default any SL/TP triggered "belong" to your EA.

As I already said here but in other words, if you work at position level, you have to proceed as your EA is alone in the world.

 
angevoyageur:

If you are using "official" SL/TP with your EA, that means no manual trading and other EA can trade this symbol. So by default any SL/TP triggered "belong" to your EA.

As I already said here but in other words, if you work at position level, you have to proceed as your EA is alone in the world.

If you are using "official" SL/TP with your EA, that means no manual trading and other EA can trade this symbol. So by default any SL/TP triggered "belong" to your EA.

I like the way you put it here, very claryfing.

Thanks again angevoyageur

 
Candles:

If you are using "official" SL/TP with your EA, that means no manual trading and other EA can trade this symbol. So by default any SL/TP triggered "belong" to your EA.

I like the way you put it here, very claryfing.

Thanks again angevoyageur

You are welcome.
 
I thought this question has been asked before?
 
doshur:
I thought this question has been asked before?
Maybe. Where ?
 
angevoyageur:
Maybe. Where ?
Here it appears to be same? https://www.mql5.com/en/forum/15507 
can mt5 operate in non-fifo mode?
can mt5 operate in non-fifo mode?
  • www.mql5.com
or is fifo mandatory across all brokers?
Reason: