Alert Setup Guide

How to Set Stochastic Alerts: %K, %D and Thresholds

Configure Stochastic threshold and line-cross alerts, distinguish event frequency from intrabar changes, and check the oscillator settings.

Setup Steps

1

Identify %K and %D

Add the Stochastic oscillator, not Stochastic RSI. Record %K lookback, its smoothing and %D length. The usual 14/3/3 setting describes three separate parameters. The oscillator compares the close with a recent high-low range; %D smooths %K.

2

Set a threshold event

Open Create Alert and select the %K plot, then a crossing direction and level. A cross above 20 leaves a low zone; a cross below 80 leaves a high zone. Those events differ from simply being below 20 or above 80.

3

Compare the plots for a line crossover

Inspect whether the dialog offers %K and %D as the two plot operands. If so, use their directional crossing comparison. A missing dedicated preset does not by itself require custom code. A specific combined rule, such as a cross while both lines are below 20, must explicitly include that extra condition.

4

Save the alert context

Choose the frequency, expiry and notification method in your account. For a rule defined on completed candles, select Once Per Bar Close where available. Record the symbol, timeframe and inputs. Recreate the alert after changing the script or its inputs; the running alert retains its saved configuration.

5

Verify delivery on new market data

Treat chart inspection and delivery as separate checks. Bar Replay can help inspect historical plots, but server alerts continue using live data. Check a new event against the alert log, then check the chosen notification channel. This is a test procedure, not a claim that delivery or investment performance has been tested here.

Alert Conditions Reference

Conditions to define and verify for the selected indicator.

Feature comparison table: Signal vs Notes
ConditionSignalNotes
%K crosses above 20Recovery from the chosen low zoneThe broader price trend may remain down.
%K crosses below 80Exit from the chosen high zoneThis does not prove a price reversal.
%K crosses above %DThe faster oscillator changes relative orderingCan happen repeatedly in choppy conditions.
%K crosses below %DOpposite oscillator ordering changeAdd any zone restriction explicitly; it is not implicit in a crossover.

Parameters to record and evaluate

Examples describe the configuration, not validated trading settings.

Feature comparison table: Starting value or requirement vs Description
ParameterStarting value or requirementDescription
%K lookback14, starting conventionSets the high-low window used by the oscillator.
%K smoothing3, starting conventionSmooths the raw range-position value; 1 disables this extra smoothing.
%D length3, starting conventionSets the average of %K used as the signal line.
Reference levels20 / 80, examplesA strong trend can keep readings near an extreme; the levels are not reversal guarantees.

FAQ

Alert Setup FAQ

Do all %K/%D alerts require Pine code?
Not necessarily. Check the available plot-to-plot comparison in the alert dialog. Custom code is useful for a combined condition or a pattern the existing implementation does not expose.
Can Once Per Bar fire repeatedly within the same bar?
A correctly configured single once-per-bar alert is limited to one event in that bar. If notifications repeat, inspect multiple active alerts, the selected frequency and any receiver retries. Intrabar conditions changing is a different issue from duplicate delivery.
Can Stochastic remain overbought during a rally?
Yes. It measures the close’s position in a recent range. A high reading can persist while price keeps rising; it is not a command to short.
Do rolling highest/lowest calculations cause future leakage?
A trailing window alone does not use future bars. Current-bar values can change while that bar develops. Evaluate a custom implementation’s actual indexing and data requests instead of attributing repainting to a function name.
How should divergence be evaluated?
Specify the swing points, oscillator series and confirmation delay. Keep labels plotted on past pivots separate from the time the pattern became detectable. No reversal-capture rate is established here.

Need a custom alert rule?

Describe the condition in Pineify’s coding agent, then review the generated Pine Script and test its timing and delivery in TradingView.

Explore Pine Script coding