Need some help for multiTF iCustom calculation

 

Hello,


i want to make my code a little softier. I have a lot of iCustom calculation on several TF and want to improve algorithm by putting all these calculation in a FOR operator.


I have :

ind30b0=Icustom(); //ind TF30 bar 0

ind30b1=Icustom(); //ind TF30 bar 1

ind15b0=Icustom(); //ind TF15 bar 0

ind15b1=Icustom(); //ind TF15 bar 1

etc....


I want to make the algorithm like that :

for (i=1;i<4;i++) 
   {
    switch(i)
     {
      case 1:TF=30;
      case 2:TF=15;
      case 3:TF=5;
     }
    name of indic = Icustom calculation with selected TF
   }

I'm a little stuck with the name of the different calculated indicators because they are double variables so i can't change name easily. I think of using a function but it's fuzzy for me....

I don't code writed but some clues and help on the new algorithm or a link to an article describing this. Searched across mql4 site and found nothing.


Thanks for advance,

Dam.

 
damtoul:

Hello,


i want to make my code a little softier. I have a lot of iCustom calculation on several TF and want to improve algorithm by putting all these calculation in a FOR operator.


I have :


I want to make the algorithm like that :

I'm a little stuck with the name of the different calculated indicators because they are double variables so i can't change name easily. I think of using a function but it's fuzzy for me....

I don't code writed but some clues and help on the new algorithm or a link to an article describing this. Searched across mql4 site and found nothing.


Thanks for advance,

Dam.

Ok forget that post. It works perfectly with a for operator && function call.