OPEN-SOURCE SCRIPT

AetherEdge - APEX Swing Engine

5 919
🖊️ Overview

APEX is a swing-reversal engine that captures market tops (swing highs) and bottoms (swing lows), routing BUY and SELL into a strictly alternating sequence. At its core sits confirmed-pivot detection, so once a signal is printed it never moves — the indicator is fully non-repainting. Where many "perfect top-and-bottom" tools are illusions drawn by peeking at future data, APEX accepts an honest confirmation lag in exchange for signals that hold meaning in real time. A state machine structurally guarantees alternation, while an oscillator consensus gate filters out trivial swings.

🔶 Key Features

Strict alternation: a state machine enforces the BUY→SELL→BUY order, eliminating one-sided signal clustering
Fully non-repainting: only confirmed pivots (ta.pivothigh/low) are used; printed markers never shift
Transparent confirmation lag: the HUD shows how many bars after the true extreme the pivot confirmed
RSI consensus gate: accepts a top/bottom only when the oscillator was overbought/oversold at pivot formation, removing noise swings
Minimum-move filter: requires an ATR-based price displacement from the last signal to suppress over-dense output
Zig-zag visualization: glowing lines connect confirmed extremes, making the alternating capture structure instantly readable
Top/bottom zone shading: a translucent band around each extreme visualizes the high/low region
Live tracking rays: horizontal lines extend from the latest top and bottom as dynamic support/resistance
Refined data-science palettes: Quant Lab, Sumi Ink, and Aurora
Integrated HUD: current state, last top/bottom prices, RSI, confirmation lag, and the next permitted signal type

🧠 Technical Architecture

The source of APEX's honesty is confirmed-pivot detection. ta.pivothigh/ta.pivotlow resolve a value only after a set number of bars (pv_rightInput) have elapsed to the right of the pivot candidate. By the time confirmation occurs, the extreme is already a past bar, so its position can never change afterward — the essence of "a few bars of lag, but never repainting." The resulting delay, the honest price of refusing to peek at the future, is displayed explicitly in the HUD.
Alternation is enforced by a state machine. Its internal state holds +1 when the last signal was a bottom (BUY), −1 when it was a top (SELL), and 0 before any signal. Because this state locks which signal type is next permitted, same-type signals are structurally rejected and output necessarily alternates between BUY and SELL. In the rare case where a top and a bottom confirm on the same bar, an arbitration rule favors whichever carries the stronger oscillator extreme.
The consensus gate promotes a confirmed pivot into a top/bottom candidate. A pivot high qualifies as a top (SELL) candidate only if RSI exceeded the overbought threshold when it formed; a pivot low qualifies as a bottom (BUY) candidate only if RSI was below the oversold threshold. This leaves only "meaningful" swings accompanied by oscillator extremes rather than every minor wiggle. An ATR-based minimum-move filter further demands sufficient travel from the prior signal to prevent crowding. In the visual layer, accepted extremes are linked by a zig-zag line, each extreme receives a zone box, and rays extending from the latest top and bottom present dynamic battle lines.

⚙️ Recommended Settings & Tuning Guide

APEX is tuned with crypto in mind. For intraday trading on majors like BTC and ETH, Pivot Left/Right Bars near 8 is a balanced starting point between sensitivity and lag. On higher-volatility names such as SOL and XRP, widening Bars to 10–12 and tightening the RSI gate (overbought 65 / oversold 35) suppresses fakeout swings and stabilizes top/bottom precision.
Pivot Bars is the master sensitivity parameter. Larger values admit only larger, more significant swings and increase lag; smaller values are more responsive with less lag but more fakeouts. For swing trading (days-to-weeks holds), 15–20 is a guide; for short-term trading, 6–8. If signals are too frequent, tighten the RSI gate (overbought 70 / oversold 30) and set the minimum-move filter to 1–2 ATR to reduce density. If signals are too sparse, ease the RSI gate (overbought 55 / oversold 45) or disable it, driving alternation purely from pivot structure.

💡 How to Use in Practice

The most fundamental use is to read confirmed BUY/SELL markers as an objective fact that a swing pivot has formed. Because markers arrive with lag, treat them with care as direct counter-trend triggers; instead, the tracking rays extending from the latest top and bottom serve as powerful support/resistance for subsequent price action. Moments where price approaches and rejects these rays are strong entry-consideration points while awaiting the next alternating signal.
For multi-timeframe trading, pair APEX on a higher timeframe to grasp the major swing structure with APEX on a lower timeframe for finer timing. Since the zig-zag line maps directly to wave structure, overlaying it with Elliott Wave or Fibonacci retracements adds context to top/bottom placement. The HUD's "next permitted signal" makes clear which reversal to await, serving as a guide for position management.

⚠️ Important Notes

Because this indicator is based on confirmed pivots, signals always arrive in real time delayed by the confirmation lag. Historical charts appear to capture tops and bottoms perfectly, but that is because they are already confirmed — no marker appears on a not-yet-confirmed extreme near the latest bar. This is not a flaw but a necessary property of an honest, non-repainting design. Expecting instant reaction on the current bar without understanding this lag leads to misuse. Setting pivot width extremely small reduces lag but lowers confirmation reliability and increases fakeouts.

🚨 Disclaimer

This indicator is provided for educational and informational purposes only and does not constitute financial or investment advice. No signal guarantees future profit, and past performance does not indicate future results. All trading decisions are made at your own risk; please use this tool with sound risk management and your own independent verification.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。