error with find the highest bar after oderopen

 

i use the EA expert to backtest my EA. But there is some error with the part of code below.

the journal said "ticket for OrderModify function must ba an integer".

Does anyone know where the error is?


double Ticket;
  double TrailingStoploss;
  double highest;
  double lowest;
 
 
  for(cnt=0;cnt<OrdersTotal();cnt++)
     {
           Ticket= OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
           if(Ticket <0)  {return(-1);}
          
           // Long exit
            if (OrderSymbol()==Symbol() && OrderType()==OP_BUY)
            {
               int shift = iBarShift(Symbol(), 0, OrderOpenTime(),false);                
               highest= High[ iHighest(Symbol(),0, MODE_HIGH, shift-1, 0)];
              
               if ( highest>=(OrderOpenPrice()+Point*Profit_Level1))
               {
                  TrailingStoploss=highest-(highest-OrderOpenPrice())*0.15;
              
                 
                     OrderModify( Ticket, OrderOpenPrice(),  TrailingStoploss, 0, 0,CLR_NONE);
                 
               }
          }    
     }        
 
wusuowei:

i use the EA expert to backtest my EA. But there is some error with the part of code below.

the journal said "ticket for OrderModify function must ba an integer".

Does anyone know where the error is?

<CODE DELETED>

Please read some other posts before posting . . .

Please   edit   your post . . .    please use the   SRC   button to post code: How to use the   SRC   button. 

 
wusuowei:

i use the EA expert to backtest my EA. But there is some error with the part of code below.

the journal said "ticket for OrderModify function must ba an integer".

Did you read the documentation for OrderSelect() ?  I guess not . . .  it returns a bool not an double.   And  OrderModify()  takes an int for it's first parameter . . .  not a double.
 
RaptorUK:
Did you read the documentation for OrderSelect() ?  I guess not . . .  it returns a bool not an double.   And  OrderModify()  takes an int for it's first parameter . . .  not a double.


thanks a lot.