How to get the stoploss of the previous order?

 
Some parts of my EA require validation of a previous price level. The best way I can think of is getting the last order in history and check the stop loss but there is no option for getting the stop loss of the last order in history.
 
wehsnim:
Some parts of my EA require validation of a previous price level. The best way I can think of is getting the last order in history and check the stop loss but there is no option for getting the stop loss of the last order in history.

Hello wehsnim,

You have to use the HistorySelect function, together with other functions related to history orders, like HistoryOrderGetDouble, HistoryOrderGetInteger, etc.

In your specific question, you can get the SL price of the last order by using HistoryOrderGetDouble(ticket,ORDER_SL), through a for-loop.

Regards,
Malacarne 

 
Malacarne:

Hello wehsnim,

You have to use the HistorySelect function, together with other functions related to history orders, like HistoryOrderGetDouble, HistoryOrderGetInteger, etc.

In your specific question, you can get the SL price of the last order by using HistoryOrderGetDouble(ticket,ORDER_SL), through a for-loop.

Regards,
Malacarne 

Thank you. :)