## What is a Stochastic Oscillator?

The stochastic oscillator is a momentum indicator comparing the closing price of a security to the range of its prices over a certain period of time. The sensitivity of the oscillator to market movements is reducible by adjusting that time period or by taking a moving average of the result. The stochastic oscillator can play in identifying overbought and oversold levels because it is range-bound. This range – from 0 to 100 – will remain constant, no matter how quickly or slowly a security advances or declines.

Considering the most traditional settings for the oscillator, 20 is typically considered the oversold threshold and 80 is considered the overbought threshold. However, the levels are adjustable to fit security characteristics and analytical needs. Readings above 80 indicate a security is trading near the top of its high-low range; readings below 20 indicate the security is trading near the bottom of its high-low range.

The general theory serving as the foundation for this indicator is that in a market trending upward, prices will close near the high, and in a market trending downward, prices close near the low. Transaction signals are created when the %K crosses through a three-period moving average, which is called the %D.

## Stochastic Oscillator Indicator

The Stochastic Oscillator is a momentum indicator. It compares a specific closing price of a financial asset, to a range of its prices over a time period. It is a popular technical indicator for generating overbought and oversold signals.

The theory behind this indicator is that in a market trending upward, prices will close near the high, and in a market trending downward, prices close near the low.

## How To Calculate The Stochastic Oscillator Indicator

Formula:- First the function computes some basic parameters:

• hh = highest(high, period)
• ll = lowest(low, period)
• knum = close – ll
• kden = hh – ll

The function then uses the above to compute the 3 outputs as below

• %k = 100 * (knum / kden)
• %d = MovingAverage(k, period_dfast)
• %d-slow = MovingAverage(d, period_dslow)

## Why Use The Stochastic Oscillator

The stochastic oscillator is range-bound, and it always ranges between 0 and 100. Generally, all readings over 80 are considered in the overbought range, and all readings under 20 are considered oversold. It is used by many traders, generally over a 14-day period, and it reflects the consistency with which the price closes near its recent high or low.

## How to Use The Stochastic Oscillator Trading Strategy

Bullish Scenario:- Stochastic Indicator being a momentum and range bound indicator i.e. it moves only between 0 and 100, it becomes easier to generate buy and sell signals. If the value given by the indicator is increasing it generally shows an uptrend hence a bullish scenario.

Bearish Scenario:- Similarly If the value given by the indicator is decreasing it generally shows a downtrend hence a bearish scenario.

Note:- A value over 80 is generally considered as an overbought situation whereas a value below 20 is considered an oversold situation.

## Building Stochastic Oscillator Trading Strategy in Mudrex

Strategy:-

SELL:- SO crosses down 25

TIME FRAME:- 6Hrs

### Creating on Mudrex:-

We will use 2 SO indicator blocks. One for selling and One for buying.

For buying we will use the following settings:-

For selling we will use the following settings:-

Final Strategy:-

Testing:-

Running on Binance Futures: BTC/USDT with tick interval of 6H yielded an overall profit of 109.25%