I'm not sure where you see multiplication by 5, but the idea is to calculate for every major pair how it has been changing in past - this is done by ratio between two MAs - slow and fast. Then every major currency power is formed from the corresponding ratios for all pairs which contain specific currency. Minus 1 comes from the fact that we want to have a zero line for balance. In other words, if a pair is not changed, its ratio of fast and slow MAs will give 1. If it was rising it will give > 1, if it was falling < 1. We just transfer this > 1 and < 1 to > 0 and < 0 scale. This makes the sum of all changes (in different currencies) equal to 0!
Also you may see that if a pair contains usd as quoting currency (second), we calculate the ratio as fast/slow, and if usd is the base (first) - then the ratio is calculated as slow/fast.
Also the MAs are actually not a simple MAs but constructed from many MAs of different periods - this produces more weighted behaviour.
I'm not sure where you see multiplication by 5, but the idea is to calculate for every major pair how it has been changing in past - this is done by ratio between two MAs - slow and fast. Then every major currency power is formed from the corresponding ratios for all pairs which contain specific currency. Minus 1 comes from the fact that we want to have a zero line for balance. In other words, if a pair is not changed, its ratio of fast and slow MAs will give 1. If it was rising it will give > 1, if it was falling < 1. We just transfer this > 1 and < 1 to > 0 and < 0 scale. This makes the sum of all changes (in different currencies) equal to 0!
Also you may see that if a pair contains usd as quoting currency (second), we calculate the ratio as fast/slow, and if usd is the base (first) - then the ratio is calculated as slow/fast.
Also the MAs are actually not a simple MAs but constructed from many MAs of different periods - this produces more weighted behaviour.
Thanks for your response, I appreciate it very much.
I do agree in that I understand, for example in AUDUSD, the first math done is FAST moving avg (based on linear weight avg) divided by SLOW moving avg of AUDUSD. Then minus 1 or normalize it for a zero line balance. But what is done after, since that is not the end. Is that value then balanced with every other AUDXXX calculation as well or ??
You said something about the sum of all changes equalling 0..this may be what I am not understanding in how that is calculated particularly.
I do agree in that I understand, for example in AUDUSD, the first math done is FAST moving avg (based on linear weight avg) divided by SLOW moving avg of AUDUSD. Then minus 1 or normalize it for a zero line balance. But what is done after, since that is not the end. Is that value then balanced with every other AUDXXX calculation as well or ??
For the example of 4hr AUDUSD, does the following sequence of code take place?
1.
if(AUD) { double AUDUSD_Fast = ma("AUDUSD", Fast, MA_Method, Price, i); double AUDUSD_Slow = ma("AUDUSD", Slow, MA_Method, Price, i); if(!AUDUSD_Fast || !AUDUSD_Slow) break;2.
if(AUD) { arrAUD = 0; if(USD) arrAUD += AUDUSD_Fast / AUDUSD_Slow - 1;3.
//+------------------------------------------------------------------+ //| Subroutine | //+------------------------------------------------------------------+ double ma(string sym, int per, int Mode, int Price, int i) { double res = 0; int k = 1; int ma_shift = 0; int tf = 0; switch(Period()) case 240: res += iMA(sym, tf, per*k, ma_shift, Mode, Price,i); k += 6;
I hope that helps narrow down what I'm trying to understand. As in step 3, what is happening?
If you could break down the arithmetic/logic of this 4hr AUDUSD , I would greatly appreciate it.
This is very simple.
double ma(string sym, int per, int Mode, int Price, int i) { double res = 0; int k = 1; int ma_shift = 0; int tf = 0; switch(Period()) { case 1: res += iMA(sym, tf, per*k, ma_shift, Mode, Price,i); k += 5; case 5: res += iMA(sym, tf, per*k, ma_shift, Mode, Price,i); k += 3; case 15: res += iMA(sym, tf, per*k, ma_shift, Mode, Price,i); k += 2; case 30: res += iMA(sym, tf, per*k, ma_shift, Mode, Price,i); k += 2; case 60: res += iMA(sym, tf, per*k, ma_shift, Mode, Price,i); k += 4; case 240: res += iMA(sym, tf, per*k, ma_shift, Mode, Price,i); k += 6; case 1440: res += iMA(sym, tf, per*k, ma_shift, Mode, Price,i); k += 4; case 10080: res += iMA(sym, tf, per*k, ma_shift, Mode, Price,i); k += 4; case 43200: res += iMA(sym, tf, per*k, ma_shift, Mode, Price,i); } return(res); }
The author made this synthetic MA as combination of standard MAs from different periods from different timeframes. Whatever timeframe you use, the algorithm starts to calculate MA for that timeframe and then adds other parts from higher timeframes. This is done to make the synthetic MA behave more stable. Normally, when you use a single MA, it will have afteraffects, so to speak, that is every noticable increase will be followed by equally noticable fall (when old bars from MA period offset go out of the scope). The synthetic MA makes such falls less noticable.
When you use H4, the MA is calculated starting from the case 240 with given 'per', then another MA from "D1" (1440) case and period *7 is added and so on. Please note that the switch does not have breaks after each clause.
This is very simple.
The author made this synthetic MA as combination of standard MAs from different periods from different timeframes. Whatever timeframe you use, the algorithm starts to calculate MA for that timeframe and then adds other parts from higher timeframes. This is done to make the synthetic MA behave more stable. Normally, when you use a single MA, it will have afteraffects, so to speak, that is every noticable increase will be followed by equally noticable fall (when old bars from MA period offset go out of the scope). The synthetic MA makes such falls less noticable.
When you use H4, the MA is calculated starting from the case 240 with given 'per', then another MA from "D1" (1440) case and period *7 is added and so on. Please note that the switch does not have breaks after each clause.
This is very simple.
The author made this synthetic MA as combination of standard MAs from different periods from different timeframes. Whatever timeframe you use, the algorithm starts to calculate MA for that timeframe and then adds other parts from higher timeframes. This is done to make the synthetic MA behave more stable. Normally, when you use a single MA, it will have afteraffects, so to speak, that is every noticable increase will be followed by equally noticable fall (when old bars from MA period offset go out of the scope). The synthetic MA makes such falls less noticable.
When you use H4, the MA is calculated starting from the case 240 with given 'per', then another MA from "D1" (1440) case and period *7 is added and so on. Please note that the switch does not have breaks after each clause.
Hi again, Im having an issue still getting to what you mean at this part " Whatever timeframe you use, the algorithm starts to calculate MA for that timeframe and then adds other parts from higher timeframes."
Can you if possible show me the math of what exactly is going on for example the 4hr AUDUSD when calculating CFP? I would be greatly appreciative
Hi again, Im having an issue still getting to what you mean at this part " Whatever timeframe you use, the algorithm starts to calculate MA for that timeframe and then adds other parts from higher timeframes."
Can you if possible show me the math of what exactly is going on for example the 4hr AUDUSD when calculating CFP? I would be greatly appreciative

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Can anyone guide me in laymens terms what arithmetic is being done in the CFP indicator for mt4, for example for the AUDUSD pair's display.
eg. FAST MA divided by SLOW MA, then minus 1. Then multiplied by 5.... etc etc
Attached indicator from https://www.mql5.com/en/articles/1472
THANK YOU