Skip to main content

Stochastic Oscillator in the Trade Rule Block

Stochastic Oscillator measures momentum and overbought/oversold levels based on recent high-low price ranges.

Updated over 4 months ago

Purpose of the Stochastic Oscillator

The Stochastic Oscillator measures the momentum of price, showing the position of the closing price relative to the high-low range over a set period. It helps identify overbought/oversold conditions and potential trend reversals.


How It Works

When you select Stochastic Oscillator in the Trade Rule block, you can configure it as follows:

  1. %K Line Period

    • The number of candles used to calculate the raw stochastic value.

    • Shorter periods = more sensitive to price changes.

  2. %D Line Period

    • The moving average of the %K line, smoothing the signal.

    • Often used to identify crossovers for trading signals.

  3. Slowing Value

    • Additional smoothing applied to the %K line before comparing to %D.

    • Helps reduce false signals in volatile markets.


Advanced Options

  1. MA Method

    • Method used for smoothing (Simple, Exponential, Smoothed, Weighted).

    • Simple: Equal weight to all values.

    • Exponential: More weight on recent data.

    • Smoothed: Longer-term smoothing with reduced noise.

    • Weighted: Highest weight on the most recent data, decreasing linearly.

  2. Price Field (Basis for the calculation)

    • Common options include Low/High, Close/Close, etc.

    • Determines which prices form the high-low range for %K calculation.

  3. Mode

    • Main Line: The %K line value.

    • Signal Line: The %D line value (smoothed %K).

  4. Time Frame

    • Choose the chart time frame for calculation.

    • Can be replaced with a variable or input for flexible testing.

  5. Candle ID

    • 0 – Current forming candle.

    • 1 – Most recently closed candle.

    • Higher IDs = older candles.


Adjust

  • Apply modifications to the final value: add, subtract, multiply, or divide by a chosen number.


Example

If you set:

  • %K Period: 5

  • %D Period: 3

  • Slowing: 3

  • Mode: Main Line

  • Price Field: Low/High

  • Candle ID: 1
    You get the stochastic %K value of the last closed candle, smoothed and calculated from the highest high and lowest low over the past 5 candles.


Use Cases

  • Identify overbought/oversold zones (commonly above 80 or below 20).

  • Trade crossovers between %K and %D lines.

  • Combine with trend filters to avoid false signals.


⚠ Tip: Works best in ranging markets; combine with trend indicators to avoid whipsaws in strong trends.

Did this answer your question?