I am trying to create original EA with MQL5, but iCustom function returns always 10.0.
Code :
Alert(MA1);
If I delete Custom Moving Average.ex5,iCustom always returns value of -1.0.
so, Custom Moving Average.ex5 seems to be read correctly.
iCustom uses an integer and returns the handle for processing not an indicator value, have a look here
https://www.mql5.com/en/docs/indicators/icustom
regards
![Documentation on MQL5: Technical Indicators / iCustom Documentation on MQL5: Technical Indicators / iCustom](https://c.mql5.com/36/34/documentation-on-mql5-technical__1.png)
- www.mql5.com
I am trying to create original EA with MQL5, but iCustom function returns always 10.0.
Code :
Alert(MA1);
If I delete Custom Moving Average.ex5,iCustom always returns value of -1.0.
so, Custom Moving Average.ex5 seems to be read correctly.
In MQL5, the indicator handle must be CREATED ONCE (in OnInit), and then (to obtain data) use CopyBuffer.
Example: iCustom
![Documentation on MQL5: Technical Indicators / iCustom Documentation on MQL5: Technical Indicators / iCustom](https://c.mql5.com/36/34/documentation-on-mql5-technical__2.png)
- www.mql5.com
In MQL5, the indicator handle must be CREATED ONCE (in OnInit), and then (to obtain data) use CopyBuffer.
Example: iCustom
Thanks to Vladimir Karputov and Paul Anscombe, I've resovled this problem.
Thank you very much!!
![Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions](https://c.mql5.com/36/34/documentation-on-mql5-constants__23.png)
- www.mql5.com
![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
I am trying to create original EA with MQL5, but iCustom function returns always 10.0.
Code :
double MA1 = iCustom("USDJPY",PERIOD_CURRENT,"Examples\\Custom Moving Average");Alert(MA1);
If I delete Custom Moving Average.ex5,iCustom always returns value of -1.0.
so, Custom Moving Average.ex5 seems to be read correctly.