DWMACD - Divergence Wave MACD. The indicator displays divergence by changing color of the MACD histogram. Only the last (current zero bar) is redrawn. The indicator is very simple to use and configure.
Buffer divergence №1 can also be used in Expert Advisors.
The indicator displays the following types of divergence (definitions from the code):
- #define MoveUp 1 - (Green) movement up, no divergence;
- #define MoveDn 2 - (Yellow) movement down, no divergence;
- #define MoveUpDiv 3 - (MediumTurquoise) movement up, simple divergence (on the basis of the 1 previous wave);
- #define MoveDnDiv 4 - (DarkOrange) movement down, simple divergence (on the basis of the 1 previous wave);
- #define MoveUpDivR 5 - (DodgerBlue) movement up, divergence (on the basis of realwavecount of tprevious waves);
- #define MoveDnDivR 6 - (OrangeRed) movement down, divergence (on the basis of realwavecount of previous waves);
- #define MoveUpDivBreak 7 - (Blue) movement up, divergence with the breakthrough (down wave on the histogram broke through the previous wave level);
- #define MoveDnDivBreak 8 - (Red) movement down, divergence with the breakthrough (up wave on the histogram broke through the previous wave level).
Divergence with the breakthrough demonstrated good results in the tester using this indicator, so it was included as a signal to the indicator.
The realwavecount parameter defines the number of previous waves on which the current wave divergence will be calculated. The parameter is used to increase the accuracy of calculations at strong and weak waves alternation (the situation does not correspond to an accurate wave labeling). Further use of a group of waves for divergence calculation proved its feasibility.
Signal line or values of the standard MACD histogram can be used for calculation. You can change the calculation using the linemode parameter.
The last parameter is the used price.
An important feature of the indicator is that a new wave begins with the second bar. I.e. when the histogram breaks through the zero line, the histogram will be colored in the "wrong" color. At first, it is a disadvantage. But the experience has shown that this wave calculation algorithm is more effective (there were 18 variants!). 2000 bars are used for the calculation.
The signals of this indicator are the signals of divergence. This is not necessarily a reversal, but just weakening of a trend. At other positive conditions you should enter the market according to this indicator when the divergence wave breaks through the zero line waiting for a long trend. It is also possible that an expected divergence is not justified and the price continues moving. It looks like the divergence color changes with the simple movement color on the histogram. In this case, the price will continue moving at least for one more wave (as a rule).
Note: the next divergence cancels the previous one!
In my opinion, the indicator demonstrates the best results with default settings, but you can find parameters more suitable for you.
Have a successful trading!