RSI alert ERROR in MT5!

 

Hi!

 

I need a simple RSI alert ea in MT5: if the RSI is higher than 70 or lower than 30 then it makes an alert!

I've tried to make it, but it's not working properly:


 

input int RSI_Upper_Level = 70;
input int RSI_Lower_Level = 30;

//+------------------------------------------------------------------+
int OnInit()
  {
//---
double RSI_0 = iCustom(NULL,0,"Examples\Custom RSI",14,PRICE_CLOSE,0);
double RSI_1 = iCustom(NULL,0,"Examples\Custom RSI",14,PRICE_CLOSE,1);

if((RSI_0 > RSI_Lower_Level) && (RSI_1 <= RSI_Lower_Level)) Alert("RSI more than 70!!"); // coming up thru

if((RSI_0 < RSI_Upper_Level) && (RSI_1 >= RSI_Upper_Level)) Alert("RSI less than 30!!"); // going down thru

//---
   return(INIT_SUCCEEDED);
  }

 

 

I am not a programmer, can you help me, please ?

 

Thank You! 

 

iCustom return an int, not a double. Check documentation.

See Freelance section.