OPEN-SOURCE SCRIPT
Zaktualizowano

OBV Linear Regression Multi-Slope [HYPR-run]

708
DESCRIPTION:
Three linear regression slopes fitted to On-Balance Volume. Measures whether accumulation or distribution is accelerating, decelerating, or reversing across short, medium, and long lookbacks simultaneously. Raw OBV tells you the cumulative direction of volume flow. Fitting a linear regression to it gives you the rate of change: the slope. Three slopes at different lookbacks show the structure of volume commitment. When all three agree, volume flow is structurally committed in one direction. When they disagree, the timeframes are in conflict.

DISCOVERING EDGE
Dual and triple slope alignment has proven to be a staple confirmation signal in our most reliable automated strategies for both entries and exits. When two or three independent lookbacks agree on the direction of volume flow, the commitment is structural, not noise. When alignment breaks, the first slope to flip tells you exactly where conviction cracked. We built this indicator to surface that alignment as a first-class signal rather than something you eyeball across separate panes.

THREE LR SLOPES vs RAW OBV LINE
Three slopes at different lookbacks show whether all timeframes of volume flow agree or conflict. Dual alignment (short + long) is the entry signal; triple (all three) confirms later for pyramids. When triple breaks, that's the exit. Values above 0.3 mean the slope is steeper than one standard deviation per bar (very strong trend). Sigma/bar above 0.1 means the slope is statistically strong; below 0.05 is weak.

FEATURES
- Three linear regression slope lines on OBV (short 9, medium 26, long 50)
- Optional adaptive short lookback (ATR-scaled for low timeframes)
- Slope alignment detection: dual (short+long) and triple (all three)
- Universal angle normalization (slope/sigma x 45 degrees)
- Sigma/Bar ratio: slope strength relative to OBV noise
- Auto-adjusts all lookbacks by timeframe (weekly/monthly compress)
- Webhook alerts on slope flip or triple alignment
- Full bar filter rejects doji/wick-heavy bars
- Dashboard with lookback, angle, and sigma/bar for all three lines

HOW IT WORKS
Linear regression calculates the best-fit line through OBV values over a lookback window. The slope of that line is the rate of volume flow. Positive slope = accumulation accelerating. Negative slope = distribution accelerating. The universal angle normalizes raw slope by OBV standard deviation so the dashboard reads consistently across any asset (BTC's OBV in millions, a low-cap's in thousands, same angle scale).

UNIVERSAL ANGLE
Slope divided by OBV standard deviation per bar, multiplied by 45. A value of 45 degrees means the slope equals one standard deviation per bar. Makes angle comparable across any asset and timeframe: 30 degrees on BTC means the same relative strength as 30 degrees on SOL.

ALERT MODES
Slope Flip: fires when selected lookback crosses zero. Negative to positive = accumulation starting (LONG). Positive to negative = distribution starting (SHORT). Triple Alignment: fires when all three slopes agree on direction. Fewer signals, higher conviction. Alert payload is built into the script as JSON; works with any webhook receiver.

CREDITS
On-Balance Volume: Joseph Granville, Granville's New Key to Stock Market Profits (1963)
Informacje o Wersji
HOW TO USE
Add to chart below your price pane. Watch for slope alignment: when all three lines point the same direction, volume flow is structurally committed. Dual alignment (short + long agreeing) and triple alignment (all three agreeing) are the key states. When alignment breaks, the first slope to flip identifies where conviction cracked. Check sigma/bar in the dashboard; above 1.0 is statistically strong, below 0.5 is noise. The universal angle normalizes across assets so the dashboard reads the same whether you're on BTC or a low-cap.

ALERTS
Five alert modes from fastest to most selective. Slope Flip (Short/Medium/Long): fires when the selected lookback crosses zero. Note: slope flip does not require the full bar filter. Dual Alignment: fires when short + long slopes flip to the same direction; requires full bar (body >= 66.6% of range). Triple Alignment: fires when all three slopes flip to the same direction; requires full bar. Fewer signals, highest conviction. Toggle Alert Long and Alert Short independently.

For notifications without webhooks, create a TradingView alert with condition = this indicator, "Any alert() function call", and select push notification, email, or popup.

For webhook execution, paste your endpoint URL in the alert's Webhook URL field, set Open-ended, create. Long sends {"market":"PERPS","ticker":"...","position":"LONG",...}. Short sends the same with "position":"SHORT".

THREE LOOKBACKS
Short (default 9): fast-moving slope, first to react. Solid line. Auto-adjusts: 9 on daily, 7 on weekly, 5 on monthly. Medium (default 26): intermediate context. Dotted line, darker green/red. Auto-adjusts: 14 on weekly, 7 on monthly. Long (default 50): structural trend. Solid line. Auto-adjusts: 26 on weekly, 14 on monthly.

ADAPTIVE LOOKBACK
For low timeframes (1m through 4hr). When enabled, the short line's lookback adjusts dynamically by ATR volatility. High ATR = longer lookback (smoother). Low ATR = shorter lookback (more responsive). Range clamped between the short lookback (floor) and 50 (ceiling). On higher timeframes (daily+), static lookbacks are usually sufficient.

DASHBOARD
Three rows: short, medium, long. Each shows: lookback (effective period, adaptive or static), angle (universal angle in degrees), sigma/bar (slope-to-volatility ratio). Dark/light theme toggle.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.