currentBars != Bars not working

 

Hi, here is my code for which I have this problem, but I don't understand why you give me this in the end which in a nutshell only fits me long and not short


  if(currBars != Bars>Nearest_Up_Level && Nearest_Up_Level && checkMA(0) && isAvailableOrder())
           {
            double lot = _get_lot_size(Stop_Loss);
            OpenTrade(Symbol(), OP_BUY, lot);
           }



 if(currBars != Bars< &&Nearest_Down_Level && checkMA(0) && isAvailableOrder())
           {
            double lot = _get_lot_size(Stop_Loss);
            OpenTrade(Symbol(), OP_SELL, lot);
           }


I would just like to tell them that if the bar is rising above the Bars >Nearest_Up_Level, buy

vice versa for the short Bar<Nearest_Down_Level

 
  1. if(currBars != Bars< &&Nearest_Down_Level && checkMA(0) && isAvailableOrder()){}

    Do not post code that will not even compile.

  2. For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
              New candle - MQL4 programming forum #3 (2014)