Skip to content
ChartRiderDocs
Docs/Indicators/Stochastic

Stochastic

Stochastic oscillator with %K, smoothed %K and %D lines: where the close sits within the high-low range of the last candles, from 0 to 100.

Updated ·Markdown

What you see

Three lines in their own pane, %K, smoothed %K and %D, each with its own color, plus reference lines at 80 and 20. The pane scales to the lowest and highest %K and smoothed %K of the visible candles. With Period Smoothing at 1, smoothed %K equals %K and the two lines lie on top of each other. Green and red lines mark divergences between price and %D.

How it is calculated

  1. %K = 100 × (close − LL) / (HH − LL), where HH and LL are the highest high and lowest low of the last Period %K candles, the current one included. If HH equals LL, %K is 0.
  2. Smoothed %K: simple average of %K over Period Smoothing candles.
  3. %D: simple average of the smoothed %K over Period %D candles.

Smoothing 1 gives the "fast" stochastic; smoothing 3 gives the "slow" stochastic, whose %K is the fast %D. Divergences compare %D with the close, using Period %K as the swing window and the same rules as the RSI.

How to read it

  • %K crossing above %D below 20 is the classic buy signal, %K crossing below %D above 80 the classic sell signal.
  • Overbought and oversold readings can last a long time in trends; a trend filter helps.
  • Divergences between price and %D hint at a weakening move.

Using it in strategies

Outputs: k, smoothedK, d, and value, which is also %D. In the Trade Setup, "Compare" can check smoothedK against the line d; as a trigger it fires when smoothed %K moves above %D. "Range" or "Against" on d work as overbought/oversold filters. In WickScript, s = stoch(9, 1, 3) gives s.k (the smoothed %K) and s.d, e.g. s.k crosses above s.d. With use indicator "Stoch" with period 14, periodSmooth 3 as st you read st.k, st.smoothedK and st.d.

Settings

Open the settings with the slider icon next to the indicator (Indicators, F3). Numeric settings can be swept as Step 1 / Step 2 parameters when you run a strategy.

Inputs

SettingTypeDefaultDescription
Period %KNumber9Candles for the high-low range of %K. Also the swing window for divergence detection. (min 1)
Period %DNumber3Candles in the simple average that turns the smoothed %K into %D. (min 1)
Period SmoothingNumber1Candles in the simple average applied to %K (1 = fast stochastic, 3 = slow stochastic). (min 1)
HeightNumber50Height of the pane in pixels. (min 10)
Look Back RangeNumber2Candles after a swing point that are checked before the swing counts for a divergence. Higher values give fewer, later divergences. (min 1)

Styles

SettingTypeDefaultDescription
%D Line ColorColor#26bf8cff
%K Line ColorColor#6B3AD1ff
%K Smoothing Line ColorColor#9c7070ff
Line Color overboughtColor#bd1c1cffColor of the reference line at 80.
Line Color OversoldColor#5f38edffColor of the reference line at 20.

Outputs

These values can be used in Trade Setup triggers, filters and exits (see Trade Setup) and in WickScript.

OutputIn WickScriptDescription
valuevalue%D, the same line as d.
kkRaw %K.
smoothedKsmoothedK%K after the Period Smoothing average.
dd%D, the average of the smoothed %K.

Use in WickScript

use indicator creates this indicator inside a script, with settings by their ID. Each output is a field of the name after as. See WickScript indicators.

WickScript
wickscript 1
indicator "Stochastic from the list" in pane
use indicator "Stoch" with period 9 as myStoch
show myStoch.value as line "value"

Generated from the ChartRider source code on every release – settings, outputs and the WickScript reference always match the app.

Imprint·Privacy·Contact·Changelog·llms-full.txt

Paper trading uses play money only. Nothing in these docs is investment advice.