Zyklen
Pattern Match & Forward Projection – Weekly (v6.0)
📊 Pattern Match & Forecast Indicator (Weekly)
This custom indicator is designed to identify recurring price patterns in historical data and then forecast potential outcomes into the future. It works by scanning past price movements over a defined lookback period and comparing them with the current market structure. When a sufficiently close match is found, it generates a forward projection that traders can use as a reference for possible scenarios.
🔧 Key Features & Parameters
Lookback period (bars/weeks): Defines how far back the script searches for similar price patterns (e.g., 750 weekly bars in this chart).
Match threshold (distance/shape similarity): Controls how closely past price patterns must resemble the current one.
Forward projection length: Determines how many bars ahead the indicator will forecast.
In this example, the projection covers the next 10 weeks 📅.
Traders can freely adjust this value (e.g., 5 weeks, 20 weeks, or more) depending on their strategy.
Return filters: Minimum % return requirement for a match to be considered valid (e.g., ≥ 1.5%).
Hit rate requirement: Sets the minimum historical success rate (e.g., ≥ 60%).
Averages & probabilities: Displays expected forward performance at different horizons (+2w, +4w, +8w, etc.).
📈 How It Helps
Detects historical analogs to current price action.
Provides forward-looking forecasts based on recurring structures.
Helps filter out weak signals by using statistical significance (hit rate + return filter).
Can be combined with other tools (Bollinger Bands, RSI, ATR) for confirmation.
⚙️ Customizable Parameters
Lookback window (number of bars to scan).
Similarity threshold (strict vs flexible pattern matching).
Projection horizon (how far ahead to forecast: 5–50 weeks or more).
Return & hit filters (to only keep high-probability setups).
Universal Gann Square & Cube LevelsUniversal Gann Square & Cube Levels - Dynamic Support/Resistance
Description:
📊 UNIVERSAL GANN LEVELS INDICATOR
This powerful indicator automatically plots Gann Square and Cube levels around the current stock price, providing dynamic support and resistance levels based on W.D. Gann's mathematical theories.
🎯 KEY FEATURES:
✅ Auto-Adaptive: Works for ANY stock price (₹20 to ₹100,000+)
✅ Real-time Detection: Uses current close price automatically
✅ Dual Level System: Square levels (black) + Cube levels (red)
✅ Customizable Range: Adjust percentage range (5% to 50%)
✅ Clean Display: Toggle square/cube lines independently
✅ Universal Compatibility: Works on all timeframes and instruments
📈 HOW IT WORKS:
Square Levels (Black Lines): Based on perfect squares (n²) around current price
Cube Levels (Red Lines): Based on perfect cubes (n³) around current price
Smart Range: Automatically calculates relevant levels within your specified percentage range
Info Display: Shows current price and level counts
⚙️ SETTINGS:
Price Range %: Control how many levels appear (default: 15%)
Show Square Levels: Toggle black square lines on/off
Show Cube Levels: Toggle red cube lines on/off
🔥 PERFECT FOR:
Day traders seeking precise entry/exit points
Swing traders identifying key support/resistance zones
Gann theory practitioners and students
Multi-timeframe analysis across all instruments
💡 USAGE TIPS:
Use 10-20% range for active day trading
Use 30-50% range for swing trading analysis
Watch for price reactions at square/cube intersections
Combine with volume analysis for confirmation
🌟 WHY THIS INDICATOR?
Unlike fixed Gann calculators, this indicator dynamically adapts to ANY price level, making it truly universal for Indian stocks, crypto, forex, and commodities.
⚠️ DISCLAIMER:
This indicator is for educational and informational purposes only. It is not financial advice and should not be considered as a recommendation to buy or sell any security. Trading involves significant risk of loss and may not be suitable for all investors. Past performance does not guarantee future results. Always conduct your own research and consult with a qualified financial advisor before making any investment decisions. The developer assumes no responsibility for any trading losses incurred through the use of this indicator.
📋 COMPATIBILITY:
All TradingView plans
All timeframes (1m to 1M)
Stocks, Crypto, Forex, Commodities
Mobile and desktop platforms
All Levels This script draws key price levels on your chart, including:
• Previous Day (PD): High, Low, Close
• Day Before Yesterday (DBY): High, Low, Close
• Pre-Market (PM): High and Low
• Today’s levels: High, Low, Open, Close
• Current bar levels: High, Low, Open, Close
Each level is displayed as a horizontal line with a label showing the level value.
It works on any timeframe, including 1-minute charts, and automatically updates as new bars form.
⸻
2. Features
1. Custom Colors
Each type of level has its own color, declared as a const color. For example:
• Previous Day High = red
• Today’s Close = gold
• Pre-Market High = fuchsia
2. Right-Extending Lines
All horizontal levels extend to the right, so you always see them on the chart.
3. Persistent Labels
Every line has a label at the right side showing its name and price. For example:
• PDH 422
• TODL 415.5
4. Dynamic Updates
The script updates automatically whenever a new bar forms, so levels stay accurate.
5. Session-Based Pre-Market
You can define the pre-market session (default “04:00–09:30 EST”). The script calculates the high and low of this session only.
6. Checkbox Inputs
You can enable/disable entire groups of levels:
• Previous Day
• Day Before Yesterday
• Pre-Market
• Today
• Current bar
Yearly VWAP with Z-Score V2This script extends the traditional Volume Weighted Average Price (VWAP) by applying it to yearly sessions (with a customizable start month) and combining it with a Z-Score framework to standardize price deviations from VWAP.
Features
Yearly VWAP: Automatically resets at the selected month, making it possible to align VWAP with fiscal or seasonal cycles (e.g., June–May).
Volatility-Weighted Bands: Standard deviation is calculated using volume-weighted price variance, creating adaptive upper and lower bands around VWAP.
Z-Score Calculation: Converts price distance from VWAP into standardized scores, ranging from +2.5 to –2.5. This enables statistical interpretation of whether price is trading at fair value, extended, or oversold relative to VWAP.
Custom Session Control: Input allows users to change the yearly anchor month.
On-Chart Display: VWAP and bands are plotted, with a live Z-Score label shown on the latest bar.
How to Use
Fair Value Reference: VWAP reflects the average price weighted by volume over the yearly session — a natural equilibrium point.
Overbought / Oversold Detection: Extreme Z-Score readings (±2 or beyond) highlight when price is stretched relative to VWAP.
Cycle Analysis: Resetting VWAP by custom months allows studying market behavior over fiscal years, seasons, or custom trading cycles.
Part of a Broader Toolkit: This script is not a standalone trading system. It works best when aggregated with other indicators, confluence factors, or a structured strategy.
Originality
Unlike a standard VWAP, this version:
Uses yearly anchoring with custom start month instead of session/day anchoring.
Adds volume-weighted standard deviation bands for statistical context.
Translates distance into a Z-Score scale for objective overbought/oversold assessment.
Positive Z-Score values indicate zones where price is positioned favorably for accumulation or potential buys, while negative values highlight areas more suitable for distribution or profit-taking — always best used in confluence with other tools rather than as a standalone signal
MMA Ribbon Opening SystemMMA Ribbon Opening System
The MMA Ribbon Opening System is designed to identify major trend peaks and bottoms by analyzing the behavior of a multi-moving-average (MMA) ribbon in combination with trend confirmation filters.
Core Logic
Ribbon Compression & Expansion – Detects when the moving average ribbon is tightly compressed (low volatility) and when it begins to open (momentum building).
Directional Bias – Classifies the ribbon as bullish (green) or bearish (red) based on the relative position of fast MAs to the 20-period MA.
Peak & Bottom Signals – Generates potential PEAK (trend exhaustion tops) or BTM (trend exhaustion bottoms) signals when ribbon expansion coincides with specific slope and price conditions.
MA20 Slope Filter – Uses the slope of the 20-period moving average to confirm steep uptrends, downtrends, or turning points and avoid false reversals.
RSI Filter – Applies RSI overbought/oversold zones as a secondary confirmation to reduce noise.
Enhanced Detection Mode – Prevents premature signals during strong trends by requiring contraction and limiting the number of ascending/descending MAs.
Features
Customizable thresholds for ribbon compression, expansion, and MA20 slope strength.
Signal lockout system to prevent rapid flip-flopping.
Visual ribbon plots with color-coded direction and background states (compressed, opening, max width, strong trend).
Clear PEAK and BTM markers on chart.
Info panel showing ribbon status, trend strength, MA20 slope, RSI, and readiness of signals.
Alert conditions for both Peak and Bottom events.
Use Case
This tool helps traders spot where a trend may be exhausting and a reversal is likely by combining ribbon structure with momentum filters. It works across assets and timeframes, and is especially useful for highlighting major turning points rather than every small fluctuation.
Volume Candle Rings [CHE]Volume Candle Rings – Spot Volume Extremes Fast 🔍
Marks exceptionally high volume right on the candle as concentric rings. Instantly see how extreme the spike is (levels 1–10), where it happens (anchor on HL2/Close/BodyMid), and how big it is relative to volatility (ATR-scaled). No magic, no blind signals—just clean context for better decisions.
Why it helps 🎯
Catch true extremes: Positive-side Z-Score maps spikes into 10 levels. By default, only 8/9/10 show—the ones that matter.
Context over clutter: Rings sit on the candle, scale with ATR (market regime), and widen in bars (time). Read absorption, breakout thrusts, or capitulation in context.
Signal the new, not the noise: Optional OFF→ON only drawing cuts chart noise and highlights fresh events.
How it works ⚙️
Z-Score: `z = (Vol – SMA(Vol, lookback)) / StDev(Vol, lookback)` → clipped at `zScoreCap`, normalized, and binned to 1..10 (0 = none). Only z > 0 counts.
Geometry: Vertical diameter = `Level × ATR(atrLength) × atrPerLevel`; horizontal radius = `Level × xBarsPerLevel` bars; curvatureFactor controls roundness.
Anchor: Choose HL2, Close, or BodyMid for the vertical center.
Performance: Keeps up to maxStoredCircles; FIFO cleanup to stay smooth.
Typical use cases 📈
Breakout confirmation: Clusters of 8–10 at range edges → rising initiative.
Absorption / fade: Extreme ring (9–10) without follow-through → potential stall or reversal.
Blow-off / climax: Single huge ring after a long run → higher odds of mean reversion.
News filtering: Show the real outliers, not every minor bump.
Inputs (mapped 1:1) 🧩
Z-Score & Levels
Lookback (SMA/StDev) – default 200
Z-Score Clipping – default 5.0
Behavior
Draw every bar – default ON; OFF = only on OFF→ON switches
Max circles to retain – default 120
Anchoring & Geometry
Anchor on candle – HL2 / Close / BodyMid
ATR Length – default 50
ATR per Level (Y) – default 0.25
Bars per Level (X) – default 0.15
Circle curvature – default 0.70
Level Selection (1–10)
Default: 8/9/10 ON, 1–7 OFF. Colors grade from teal/green → orange → red; fill opacity separate.
Quick presets ⏱️
Intraday (1–5m): Lookback 150–250, Cap 4.0–5.0, ATR/Level 0.20–0.30, Bars/Level 0.10–0.20, Draw every bar OFF.
Swing (1H–1D): Lookback 200–300, Cap 5.0, ATR/Level 0.25–0.35, Bars/Level 0.15–0.25, keep 8–10.
Aggressive scouting: Also enable Level 7 for early accumulation.
Pro tips 💡
Control object load: Reduce maxStoredCircles or switch Draw every bar OFF on busy charts.
Seek confluence: Combine rings with S/R, range edges, VWAP, session H/L. A ring is information, not an entry by itself.
Color discipline: Reserve red (9/10) for true extremes; keep lower levels subtle.
Limits & notes 🧭
This is visualization, not alerts or auto signals.
Many polylines can slow charts—tune Behavior settings.
Works across markets/timeframes; adapt parameters to the asset’s character.
Who it’s for 🙌
Traders who read volume in price context—breakouts, fades, reversals. See when the market is truly stepping on the gas.
Volume Candle Rings \ turns raw volume into precise, scale-aware markers. Spot extremes faster, avoid confusing “loud” with “important,” and make cleaner, context-driven decisions. 🚀
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.
Best regards and happy trading
Chervolino
ADX with MFIADX with MFI (by TanTechTrades™)
This indicator combines the Average Directional Index (ADX) with a custom MFI+RSI hybrid area to help traders identify market strength and momentum shifts.
🔑 Features
Custom Timeframe Selection – analyze ADX and MFI on any timeframe, independent of your chart.
ADX Trend Strength – highlights when market conditions are gaining or losing directional strength.
MFI+RSI Area – a hybrid momentum/flow tool that plots green when positive and red when negative, giving quick visual confirmation of strength/weakness.
Configurable Inputs – adjust smoothing, lengths, and colors to fit your strategy.
📊 How to Use
Look for ADX rising above 20 to confirm strong trends.
Use the MFI+RSI area as a momentum filter—green supports long setups, red supports shorts.
Combine with price action, support/resistance, and your trading system for best results.
💡 Tip: This tool is designed to help you confirm market direction and strength, not as a standalone entry signal. Always pair with solid risk management.
🔗 Visit TanTechTrades.com
for more tools, strategies, and trading resources.
Multi Momentum 10/21/42/63 — Histogram + 2xSMAMY MM INDICATOR INDIRED BY KARADI
It averages four rate-of-change snapshots of price, all anchored at today’s close.
If “Show as %” is on, the value is multiplied by 100.
Each term is a simple momentum/ROC over a different lookback.
Combining 10, 21, 42, 63 bars blends short, medium, and intermediate horizons into one number.
Positive MM → average upward pressure across those horizons; negative MM → average downward pressure.
Why those lengths?
They roughly stack into ~2× progression (10→21≈2×10, 21→42=2×21, 63≈1.5×42). That creates a “multi-scale” momentum that’s less noisy than a single fast ROC but more responsive than a long ROC alone.
How to read the panel
Gray histogram = raw Multi-Momentum value each bar.
SMA Fast/Slow lines (defaults 12 & 26 over the MM values) = smoothing of the histogram to show the trend of momentum itself.
Typical signals
Zero-line context:
Above 0 → bullish momentum regime on average.
Below 0 → bearish regime.
Crosses of SMA Fast & Slow: momentum trend shifts (fast above slow = improving momentum; fast below slow = deteriorating).
Histogram vs SMA lines: widening distance suggests strengthening momentum; narrowing suggests momentum is fading.
Divergences: price makes a new high/low but MM doesn’t → potential exhaustion.
Compared to a classic ROC
A single ROC(20) is very sensitive to that one window.
MM averages several windows, smoothing idiosyncrasies (e.g., a one-off spike 21 bars ago) and reducing “lookback luck.”
Settings & customization
Lookbacks (10/21/42/63): you can tweak for your asset/timeframe; the idea is to mix short→medium horizons.
Percent vs raw ratio: percent is easier to compare across symbols.
SMA lengths: shorter = more reactive but choppier; longer = smoother but slower.
Practical tips
Use regime + signal: trade longs primarily when MM>0 and fast SMA>slow SMA; consider shorts when MM<0 and fast
Time Cycle IntervalsTo set time ranges in a chart within a day
Timezone: To sync with current timezone selected on the chart, where Exchange represent the chart Exchange timezone, New York for New York Time
New Day Start: Example New Day for New York Start at 17:00 seen on chart, thus value as "17:00"
Customisable MacrosSimple indicator that enables users to visualise customisable time ranges using a vertical column.
Positional Toolbox v6 (distinct colors)what the lines mean (colors)
EMA20 (green) = fast trend
EMA50 (orange) = intermediate trend
EMA200 (purple, thicker) = primary trend
when the chart is “bullish” vs “bearish”
Bullish bias (look for buys):
EMA20 > EMA50 > EMA200 and EMA200 sloping up.
Bearish bias (avoid longs / consider exits):
EMA20 < EMA50 < EMA200 or price closing under EMA50/EMA200.
the two buy signals the script gives you
Pullback Long (triangle up)
Prints when price dips to EMA20 (green) and closes back above it while trend is bullish and ADX is decent.
Entry: buy on the same close or on a break of that candle’s high next day.
Stop: below the pullback swing-low (or below EMA50 for simplicity).
Best for: adding on an existing uptrend after a shallow dip.
Breakout 55D (“BO55” label)
Prints when price closes above prior 55-day high with volume surge in a bullish trend.
Entry: on the close that triggers, or next day above the breakout candle’s high.
Stop: below the breakout candle’s low (conservative: below base low).
Best for: fresh trend legs from bases.
simple “sell / exit” rules
Trend exit (clean & mechanical): exit if daily close < EMA50 (orange).
More conservative: only exit if close < EMA200 (purple).
Momentum fade / weak breakout: if BO55 triggers but price re-closes back inside the base within 1–3 sessions on above-avg volume → exit or cut size.
Profit taking: book some at +1.5R to +2R, trail the rest (e.g., below prior swing lows or EMA20).
quick visual checklist (what to look for)
Are the EMAs stacked up (green over orange over purple)? → ok to buy setups.
Did a triangle print near EMA20? → pullback long candidate.
Did a BO55 label print with strong volume? → breakout candidate.
Any close under EMA50 after you’re in? → reduce/exit.
timeframe
Use Daily for positional signals.
If you want a tighter entry, drop to 30m/1h only to time the trigger—but keep decisions anchored to the daily trend.
alerts to set (so you don’t miss signals)
Add alert on Breakout 55D and Pullback Long (from the indicator’s alertconditions).
Optional price alerts at the breakout level or EMA20 touch.
risk guardrails (MTF friendly)
Risk ≤1% of capital per trade.
Avoid fresh entries within ~5 trading days of earnings unless you accept gap risk.
Prefer high-liquidity NSE F&O names (your CSV watchlist covers this).
TL;DR (super short):
Green > Orange > Purple = uptrend.
Triangle near green = buy the pullback; stop under swing low/EMA50.
BO55 label = buy the breakout; stop under breakout candle/base.
Exit on close below EMA50 (or below EMA200 if you’re giving more room).
Linhas Max/Min 30m - Histórico CompletoMarks highs and lows for all 30-minute blocks, at any time.
Maintains the segmentation logic from the candle in which it occurred to the end of the block.
Works on any timeframe.
Linhas Max/Min 30m - ALL CICLEMarks highs and lows for all 30-minute blocks, at any time.
Maintains the segmentation logic from the candle in which it occurred to the end of the block.
Works on any timeframe.
Doodee SuperTrader EMAThe Exponential Moving Average (EMA) for the 49, 89, and 200 lines, or the Exponential Moving Average, is an indicator used in technical analysis to detect market price trends. It gives more weight to recent price data than to past price data, unlike the Simple Moving Average (SMA), which gives equal weight to price data.
Because the EMA responds to rapid price changes, it is ideal for detecting short-term trading signals.
From Doodee
350DMA bands + Z-score (V2)This script extends the classic 350-day moving average (350DMA) by building dynamic valuation bands and a Z-Score framework to evaluate how far price deviates from its long-term mean.
Features
350DMA Anchor: Uses the 350-day simple moving average as the baseline reference.
Fixed Multipliers: Key bands plotted at ×0.625, ×1.0, ×1.6, ×2.0, and ×2.5 of the 350DMA — historically significant levels for cycle analysis.
Z-Score Mapping: Price is converted into a Z-Score on a scale from +2 (deep undervaluation) to –2 (extreme overvaluation), using log-space interpolation for accuracy.
Custom Display: HUD panel and on-chart label show the current Z-Score in real time.
Clamp Option: Users can toggle between raw Z values or capped values (±2).
How to Use
Valuation Context: The 350DMA is often considered a “fair value” anchor; large deviations identify cycles of under- or over-valuation.
Z-Score Insight:
Positive Z values suggest favorable accumulation zones where price is below long-term average.
Negative Z values highlight zones of stretched valuation, often associated with distribution or profit-taking.
Strategic Application: This is not a standalone trading system — it works best in confluence with other indicators, cycle models, or macro analysis.
Originality
Unlike a simple DMA overlay, this script:
Provides multiple cycle-based bands derived from the 350DMA.
Applies a logarithmic Z-Score mapping for more precise long-term scaling.
Adds an integrated HUD and labeling system for quick interpretation.
200WMA Overlay + Z (heatmap mapping)This script enhances the classic 200-week moving average (200WMA), a long-term market reference line, by adding Z-Score mapping and optional helper bands for extended cycle analysis.
Features
200WMA Anchor: Plots the true 200-week simple moving average on any chart, a widely followed metric for long-term Bitcoin and crypto cycles.
Helper Multiples: Optional overlay of key historical ratios (×0.625, ×1.6, ×2.0, ×2.5) often referenced as cycle support/resistance zones.
Z-Score Mapping: Translates the ratio of price to 200WMA into a Z-Score scale (from +2.5 to –2.5), offering a statistical perspective on whether the market is undervalued, neutral, or overheated relative to its long-term mean.
On-Chart Label: Current Z-Score displayed directly on the last bar for quick reference.
How to Use
Long-Term Valuation: The 200WMA serves as a “fair value” baseline; large deviations highlight extended phases of market sentiment.
Heatmap Context:
Positive Z values typically mark undervaluation or favorable accumulation zones.
Negative Z values highlight overvaluation or profit-taking / distribution zones.
Strategic View: Best used to contextualize long-term market cycles, not for short-term signals.
Confluence Approach: This indicator should not be used alone — combine it with other technical or fundamental tools for stronger decision-making.
Originality
Unlike a basic 200WMA overlay, this version:
Incorporates multi-band ratios for extended cycle mapping.
Introduces a custom Z-Score scale tied directly to price/WMA ratios.
Provides both visual structure and statistical interpretation on a single overlay.
Long-only Swing/Scalp (anchored exits + TP harness) Traders PostThis is the Traders Post friendly drag and drop version of the swing/ scalp strategy for the algo traders out there. Let me know your thoughts, constructive criticism is always welcome.
EMP Probabilistic [CHE]Part 1 — For Traders (Practical Overview, no formulas)
What this tool does
EMP Probabilistic \ turns raw price action into a clean, probability-aware map. It builds two adaptive bands around the session open of a higher timeframe you choose (called the S-timeframe) and highlights a robust median threshold. At a glance you know:
Where price has recently tended to stay,
Whether current momentum sits above or below the median, and
A live Long vs. Short probability based on recent outcomes.
Why it improves decisions
Objective context in any regime: The nonparametric band comes straight from recent market behavior, without assuming a particular distribution.
Volatility-aware risk lens: The parametric band adapts to current volatility, helping you judge stretch and room for continuation or snap-back.
No lookahead: All stats update only after an S-bar is finished. That means the panel reflects information you truly had at that time.
How to read the chart
Orange band = empirical, distribution-free range derived from recent session returns (nonparametric).
Teal band = volatility-scaled range around the session open (parametric).
Median dots: green when close is above the median threshold, red when below.
Info panel: shows the active S-timeframe, window sizes, live coverage for both bands, the internal width parameter and volatility estimate, plus a one-line summary.
Probability label: “Long XX% • Short YY%” — a simple read on the recent balance of up vs. down S-bars.
How to use it (quick start)
1. Choose S-timeframe with Auto, Multiplier, or Manual. “Auto” scales your chart TF up to a sensible higher step.
2. Set alpha to control how tight the inner band should be. A typical value gives you a comfortable center zone without cutting off healthy trends.
3. Trade the context:
Trend-following: Prefer longs when price holds above the median; prefer shorts when it stays below.
Mean-reversion: Fade moves near the outer edges during ranges; look for reversion back toward the median.
Breakout filter: Require closes that push and hold beyond the volatility band for momentum plays; avoid noise when price chops inside the middle of the orange band.
Risk management made practical
Size positions relative to the teal band width to keep risk consistent across instruments and regimes.
For stops, many traders set them just beyond the opposite orange bound or use a fraction of the teal band.
Watch the panel’s coverage readouts and Brier score; when they deteriorate, the market may be shifting — reduce size or demand stronger confirmation.
Suggested presets
Scalping (Crypto/FX): Auto S-TF, alpha around a fifth, calibration window near two hundred, RS volatility, metrics window near two hundred.
Intraday Futures: Multiplier 3–5× your chart TF; similar alpha and window sizes; RS volatility is a solid default.
Swing/Equities: S-TF at least daily; test both RS and GK volatility modes; keep windows on the larger side for stability.
What makes it different
Two complementary lenses: a distribution-free read of recent behavior and a volatility-scaled read for risk and stretch.
Self-calibrating width: the parametric band quietly nudges its internal multiplier so actual coverage tracks your target.
Clean UX: grouped inputs, tooltips, an info panel that tells you what’s going on, and a simple median bias you can act on.
Repainting & timing
The logic updates only when the S-bar closes. On lower-timeframe charts you’ll see intrabar flips of the dot color — that’s just live price moving around. For strict signals, confirm on S-bar close.
Friendly note (not financial advice)
Use this as a context engine. It won’t predict the future, but it will keep you on the right side of probability and volatility more often, which is exactly where consistency starts.
Part 2 — Under the Hood (Conceptual, no formulas)
Data and timeframe design
The script works on a higher S-timeframe you select. It fetches the open, high, low, close, and time of that S-bar. Internally, it only updates its rolling windows after an S-bar has finished. It then pushes the previous S-bar’s statistics into its arrays. That design removes lookahead and keeps the metrics out-of-sample relative to the current S-bar.
Nonparametric band (distribution-free)
The orange band comes from the empirical distribution of recent session-level close-minus-open moves. The script keeps a rolling window, sorts a safe copy, and reads three key points: a lower bound, a median, and an upper bound. Because it’s based purely on observed outcomes, it adapts naturally to skew, fat tails, and regime shifts without assuming any particular shape. The orange range shows “where price has tended to live” lately on the chosen S-timeframe.
Parametric band (volatility-scaled)
The teal band models log-space variability around the session open using one of two well-known OHLC volatility estimators: Rogers–Satchell or Garman–Klass. Each estimator contributes a per-bar variance figure; the script averages these across the rolling window to form a current volatility scale. It then builds a symmetric band around the session open in price space. This gives you a volatility-aware notion of stretch that complements the distribution-free orange band.
Self-calibration of band width
The teal band has an internal width multiplier. After each completed S-bar the script checks whether the realized move stayed inside that band. If the band was too tight, the multiplier is nudged upward; if it was too loose, it’s eased downward. A simple learning rate governs how quickly it adapts. Over time this keeps the realized inside-coverage close to the target implied by your alpha setting, without you having to hand-tune anything.
Long/Short probability and calibration quality
The Long vs. Short probability is a transparent statistic: it’s just the recent fraction of up sessions in the rolling window. It is not a complex model — and that’s the point. You get an honest, intuitive read on directional tendency.
To monitor how well this simple probability lines up with reality, the script tracks a Brier-style score over a separate metrics window. Lower is better: it means your recent probability read has matched outcomes more closely.
Coverage tracking for both bands
The panel reports coverage for the orange band (nonparametric) and the teal band (parametric). These are rolling averages of how often recent S-bar moves landed inside each band. Watching these two numbers tells you whether market behavior still aligns with the recent distribution and with the current volatility model.
Why it doesn’t repaint
Because the arrays update only when an S-bar closes and only push the previous bar’s stats, the panel and metrics reflect information you had at the time. Intrabar visuals can change while a bar is forming — that’s expected — but the decision framework itself is anchored to completed S-bars.
Performance and practicality
The heaviest step is sorting a copy of the window for the nonparametric band. With typical window sizes this stays responsive on TradingView. The volatility estimators and rolling averages are lightweight. Inputs are grouped with clear tooltips so you can tune without hunting.
Limitations and good practice
In thin or gappy markets the bands can jump; consider a larger window or a higher S-timeframe.
During violent regime shifts, shorten the window and increase the learning rate slightly so the teal band catches up faster — but don’t overdo it, or you’ll chase noise.
The Long/Short probability is intentionally simple; it’s a context indicator, not a standalone signal factory. Combine it with structure, volume, or your execution rules.
Takeaway
Under the hood, the script blends empirical behavior and volatility scaling, then self-calibrates so the teal band’s real-world coverage stays near your target. You get clarity, consistency, and a dashboard that tells you when its own assumptions are holding up — exactly what you need to trade with confidence.
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.
Best regards and happy trading
Chervolino
Asian Stock Open (00:00 UTC Daily)Simple TSE daily open indicator, 500 line history, to help prepare for potential weekly open volatility from Asia trading