Hi coders,
Is it possible to get a loop of a loop or multiple loops that to get the number of count ? Let me give a scenario :-
Firstly, for 100 bars, I want to get the count number of big bars that meeting my conditions for TF=60 (cntBigBarTF1).
Subsequently, from the 1st loop (TF=60), ONLY the "selected big bar" that meeting the required conditions will be used for lower TF=5's calculation, in order to get the count number of big bars for lower TF=5 (cntBigBarTF2).
How to merge the above 2 loops into one loop ? My ultimate target is to get the count number of lower TF=5 that meeting both loops' conditions. Kindly advise, thanks.
Is it possible to get a loop of a loop or multiple loops that to get the number of count ? Let me give a scenario :-
Inserted Code
int cntBigBarTF1=0; for(int i=1; i<=100; i++) { double cOp0=iOpen(symbol,60,i), cCs0=iClose(symbol,60,i), cATR0=iATR(symbol,60,5,i); if(MathAbs(cOp0-cCs0)>cATR0) cntBigBarTF1++; } int cntBigBarTF2=0; for(int i=??; i<=??; i++) { double cOp0=iOpen(symbol,5,i), cCs0=iClose(symbol,5,i), cATR0=iATR(symbol,5,5,i); if(MathAbs(cOp0-cCs0)>cATR0) cntBigBarTF2++; }
Firstly, for 100 bars, I want to get the count number of big bars that meeting my conditions for TF=60 (cntBigBarTF1).
Subsequently, from the 1st loop (TF=60), ONLY the "selected big bar" that meeting the required conditions will be used for lower TF=5's calculation, in order to get the count number of big bars for lower TF=5 (cntBigBarTF2).
How to merge the above 2 loops into one loop ? My ultimate target is to get the count number of lower TF=5 that meeting both loops' conditions. Kindly advise, thanks.