MT5: The indicator does not work after the first candlestick (Hull Moving Average)

 
Hello to the forum
I recently learned the mql5 programming language.
I needed to create a Hall Moving Average indicator with the ability to adjust the average type.
I made it with difficulty, but the indicator does not draw the next points after the first candlestick.
Can anyone help me?
 

There is an error on line 144.

2021.06.11 22:32:09.871 Infinity_Hull_Moving_Average_V1.01 (GBPJPY,M1) array out of range in 'Infinity_Hull_Moving_Average_V1.01.mq5' (144,21)

Fix it as follows

for(int a = 0; a < rates_total - 1 && !IsStopped(); a++)
{
   hullc[a] = hullc[a + 1];
   if (hull[a] > hull[a + 1]) hullc[a] = 1;
   if (hull[a] < hull[a + 1]) hullc[a] = 0;
}



 
Nagisa Unada:

There is an error on line 144.

2021.06.11 22:32:09.871 Infinity_Hull_Moving_Average_V1.01 (GBPJPY,M1) array out of range in 'Infinity_Hull_Moving_Average_V1.01.mq5' (144,21)

Fix it as follows



Thanks dear
Reason: