Possible? -> Call same indicator with iCustom()

 
Hello, is it possible to call the same indicator with iCustom(), for calluculating another Timeframe, in my Test the CPU from the PC is going to high and not possible
 

I would think "possible" but have never tried it, but...

If you start your indicator,

which starts your indicator,

which starts your indicator,

which starts your indicator,

which starts your indicator,

...

 

I have also think so its possible, but it dont looks like.

example indivators "abc.ex4" in the start() function i have just tried to call one time with iCustom() the same indicator also again "abc.ex4" but without any result the CPU from the PC is just to high and nothing happend just must close terminal.exe by task manager.

Also it looks like not possible.

 

Endless loop, opening more and more instances of same indicator, and never finishing, in the simple case.


---

write your calculation as a function, and call that...

(simplified sample)
start(){
   for(i = bars, i >=0 i--){
      index0[i] = MyIndicator(5m);
      index1[i] = MyIndicator(15m);
   }
return(0);
 
double MyIndicator(int timeFrame){
   ...
   ...
   return( value);
}
 
phy:

Endless loop, opening more and more instances of same indicator, and never finishing, in the simple case.


---

write your calculation as a function, and call that...

(simplified sample)

start(){

for(i = bars, i >=0 i--){

index0[i] = MyIndicator(5m);

index1[i] = MyIndicator(15m);

}

return(0);

double MyIndicator(int timeFrame){

...

...

return( value);

}


Ok, with a script thats no problem, execuse me, my english is again to bad to explain better what I mean.

I have trie to call in the sorcecode from the same indicator it slft again.

example "abc indicator" code:

start()

{

double value = iCustom(other,"abc indicator,other,other...);

}

Understanding? It ist the same indicator .... noe script ;-)

And it dont works, if I call it so, the cpu is to high without result.

I say it again, i dont want to call from a script, i want to call from a indicator, but from it same indicator :-).

 

There certainly is another way to write the code.

What are you trying to do?

 
phy:

There certainly is another way to write the code.

What are you trying to do?


I have some calulations in the indicator which i want to make for other Timeframes to, but I dont want to write so much code for that and have think if it is not better to call the indicator by it self with iCustom() to calculate the oter Timeframes, but if I trie the terminal high the CPU and it is not possible.

Now I think without writing more code for the other Timeframes it isnot possible...

Reason: