Thanks gooly, got success by your idea.
int last_trade=HistoryTotal(); if(last_trade>0) { if(OrderSelect(last_trade-1,SELECT_BY_POS,MODE_HISTORY)==true) { BuyProfitPip=OrderClosePrice()-OrderOpenPrice(); SellProfitPip=OrderOpenPrice()-OrderClosePrice(); } }
sheriffonline:
Thanks gooly, got success by your idea.
But now you get only the trade with the highest pos no. - not the last trade in a temporal sequence!
To be save you have to loop through the history!
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
How to get last closed order gained pip?
Is there any function available to find last closed order pip value?