Hi Jorgen,

Since you have not explained in details what you "method" is I took your 
example as a proxy what it is all about. Your code says quite explicitly : for 
any higher timeframe CURRENT period take values from PREVIOUS higher timeframe 
periods  and add values from the current period but at the current lower 
resolution. That's what your code says and does when calculating Close for MA. 
I just made your code more efficient (it gives the same result) and compared 
the outcome (bright green color) to the outcome from the the "traditional" 
method (yellow color). For illustration purposes I marked higher timeframe bars 
(histogram) and indicated CLOSE from higher timeframe on lower timeframe (red 
color). This is all I have done.  The difference is quite explicit: MA does not 
wait till the end of the higher time period, but includes current lower 
timeframe values. Therefor MA is either lower (down trend) or higher (up trend) 
when comparing to traditional method. The alternative method would be to 
calculate MA on lower timeframe equivalent to period = Period of the higher 
timeframe  * (interval of the higher timeframe / interval of the lower 
timeframe) eg. MA(C,10) on 15min chart would be equivalent to MA(c,150) on 1min 
chart.

Regards,

AF  

Reply via email to