Skip to content
All library documents

KDJ Oscillator: Calculating K, D, and J from Recent Price Range

Article MQL5 code base

Summary

The document explains the KDJ oscillator as a tool for identifying potential market entry conditions. It defines the raw stochastic value (RSV) as the close's position within the highest-to-lowest price range over a chosen period, scaled to 100. K and D are smoothed recursively using their prior values and the RSV or K value, while J is derived from the difference between D and K.

The indicator exposes four inputs: the lookback period, coefficients for the K and D calculations, and a threshold signal line. The text does not specify recommended settings, exact threshold rules, or a complete entry or exit strategy. It presents the indicator's calculation rather than evidence of trading performance, so it does not establish that KDJ signals are profitable or reliable across markets.

Key ideas

  • RSV measures the close relative to the recent high-low range and scales that position to 100.
  • K and D are smoothed recursively using prior values and current inputs.
  • J is calculated as three times D minus two times K.
  • The indicator provides a threshold input but does not explain a complete trading rule.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.