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.
- Need help with Order History to get the last order?
- Trailing Stop and reversing
- How select last order for one symbol in the history and get value of lots and profit?
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.
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:
Thank you. :)
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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register