Einzelnen Beitrag anzeigen
  #10 (permalink)  
Alt 15.01.14
traderdoc traderdoc ist offline
Elite Mitglied
 
Registriert seit: Apr 2011
Beiträge: 2.735
traderdoc befindet sich auf einem aufstrebenden Ast
Standard

So nun nochmal den Code ohne Fehlerchen:

Code:
double GetLot()
 {
  int cnt=0;
  double profit;
  int ls = 1;
  double lotmod = Lot; //Lot - initiale LotSize
  if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.01) ls = 2;
 
  for(int i=OrdersHistoryTotal(); i >=0;i--)
    {
     if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
       {
        if (OrderSymbol() == Symbol())
           {
            profit = OrderProfit() + OrderSwap() + OrderCommision();
            if (profit < 0) cnt++;
                else break;
            if (cnt == 5) 
               {
                lotmod = NormalizeDouble(Lot/2, ls);
                return(lotmod);
               }
           }
       }
    }
  return(lotmod);
 }
traderdoc