How Indicator performs when it's called by an EA

 

Hi all. 

 

So i would like to know how one Indicator performs when it's called by an EA.

For instance i have this line of code on OnTick() Function.

double Indicator = iCustom(NULL,0,"Indicator",0,1);

My indicator works in the following way:

First it runs all candles and makes all the necessaries calculation, then it only make calculations for the very first candles depending on some conditions but not all candles at all.

So my question is when i call my indicator from an EA on every tick like

double Indicator = iCustom(NULL,0,"Indicator",0,1);

it will be running the indicator from the begining every time? or it runs one time then works just like if it was dropped on one given chart and then just calculating the very first and important candles?

I want to know that because a matter of CPU performance consumption, energy and time.

 

Thank you 

 
It works the same way as if it was alone. The first iCustom calls OnInit and OnCalculate once. The next iCustom calls only the buffer value, until a new tick. With the new tick iCustom runs only OnCalculate, as the indicator stays initted.
 

ok perfect!!!

 

thank you ;)