Multiple indicator loads when calling throw iCustom function

 
"I am using the iCustom function to call different indicators in an EA. Some indicators work perfectly, but others like the 'kaufman_ama_averages_filtered_ATR bands' load multiple times within the chart, which slows down the processing as it performs the same calculation hundreds of times. I wanted to know if there is any way to load this indicator only once when incorporating it into the EA. Thank you."
 
Please don't post randomly in any section. Your topic has been moved to the section: Expert Advisors and Automated Trading
 

We cannot read your mind nor see your computer. We have no idea about said indicator if you don't reference it — kaufman_ama_averages_filtered_ATR bands

I could find no mention of it in the CodeBase and I found only one indirect mention in the forum, but it refers to MQL4 and not MQL5 — MQL4 iCustom is giving wrong output

Should your question be about MQL4, then I will be moving this thread again as MQL4 and MetaTrader 4, has it's own section on the forum.

If you need help with your code, the please show your code and reference all the necessary details.

 
 Media= iCustom(NULL, 0, "kaufman_ama_averages_filtered_ATR bands", "",14,"",2,30,2.0,5,"", "", 0,1);

 if(OperacionesAbiertas()==0)
 {
     if(Open[1]<Media && Close[1]>Media)//Si precio cierra por encima de media
     if(Macierrecompra()==false)// si no se cumple condición de cierre
      {
       OrderSend(NULL,OP_BUY,Lot,Ask,5,0, 0,"Comment",Magic,clrGreen);//Ejecuto compra
      }
       if(Open[1]>Media && Close[1]<Media )//Si precio cierra por debajo de media
       if(Macierreventa()==false)// si no se cumple condición de cierre
      {
       OrderSend(NULL,OP_SELL,Lot,Bid,5,0, 0,"Comment",Magic,clrRed); //Ejecuto venta
      }
 } 
Files:
indicadores.jpg  146 kb
 

Your topic has been moved to the section: MQL4 e MetaTrader 4

I have edited your improperly formatted code because it was short, but in the future please EDIT your post and use the CODE button (Alt-S) when inserting code.

Code button in editor

 
leandrogarrote #:

You have not provided a reference to the "kaufman_ama_averages_filtered_ATR bands" source code as requested.

The code sample you supplied is also incomplete and we cannot see how it is called.

Please provide some example code that can be tested for the issue to be reproduced.

But, remember you need to provide a reference for "kaufman_ama_averages_filtered_ATR bands". We have no ideia how it is implemented.

Reason: