Handling Array out of range

 
Is it a good practice to set a random large size for your arrays, 
I'm converting an indicator from mt4 to mt5, the code compiles with 0 warning ⚠️ and 0 errors. But the expert tab screens array our of range. 
I don't seem to understand exactly what's wrong. What's your advice on this
Files:
 
Fela Fomonyuy: Is it a good practice to set a random large size for your arrays, 
I'm converting an indicator from mt4 to mt5, the code compiles with 0 warning ⚠️ and 0 errors. But the expert tab screens array our of range. 
I don't seem to understand exactly what's wrong. What's your advice on this

No! The good practice is properly identifying the indexing range for arrays. And in the case of non-buffers, to correctly sizing them as required.

EDIT: If you need further guidance, show your code.

 

Attached below is the code file 

And a screenshot of the specific line 

Files:
177_095854.PNG  38 kb
chart.mq5  20 kb
 
"Array out of range" is a Runtime error when an Array created then you called that Array out of it's 'index'. So if your all Syntaxes are ok then there will be no 'Compilation Error'. So carefully check your all Arrays/Buffers where you called it out of index. Example, you declared an array where it's size is 10. So you can call this array start from 0 to 9. If you call index below 0 or above 9 then you'll get Array out of range error.
 
Mahadi Hasan Razu #:
"Array out of range" is a Runtime error when an Array created then you called that Array out of it's 'index'. So if your all Syntaxes are ok then there will be no 'Compilation Error'. So carefully check your all Arrays/Buffers where you called it out of index. Example, you declared an array where it's size is 10. So you can call this array start from 0 to 9. If you call index below 0 or above 9 then you'll get Array out of range error.
Let me check through 
 
Fela Fomonyuy #:
Let me check through 
Fela Fomonyuy #:
Let me check through 
Just a follow up. I did notice after some research, resizing the arrays fixed the runtime error but another issues is up. The indicator is removed from the chart after a few seconds. It doesn't throw any error message. After a few seconds it's removed from the charts.  
Files:
problem.PNG  100 kb
compiled.PNG  97 kb