![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I think the missing break is not an error. It is done intentionally to add the values for higher timeframes as well by continuing down to the following cases.
But I think there is another error. After each call to iMA(), k is updated using '+=' operator. I think it should be '*='. As the higher timeframe should be calculated by multiplying the current time frame by a number. So if the current timeframe is H4, k should change as k *= 6 to calculate D1 from it. Also for case 1440: the multiplier should be 5 (not 4) as there are 5 daily bars in a week.
In my opinion, the algorithm of the indicator is right, nothing to be changed. The smaller the timeframe, the more bars that are used on the calculation, what makes sense to me.
I would have done it other way, using "break" on the switch statements, and modifying the period depending on the current timeframe the number of bars, to avoid calling so many times iMA() when using small timeframes for each bar. But anyway, it works the way it is.
I have modified the code to cope with the new MQL4. But indicator values are exactly the same as on the original CCFp.mq4.
List of changes:
I have left the copyright values to the original author, and change the link to this article on mql5.com.
Hi it seems the author has removed the links to download the indicators. I can't find them in the OP.
It's in the first post. Links are underlined.
This will take you to the relevant page