Stochastic oscillator is a momentum indicator within technical analysis that uses support and resistance levels as an oscillator. George Lane developed this indicator in the late 1950s. The term stochastic refers to the point of a current price in relation to its price range over a period of time. This method attempts to predict price turning points by comparing the closing price of a security to its price range.
The 5-period stochastic oscillator in a daily timeframe is defined as follows:
% D N = % K 1 + % K 2 + % K 3 + . . . % K N N {\displaystyle \%D_{N}={\frac {\%K_{1}+\%K_{2}+\%K_{3}+...\%K_{N}}{N}}}
where H i g h 5 {\displaystyle \mathrm {High} _{5}} and L o w 5 {\displaystyle \mathrm {Low} _{5}} are the highest and lowest prices in the last 5 days respectively, while %D is the N-day moving average of %K (the last N values of %K). Usually this is a simple moving average, but can be an exponential moving average for a less standardized weighting for more recent values. There is only one valid signal in working with %D alone — a divergence between %D and the analyzed security.