PROTECTED SOURCE SCRIPT
Swing Algo Pro — Adaptive Trend + Volume + Squeeze

Swing Algo Pro — Adaptive Trend + Volume + Squeeze (v1.3)
A non-repainting swing and intraday trading system built on a robust combination of adaptive trend logic, volume & squeeze confirmation, HTF regime filtering, and StochRSI momentum triggers.
The goal: fewer flips, clear visual zones, and confident entries only at the start of a swing.
🔍 Core Features
Adaptive Trend Engine using HMA/EMA slope vs ATR → isolates real directional moves from noise.
Volume & Volatility Squeeze Confirmation (Bollinger vs Keltner) → filters low-energy setups.
HTF Regime Filter (e.g., 1H / 4H / 1D or "Chart") → trades only in the higher-timeframe direction.
StochRSI Trigger (optional) → aligns swing entries with short-term momentum cycles.
Dynamic Background Shading based on signal strength:
🟢 Green = bullish zone 🔴 Red = bearish zone 🟠 Amber = transition ⚪ Gray = no-trade.
One Signal per Swing logic with cooldown and minimum bars filter → prevents over-triggering.
Smart Alerts: BUY / SELL / STRONG BUY / STRONG SELL.
No repainting when “Confirmation ON (bar close)” is enabled.
⚙️ Algorithm Highlights
Trend Core:
HMA or EMA baseline + fast EMA + ATR slope check + ADX confirmation.
Volatility Module:
Squeeze detection via Bollinger vs Keltner compression and breakout.
Volume Module:
Z-score + volume SMA + volatility multiplier for reliability.
HTF Context:
Multi-timeframe baseline alignment (using request.security() with lookahead_off) — filters weak counter-trend setups.
StochRSI Momentum:
K/D crossover inside oversold/overbought zones; optional strict band cross; weighted score (0–2).
🎨 Visual Logic
Zone Meaning Color
Green Active long swing Strong green intensity = stronger setup
Red Active short swing Strong red intensity = stronger setup
Amber (Orange) Transition / mixed signals (watch mode)
Gray No-Trade zone (flat baseline, low volatility, or too close to baseline)
Vertical lines mark confirmed BUY/SELL flips.
Labels display BUY, SELL, STRONG BUY, STRONG SELL.
🧩 Input Tips
Mode
Aggressive → more signals, faster entries.
Balanced → standard swing trading mode.
Conservative → filters small moves.
Sensitivity (10–90)
35–55 → slow assets or higher TFs.
60–80 → intraday crypto/FX.
75–90 → high-volatility instruments.
HTF Regime Filter:
M5–M15 → set HTF to 1H
M30–H1 → set HTF to 4H
H4–D1 → set HTF to 1D
or select “Chart” to disable HTF filtering.
StochRSI:
Typical: length 14 / K=3 / D=3 / bands 20–80.
Strict mode (“Require K/D cross at bands”) = rarer but higher-quality entries.
False Signal Reduction:
Increase Cooldown between flips (3–6).
Increase Min bars per swing (6–12).
Increase Min distance from Baseline (×ATR) (0.2–0.35).
Adjust ADX/ATR thresholds for more No-Trade filtering.
📊 Quick Presets
Style Mode Sens HTF Use case
Swing Daily Balanced 45–55 1D Trend-following swing
Intraday 15m Aggressive 65–75 1H Scalping & day trading
Conservative 4H Conservative 35–45 1D Larger structure alignment
🚨 Alerts
Buy, Sell, Strong Buy, Strong Sell — all trigger on confirmed flips (no repaint).
⚠️ Disclaimer
This script is for educational purposes only and not financial advice.
Always backtest and adjust parameters per market and timeframe before using live.
Designed for clarity, consistency, and adaptability — not curve-fit optimization.
A non-repainting swing and intraday trading system built on a robust combination of adaptive trend logic, volume & squeeze confirmation, HTF regime filtering, and StochRSI momentum triggers.
The goal: fewer flips, clear visual zones, and confident entries only at the start of a swing.
🔍 Core Features
Adaptive Trend Engine using HMA/EMA slope vs ATR → isolates real directional moves from noise.
Volume & Volatility Squeeze Confirmation (Bollinger vs Keltner) → filters low-energy setups.
HTF Regime Filter (e.g., 1H / 4H / 1D or "Chart") → trades only in the higher-timeframe direction.
StochRSI Trigger (optional) → aligns swing entries with short-term momentum cycles.
Dynamic Background Shading based on signal strength:
🟢 Green = bullish zone 🔴 Red = bearish zone 🟠 Amber = transition ⚪ Gray = no-trade.
One Signal per Swing logic with cooldown and minimum bars filter → prevents over-triggering.
Smart Alerts: BUY / SELL / STRONG BUY / STRONG SELL.
No repainting when “Confirmation ON (bar close)” is enabled.
⚙️ Algorithm Highlights
Trend Core:
HMA or EMA baseline + fast EMA + ATR slope check + ADX confirmation.
Volatility Module:
Squeeze detection via Bollinger vs Keltner compression and breakout.
Volume Module:
Z-score + volume SMA + volatility multiplier for reliability.
HTF Context:
Multi-timeframe baseline alignment (using request.security() with lookahead_off) — filters weak counter-trend setups.
StochRSI Momentum:
K/D crossover inside oversold/overbought zones; optional strict band cross; weighted score (0–2).
🎨 Visual Logic
Zone Meaning Color
Green Active long swing Strong green intensity = stronger setup
Red Active short swing Strong red intensity = stronger setup
Amber (Orange) Transition / mixed signals (watch mode)
Gray No-Trade zone (flat baseline, low volatility, or too close to baseline)
Vertical lines mark confirmed BUY/SELL flips.
Labels display BUY, SELL, STRONG BUY, STRONG SELL.
🧩 Input Tips
Mode
Aggressive → more signals, faster entries.
Balanced → standard swing trading mode.
Conservative → filters small moves.
Sensitivity (10–90)
35–55 → slow assets or higher TFs.
60–80 → intraday crypto/FX.
75–90 → high-volatility instruments.
HTF Regime Filter:
M5–M15 → set HTF to 1H
M30–H1 → set HTF to 4H
H4–D1 → set HTF to 1D
or select “Chart” to disable HTF filtering.
StochRSI:
Typical: length 14 / K=3 / D=3 / bands 20–80.
Strict mode (“Require K/D cross at bands”) = rarer but higher-quality entries.
False Signal Reduction:
Increase Cooldown between flips (3–6).
Increase Min bars per swing (6–12).
Increase Min distance from Baseline (×ATR) (0.2–0.35).
Adjust ADX/ATR thresholds for more No-Trade filtering.
📊 Quick Presets
Style Mode Sens HTF Use case
Swing Daily Balanced 45–55 1D Trend-following swing
Intraday 15m Aggressive 65–75 1H Scalping & day trading
Conservative 4H Conservative 35–45 1D Larger structure alignment
🚨 Alerts
Buy, Sell, Strong Buy, Strong Sell — all trigger on confirmed flips (no repaint).
⚠️ Disclaimer
This script is for educational purposes only and not financial advice.
Always backtest and adjust parameters per market and timeframe before using live.
Designed for clarity, consistency, and adaptability — not curve-fit optimization.
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。