double SymbolProfit(string symb){ int cnt, total; double BuyProfit = 0; double SellProfit = 0; total = OrdersTotal(); for(cnt=0; cnt<total; cnt++){ if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true) if(OrderSymbol()==symb && OrderMagicNumber()==MagicNo){ if(OrderType()==OP_BUY){ BuyProfit = BuyProfit + OrderProfit() + OrderCommission() + OrderSwap(); } if(OrderType()==OP_SELL){ SellProfit = SellProfit + OrderProfit() + OrderCommission() + OrderSwap(); } } } return(BuyProfit+SellProfit); }
Michael Maggi:
Marketplace has a handy utility that is free that does this: KL Account Performance. It is free.
Marketplace has a handy utility that is free that does this: KL Account Performance. It is free.
I want in code mql, but, Thank you.
I modified...
double PLPAR(){
int cnt, total;
double BuyProfit = 0;
double SellProfit = 0;
total = OrdersTotal();
for(cnt=0; cnt<total; cnt++){
if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true)
if(OrderSymbol()!=Symbol()) continue;
{
if(OrderType()==OP_BUY){
BuyProfit = BuyProfit + OrderProfit() + OrderCommission() + OrderSwap();
}
if(OrderType()==OP_SELL){
SellProfit = SellProfit + OrderProfit() + OrderCommission() + OrderSwap();
}
}
}
return(BuyProfit+SellProfit);
}

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want get total AccountInfoDouble(ACCOUNT_PROFIT), but for a symbol()
Thank you