AetherEdge - APEX Swing Engine
May 24, 2026

The AetherEdge - APEX Swing Engine indicator identifies market tops and bottoms using a non-repainting state machine to provide strictly alternating BUY and SELL signals for swing trading. By utilizing confirmed pivot detection, the tool ensures that once a signal is printed, its position remains fixed, offering a reliable framework for analyzing price reversals without the illusions of "future-peeking" scripts.
Usage
The Usage section describes how the script can be used to identify trend exhaustion and potential entry points. The script is designed to capture swing highs and lows and organize them into an actionable sequence.
- Alternating Signals: The engine enforces a BUY→SELL→BUY sequence. This prevents signal clustering during strong trends and ensures traders focus on the next logical reversal point.
- Support and Resistance: While signals arrive with a slight lag (equal to the "Right Bars" setting), the horizontal tracking rays extending from the latest top and bottom serve as dynamic support and resistance levels. Price rejection at these rays often precedes the next confirmed signal.
- Oscillator Filtering: Users can enable the RSI consensus gate to ensure signals only trigger when the market is in an overbought or oversold state. This filters out minor price fluctuations and focuses on significant swings.
- Visualizing Structure: The optional zig-zag lines and zone shading provide a clear view of the current market structure, helping users identify Elliott Wave patterns or Fibonacci retracement zones.
Details
The script's technical integrity is based on ta.pivothigh and ta.pivotlow functions. A pivot is only confirmed after a specified number of bars have passed to the right of the extreme. This inherent "confirmation lag" is the mechanism that prevents repainting; the indicator waits for mathematical confirmation before placing a marker.
A state machine governs the logic, holding internal values to track whether the last event was a top or bottom. If a top and bottom are detected simultaneously, an arbitration rule selects the one with the more extreme RSI value. Furthermore, an ATR-based minimum-move filter can be applied, requiring the price to travel a specific distance before the next alternating signal is permitted, which reduces noise in sideways markets.
Settings
Pivot Detection
- Pivot Left Bars: The number of bars to the left required to detect a peak or trough.
- Pivot Right Bars (confirmation lag): The number of bars to the right required to confirm the pivot. This determines the signal delay.
- Top/Bottom Source: The price source used for detection (default is High/Low).
Confluence Gate
- Require Oscillator Extreme: When enabled, pivots are only accepted if the RSI is beyond the OB/OS thresholds.
- RSI Length: The lookback period for the RSI calculation.
- Overbought/Oversold: Thresholds that the RSI must cross at the time of the pivot to validate a signal.
- Min Move Since Last Signal (ATR): The minimum price distance (in ATR units) required between consecutive signals.
Visuals & HUD
- Draw Zig-Zag: Connects confirmed extremes with alternating colored lines.
- Shade Top/Bottom Zones: Creates translucent boxes around confirmed pivot areas.
- Track Last Extreme Lines: Extends horizontal rays from the most recent confirmed highs and lows.
- Show HUD: Toggles the on-screen display showing current state, lag, and RSI values.
FAQ
Why do the signals appear a few bars behind the actual peak or trough? This is a non-repainting script. It requires a specific number of bars (defined by the "Right Bars" setting) to pass to confirm that a high or low was actually a pivot. This prevents signals from disappearing or moving after they have appeared.
How do I reduce the signal frequency? To reduce signals, you can increase the Pivot Bars settings, tighten the RSI Overbought/Oversold thresholds, or increase the "Min Move (ATR)" filter to require larger price displacements between signals.
How can I access this script? 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.