Indicator Load multiple times

 

Hello guys, I have an issue with calling an indicator in my EA.

It is loading multiple times as. I call this EA in a function as below:

void OnInit()
{

double BV(int buff,int shift){return(iCustom(_Symbol,0,"BetterVolume 1.4",NumberOfBars,MAPeriod,LookBack,buff,shift));}

)

///
///
///
 void OnTick()
{

   double red=BV(0,0); //Climax High
   double blue=BV(1,0); //Neutral
   double yellow=BV(2,0);//Low
   double green=BV(3,0);//HighChurn
   double white=BV(4,0);//ClimaxLow
   double magenta=BV(5,0);//ClimaxChurn
   double average=BV(6,0); //Average 

}

And when I test it on StrategyTester this indicator is loading multiple times. I have other indicators called in the same way, which loading correctly. What am I missing? 

What I have observed is that if I remove the inputs from iCustom it will only load once. input= NumberOfBars,MAPeriod,LookBack

How to call indicators in MQL5
How to call indicators in MQL5
  • www.mql5.com
With new version of MQL programming language available not only the approach of dealing with indicators have changed, but there are also new ways of how to create indicators. Furthermore, you have additional flexibility working with indicator's buffers - now you can specify the desired direction of indexing and get exactly as many indicator's values as you want. This article explains the basic methods of calling indicators and retrieving data from the indicator's buffers.
 
I use Amarket indicators, I can say that in principle there were no such critical moments and it is convenient to work with them.
 
Daniel Cioca:

Hello guys, I have an issue with calling an indicator in my EA.

It is loading multiple times as. I call this EA in a function as below:

And when I test it on StrategyTester this indicator is loading multiple times. I have other indicators called in the same way, which loading correctly. What am I missing? 

What I have observed is that if I remove the inputs from iCustom it will only load once. input= NumberOfBars,MAPeriod,LookBack

Hello Daniel, did you solve the problem. Because I'm getting the same issue... thanks
 
  1. Daniel Cioca:
    double BV(int buff,int shift){return(iCustom(_Symbol,0,"BetterVolume 1.4",NumberOfBars,MAPeriod,LookBack,buff,shift));}
    

    Why did you post your MT4 question in the MT5 EA section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.


  2. Daniel Cioca: What I have observed is that if I remove the inputs from iCustom it will only load once. input= NumberOfBars,MAPeriod,LookBack

    Then your call is wrong.

    Do you really expect an answer? There are no mind readers here and our crystal balls are cracked.
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem

    Where is the indicator code or a link to it?

 
Topic has been moved to the section: MQL4 e MetaTrader 4
 
William Roeder #:

You answered a two year old post!

 
Fernando Carreiro #: You answered a two year old post!
leandrogarrote 2023.05.20 17:37   Today.
Reason: