OPEN-SOURCE SCRIPT

FRAMA Channel [JopAlgo]

165
FRAMA Channel [JopAlgo] — let the market tell you how fast to move

Most moving averages make you pick a speed and hope it fits every regime. FRAMA (Fractal Adaptive Moving Average, popularized by John Ehlers) does the opposite: it adapts its smoothing to market structure. When price action is “trendy” (more directional, less jagged), FRAMA speeds up; when it’s choppy (more fractal noise), FRAMA slows down and filters the rubble.

FRAMA Channel [JopAlgo] wraps that adaptive core with a volatility channel and clean color logic so you can read trend, mean-reversion windows, and breakouts in one glance—on any timeframe.

What you’re seeing (plain-English tour)

FRAMA midline (Filt): the adaptive average. It’s computed from a fractal dimension of price over Length (N).

Trendy tape → lower fractal dimension → FRAMA tracks price tighter.

Choppy tape → higher fractal dimension → FRAMA smooths harder.

Channel bands (Filt ± distance × volatility): the “breathing room.” Volatility here is a long lookback average of (high − low).

Upper band = potential resistance in down/neutral or trend-walk path in uptrends.

Lower band = mirror logic for shorts.

Color logic (simple and strict):

Green when price breaks above the upper band → bullish regime (momentum present).

Red when price breaks below the lower band → bearish regime.

White when price crosses the FRAMA midline → neutral/reset.

Optional candle coloring: toggle Color Candles to tint the chart itself with the regime color—handy for quick reads.

(When you add screenshots: image #1 should label FRAMA, bands, and the three colors in a small trend + pullback. Image #2 can show a “squeeze → expansion” sequence: channel tightens, then price breaks and walks the band.)

How it’s built (without the jargon)

The script measures three ranges over your Length (N): two half-windows and the full window.

It converts those into a fractal dimension (Dimen). That number says “how zig-zaggy” price is right now.

It turns Dimen into an alpha (smoothing factor): alpha = exp(−4.6 × (Dimen − 1)), clamped so it never explodes or flatlines.

It updates FRAMA each bar using that alpha.

It builds bands using a long average of (high − low) multiplied by your Bands Distance setting.

It changes color only on confirmed bar events:

hlc3 crosses above the upper band → green

hlc3 crosses below the lower band → red

close crosses the midline → white

Result: a channel that tightens in balance, widens in trend, and doesn’t flicker on partial bars.

How to use FRAMA Channel on any timeframe

Same framework everywhere. Your job is to choose where to act (objective levels) and let FRAMA tell you trend/mean-reversion context and breakout quality.

Scalping (1–5m)

Pullback-to-midline (trend): When color is green, buy pullbacks that hold at/above the midline; when red, short pullbacks that fail at/below it.

Invalidation: a white flip (midline cross back) right after entry → tighten or bail.

Squeeze → break: A narrowing channel often precedes a move. Only chase the break if color flips to green/red and the first pullback holds the band/midline.

Intraday (15m–1H)

Trend rides: In green/red, expect price to walk the outer band. Entries on midline kisses are cleaner than chasing the band itself.

Balance fades: In white (neutral) with a tight channel, fade outer band → midline—but only at a real level (see “Pairing” below).

Swing (2H–4H)

Regime compass: Color changes that stick (several bars) often mark swing regime shifts. Combine with Weekly/Event AVWAP and composite VP levels.

Add/Trim: In an uptrend, add on midline holds; trim as the channel widens and price spikes beyond the upper band into HVNs.

Position (1D–1W)

Context first: A persistent green weekly channel is constructive; a persistent red is distributive.

Patience: Wait for midline retests at higher-TF levels rather than chasing outer-band prints.

Entries, exits, and risk (keep it simple)

Continuation entry (trend):

Color already green/red.

Price pulls back to FRAMA midline (or shallowly toward it) and holds.

Take the trend side.
Stop: beyond the opposite side of the midline or behind local structure.
Targets: your Volume Profile HVN/POC or prior swing, not the band alone.

Breakout entry:

Channel had tightened; price breaks a key level.

Color flips green/red and the first retest holds.

Enter with the break.
Avoid: breaks that flip color but immediately white-flip on the next bar.

Mean-reversion entry (balance):

Color white and channel tight.

At a VP edge (VAL/VAH), fade outer band → midline.
Stop: just outside the band; Exit: at midline/POC.

Settings that actually matter (and how to tune them)

Length (N) — default 26
Controls how FRAMA “reads” structure.

Shorter (14–20): faster, more responsive (good for scalps/intraday), more flips in chop.

Longer (30–40): steadier (good for swings/position), slower to acknowledge new trends.

Bands Distance — default 1.5
Scales the channel width.

If you’re constantly tagging bands, increase slightly (1.7–2.0).

If nothing ever reaches the band, decrease (1.2–1.4) to make context meaningful.

Color Candles — on/off
Great for quick regime reads. If your chart feels too busy, leave bands colored and turn candle coloring off.

Warm-up note: FRAMA references N bars. Right after switching timeframes or symbols, give it N–2N bars to settle before you judge the current state.

(You may see an input named “Signals Data” in this version; it’s reserved for future enhancements.)

What to look for (pattern cheat sheet)

Walk-the-band: After a green/red flip, price hugs the outer band while the midline slopes. Ride pullbacks to the midline, don’t fade the band.

Squeeze → Expansion: Channel pinches, then color flips and bands widen—that’s the move. The first midline retest is your best entry.

False break tell: Brief color flip to green/red that immediately reverts to white on the next bar—skip chasing; plan for a reclaim.

Midline reclaims: In chop, repeated white↔green/white↔red flips say “mean reversion”; stay tactical and target the midline/POC.

Pairing FRAMA Channel with other [JopAlgo] tools

Cumulative Volume Delta v1 (CVDv1):
FRAMA tells you trend/mean-reversion context; CVDv1 tells you flow quality.

Breakout quality: FRAMA flips green and CVDv1 ALIGN = OK, Imbalance strong, Absorption ≠ red → higher odds the break sticks.

If Absorption is red on a FRAMA green flip, do not chase—wait for retest or look for a fail/reclaim.

Volume Profile v3.2:
Use VAH/VAL/LVNs/POC for where.

Green + VAL retest → rotate toward POC/HVN.

Red + VAH rejection → rotate back to POC.

LVN + green flip → expect fast travel toward the next HVN; set targets there.

Anchored VWAP [JopAlgo]:
Treat AVWAP as fair-value rails.

AVWAP reclaim + FRAMA green → excellent trend-resume entry.

AVWAP rejection + FRAMA red → high-quality short; use midline as your risk guide.

Common pitfalls this helps you avoid

Chasing every poke: FRAMA’s white → green/red state change helps you wait for confirmation (or a retest) instead of reacting to the first wick.

Fading a real trend: A sloped midline with price walking the band is telling you not to fight it.

Stops too tight: In expansion, give the trade room to the midline or local structure, not just inside the channel.

Practical defaults to start with

Length: 26

Bands Distance: 1.5

Color Candles: on (turn off if your chart is busy)

Timeframes: works out of the box on 15m–4H; for 1–5m try Length=20; for daily swings try Length=34–40.

Open source & disclaimer

This indicator is published open source so traders can learn, tweak, and build rules they trust. No tool guarantees outcomes; risk management is essential.

Disclaimer — Not Financial Advice.
The “FRAMA Channel [JopAlgo]” indicator and this description are provided for educational purposes only and do not constitute financial or investment advice. Trading involves risk, including possible loss of capital. [JopAlgo] makes no warranties and assumes no responsibility for any trading decisions or outcomes resulting from the use of this script. Past performance is not indicative of future results.

Use FRAMA Channel for context (trend vs balance, squeeze vs expansion), Volume Profile v3.2 and Anchored VWAP for locations, and CVDv1 for flow quality. That trio keeps your trades selective and your rules consistent on any timeframe.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.