Auto Fib Golden Pocket Band - Strategy with Buy Signals
Oct 19, 2021

The Auto Fib Golden Pocket Band strategy tool automates the identification of Fibonacci retracement levels and integrates a fully functional backtesting engine with dynamic risk management. This script aims to simplify trend analysis by plotting Fibonacci-based moving averages across multiple time horizons to identify high-probability entry points.
Usage
The Usage section describes how the script can be used, focusing on the identification of trend exhaustion and potential reversals. The strategy utilizes three distinct trend horizons—Strong, Regular, and Sideways—to provide a comprehensive view of market structure.
Users can employ this script to:
- Identify Reversal Zones: By monitoring when price interacts with the "Golden Pocket" EMA bands, traders can spot areas where a trend might find support or resistance.
- Filter Entries: The strategy includes built-in signal filters to refine entries based on trend strength and Fibonacci alignment.
- Automate Risk Management: The tool calculates dynamic stop losses based on recent swing highs or lows, ensuring risk is adjusted according to market volatility.
For example, a bullish signal is typically generated when the price touches or crosses a bullish Fibonacci band while specific trend conditions are met. The backtester will then simulate an entry and manage the position using the predefined take-profit and stop-loss parameters.
Details
The strategy execution is based on the interaction between price action and exponential moving averages (EMAs) derived from Fibonacci retracement levels. Unlike static Fibonacci tools, these "Autofib Moving Averages" adjust dynamically as new pivot highs and lows are established within the specified lookback periods.
The script calculates three tiers of bands:
- Strong Trend Levels: Focused on short-term pivots (default 400 bars) to capture rapid price movements.
- Regular Trend Levels: Uses a medium-term lookback (default 900 bars) for standard trend following.
- Sideways Trend Levels: Employs a long-term lookback (default 4000 bars) to identify major structural levels during consolidation phases.
The script determines the current trend state by analyzing the slope of these Fibonacci EMAs. When the EMAs are rising, bullish bands are prioritized; when falling, bearish bands take precedence.
Settings
Strong Trend Levels
- Enable Upper Bullish / Lower Bearish Band: Toggles the visibility and calculation of the short-term Fibonacci bands.
- Fib Level: Selects the specific Fibonacci ratio (e.g., 0.236, 0.618) used for band calculation.
- Pivot Look Back: Sets the number of bars used to find the highest high and lowest low for the Fibonacci calculation.
- Fib EMA Length: Determines the smoothing period for the resulting Fibonacci price line.
Regular & Sideways Trend Levels
- These groups contain identical settings to the Strong Trend Levels (Enable, Fib Level, Lookback, EMA Length) but are intended for medium and long-term trend analysis respectively.
Stop Loss Settings
- Enable Stop Loss: Activates the exit logic for losing trades.
- SL Type: Choose between "low/high as SL" (dynamic based on price action) or "static % as SL".
- Offset: Defines the distance from the swing point in either percentage or dollar value.
- SL Lookback: The number of bars used to determine the recent high or low for the dynamic stop loss.
Take Profit & Alerts
- Long/Short Take Profit: Sets the percentage-based target for closing winning positions.
- Alert Options: Configures the frequency of notifications (once per bar, once per bar close, or every tick).
- Alert Message: Customizable text for webhook or app notifications, with optional dynamic stop-loss value inclusion.
FAQ
How do I adjust the strategy for different assets? You should modify the "Pivot Look Back" and "Fib EMA Length" in the settings to match the volatility and timeframe of the specific asset you are trading.
Can I use this for both Long and Short trades? Yes, the strategy is designed to handle both bullish and bearish market conditions by utilizing separate Fibonacci bands and entry logic for each direction.
How can I access the Auto Fib Golden Pocket Band? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.