FRAMA Channel [JopAlgo]FRAMA Channel — 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 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 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 :
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 ” 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. 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.
Indicators and strategies
Portfolio Simulator & BacktesterMulti-asset portfolio simulator with different metrics and ratios, DCA modeling, and rebalancing strategies.
Core Features
Portfolio Construction
Up to 5 assets with customizable weights (must total 100%)
Support for any tradable symbol: stocks, ETFs, crypto, indices, commodities
Real-time validation of allocations
Dollar Cost Averaging
Monthly or Quarterly contributions
Applies to both portfolio and benchmark for fair comparison
Model real-world investing behavior
Rebalancing
Four strategies: None, Monthly, Quarterly, Yearly
Automatic rebalancing to target weights
Transaction cost modeling (customizable fee %)
Key Metrics Table
CAGR: Annualized compound return (S&P 500 avg: ~10%)
Alpha: Excess return vs. benchmark (positive = outperformance)
Sharpe Ratio: Return per unit of risk (>1.0 is good, >2.0 excellent)
Sortino Ratio: Like Sharpe but only penalizes downside (better metric)
Calmar Ratio: CAGR / Max Drawdown (>1.0 good, >2.0 excellent)
Max Drawdown: Largest peak-to-trough decline
Win Rate: % of positive days (doesn't indicate profitability)
Visualization
Dual-chart comparison - Portfolio vs. Benchmark
Dollar or percentage view toggle
Customizable colors and line width
Two tables: Statistics + Asset Allocation
Adjustable table position and text size
🚀 Quick Start Guide
Enter 1-5 ticker symbols (e.g., SPY, QQQ, TLT, GLD, BTCUSD)
Make sure percentage weights total 100%
Choose date range (ensure chart shows full period - zoom out!)
Configure DCA and rebalancing (optional)
Select benchmark (default: SPX)
Analyze results in statistics table
💡 Pro Tips
Chart data matters: Load SPY or your longest-history asset as main chart
If you select an asset that was not available for the selected period, the chart will not show up! E.g. BTCUSD data: Only available from ~2017 onwards.
Transaction fees: 0.1% default (adjust to match your broker)
⚠️ Important Notes
Requires visible chart data (zoom out to show full date range)
Limited by each asset's historical data availability
Transaction fees and costs are modeled, but taxes/slippage are not
Past performance ≠ future results
Use for research and education only, not financial advice
Let me know if you have any suggestions to improve this simulator.
Gap ZonesThis TradingView indicator automatically detects daily price gaps and plots them clearly on any timeframe (intraday or daily).
It helps visualize where unfilled gaps are sitting, track whether they’ve been filled, and control how far the zone extends.
Key Features
1. Daily Gap Detection
• Works even when you’re on intraday charts (uses daily OHLC data).
• Marks both gap up (potential support zones) and gap down (potential resistance zones).
2. Shaded Gap Zones
• Each gap is highlighted as a band (greenish for up, reddish for down).
• Option to turn shading off if you just want horizontal lines.
3. Hide When Filled
• Once price closes or touches the far side of the gap, it disappears (configurable: Touch vs Close).
4. Lookback Window
• Gaps only show if they occurred within the past X trading days (default: 30).
• Prevents your chart from being cluttered with ancient gaps.
5. Multiple Gaps Tracked
• Can track up to 5 recent gaps simultaneously.
• Oldest gaps “roll off” as new ones form.
6. Finite Right-Edge Guides
• Optional horizontal guide lines extend to the right, but only for a fixed number of bars (default: 50).
• Cleaner than infinite extensions.
7. Gap-Day Marker
• Optional vertical line drawn on the bar where the gap first occurred.
⸻
⚙️ Inputs & Settings
When you apply the indicator, you’ll see these options:
• Lookback (trading days): How far back to scan for gaps (default 30).
• Max gaps to show (1..5): How many simultaneous gap zones to display.
• Min gap size (% of prior close): Filter out tiny gaps (default 0.25%).
• Hide gaps once filled: Removes a gap from the chart once filled.
• Fill rule uses CLOSE (off = Touch):
• Touch = filled when price trades through the level intraday.
• Close = filled only when a candle close crosses it.
• Show shading: Toggle zone fills on/off.
• Show vertical marker on gap day: Toggle gap-day marker line.
• Show finite right-edge lines: Toggle horizontal lines extending right.
• Right line length (bars): How far those lines extend (default 50 bars).
⸻
🟢 How to Use It
1. Apply on Any Chart
• Works best on daily or intraday (5m, 15m, 1h).
• Gaps are always calculated from daily data, so intraday charts will show higher-timeframe gaps correctly.
2. Interpret Colors
• Green shading = Gap Up (often acts as support).
• Red shading = Gap Down (often acts as resistance).
3. Watch for Fills
• When price re-enters the gap zone, the indicator checks if it’s “filled” (based on your Touch/Close setting).
• If “Hide When Filled” is on, the zone vanishes.
4. Trade Context
• Many traders use gaps as targets (expecting a fill) or levels of support/resistance.
• Combined with your bull put/bear call spread strategies, it helps confirm strong levels.
Market Bias (CEREBR)Market Bias (CEREBR) — quick read of who’s in control
What it does, in one line:
It builds a clean, smoothed Heikin-Ashi view (optionally from a higher timeframe) and an oscillator that says: bullish, bearish, or cooling off. You use it to decide directional bias and to avoid trading against that bias.
What you see on the chart
Smoothed HA candles (optional): green = bullish bias, red = bearish bias.
A soft fill band around the HA body:
Brighter = bias is strengthening.
Faded = bias is weakening.
(In Data Window) “Bias High / Low / Average” = the smoothed HA range and midline.
If you only look at one thing: green means look for longs, red means look for shorts. Faded color = be picky or trim.
How to use it (simple playbook)
Pick your higher timeframe (HTF) for the bias.
On a 4H chart, try HTF = 12H or 1D.
Rule: HTF must be equal to or higher than your chart TF.
Trade with the bias at real levels.
Longs only when the bias is green.
Shorts only when the bias is red.
Take entries at location: Volume Profile v3.2 levels (VAH/VAL/POC/LVNs) or Anchored VWAP.
Quality check (optional but strong):
Before clicking, glance at CVDv1.
Green bias + CVD Alignment OK and no Absorption = better odds.
If CVD shows Absorption against you, skip or wait for a retest.
When to pass:
Color flips every other bar (chop) → do less.
Color is fading (weakening) into your entry → size down or wait.
Timeframe guidance
Scalps (1–5m): HTF = 15m/30m. Use bias to filter direction; enter on pullbacks at AVWAP/VA edges.
Intraday (15m–1H): HTF = 4H. Buy dips in green / sell pops in red at VP levels.
Swing (2H–4H): HTF = 12H/1D. First pullback after a fresh flip is usually the best.
Position (1D–1W): HTF = 1W. Hold while color stays consistent; reduce on weakening near HVNs.
Entries, exits, and stops
Entry with trend:
Bias green, price pulls back to AVWAP / VAL / prior HA mid, then holds.
Click the long. Reverse for shorts in red.
Exit / reduce:
When “Trend Weakens” alert fires, or color fades while hitting your POC/HVN target.
Hard exit on opposite flip (green→red or red→green) if your idea was pure trend-follow.
Stops:
Behind structure/level (not just on color).
If the next bar flips bias against you and CVD also disagrees, cut it early.
Inputs that matter (keep these simple)
Timeframe (HA Market Bias): your HTF. Must be ≥ chart TF.
Period (default 100): smoothing for the base OHLC. Higher = steadier.
Smoothing (default 100): extra smoothing for the HA feed. Higher = fewer flips.
Oscillator Period (default 7): affects how fast strengthening/weakening shows in the fill color. Lower = quicker.
Tip: If you see too many flips, raise Period/Smoothing or pick a higher HTF. If it feels slow, lower them one notch.
Alerts (plain meaning)
Bullish Trend Switch: bias turned bearish → bullish.
Bullish Trend Strengthens / Weakens: same direction, momentum building / cooling.
Bearish Trend Switch: bullish → bearish.
Bearish Trend Strengthens / Weakens: same idea for shorts.
Use “Switch” to prepare for new setups; use “Strengthens/Weakens” to add/trim or tighten risk.
How it works (one paragraph, no math)
The script smooths price, builds Heikin-Ashi values on your chosen HTF, smooths those again, and doesn’t repaint on closed bars. From the HA open/close difference it creates a simple bias oscillator: above zero = bullish, below zero = bearish. The fill brightness tells you if that bias is getting stronger or weaker right now.
Good combos (optional, but recommended)
Volume Profile v3.2 : use VAH/VAL/POC/LVNs as your battleground.
Anchored VWAP : use reclaims/rejections for timing.
CVDv1 : sanity-check flow quality before entry.
FAQ (quick)
Does it repaint?
No on closed bars. HTF values are requested with a safe offset.
Best starting setup?
4H chart, HTF = 1D, Period/Smoothing 100/100, Oscillator 7.
Can I hide the HA candles?
Yes—toggle “Show HA Candles.” Keep only the bias fill if you want a cleaner price chart.
Short disclaimer
Educational tool, not advice. Markets carry risk. Test first, size small, and trade with your plan.
Kairi Relative Index Upgrated v1Kairi Relative Index Upgraded v1 — how far from “fair” are we, right now?
Most oscillators mash together price and momentum in ways that are hard to explain to a new trader. KRI is refreshingly simple: it measures how far price is from its moving average, as a percent of that average.
KRI = 100 × (Price − SMA) / SMA
Above 0 → price is above its average (stretched up).
Below 0 → price is below its average (stretched down).
The farther from 0, the more stretched we are from the mean.
This upgraded version keeps the pane clean (zero line, colored KRI, optional guide rails at +Line Above / Line Below) so you can read extension, reversion pressure, and reclaims at a glance—on any timeframe.
(If you add screenshots: image #1 should label the zero line and ± threshold lines; image #2 should show a textbook “overshoot at VAH/VAL + KRI extreme → rotate back to POC.”)
What you’re seeing (and how to read it fast)
KRI line
Green when KRI ≥ 0 (price above SMA)
Red when KRI < 0 (price below SMA)
Zero line = the moving average itself (no stretch).
Guide lines (default +10/−10) = “This is pretty far for this setting.” Treat these as review-and-decide zones, not auto-trade signals.
Three quick reads:
Magnitude: how far from the mean (size of KRI).
Direction: above/below zero (which side of the mean).
Turn: KRI curling back toward zero (reversion starting) or accelerating away (trend impulse continuing).
What KRI really measures (plain-English)
The SMA(length) is your “fair value” line for this indicator.
KRI tells you the percentage deviation from that fair value—normalized, so you can compare across assets/timeframes with the same length.
Because it’s a pure distance metric, KRI excels at:
spotting over-extensions into VP edges (VAH/VAL) and AVWAP,
timing mean-reversion back to POC/AVWAP in balance,
confirming reclaims (KRI crossing back through zero at a level),
framing pullbacks in trend (healthy dips usually avoid deep negative KRI in strong uptrends).
Using KRI on any timeframe
The workflow is always Location → Flow → KRI:
Location: a real level (Volume Profile v3.2’s VAH/VAL/POC/LVNs or Anchored VWAP).
Flow quality: check CVDv1 (Alignment OK? Absorption not red?).
KRI: are we stretched into/away from the level, and is KRI turning?
Scalping (1–5m)
Fade the stretch (balance): At VAH/VAL or Session AVWAP, an extreme KRI that rolls back toward zero = quick rotation to the middle (POC/AVWAP).
Don’t fade if bands are expanding and flow is strong (CVDv1 says go) — big KRI can stay big in expansion.
Intraday (15m–1H)
Continuation after pullback: In uptrends, look for shallow negative KRI at support (VAL/AVWAP) that turns up → join trend.
Failed breakout tell: Price pokes above VAH but KRI barely increases or rolls over quickly → likely a reclaim back inside value.
Swing (2H–4H)
Edge-to-mean rotations: At composite VAH/VAL, KRI extremes are great context: fade back to POC/HVNs if flow doesn’t confirm a breakout.
Reclaim confirmation: After a flush below Weekly AVWAP, KRI crossing back up through zero on the reclaim bar is a clean green light.
Position (1D–1W)
Regime posture: Multi-day runs with sustained positive KRI (and shallow dips) = constructive; mirror for downtrends. Use KRI pullbacks to ~0 at Weekly AVWAP for adds.
Entries, exits, and risk (simple rules)
Mean-reversion entry: At VAH/VAL or AVWAP, wait for KRI extreme at/through your guide line and a turn back toward zero.
Stop: just beyond the level; Target: POC/HVN or the zero line on KRI.
Trend-continuation entry: In a trend, take pullbacks where KRI stays modest (doesn’t blow through your lower/upper guide) and turns back with the trend at the level.
Avoid: chasing breakouts where KRI is already extreme and still climbing unless CVDv1 says Alignment OK + no Absorption and you have a clean retest.
Settings that matter (and how to tune them)
Length (default 50): defines the moving average “fair value.”
Shorter (20–34): faster, more signals, more noise—good for intraday.
Longer (50–100): steadier, better for swings/position.
Source (default close): keep it simple; hlc3 or close both work.
Line Above / Below (defaults +10/−10): your review zones. Tune them to the asset/timeframe:
Scroll back 6–12 months and eyeball typical |KRI| spikes. Set your lines around the 80th–90th percentile of |KRI| for that market and length.
Majors often need smaller thresholds than thin alts on the same timeframe.
Tip: If your KRI is always beyond the lines, increase length or widen the thresholds. If it never touches them, shorten length or tighten thresholds.
What to look for (pattern cheat sheet)
Stretch into level → curl: KRI tags an extreme right at VAH/VAL/AVWAP, then turns back → classic rotation.
Shallow pullback in trend: KRI dips toward zero but doesn’t hit your lower guide, then turns up at support → continuation.
No-juice break: New price high with weaker KRI (smaller positive % vs prior leg) → breakout lacks extension; plan for retest or reclaim.
Zero-line reclaims: After a washout, KRI crosses zero as price reclaims AVWAP/VAL → clean confirmation.
Combining KRI with other tools
Cumulative Volume Delta v1 (CVDv1):
Use KRI for stretch/turn, CVDv1 for quality.
A KRI extreme at VAH with CVDv1 Absorption (red) is a do-not-chase; look for the fail/reclaim.
A KRI pullback toward zero at VAL with Alignment OK + strong Imbalance + no Absorption = high-quality continuation.
Volume Profile v3.2:
KRI’s best signals happen at VAH/VAL/POC/LVNs.
LVN traversals with rising KRI often run quickly to the next HVN—use VP for targets.
Anchored VWAP :
Treat AVWAP as fair-value rails. KRI zero cross on an AVWAP reclaim is your green flag; KRI extreme + failure to accept beyond AVWAP warns of a fake break.
Common pitfalls KRI helps you avoid
Buying high into a tired move: KRI already very positive at VAH and rolling over = likely rotation; wait.
Fading true expansion: In strong trends with confirmed flow, KRI can remain extreme; don’t automatically fade just because it’s “far.”
Wrong thresholds: Copy-pasting ±10 to every market/timeframe can mislead. Calibrate to the market you trade.
Practical defaults to start with
Length: 50
Lines: +10 / −10 as placeholders—calibrate later.
Timeframes: great out of the box on 15m–4H; for 1–5m try Length 34 and tighter lines; for daily swings try Length 100 and broader lines.
Process: Level → CVDv1 quality → KRI stretch/turn. If any of the three disagree, wait for the retest.
Disclaimer & Licensing
This indicator and its description are provided for educational purposes only and do not constitute financial or investment advice. Trading involves risk, including the possible loss of capital. makes no warranties and assumes no responsibility for any decisions or outcomes resulting from the use of this script. Past performance is not indicative of future results. Use at your own risk.
Licensing & Attribution:
Copyright (c) 2018–present, Alex Orekhov (everget). Modified and upgraded by .
The original “Kairi Relative Index” is released under the MIT License, and this derivative is distributed under the MIT License as well. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files to deal in the Software without restriction, subject to the conditions of the MIT License, including the above copyright notice and this permission notice. The Software is provided “AS IS,” without warranty of any kind, express or implied.
Predictive Pivot Matrix OHLC data, integrates volume profile for POC/Value Area tracking (including virgin POC), applies rule-based "ML" scoring to evaluate pivot strength via factors like proximity, volume, touches, trend, and confluence, monitors adaptive success rates, projects 5-day future pivots using trend/volatility, detects overlapping confluence zones, and generates visuals (lines, labels, table), alerts, and buy/sell signals on key crossings.
Keltner Channels v1 [JopAlgo]Keltner Channels v1 — a clean volatility envelope for timing pullbacks, breakouts, and risk
Keltner Channels are a moving-average centerline with volatility-based bands above and below. They give you a live “speed limit” for price: when the market is calm, bands are tight (expect mean reversion); when volatility expands, bands widen (trend moves can breathe). KC v1 keeps the classic idea but adds a small twist that traders appreciate in crypto: an adaptive centerline that switches between EMA and SMA based on trendiness, plus a choice of how you measure volatility for the bands.
This makes KC v1 useful for any timeframe—from fast scalps to multi-day swings—because it answers three practical questions on every chart:
Where’s the “middle” of price right now? (the centerline)
How far is “far” for current volatility? (the bands)
Should I fade back to the middle or ride with the expansion? (context from band width + slope)
If you attach screenshots to your script page, show one image labeling Upper / Middle / Lower bands with a classic pullback-to-middle entry, and another showing a band expansion where price hugs the outer band in trend.
What you’re seeing (and how it’s computed)
Middle band (MA):
KC v5 computes both an EMA and an SMA of your source (default close) with the same length, then auto-selects the middle band:
If ATR > SMA(ATR) over length, KC marks the market as trending and uses the EMA (faster, responsive).
Otherwise, it uses the SMA (steadier) in balance.
Result: you get a centerline that’s calm in chop and snappier in trend, without touching settings.
Upper / Lower bands:
upper = middle + (mult × volatility)
lower = middle - (mult × volatility)
You choose the volatility measure via Bands Style:
Average True Range (default): smooth, robust; uses ATR(atrlength). Best all-around choice.
True Range: raw TR each bar (more jumpy; reacts to gaps and spikes quickly).
Range: RMA of (high - low) over length (gentler; good for tight mean-reversion regimes).
Colors & fill:
Upper = red, Lower = green, Middle = white, with muted fill between bands so you can still read candles.
How to use Keltner Channels on any timeframe
Same framework everywhere: trade with the envelope when expanding, fade back to the middle when contracting—but only at objective locations and with healthy flow.
Scalping (1–5m)
Pullback-to-middle entry: In a micro-trend, wait for price to retrace to the middle band and print a hold. Enter with the trend, stop just beyond the opposite side of the middle or below minor structure; first target is the near band.
Band tap fades (only in contraction): When bands are tightening and the middle is flat, quick fades from upper → middle or lower → middle are high-probability if your volume/flow read doesn’t show aggressive pressure against you.
Avoid: Fading when bands expand and middle slopes—expect continuation instead.
Intraday (15m–1H)
Continuation rides: When bands open up (volatility expansion) and the middle slopes, price often walks the outer band. Enter on minor pullbacks that hold above the middle (for longs) and trail using the middle band or a structure stop.
Squeeze to break: A period of narrowing bands often precedes a move. Let price close outside the channel with good flow, then buy the retest toward the middle that holds.
Swing (2H–4H)
Trend participation: In established trends, treat pullbacks to the middle band as your primary entry. The upper/lower band is not a take-profit by itself—use it with Volume Profile targets (POC/HVNs) or key swing levels.
Mean reversion in balance: When the middle is flat and bands are tight over many bars, fade outer band → middle at Volume Profile edges, provided your flow read isn’t showing absorption against your idea.
Position (1D–1W)
Context: Use KC to judge regime (wide bands + slope = trend; tight/flat = balance). Position entries come from pullbacks to middle that coincide with Weekly AVWAP / VP value edges.
Entries, exits, and risk (simple rules)
Trend entry (with expansion):
Wait for band expansion + sloping middle in your direction. Enter on the first clean pullback to middle (or shallow pullback that can’t even tag middle).
Stop: below the middle band or just beyond local swing.
Trail: by the middle band in trend, or step-trail under pivots.
Targets: next Volume Profile HVN/POC or structural levels; the far Keltner band is a context line, not a hard TP.
Mean-reversion entry (in contraction):
Bands tight + flat middle → fade outer band back to middle at a Volume Profile VA edge.
Stop: just beyond the band.
Target: middle band (first), opposite band if flow remains weak.
Breakout confirmation:
A strong close outside the band by itself can be a trap. Treat it as signal only when your flow read confirms (see “Combining with other tools”).
Settings that actually matter (and how to tune them)
MA Length (default 20): controls both middle smoothness and the trending test (ATR vs SMA(ATR)).
Shorter (10–14) reacts faster, more whips in chop.
Longer (30–50) steadier middle, better for swings/position.
Multiplier (default 2.0): scales band distance.
Crypto majors: 1.8–2.2 is a good starting range on 15m–4H.
Volatile alts: 2.2–2.6 to avoid over-triggering.
If you keep getting faked out on fades: increase the multiplier.
If the channel rarely contains price for long stretches: decrease slightly.
Bands Style:
ATR for most use cases;
TR when you want maximum responsiveness to spikes;
Range for calmer envelopes in slow, balanced markets.
ATR Length (default 10): only applies if you choose ATR for band style.
Shorter = quicker band changes, good for scalps;
Longer = steadier bands for swings.
Note: KC v1 auto-selects EMA vs SMA for the middle band using the ATR trend test. That’s intentional, so you don’t have to toggle it manually.
What to look for (pattern cheatsheet)
Walk-the-band: In expansion, price hugs the outer band and barely returns to the middle—ride, don’t fade.
First touch of middle in trend: Often the cleanest add or first entry after a breakout.
Band pinch (“squeeze”): A long, narrow channel with flat middle sets up a breakout. Wait for acceptance (close outside + hold on retest).
False break tell: Price pokes outside band but closes back inside quickly—watch for reversion to middle, especially if your flow read shows Absorption against the poke.
Combining KC v1 with other tools
like the Cumulative Volume Delta v1 (CVDv1):
Do not chase an outside-band move if CVDv1 shows Absorption—that’s a classic failed break.
Prefer pullbacks to the middle band when Alignment = OK and Imbalance % is strong in your direction.
Reclaim setups: after a poke outside the band, a CVD divergence on the return through the middle often precedes a mean-reversion run.
Volume Profile v3.2 :
Use VAH/VAL/LVNs for location. A pullback-to-middle that coincides with VA boundary is A-tier.
Breakouts through LVNs with expanding bands tend to travel fast toward the next HVN/POC—good for continuation targets.
(A great screenshot: KC middle kiss at VAL with CVDv1 Efficient, then a move to POC.)
Common pitfalls KC v1 helps you avoid
Fading expansion: Trying to short the upper band when bands are widening and middle slopes up is how you get steamrolled. KC tells you it’s not that kind of day.
Chasing inside contraction: Buying every tiny outside poke while bands are pinched leads to whips. Let acceptance form; buy the retest to middle that holds.
Stops too tight: In trend, volatility is elevated; stops need to live beyond the middle or behind structure, not right at the band.
Practical defaults to start with
Length: 20
Multiplier: 2.0 (adjust ±0.2–0.4 per asset)
Bands Style: ATR
ATR Length: 10
Timeframes: works out of the box on 15m–4H; for 1–5m scalps, consider length=14; for daily swings, length=30.
Open source & disclaimer
This indicator is provided open source so traders can study, test, and adapt it to their workflow. No tool guarantees outcomes; risk management is essential.
Disclaimer — Not Financial Advice.
The “Keltner Channels v1 ” 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. 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.
自定义均线(多色 & 分级线宽)Title: Multi-Color Moving Average Suite (MA5…MA4320) — Pine v6
Summary (1–2 lines):
An overlay indicator that plots a full ladder of SMA lines from MA5 up to MA4320. Each MA has a unique color, and line width scales with period (short = thin, mid = medium, long = thick) to make trend structure easy to read at a glance.
What it does
• Plots 16 simple moving averages: 5, 10, 20, 30, 60, 120, 160, 240, 480, 720, 960, 1440, 1750, 2880, 4320.
• Distinct colors for every MA to avoid confusion when lines cluster.
• Period-based thickness:
• Short-term (<60) = thin,
• Mid-term (60–160) = medium,
• Long-term (≥240) = thick (capped; no unlimited growth).
• Designed for quick trend reading across intraday to multi-year cycles (especially useful for 24/7 markets like crypto).
How to use
1. Add the indicator to any chart (works on all symbols/timeframes).
2. Use the thin/medium/thick visual hierarchy to identify short-/mid-/long-term bias and crossovers.
3. On very low timeframes, consider hiding some ultra-long MAs if your chart has insufficient history.
Notes
• Built with Pine Script v6; uses ta.sma(close, length) only (no repainting).
• Very long MAs (e.g., 2880/4320) require enough bars; they will display na until sufficient history loads.
• No inputs/alerts by default—kept intentionally simple for clarity. (Easy to extend with toggles, custom colors, EMA/WMA options, alerts, etc.)
Credits
Author: TraderFinsher (customized multi-MA visualization with color and thickness hierarchy).
⸻
标题: 多色均线系统(MA5…MA4320)— Pine v6
摘要(1–2 句):
这是一个叠加在价格上的 SMA 均线组,从 MA5 到 MA4320。为每条均线设置了 独立颜色,并按 周期长度分级线宽(短=细、中=中等、长=较粗),让趋势结构一眼可读。
功能说明
• 绘制 16 条简单移动平均线:5、10、20、30、60、120、160、240、480、720、960、1440、1750、2880、4320。
• 全部不同颜色,避免密集时混淆。
• 线宽随周期分级:
• 短期(<60)= 细,
• 中期(60–160)= 中等,
• 长期(≥240)= 粗(封顶,不再无限加粗)。
• 适合从日内到多年周期的 趋势快速判读(对加密等 24/7 市场尤为友好)。
使用建议
1. 将指标添加到任意品种/周期。
2. 结合细/中/粗的视觉层级,判断短/中/长趋势与均线交叉。
3. 在较低周期下,如果历史数据不足,可隐藏部分超长均线。
注意事项
• 使用 Pine v6,仅调用 ta.sma(close, length),不重绘。
• 超长均线需要足够历史数据,未满足前会显示 na。
• 默认不含参数和告警,追求简洁清晰(后续可扩展开关、自定义颜色/线宽、EMA/WMA 选项与告警等)。
致谢
作者:TraderFinsher(基于颜色与线宽层级的多均线可视化)。
Impulse Range Compression & Expansion (IRCE)📌 Impulse Range Compression & Expansion (IRCE) – Visualizing Price Traps Before Breakouts
📖 Overview
The IRCE Indicator is a precision breakout detection tool designed to identify consolidation traps and price coil zones before expansion moves occur. Unlike traditional volatility indicators that rely solely on statistical thresholds (e.g., Bollinger Bands or ATR), IRCE focuses on behavioral price compression, detecting tight-range candle clusters and validating breakouts through body expansion and/or volume surges.
This makes it ideal for traders looking to:
• Catch breakouts from range traps
• Avoid choppy and premature signals
• Spot early-stage momentum moves based on clean price behavior
⸻
⚙️ How It Works
1. Impulse Range Compression Detection
• Measures the high-low range of each candle
• Compares it to a user-defined average range (default 7 bars)
• Flags candles where the range is significantly smaller (e.g., <60% of average)
• Groups these into tight clusters, indicating compression zones or potential “trap ranges”
2. Cluster Box Construction
• When a valid cluster (e.g., 3 or more tight candles) is detected, the indicator:
• Marks the high and low of the cluster
• Draws a shaded box over this “trap zone”
• This helps visually track where price has coiled before a breakout
3. Breakout Confirmation Logic
A breakout from the trap zone is only validated when:
• Price closes above the cluster high (bullish) or below the cluster low (bearish)
• One or both of the following confirm strength:
• Body Expansion: Current candle body is 120%+ of recent average
• Volume Expansion: Volume exceeds recent volume average
4. Optional Trend Filter
• An optional EMA filter (default: 50 EMA) ensures breakout signals align with trend direction
• Helps filter out countertrend noise in ranging markets
5. Signal Cooldown
• Prevents repeated signals by enforcing a cooldown period (e.g., 10 bars) between entries
⸻
🖥️ Visual Elements
• 📦 Yellow compression boxes represent tight price traps
• 🟢 Buy labels appear when price breaks above the trap with confirmation
• 🔴 Sell labels appear when price breaks below with confirmation
• All visuals are non-repainting and updated in real-time
🧠 How to Use
1. Wait for a yellow trap box to appear
2. Watch for a confirmed breakout from the trap zone
3. Take the trade in the direction of the breakout:
• Only if it satisfies body or volume confirmation
• And if trend alignment is enabled, it must match EMA direction
4. Place stops just outside the opposite end of the trap zone
5. Use risk/reward ratios or structure levels for exits
This logic works great on:
• Lower timeframes (scalping breakouts)
• Higher timeframes (detecting price coiling before major moves)
• Any market: Stocks, Crypto, FX, Commodities
⸻
🔒 Technical Notes
• ✅ No repainting
• ✅ No future-looking logic
• ✅ Suitable for both discretionary and systematic traders
• ✅ Built in Pine Script v6
SuperTrend Optimizer Remastered[CHE] SuperTrend Optimizer Remastered — Grid-ranked SuperTrend with additive or multiplicative scoring
Summary
This indicator evaluates a fixed grid of one hundred and two SuperTrend parameter pairs and ranks them by a simple flip-to-flip return model. It auto-selects the currently best-scoring combination and renders its SuperTrend in real time, with optional gradient coloring for faster visual parsing. The original concept is by KioseffTrading Thanks a lot for it.
For years I wanted to shorten the roughly two thousand three hundred seventy-one lines; I have now reduced the core to about three hundred eighty lines without triggering script errors. The simplification is generalizable to other indicators. A multiplicative return mode was added alongside the existing additive aggregation, enabling different rankings and often more realistic compounding behavior.
Motivation: Why this design?
SuperTrend is sensitive to its factor and period. Picking a single pair statically can underperform across regimes. This design sweeps a compact parameter grid around user-defined lower bounds, measures flip-to-flip outcomes, and promotes the combination with the strongest cumulative return. The approach keeps the visual footprint familiar while removing manual trial-and-error. The multiplicative mode captures compounding effects; the additive mode remains available for linear aggregation.
Originally (by KioseffTrading)
Very long script (~2,371 lines), monolithic structure.
SuperTrend optimization with additive (cumulative percentage-sum) scoring only.
Heavier use of repetitive code; limited modularity and fewer UI conveniences.
No explicit multiplicative compounding option; rankings did not reflect sequence-sensitive equity growth.
Now (remastered by CHE)
Compact core (~380 lines) with the same functional intent, no compile errors.
Adds multiplicative (compounding) scoring alongside additive, changing rankings to reflect real equity paths and penalize drawdown sequences.
Fixed 34×3 grid sweep, live ranking, gradient-based bar/wick/line visuals, top-table display, and an optional override plot.
Cleaner arrays/state handling, last-bar table updates, and reusable simplification pattern that can be applied to other indicators.
What’s different vs. standard approaches?
Baseline: A single SuperTrend with hand-picked inputs.
Architecture differences:
Fixed grid of thirty-four factor offsets across three ATR offsets.
Per-combination flip-to-flip backtest with additive or multiplicative aggregation.
Live ranking with optional “Best” or “Worst” table output.
Gradient bar, wick, and line coloring driven by consecutive trend counts.
Optional override plot to force a specific SuperTrend independent of ranking.
Practical effect: Charts show the currently best-scoring SuperTrend, not a static choice, plus an on-chart table of top performers for transparency.
How it works (technical)
For each parameter pair, the script computes SuperTrend value and direction. It monitors direction transitions and treats a change from up to down as a long entry and the reverse as an exit, measuring the move between entry and exit using close prices. Results are aggregated per pair either by summing percentage changes or by compounding return factors and then converting to percent for comparison. On the last bar, open trades are included as unrealized contributions to ranking. The best combination’s line is plotted, with separate styling for up and down regimes. Consecutive regime counts are normalized within a rolling window and mapped to gradients for bars, wicks, and lines. A two-column table reports the best or worst performers, with an optional row describing the parameter sweep.
Parameter Guide
Factor (Lower Bound) — Starting SuperTrend factor; the grid adds offsets between zero and three point three. Default three point zero. Higher raises distance to price and reduces flips.
ATR Period (Lower Bound) — Starting ATR length; the grid adds zero, one, and two. Default ten. Longer reduces noise at the cost of responsiveness.
Best vs Worst — Ranks by top or bottom cumulative return. Default Best. Use Worst for stress tests.
Calculation Mode — Additive sums percents; Multiplicative compounds returns. Multiplicative is closer to equity growth and can change the leaderboard.
Show in Table — “Top Three” or “All”. Fewer rows keep charts clean.
Show “Parameters Tested” Label — Displays the effective sweep ranges for auditability.
Plot Override SuperTrend — If enabled, the override factor and ATR are plotted instead of the ranked winner.
Override Factor / ATR Period — Values used when override is on.
Light Mode (for Table) — Adjusts table colors for bright charts.
Gradient/Coloring controls — Toggles for gradient bars and wick coloring, window length for normalization, gamma for contrast, and transparency settings. Use these to emphasize or tone down visual intensity.
Table Position and Text Size — Places the table and sets typography.
Reading & Interpretation
The auto SuperTrend plots one line for up regimes and one for down regimes. Color intensity reflects consecutive trend persistence within the chosen window. A small square at the bottom encodes the same gradient as a compact status channel. Optional wick coloring uses the same gradient for maximum contrast. The performance table lists parameter pairs and their cumulative return under the chosen aggregation; positive values are tinted with the up color, negative with the down color. “Long” labels mark flips that open a long in the simplified model.
Practical Workflows & Combinations
Trend following: Use the auto line as your primary bias. Enter on flips aligned with structure such as higher highs and higher lows. Filter with higher-timeframe trend or volatility contraction.
Exits/Stops: Consider conservative exits when color intensity fades or when the opposite line is approached. Aggressive traders can trail near the plotted line.
Override mode: When you want stability across instruments, enable override and standardize factor and ATR; keep the table visible for sanity checks.
Multi-asset/Multi-TF: Defaults travel well on liquid instruments and intraday to daily timeframes. Heavier assets may prefer larger lower bounds or multiplicative mode.
Behavior, Constraints & Performance
Repaint/confirmation: Signals are based on SuperTrend direction; confirmation is best assessed on closed bars to avoid mid-bar oscillation. No higher-timeframe requests are used.
Resources: One hundred and two SuperTrend evaluations per bar, arrays for state, and a last-bar table render. This is efficient for the grid size but avoid stacking many instances.
Known limits: The flip model ignores costs, slippage, and short exposure. Rapid whipsaws can degrade both aggregation modes. Gradients are cosmetic and do not change logic.
Sensible Defaults & Quick Tuning
Start with the provided lower bounds and “Top Three” table.
Too many flips → raise the lower bound factor or period.
Too sluggish → lower the bounds or switch to additive mode.
Rankings feel unstable → prefer multiplicative mode and extend the normalization window.
Visuals too strong → increase gradient transparency or disable wick coloring.
What this indicator is—and isn’t
This is a parameter-sweep and visualization layer for SuperTrend selection. It is not a complete trading system, not predictive, and does not include position sizing, transaction costs, or risk management. Combine with market structure, higher-timeframe context, and explicit risk controls.
Attribution and refactor note: The original work is by KioseffTrading. The script has been refactored from approximately two thousand three hundred seventy-one lines to about three hundred eighty core lines, retaining behavior without compiler errors. The general simplification pattern is reusable for other indicators.
Metadata
Name/Tag: SuperTrend Optimizer Remastered
Pine version: v6
Overlay or separate pane: true (overlay)
Core idea/principle: Grid-based SuperTrend selection by cumulative flip returns with additive or multiplicative aggregation.
Primary outputs/signals: Auto-selected SuperTrend up and down lines, optional override lines, gradient bar and wick colors, “Long” labels, performance table.
Inputs with defaults: See Parameter Guide above.
Metrics/functions used: SuperTrend, ATR, arrays, barstate checks, windowed normalization, gamma-based contrast adjustment, table API, gradient utilities.
Special techniques: Fixed grid sweep, compounding vs linear aggregation, last-bar UI updates, gradient encoding of persistence.
Performance/constraints: One hundred and two SuperTrend calls, arrays of length one hundred and two, label budget, last-bar table updates, no higher-timeframe requests.
Recommended use-cases/workflows: Trend bias selection, quick parameter audits, override standardization across assets.
Compatibility/assets/timeframes: Standard OHLC charts across intraday to daily; liquid instruments recommended.
Limitations/risks: Costs and slippage omitted; mid-bar instability possible; not suitable for synthetic chart types.
Debug/diagnostics: Ranking table, optional tested-range label; internal counters for consecutive trends.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Cycle Momentum Filter [JopAlgo]Cycle Momentum Filter (CMF) — spot “when” to engage the market, on any timeframe
Markets breathe in cycles (expansion → contraction) while momentum and trend decide which moves actually travel. CMF is a compact filter that blends those ideas so you can answer two questions before you click:
Is this a good moment to take a trade? (cycle position)
If I take it, is there enough force behind the move to carry it? (momentum + trend)
CMF does not replace your levels—use it with your location tools (e.g., Volume Profile v3.2 and Anchored VWAP). It simply keeps you out of entries taken at the wrong part of the swing or against weak momentum.
(When you add screenshots: image #1 should label each sub-line and the green/yellow/red background; image #2 can show CMF turning green at VAL + AVWAP before a rotation back to POC.)
What you’re seeing (and how to read it at a glance)
CMF draws five sub-lines around a zero line, plus a background color:
Cycle Oscillator (blue): where you are in the swing. Above zero ≈ cycle crest side; below zero ≈ trough side.
ROC % (purple): short-term price acceleration. Above zero = positive momentum; below zero = negative.
MACD Histogram (orange): classic impulse measure (fast–slow EMA gap). Above zero = bullish impulse.
EWO (cyan): Elliott Wave Oscillator (EMA fast – EMA slow). Above zero = trend tilt up.
RSI-MA (gray, plotted as RSI−50): smoothed RSI relative to 50. Above zero = buyers have the relative strength.
Background color = the filter result:
Green → bullish window: cycle favors longs and momentum/trend/RS confirm.
Red → bearish window: mirror logic.
Yellow → neutral: at least one piece disagrees—do less, or wait for alignment.
For new traders: Every sub-line crossing above/below zero is a yes/no vote. Green happens only when all bullish checks are true; red when all bearish checks are true.
How CMF is built (plain-English version)
Cycle (DPO-style): CMF subtracts a displaced SMA from price to remove trend and expose the swing. Below 0 = you’re on the dip side of the cycle; above 0 = rally side.
Momentum (ROC): percent change over roc_length bars; tells you if price is actually accelerating.
Impulse (MACD hist): measures push from fast vs slow EMAs.
Trend tilt (EWO): broader drift via two EMAs (fast/slow).
Participation bias (RSI-MA): smoothed RSI relative to 50 (plotted as RSI−50 so its zero line matches the others).
The signal rules are strict AND conditions:
Bullish = cycle < 0 and ROC > 0 and MACD hist > 0 and EWO > 0 and RSI-MA > 0.
Bearish = cycle > 0 and ROC < 0 and MACD hist < 0 and EWO < 0 and RSI-MA < 0.
Otherwise Neutral.
This strictness is deliberate: it cuts a lot of low-quality entries.
Using CMF on any timeframe
The framework is the same—only your anchors/targets change as you zoom.
Scalping (1–5m)
Where: VP v3.2 VAL/VAH/LVNs or Session AVWAP.
When: take longs when CMF turns green on/after a dip to your level; shorts when it turns red on/after a pop into resistance.
Skip: yellow reads in the middle of the range; that’s chop.
Tip: on very fast pairs, require two consecutive green/red bars before entry.
Intraday (15m–1H)
Use CMF green to time pullbacks to AVWAP or VA edges in the trend direction.
In balance days, wait for CMF color + level alignment to fade back to POC.
If CMF flips yellow after entry, tighten risk; if it flips against you, consider exiting early.
Swing (2H–4H)
Treat first green after a higher-timeframe pullback to Weekly AVWAP or composite VAL as your A-setup.
If CMF stays green through the first pullback, consider adding; the opposite for red in downtrends.
Position (1D–1W)
Fewer, bigger decisions: CMF green at Monthly/Quarterly AVWAP or at composite VAL suggests rotation toward POC/HVNs; CMF red at VAH suggests mean-reversion lower.
If CMF can’t turn green/red at key retests, that’s valuable: the level likely won’t hold.
Entries, exits, and risk (simple rules)
Entry: trade at a level when CMF just flips to your side (green for longs / red for shorts).
Invalidation: if CMF reverts to yellow immediately, it’s a warning; if it flips to the opposite color, that’s your soft stop condition—tighten or exit unless higher-timeframe context argues otherwise.
Targets: use Volume Profile v3.2 (POC/HVNs) and AVWAP (mean) for logical destinations.
Don’t use CMF alone for stops; place them beyond the level or structure.
Settings that actually matter (and how to tune them)
Cycle Length (default 20): swing detection.
Shorter (10–14): quicker flips, better for scalps.
Longer (30–40): steadier cycle for swings/position.
ROC Length (default 10): momentum lookback.
Shorter: earlier yes/no, more noise.
Longer: slower, more selective.
MACD Fast/Slow (5/13) & EWO Fast/Slow (5/35): impulse and drift.
Increase slow values to calm false flips; decrease fast to react sooner.
RSI Length (14) & Smoothing (5): participation tilt.
Reduce smoothing for faster confirmation; increase to avoid whips.
Background on/off: keep it on while learning; once you’re comfortable, you can hide the background and read the lines against zero.
Tuning tip: If you trade only a few coins, optimize Cycle and ROC first; leave MACD/EWO defaults. Then decide how strict you want RSI (try RSI smoothing = 3 for faster reads).
What to look for (pattern cheatsheet)
Green at a dip-level (VAL/AVWAP) → rotate toward POC/HVN.
Red at a pop-level (VAH/AVWAP) → rotate down toward POC/HVN.
Color holds through the retest → continuation is more likely.
Color flips against the breakout → watch for failed break and reclaim.
Only one line disagrees (e.g., ROC < 0 while others > 0) → expect slower follow-through; consider waiting one bar.
Combining CMF with other tools
Volume Profile v3.2 :
Use VAH/VAL/POC/LVNs for where. CMF answers when.
Green at VAL → mean-reversion long to POC.
Red at VAH → fade to POC.
LVN breaks with green often travel quickly to the next HVN.
Anchored VWAP :
Reclaim of AVWAP + CMF turns green → higher-quality long; rejection + red → cleaner short.
Weekly AVWAP + CMF color is a reliable swing compass.
Cumulative Volume Delta v1 (CVDv1):
CMF says “now”, CVDv1 says “how good”.
Prefer CMF green when CVDv1 Alignment = OK, Imbalance strong, Absorption ≠ red.
If CMF flips green but CVDv1 shows Absorption (red), do not chase; look for a reclaim instead.
Common pitfalls CMF helps you avoid
Buying high in the cycle: CMF keeps longs to when the cycle is on the dip side and momentum/trend agree.
Forcing trades on yellow: yellow is your do-less mode—wait for alignment.
Ignoring flow at levels: CMF gives the window, but quality still matters; confirm with CVDv1.
Practical defaults to start with
Cycle 20 | ROC 10 | MACD 5/13 | EWO 5/35 | RSI 14 (smooth 5)
Works out of the box on 15m–4H.
For scalps, try Cycle 14 / ROC 7–9 / RSI smooth 3.
For daily swings, Cycle 30–34 / ROC 12–14.
Alerts (what they tell you)
Bullish Signal: CMF turned green (all bullish checks passed). Use it as a heads-up; still anchor the entry to VP/AVWAP.
Bearish Signal: CMF turned red. Same rule: wait for the level.
Open source & disclaimer
This indicator is published open source so traders can learn, tweak, and build rules they trust. Tools guide decisions; risk management decides outcomes.
Disclaimer — Not Financial Advice.
The “Cycle Momentum Filter ” 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. 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.
Hour/Day/Month Optimizer [CHE] Hour/Day/Month Optimizer — Bucketed seasonality ranking for hours, weekdays, and months with additive or compounded returns, win rate, simple Sharpe proxy, and trade counts
Summary
This indicator profiles time-of-day, day-of-week, and month-of-year behavior by assigning every bar to a bucket and accumulating its return into that bucket. It reports per-bucket score (additive or compounded), win rate, a dispersion-aware return proxy, and trade counts, then ranks buckets and highlights the current one if it is best or worst. A compact on-chart table shows the top buckets or the full ranking; a last-bar label summarizes best and worst. Optional hour filtering and UTC shifting let you align buckets with your trading session rather than exchange time.
Motivation: Why this design?
Traders often see repetitive timing effects but struggle to separate genuine seasonality from noise. Static averages are easily distorted by sample size, compounding, or volatility spikes. The core idea here is simple, explicit bucket aggregation with user-controlled accumulation (sum or compound) and transparent quality metrics (win rate, a dispersion-aware proxy, and counts). The result is a practical, legible seasonality surface that can be used for scheduling and filtering rather than prediction.
What’s different vs. standard approaches?
Reference baseline: Simple heatmaps or average-return tables that ignore compounding, dispersion, or sample size.
Architecture differences:
Dual aggregation modes: additive sum of bar returns or compounded factor.
Per-bucket win rate and trade count to expose sample support.
A simple dispersion-aware return proxy to penalize unstable averages.
UTC offset and optional custom hour window.
Deterministic, closed-bar rendering via a lightweight on-chart table.
Practical effect: You see not only which buckets look strong but also whether the observation is supported by enough bars and whether stability is acceptable. The background tint and last-bar label give immediate context for the current bucket.
How it works (technical)
Each bar is assigned to a bucket based on the selected dimension (hour one to twenty-four, weekday one to seven, or month one to twelve) after applying the UTC shift. An optional hour filter can exclude bars outside a chosen window. For each bucket the script accumulates either the sum of simple returns or the compounded product of bar factors. It also counts bars and wins, where a win is any bar with a non-negative return. From these, it derives:
Score: additive total or compounded total minus the neutral baseline.
Win rate: wins as a percentage of bars in the bucket.
Dispersion-aware proxy (“Sharpe” column): a crude ratio that rises when average return improves and falls when variability increases.
Buckets are sorted by a user-selected key (score, win rate, dispersion proxy, or trade count). The current bar’s bucket is tinted if it matches the global best or worst. At the last bar, a table is drawn with headers, an optional info row, and either the top three or all rows, using zebra backgrounds and color-coding (lime for best, red for worst). Rendering is last-bar only; no higher-timeframe data is requested, and no future data is referenced.
Parameter Guide
UTC Offset (hours) — Shifts bucket assignment relative to exchange time. Default: zero. Tip: Align to your local or desk session.
Use Custom Hours — Enables a local session window. Default: off. Trade-off: Reduces noise outside your active hours but lowers sample size.
Start / End — Inclusive hour window one to twenty-four. Defaults: eight to seventeen. Tip: Widen if rankings look unstable.
Aggregation — “Additive” sums bar returns; “Multiplicative” compounds them. Default: Additive. Tip: Use compounded for long-horizon bias checks.
Dimension — Bucket by Hour, Day, or Month. Default: Hour. Tip: Start Hour for intraday planning; switch to Day or Month for scheduling.
Show — “Top Three” or “All”. Default: Top Three. Trade-off: Clarity vs. completeness.
Sort By — Score, Win Rate, Sharpe, or Trades. Default: Score. Tip: Use Trades to surface stable buckets; use Win Rate for skew awareness.
X / Y — Table anchor. Defaults: right / top. Tip: Move away from price clusters.
Text — Table text size. Default: normal.
Light Mode — Light palette for bright charts. Default: off.
Show Parameters Row — Info header with dimension and span. Default: on.
Highlight Current Bucket if Best/Worst — Background tint when current bucket matches extremes. Default: on.
Best/Worst Barcolor — Tint colors. Defaults: lime / red.
Mark Best/Worst on Last Bar — Summary label on the last bar. Default: on.
Reading & Interpretation
Score column: Higher suggests stronger cumulative behavior for the chosen aggregation. Compounded mode emphasizes persistence; additive mode treats all bars equally.
Win Rate: Stability signal; very high with very low trades is unreliable.
“Sharpe” column: A quick stability proxy; use it to down-rank buckets that look good on score but fluctuate heavily.
Trades: Sample size. Prefer buckets with adequate counts for your timeframe and asset.
Tinting: If the current bucket is globally best, expect a lime background; if worst, red. This is context, not a trade signal.
Practical Workflows & Combinations
Trend following: Use Hour or Day to avoid initiating trades during historically weak buckets; require structure confirmation such as higher highs and higher lows, plus a momentum or volatility filter.
Mean reversion: Prefer buckets with moderate scores but acceptable win rate and dispersion proxy; combine with deviation bands or volume normalization.
Exits/Stops: Tighten exits during historically weak buckets; relax slightly during strong ones, but keep absolute risk controls independent of the table.
Multi-asset/Multi-TF: Start with Hour on liquid intraday assets; for swing, use Day. On monthly seasonality, require larger lookbacks to avoid overfitting.
Behavior, Constraints & Performance
Repaint/confirmation: Calculations use completed bars only; table and label are drawn on the last bar and can update intrabar until close.
security()/HTF: None used; repaint risk limited to normal live-bar updates.
Resources: Arrays per dimension, light loops for metric building and sorting, `max_bars_back` two thousand, and capped label/table counts.
Known limits: Sensitive to sample size and regime shifts; ignores costs and slippage; bar-based wins can mislead on assets with frequent gaps; compounded mode can over-weight streaks.
Sensible Defaults & Quick Tuning
Start: Hour dimension, Additive, Top Three, Sort by Score, default session window off.
Too many flips: Switch to Sort by Trades or raise sample by widening hours or timeframe.
Too sluggish/over-smoothed: Switch to Additive (if on compounded) or shorten your chart timeframe while keeping the same dimension.
Overfit risk: Prefer “All” view to verify that top buckets are not isolated with tiny counts; use Day or Month only with long histories.
What this indicator is—and isn’t
This is a seasonality and scheduling layer that ranks time buckets using transparent arithmetic and simple stability checks. It is not a predictive model, not a complete trading system, and it does not manage risk. Use it to plan when to engage, then rely on structure, confirmation, and independent risk management for entries and exits.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Relative Volume (RVOL) [JopAlgo]Relative Volume (RVOL) — “Filter Fakes, Ride Real Moves”
What it does:
Shows how today’s volume compares to its own average.
RVOL = current volume ÷ SMA(volume, length)
RVOL > cutoff → participation above normal (green)
RVOL < cutoff → participation below normal (red)
Use it to confirm breaks, filter entries, and avoid chasing moves fueled by thin volume.
Read it in 5 seconds
Above/Below the cutoff line (white) = high/low participation now.
Spikes through the cutoff on a break = real interest.
Dry-ups (well below cutoff) into support/resistance = good risk for mean-revert or pullback entries.
If you remember one rule: don’t chase a breakout with RVOL under the cutoff.
Simple playbook (copy this)
Breakout confirmation
Break at VAH/LVN/structure and RVOL > cutoff → take the retest that holds.
If RVOL stays below cutoff on the break → likely fake; wait for reclaim.
Pullback in trend
Trend up, price pulls to AVWAP / VAL / MA cluster with RVOL below cutoff → take the bounce when price turns; add if RVOL rises on the resume.
Fade the exhaustion
Into resistance, huge RVOL spike but no follow-through (long wick, CVD Absorption) → look for the fail back inside value.
Do less in chop
When RVOL hugs below cutoff all session, expect range; trade edges only.
Timeframe guide
1–5m (scalps): Signals are frequent. Keep cutoff ≥ 1.5; demand RVOL on breaks.
15m–1H (intraday): Sweet spot. cutoff 1.5–2.0 is a solid filter.
2H–4H (swing): Look for clustered bars > cutoff during expansions; dry-ups flag pullback entries.
1D+: Use RVOL to separate true trend days from drift.
Settings that matter
Length (default 14):
Shorter = reacts faster; Longer = smoother baseline.
Intraday: 14–20
Swing/Daily: 20–30
Cutoff (default 1.0):
Set the bar for “real” volume.
Conservative confirmation: 1.5–2.0
For slower pairs/timeframes: 1.2–1.5
Tune by scrolling back and marking where good breaks happened.
Color logic: green above cutoff, red below—no surprises.
Best combos (kept simple)
Volume Profile v3.2 : Confirm breaks of VAH/VAL/LVNs with RVOL > cutoff; target POC/HVNs.
Anchored VWAP : Reclaims/rejections with RVOL > cutoff stick more often.
CVDv1 :
Yes: RVOL high and CVD Alignment OK and no Absorption → higher-quality move.
No: RVOL high but Absorption red → don’t chase; look for fail/reclaim.
Pattern cheat sheet
Trend day: RVOL stays > cutoff on pushes; pullbacks show RVOL dip, then re-expand.
False break: Price pokes level, RVOL < cutoff, quick give-back.
Accumulation: Series of low-RVOL bars compressing under a level → watch for the first RVOL pop to go.
Exhaustion wick: RVOL spike + long wick into resistance/support → likely trap unless next bar accepts.
Notes & pitfalls
Exchange volume varies (crypto): use the same feed you trade and calibrate cutoff there.
RVOL ≠ direction: it’s participation. Always pair with location, structure, and flow.
Quick defaults to start
Length: 20
Cutoff: 1.5 (intraday) / 1.8–2.0 (for stricter confirmation)
Process: Level → RVOL above/below cutoff → CVD quality → Execute with structure-based risk
Mini-disclaimer
Educational tool, not financial advice. Test first, size sensibly, and always anchor decisions to levels, flow, and risk.
All-Time High Marker//@version=5
indicator("All-Time High Marker", overlay=true)
// 計算歷史最高價
allTimeHigh = ta.highest(high, bar_index + 1)
// 如果現價等於歷史最高,就畫個符號
isATH = close >= allTimeHigh
plotshape(isATH, title="All-Time High", style=shape.labelup,
color=color.green, text="ATH", location=location.abovebar)
EMA 4/8/15The 4/8/15 are the main Moving Averages you need. . When it is inside the 4/8, it is moving slowly. If it detaches or launches above the 8, you have an increase in volume and price
Actually Engulfing CandlesticksThis thing attempts to find price reversals with actually engulfing candlesticks with volume spikes and RSI values as confirmation. It works well on mean reverting assets I guess.
Green dots below bars = bullish reversal
Fuchsia dots above bars = bearish reversal
Have fun!
ADX (Colored by Slope)_V2Option added to select 28/28 or 14/14. Also added a yellow line to mark level 20. Adx will turn red if it is lower than previous candle , else it will turn green.
Multi-Timeframe MACD with Color Mix (Nikko)Multi-Timeframe MACD with Color Mix (Nikko) Indicator
This documentation explains the benefits of the "Multi-Timeframe MACD with Color Mix (Nikko)" indicator for traders and provides easy-to-follow steps on how to use it. Written as of 05:06 AM +07 on Saturday, October 04, 2025, this guide focuses on helping you, as a trader, get the most out of this tool with clear, practical advice before diving into the technical details.
Benefits for Traders
1. Multi-Timeframe Insight
This indicator lets you see momentum trends across 15-minute, 1-hour, 1-day, and 1-week timeframes all on one chart. This big-picture view helps you catch both quick market moves and long-term trends without flipping between charts, saving you time and giving you a fuller understanding of the market.
2. Visual Momentum Representation
The background changes from red to green based on short-term (15m) momentum, giving you a quick, easy-to-see signal—red means bearish (prices might drop), and green means bullish (prices might rise). The histogram uses a mix of red, green, and blue colors to show the combined strength of the 1-hour, 1-day, and 1-week timeframes, helping you spot strong trends at a glance (e.g., a bright mix for strong momentum, darker for weaker).
3. Enhanced Decision-Making
The background and histogram colors work together to confirm trends across different timeframes, making it less likely you’ll act on a false signal. This helps you feel more confident when deciding when to buy, sell, or hold.
4. Proactive Alert System
You can set alerts to notify you when the percentage of bullish timeframes hits your chosen levels (e.g., below 10% for bearish, above 90% for bullish). This keeps you in the loop on big momentum shifts without needing to watch the chart all day—perfect for when you’re busy.
5. Flexibility and Efficiency
You can turn timeframes on or off, adjust settings like speed of the moving averages, and tweak transparency to fit your trading style—whether you’re a fast scalper or a patient swing trader. Everything is shown on one chart, saving you effort, and the colors make it simple to read, even if you’re new to trading.
How to Use It
Getting Started
Add the Indicator: Load the "Multi-Timeframe MACD with Color Mix (Nikko)" onto your TradingView chart using the Pine Script editor or indicator library.
Pick Your Timeframes: Turn on the timeframes that match your trading—use 15m and 1h for quick trades, or 1d and 1w for longer holds—using the enable_15m, enable_1h, enable_1d, enable_1w, and enable_background options.
Reading the Colors
Background Gradient: Watch for red to signal bearish 15m momentum and green for bullish momentum. Adjust the Background_transparency (default 75%, or 25% opacity) if the chart feels too busy—try lowering it to 50 for clearer candlesticks in fast markets.
Histogram and EMA Colors:
The histogram and its Exponential Moving Average (EMA) line show a mix of red (1-week), green (1-day), and blue (1-hour) based on how strong the momentum is in each timeframe.
Brighter colors mean stronger momentum—white (all bright) shows all timeframes are pushing up hard, while darker shades (like gray or black) mean weaker or mixed momentum.
Turn off a timeframe (e.g., enable_1h = false) to see how it changes the color mix and focus on what matters to you.
Setting Alerts
Set Your Levels: Choose a threshold_low (default 10%) and threshold_high (default 90%) based on your comfort zone or past market patterns to catch big turns.
Get Notifications: Use TradingView alerts to get pings when the market hits your set levels, so you can act without staring at the screen.
Practical Tips
Pair with Other Tools: Use it with support/resistance lines or the RSI to double-check your moves and build a solid plan.
Tweak Settings: Adjust fast_length, slow_length, and signal_smoothing to match your asset’s speed, and bump up the lookback (default 50) for steadier trends in wild markets.
Practice First: Test different timeframe combos on a demo account to find what works best for you.
Understanding the Colors (Simple Explanation)
How Colors Work
The histogram and its EMA line use a color mix based on a simple idea from color theory, like mixing paints with red, green, and blue (RGB):
Red comes from the 1-week timeframe, green from 1-day, and blue from 1-hour.
When all three timeframes show strong upward momentum, they blend into bright white—the brightest color, like a super-bright light telling you the market’s roaring up.
If some timeframes are weak or pulling down, the mix gets darker (like gray or black), warning you the momentum might not be solid.
Brighter is Better
Bright Colors = Strong Opportunity: The brighter the histogram and EMA (closer to white), the more all your chosen timeframes are in agreement that prices are rising. This is your signal to think about buying or holding, as it points to a powerful trend you can ride.
Dark Colors = Caution: A darker mix (toward black) means some timeframes are lagging or bearish, suggesting you might wait or consider selling. It’s like a dim light saying, “Hold on, check again.”
Benefit in Practice: Watching the brightness helps you jump on the best trades fast. For example, a bright white histogram on a green background is like a green traffic light—go for it! A dark gray on red is like a red light—pause and rethink. This quick color check can save you from bad moves and boost your profits when the trend is strong.
Why It Helps
These colors are your fast friend in trading. A bright histogram means all your timeframes are cheering for an uptrend, giving you the confidence to act. A dull one tells you to be careful, helping you avoid traps. It’s like having a color-coded guide to pick the hottest market moments!
Technical Details
Input Parameters
Fast Length (default: 12): Short-term moving average speed.
Slow Length (default: 26): Long-term moving average speed.
Source (default: close): Price data used.
Signal Smoothing (default: 9): Smooths the signal line.
MA Type (default: EMA): Choose EMA or SMA.
Timeframe and Scaling
Timeframes: 15m, 1h, 1d, 1w, with on/off switches.
Lookback Period (default: 50): Sets the data window for trends.
Background Transparency (default: 75%): Controls background see-through level.
MACD Calculation
Per Timeframe: Uses request.security():
MACD Line: ta.ema(src, fast_length) - ta.ema(src, slow_length).
Signal Line: ta.ema(MACD, signal_length).
Histogram: (macd - signal) / 3.0.
Background Gradient
15m Normalization: norm_value = (hist_15m - hist_15m_min) / max(hist_15m_range, 1e-10), limited to 0-1.
RGB Mix: Red drops from 255 to 0, green rises from 0 to 255, blue stays 0.
Apply: color.new(color.rgb(r_val, g_val, b_val), Background_transparency).
Histogram and EMA Colors
Color Assignment:
1h: Blue (#0000FF) if hist_1h >= 0, else black.
1d: Green (#00FF00) if hist_1d >= 0, else black.
1w: Red (#FF0000) if hist_1w >= 0, else black.
Final Color: final_color = color.rgb(min(r, 255), min(g, 255), min(b, 255)).
Plotting: Histogram and EMA use final_color; MACD (#2962FF), signal (#FF6D00).
Alerts
Bullish Percentage: bullish_pct = (bullish_count / bullish_total) * 100, counting hist >= 0.
Triggers: Below threshold_low or above threshold_high.
--------------------------------------------------------------------
Conclusion
The "Multi-Timeframe MACD with Color Mix (Nikko)" is your all-in-one tool to spot trends, confirm moves, and trade smarter with its bright, easy-to-read colors. By using it wisely, you can sharpen your market edge and trade with more confidence.
This README is tailored for traders and reflects the indicator's practical value as of 05:06 AM +07 on October 04, 2025.
Ultra Clean Support / Resistance LevelsThis provides an Ultra Clean look for Support and Resistance levels
Ultra Clean Support / Resistance LevelsThis Provides a very clean Support and Resistance level on any timeframe