order send error , ea not opening sell trades , only buy trades are taken

 
double prev_buy, prev_sell;
bool Enable_Trade = true;
void OnTick()
  {
   double buy = 0.0, sell = 0.0;
   double atr = iATR(Symbol(),PERIOD_CURRENT,ATR_period,1);

   Check_Time();

   buy = iCustom(Symbol(),PERIOD_CURRENT,"SuperOsmaArrow"
                 ,Nbr_Periods1,Multiplier1,Nbr_Periods2,Multiplier2,Nbr_Periods3
                 ,Multiplier3,InpFastEMA,InpSlowEMA,InpSignalSMA,ATR_period,ATR_TP,ATR_SL,0,0,0,0,0,0,0,0);

   sell = iCustom(Symbol(),PERIOD_CURRENT,"SuperOsmaArrow"
                  ,Nbr_Periods1,Multiplier1,Nbr_Periods2,Multiplier2,Nbr_Periods3
                  ,Multiplier3,InpFastEMA,InpSlowEMA,InpSignalSMA,ATR_period,ATR_TP,ATR_SL,0,0,0,0,0,0,1,0);



   if(buy != EMPTY_VALUE && buy != prev_buy && Enable_Trade)
      OrderSend(Symbol(),OP_BUY,lot,Ask,3,Ask - atr * ATR_SL,Ask + atr * ATR_TP,"",Magic);
   if(sell != EMPTY_VALUE && sell != prev_sell && Enable_Trade)
      OrderSend(Symbol(),OP_SELL,lot,Bid,3,Bid + atr * ATR_SL,Bid - atr * ATR_TP,"",Magic);

   prev_buy = buy;
   prev_sell = sell;
  }

hey , can any one tell where it went wrong that the ea is ignoring sell signals from the custom indicator ? but is working fine with buy signals

Step on New Rails: Custom Indicators in MQL5
Step on New Rails: Custom Indicators in MQL5
  • www.mql5.com
I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.
Files:
Reason: