Download MetaTrader 5
To add comments, please log in or register
Follow the news. View our company's official channel!
Bro840
104
Bro840 2016.02.11 14:02 

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 

Ovo Cz
2951
Ovo Cz 2016.02.11 14:14  
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.
Bro840
104
Bro840 2016.02.11 14:48  

ok perfect!!!

 

thank you ;) 

/
To add comments, please log in or register