MaxHigh (the highest high) and MinLow (the lowest Low) are determined in the specified KdjPeriod interval. Thus, MaxHigh minus MinLow will be equal to the height of the selected KdjPeriod interval. Next, we determine the distance between the Close price of the current bar and MinLow as a percentage of the height of the selected KdjPeriod interval. It is the base RSV line.
By averaging the base RSV line with the M1 period, we obtain a smoothed K line. By averaging the smoothed K line with the M2 period, we obtain a smoothed D line. The difference between the K line and the D line gives the KDC histogram.
Compare KDJ Indicator and MACD:
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/19476
The Expert Advisor trades based on iMA and iRSI signals. Values of iMA on four bars are compared. Indices of these bars can be optimized.Billy expert
A trading strategy "three bars down, Stochastic up".