please someone tell me what is wrong whith this indicator?

 

this indicator doesent have any error or warning but when i put it on the chart nothing hppend

#property strict

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 clrGold

#property indicator_color2 clrGold

#property indicator_width1 1

#property indicator_width2 1

double UPSIGNAL[];

double DOWNSIGNAL[];



//+------------------------------------------------------------------+

//| Custom indicator initialization function                         |

//+------------------------------------------------------------------+

int OnInit()

  {



//--- indicator buffers mapping

//UP Arrow Buffer

   SetIndexEmptyValue(0,0.0);

   SetIndexStyle(0,DRAW_ARROW,0,EMPTY,clrBlue);

   SetIndexArrow(0,233);

   SetIndexBuffer(0,UPSIGNAL);



//DOWN Arrow Buffer

   SetIndexEmptyValue(1,0.0);

   SetIndexStyle(1,DRAW_ARROW,0,EMPTY,clrRed);

   SetIndexArrow(1,234);

   SetIndexBuffer(1,DOWNSIGNAL);



   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//| Custom indicator iteration function                              |

//+------------------------------------------------------------------+

int OnCalculate(const int rates_total,

                const int prev_calculated,

                const datetime &time[],

                const double &open[],

                const double &high[],

                const double &low[],

                const double &close[],

                const long &tick_volume[],

                const long &volume[],

                const int &spread[])

  {

   int limit = rates_total;

   int count = prev_calculated;

   for(int i = limit - count-1; i >= 0; i--)

     {

      if(rsistosignal(i) == "BUY")

        {

         UPSIGNAL[i] = Low[i] - (Point * 15);

         Alert("buy signal at", Symbol());

        }

      if(rsistosignal(i) == "SELL")

        {

         DOWNSIGNAL[i] = High[i] + (Point * 15);

         Alert("sell signal at", Symbol());

        }

     }



















   return(rates_total);

  }

//+------------------------------------------------------------------+

//| RSI STOCHASTOCK signal                                           |

//+------------------------------------------------------------------+

string rsistosignal(int x)

  {

   if(iRSI(Symbol(),PERIOD_CURRENT,14,PRICE_CLOSE,x)>70

      && (80<iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_EMA,0,MODE_MAIN,x)<iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_EMA,0,MODE_SIGNAL,x)))

     {

      return("SELL");

     }

   else

      if(iRSI(Symbol(),PERIOD_CURRENT,14,PRICE_CLOSE,x)<30

         && (iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_EMA,0,MODE_SIGNAL,x)<iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_EMA,0,MODE_MAIN,x)<20))

        {

         return("BUY");

        }



      else

         return("NO SIGNAL");







  }

//+------------------------------------------------------------------+


Files:
ruby.mq4  4 kb
 
  1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
              Messages Editor

  2.    for(int i = limit - count-1; i >= 0; i--)
    After the initial run, limit equals count and your loop does nothing.
              How to do your lookbacks correctly #9 - #14 & #19