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.
- How to copy deals of successful traders in MetaTrader 5
- MQL5 Wizard: Development of trading robots for MetaTrader 5
- Flexible MetaTrader 5 trading system with all order types
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