Log Regression Channel (Dezza Fixed v2)This custom indicator builds a curved Logarithmic Regression Channel designed for long-term Bitcoin and macro asset analysis. It performs a linear regression on the logarithm of price to estimate the market’s fair-value growth curve, then converts that back into price space to form upper and lower deviation bands.
It helps identify where price sits relative to its long-term exponential trend — showing potential overvaluation (upper band) or undervaluation (lower band) zones.
Best used on weekly or monthly charts to visualise market cycles and fair-value reversion. Adjustable inputs let you control lookback length, band width, and midline visibility.
Indicators and strategies
RSI Divergence 1-20 Candlesthis is a rsi divergence indicator used to mark divergence on the candle for knowing the trend
Candle Body RatioThis indicator is designed to calculate the percentage of the upper wick, the body, and the lower wick of the candle over which your cursor is positioned.
Mean Reversion Points [Clever Simplified]📊 Indicator Name:
Mean Reversion Points
🧠 Purpose
This indicator is designed to identify potential turning points in the market where the price may reverse back toward its mean (average) — a common concept in mean reversion trading strategies.
It simplifies the detection of overextended highs or lows by marking them visually on the chart, helping traders spot areas where price could correct or “revert” to a more balanced level.
⚙️ How It Works
1. Inputs
Lookback Period (len): Default 35 — defines how many previous bars are analyzed to determine highs and lows.
Show Labels / Show Markers: Toggles to display on-chart signals.
Colors:
Aqua → Mean Reversion Up (potential buy zone)
Orange → Mean Reversion Down (potential sell zone)
2. Core Calculations
The script calculates:
highest → The highest price in the last len bars.
lowest → The lowest price in the last len bars.
highest1 / lowest1 → Shorter-term highs and lows using a quarter of the main lookback (len / 4).
It then stores a “value” that updates depending on whether the price reaches a new high or low.
If the low = lowest, it records the corresponding highest level.
If the high = highest, it records the lowest level.
This dynamic relationship helps the indicator adapt as new bars form.
3. Bands for Comparison
Two “bands” are generated:
band: Long-term boundary based on full lookback period.
band1: Short-term boundary (faster and more responsive).
These act as reference zones to check when price is overstretched relative to its recent range.
4. Mean Reversion Logic
The indicator identifies potential reversal points using crossover conditions:
Mean Reversion Down (mean_rev_dn):
Triggers when the high crosses below the short-term upper band (band1), suggesting potential downward reversion (sell signal).
Mean Reversion Up (mean_rev_up):
Triggers when the low crosses above the short-term lower band (band1), suggesting potential upward reversion (buy signal).
These signals occur when price fails to maintain a breakout and is likely returning toward its mean.
5. Visual Output
If enabled:
Labels:
“Mean Rev ↓” → Placed above candles signaling a possible downward reversion.
“Mean Rev ↑” → Placed below candles signaling a possible upward reversion.
Markers:
Small colored triangles mark the same events for quick visual recognition.
💡 Practical Use
Best For: Swing traders and scalpers who trade reversals or range-bound markets.
Not Ideal For: Strong trending conditions, where price tends to move away from the mean instead of reverting.
Combination Tips: Works best when combined with:
RSI or Bollinger Bands for overbought/oversold confirmation.
Volume indicators to verify strength of reversals.
✅ Summary
Feature Description
Type Mean Reversion / Reversal Detector
Main Concept Identifies potential highs/lows where price may reverse
Signals Buy (Mean Rev ↑) and Sell (Mean Rev ↓)
Visualization Labels and triangles on chart
Customization Adjustable lookback period, markers, and colors TVC:USOIL TVC:DXY CRYPTO:BTCUSD OANDA:XAUUSD OANDA:EURUSD OANDA:AUDJPY
Quantura - Average Intraday Candle VolumeIntroduction
“Quantura – Average Intraday Candle Volume” is a quantitative visualization tool that calculates and displays the average traded volume for each intraday time position based on a user-defined historical lookback period. It allows traders to analyze recurring intraday volume patterns, identify high-activity sessions, and detect liquidity shifts throughout the trading day.
Originality & Value
This indicator goes beyond standard volume averages by normalizing and aligning volume data according to the time of day. Instead of simply smoothing recent bars, it builds an intraday volume profile based on historical daily averages, enabling users to understand when during the day volume typically peaks or drops.
Its originality and usefulness come from:
Converting standard volume data into time-aligned intraday averages.
Visualization of historical intraday liquidity behavior, not just total daily volume.
Dynamic scaling using normalization and transparency to emphasize active and quiet periods.
Optional day-separator lines for precise intraday structure recognition.
Gradient-based coloring for better visual interpretation of volume intensity.
Functionality & Core Logic
The indicator divides each day into discrete intraday time positions (based on chart timeframe).
For each position, it stores and updates historical volume values across the selected number of days.
It calculates an average volume per time position by aggregating all stored values and dividing them by the number of valid days.
The result is plotted as a continuous histogram showing typical intraday volume distribution.
The bar colors and transparency dynamically reflect the relative intensity of volume at each point in the day.
Parameters & Customization
Number of Days for Averaging: Defines how many past days are included in the volume average calculation (default: 365).
UTC Offset: Allows synchronization of intraday cycles with local or exchange time zones.
Base Color: Sets the main color for plotted volume columns.
Color Mode: Choose between “Gradient” (transparency dynamically adjusts by intensity) or “Normal” (fixed opacity).
Day Line: Toggles dashed vertical lines marking the start of each trading day.
Visualization & Display
Volume is plotted as a series of histogram bars, each representing the average volume for a specific intraday time position.
A gradient color mode enhances readability by fading lower-intensity areas and highlighting high-volume regions.
Optional day-separator lines visually segment historical sessions for easy reference.
Works seamlessly across all chart timeframes that divide the 24-hour day into regular bar intervals.
Use Cases
Identify when trading activity typically peaks (e.g., session opens, news windows, or overlapping markets).
Compare current intraday volume to historical averages for early anomaly detection.
Enhance algorithmic or discretionary strategies that depend on volume-timing alignment.
Combine with volatility or price structure indicators to confirm market activity zones.
Evaluate session consistency across different time zones using the UTC offset parameter.
Limitations & Recommendations
The indicator requires intraday data (below 1D resolution) to function properly.
Volume behavior may vary across brokers and assets; adjust averaging period accordingly.
Does not predict price movement — it provides volume-based context for analysis.
Works best when combined with structure or momentum-based indicators.
Markets & Timeframes
Compatible with all intraday markets — including crypto, Forex, equities, and futures — and all intraday timeframes (from 1 minute to 4 hours). It is particularly valuable for analyzing assets with continuous 24-hour trading activity.
Author & Access
Developed 100% by Quantura. Published as a Open-source script indicator. Access is free.
Important
This description complies with TradingView’s Script Publishing and House Rules. It provides a clear explanation of the indicator’s originality, logic, and purpose, without any unrealistic performance or predictive claims.
SMA 10/20/50 Weekly on all timeframeSMA 10/20/50 Weekly on all timeframe to keep a bias on all your chart
9 EMA and 20 MA with Fill9 EMA and 20 MA with Fill
puts a fill green or red weather whichway the trend is going
Victoria RSI Hybrid Pro – Momentum + Volume + DivergenceConditions and Actions:
RSI > 50 → Bullish regime → Consider Calls
RSI < 50 → Bearish regime → Consider Puts
RSI crosses up → Momentum shift up → Buy confirmation
RSI crosses down → Momentum shift down → Sell confirmation
RSI > 70 → Overbought → Take profits
RSI < 30 → Oversold → Watch for reversal
Bullish divergence → Hidden upward momentum → Reversal watch
Bearish divergence → Hidden downward momentum → Reversal watch
4. Multi-Indicator Confirmation Rules
Combine signals from EMA, SMA, RSI, and Volume to identify high-confidence trades.
Rules:
Triple Green → EMA1>SMA3, RSI>50, Volume Up → Buy Calls / Shares
Triple Red → EMA1 70 + Weak Volume → Exit Calls early
EMA1 flips direction + Strong Volume → Confirm bias immediately
RSI on 1H agrees with main chart → Trend continuation likely
6. Timeframes
Scalps: 1m–5m
Next-Day Options: 15m–1H
Swings: 4H–1D
7. Key Mindset Rules
Patience beats prediction. Wait for confirmations.
Volume confirms conviction, not direction.
If RSI and Overlay disagree → No trade.
Only act when 2 of 3 systems (EMA, RSI, Volume) align.
Delta Arrows Only//@version=5
indicator("Delta Arrows Only", overlay=true)
// 输入参数
sidd_time_res_for_delta = input.timeframe('1', "Lower TimeFrame", options= )
show_as_pcent = input.bool(false, "Delta as % of Volume")
// 从低时间框架获取 volume 和 candle 方向
array sidd_ltf_volume = request.security_lower_tf(syminfo.tickerid, sidd_time_res_for_delta, volume)
array sidd_ltf_close_minus_open = request.security_lower_tf(syminfo.tickerid, sidd_time_res_for_delta, math.sign(close-open))
sidd_test_pos_volume = array.new_float()
sidd_test_neg_volume = array.new_float()
for i = 0 to array.size(sidd_ltf_close_minus_open)-1
if array.size(sidd_ltf_close_minus_open) > i+1
if array.get(sidd_ltf_close_minus_open, i) < 0
array.push(sidd_test_neg_volume, nz(array.get(sidd_ltf_volume, i)))
else if array.get(sidd_ltf_close_minus_open, i) > 0
array.push(sidd_test_pos_volume, nz(array.get(sidd_ltf_volume, i)))
sidd_plot = nz(array.sum(sidd_test_pos_volume)) - nz(array.sum(sidd_test_neg_volume))
sidd_plot := show_as_pcent ? ((sidd_plot / volume) * 100) : sidd_plot
// 条件逻辑:K线 vs Delta
isBullish = close > open
isBearish = close < open
isDeltaRed = sidd_plot < 0
isDeltaGreen = sidd_plot > 0
// 🚀 主图箭头
plotshape(isBullish and isDeltaRed, title="Bearish Delta on Bullish Candle", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.small)
plotshape(isBearish and isDeltaGreen, title="Bullish Delta on Bearish Candle", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.small)
ATR Trend Table with DI both waysThis indicator is used confirm entry point whether it has met ATR and DI direction criterias
KKTT V9Description for Publication
Order Flow + Opening Range Trend Dashboard Combo
This indicator combines Cumulative Volume Delta (CVD) momentum, Opening Range breakout levels, and a Multi-Timeframe Trend Dashboard to provide a complete intraday market view.
Features:
CVD Momentum (Order Flow):
Detects real buying/selling pressure by tracking cumulative delta between bullish and bearish candles.
Buy signal → when CVD crosses above its EMA, price above EMA200, and volume above average.
Sell signal → when CVD crosses below its EMA, price below EMA200, and volume above average.
Opening Range Levels:
Automatically marks the key session opening price, upper breakout (Buy Line), and lower breakout (Sell Line).
Helps identify potential breakout zones for major sessions (e.g., Asia, Europe, US).
Trend Dashboard:
Displays the trend status for multiple timeframes (D1, H4, H1, H15).
Green → Uptrend
Red → Downtrend
Orange → Sideways
Use this dashboard to align intraday signals with higher-timeframe trends.
Usage Tips:
Prioritize buy signals when higher-timeframe trends are bullish.
Prioritize sell signals when higher-timeframe trends are bearish.
Combine with support/resistance zones for better confirmation.
This script provides a clear visualization of order flow strength, market structure, and session volatility — ideal for traders who want to capture directional moves with strong momentum confirmation.
Hybrid Linear Regression Channel with Fibonacci LevelsHow to Use the LRC Fib Hybrid Indicator (Detailed Guide)
1. Read the Trend
2.The thick blue line is the linear regression midline.
If it’s sloping upward → uptrend (favor longs).
If sloping downward → downtrend (favor shorts).
The gray channel bounds are ±2 standard deviations (adjustable).
3. Understand Fibonacci Levels
Fib lines are projected parallel to the regression slope using the channel width as 100%:
Red dashed lines (0.0 to 0.786): Support zones in uptrends.
Blue dashed line (0.5): Midline/neutral.
Green dashed lines (1.0 to 2.618): Resistance zones in downtrends.
Strongest levels: 0.618 (support) and 1.618 (resistance).
4. Buy Signal (Long Entry)
Triggered when:
Midline is rising (uptrend confirmed).
Price crosses above a red Fib level (0.0–0.786).
Volume > 20-period average (if confirmation enabled).
Action:
Enter long on the green triangle (▲).
Stop Loss: Below the lower gray channel or recent swing low.
Take Profit: At 1.0, 1.272, or 1.618 green Fibs.
5. Sell Signal (Short Entry)
Triggered when:
Midline is falling (downtrend).
Price crosses below a green Fib level (1.272–2.618).
Volume > average.
Action:
Enter short on the red triangle (▼).
Stop Loss: Above the upper gray channel.
Take Profit: At 1.0, 0.786, or 0.618 red Fibs.
6. Use the Info Table (Bottom-Right)
Shows live prices of all Fib levels, current trend ("Up"/"Down"), and signal status ("BUY"/"SELL"/"None").
7. Customize via Settings (Gear Icon)
Regression Length: 50–200 (shorter = faster response).
Std Dev Multiplier: 1.5–3.0 (tighter/wider channel).
Toggle Fibs: Hide unused levels to declutter.
Volume Confirmation: Turn off for pure price action.
8. Set Alerts
Right-click chart → Add Alert → Select "Buy Signal" or "Sell Signal" → Enable popup/email/webhook.
9. Best Practices
Best in trending markets (avoid chop).
Wait for volume spike on bounce.
Combine with higher timeframe bias.
Use 0.618/1.618 as primary reversal zones.
This indicator gives you adaptive trend, precise entries, volume filter, and dynamic targets — all in one clean overlay.
ONLY LONG – 4H Breakout → 1H EMA(12/21) [Signals]🔹 ONLY LONG – 4H Breakout → 1H EMA(12/21)
Author: SystemsOverFeelings
Type: Signal-only indicator (non-repainting)
Timeframe: Designed for the 1H chart
Markets: BTCUSDT perpetual& major pairs
📖 Concept
A high-timeframe confirmation model for trend-continuation longs.
It detects:
A 4-Hour breakout candle closing above recent range highs,
With very-high volume confirmation, and
Then waits for a 1-Hour pullback into the EMA(12/21) band or a Break of Structure (BOS) to re-enter.
No repainting — all 4H logic uses request.security(..., lookahead_off) for confirmed data.
🧩 Signal Logic
✅ 4H Trigger: Breakout candle with volume > SMA(20) × user multiplier.
✅ Armed Regime: Green background = system ready for 1H entries.
🟢 LONG Signal: 1H candle consolidates inside or touches the EMA band, or shows BOS confirmation.
❌ EXIT Signal: 4H EMA(12) crosses below EMA(21).
All signals are visually marked and alert-ready.
⚙️ Adjustable Parameters
4H volume multiplier
Range lookback days
Pullback strictness (inside/touch)
1H BOS pivot length & mode
Expiry time for invalidated setups
🔔 Alerts
Built-in alerts for:
4H breakout trigger
1H long entry signal
4H band exit
Use them directly via “Create Alert → Condition → This Script → Choose Signal.”
💡 Notes
Works best on BTC/ETH 1H chart.
Non-repainting, multi-timeframe logic.
Use for directional bias or entry timing — not financial advice.
VWAP (SIYL) Stdev Bands v2v2 indicator to allow for reversion-to-mean trading via the Stay In Your Lane approach.
5m Hammer Detector Pro (Clean View)//@version=5
indicator("5m Hammer Detector Pro (Clean View)", overlay=true)
// ===== Inputs =====
tf_detect = input.timeframe("5", "Detection timeframe (keep 5 for 5-min)")
min_lower_to_body = input.float(2.0, "Min lower-wick / body ratio", step=0.1)
max_upper_to_body = input.float(0.5, "Max upper-wick / body ratio", step=0.1)
max_body_to_range = input.float(0.30, "Max body / total-range ratio", step=0.01)
min_lower_to_range = input.float(0.45, "Min lower-wick / total-range ratio", step=0.01)
use_bullish_only = input.bool(true, "Only bullish hammer (close > open)?")
vol_mult = input.float(1.5, "Volume threshold multiplier (x avg volume)", step=0.1)
confirm_next_candle = input.bool(true, "Require next bullish candle for confirmation?")
// ===== Hammer Logic =====
f_is_hammer(o, h, l, c) =>
body = math.abs(c - o)
lower = math.min(o, c) - l
upper = h - math.max(o, c)
rng = h - l
body := body == 0 ? 0.0000001 : body
rng := rng == 0 ? 0.0000001 : rng
cond1 = (lower / body) >= min_lower_to_body
cond2 = (upper / body) <= max_upper_to_body
cond3 = (body / rng) <= max_body_to_range
cond4 = (lower / rng) >= min_lower_to_range
cond5 = use_bullish_only ? (c > o) : true
cond1 and cond2 and cond3 and cond4 and cond5
// ===== 5-Min Data =====
= request.security(syminfo.tickerid, tf_detect, )
vol_avg = ta.sma(rv, 20)
vol_ok = rv > (vol_avg * vol_mult)
hammer_raw = f_is_hammer(ro, rh, rl, rc)
hammer_with_vol = hammer_raw and vol_ok
= request.security(syminfo.tickerid, tf_detect, [open , high , low , close ])
confirmed = confirm_next_candle ? (hammer_with_vol and rc > ro and nc > rh) : hammer_with_vol
new_candle_5m = ta.change(rc) != 0
hammer_final = confirmed and new_candle_5m
// ===== Plot hammer mark only =====
plotshape(hammer_final, title="Hammer Signal", location=location.belowbar,
style=shape.labelup, text="✅ HAMMER 5m", color=color.new(color.green, 0),
textcolor=color.white, size=size.tiny)
bgcolor(hammer_final ? color.new(color.green, 85) : na)
// ===== Alert =====
alertcondition(hammer_final, title="5m Hammer Confirmed Alert",
message="🔥 {{ticker}} | 5m Confirmed Hammer at {{time}} | Vol OK | Close: {{close}}")
RSI Heatmap (≤35 Highlight)Highlights when RSI is less than or equal to 35 which can signal a potential reversal soon.
Enhanced Roman Order Block v2Enhanced Roman Order Block Indicator v2
This indicator identifies and visualizes Order Blocks (OBs) on your chart, which are key price zones where institutional traders likely placed significant orders, often acting as support/resistance. It's an enhanced version inspired by standard OB detection scripts (like "Crystal Order Block"), but combines and improves upon them with practical features for better trading utility—avoiding a simple mashup by integrating complementary tools that work synergistically.
Originality and Enhancements:
Builds on basic candle-pattern OB detection but adds ATR-based minimum size filtering to ignore noise (e.g., small, insignificant blocks).
Includes optional Higher Timeframe (HTF) confirmation to validate OBs against larger trends, using confirmed data only (no lookahead bias—requests are offset for historical accuracy).
Customizable mitigation (wick or close-based) to detect when an OB is "touched" and potentially invalidated.
Adjustable lookback for pattern flexibility, box extensions, price lines, max displayed OBs (to declutter charts), and alerts for formation/mitigation.
These features merge to create a more reliable, user-configurable tool: e.g., HTF checks + ATR filters reduce false positives, while alerts + lines help in live trading without overwhelming the chart.
How It Works:
Detection Logic: Scans recent candles (default lookback=3) for bullish OBs (e.g., a low that's lower than prior but higher than subsequent swings, indicating accumulation) or bearish OBs (opposite for distribution). Formulas: Bullish = (B_low < A_low) AND (C_low > B_low) AND ((C_low > B_high) OR (D_low > B_high)); similar for bearish.
Filters: OBs must exceed ATR * minOBSizeATR (default 0.5) for validity. If HTF enabled, confirms the OB aligns with HTF lows/highs.
Mitigation: Tracks OBs and shortens boxes/lines when price wicks/closes into the mitigation level (top for bullish, bottom for bearish).
Display: Draws semi-transparent boxes (extendable), optional dashed lines, and labels. Limits to maxOBs, removing oldest.
Alerts: Triggers on new OBs or mitigations for timely notifications.
Underlying concept: OBs stem from Smart Money Concepts (SMC), where big players leave "footprints" in price structure— this script automates detection with risk-aware tweaks.
How to Use:
Add to chart (works on any timeframe/symbol, e.g., crypto like ETHUSD).
Inputs:
Order Block Settings: Toggle bullish/bearish/mitigated visibility; choose mitigation type; set min size/lookback.
Display: Adjust extensions, enable lines, limit max OBs.
Alerts: Enable for OB events.
Multi-Timeframe: Input a higher TF (e.g., "D" for daily) for confirmation—ensures OBs respect bigger-picture levels.
SamRSIIts multiple timeframe RSI indicator
Second RSI indicator can be enabled or disabled up on the necessity
Second RSI indicator has the ability to set to a different timeframe
Perfect for all types of trade (Intraday, Positional, Short term and Long term)
MMM1this framework useful to show R1, R2, R3 and S1 , S2 , S3 and get more flexibility also work in all time fame.
Ben's BTC Macro Fair Value OscillatorBen's BTC Macro Fair Value Oscillator
Overview
The **BTC Macro Fair Value Oscillator** is a non-crypto fair value framework that uses macro asset relationships (equities, dollar, gold) to estimate Bitcoin's "macro-driven fair value" and identify mean-reversion opportunities.
"Is BTC cheap or expensive right now?" on the 4 Hour Timeframe ONLY
### Key Features
✅ **Macro-driven**: Uses QQQ, DXY, XAUUSD instead of on-chain or crypto metrics
✅ **Dynamic weighting**: Assets weighted by rolling correlation strength
✅ **Mean-reversion signals**: Identifies when BTC is cheap/expensive vs macro
✅ **Validated parameters**: Optimized through 5-year backtest (Sharpe 6.7-9.9)
✅ **Visual transparency**: Live correlation panel, fair value bands, statistics
✅ **Non-repainting**: All calculations use confirmed historical data only
### What This Indicator Does
- Builds a **synthetic macro composite** from traditional assets
- Runs a **rolling regression** to predict BTC price from macro
- Calculates **deviation z-score** (how far BTC is from macro fair value)
- Generates **entry signals** when BTC is extremely cheap vs macro (dev < -2)
- Generates **exit signals** when BTC returns to fair value (dev > 0)
### What This Indicator Is NOT
❌ Not a high-frequency trading system (sparse signals by design)
❌ Not optimized for absolute returns (optimized for Sharpe ratio)
❌ Not suitable as standalone trading system (best as overlay/confirmation)
❌ Not predictive of short-term price movements (mean-reversion timeframe: days to weeks)
---
## Core Concept
### The Premise
Bitcoin doesn't trade in a vacuum. It's influenced by:
- **Risk appetite** (equities: QQQ, SPX)
- **Dollar strength** (DXY - inverse to risk assets)
- **Safe haven flows** (Gold: XAUUSD)
When macro conditions are "good for BTC" (risk-on, weak dollar, strong equities), BTC should trade higher. When macro conditions turn against it, BTC should trade lower.
### The Innovation
Instead of looking at BTC in isolation, this indicator:
1. **Measures how strongly** BTC currently correlates with each macro asset
2. **Builds a weighted composite** of those macro returns (the "D" driver)
3. **Regresses BTC price on D** to estimate "macro fair value"
4. **Tracks the deviation** between actual price and fair value
5. **Signals mean reversion** when deviation becomes extreme
### The Edge
The validated edge comes from:
- **Extreme deviations predict future returns** (dev < -2 → +1.67% over 12 bars)
- **Monotonic relationship** (more negative dev → higher forward returns)
- **Works out-of-sample** (test Sharpe +83-87% better than training)
- **Low correlation with buy & hold** (provides diversification value)
---
## Methodology
### Step 1: Macro Composite Driver D(t)
The indicator builds a weighted composite of macro asset returns:
**Process:**
1. Calculate **log returns** for BTC and each macro reference (QQQ, DXY, XAUUSD)
2. Compute **rolling correlation** between BTC and each reference over `corrLen` bars
3. **Weight each asset** by `|correlation|` if above `minCorrAbs` threshold, else 0
4. **Sign-adjust** weights (+1 for positive corr, -1 for negative) to handle inverse relationships
5. **Z-score normalize** each reference's returns over `fvWindow`
6. **Composite D(t)** = weighted sum of sign-adjusted z-scores
**Formula:**
```
For each reference i:
corr_i = correlation(BTC_returns, ref_i_returns, corrLen)
weight_i = |corr_i| if |corr_i| >= minCorrAbs else 0
sign_i = +1 if corr_i >= 0 else -1
z_i = (ref_i_returns - mean) / std
contrib_i = sign_i * z_i * weight_i
D(t) = sum(contrib_i) / sum(weight_i)
```
**Key Insight:** D(t) represents "how good macro conditions are for BTC right now" in a normalized, correlation-weighted way.
---
### Step 2: Fair Value Regression
Uses rolling linear regression to predict BTC price from D(t):
**Model:**
```
BTC_price(t) = α + β * D(t)
```
**Calculation (Pine Script approach):**
```
corr_CD = correlation(BTC_price, D, fvWindow)
sd_price = stdev(BTC_price, fvWindow)
sd_D = stdev(D, fvWindow)
cov = corr_CD * sd_price * sd_D
var_D = variance(D, fvWindow)
β = cov / var_D
α = mean(BTC_price) - β * mean(D)
fair_value(t) = α + β * D(t)
```
**Result:** A time-varying "macro fair value" line that adapts as correlations change.
---
### Step 3: Deviation Oscillator
Measures how far BTC price has deviated from fair value:
**Calculation:**
```
residual(t) = BTC_price(t) - fair_value(t)
residual_std = stdev(residual, normWindow)
deviation(t) = residual(t) / residual_std
```
**Interpretation:**
- `dev = 0` → BTC at fair value
- `dev = -2` → BTC is 2 standard deviations **cheap** vs macro
- `dev = +2` → BTC is 2 standard deviations **rich** vs macro
---
### Step 4: Signal Generation
**Long Entry:** `dev` crosses below `-2.0` (BTC extremely cheap vs macro)
**Long Exit:** `dev` crosses above `0.0` (BTC returns to fair value)
**No shorting** in default config (risk management choice - crypto volatility)
---
## How It Works
### Visual Components
#### 1. Price Chart (Main Panel)
**Fair Value Line (Orange):**
- The estimated "macro-driven fair value" for BTC
- Calculated from rolling regression on macro composite
**Fair Value Bands:**
- **±1σ** (light): 68% confidence zone
- **±2σ** (medium): 95% confidence zone
- **±3σ** (dark, dots): 99.7% confidence zone
**Entry/Exit Markers:**
- **Green "LONG" label** below bar: Entry signal (dev < -2)
- **Red "EXIT" label** above bar: Exit signal (dev > 0)
#### 2. Deviation Oscillator (Separate Pane)
**Line plot:**
- Shows current deviation z-score
- **Green** when dev < -2 (cheap)
- **Red** when dev > +2 (rich)
- **Gray** when neutral
**Histogram:**
- Visual representation of deviation magnitude
- Green bars = negative deviation (cheap)
- Red bars = positive deviation (rich)
**Threshold lines:**
- **Green dashed at -2.0**: Entry threshold
- **Red dashed at 0.0**: Exit threshold
- **Gray solid at 0**: Fair value line
#### 3. Correlation Panel (Top-Right)
Shows live correlation and weighting for each macro asset:
| Asset | Corr | Weight |
|-------|------|--------|
| QQQ | +0.45 | 0.45 |
| DXY | -0.32 | 0.32 |
| XAUUSD | +0.15 | 0.00 |
| Avg \|Corr\| | 0.31 | 0.77 |
**Reading:**
- **Corr**: Current rolling correlation with BTC (-1 to +1)
- **Weight**: How much this asset contributes to fair value (0 = excluded)
- **Avg |Corr|**: Average correlation strength (should be > 0.2 for reliable signals)
**Colors:**
- Green/Red corr = positive/negative correlation
- White weight = asset included, Gray = excluded (below minCorrAbs)
#### 4. Statistics Label (Bottom-Right)
```
━━━ BTC Macro FV ━━━
Dev: -2.34
Price: $103,192
FV: $110,500
Status: CHEAP ⬇
β: 103.52
```
**Fields:**
- **Dev**: Current deviation z-score
- **Price**: Current BTC close price
- **FV**: Current macro fair value estimate
- **Status**: CHEAP (< -2), RICH (> +2), or FAIR
- **β**: Current regression beta (sensitivity to macro)
---
## Installation & Setup
### TradingView Setup
1. Open TradingView and navigate to any **BTC chart** (BTCUSD, BTCUSDT, etc.)
2. Open **Pine Editor** (bottom panel)
3. Click **"+ New"** → **"Blank indicator"**
4. **Delete** all default code
5. **Copy** the entire Pine Script from `GHPT_optimized.pine`
6. **Paste** into the editor
7. Click **"Save"** and name it "BTC Macro Fair Value Oscillator"
8. Click **"Add to Chart"**
### Recommended Chart Settings
**Timeframe:** 4h (validated timeframe)
**Chart Type:** Candlestick or Heikin Ashi
**Overlay:** Yes (indicator plots on price chart + separate pane)
**Alternative Timeframes:**
- Daily: Works but slower signals
- 1h-2h: May work but not validated
- < 1h: Not recommended (too noisy)
### Symbol Requirements
**Primary:** BTC/USD or BTC/USDT on any exchange
**Macro References:** Automatically fetched
- QQQ (Nasdaq 100 ETF)
- DXY (US Dollar Index)
- XAUUSD (Gold spot)
**Data Requirements:**
- At least **90 bars** of history (warmup period)
- Premium TradingView recommended for full historical data
---
## Reading the Indicator
### Identifying Signals
#### Strong Long Signal (High Conviction)
- ✅ Deviation < -2.0 (extreme undervaluation)
- ✅ Avg |Corr| > 0.3 (strong macro relationships)
- ✅ Price touching or below -2σ band
- ✅ "LONG" label appears below bar
**Interpretation:** BTC is extremely cheap relative to macro conditions. Historical data shows +1.67% average return over next 12 bars (48 hours at 4h timeframe).
#### Moderate Long Signal (Lower Conviction)
- ⚠️ Deviation between -1.5 and -2.0
- ⚠️ Avg |Corr| between 0.2-0.3
- ⚠️ Price approaching -2σ band
**Interpretation:** BTC is cheap but not extreme. Consider as confirmation for other signals.
#### Exit Signal
- 🔴 Deviation crosses above 0 (returns to fair value)
- 🔴 "EXIT" label appears above bar
**Interpretation:** Mean reversion complete. Close long positions.
#### Strong Short/Avoid Signal
- 🔴 Deviation > +2.0 (extreme overvaluation)
- 🔴 Avg |Corr| > 0.3
- 🔴 Price touching or above +2σ band
**Interpretation:** BTC is expensive vs macro. Historical data shows -1.79% average return over next 12 bars. Consider exiting longs or reducing exposure.
### Regime Detection
**Strong Regime (Reliable Signals):**
- Avg |Corr| > 0.3
- Multiple assets weighted > 0
- Fair value line tracking price reasonably well
**Weak Regime (Unreliable Signals):**
- Avg |Corr| < 0.2
- Most weights = 0 (grayed out)
- Fair value line diverging wildly from price
- **Action:** Ignore signals until correlations strengthen
Log Regression Channel (Dezza)This custom indicator builds a curved Logarithmic Regression Channel designed for long-term Bitcoin and macro asset analysis. It performs a linear regression on the logarithm of price to estimate the market’s fair-value growth curve, then converts that back into price space to form upper and lower deviation bands.
It helps identify where price sits relative to its long-term exponential trend — showing potential overvaluation (upper band) or undervaluation (lower band) zones.
Best used on weekly or monthly charts to visualise market cycles and fair-value reversion. Adjustable inputs let you control lookback length, band width, and midline visibility.
Delta ROC (acceleration) + GuideStan Druckenmiller often stresses that markets are driven not by absolute numbers but by their rate of change. He says the key is to “focus on the central banks and the movement of liquidity,” and notes that “because it used second-derivative rate of change, these things will often bottom a year to a year and a half before the fundamentals.” In essence, he looks for inflection points—moments when momentum itself begins to turn—well before the data or headlines confirm it.
The ΔROC (Delta Rate of Change) indicator applies that same philosophy. It measures both the first derivative of price (ROC: speed or momentum) and the second derivative (ΔROC: acceleration or deceleration of that momentum). Green bars signal that momentum is accelerating—buyers gaining control—while red bars show slowing momentum or exhaustion. Combine this with trend filters like the 30- and 50-day moving averages to spot early shifts in sentiment and liquidity—the kind of turning points Druckenmiller calls the “second-derivative moments” that often lead the real economy by months.
Multi MA Extended OverlayIntroducing "Multi MA Extended Overlay," a powerful and versatile Pine Script indicator designed for traders who want to analyze multiple moving averages simultaneously on their price charts. This indicator allows you to enable or disable a variety of moving average types, each customizable by length and data source, providing comprehensive insight into market trends and momentum.
Key Features:
Support for classic moving averages such as EMA, SMA, and WMA
Advanced moving averages including HMA (Hull Moving Average), EHLMA (Exponential Hull Moving Average), VMA (Volume Moving Average), TRIMA (Triangular Moving Average), and KAMA (Kaufman Adaptive Moving Average)
Dynamic calculation of KAMA smoothing constants based on market volatility using ATR (Average True Range)
User-friendly toggle inputs with informative tooltips for each moving average type
Three configurable lengths per moving average type for detailed comparison on a single chart
Modular structure leveraging a dedicated library for efficient maintenance and extensibility
This indicator is perfect for traders and analysts seeking to enhance technical analysis with multiple moving average perspectives, enabling better decision-making and strategy development.
#tradingview #pineScript #movingaverages #technicalanalysis #KAMA #HMA #EMA #SMA #tradingtools #algorithmictrading






















