Stochastic Trading Oscillator

Learn about the stochastic indicator, and it’s use in the MarketGod Trading Series

In efforts to lead into a series of posts detailing the MarketGodPro Indicator, and the components involved with the MarketGod Series, we will be covering the fundamental components involved with the decision making you see on the indicator itself. Today, we cover one of several components in this series, the stochastic oscillator. We have also covered the MACD trading indicator, which you can read about here


            Most available financial resources state that the stochastic indicator has been developed by Dr. George Lane during his time working for Investment Educators in the 1950’s. However, some sources claim that the oscillator was a discovery made by Ralph Dyant, then head of Investment Educators, or even by some other colleague at the firm or one of their relatives. The stochastic compares a stock closing price to its price range over a certain period of time (analysts conventionally use 14 periods as the default setting for the stochastic oscillator).  Depending on the analysis objectives, the time period could be set as days, weeks, or even months for an analyst willing to get a long-term view. A trader can also use an intraday timeframe.

The Stochastic Oscillator, via


            The stochastic oscillator is a momentum indicator using support and resistance levels and refers to the position of the closing price in relationship to the price range over a period of time. It is calculated as the difference between the close and the low, divided by the price range (the difference between the high and low over a certain period of time). The result is noted %K, and for a 14-period %K, an analyst would use the most recent close and the absolute high and low over the 14-period preceding the analysis. Thus, the indicator takes a value between 0 and 1 and is expressed in percentage points. An additional line is plotted against %K acting as a trigger line and denoted %D.  %D is just the 3-day simple moving average of %K.

Above: Source Code for the Stochastic Indicator, as seen in’s native programming language, PineScript.


            The stochastic oscillator measures the position of the close relative to the high-low range over the chosen timeframe. A reading over 50% indicates that the close is somewhere in the upper half of the high-low range, whereas a reading under 50% indicates that the close is somewhere in the lower half of that range. A stochastic value over 80% indicates that the security is overbought and a crossover below that threshold represents a potential sell signal while a value below 20% indicates that the security is oversold and a crossover above that threshold indicates a potential buy signal. However, this indicator needs to be considered in conjunction with other indicators to provide meaningful insights. In fact, a reading over 80% could not be considered as a sell signal at all times, as securities can, at times, keep being overbought for a long period during a sustained uptrend.

Stochastic & MarketGod

The stochastic plays a major role in all major versions of the MarketGod Trading Series. From the original through v6.2 (current version), we use the stochastic oscillator, specifically the ‘%K’ plays a core component in the success of interpreting incoming price action in the indicator. %K is typically a leading indicator, and provides a confirmed movement in a given direction. We use this to our advantage by also using variations of the %K through indicators such as the Stochastic RSI and KDJ indicators which we will go more in depth with during this series of postings.