array out of range error - Creating an object using the indicator

You are missing trading opportunities:
- Free trading apps
- Free Forex VPS for 24 hours
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
This text has been translated with the help of Google Translate, so I hope you understand what I mean.
This error occurs due to the execution of the following code. As you can see, I also used the do while loop to ensure that this command is executed correctly, but the situation got worse. That means the whole program failed.
main code :
If you have a better idea to implement this program, please send your comment.
thank you for your time.