It seems you are relying on ChatGPT. Don't!
Instead, reference the documentation or the book.
Indicator functions return a handle, not the buffer data. You do in fact declare handles, but then don't assign me. A clear sign that you are using ChatGPT for the skeleton code.
// Indicator handles for RSI and MA int RSI_Handle, MA_Handle;
Please read the documentation for iRSI() and the CopyBuffer() function to retrieve the buffer values.

Documentation on MQL5: Timeseries and Indicators Access / CopyBuffer
- www.mql5.com
Gets data of a specified buffer of a certain indicator in the necessary quantity. Counting of elements of copied data (indicator buffer with the...
Hi
In mql5 the functions for indicators like iRSI, iMA etc, return only handle for the indicator values. You should initialize those handles in the OnInit function and then use CopyBuffer to get the data from chosen index. So move iRSI to the OnInit and in the OnCalculate use this instead:
RSI_Buffer[i]=getRSI(i); double getRSI(int i){ double res[]; ResetLastError(); if(CopyBuffer(RSI_Handle, 0, i,1,res)<0 ){ Print("Error copying RSI data for buffer - error:"+IntegerToString(GetLastError())+"!!"); return(0); } return(norm(res[0])); }
Have a nice day👍📊

You are missing trading opportunities:
- Free trading apps
- 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
I took my own crack at coding today. This is supposed to be an indicator that connects BB and an EMA to the RSI indicator data that will be displayed in one indicator window.
However, after fixing all of the errors Meta Editor has given me, the indicator window shows up blank on my chart.
When I look at the data window, the value just shows 10.000000000.
What seems to be the problem? is it just crap code or what?