assumption

 

Hi,

Please help me! I'd like to put assumption to an expert. The assumption would be, that what was the previous position achivement. So the next open order depens on previous position closed by SL or TP.

Thanks
H

 

Just look at the last closed order and you have your answer

 
Ickyrus wrote >>

Just look at the last closed order and you have your answer


Ok, but how can i write that in mql4 language?
 
Hopkinsz:


Ok, but how can i write that in mql4 language?

Loop on all history orders using OrderSelect() and find the last closed order. That won't guarantee that it was closed by T/P or S/L though.

 

The assumption I was making was that all the orders in the history were closed by T/P or S/L.
If the EA sets the order with a magic number and closes it based on its settings of T/P and S/L
then all the oders with that magic number (unless manual intervention) were closed with T/P and S/L
-
Compareing the closeprice with startprice (don't know the official names yet!) would let you know how the order was closed
most of the time. If the T/P and S/L are too close to the startprice (maybe I should use the word openprice for startprice) slippage can
close the order before T/P or S/L are reached (or so my experiments in the live trading environment have prooved)
-
Hey I'm only 14days old in useing MT4 and trading on the currency exchange!

 
Ickyrus:

Compareing the closeprice with startprice (don't know the official names yet!) would let you know how the order was closed
most of the time. If the T/P and S/L are too close to the startprice (maybe I should use the word openprice for startprice) slippage can
close the order before T/P or S/L are reached (or so my experiments in the live trading environment have prooved)

https://www.mql5.com/en/forum/123668
 

Usful - Still not sure if it answered the question about the missing T/P S/L, figures (that was the service provider?)
However a simple CSV file setup by the EA to Audit its on activities is also posible.
 
Ickyrus:
Usful - Still not sure if it answered the question about the missing T/P S/L,

What do u mean? What missing T/P S/L?

 

Sorry the S/L and T/P info was in the brokers order comments and there was some disscussion on its removal by the broker. The other S/L T/P was to do with whether the order had to be modified after it had been sent. However am I ok in thinking that all orderrecords with brokers that use the MT4 platform store the closed orders S/L and T/P values?

 
Ickyrus:

Sorry the S/L and T/P info was in the brokers order comments and there was some disscussion on its removal by the broker. The other S/L T/P was to do with whether the order had to be modified after it had been sent. However am I ok in thinking that all orderrecords with brokers that use the MT4 platform store the closed orders S/L and T/P values?

The S/L and T/P that are stored with a closed order are the LAST S/L and T/P set for that order (if they were modified...).

Reason: