Hello! Could you help me to detect the error in line 78 of the mql5 code below (Thank you in advance):
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots 2
// Indicator parameters
input int RSI_Period = 14;
input int Buy_Level = 30;
input int Sell_Level = 70;
input string Push_Notif_Title = "RSI Alert";
input string Push_Notif_Buy = "RSI Buy Signal";
input string Push_Notif_Sell = "RSI Sell Signal";
// Indicator buffers
double RSI_Buffer[];
double Level_Buffer[];
// Handle for push notification
int Push_Notif_Handle;
// Indicator initialization function
int OnInit()
{
// Define the properties of indicator buffers
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(0, RSI_Buffer);
SetIndexLabel(0, "RSI");
SetIndexDrawBegin(0, RSI_Period);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(1, Level_Buffer);
SetIndexLabel(1, "Level");
SetIndexDrawBegin(1, RSI_Period);
// Create the push notification
Push_Notif_Handle = PushNotificationCreate();
// Returns "true" to indicate successful initialization
return (INIT_SUCCEEDED);
}
// Indicator calculation 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[])
{
// Calculate the RSI for each bar
ArraySetAsSeries(RSI_Buffer, true);
ArraySetAsSeries(Level_Buffer, true);
int limit = rates_total - prev_calculated;
for (int i = limit; i >= 0; i--)
{
RSI_Buffer[i] = iRSI(NULL, 0, RSI_Period, PRICE_CLOSE, i);
Level_Buffer[i] = Buy_Level;
if (RSI_Buffer[i] >= Sell_Level)
{
Level_Buffer[i] = Sell_Level;
// Send a push notification if the RSI reaches the defined sell level
PushNotificationSend(Push_Notif_Handle, Push_Notif_Title, Push_Notif_Sell);
}
else if (RSI_Buffer[i] <= Buy_Level)
{
Level_Buffer[i] = Buy_Level;
// Send a push notification if the RSI reaches the defined buy level
PushNotificationSend(Push_Notif_Handle, Push_Notif_Title, Push_Notif_Buy);
}
}
// Returns "rates_total" to indicate that the calculation was successful
return (rates_total);
}