Issue reading custom indicator via iCustom in EA (MT5)
Your indicator is not working. Drop this code:
You must use the 'open', 'high', 'low', 'close' arrays from Oncalculate:
int OnCalculate ( const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[])
Arturo Lopez Perez:
However, when I try to read from any buffer on shift 1, it always returns zero. All the time.
The CopyBuffer call always stores zero, not the actual value.
You don't create the handle for the indicator.
int init() { devhandle = iCustom(_Symbol, _Period, "PZ_DeviationFromOpen", "--", DevPeriod); if(devhandle == INVALID_HANDLE) { Print("DevHandle failed"); return(INIT_FAILED); } return(0); }
This is a function that you have created and is not called anywhere.
You should use OnInit().

Hi Everyone,
I hope you are all fine. I am having an issue reading from a custom indicator I just made and for the life of me, I can't figure it out. The indicator I am trying to read from is the following.
The indicator runs fine, no issues.
However, when I try to read from any buffer on shift 1, it always returns zero. All the time.
The CopyBuffer call always stores zero, not the actual value.
I would greatly appreciate your help.
Many thanks in advance.