FIBOtomgoodcar v1Fibonacci Levels, Code Names, Usage Strategies, Colors
78.6% (fib_786_buy) 💰 Buy Trap (78.6%) A very important entry point (Buy Trap). Considered the deepest level of the consolidation before the uptrend continues. Blue
61.8% (fib_618_buy) 💰 Buy Trap (61.8%) The most common entry point (Buy Trap). When the price consolidates in an uptrend: Green
50.0% 50.00% Mid-trend consolidation level. Yellow
127.2% (fib_1272_sell) 🎯 127.2% target (sell trap) Profit target (Target/Sell Trap) for uptrend trading after the price breaks through the previous High. Orange
161.8% (fib_1618_sell) 🎯 161.8% target (sell trap) Profit target (Target/Sell Trap) The most important and popular for Fibonacci extensions. Red
I created this indicator to help traders who know nothing about trading. It might be worthless if you don't use it. Only 200 baht for this amazing indicator.
Statistics
Smart Money Confluence Heatmap [PhenLabs]📊 Smart Money Confluence Heatmap
Version: Pine Script™ v6
📌 Description
The Smart Money Confluence Heatmap is a professional‑grade Smart Money Concepts indicator designed to identify high‑probability institutional trading zones. It merges multiple advanced market factors into a single confluence score, allowing traders to focus only on areas that matter. By synthesizing Fair Value Gaps, Order Blocks, Liquidity Sweeps, Volume Strength, and Market Structure, this script removes subjective bias and replaces it with data‑driven confirmation.
🚀 Points of Innovation
Unified confluence scoring system combining five institutional concepts
Adaptive ATR‑based zone sizing for volatility‑adjusted precision
Automatic trend and structure alignment scoring
Volume‑validated Order Blocks and Liquidity Sweeps
Probability‑ranked zones instead of static levels
🔧 Core Components
Fair Value Gap detection with imbalance strength scoring
Order Block identification confirmed by displacement and volume
Liquidity sweep analysis using wick depth and volume expansion
Volume strength modeling for accumulation and distribution phases
Market structure confirmation using BOS and directional bias
🔥 Key Features
Confluence heatmap zones graded by bullish and bearish probability
Minimum score filtering to remove low‑quality setups
Automatic risk‑to‑reward based TP and SL projections
Entry alerts when price taps validated institutional zones
🎨 Visualization
Color‑graded heatmap zones representing probability strength
Percentage score labels with component icons
On‑chart dashboard displaying market bias and structure state
✅ Best Use Cases
Liquidity sweep reversals at key structure levels
Trend‑aligned pullbacks into institutional zones
Intraday and swing trading using confluence confirmation
⚠️ Limitations
Not designed for low‑liquidity or extremely ranging markets
Confluence does not guarantee outcomes and requires risk management
💡 What Makes This Unique
Objective probability scoring instead of subjective SMC interpretation
Multi‑layer institutional confirmation in a single indicator
Built for traders who demand clarity, not chart clutter
💡 Note:
This indicator is for educational purposes only and should always be used alongside proper risk management and higher‑timeframe context.
MADZ - Moving Average Deviation Z-ScoreMADZ - Moving Average Deviation Z-Score
MADZ is a powerful valuation oscillator that measures how far the current price has deviated from a user-selected moving average, expressed in statistical terms as a Z-Score. This normalization makes it easier to identify overvalued and undervalued conditions across different assets, timeframes, and market environments.
Overview
The indicator works by:
Calculating the percentage deviation of price from a customizable moving average (SMA, EMA, WMA, VWMA, HMA, or RMA).
Applying a Z-Score transformation to this deviation over a chosen lookback period — showing how many standard deviations the current deviation is from its historical average. Smoothing the result for a clean, responsive oscillator centered around zero.
Positive values indicate price is trading above the moving average (potentially overvalued), while negative values suggest price is below (potentially undervalued). The further from zero, the greater the relative valuation extreme.
Key Features
Customizable base moving average (type and length)
Z-Score normalization for statistically meaningful readings
Final smoothing for reduced noise
Static overbought/oversold levels (default ±1.5) — line changes color when crossed (red above, green below)
Dynamic extreme bands (±3σ) — optional display of bands calculated from the oscillator’s own volatility over a user-defined period
Extreme zone highlighting — background shading activates only during truly rare valuation events
Extreme Zone Highlighting Explained
The highlighted extreme zones (background shading) are not based on the fixed static levels. Instead, they signal statistically significant outliers using dynamic bands:
Overbought extreme zone (red background): Triggered when MADZ rises above the upper dynamic band (+3 standard deviations of the MADZ line itself over the dynamic length period).
Oversold extreme zone (green background): Triggered when MADZ falls below the lower dynamic band (-3 standard deviations).
These ±3σ bands adapt to the recent behavior of the oscillator. Because they represent three standard deviations from the mean of MADZ, crossings are rare and often precede major reversals or trend accelerations — making them valuable for spotting potential turning points in valuation extremes.
How to Use
Use zero-line crosses for trend changes or mean-reversion setups.
Watch static level crossings (±1.5 default) for early overbought/oversold warnings.
Pay special attention to extreme zone shading — these highlight high-conviction valuation dislocations that may offer superior risk/reward opportunities.
Designed on the BTC chart, but can be used on other assets.
Settings
Moving Average Settings: Type, length, source
Z-Score & Smoothing: Lookback period and smoothing length
Threshold Levels: Static overbought/oversold thresholds
Display Options: Toggle dynamic bands and extreme background highlighting
This is an educational tool designed to aid in valuation analysis. The information provided is not financial advice. Always conduct your own research and consider multiple factors before making trading decisions. Trade at your own risk.
Bloomberg Mega Board [v2.5 Fixed]Transform your TradingView chart into a professional-grade command center. Designed for traders who need high-level market awareness without switching tabs, this dashboard provides deep, multi-timeframe analysis across US Sectors, Commodities, Currencies, and Crypto.
Key Features
1. Multi-Asset Paging System Pine Script has a limit of 40 security calls, which usually limits how much data you can see. This script bypasses that limitation using a smart Paging System:
Sectors Page: Tracks the top 10 US Sectors (SPY, XLK, XLF, etc.) & Indices.
Commodities Page: Gold, Silver, Oil, Gas, Copper, Corn, etc.
Currencies Page: Major Forex pairs including DXY, EURUSD, USDJPY.
Crypto Page: Top 10 Cryptocurrencies by volume.
Switch pages instantly via the Settings menu.
2. Smart "News" Headlines Since Pine Script cannot access the live internet for news, this script uses an Algorithmic Headline Generator. It analyzes price action and trend alignment to generate a "Market Status" summary:
Full Bull Trend: Intraday + Daily + Weekly trends are all positive.
Strong Rally: Asset is up significantly (>1.25%) on the day.
Heavy Sell-off: Asset is down significantly (<-1.25%) on the day.
Pullback (Buy?): Daily trend is UP, but Intraday is DOWN (potential entry).
Consolidating: Market is chopping sideways.
3. Timeframe Trend Matrix Monitor momentum across the curve with a single glance. The "Trend" columns are powered by the 5 EMA (Exponential Moving Average):
Intraday: Adapts to your current chart timeframe (e.g., switch your chart to 15m to see the 15m trend).
Daily / Weekly / Monthly: These are hard coded to always show the higher timeframe trend, regardless of what chart you are looking at. Trend is determined by price in relation to it's 5 EMA.
4. "Terminal" Aesthetic
Styled with a dark, high-contrast Bloomberg Terminal look.
Uses Amber tickers and Neon status blocks for rapid visual scanning.
Optimized for Full Screen Mode: Hide your main chart candles to turn your monitor into a dedicated data dashboard.
How to Use
Add the indicator to your chart and move it to "New Lower Indicator" Then repeat 4 times for each dashboard.
Open Settings (the gear icon) and find "Select Page".
Choose your desired market view (e.g., Sectors, Crypto, Currencies, Commodities)
Optional: To replicate the full dashboard look, go to your Chart Settings -> Symbol -> Uncheck "Body" and "Borders" to hide the candles behind the table.
2 hours ago
Release Notes
Transform your TradingView chart into a professional-grade command center. Designed for traders who need high-level market awareness without switching tabs, this dashboard provides deep, multi-timeframe analysis across US Sectors, Commodities, Currencies, and Crypto.
Key Features
1. Multi-Asset Paging System Pine Script has a limit of 40 security calls, which usually limits how much data you can see. This script bypasses that limitation using a smart Paging System:
Sectors Page: Tracks the top 10 US Sectors (SPY, XLK, XLF, etc.) & Indices.
Commodities Page: Gold, Silver, Oil, Gas, Copper, Corn, etc.
Currencies Page: Major Forex pairs including DXY, EURUSD, USDJPY.
Crypto Page: Top 10 Cryptocurrencies by volume.
Switch pages instantly via the Settings menu.
2. Smart "News" Headlines Since Pine Script cannot access the live internet for news, this script uses an Algorithmic Headline Generator. It analyzes price action and trend alignment to generate a "Market Status" summary:
Full Bull Trend: Intraday + Daily + Weekly trends are all positive.
Strong Rally: Asset is up significantly (>1.25%) on the day.
Heavy Sell-off: Asset is down significantly (<-1.25%) on the day.
Pullback (Buy?): Daily trend is UP, but Intraday is DOWN (potential entry).
Consolidating: Market is chopping sideways.
3. Timeframe Trend Matrix Monitor momentum across the curve with a single glance. The "Trend" columns are powered by the 5 EMA (Exponential Moving Average):
Intraday: Adapts to your current chart timeframe (e.g., switch your chart to 15m to see the 15m trend).
Daily / Weekly / Monthly: These are hard coded to always show the higher timeframe trend, regardless of what chart you are looking at. Trend is determined by price in relation to it's 5 EMA.
4. "Terminal" Aesthetic
Styled with a dark, high-contrast Bloomberg Terminal look.
Uses Amber tickers and Neon status blocks for rapid visual scanning.
Optimized for Full Screen Mode: Hide your main chart candles to turn your monitor into a dedicated data dashboard.
How to Use
Add the indicator to your chart and move it to "New Lower Indicator" Then repeat 4 times for each dashboard.
Open Settings (the gear icon) and find "Select Page".
Choose your desired market view (e.g., Sectors, Crypto, Currencies, Commodities)
Optional: To replicate the full dashboard look, go to your Chart Settings -> Symbol -> Uncheck "Body" and "Borders" to hide the candles behind the table.
2 hours ago
Release Notes
Transform your TradingView chart into a professional-grade command center. Designed for traders who need high-level market awareness without switching tabs, this dashboard provides deep, multi-timeframe analysis across US Sectors, Commodities, Currencies, and Crypto.
Key Features
1. Multi-Asset Paging System Pine Script has a limit of 40 security calls, which usually limits how much data you can see. This script bypasses that limitation using a smart Paging System:
Sectors Page: Tracks the top 10 US Sectors (SPY, XLK, XLF, etc.) & Indices.
Commodities Page: Gold, Silver, Oil, Gas, Copper, Corn, etc.
Currencies Page: Major Forex pairs including DXY, EURUSD, USDJPY.
Crypto Page: Top 10 Cryptocurrencies by volume.
Switch pages instantly via the Settings menu.
2. Smart "News" Headlines Since Pine Script cannot access the live internet for news, this script uses an Algorithmic Headline Generator. It analyzes price action and trend alignment to generate a "Market Status" summary:
Full Bull Trend: Intraday + Daily + Weekly trends are all positive.
Strong Rally: Asset is up significantly (>1.25%) on the day.
Heavy Sell-off: Asset is down significantly (<-1.25%) on the day.
Pullback (Buy?): Daily trend is UP, but Intraday is DOWN (potential entry).
Consolidating: Market is chopping sideways.
3. Timeframe Trend Matrix Monitor momentum across the curve with a single glance. The "Trend" columns are powered by the 5 EMA (Exponential Moving Average):
Intraday: Adapts to your current chart timeframe (e.g., switch your chart to 15m to see the 15m trend).
Daily / Weekly / Monthly: These are hard coded to always show the higher timeframe trend, regardless of what chart you are looking at. Trend is determined by price in relation to it's 5 EMA.
4. "Terminal" Aesthetic
Styled with a dark, high-contrast Bloomberg Terminal look.
Uses Amber tickers and Neon status blocks for rapid visual scanning.
Optimized for Full Screen Mode: Hide your main chart candles to turn your monitor into a dedicated data dashboard.
How to Use
Add the indicator to your chart and move it to "New Lower Indicator" Then repeat 4 times for each dashboard.
Open Settings (the gear icon) and find "Select Page".
Choose your desired market view (e.g., Sectors, Crypto, Currencies, Commodities)
Optional: To replicate the full dashboard look, go to your Chart Settings -> Symbol -> Uncheck "Body" and "Borders" to hide the candles behind the table.
2 hours ago
Release Notes
Transform your TradingView chart into a professional-grade command center. Designed for traders who need high-level market awareness without switching tabs, this dashboard provides deep, multi-timeframe analysis across US Sectors, Commodities, Currencies, and Crypto.
Key Features
1. Multi-Asset Paging System Pine Script has a limit of 40 security calls, which usually limits how much data you can see. This script bypasses that limitation using a smart Paging System:
Sectors Page: Tracks the top 10 US Sectors (SPY, XLK, XLF, etc.) & Indices.
Commodities Page: Gold, Silver, Oil, Gas, Copper, Corn, etc.
Currencies Page: Major Forex pairs including DXY, EURUSD, USDJPY.
Crypto Page: Top 10 Cryptocurrencies by volume.
Switch pages instantly via the Settings menu.
2. Smart "News" Headlines Since Pine Script cannot access the live internet for news, this script uses an Algorithmic Headline Generator. It analyzes price action and trend alignment to generate a "Market Status" summary:
Full Bull Trend: Intraday + Daily + Weekly trends are all positive.
Strong Rally: Asset is up significantly (>1.25%) on the day.
Heavy Sell-off: Asset is down significantly (<-1.25%) on the day.
Pullback (Buy?): Daily trend is UP, but Intraday is DOWN (potential entry).
Consolidating: Market is chopping sideways.
3. Timeframe Trend Matrix Monitor momentum across the curve with a single glance. The "Trend" columns are powered by the 5 EMA (Exponential Moving Average):
Intraday: Adapts to your current chart timeframe (e.g., switch your chart to 15m to see the 15m trend).
Daily / Weekly / Monthly: These are hard coded to always show the higher timeframe trend, regardless of what chart you are looking at. Trend is determined by price in relation to it's 5 EMA.
4. "Terminal" Aesthetic
Styled with a dark, high-contrast Bloomberg Terminal look.
Uses Amber tickers and Neon status blocks for rapid visual scanning.
Optimized for Full Screen Mode: Hide your main chart candles to turn your monitor into a dedicated data dashboard.
How to Use
Add the indicator to your chart and move it to "New Lower Indicator" Then repeat 4 times for each dashboard.
Open Settings (the gear icon) and find "Select Page".
Choose your desired market view (e.g., Sectors, Crypto, Currencies, Commodities)
Optional: To replicate the full dashboard look, go to your Chart Settings -> Symbol -> Uncheck "Body" and "Borders" to hide the candles behind the table.
QuantLabs Mega Multi-Asset DashboardTransform your TradingView chart into a professional-grade command center. Designed for traders who need high-level market awareness without switching tabs, this dashboard provides deep, multi-timeframe analysis across US Sectors, Commodities, Currencies, and Crypto.
Key Features
1. Multi-Asset Paging System Pine Script has a limit of 40 security calls, which usually limits how much data you can see. This script bypasses that limitation using a smart Paging System:
Sectors Page: Tracks the top 10 US Sectors (SPY, XLK, XLF, etc.) & Indices.
Commodities Page: Gold, Silver, Oil, Gas, Copper, Corn, etc.
Currencies Page: Major Forex pairs including DXY, EURUSD, USDJPY.
Crypto Page: Top 10 Cryptocurrencies by volume.
Switch pages instantly via the Settings menu.
2. Smart "News" Headlines Since Pine Script cannot access the live internet for news, this script uses an Algorithmic Headline Generator. It analyzes price action and trend alignment to generate a "Market Status" summary:
Full Bull Trend: Intraday + Daily + Weekly trends are all positive.
Strong Rally: Asset is up significantly (>1.25%) on the day.
Heavy Sell-off: Asset is down significantly (<-1.25%) on the day.
Pullback (Buy?): Daily trend is UP, but Intraday is DOWN (potential entry).
Consolidating: Market is chopping sideways.
3. Timeframe Trend Matrix Monitor momentum across the curve with a single glance. The "Trend" columns are powered by the 5 EMA (Exponential Moving Average):
Intraday: Adapts to your current chart timeframe (e.g., switch your chart to 15m to see the 15m trend).
Daily / Weekly / Monthly: These are hard coded to always show the higher timeframe trend, regardless of what chart you are looking at. Trend is determined by price in relation to it's 5 EMA.
4. "Terminal" Aesthetic
Styled with a dark, high-contrast Bloomberg Terminal look.
Uses Amber tickers and Neon status blocks for rapid visual scanning.
Optimized for Full Screen Mode: Hide your main chart candles to turn your monitor into a dedicated data dashboard.
How to Use
Add the indicator to your chart and move it to "New Lower Indicator" Then repeat 4 times for each dashboard.
Open Settings (the gear icon) and find "Select Page".
Choose your desired market view (e.g., Sectors, Crypto, Currencies, Commodities)
Optional: To replicate the full dashboard look, go to your Chart Settings -> Symbol -> Uncheck "Body" and "Borders" to hide the candles behind the table.
FX Rate Bias US vs EU 2YFX Rate Bias – US vs EU (2Y)
This indicator provides a macro bias framework for FX markets by tracking the 2-year government bond yield differential between the United States and Germany.
Rather than displaying the spread as a raw calculation, the script translates interest-rate expectations into a clear directional bias, helping traders understand which currency currently holds a rate advantage.
The 2Y segment of the yield curve is highly sensitive to:
Central bank expectations
Forward guidance
Shifts in short-term monetary policy outlook
How to use
Positive spread → USD rate advantage
Negative spread → EUR rate advantage
Designed to be used as a contextual macro tool, this indicator helps align technical setups with broader monetary conditions.
It is not intended as a standalone entry or signal generator.
Wasserstein Distance [Regime Series]- FilterThe tool is measures how different the market’s current behavior is from its normal behavior by comparing two distributions of returns:
Short window → recent market behavior
Reference window → baseline / historical behavior
It uses a simplified 1D Wasserstein Distance, which compares the shape of return distributions rather than individual prices.
The result is a regime-awareness signal, not a buy/sell trigger that answers the question: Is the market behaving normally, or has its behavior changed?
🧠 Why use it as a regime filter
*Trending vs ranging
*Low volatility vs high volatility
*Normal conditions vs news / expansion phases
*Most strategies fail when applied in the wrong regime.
📈 How to interpret the values
🔹 Low / Stable values
*Market behavior is similar to the baseline.
*Regime is stable
*Mean-reversion and structure-based strategies tend to work better in this environment.
🔸 Rising values
*Market behavior is changing
*Possible early regime transition
*Volatility and directional movement may increase
🔺 Spiking Values
*Clear regime shift
*Often associated with:
*Breakouts
*Volatility expansion
*News events
🧩 How to use it as a filter (NOT AN ENTRY)
✅ Breakout / trend strategies
Prefer trades when:
*Wasserstein Distance is rising, or above its recent average
*Confirms that the market is leaving a “normal” state
🚫 Mean-reversion strategies
*Avoid trades when distance is elevated or spiking.
*Best used when distance is low and stable.
⚖️ Risk management
*Reduce position size when distance is high.
*Skip trades entirely during extreme spikes.
This is a filter that uses a distribution-based metric, not momentum or direction but for structural awareness and market context. THIS IS NOT DESIGNED TO OPERATE AS A STANDALONE, a high value does not mean price will go up or down, only that behavior has changed.
I'm leaving this open so anyone can experiment with it as I've noticed there isn't much variety in this category.
Institutional Intermarket Score PRO V3.3 (Presets)This indicator is built on an unusual, non-traditional intermarket concept and is designed to provide market context rather than trading signals.
Institutional Intermarket Score – Indicator Description
Overview
The Institutional Intermarket Score is a contextual market indicator designed to provide a macro and intermarket perspective on the current market environment.
It aggregates information from multiple user-selected correlated and inversely correlated assets to determine whether the broader market context favors risk-on, risk-off, or neutral conditions.
This indicator is not a buy or sell signal.
It does not attempt to predict short-term price movements, entries, or exits.
Its sole purpose is to help the trader understand the broader market context before making any trading decisions.
Core Concept
Markets do not move in isolation.
Institutional participants continuously monitor multiple related markets to assess risk, liquidity, and conviction before deploying capital.
This indicator replicates that process by:
Monitoring several correlated assets (assets that tend to move in the same direction)
Monitoring several inversely correlated assets (assets that typically move in the opposite direction)
Combining their behavior into a single, normalized intermarket score
The result is a context filter, not a trading system.
Asset Groups
The indicator supports up to:
5 correlated assets
5 inversely correlated assets
All assets are fully configurable by the user and can be enabled or disabled individually.
Only active assets are included in all calculations.
Market State Evaluation
Each asset is evaluated using a Price vs VWAP relationship:
Price above VWAP → bullish state
Price below VWAP → bearish state
This binary state is used consistently across all assets to maintain clarity and robustness.
Intermarket Score
----------------------
The Intermarket Score represents the average directional alignment of all active assets and is normalized between -1 and +1.
Positive values indicate a risk-on environment
Negative values indicate a risk-off environment
Values near zero indicate balance, rotation, or uncertainty
The score is smoothed to reduce noise and highlight regime persistence rather than short-term fluctuations.
Confirmation Metric (X / Y)
----------------------------------
In addition to the score, the indicator calculates a confirmation ratio:
Y = total number of active assets
X = number of assets aligned with the current regime
Alignment is evaluated relative to the current regime:
In bullish regimes, assets above VWAP confirm
In bearish regimes, assets below VWAP confirm
This metric reflects the quality and conviction of the intermarket consensus.
High confirmation indicates broad agreement across markets.
Low confirmation indicates divergence, uncertainty, or fragile conditions.
Heatmap
-----------
A compact heatmap visually displays the state of each individual asset:
Green indicates alignment with the regime
Red indicates opposition
Neutral indicates inactive assets
This allows immediate identification of:
Which markets are confirming
Which markets are diverging
Whether consensus is broad or fragmented
Intended Use
----------------
This indicator is designed to be used:
Before evaluating trade setups
As a filter, not a trigger
In combination with price action, structure, and risk management
Typical applications include:
Avoiding trades against the broader market context
Distinguishing strong trends from fragile moves
Identifying periods of institutional alignment or hesitation
What This Indicator Is Not
It is not a buy or sell indicator
It does not provide entry or exit signals
It does not predict price direction on its own
It does not guarantee profitable trades
Any trading decisions remain entirely the responsibility of the user.
Summary
The Institutional Intermarket Score provides a high-level market image based on assets selected by the user.
It reflects context, alignment, and conviction, not timing.
Used correctly, it helps traders avoid low-quality trades, understand when markets are aligned or fragmented, and make decisions with greater awareness of the broader environment.
It is a decision support tool, not a trading system.
This indicator, is still evolving and its structure will continue to develop as new insights are tested...
RAPF Plus - Forecast Cones - Payoff Greeks - Calibration HarnessRAPF+ Manual (v2.2 — “variable ↔ chart label” clarified)
RAPF+ — Forecast Cones + Payoff Greeks + Calibration Harness
──────────────────────────────────────────────────────────────────────────────
0) What this indicator is
──────────────────────────────────────────────────────────────────────────────
RAPF+ is a forecast-and-score system: it predicts a future price range, then later
checks whether that prediction was accurate — and only generates signals whenthe
conditions are trustworthy.
Core idea (the “lightbulb moment”):
You’re not trading a static band. You’re trading “today’s range that was predicted
h bars ago.”
──────────────────────────────────────────────────────────────────────────────
1) Mental Model (Non-Quant Friendly)
──────────────────────────────────────────────────────────────────────────────
Weather Forecast Analogy
- Bollinger Bands are like looking out the window to see if it’s raining now.
- RAPF+ is like checking the forecast made 3 days ago for today, then grading it.
Interpretation:
- If the forecast said “normal range” and the price stays inside the cone:
→ forecast held → “hold/trend environment”
- If price breaks outside the cone:
→ forecast failed → “breakout shock” or “overextension” (depends on mode)
Why this matters:
RAPF+ is about whether the *old forecast* was correct, not just where the price is now.
──────────────────────────────────────────────────────────────────────────────
2) What You See on the Chart (and what the internal variables are called)
──────────────────────────────────────────────────────────────────────────────
Important: Variable names like aUp/aDn/aMid are INTERNAL to the code.
On the chart and in the Data Window, you’ll see them by their PLOT NAMES.
How to read exact values:
- Hover a candle → open TradingView “Data Window” → find this indicator → read plot values.
- Or hover the plotted line to see its value.
- Or enable “Indicators Values” on the right scale to see last values.
A) Forecast Cones (future projections)
These are projected to the right of current candles (offset by H1/H2/H3).
Code variables (forecast for each horizon):
- mid1 / up1 / dn1 = forecast median/upper/lower at Horizon H1 (projected right)
- mid2 / up2 / dn2 = forecast median/upper/lower at Horizon H2 (projected right)
- mid3 / up3 / dn3 = forecast median/upper/lower at Horizon H3 (projected right)
Chart plot names (what users will see):
- “P50 H1”, “Upper H1”, “Lower H1”
- “P50 H2”, “Upper H2”, “Lower H2”
- “P50 H3”, “Upper H3”, “Lower H3”
Use forecast cones for planning (expectations, targets), NOT direct signal triggers.
B) Density Fan (optional)
Layered confidence bands (50–95%) for a selected horizon.
Code variables:
- upDen50/dnDen50 … upDen95/dnDen95 (selected density horizon)
Chart plot names:
- “Den Up 50”, “Den Dn 50”, … “Den Up 95”, “Den Dn 95” (usually hidden; fills visible)
C) Applied Cone (the tradeable one)
This is the cone that actively interacts with the CURRENT candle.
The Applied Cone is a “prediction made h bars ago, applied to today.”
It uses “old” cone values (shifted buffers) and then selects one horizon.
Internal variables (used by signals):
- aMid = applied median line for the selected Signal Horizon (H1/H2/H3)
- aUp = applied upper bound for the selected Signal Horizon
- aDn = applied lower bound for the selected Signal Horizon
Chart plot names (what users will see):
- aMid → “Applied Mid”
- aUp → “Applied Up”
- aDn → “Applied Dn”
Trading cue:
- Signals are generated by price crossing the Applied Cone (aUp/aDn),
meaning price broke outside the range that was predicted h bars ago for today.
Visual cue (important):
- Applied Cone = the one interacting with current candles (now).
- Forecast Cones = projected to the right into the future.
──────────────────────────────────────────────────────────────────────────────
3) The Stats Table (How to Trust It)
──────────────────────────────────────────────────────────────────────────────
The table grades the model across H1/H2/H3:
Coverage (most important)
- “How often did realized price land inside the predicted cone?”
- Target ≈ conf (e.g., 80%)
Interpretation:
- Coverage below target: cones too tight OR regime changed
- Coverage above target: cones conservative (wider than needed)
Dir Acc (Direction Accuracy)
- “How often was the direction of the forecast correct?”
- Compares sign(forecast mid - old spot) vs sign(realized move)
MAE (Mean Absolute Error)
- Average miss from the predicted midline (lower is better)
Avg Width
- Average cone width (how “expensive” the forecast is in range terms)
Warm-up note (important)
- Stats use warmupBars (default 50) to avoid early-history spikes.
- If you see dashes/empty values on load, wait for more bars to load/scroll back.
Horizon selection tip
Pick the horizon that best balances:
- Coverage near/above target
- Dir Acc acceptable
- MAE low
- Width reasonable
──────────────────────────────────────────────────────────────────────────────
4) The Risk Gate (When Signals Matter)
──────────────────────────────────────────────────────────────────────────────
RAPF+ has an explicit “stand down” filter.
Signals are considered valid only when okRisk = YES, based on:
- Trust ≥ Min Trust
- RegimeRisk ≤ Max RegimeRisk
- Coverage(selected horizon) ≥ Min Coverage
- Enough bars have elapsed for that horizon
HUD labels (what users see) vs code variables:
- “RegimeRisk” in HUD = regimeRisk in code
- “Trust” in HUD = trustTrend in code
- “μ(bar)” in HUD = muBar in code
- “σ(bar)” in HUD = sigmaBar in code
- “okRisk YES/no” = okRisk boolean in code
If okRisk = NO:
DEFAULT ACTION = HOLD / reduce risk / stay flat
This is “no signal.” It is a “low-quality environment.”
What RegimeRisk/Trust mean (simple)
- RegimeRisk rises when volatility is high and/or unstable.
- Trust = 1 − RegimeRisk
- Drift (μ) is damped when Trust is low.
──────────────────────────────────────────────────────────────────────────────
5) Buy / Sell / Hold Playbooks
──────────────────────────────────────────────────────────────────────────────
All rules below assume okRisk = YES.
A) Breakout Mode (continuation/trend)
Signal logic:
- BUY/LONG when price crosses above Applied Upper:
• internal: close crosses above aUp
• chart: close crosses above “Applied Up”
- SELL/SHORT when price crosses below Applied Lower:
• internal: close crosses below aDn
• chart: close crosses below “Applied Dn”
Drift direction filter (recommended ON):
- Longs require μ > 0 (muBar > 0)
- Shorts require μ < 0 (muBar < 0)
Management / Hold:
- Long bias while price is above aMid (“Applied Mid”)
- Short bias while price is below aMid (“Applied Mid”)
Exit ideas (choose your style):
- Conservative: exit if price re-enters inside the cone (failed breakout)
- Balanced: exit on cross back through aMid
- Hard stop: exit on cross opposite band
Best conditions for Breakout:
- Coverage at/above target
- Dir Acc decent
- Trust healthy (RegimeRisk contained)
B) Fade Mode (mean reversion/overextension)
Signal logic (opposite philosophy):
- SHORT when price breaks above aUp (“Applied Up”)
- LONG when price breaks below aDn (“Applied Dn”)
Profit logic:
- aMid (“Applied Mid”) is the “magnet” / mean reversion target
- Many traders scale out toward aMid
Re-entry circles (what they mean):
- When the price was outside, then it crossed back INSIDE the Applied Cone.
- In code: reenterFromAbove / reenterFromBelow
- On the chart: small yellow circles near the candle
Use as confirmation that the “shock” is fading and/or as take-profit prompts.
Best conditions for Fade:
- Dir Acc mediocre/low (choppy drift)
- Coverage struggling vs target (more violations)
- RegimeRisk higher (but still within your maxRisk gate)
C) Auto (Cal Error) Mode (adaptive behavior)
If Signal Mode = Auto (Cal Error):
- If realized coverage ≥ target → uses Breakout
- If realized coverage < target → uses Fade
Plain English:
“If my cones are behaving well, ride continuation.
If they’re failing, mean-revert the brakes.”
──────────────────────────────────────────────────────────────────────────────
6) What HOLD Means (3 distinct cases)
──────────────────────────────────────────────────────────────────────────────
Hold Type 1: No-trade hold (risk gate fails)
- If Trust too low OR RegimeRisk too high OR Coverage too low:
→ HOLD / reduce risk / stand down
Hold Type 2: Inside-cone hold (normal noise)
- Inside the Applied Cone is often “business as usual.”
- Breakout traders: wait, avoid impulsive adds
- Fade traders: take profit / don’t overstay
Hold Type 3: Midline bias hold
- aMid (“Applied Mid”) acts like “forecast fair value”
- Above aMid: bullish bias
- Below aMid: bearish bias
- Frequent flips around aMid: chop → prefer Fade or no-trade
──────────────────────────────────────────────────────────────────────────────
7) Setup Checklist (Practical Defaults)
──────────────────────────────────────────────────────────────────────────────
Step 0 — Select Your Timeframe (avoid noise first)
- Daily (1D): Recommended for most crypto assets.
Best balance of signal stability + trend capture.
- Weekly (1W): Use for macro trend bias (Drift check).
Great for direction context, but signals are slower/fewer.
- Intraday (1H/4H): Advanced users only.
Noisier; typically requires:
• Higher confidence (e.g., 0.90+)
• Stricter risk gates (higher Min Trust, higher Min Coverage, lower Max RegimeRisk)
• Patience with calibration stability
Step 1 — Pick Signal Horizon
- H1: quick swing
- H2: typical swing
- H3: position-style
Step 2 — Calibrate Coverage (don’t guess)
- Coverage below target → increase Cone Width Multiplier
- Coverage above target → decrease Cone Width Multiplier
- Optional: enable Auto-calibrate Cone Width (servo toward conf + margin)
Important: Use Cone Width Multiplier for coverage tuning (that’s what it’s for).
Avoid “fixing” coverage by changing cycle settings.
Step 3 — Set risk gates (reasonable baseline)
- Min Trust ≈ 0.45
- Max RegimeRisk ≈ 0.70
- Min Coverage ≈ 0.55+ (raise for fewer, higher-quality trades)
Step 4 — Keep Drift Filter ON (recommended)
Prevents trading against μ (drift direction).
──────────────────────────────────────────────────────────────────────────────
8) Optional: Payoff + Greeks (Advanced Layer)
──────────────────────────────────────────────────────────────────────────────
(Note: The Greeks engine is disabled by default to save performance.
You must enable it in indicator settings to see these metrics.)
If enabled, RAPF+ estimates the expected payoff for Straddle/Call/Put under the model
distribution (with optional fat-tail mixture) plus Δ / Γ / ν / Θ.
Use cases:
- Assess convexity vs mean reversion preference
- Spot/vol sensitivity awareness
- Horizon comparisons for “optionality-like” behavior
If you’re a spot-only trader, you can ignore this section.
──────────────────────────────────────────────────────────────────────────────
9) One-Page Rules Card
──────────────────────────────────────────────────────────────────────────────
PRE-CHECK
- Choose timeframe (prefer 1D for most crypto)
- Choose signal horizon (H1/H2/H3)
- Prefer horizon with good Coverage and acceptable Dir Acc
- Trade only if okRisk = YES
BREAKOUT MODE
- Buy on cross above “Applied Up” (aUp) (μ>0 if drift filter ON)
- Sell/short on cross below “Applied Dn” (aDn) (μ<0 if drift filter ON)
- Hold while aligned with “Applied Mid” (aMid)
- Exit on re-entry / aMid cross / opposite band (your style)
FADE MODE
- Short on break above “Applied Up” (aUp)
- Long on break below “Applied Dn” (aDn)
- Target “Applied Mid” (aMid) as the mean reversion magnet
- Re-entry circles confirm the “shock fade”
STAND DOWN
- If okRisk = NO → HOLD / reduce risk / no-trade
──────────────────────────────────────────────────────────────────────────────
Quick Glossary
──────────────────────────────────────────────────────────────────────────────
H1/H2/H3: Forecast horizons in bars
conf: Desired coverage probability (e.g., 0.80)
Coverage: % of times realized price stayed inside the cone
Dir Acc: % of times direction was correct
MAE: Avg error vs forecast midline
Width: Avg cone width (upper-lower)/spot
RegimeRisk: Combined “vol high/unstable” score
Trust: 1 − RegimeRisk (how much to trust drift)
μ(bar): Estimated per-bar drift (directional bias)
σ(bar): Estimated per-bar volatility
Applied Cone (present, tradeable):
- aMid / aUp / aDn are internal variables
- On the chart/Data Window, they appear as:
aMid = “Applied Mid”
aUp = “Applied Up”
aDn = “Applied Dn”
Forecast Cones (future projections):
- mid1/up1/dn1 (H1), mid2/up2/dn2 (H2), mid3/up3/dn3 (H3)
- On the chart, they appear as:
“P50 H1/Upper H1/Lower H1”, etc.
DeeptestDeeptest: Quantitative Backtesting Library for Pine Script
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ OVERVIEW
Deeptest is a Pine Script library that provides quantitative analysis tools for strategy backtesting. It calculates over 100 statistical metrics including risk-adjusted return ratios (Sharpe, Sortino, Calmar), drawdown analysis, Value at Risk (VaR), Conditional VaR, and performs Monte Carlo simulation and Walk-Forward Analysis.
█ WHY THIS LIBRARY MATTERS
Pine Script is a simple yet effective coding language for algorithmic and quantitative trading. Its accessibility enables traders to quickly prototype and test ideas directly within TradingView. However, the built-in strategy tester provides only basic metrics (net profit, win rate, drawdown), which is often insufficient for serious strategy evaluation.
Due to this limitation, many traders migrate to alternative backtesting platforms that offer comprehensive analytics. These platforms require other language programming knowledge, environment setup, and significant time investment—often just to test a simple trading idea.
Deeptest bridges this gap by bringing institutional-level quantitative analytics directly to Pine Script. Traders can now perform sophisticated analysis without leaving TradingView or learning complex external platforms. All calculations are derived from strategy.closedtrades.* , ensuring compatibility with any existing Pine Script strategy.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ ORIGINALITY AND USEFULNESS
This library is original work that adds value to the TradingView community in the following ways:
1. Comprehensive Metric Suite: Implements 112+ statistical calculations in a single library, including advanced metrics not available in TradingView's built-in tester (p-value, Z-score, Skewness, Kurtosis, Risk of Ruin).
2. Monte Carlo Simulation: Implements trade-sequence randomization to stress-test strategy robustness by simulating 1000+ alternative equity curves.
3. Walk-Forward Analysis: Divides historical data into rolling in-sample and out-of-sample windows to detect overfitting by comparing training vs. testing performance.
4. Rolling Window Statistics: Calculates time-varying Sharpe, Sortino, and Expectancy to analyze metric consistency throughout the backtest period.
5. Interactive Table Display: Renders professional-grade tables with color-coded thresholds, tooltips explaining each metric, and period analysis cards for drawdowns/trades.
6. Benchmark Comparison: Automatically fetches S&P 500 data to calculate Alpha, Beta, and R-squared, enabling objective assessment of strategy skill vs. passive investing.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ KEY FEATURES
Performance Metrics
Net Profit, CAGR, Monthly Return, Expectancy
Profit Factor, Payoff Ratio, Sample Size
Compounding Effect Analysis
Risk Metrics
Sharpe Ratio, Sortino Ratio, Calmar Ratio (MAR)
Martin Ratio, Ulcer Index
Max Drawdown, Average Drawdown, Drawdown Duration
Risk of Ruin, R-squared (equity curve linearity)
Statistical Distribution
Value at Risk (VaR 95%), Conditional VaR
Skewness (return asymmetry)
Kurtosis (tail fatness)
Z-Score, p-value (statistical significance testing)
Trade Analysis
Win Rate, Breakeven Rate, Loss Rate
Average Trade Duration, Time in Market
Consecutive Win/Loss Streaks with Expected values
Top/Worst Trades with R-multiple tracking
Advanced Analytics
Monte Carlo Simulation (1000+ iterations)
Walk-Forward Analysis (rolling windows)
Rolling Statistics (time-varying metrics)
Out-of-Sample Testing
Benchmark Comparison
Alpha (excess return vs. benchmark)
Beta (systematic risk correlation)
Buy & Hold comparison
R-squared vs. benchmark
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ QUICK START
Basic Usage
//@version=6
strategy("My Strategy", overlay=true)
// Import the library
import Fractalyst/Deeptest/1 as *
// Your strategy logic
fastMA = ta.sma(close, 10)
slowMA = ta.sma(close, 30)
if ta.crossover(fastMA, slowMA)
strategy.entry("Long", strategy.long)
if ta.crossunder(fastMA, slowMA)
strategy.close("Long")
// Run the analysis
DT.runDeeptest()
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ METRIC EXPLANATIONS
The Deeptest table displays 23 metrics across the main row, with 23 additional metrics in the complementary row. Each metric includes detailed tooltips accessible by hovering over the value.
Main Row — Performance Metrics (Columns 0-6)
Net Profit — (Final Equity - Initial Capital) / Initial Capital × 100
— >20%: Excellent, >0%: Profitable, <0%: Loss
— Total return percentage over entire backtest period
Payoff Ratio — Average Win / Average Loss
— >1.5: Excellent, >1.0: Good, <1.0: Losses exceed wins
— Average winning trade size relative to average losing trade. Breakeven win rate = 100% / (1 + Payoff)
Sample Size — Count of closed trades
— >=30: Statistically valid, <30: Insufficient data
— Number of completed trades. Includes 95% confidence interval for win rate in tooltip
Profit Factor — Gross Profit / Gross Loss
— >=1.5: Excellent, >1.0: Profitable, <1.0: Losing
— Ratio of total winnings to total losses. Uses absolute values unlike payoff ratio
CAGR — (Final / Initial)^(365.25 / Days) - 1
— >=10%: Excellent, >0%: Positive growth
— Compound Annual Growth Rate - annualized return accounting for compounding
Expectancy — Sum of all returns / Trade count
— >0.20%: Excellent, >0%: Positive edge
— Average return per trade as percentage. Positive expectancy indicates profitable edge
Monthly Return — Net Profit / (Months in test)
— >0%: Profitable month average
— Average monthly return. Geometric monthly also shown in tooltip
Main Row — Trade Statistics (Columns 7-14)
Avg Duration — Average time in position per trade
— Mean holding period from entry to exit. Influenced by timeframe and trading style
Max CW — Longest consecutive winning streak
— Maximum consecutive wins. Expected value = ln(trades) / ln(1/winRate)
Max CL — Longest consecutive losing streak
— Maximum consecutive losses. Important for psychological risk tolerance
Win Rate — Wins / Total Trades
— Higher is better
— Percentage of profitable trades. Breakeven win rate shown in tooltip
BE Rate — Breakeven Trades / Total Trades
— Lower is better
— Percentage of trades that broke even (neither profit nor loss)
Loss Rate — Losses / Total Trades
— Lower is better
— Percentage of unprofitable trades. Together with win rate and BE rate, sums to 100%
Frequency — Trades per month
— Trading activity level. Displays intelligently (e.g., "12/mo", "1.5/wk", "3/day")
Exposure — Time in market / Total time × 100
— Lower = less risk
— Percentage of time the strategy had open positions
Main Row — Risk Metrics (Columns 15-22)
Sharpe Ratio — (Return - Rf) / StdDev × sqrt(Periods)
— >=3: Excellent, >=2: Good, >=1: Fair, <1: Poor
— Measures risk-adjusted return using total volatility. Annualized using sqrt(252) for daily
Sortino Ratio — (Return - Rf) / DownsideDev × sqrt(Periods)
— >=2: Excellent, >=1: Good, <1: Needs improvement
— Similar to Sharpe but only penalizes downside volatility. Can be higher than Sharpe
Max DD — (Peak - Trough) / Peak × 100
— <5%: Excellent, 5-15%: Moderate, 15-30%: High, >30%: Severe
— Largest peak-to-trough decline in equity. Critical for risk tolerance and position sizing
RoR — Risk of Ruin probability
— <1%: Excellent, 1-5%: Acceptable, 5-10%: Elevated, >10%: Dangerous
— Probability of losing entire trading account based on win rate and payoff ratio
R² — R-squared of equity curve vs. time
— >=0.95: Excellent, 0.90-0.95: Good, 0.80-0.90: Moderate, <0.80: Erratic
— Coefficient of determination measuring linearity of equity growth
MAR — CAGR / |Max Drawdown|
— Higher is better, negative = bad
— Calmar Ratio. Reward relative to worst-case loss. Negative if max DD exceeds CAGR
CVaR — Average of returns below VaR threshold
— Lower absolute is better
— Conditional Value at Risk (Expected Shortfall). Average loss in worst 5% of outcomes
p-value — Binomial test probability
— <0.05: Significant, 0.05-0.10: Marginal, >0.10: Likely random
— Probability that observed results are due to chance. Low p-value means statistically significant edge
Complementary Row — Extended Metrics
Compounding — (Compounded Return / Total Return) × 100
— Percentage of total profit attributable to compounding (position sizing)
Avg Win — Sum of wins / Win count
— Average profitable trade return in percentage
Avg Trade — Sum of all returns / Total trades
— Same as Expectancy (Column 5). Displayed here for convenience
Avg Loss — Sum of losses / Loss count
— Average unprofitable trade return in percentage (negative value)
Martin Ratio — CAGR / Ulcer Index
— Similar to Calmar but uses Ulcer Index instead of Max DD
Rolling Expectancy — Mean of rolling window expectancies
— Average expectancy calculated across rolling windows. Shows consistency of edge
Avg W Dur — Avg duration of winning trades
— Average time from entry to exit for winning trades only
Max Eq — Highest equity value reached
— Peak equity achieved during backtest
Min Eq — Lowest equity value reached
— Trough equity point. Important for understanding worst-case absolute loss
Buy & Hold — (Close_last / Close_first - 1) × 100
— >0%: Passive profit
— Return of simply buying and holding the asset from backtest start to end
Alpha — Strategy CAGR - Benchmark CAGR
— >0: Has skill (beats benchmark)
— Excess return above passive benchmark. Positive alpha indicates genuine value-added skill
Beta — Covariance(Strategy, Benchmark) / Variance(Benchmark)
— <1: Less volatile than market, >1: More volatile
— Systematic risk correlation with benchmark
Avg L Dur — Avg duration of losing trades
— Average time from entry to exit for losing trades only
Rolling Sharpe/Sortino — Dynamic based on win rate
— >2: Good consistency
— Rolling metric across sliding windows. Shows Sharpe if win rate >50%, Sortino if <=50%
Curr DD — Current drawdown from peak
— Lower is better
— Present drawdown percentage. Zero means at new equity high
DAR — CAGR adjusted for target DD
— Higher is better
— Drawdown-Adjusted Return. DAR^5 = CAGR if max DD = 5%
Kurtosis — Fourth moment / StdDev^4 - 3
— ~0: Normal, >0: Fat tails, <0: Thin tails
— Measures "tailedness" of return distribution (excess kurtosis)
Skewness — Third moment / StdDev^3
— >0: Positive skew (big wins), <0: Negative skew (big losses)
— Return distribution asymmetry
VaR — 5th percentile of returns
— Lower absolute is better
— Value at Risk at 95% confidence. Maximum expected loss in worst 5% of outcomes
Ulcer — sqrt(mean(drawdown^2))
— Lower is better
— Ulcer Index - root mean square of drawdowns. Penalizes both depth AND duration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ MONTE CARLO SIMULATION
Purpose
Monte Carlo simulation tests strategy robustness by randomizing the order of trades while keeping trade returns unchanged. This simulates alternative equity curves to assess outcome variability.
Method
Extract all historical trade returns
Randomly shuffle the sequence (1000+ iterations)
Calculate cumulative equity for each shuffle
Build distribution of final outcomes
Output
The stress test table shows:
Median Outcome: 50th percentile result
5th Percentile: Worst 5% of outcomes
95th Percentile: Best 95% of outcomes
Success Rate: Percentage of simulations that were profitable
Interpretation
If 95% of simulations are profitable: Strategy is robust
If median is far from actual result: High variance/unreliability
If 5th percentile shows large loss: High tail risk
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ WALK-FORWARD ANALYSIS
Purpose
Walk-Forward Analysis (WFA) is the gold standard for detecting strategy overfitting. It simulates real-world trading by dividing historical data into rolling "training" (in-sample) and "validation" (out-of-sample) periods. A strategy that performs well on unseen data is more likely to succeed in live trading.
Method
The implementation uses a non-overlapping window approach following AmiBroker's gold standard methodology:
Segment Calculation: Total trades divided into N windows (default: 12), IS = ~75%, OOS = ~25%, Step = OOS length
Window Structure: Each window has IS (training) followed by OOS (validation). Each OOS becomes the next window's IS (rolling forward)
Metrics Calculated: CAGR, Sharpe, Sortino, MaxDD, Win Rate, Expectancy, Profit Factor, Payoff
Aggregation: IS metrics averaged across all IS periods, OOS metrics averaged across all OOS periods
Output
IS CAGR: In-sample annualized return
OOS CAGR: Out-of-sample annualized return ( THE key metric )
IS/OOS Sharpe: In/out-of-sample risk-adjusted return
Success Rate: % of OOS windows that were profitable
Interpretation
Robust: IS/OOS CAGR gap <20%, OOS Success Rate >80%
Some Overfitting: CAGR gap 20-50%, Success Rate 50-80%
Severe Overfitting: CAGR gap >50%, Success Rate <50%
Key Principles:
OOS is what matters — Only OOS predicts live performance
Consistency > Magnitude — 10% IS / 9% OOS beats 30% IS / 5% OOS
Window count — More windows = more reliable validation
Non-overlapping OOS — Prevents data leakage
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ TABLE DISPLAY
Main Table — Organized into three sections:
Performance Metrics (Cols 0-6): Net Profit, Payoff, Sample Size, Profit Factor, CAGR, Expectancy, Monthly
Trade Statistics (Cols 7-14): Avg Duration, Max CW, Max CL, Win, BE, Loss, Frequency, Exposure
Risk Metrics (Cols 15-22): Sharpe, Sortino, Max DD, RoR, R², MAR, CVaR, p-value
Color Coding
🟢 Green: Excellent performance
🟠 Orange: Acceptable performance
⚪ Gray: Neutral / Fair
🔴 Red: Poor performance
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ IMPLEMENTATION NOTES
Data Source: All metrics calculated from strategy.closedtrades , ensuring compatibility with any Pine Script strategy
Calculation Timing: All calculations occur on barstate.islastconfirmedhistory to optimize performance
Limitations: Requires at least 1 closed trade for basic metrics, 30+ trades for reliable statistical analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ QUICK NOTES
➙ This library has been developed and refined over two years of real-world strategy testing. Every calculation has been validated against industry-standard quantitative finance references.
➙ The entire codebase is thoroughly documented inline. If you are curious about how a metric is calculated or want to understand the implementation details, dive into the source code -- it is written to be read and learned from.
➙ This description focuses on usage and concepts rather than exhaustively listing every exported type and function. The library source code is thoroughly documented inline -- explore it to understand implementation details and internal logic.
➙ All calculations execute on barstate.islastconfirmedhistory to minimize runtime overhead. The library is designed for efficiency without sacrificing accuracy.
➙ Beyond analysis, this library serves as a learning resource. Study the source code to understand quantitative finance concepts, Pine Script advanced techniques, and proper statistical methodology.
➙ Metrics are their own not binary good/bad indicators. A high Sharpe ratio with low sample size is misleading. A deep drawdown during a market crash may be acceptable. Study each function and metric individually -- evaluate your strategy contextually, not by threshold alone.
➙ All strategies face alpha decay over time. Instead of over-optimizing a single strategy on one timeframe and market, build a diversified portfolio across multiple markets and timeframes. Deeptest helps you validate each component so you can combine robust strategies into a trading portfolio.
➙ Screenshots shown in the documentation are solely for visual representation to demonstrate how the tables and metrics will be displayed. Please do not compare your strategy's performance with the metrics shown in these screenshots -- they are illustrative examples only, not performance targets or benchmarks.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ HOW-TO
Using Deeptest is intentionally straightforward. Just import the library and call DT.runDeeptest() at the end of your strategy code in main scope. .
//@version=6
strategy("My Strategy", overlay=true)
// Import the library
import Fractalyst/Deeptest/1 as DT
// Your strategy logic
fastMA = ta.sma(close, 10)
slowMA = ta.sma(close, 30)
if ta.crossover(fastMA, slowMA)
strategy.entry("Long", strategy.long)
if ta.crossunder(fastMA, slowMA)
strategy.close("Long")
// Run the analysis
DT.runDeeptest()
And yes... it's compatible with any TradingView Strategy! 🪄
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ CREDITS
Author: @Fractalyst
Font Library: by @fikira - @kaigouthro - @Duyck
Community: Inspired by the @PineCoders community initiative, encouraging developers to contribute open-source libraries and continuously enhance the Pine Script ecosystem for all traders.
if you find Deeptest valuable in your trading journey, feel free to use it in your strategies and give a shoutout to @Fractalyst -- Your recognition directly supports ongoing development and open-source contributions to Pine Script.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ DISCLAIMER
This library is provided for educational and research purposes. Past performance does not guarantee future results. Always test thoroughly and use proper risk management. The author is not responsible for any trading losses incurred through the use of this code.
Seasonal Strategies V1Seasonal Strategies V1 is a rule-based futures seasonality framework built around predefined calendar windows per asset.
The strategy automatically detects the current symbol and activates long or short trading phases strictly based on historically observed seasonal tendencies. All entries and exits are fully time-based — no indicators, no predictions, no discretionary input.
Key Features
Asset-specific seasonal windows (MMDD-based)
Automatic long and short activation
Fully time-based entries and exits
One position at a time (no pyramiding)
Clean chart visualization using subtle background shading
No indicators, no filters, no curve fitting
Philosophy:
This strategy is designed as a structural trading tool, not a forecasting model.
It focuses on when a market historically shows seasonal tendencies — not why or how far price might move.
Seasonal Strategies V1 intentionally keeps the chart clean and minimal, making it suitable as a baseline framework for research, portfolio-style seasonal approaches, or further extensions in later versions.
Intended Use:
Futures and commodity markets
Seasonality research and testing
Systematic, calendar-driven strategies
Educational and analytical purposes
Disclaimer
This script is provided for educational and research purposes only.
Past seasonal tendencies do not guarantee future performance.
Risk management, position sizing, and portfolio decisions are the responsibility of the user.
Correlation with BTCIt can be used to observe the correlation between the returns of various assets and Bitcoin.
可用來觀測各資產與比特幣的報酬率相關性
ADR%, LoD Price, RS RatingGet the Values of ADR%, LoD Price, RS Rating on Daily Charts.
For RS Ratings, Benchmark Symbol and look back period need to be adjusted manually as per your requirement.
NY Opening Range [LuckyAlgo]
This custom ORM (Opening Range Move) indicator is designed as a tool for traders who focus not just on where a range is, but on the magnitude of the expansion following the initial morning volatility.
Here is a summary of the indicator and how it differentiates itself from standard Opening Range Breakout (ORB) tools.
Indicator Summary
The script captures the high and low of the market during the first 30 minutes of the NY session (09:30–10:00 AM EST). Once this range is set, it tracks the "Expansion Move" - the point distance from the range's boundary to the current session's high or low. It visualizes this through color-coded zones, dynamic labels at the session extremes, and a statistical table that benchmarks today's volatility against the recent past.
What specific questions does this indicator answer?
While most indicators tell you "the range is broken," this indicator answers quantitative questions vital for trade management:
1. "How far has the market stretched relative to the breakout?"
The indicator provides the exact point distance (+/-) from the range high/low. This helps you determine if the move is just beginning or if it has already extended significantly.
2. "Is the current move 'normal' or an outlier?"
By using the Stats Table, you can see if the current 40-point move on NQ is typical or if the average move over the last 10 days is actually 80 points. This prevents you from "fading" a move that still has average room to grow, or taking a "pro-trend" trade when the market is already exhausted.
3. "Where is the session extreme located?"
The inclusion of the dashed High of Day (HOD) and Low of Day (LOD) lines with attached labels tells you exactly where the "Move" calculation is peaking. If the HOD line hasn't moved for two hours, you know the bullish expansion has stalled.
4. "When is the data no longer relevant?"
Because of the 17:00 EST reset logic, the indicator answers the "end of day" question for futures traders. It stops measuring at the settlement/close of the electronic session, ensuring your charts are clean for the overnight (Globex) session or ready for the next morning.
Technical Advantage
Most scripts use a single "point in time" to reset. This script uses a Trading Window logic, which is much more robust. If a bar is missing at exactly 17:00 due to low volume or a data glitch, the indicator won't "break" or keep drawing old lines - it understands the entire window of time it is allowed to exist in.
Credit to @LuxAlgo for his initial Opening Range Breakout indicator used as a base to develop this version.
Uptrick: Price Memory TrendIntroduction
Uptrick: Price Memory Trend is a custom indicator designed to detect directional shifts and volatility changes using a non-traditional price memory approach. Unlike moving average systems, it builds a dynamic memory of price that adapts gradually over time, allowing it to detect significant deviations and trend transitions with reduced noise.
Overview
This script identifies trend changes by comparing the current price to a memory-based baseline. When price deviates significantly from this memory base, it triggers a trend regime shift—either bullish or bearish. Adaptive deviation bands are calculated using absolute deviation from the memory base, not ATR or standard deviation, which allows the indicator to capture volatility uniquely. Visual components include color-coded candles, labeled signals, optional bands, and a live status table summarizing current trend metrics.
Originality
The indicator’s core innovation lies in its use of a decaying memory function to track trend direction, replacing moving averages with a price memory that responds only to significant deviations. This method avoids lag typically associated with smoothing techniques, enabling timely trend detection. Furthermore, deviation is measured directly in price terms, rather than through volatility surrogates like ATR or Bollinger Bands, resulting in a more raw and responsive depiction of price behavior.
Inputs
Core Engine
Memory Strength: Sets how strongly the memory responds to price changes. Higher values make the memory base more reactive.
Memory Decay: Controls how much past memory is retained. Lower values weight new prices more heavily.
Deviation Length: Length of the EMA used to smooth absolute price deviation. A longer setting results in smoother bands.
Band Multiplier: Expands or contracts the dynamic bands. Higher values widen the bands, reducing sensitivity.
Customization
Color Palette: Selects one of six predefined color schemes for bull and bear visuals.
Show Bands: Enables or disables the display of deviation bands.
Look: Chooses between 'Bands', 'Trail', or 'Intense' styles, affecting how bands and fills are drawn.
Bands
Trail
Intense
Show Info Table: Toggles display of the real-time trend and volatility status panel.
Table Position: Determines which corner of the chart the info panel appears in.
Text Size: Adjusts font size used within the info table.
Features
Trend Detection
Bullish Shift: Triggered when price crosses above the upper band, entering a new bullish regime.
Bearish Shift: Triggered when price crosses below the lower band, entering a new bearish regime.
Trend state is persistent and updated only on confirmed transitions, avoiding repeated entries in the same direction.
Candle Coloring
Candles are dynamically recolored based on current trend direction: bull, bear, or neutral.
Signal Labels
Visual labels marked "Up" or "Down" are placed on the chart when a regime shift occurs, helping to mark turning points.
Deviation Bands
Dynamic upper and lower bands are drawn based on smoothed absolute deviation from the memory base.
Additional outer bands based on ATR may be drawn to highlight zone intensity when the 'Intense' or 'Trail' styles are selected.
Bands visually indicate overextension and help frame price context relative to memory.
Alerts
Built-in alert conditions trigger on bullish or bearish trend shifts, useful for automation or notifications.
Info Table
The optional info table displays:
Current trend direction
Band state (calm, hot, or cool)
Price stretch from base
Trend age in bars
Confidence level based on deviation
Memory slope and acceleration
Band width and compression state
Reversion risk based on stretch level
Info Table:
Trade Example:
Logic
Price Memory
A recursive formula updates a memory variable based on the current price.
The memory adjusts only when the price deviates meaningfully from its previous value.
The formula uses a combination of delta-weighting and exponential decay:
> memory := previous_memory + delta × memory_strength
> memory := memory × memory_decay + price × (1 - memory_decay)
This produces a smooth, adaptive base that responds gradually to directional price moves.
Deviation and Bands
Absolute deviation between price and the memory base is calculated and smoothed using an EMA.
The upper and lower bands are then calculated as:
> Upper Band = memory base + (smoothed deviation × band multiplier)
> Lower Band = memory base - (smoothed deviation × band multiplier)
ATR-based extensions can optionally be drawn around these bands for added visual structure.
Trend Logic
Bullish and bearish states are tracked using crossovers and crossunders of price against the upper and lower bands.
The indicator maintains a persistent trend state variable that updates only when a confirmed regime change occurs.
This prevents multiple signals within the same trend direction (non-pyramiding behavior).
Stretch and Band Analysis
Stretch is measured as the deviation of price from memory, normalized by smoothed deviation.
Band width is tracked over time and used to detect compression or expansion.
Band position is calculated to identify where price sits between the upper and lower bands.
Info Table Metrics
Memory Slope and Acceleration: Show first and second derivative of the memory base to capture trend speed and change.
Confidence Level: Based on stretch intensity, indicating trend strength.
Reversion Risk: Inferred from how extended price is beyond the band.
Compression: Evaluated by comparing current band width to its recent average.
Summary
Uptrick: Price Memory Trend provides an alternative framework for trend identification by replacing traditional smoothing with adaptive memory logic. It measures price deviation without reliance on ATR or standard deviation, instead focusing on distance from a reactive baseline. With regime-based trend tracking, customizable visuals, and a detailed status table, it supports both discretionary and system-driven trading styles.
Disclaimer
This script is for informational and educational purposes only. It does not provide financial advice or guarantees. Trading involves risk, and past performance is not indicative of future results. Always perform your own research before making trading decisions.
Position Sizing Calculator_V1Added a Table Text Size setting so you can control how big the text appears in the on-chart table.
New input: Table Text Size with options Tiny / Small / Normal / Large / Huge
4H Candle Curves4H Candle Curves - Detailed User Guide
OVERVIEW
This indicator reveals curve vs continuation behavior in NQ Futures by analyzing how price responds after breaking the first-hour range. Based on 10+ years of statistical analysis (2013-2025, 3,136+ trading days), it identifies which 4-hour sessions exhibit mean reversion (curve) behavior versus trend continuation when Q2 (second hour) breaks Q1 (first hour) extremes.
⚠️ IMPORTANT: This indicator is specifically designed for NQ FUTURES ONLY. All curve probabilities and statistics were derived from a decade-long dataset of NQ 1-minute bars. Using this on other instruments will produce inaccurate results.
CORE CONCEPT: THE CURVE
What is a "Curve"?
A curve occurs when price breaks out of the first hour's range in Q2 (hour 2), but then reverses direction in the second half (Q3+Q4) to make a new extreme on the opposite side.
Curve Example (Upside Break → Downside Reversal):
Q1 (Hour 1): Price establishes range 25,000 - 25,050
Q2 (Hour 2): Price breaks ABOVE Q1 high, reaches 25,100
Q3+Q4 (Hours 3-4): Price curves back down, makes new LOW below 25,000
Result: Q2 broke high, but second half curved back to make new low below Q1 = CURVE
What is "Continuation"?
Continuation occurs when Q2 breaks Q1 range and the second half extends further in the same direction.
Continuation Example (Upside Break → Further Upside):
Q1 (Hour 1): Price establishes range 25,000 - 25,050
Q2 (Hour 2): Price breaks ABOVE Q1 high, reaches 25,100
Q3+Q4 (Hours 3-4): Price continues higher, makes new HIGH above 25,100
Result: Q2 broke high, second half made new high above Q2 = CONTINUATION
THE CRITICAL DISCOVERY: 6AM IS THE CURVE SESSION
Curve Probabilities by Session:
When Q2 Breaks Q1 HIGH:
6AM: 60.6% curve (new low below Q1) | 38.5% continuation
2AM: 38.4% curve | 46.7% continuation (balanced)
10AM: 17.2% curve | 60.4% continuation ← STRONG continuation bias
6PM: 29.6% curve | 59.0% continuation
10PM: 27.5% curve | 55.1% continuation
When Q2 Breaks Q1 LOW:
6AM: 64.4% curve (new high above Q1) | 35.0% continuation ← HIGHEST curve
2AM: 42.8% curve | 43.3% continuation (balanced)
10AM: 16.7% curve | 51.6% continuation ← STRONG continuation bias
6PM: 33.7% curve | 51.1% continuation
10PM: 33.1% curve | 48.6% continuation
Key Insight:
6AM is THE ONLY SESSION with >60% curve probability in both directions. This makes it a uniquely exploitable mean reversion session. When Q2 breaks Q1 range during 6AM, expect the second half to curve back 60-64% of the time.
10AM shows the opposite: Strong continuation bias (60% when Q2 breaks high, 52% when Q2 breaks low). 10AM breakouts tend to follow through.
HOW IT WORKS: THE QUARTER SYSTEM
The Six 4-Hour Candles (EST):
Each trading day (6pm-5pm) is divided into six 4-hour periods:
6PM (18:00-22:00) - Evening/Globex open | Blue box
10PM (22:00-02:00) - Asia session | Purple box
2AM (02:00-06:00) - Early London | Orange box
6AM (06:00-10:00) - Late London + NY Open | Green box ← THE CURVE SESSION
10AM (10:00-14:00) - NY Morning | Red box ← THE CONTINUATION SESSION
2PM (14:00-17:00) - NY Afternoon | Yellow box (3 hours only)
The Four Quarters:
Each 4-hour candle (except 2PM) is divided into four 1-hour quarters:
Q1 (Hour 1, minutes 0-60): Establishes initial range
Q2 (Hour 2, minutes 60-120): Tests Q1 range - breaks or holds?
Q3 (Hour 3, minutes 120-180): Second half begins
Q4 (Hour 4, minutes 180-240): Second half completes
2PM candle only has 3 hours (14:00-17:00), so quarters are adjusted accordingly.
The Three-Step Analysis:
STEP 1: Q1 Establishes Range
The first hour sets the high and low for the session. This becomes the reference range.
STEP 2: Q2 Break Detection
The indicator monitors whether Q2 (hour 2) breaks above Q1 high or below Q1 low.
STEP 3: Second Half Response
Once Q2 breaks Q1 range, the indicator tracks what happens in Q3+Q4:
Does price CURVE back to make new extreme on opposite side?
Does price CONTINUE to make new extreme in same direction?
Or does price stay within the established range?
VISUAL ELEMENTS EXPLAINED
1. 4-Hour Candle Boxes
Colored boxes display the high-to-low range of each 4H candle:
Blue = 6PM (evening session start)
Purple = 10PM (Asia session)
Orange = 2AM (early London)
Green = 6AM ← THE CURVE SESSION (watch for mean reversion)
Red = 10AM ← THE CONTINUATION SESSION (trend follow-through)
Yellow = 2PM (afternoon close, 3 hours only)
2. Quarter Separator Lines
Vertical dotted lines mark the boundaries between quarters (1H, 2H, 3H marks). This helps you see:
When Q1 ends (after 1 hour)
When Q2 ends / second half begins (after 2 hours)
When Q3 ends (after 3 hours)
3. Candle Name Labels
At the 2-hour mark (Q2/Q3 boundary), a label shows:
Candle name (e.g., "6am")
Directional indicator:
🔼 = Q2 broke Q1 HIGH
🔽 = Q2 broke Q1 LOW
⚠️ = Q2 broke BOTH Q1 high and low (extended range)
No symbol = Q2 stayed within Q1 range
THE LIVE STATUS TABLE
Located in your chosen corner (default: bottom-right), this table shows real-time analysis of the current 4H candle.
Header Row:
"LIVE: CANDLE" - Shows which 4H session you're currently in
Quarter Row:
"Quarter: Q1/Q2/Q3/Q4 (Hour X)" - Shows which quarter you're currently forming
STATUS Section:
The status updates dynamically based on what has happened:
During Q1-Q2 (First Half):
"⏳ Q1 Building..." - First hour forming, range being established
"⏳ Q2 Building..." - Second hour in progress, Q2 within Q1 range so far
"🔼 Q2 Broke Q1 HIGH" - Q2 has broken above Q1 high
"🔽 Q2 Broke Q1 LOW" - Q2 has broken below Q1 low
"⚠️ Q2 Broke BOTH Q1 Extremes" - Q2 extended range in both directions
During Q3-Q4 (Second Half):
"✓ CURVE CONFIRMED" - Q2 broke one direction, second half reversed to opposite side
"✓ CONTINUATION CONFIRMED" - Q2 broke one direction, second half extended further same direction
"⏳ 2nd Half In Progress" - Q2 broke Q1, waiting to see if curve or continuation
"📊 No Q2 Break Occurred" - Q2 stayed within Q1 range (no curve/continuation setup)
EXPECTATION Section:
Shows the probabilities based on the current state:
When Q2 breaks Q1 high in 6AM:
EXPECT 2nd half:
CURVE (low < Q1): 60.6%
CONT (high > Q2): 38.5%
This tells you there's a 60.6% chance the second half will curve back to make a new low below Q1, versus 38.5% chance it continues higher above Q2.
When curve/continuation is confirmed:
Q2 broke high → 2nd half made new LOW below Q1
Curve: 60.6%
Shows what actually happened and the historical probability.
Color Coding:
Purple background = Curve confirmed (mean reversion occurred)
Green background = Continuation confirmed (upside extension)
Red background = Continuation confirmed (downside extension)
Blue background = Second half in progress, watching
Yellow background = No Q2 break (no setup)
Gray background = Still in first half, building
THE CURVE REFERENCE TABLE
Located in your chosen corner (default: bottom-left), this table provides a quick reference for all sessions.
Table Structure:
TOP SECTION: "When Q2 BREAKS Q1 HIGH"
BOTTOM SECTION: "When Q2 BREAKS Q1 LOW"
How to Read:
"Curve" column = % of time second half makes new extreme on OPPOSITE side
"Cont" column = % of time second half makes new extreme in SAME direction
"Winner" column = Which behavior is more likely
Purple highlight = Curve is the winner (higher %)
Blue highlight = Continuation is the winner
🔥 symbol = Strong edge (>60%)
Quick Reference Usage:
You're in 10AM session, Q2 just broke Q1 high. Look at top section, 10AM row:
Curve: 17.2%
Cont: 60.4%
Winner: CONT
Interpretation: 10AM breakouts tend to follow through. Only 17% chance of curving back. Trade with the break, not against it.
PRACTICAL TRADING EXAMPLES
Example 1: Perfect 6AM Curve Setup
Scenario:
6AM candle in progress
7:00 AM: Q1 ends, range is 18,000 - 18,050
7:30 AM: Price breaks above 18,050, reaches 18,075 (Q2 broke Q1 high)
Live table shows: "🔼 Q2 Broke Q1 HIGH"
Expectation: "CURVE (low < Q1): 60.6%"
Trading Decision:
Even though price broke to new highs, the 60.6% curve probability suggests looking for short opportunities expecting price to curve back below 18,000 in Q3-Q4.
Typical Outcome:
8:15 AM (Q3): Price starts declining
9:15 AM (Q4): Price makes new low at 17,990
Result: ✓ CURVE CONFIRMED
Example 2: 10AM Continuation Signal
Scenario:
10AM candle in progress
11:00 AM: Q1 ends, range is 18,100 - 18,150
11:45 AM: Price breaks above 18,150, reaches 18,180 (Q2 broke Q1 high)
Live table shows: "🔼 Q2 Broke Q1 HIGH"
Expectation: "CONT (high > Q2): 60.4%"
Trading Decision:
With 60.4% continuation probability, breakout likely to follow through. Look for long opportunities expecting extension above 18,180 in Q3-Q4.
Typical Outcome:
12:30 PM (Q3): Price continues higher to 18,200
1:15 PM (Q4): Price makes new high at 18,225
Result: ✓ CONTINUATION CONFIRMED
Example 3: Using Reference Table During Live Trading
You see Q2 breaking Q1 low during 2AM session:
Quick reference check:
2AM row, "When Q2 BREAKS Q1 LOW" section
Curve: 42.8% | Cont: 43.3% | Winner: Balanced
Interpretation: This is a coin flip - 2AM session is balanced when Q2 breaks low. Don't force a directional bias. Wait for second half price action confirmation or skip the setup.
Example 4: No Setup Scenario
Scenario:
6AM candle, Q2 ends at 8:00 AM
Q2 stayed within Q1 range (no break above or below)
Live table shows: "📊 No Q2 Break Occurred"
Trading Decision:
No curve/continuation setup exists. This analysis only applies when Q2 breaks Q1 range. Monitor for different strategies or wait for next 4H candle.
UNDERSTANDING THE UNDERLYING METHODOLOGY
Data Foundation:
Instrument: NQ Futures (E-mini NASDAQ-100)
Timeframe: 1-minute bars for precise quarter tracking
Period: January 2013 - December 2025
Sample: 3,136+ complete trading days
Total 4H Candles Analyzed: ~18,800+ individual sessions
Analysis Process:
For each 4H candle in the dataset:
Calculate Q1 high and low (first hour range)
Track whether Q2 breaks Q1 high, Q1 low, both, or neither
When Q2 breaks Q1 range, measure second half response:
Did Q3+Q4 make new low below Q1? (curve when Q2 broke high)
Did Q3+Q4 make new high above Q1? (curve when Q2 broke low)
Did Q3+Q4 make new high above Q2? (continuation when Q2 broke high)
Did Q3+Q4 make new low below Q2? (continuation when Q2 broke low)
Calculate percentages for each session
Why NQ-Specific?
Different futures contracts exhibit different intraday personality:
NQ (NASDAQ):
Tech-heavy, volatility-prone
6AM shows extreme curve behavior (60-64%) due to NY Open reversal tendency
10AM shows strong continuation (60%) as trends establish
ES (S&P 500) would show different probabilities because:
Lower volatility than NQ
Different institutional participation patterns
Different response to macro events
The indicator's probabilities are calibrated specifically to NQ behavior patterns. Using it on ES, RTY, or other instruments will produce misleading signals.
ORIGINALITY & INNOVATION
What Makes This Indicator Unique:
Quarter-Based Curve Analysis: Unlike traditional indicators that only identify breakouts, this tracks what happens after the breakout. The curve vs continuation framework is novel and provides directional edge.
Session-Specific Behavior: Recognizes that 6AM behaves fundamentally differently than 10AM. Most indicators apply the same logic across all sessions. This indicator provides session-specific probabilities.
Statistical Validation: Every probability shown is backed by 10+ years of data (2,900+ candles per session). Not based on theory or discretionary observation.
Real-Time Quarter Tracking: Precisely identifies which quarter you're in and what stage of the pattern is forming. Provides forward-looking probabilities based on current state.
The 6AM Discovery: The 60-64% curve probability in 6AM is a quantified, repeatable edge that contradicts traditional "breakout = continuation" assumptions. This session exhibits mean reversion characteristics that most traders miss.
Dual-Direction Analysis: Tracks both upside breaks (Q2 > Q1 high) and downside breaks (Q2 < Q1 low) separately, as they can have different probabilities.
Visual Quarter System: The combination of colored boxes, quarter separators, and real-time labels provides instant visual understanding of pattern stage and expected behavior.
HOW TO USE THIS INDICATOR
Step 1: Identify Current 4H Candle
Check which colored box you're in and what session it represents.
Step 2: Wait for Q2 to Complete
The setup doesn't exist until Q2 (hour 2) breaks Q1 range. Monitor the live table.
Step 3: Check Q2 Break Status
Did Q2 break Q1 high? Q1 low? Both? Or neither?
Step 4: Consult Reference Table
Look up current session in curve reference table. What's the probability?
Step 5: Apply Session-Specific Strategy
For 6AM (60-64% curve):
Q2 breaks high → Expect curve back for new low
Q2 breaks low → Expect curve back for new high
Strategy: FADE the Q2 break, look for reversal entries in Q3-Q4
For 10AM (52-60% continuation):
Q2 breaks high → Expect continuation higher
Q2 breaks low → Expect continuation lower
Strategy: TRADE WITH the Q2 break, look for continuation entries in Q3-Q4
For 2AM (38-43% curve, 43-47% continuation):
Balanced probabilities
Strategy: Wait for Q3 price action to confirm direction, or skip
For 6PM/10PM (50-59% continuation):
Moderate continuation bias
Strategy: Lean with the break but use tight stops
Step 6: Monitor Live Status
Watch the live table for confirmation:
"✓ CURVE CONFIRMED" = Mean reversion occurred
"✓ CONTINUATION CONFIRMED" = Follow-through occurred
"⏳ 2nd Half In Progress" = Still developing
BEST PRACTICES
Focus on 6AM for curve trades - This is THE high-probability mean reversion session
Focus on 10AM for continuation trades - This is THE high-probability breakout session
Be cautious with 2AM - Balanced probabilities mean lower edge
Use quarter separators - Enter trades early in Q3 after Q2 break, don't wait for Q4
Combine with price action - Don't blindly fade 6AM or follow 10AM; wait for confirming price structure
Respect the 60% rule - 6AM curve happens 60% of time, which means 40% it doesn't. Manage risk accordingly
Watch for "No Q2 Break" - If Q2 doesn't break Q1, this analysis doesn't apply
Consider overnight context - If 6AM opens with huge gap, curve probability may be affected
SETTINGS & CUSTOMIZATION
Display Settings:
Show 4H Candle Boxes - Toggle colored range boxes
Box Colors - Customize color for each session
Show Quarter Separators - Show/hide 1H, 2H, 3H lines
Show Candle Name Labels - Show/hide session labels at 2H mark
Separator Line Style - Solid/Dashed/Dotted
Max Historical Candles - How many past 4H candles to display (1-50)
Table Settings:
Show Live Status Table - Toggle real-time analysis table
Show Curve Reference Table - Toggle probability reference table
Table Positions - Place tables in any corner
Table Text Size - Tiny/Small/Normal
LIMITATIONS & DISCLAIMERS
NQ FUTURES ONLY - All probabilities are NQ-specific, do not use on other instruments
Requires Q2 break - No curve/continuation setup exists if Q2 stays within Q1 range
Probabilities, not certainties - 60% means it happens 6 out of 10 times, not every time
Lower timeframe noise - 1-minute tracking can be choppy, consider using 5min+ for entries
Gap days - Large overnight gaps may affect curve/continuation probabilities
Not standalone - Use as confluence with your strategy, not as sole decision factor
Historical performance - Past statistics don't guarantee future results
WHY THE CURVE CONCEPT MATTERS
Traditional trading wisdom says: "Breakout = Continuation"
This indicator proves that's not always true. Specifically, during the 6AM session (late London + NY Open), when Q2 breaks the Q1 range, price curves back to the opposite extreme 60-64% of the time.
This creates a unique exploitable edge:
Most breakout traders go LONG when Q2 breaks Q1 high
But in 6AM, 60.6% of the time, price curves back down for new low
Shorting the breakout (counter-intuitive) is the higher-probability trade
The 10AM session shows the opposite:
Breakouts in 10AM tend to follow through (52-60%)
Traditional "trade the breakout" strategy works better here
By knowing which session you're in, you can adapt your strategy to match the session's personality.
FINAL NOTES
This indicator distills 10+ years of NQ intraday behavior into actionable, session-specific probabilities. The discovery that 6AM exhibits 60-64% curve behavior while 10AM exhibits 52-60% continuation behavior provides a statistical edge for mean reversion and trend-following traders respectively.
The highest-probability setups:
6AM Q2 break → FADE (60-64% edge for curve)
10AM Q2 break → FOLLOW (52-60% edge for continuation)
2AM = SKIP (balanced probabilities, no clear edge)
Master the 6AM curve and 10AM continuation first. These two sessions provide the clearest statistical edges.
Remember: Trade with proper risk management. This tool provides probabilities based on historical behavior, not predictions of future performance.
4H HOD/LOD Checkpoint Analysis4H HOD/LOD Checkpoint Analysis - Detailed User Guide
OVERVIEW
This indicator is a data-driven probability framework for NQ Futures traders that predicts High-of-Day (HOD) and Low-of-Day (LOD) placement based on statistical analysis of 3,136+ trading days (2013-2025). Unlike traditional indicators that rely on technical signals, this tool uses checkpoint-based state analysis with zero forward-looking bias to provide real-time probabilities of whether the daily range is complete.
⚠️ IMPORTANT: This indicator is specifically designed for NQ FUTURES ONLY. All probabilities, patterns, and statistics were derived from a 10+ year historical dataset of NQ 1-minute bars. Using this on other instruments will produce inaccurate results.
CORE CONCEPT: CHECKPOINT METHODOLOGY
What is a Checkpoint?
A checkpoint occurs when a 4-hour candle closes. At this moment, the indicator "locks" the current market state and calculates probabilities for the remainder of the trading day. The key innovation is that state never changes after locking - probabilities remain constant throughout the session until the next checkpoint.
The Six 4-Hour Candles (EST):
6PM (18:00-22:00) - Evening/Globex open
10PM (22:00-02:00) - Asia session
2AM (02:00-06:00) - Early London
6AM (06:00-10:00) - Late London + NY Open
10AM (10:00-14:00) - NY Morning
2PM (14:00-17:00) - NY Afternoon (3 hours only)
Five Checkpoints:
10PM Checkpoint - After 6PM closes
2AM Checkpoint - After 10PM closes
6AM Checkpoint - After 2AM closes
10AM Checkpoint - After 6AM closes (most critical)
2PM Checkpoint - After 10AM closes (highest conviction fade signals)
HOW IT WORKS: THE THREE-FACTOR STATE SYSTEM
At each checkpoint, the indicator evaluates three critical factors to determine probability:
1. ELIMINATIONS (Quantity)
An "elimination" occurs when a candle trades beyond a previous candle's high or low, effectively removing that candle from contention for HOD/LOD.
Example at 10AM Checkpoint:
6PM high = 18,000
10PM high = 18,050 (eliminates 6PM high)
2AM high = 18,100 (eliminates 10PM high)
6AM high = 18,075 (does NOT eliminate 2AM high)
Result: 2 eliminations
The number of eliminations indicates trend strength:
0 eliminations = Range-bound, high probability extremes already set
1-2 eliminations = Moderate trend
3-4 eliminations = Strong trend day, range likely to extend
2. STRUCTURE (Pattern Type)
The indicator distinguishes between two elimination patterns:
Sequential: Eliminations occur in order (6pm → 10pm → 2am → 6am → 10am)
Indicates smooth, consistent trend
Example: 10pm eliminates 6pm, then 2am eliminates 10pm (sequential)
Skip: Eliminations skip candles
Indicates choppy/reversal behavior
Example: 2am eliminates 6pm but NOT 10pm (skip pattern)
Why it matters: Skip patterns show 2X probability differences compared to sequential patterns. At 10AM checkpoint with 2 eliminations, skip pattern shows 64% participation rate vs 36% for sequential pattern with previous survived.
3. PREVIOUS CANDLE STATUS
Did the immediately prior candle get eliminated?
Eliminated: Previous candle's high/low was taken out
Indicates relentless trend
Higher probability of continuation
Survived: Previous candle's high/low still intact
Indicates trend pause
Higher probability of mean reversion or range completion
Critical insight: High and low are tracked separately. At 2AM checkpoint, 10PM might have eliminated 6PM high (relentless uptrend) but NOT eliminated 6PM low (low survived). This creates different probabilities for HOD vs LOD.
VISUAL ELEMENTS
4-Hour Candle Boxes
Each 4H candle is displayed as a colored box showing its range:
Gray = 6PM (evening)
Blue = 10PM (Asia)
Purple = 2AM (early London)
Orange = 6AM (London + NY Open) - THE CURVE SESSION
Teal = 10AM (NY morning) - THE MONEY SESSION
Red = 2PM (NY afternoon) - THE FADE SESSION
HOD/LOD Lines
Black horizontal lines extend from current HOD/LOD with labels showing:
Which candle set the extreme
Current price level
THE CHECKPOINT TABLE EXPLAINED
Table Header:
Shows current checkpoint (e.g., "🎯 10AM CHECKPOINT") or "⏳ PRE-CHECKPOINT" if between checkpoints.
Main Metrics (Side-by-Side Comparison):
The table displays HOD and LOD separately in two columns because they can have different patterns:
METRIC
HODLOD Eliminations
Number of candles eliminated so far for highs
Number of candles eliminated so far for lows
Structure
Sequential or Skip pattern for highs
Sequential or Skip pattern for lows
Prev Candle
Was previous candle's high eliminated or did it survive?
Was previous candle's low eliminated or did it survive?
Pattern
Combined interpretation: Relentless/Paused/Skip/Early
Combined interpretation: Relentless/Paused/Skip/Early
Color Coding:
Structure Row:
White = Sequential (smooth trend)
Orange = Skip (choppy/reversal)
Previous Candle Row:
Red = Eliminated (relentless trend continuing)
Blue = Survived (trend paused)
Pattern Row:
Red = Relentless (previous eliminated + sequential = strong trend)
Blue = Paused (previous survived + sequential = trend pause)
Orange = Skip/Chop (skip pattern = reversal likely)
Gray = Early (0-1 eliminations, too early to tell)
Probability Section:
Prob Already In: Percentage chance that HOD/LOD has already been set
Color coding:
Green (>75%) = High confidence extreme is in, FADE
Yellow (45-75%) = Moderate confidence
Red (<45%) = Low confidence extreme is in, CONTINUATION likely
Sample Size: Shows how many historical occurrences match this exact state (n=XXX)
Larger samples = higher confidence
Most common states have n=500-2,000+
Current: Which candle currently holds HOD/LOD
Pattern Guide Section:
Appears when you have 2+ eliminations. Provides interpretation:
📈 Paused: Trend has paused, 2pm more likely to set extreme
📈 Relentless: Breaking higher/lower, continuation expected
📈 Skip/Chop: Choppy pattern, next session likely
Same for lows with 📉 symbol.
PRACTICAL TRADING EXAMPLES
Example 1: High Conviction Fade Setup
State at 10AM Checkpoint:
Eliminations: 0 (both HOD/LOD)
Structure: None (no eliminations yet)
Prev Candle: Survived
Table shows:
HOD Prob Already In: 68.9% (n=582)
LOD Prob Already In: 73.6% (n=785)
Interpretation: Range is likely complete. Fade extremes. With 0 eliminations and 70%+ probability, this is a high-conviction mean reversion signal.
Example 2: Strong Continuation Signal
State at 10AM Checkpoint:
Eliminations: 3 (both HOD/LOD)
Structure: Sequential
Prev Candle: Eliminated (relentless)
Table shows:
HOD Prob Already In: 29.8% (n=1,758)
LOD Prob Already In: 34.6% (n=1,451)
Pattern: 📈 Relentless / 📉 Relentless
Interpretation: Strong trend day. Only 30-35% chance range is complete. Look for breakouts in direction of trend. 10AM and 2PM likely to extend range.
Example 3: Pattern Structure Edge
State at 10AM Checkpoint:
Eliminations: 2 (HOD)
Structure: Skip (orange background)
Prev Candle: Eliminated vs Alternative State:
Eliminations: 2 (HOD)
Structure: Sequential
Prev Candle: Survived
Result: Skip pattern shows 64% chance 10AM participates vs 36% for sequential+survived. Skip pattern = 2X more likely to see 10AM high. This structural edge is unique to this indicator.
Example 4: Different HOD vs LOD Patterns
State at 10AM Checkpoint:
HOD: 2 eliminations, Sequential, Previous Eliminated (Relentless) = 46.7% in
LOD: 2 eliminations, Skip, Previous Eliminated (Choppy) = 48.4% in
Interpretation: Highs show relentless uptrend but lows show choppy behavior. This divergence suggests potential for upside continuation but with volatility. Not a clean trend day.
KEY CHECKPOINT STATISTICS (DERIVED FROM 10-YEAR DATASET)
10PM Checkpoint (After 6PM):
Very early in day
13.5% HOD in, 21.3% LOD in
Most likely outcome: Range extends into 6AM/10AM
2AM Checkpoint (After 10PM):
Still early
With 0 elims: 22-31% in (balanced)
With 1 elim: 8-12% in (strong trend signal)
6AM Checkpoint (After 2AM) - Critical Decision Point:
With 0 elims: 40-47% in (balanced, could go either way)
With 2 elims: 18-22% in (strong trend into 6AM/10AM)
Most likely outcome: 10AM sets extremes (~38-40%)
10AM Checkpoint (After 6AM) - Highest Conviction:
With 0 elims: 69-74% in → FADE (high confidence)
With 3 elims: 30-35% in → BUY/SELL continuation
This is THE money checkpoint for high-probability setups
2PM Checkpoint (After 10AM) - Maximum Fade Conviction:
With 0-3 elims: 67-95% in → FADE strongly
With 4 elims: 49-61% in (monster trend, weaker fade)
2PM is primarily a mean reversion session
UNDERSTANDING THE UNDERLYING DATA
All probabilities are derived from analysis of:
Instrument: NQ Futures (E-mini NASDAQ-100)
Timeframe: 1-minute bars
Period: January 2013 - December 2025
Sample: 3,136+ complete trading days
Methodology: Real-time checkpoint analysis with zero forward-looking bias
Why NQ-Specific?
Each futures contract has unique:
Session characteristics (6AM in NQ shows 60-64% curve behavior, other sessions differ)
Timing patterns (NQ's 10AM session has 67-74% immediate takeouts)
Volatility profiles (NQ 2PM shows 56% bullish bias vs ES shows different bias)
Using this indicator on ES, RTY, or other instruments will produce inaccurate results because the probability tables are NQ-specific.
ORIGINALITY & INNOVATION
What Makes This Indicator Unique:
Zero Forward-Looking Bias: State locks at checkpoint moments. Traditional indicators recalculate continuously, introducing bias. This indicator freezes probabilities at the exact moment a 4H candle closes.
Three-Factor State System: Combines elimination count, structure pattern, and previous candle status. Most indicators only track one dimension. This multi-factor approach provides 2X+ probability differentials.
Separate HOD/LOD Tracking: Highs and lows can have different patterns simultaneously (relentless high with choppy low). This indicator tracks them separately for precision.
Pattern Structure Analysis: Distinguishes between sequential and skip patterns, a concept not found in standard indicators. Skip patterns show mean reversion while sequential shows continuation.
10+ Year Statistical Foundation: Every probability is backed by hundreds to thousands of historical occurrences (sample sizes shown in table). Not based on theories or assumptions.
Checkpoint-Specific Probabilities: Different checkpoints have different probability profiles. 10AM checkpoint with 0 eliminations = 70%+ fade. 6AM checkpoint with same state = 40%+ fade. Context matters.
HOW TO USE THIS INDICATOR
Step 1: Wait for Checkpoint
The table will show "⏳ PRE-CHECKPOINT" until a 4H candle closes. Probabilities are only valid at checkpoint moments.
Step 2: Read the State
Check the three factors:
How many eliminations?
Sequential or skip?
Previous candle eliminated or survived?
Step 3: Check Probability
Look at "Prob Already In" percentage:
>75% (Green) = High confidence extreme is set, fade
45-75% (Yellow) = Moderate confidence, use other confirmation
<45% (Red) = Low confidence extreme is set, continuation likely
Step 4: Check Sample Size
Larger sample (n=1,000+) = higher confidence
Smaller sample (n=50-200) = use caution, edge is real but less robust
Step 5: Consider Pattern
Read the pattern guide:
Relentless = trend continuing
Paused = trend stalled, mean reversion
Skip/Chop = reversal/range likely
Step 6: Compare HOD vs LOD
If both show similar patterns = cleaner signal
If divergent patterns = complex day, be cautious
BEST PRACTICES
Focus on 10AM and 2PM checkpoints - These have the highest conviction signals
Combine with price action - Don't fade blindly at 90% probability if price is breaking out strongly
Larger samples = better edges - Prioritize setups with n=500+
Watch for pattern divergence - When HOD and LOD show different patterns, expect complexity
Remember session characteristics:
6AM = THE CURVE SESSION (60-64% mean reversion when Q2 breaks Q1)
10AM = THE MONEY SESSION (67-74% immediate takeouts, highest conviction)
2PM = THE FADE SESSION (67-95% extremes already in)
SETTINGS
Show 4H Candle Boxes - Display colored boxes for each 4H candle
Show HOD/LOD Lines - Display horizontal lines at current extremes
Show Checkpoint Analysis - Display probability table
Table Position - Choose where to place the checkpoint table
Table Size - Tiny/Small/Normal
Colors - Customize box colors for each session
LIMITATIONS & DISCLAIMERS
NQ FUTURES ONLY - Do not use on other instruments
Not a standalone system - Use as confluence with your strategy
Historical data - Past performance doesn't guarantee future results
Sample size variance - Some states have smaller samples, use judgment
Requires understanding - Read this guide fully before trading with this tool
FINAL NOTES
This indicator represents 10+ years of NQ futures data distilled into actionable, real-time probabilities. The checkpoint methodology ensures zero forward-looking bias, while the three-factor state system provides granular edge that traditional indicators miss.
Remember: This tool provides probabilities, not certainties. Trade with proper risk management, and use this as one input in your decision-making process.
Historical Returns [BigBeluga]🔵 OVERVIEW
The Historical Returns indicator visualizes daily and monthly return data to help traders assess seasonal performance and volatility behavior. It provides a clean and informative dashboard showing the current month’s daily return bubbles, monthly return curves, and a snapshot of the current month and year performance. This tool is ideal for spotting recurring return patterns and understanding the broader profitability context of a symbol.
🔵 CONCEPTS
Daily Return Bubbles: Each trading day is analyzed for its return percentage, and plotted as a bubble with size proportional to the return magnitude.
Monthly Performance Curves: Average or cumulative returns are calculated and plotted to show how the current month is performing relative to historical averages.
Current Year Return: Current year performance as a single return value, giving traders context on long-term profitability.
Current Month Average Return: Current month average performance as a single return value, giving traders context on short-term profitability.
Extreme Return Labels: Optionally highlights daily returns above +4% or below -4% with labeled percentages for spike recognition.
🔵 FEATURES
Shows daily return bubbles (1%–7%+), color-coded by direction.
Labels monthly returns with the month name and percentage value.
Displays a performance dashboard with:
Daily return heatmap for the current month.
Average return for the current month.
Year-to-date return.
Toggle between average and cumulative modes for monthly return curves.
Clearly marks days with abnormal return spikes using optional labels.
Clean fallback warning if not on a daily chart ("⚠️USE DAILY TIMEFRAME").
Custom color themes for bullish and bearish values.
🔵 HOW TO USE
Use the monthly return curve to compare how the current month is performing against historical averages.
Look for clusters of positive or negative bubbles as signals of strong directional weeks.
Watch extreme return labels for volatility spikes or catalyst days.
Use year-to-date return to assess how the asset is trending in the broader macro cycle.
Combine with other BigBeluga tools to align trades with historically favorable periods.
🔵 CONCLUSION
Historical Returns is your visual companion for return analytics — helping you identify profitable months, detect volatility surges, and understand historical seasonality at a glance. With a clean dashboard and insightful overlays, this tool supports better timing and improved statistical edge in both short- and long-term trades.






















