There are just too many mistakes in this code to be made by a human — Is this ChatGPT (or A.I.) generated code?
Please don't request help for ChatGPT (or other A.I.) generated code. It generates horrible code, mixing MQL4 and MQL5. Please use the Freelance section for such requests.
I did the code my self....
Then I suggest you reference the documentation because there are too many mistakes.
For example, all the functions like iClose, iHigh, iLow, etc. return individual data values, not handles to be used in CopyBuffer which is for use with Indicators.
If you want to copy arrays of data from Close, High, Low, etc. then use CopyClose, CopyHigh, CopyLow, etc.
Please read the following section of the documentation: Documentation on MQL5: Timeseries and Indicators Access
Also, before using array variables, you need to declare them.
When collecting data from indicators, like RSI, you should first obtain the handle from iRSI() function in the OnInit() event handler.
You should not be reading the handle every time in the OnTick(), and the handle is an integer not a double.
Do some research by reading related coding Articles for beginers while also having a look at examples in the CodeBase.
Then I suggest you reference the documentation because there are too many mistakes.
For example, all the functions like iClose, iHigh, iLow, etc. return individual data values, not handles to be used in CopyBuffer which is for use with Indicators.
If you want to copy arrays of data from Close, High, Low, etc. then use CopyClose, CopyHigh, CopyLow, etc.
Please read the following section of the documentation: Documentation on MQL5: Timeseries and Indicators Access
Also, before using array variables, you need to declare them.
When collecting data from indicators, like RSI, you should first obtain the handle from iRSI() function in the OnInit() event handler.
You should not be reading the handle every time in the OnTick(), and the handle is an integer not a double.
Do some research by reading related coding Articles for beginers while also having a look at examples in the CodeBase.
thank you was able to fix the issue
Why did you remove the code from your post?
Now this thread no longer makes any sense and any future readers will not be able to learn from it.
Please don't do that again in the future. Leave your posted questions and code intact. Don't remove it afterwards.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
In order to do so I have multiple arrays in place, with the largest being 90.
I keep going though the code but im not able to find what causes the error.
I would really apreciate the help
I'm even testing to see RSI value and it is 0..