Code:
double summe = 0; //als globale variable
int summepips = 0;
int m = 1;
if (Digits == 3 || Digits == 5) m = 10;
if(test)
{
int pips;
double f;
double x;
int i;
for (i = OrdersHistoryTotal() - 1 ; i > OrdersHistoryTotal() - 10; i--)
{
OrderSelect(i, SELECT_BY_POS, MODE_HISTORY);
double point = MarketInfo(OrderSymbol(), MODE_POINT);
f = m * point;
if (OrderType() == OP_BUY)
pips = MathRound((OrderClosePrice() - OrderOpenPrice())/f);
if (OrderType() == OP_SELL)
pips = MathRound((OrderOpenPrice() - OrderClosePrice())/f);
summepips += pips;
x = OrderProfit() + OrderSwap() + OrderCommission();
summe += x;
Print("summe=", summe);
}
}
traderdoc