English

## Help please Highest between 2 levels ....

 17 jeef_1985 2016.08.19 17:15 #   yes indeed but how, here is what I dofirst  function to find the time cross up TP, the secondis to find the time of cross Down SL and 2 functions iBarShift and iHighest , but it didnt workThank you for your help     ``` datetime ShiftTP(){           double TP ;      int Total = OrdersTotal()-1 ;       for(int i = Total ; i >= 0 ; i--){        if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))          if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic && OrderType()==OP_BUY)          TP = OrderTakeProfit() ;            for(i=1;i<=ibars;i++)             {                if(Open[i]TP)return(Time[i]);              }         }        return 0 ;    }`````` datetime ShiftSL(){           double SL ;      int Total = OrdersTotal()-1 ;       for(int i = Total ; i >= 0 ; i--){        if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))          if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic && OrderType()==OP_BUY)          SL = OrderStopLoss() ;            for( i=1;i<=ibars;i++)             {                if(Open[i]>SL&&Close[i]
 17 jeef_1985 2016.08.19 21:45 #   functions  one and two returs the  times of the crossup and down of levelsiBarshift function parameter needs the time to find the index of chandeles that will reuse for iHighest function. I can not do better ... help if possible thank you ```datetime ShiftTP(){           double TP ;      int Total = OrdersTotal()-1 ;       for(int i = Total ; i >= 0 ; i--){        if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))          if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic && OrderType()==OP_BUY)          TP = OrderTakeProfit() ;                 if(Open[1]TP)return(Time[1]);                      }        return 0 ;    }```
 13130 WHRoeder 2016.08.20 15:08 #   jeef_1985: iBarshift function parameter needs the time to find the index of chandeles that will reuse for iHighest function. I can not do better ...To get the time you already must have the shift. No need for the time and iBarShift, you already have it. Yes you can do better.``` int      shifttp=iBarShift(Symbol(),0,ShiftTP()); int      shiftsl=iBarShift(Symbol(),0,ShiftSL()); double   Highest = High[iHighest(Symbol(),0,shifttp,shiftsl)] ;```iHighest is not symbol, period, from, to, (or "to, from,") it is length, from. You must compute the length and the lowest shift.