Having trouble making a MTF Moving Average. Tried a few things, but still struggling.
Some one please help me out. Much thanks appreciated!
- Compute your limit. That is the current chart's index. Use iBarShift(TimeFrame) to find the index on the TimeFrame chart. Get that bar's time and use iBarShift(PERIOD_CURRENT) to find the real limit. You have to re-process all bars that are part of TimeFrame bar zero, the stair step effect.
- In your loop, for each i, use iBarShift to find the index on the TimeFrame chart and get the value from there.
- Compute your lookbacks correctly. For TFMA it is not MA_Period it is MA_Period * PeriodSeconds(TimeFrame) /
PeriodSeconds(PERIOD_CURRENT)
How to do your lookbacks correctly.