Files
QuanTAlib/lib/oscillators/dstoch/dstoch.pine
T
Miha Kralj 15f4bb90f3 feat: add 8 new indicators with full integration
New indicators:
- HWC (Holt-Winters Channel) — channels, 27 tests
- VWMACD (Volume-Weighted MACD) — momentum, 38 tests
- Squeeze Pro — oscillators, 69 tests
- BW_MFI (Bill Williams MFI) — oscillators
- DSTOCH (Double Stochastic) — oscillators
- ATRSTOP (ATR Trailing Stop) — reversals
- VSTOP (Volatility Stop) — reversals
- Convexity (Beta Convexity) — statistics, 23 tests

Integration:
- Python bridge: Exports.cs, _bridge.py, wrapper modules
- Documentation: _sidebar.md, _index.md pages, SPEC.md
- All analyzer warnings fixed (MA0074, xUnit2013, S2699)

Build: 0 warnings, 0 errors | Tests: 15,933 passed, 0 failed
2026-03-17 08:35:29 -07:00

28 lines
946 B
Plaintext

// PineScript v6 reference for DSTOCH (Double Stochastic / Bressert DSS)
// Apply Stochastic formula twice with EMA smoothing between stages.
//@version=6
indicator("Double Stochastic (DSS Bressert)", shorttitle="DSTOCH", overlay=false)
period = input.int(21, "Period", minval=1)
// Stage 1: Raw %K
rawK = ta.stoch(close, high, low, period)
// Stage 1: EMA smooth rawK → smoothK
smoothK = ta.ema(rawK, period)
// Stage 2: Stochastic of smoothK
skHigh = ta.highest(smoothK, period)
skLow = ta.lowest(smoothK, period)
skRange = skHigh - skLow
dsRaw = skRange > 0 ? 100.0 * (smoothK - skLow) / skRange : 0.0
// Stage 2: EMA smooth dsRaw → DSS output
dss = ta.ema(dsRaw, period)
plot(dss, "DSS", color=color.blue, linewidth=2)
hline(80, "Overbought", color=color.red, linestyle=hline.style_dotted)
hline(20, "Oversold", color=color.green, linestyle=hline.style_dotted)
hline(50, "Midline", color=color.gray, linestyle=hline.style_dotted)