Hi ...
I did this function in some of my codes ... It returns Last order type, Last order Lots and Last order Profit ...
So, just check in your main code if last order profit >=0 ... It works charm :)
void LastClosedTrade(){ int cnt, total; total = OrdersHistoryTotal(); for(cnt=0;cnt<total; cnt++){ if(OrderSelect(cnt,SELECT_BY_POS,MODE_HISTORY)==true) if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC && OrderProfit()!=0){ LastOrderType = OrderType(); LastOrderLots = OrderLots(); LastOrderProfit = OrderProfit(); } } }
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 we can verfied if the last trade is win or a loose trade ?
what is the functions and commands that we must use or a little exemple of script?
Thank you very much, seriously i need your help to finish my strategy