HL 20 Hybrid [Paifcode]

What it is
HL 20 Hybrid builds a volatility-adaptive High/Low band from an EMA-20 core, blended with a user-selectable slower smoother.
A “sticky” regime engine (body-breaks, ATR edge buffers, basis hysteresis, consecutive-bar confirmation, minimum hold) reduces flip noise.
Signals are synchronized with what you see:
Low line turns blue → BUY (triangle up + barcolor sync)
High line turns red → SELL (triangle down + barcolor sync)
No lookahead; repaint-free.
Concept & origin (why this exists)
This started as a simple EMA-20 High/Low scalping idea on FX. It caught impulse legs but flipped too often in chop. I iterated toward:
Hybrid smoothing: EMA-20 + selectable slow smoother (RMA / EMAx2 / KAMA / ALMA / WMA / McGinley / Jurik-approx) with a blend weight, applied separately to Close/High/Low → Basis/Upper/Lower.
Volatility-adaptive width: deviations from Basis plus ATR padding.
Sticky regime detection: body-based breaks of the band edges, ATR edge buffer, basis hysteresis, consecutive bars to confirm, and a minimum hold so flips don’t whipsaw.
One-to-one visuals: signal triangles fire on the same bar the line color turns, so the chart and alerts match.
How it works (pipeline)
Hybrid smoother
Compute EMA-20. Compute a slow smoother (choose: RMA, EMAx2, KAMA-custom, ALMA, WMA, McGinley, Jurik-approx).
Hybrid = EMA20 × (1–blend) + Slow × blend. Run this on Close/High/Low separately → Basis / HighHybrid / LowHybrid.
Band construction
Upper = Basis + (HighHybrid − Basis) × width + ATR × padding
Lower = Basis − (Basis − LowHybrid) × width − ATR × padding
Regime engine (no repaint)
Detect body breaks (optional wick mode) beyond edge buffers.
Apply basis hysteresis and require N consecutive outside bars.
Enforce minimum hold bars after a flip.
Calculations use confirmed bars only.
Signals & visuals
BUY when regime flips to long (low line turns blue).
SELL when regime flips to short (high line turns red).
Barcolor follows the active regime.
“Signals are synchronized with line colors: Low line turns blue → BUY; High line turns red → SELL.”
Inputs (quick reference)
Smoother: RMA / EMAx2 / KAMA / ALMA / WMA / McGinley / Jurik-approx + blend weight
Band width: multiplier ≥ 1.0, optional ATR padding (len & ×)
Regime control: Body-break toggle, edge buffer (×ATR), basis hysteresis (×ATR), consecutive bars, min hold bars
Visuals: Upper/Lower colors, show basis
Tuning guide (cookbook)
Choppy markets: increase consecutive bars, min hold, and edge buffer; or add a touch more ATR padding.
Late entries: reduce consecutive bars and min hold, or slightly decrease edge buffer.
Too tight bands: increase width multiplier or ATR padding.
Too loose bands: decrease width multiplier and/or padding.
ibb.co/2YN4rQ34
“Chop control with consecutive bars / min hold / edge buffer. Flips stay clean.”
Usage notes
Recommended to alert on BUY/SELL flips and work entries around them with your execution rules.
Multi-TF anchoring is not included by design; the engine is single-TF, no lookahead.
Not a strategy; pair with risk and session management.
Limitations & transparency
No guarantees across all symbols/timeframes.
Jurik-approx and KAMA are custom approximations implemented from public concepts; no external code is copied.
Repaint-free: the script does not rely on future bars nor HTF lookahead.
Originality & usefulness (for moderators)
This is not a mashup; it’s a single, coherent pipeline where every component serves the objective of reducing flip noise while keeping entries aligned to what the user sees:
Hybrid smoothing (EMA20 + selectable slow) is integrated with band width/ATR padding, which in turn feeds the regime engine (body breaks + buffers + hysteresis + hold).
The signal mechanism is coupled to the visual state (line colors) to maintain a one-to-one relationship between alerts and chart.
All logic is implemented in-house using TradingView built-ins; classic references (Wilder, EMA, ALMA, etc.) are public domain concepts, not reused code.
Changelog
v1.0: Initial invite-only release.
Invite-only script
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact paifcode directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.
Author's instructions
Disclaimer
Invite-only script
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact paifcode directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.