OPEN-SOURCE SCRIPT
Telah dikemas kini

Al Brooks Second Entry

275
**\Al Brooks Second Entry Indicator\**

This custom indicator helps identify second-entry setups based on Al Brooks' price action principles. The script marks key levels in trending markets, indicating potential long and short entries. It displays the first and second entry signals (H1, H2, L1, L2) as well as relevant pullback zones for added clarity.

\Features:\
\

  • \
  • \First Entry Signals\: H1 (Long) and L1 (Short) are marked when a trend begins to form.
    \
  • \Second Entry Signals\: H2 (Long) and L2 (Short) are plotted once the market pulls back and continues in the direction of the trend.
    \
  • \EMA Filter\: An Exponential Moving Average (EMA) is included to filter trades in the direction of the trend (longs above EMA, shorts below EMA).
    \
  • \Pullback Zones\: Highlighted areas to assist in identifying optimal zones for entry.
    \[\*]\Adjustable Label Sizes\: Customize the appearance of the entry labels (tiny or small).
    \


\Inputs:\
\

  • \
  • \Show First/Second Entry\: Control whether the first (H1, L1) and second (H2, L2) entry signals are displayed.
    \
  • \EMA Length\: Set the length of the EMA to use for trend direction.
    \
  • \Label Size\: Choose between tiny and small label sizes for clear chart visibility.
    \
  • \Pullback Zones\: Toggle the highlighting of pullback zones.
    \


\How it Works:\
\

  • \
  • The indicator detects a trend direction using price action (new highs/lows, inside/outside bars).
    \
  • Once a trend is identified, it waits for a pullback and marks the first and second entry points (H1, H2, L1, L2).
    \
  • The indicator also plots the EMA to help confirm the overall market bias.
    \
  • Pullback zones are drawn to help spot potential areas of support or resistance.
    \


This script is ideal for traders looking to trade retracements in trending markets, providing clear entry signals and a visual representation of market structure.

Nota Keluaran
Al Brooks Second Entry Indicator

This custom indicator helps identify second-entry setups based on Al Brooks' price action principles. The script marks key levels in trending markets, indicating potential long and short entries. It displays the first and second entry signals (H1, H2, L1, L2) as well as relevant pullback zones for added clarity.

Features:
  • First Entry Signals: H1 (Long) and L1 (Short) are marked when a trend begins to form.
  • Second Entry Signals: H2 (Long) and L2 (Short) are plotted once the market pulls back and continues in the direction of the trend.
  • EMA Filter: An Exponential Moving Average (EMA) is included to filter trades in the direction of the trend (longs above EMA, shorts below EMA).
  • Pullback Zones: Highlighted areas to assist in identifying optimal zones for entry.
    [\*]Adjustable Label Sizes: Customize the appearance of the entry labels (tiny or small).


Inputs:
  • Show First/Second Entry: Control whether the first (H1, L1) and second (H2, L2) entry signals are displayed.
  • EMA Length: Set the length of the EMA to use for trend direction.
  • Label Size: Choose between tiny and small label sizes for clear chart visibility.
  • Pullback Zones: Toggle the highlighting of pullback zones.


How it Works:
  • The indicator detects a trend direction using price action (new highs/lows, inside/outside bars).
  • Once a trend is identified, it waits for a pullback and marks the first and second entry points (H1, H2, L1, L2).
  • The indicator also plots the EMA to help confirm the overall market bias.
  • Pullback zones are drawn to help spot potential areas of support or resistance.


This script is ideal for traders looking to trade retracements in trending markets, providing clear entry signals and a visual representation of market structure.
Nota Keluaran
🔄 What's New in This Update

  1. Improved Swing Detection & Trend Logic
  2. Replaced simple bar-by-bar comparisons with structured swing high/low detection.
  3. Added optional swing markers for clearer visual confirmation.

  1. Smarter Leg Tracking
  2. Added `waitForLegCompletion` logic to ensure accurate identification of pullback legs.
  3. Improved handling of trend transitions and bias resets, reducing false H1/H2 or L1/L2 signals.

  1. Cleaner Pullback Zone Management
  2. Pullback zones are now created, updated, and removed more reliably in response to trend legs.
  3. Resets zones correctly when trend direction or bias changes.

  1. Debugging Support
  2. Added optional `debugMode` input to display real-time leg count and bias state for easier troubleshooting.

  1. Visual Enhancements
  2. Optional swing high/low markers (`triangleup` / `triangledown`) for extra clarity.
  3. Label conditions refactored for better consistency across different market scenarios.
Nota Keluaran
Added notes in the code comment.
Nota Keluaran
Update: 🔔 Alerting & Usability Enhancements
  • Added descriptive titles to plotted signals (H1, H2, L1, L2, Swing High/Low)
  • Alerts are now available for all major entries and swing confirmations

Nota Keluaran
🔄 Major Improvements
🐛 Bug Fixes

  • Fixed incorrect H2 signals: Resolved the issue where the indicator would incorrectly show an H2 signal after a new swing high was detected, instead of correctly showing H1. This ensures proper pattern sequencing in all market conditions.
  • Fixed pullback box rendering in bear markets: Corrected coordinates for pullback zones in bear trends to display properly.


🧠 Enhanced Pattern Detection

  • Improved trend high/low tracking: Added dedicated flags to properly track when new highs/lows are made, ensuring accurate pattern reset.
  • More reliable pattern sequencing: The indicator now correctly resets after new swing highs/lows, maintaining the proper H1→H2 and L1→L2 progression.


🧪 Expanded Debug Information

  • Added detailed state tracking: Debug mode now shows additional information including leg direction and new high/low detection status.
  • Better troubleshooting: Enhanced visualization makes it easier to understand the indicator's internal state.


📋 Technical Changes

  • Added new state variables to track high/low detection events
  • Refactored condition logic for more precise pattern identification
  • Separated price level detection from pattern state management
  • Improved visual feedback for pattern formation phases


📊 Usage Tips

  • Enable debug mode to see detailed information about pattern formation
  • Watch how the indicator resets after new trend highs/lows are made

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.