Algorithm/Timeframes problem - page 2

 
WHRoeder:
  1. athanfx: Why not? 
    What part of "because of possible missing bars." is not clear. If you have 25 M1 bars covering one M30 bar, then M1(i+30) means you are looking at a M1 bar beyond the M30 bar.
  2. athanfx: Now my main problem is how to check if the M1 bar is between the i bar
    In the code I postedALL OF THE BARS (iM1Beg to iM1End inclusive) were inside the higher TF bar.
Asked and Answered.

Thanks a lot for your answer. This code really helped me understand how stuff works.

i finally didnt use any for loop and i only used a while loop in order to avoid any missing bars  in the history (cause of the broker but Weekens as well).

Now what i m trying to achieve is to create a loop and make calculations based on a specific number of period bars (like MAs, RSI etc). Is there anywhere any sample on how to do that? 
My main issue is that i m calculating the custom indicator out of 1M bars no matter what TF i m looking at.  

Reason: