OPEN-SOURCE SCRIPT

Swing from stochastic with alert

1 138
Stochastic ZigZag [SH/SL] — How It Works
This indicator uses the Stochastic %K (9,3,3) to identify and confirm Swing Highs and Swing Lows on the price chart, then connects them with a ZigZag line.
Swing Detection Logic

When %K crosses below 20 → enters "seeking Low" mode, tracking the lowest price. Once %K crosses above 80, that lowest point is confirmed as a Swing Low (SL)
When %K crosses above 80 → enters "seeking High" mode, tracking the highest price. Once %K crosses below 20, that highest point is confirmed as a Swing High (SH)
If the same swing type repeats before the opposite appears, only the more extreme value is kept

Visual Output

ZigZag line connecting alternating SH and SL points (customizable color, width, style)
Tiny SH / SL labels at each confirmed swing point
Dashed horizontal level lines extending right from each confirmed SH and SL (last 3 of each shown); a level line ends at the bar where price closes through it

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。