OPEN-SOURCE SCRIPT

Fibonacci Spectrum + Regression Channel + Confirmations

144
A versatile multi-strategy tool for technical traders using Fibonacci levels, regression channels, and dynamic confirmations.
๐Ÿ“˜ Overview
This TradingView strategy script helps traders detect high-probability breakouts, reversals, and trend continuations using:

๐Ÿ”ข Fibonacci retracement zones

๐Ÿ“‰ Regression channels (local & multi-timeframe)

โœ… Multiple confirmations (Volume, RSI, MACD, Candlestick)

๐Ÿ”„ Preset strategy modes (Trend-follow, Mean-reversion, Breakout, Custom)

๐Ÿ“Š Visual dashboard for real-time analysis

๐Ÿ”” Alerts for breakout and breakdown signals

๐Ÿ› ๏ธ Inputs & Configuration
๐ŸŽ›๏ธ Preset Modes
Choose from 4 trading modes:

Custom โ€” manually enable/disable confirmations

Trend-follow โ€” emphasizes RSI & MACD alignment

Mean-reversion โ€” tight channels, ignores volume

Breakout โ€” aggressive setup, tighter fib lookback & wider bands

๐Ÿ”ง Changing preset automatically adjusts parameters like regression length, fib lookback, and confirmation rules.

๐Ÿ”ข Fibonacci Settings
Fib Lookback: Number of bars to calculate the high/low range.

Fib Ratios A-E: Defines retracement levels (0.236 to 0.786 by default).

Zones are shaded for clarity:

๐ŸŸง 0.236โ€“0.382

๐ŸŸจ 0.382โ€“0.5

๐ŸŸฉ 0.5โ€“0.618

๐ŸŸฆ 0.618โ€“0.786

๐Ÿ“‰ Regression Channel
Reg Channel Length: Period used for linear regression.

StdDev Multiplier: Defines channel width.

Multi-Timeframe Support: Choose a higher timeframe (like 1h) to overlay broader trends.

โœ… Confirmations (toggle ON/OFF or preset controlled)
Volume: Must be above its 20-bar average.

RSI: Must be above 50 and rising (or below 50 and falling for shorts).

MACD: Line must cross above Signal (bull) or below (bear).

Candlestick Pattern: Looks for Bullish or Bearish Engulfing candles.

๐Ÿ“… Backtest Settings
Enable/disable strategy entries and exits for simulation.

Entries:

Long when price breaks above Fib 0.618 with all confirmations met

Short when price breaks below Fib 0.382 with all bearish confirmations

Exits:

Long exits when price breaks below Fib 0.382

Short exits when price breaks above Fib 0.618

๐Ÿ” How to Use the Strategy
๐Ÿ”น Step 1: Choose a Preset
Pick one of the four Preset Modes:

Want to follow a trend? Select Trend-follow

Expect a price bounce? Try Mean-reversion

Expect volatility? Use Breakout

Prefer full control? Use Custom

๐Ÿ”น Step 2: Enable Confirmations (if in Custom mode)
Activate/deactivate:

Volume

RSI

MACD

Candlestick Patterns

These filters increase signal quality.

๐Ÿ”น Step 3: Watch for Signals
Look for:

๐Ÿ’  "READY" labels (potential breakout or breakdown)

Color-coded Fibonacci zones and channel bounds

๐Ÿ“ˆ Entry/Exit signals (when backtesting is enabled)

๐Ÿ”น Step 4: Use the Dashboard
Located in the top-right, the table shows:

Indicator values

Trend direction (Up/Down)

Status (Bull/Bear, High/Low, Above/Below)

Closest Fibonacci level and candlestick patterns

Colors:

๐ŸŸข Green = Bullish or Positive

๐Ÿ”ด Red = Bearish or Negative

๐ŸŸก Yellow = Close to a key Fib level

๐Ÿ”” Alerts (Included)
You can set alerts on the following conditions:

Pre-Breakout โ€” all bullish confirmations + Fib 0.618 cross

Pre-Breakdown โ€” all bearish confirmations + Fib 0.382 break

Position Opened โ€” any strategy entry (for backtest tracking)

To activate:

Right-click the chart โ†’ Add Alert

Select this strategy and the condition (e.g., โ€œPre-Breakout Signalโ€)

๐Ÿ“Š Example Use Cases
๐ŸŸข Breakout Trader
Set to Breakout

Watch for โ€œREADYโ€ label above Fib 0.618

Confirm with strong volume & bullish MACD

Alert triggers โ†’ enter trade

๐Ÿ”ด Mean Reversion Trader
Set to Mean-reversion

Price hits lower channel + Fib 0.382

Weak volume, but RSI rebounds โ†’ consider long

โš–๏ธ Trend Follower
Set to Trend-follow

RSI, MACD, and price all moving up above midline

Enter on Fib 0.618 bounce

๐Ÿงช Tips & Notes
Combine with multi-timeframe analysis by enabling the MTF Channel

Tweak Fib ratios if you're using alternative levels (e.g., 0.886)

Use strategy.percent_of_equity for dynamic position sizing in backtests

Set proper timeframes (e.g., 15m, 1h) based on your trading style

Not financial advice at all. Strategy still WIP, i mainly think the indicator is ready.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.