rodrigosm:
Hi, I would like to get the last trades profit and loss that my expert had, how can I do that?
Thanks.
Use
bool OrderSelect( int index, int select, int pool=MODE_TRADES)
with pool = MODE_HISTORY
Also use
int OrdersHistoryTotal( )
for(int iPos=OrdersHistoryTotal()-1; iPos >= 0 ; iPos--) if ( OrderSelect(iPos, SELECT_BY_POS, MODE_HISTORY) // Only orders w/ && OrderMagicNumber() == Magic.Number // my magic number && OrderSymbol() == chart.symbol // and my pair. && OrderType() <= OP_SELL// Avoid cr/bal forum.mql4.com/32363#325360 ){ double profit = OrderProfit() + OrderSwap() + OrderCommission(),

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
Hi, I would like to get the last trades profit and loss that my expert had, how can I do that?
Thanks.