OPEN-SOURCE SCRIPT
AetherEdge - Smart Money Flow

🖊️ Overview
AE-SMF focuses on what smart-money price action is really about — liquidity. It maps the stop pools resting above swing highs (buyside) and below swing lows (sellside) and learns which liquidity price reaches for next (draw on liquidity). The liquidity, sweep, displacement/FVG and premium/discount concepts are re-implemented from public material, with a genuine learning core on top.
🔶 Key Features
Liquidity pool map — buyside/sellside pools, auto-removed once taken
Sweep detection — a grab of one side's liquidity followed by reclaim
ML: draw on liquidity — learns P(the buyside pool is reached before the sellside pool), turning the pull of price into a probability
RL: self-tuning bias threshold — a UCB bandit auto-tunes the firing threshold per structure regime
Sweep-origin signals — TP set to the targeted liquidity pool, SL beyond the swept extreme
Displacement/FVG and premium/discount included
Structure uses confirmed pivots; training and signals gate on bar close — no repaint
🧠 Technical Architecture
Liquidity engine: buyside/sellside pools from confirmed pivots are held in arrays; pools price trades through (taken liquidity) are removed; the nearest pools are drawn as lines.
Sweeps: piercing sellside then reclaiming up = bullish sweep; piercing buyside then closing down = bearish sweep.
ML (online logistic regression): eight features (trend, displacement tendency, premium/discount position, recent bullish/bearish sweep, distance to the buyside/sellside pools, structure direction) feed a model of the draw = P(buyside pool reached before sellside, within N bars). Each confirmed bar labels a pool-to-pool barrier — which of the nearest buyside target (above) and sellside target (below) is touched first — so the prediction uses no future data. If neither is reached in time, the sample is discarded (only clean draws train it).
RL (UCB contextual bandit): auto-tunes the bias firing threshold per structure regime (trend-strength terciles). Its reward is tied to the same draw resolution (a confident bias that proves correct = +1, wrong = −penalty, abstaining when neutral = a small reward) — so the ML training and the RL reward share one judgment loop.
Signals: long = bullish sweep + buyside draw ≥ threshold + discount; short = the mirror. TP is the targeted liquidity pool; SL is beyond the swept extreme.
Honest scope: a linear classifier + a UCB bandit over standard liquidity/structure features. Not deep learning, not a guarantee.
⚙️ Recommended Settings & Tuning Guide
Key parameters: swing lookback (pivots), pools per side, displacement multiple, barrier horizon N, learning rate, threshold search range, stop buffer.
Larger swing lookback → focus on major-structure pools; smaller → more detections
N is the window for deciding which liquidity is reached first (smaller for short-term, larger for swing)
Crypto starting points (tune on your chart):
BTC / ETH (15m–4H): defaults are the baseline (pivLen 10, N 20)
SOL / XRP and high-vol alts: a slightly longer swing lookback and a wider stop buffer to avoid wick-hunts
Scalping (1–15m): smaller pivot length and N
Swing (4H–daily): larger pivot length, N, and warmup
Bias, accuracy, and threshold are coarse until warmup plus enough draws accumulate
💡 How to Use in Practice
Read the draw bias for the liquidity price is likely to target next (buyside = up, sellside = down)
Enter on a sweep + agreeing-draw signal and use the drawn SL/TP (TP = the targeted pool)
Use premium/discount to favor advantageous pullbacks/rallies (buy discount, sell premium)
Leave the auto threshold to the learner by default
Combine with a higher-timeframe liquidity view or a precision-entry tool (AE-ACE)
⚠️ Important Notes
Needs a learning period (warmup); weights and the Q-table re-learn on input/symbol/timeframe change
Pools come from confirmed pivots, so the latest extreme confirms a few bars late (the trade-off for avoiding repaint)
A sweep does not guarantee a reversal (it can continue)
Probability, not a guarantee — always use stops and position sizing
🚨 Disclaimer
This indicator is for educational and informational purposes only and is not financial advice or a recommendation to buy or sell. No method guarantees future profits; past performance does not indicate future results, and trading carries the risk of loss. All trading decisions are your own — use proper backtesting and disciplined risk management.
AE-SMF focuses on what smart-money price action is really about — liquidity. It maps the stop pools resting above swing highs (buyside) and below swing lows (sellside) and learns which liquidity price reaches for next (draw on liquidity). The liquidity, sweep, displacement/FVG and premium/discount concepts are re-implemented from public material, with a genuine learning core on top.
🔶 Key Features
Liquidity pool map — buyside/sellside pools, auto-removed once taken
Sweep detection — a grab of one side's liquidity followed by reclaim
ML: draw on liquidity — learns P(the buyside pool is reached before the sellside pool), turning the pull of price into a probability
RL: self-tuning bias threshold — a UCB bandit auto-tunes the firing threshold per structure regime
Sweep-origin signals — TP set to the targeted liquidity pool, SL beyond the swept extreme
Displacement/FVG and premium/discount included
Structure uses confirmed pivots; training and signals gate on bar close — no repaint
🧠 Technical Architecture
Liquidity engine: buyside/sellside pools from confirmed pivots are held in arrays; pools price trades through (taken liquidity) are removed; the nearest pools are drawn as lines.
Sweeps: piercing sellside then reclaiming up = bullish sweep; piercing buyside then closing down = bearish sweep.
ML (online logistic regression): eight features (trend, displacement tendency, premium/discount position, recent bullish/bearish sweep, distance to the buyside/sellside pools, structure direction) feed a model of the draw = P(buyside pool reached before sellside, within N bars). Each confirmed bar labels a pool-to-pool barrier — which of the nearest buyside target (above) and sellside target (below) is touched first — so the prediction uses no future data. If neither is reached in time, the sample is discarded (only clean draws train it).
RL (UCB contextual bandit): auto-tunes the bias firing threshold per structure regime (trend-strength terciles). Its reward is tied to the same draw resolution (a confident bias that proves correct = +1, wrong = −penalty, abstaining when neutral = a small reward) — so the ML training and the RL reward share one judgment loop.
Signals: long = bullish sweep + buyside draw ≥ threshold + discount; short = the mirror. TP is the targeted liquidity pool; SL is beyond the swept extreme.
Honest scope: a linear classifier + a UCB bandit over standard liquidity/structure features. Not deep learning, not a guarantee.
⚙️ Recommended Settings & Tuning Guide
Key parameters: swing lookback (pivots), pools per side, displacement multiple, barrier horizon N, learning rate, threshold search range, stop buffer.
Larger swing lookback → focus on major-structure pools; smaller → more detections
N is the window for deciding which liquidity is reached first (smaller for short-term, larger for swing)
Crypto starting points (tune on your chart):
BTC / ETH (15m–4H): defaults are the baseline (pivLen 10, N 20)
SOL / XRP and high-vol alts: a slightly longer swing lookback and a wider stop buffer to avoid wick-hunts
Scalping (1–15m): smaller pivot length and N
Swing (4H–daily): larger pivot length, N, and warmup
Bias, accuracy, and threshold are coarse until warmup plus enough draws accumulate
💡 How to Use in Practice
Read the draw bias for the liquidity price is likely to target next (buyside = up, sellside = down)
Enter on a sweep + agreeing-draw signal and use the drawn SL/TP (TP = the targeted pool)
Use premium/discount to favor advantageous pullbacks/rallies (buy discount, sell premium)
Leave the auto threshold to the learner by default
Combine with a higher-timeframe liquidity view or a precision-entry tool (AE-ACE)
⚠️ Important Notes
Needs a learning period (warmup); weights and the Q-table re-learn on input/symbol/timeframe change
Pools come from confirmed pivots, so the latest extreme confirms a few bars late (the trade-off for avoiding repaint)
A sweep does not guarantee a reversal (it can continue)
Probability, not a guarantee — always use stops and position sizing
🚨 Disclaimer
This indicator is for educational and informational purposes only and is not financial advice or a recommendation to buy or sell. No method guarantees future profits; past performance does not indicate future results, and trading carries the risk of loss. All trading decisions are your own — use proper backtesting and disciplined risk management.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.