I'm developing an EA, I'm reading a custom indicator using iCustom as the usual, but it creates multiple instances of the same indicator at backtest.
Usual issue, indicator works absolutely fine when applied to a chart, however when i attempt to use via iCustom in an EA I have multiple instances being applied on my back testing. Could you help me?
Indicator Corola
EA
Finally start reading the help. In MQL5, the indicator handle SHOULD BE CREATED ONLY ONCE !!! The indicator handle is created in OnInit ().
Finally start reading the help. In MQL5, the indicator handle SHOULD BE CREATED ONLY ONCE !!! The indicator handle is created in OnInit ().
Didn´t work!
Didn´t work!
If it didn’t work, then you didn’t do anything.
Please attach ( ) two files: the indicator file and the FIXED advisor file.
Se não funcionou, você não fez nada.
Anexe ( ) dois arquivos: o arquivo do indicador e o arquivo do orientador FIXED.
I attached the files, can you help or not?
Correct your code:
//+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int OnInit() { int CorrelationDefination=iCustom(NULL,Period(),"Corola.ex5",20,40,PRICE_CLOSE); return(INIT_SUCCEEDED); } void OnTick() { string signal=""; double short_period[]; double long_period[]; ArraySetAsSeries(long_period,true); ArraySetAsSeries(short_period,true); CopyBuffer(CorrelationDefination,0,0,3,short_period); CopyBuffer(CorrelationDefination,1,0,3,long_period); double shortValue0=short_period[0]; double longValue0=long_period[0]; double shortValue1=short_period[1]; double longValue1=long_period[1]; if(longValue0<-0.8&&shortValue0<-0.8) if((shortValue0<longValue0) && (shortValue1>longValue1)) { signal="Buy"; } if(longValue0>0.8&&shortValue0>0.8) if((shortValue0>longValue0) && (shortValue1<longValue1)) { signal="Sell"; } Comment("Signal: ",signal); } //+------------------------------------------------------------------+
Read the help ( iCustom ). Correct the mistake. Your code won't compile.
Read the help. Look at the code formatting rules - don't be lazy and add the file name. Example:
//+------------------------------------------------------------------+ //| Accelerator.mq5 | //| Copyright 2009-2017, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "2009-2017, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property description "Accelerator/Decelerator" //---- indicator settings #property indicator_separate_window #property indicator_buffers 6 #property indicator_plots 1 #property indicator_type1 DRAW_COLOR_HISTOGRAM #property indicator_color1 Green,Red #property indicator_width1 2 #property indicator_label1 "AC" //--- indicator buffers double ExtACBuffer[]; double ExtColorBuffer[]; double ExtFastBuffer[]; double ExtSlowBuffer[]; double ExtAOBuffer[]; double ExtSMABuffer[]; //--- handles for MAs int ExtFastSMAHandle; int ExtSlowSMAHandle; //--- bars minimum for calculation #define DATA_LIMIT 37 //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnInit() {

- www.mql5.com
Correct your code:
Read the help ( iCustom ). Correct the mistake. Your code won't compile. Read the help. Look at the code formatting rules - don't be lazy and add the file name. Example:
Lazy??? Are you kidding??? If I knew the answer and had no doubts I wouldn't be in this forum. In fact, there would be no need for a forum if everyone knew everything.If you don't want to help, don't disturb
Just to remind -
Forum on trading, automated trading systems and testing trading strategies
Please fix this indicator or EA
Sergey Golubev, 2017.03.24 07:23
And this is my other suggestion (which came from tsd 2010 and from tsd 2008):
----------------
Just to remind:
Coders (any coder) are coding for free:
- if it is interesting for them personally, or
- if it is interesting for many members of this forum.
and Freelance section of the forum should be used in most of the cases.
Só para lembrar -
Just to remind:
My code works, ok!!!?I attached.
And what's the difference with this post https://www.mql5.com/en/forum/217617 ???????? AND THIS https://www.mql5.com/en/forum/329733 ?????
Good Job !!!

- 2017.10.16
- www.mql5.com
Lazy??? Are you kidding??? If I knew the answer and had no doubts I wouldn't be in this forum. In fact, there would be no need for a forum if everyone knew everything. If you don't want to help, don't disturb
I advise you to communicate correctly.
Your actions: compile -> see if there are any errors?
And the error is:
Click the error and the cursor will move to the code (to the line in the code where this error is) - you refer to the 'CorrelationDefination' variable - but this variable is not declared anywhere.

- www.mql5.com

- 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'm developing an EA, I'm reading a custom indicator using iCustom as the usual, but it creates multiple instances of the same indicator at backtest.
Usual issue, indicator works absolutely fine when applied to a chart, however when i attempt to use via iCustom in an EA I have multiple instances being applied on my back testing. Could you help me?
Indicator Corola
EA