OPEN-SOURCE SCRIPT
AetherEdge - Pattern Edge Learner

🖊️ Overview
Most pattern tools hard-code the textbook ("engulfing = bullish"). AE-PAT throws that out and measures each shape's forward edge from this market's own history. It encodes recent price action as a normalized signature and aggregates what past analogues did next via kernel regression — telling you which shapes actually work now, as an up-probability, expected move, and confidence (effective neighbors). It also shows learned win-rates for five classic candlestick patterns.
🔶 Key Features
Learned shape signatures — encodes the last L bars as an ATR-normalized shape and learns the forward edge from analogues
Non-parametric (kernel regression) — estimates "this shape did X" from data, no hard-coded lore
Up-probability + expected move + confidence — including how many analogues exist (effective neighbors)
Measured win-rates of classic patterns — bull/bear engulfing, hammer, shooting star, doji (the record, not the textbook)
Pattern signals — fire only when the learned edge is strong with enough analogues
Bar coloring for the edge; bar-close training and signals — no repaint
🧠 Technical Architecture
Shape signature: the last L bars encoded as four features each (body / upper wick / lower wick / return, normalized by each bar's ATR = scale-invariant), F = L×4 dims.
ML (Nadaraya-Watson kernel regression): a memory bank stores, each bar, the signature from N bars ago plus its realized outcome (up/down + forward return; no lookahead). The current signature is weighted against the whole memory by a Gaussian kernel exp(−dist²/2h²), yielding P(up), expected move, and effective neighbors (confidence). The estimate adapts as shapes change.
Stats (Beta-Bernoulli): online win-rates for five classic patterns, updated from the outcome N bars after each occurrence.
Honest scope: kernel regression + Bernoulli counting (no RL). Not deep learning, not a guarantee.
⚙️ Recommended Settings & Tuning Guide (crypto 15m–4H)
Key parameters: signature window L, outcome horizon N, up threshold (ATR), memory size, kernel bandwidth, bull/bear edge thresholds, min effective neighbors.
Window L ≈ 3–5 (larger captures complex shapes but yields fewer analogues)
N is the bars to measure the outcome; 8–15 for 15m–1H
Bandwidth controls match tolerance (smaller = stricter/fewer neighbors, larger = smoother)
Min effective neighbors ensures firing only with enough analogues
⚠️ It's a memory × dimension scan; if you hit a "script takes too long" error on long timeframes, lower the memory size
💡 How to Use in Practice
Use the pattern triangles for shape-backed entries
Read P(up) and expected move for direction/size, and stand aside when effective neighbors is low
Use the classic-pattern table to check "is the hammer working now / what's the engulfing win-rate" and drop assumptions
Combine with AE-MRB (mean reversion) or AE-CORR (drivers) to layer shape × context
⚠️ Important Notes
Needs a learning period (warmup) and memory to build; memory resets on timeframe/parameter change
Past analogues are not guaranteed to resolve the same now (regime shifts break it)
Rare shapes have few neighbors and lower confidence
Probability, not a guarantee — always do your own due diligence and use risk management
🚨 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 decisions are your own — use proper validation and disciplined risk management.
Most pattern tools hard-code the textbook ("engulfing = bullish"). AE-PAT throws that out and measures each shape's forward edge from this market's own history. It encodes recent price action as a normalized signature and aggregates what past analogues did next via kernel regression — telling you which shapes actually work now, as an up-probability, expected move, and confidence (effective neighbors). It also shows learned win-rates for five classic candlestick patterns.
🔶 Key Features
Learned shape signatures — encodes the last L bars as an ATR-normalized shape and learns the forward edge from analogues
Non-parametric (kernel regression) — estimates "this shape did X" from data, no hard-coded lore
Up-probability + expected move + confidence — including how many analogues exist (effective neighbors)
Measured win-rates of classic patterns — bull/bear engulfing, hammer, shooting star, doji (the record, not the textbook)
Pattern signals — fire only when the learned edge is strong with enough analogues
Bar coloring for the edge; bar-close training and signals — no repaint
🧠 Technical Architecture
Shape signature: the last L bars encoded as four features each (body / upper wick / lower wick / return, normalized by each bar's ATR = scale-invariant), F = L×4 dims.
ML (Nadaraya-Watson kernel regression): a memory bank stores, each bar, the signature from N bars ago plus its realized outcome (up/down + forward return; no lookahead). The current signature is weighted against the whole memory by a Gaussian kernel exp(−dist²/2h²), yielding P(up), expected move, and effective neighbors (confidence). The estimate adapts as shapes change.
Stats (Beta-Bernoulli): online win-rates for five classic patterns, updated from the outcome N bars after each occurrence.
Honest scope: kernel regression + Bernoulli counting (no RL). Not deep learning, not a guarantee.
⚙️ Recommended Settings & Tuning Guide (crypto 15m–4H)
Key parameters: signature window L, outcome horizon N, up threshold (ATR), memory size, kernel bandwidth, bull/bear edge thresholds, min effective neighbors.
Window L ≈ 3–5 (larger captures complex shapes but yields fewer analogues)
N is the bars to measure the outcome; 8–15 for 15m–1H
Bandwidth controls match tolerance (smaller = stricter/fewer neighbors, larger = smoother)
Min effective neighbors ensures firing only with enough analogues
⚠️ It's a memory × dimension scan; if you hit a "script takes too long" error on long timeframes, lower the memory size
💡 How to Use in Practice
Use the pattern triangles for shape-backed entries
Read P(up) and expected move for direction/size, and stand aside when effective neighbors is low
Use the classic-pattern table to check "is the hammer working now / what's the engulfing win-rate" and drop assumptions
Combine with AE-MRB (mean reversion) or AE-CORR (drivers) to layer shape × context
⚠️ Important Notes
Needs a learning period (warmup) and memory to build; memory resets on timeframe/parameter change
Past analogues are not guaranteed to resolve the same now (regime shifts break it)
Rare shapes have few neighbors and lower confidence
Probability, not a guarantee — always do your own due diligence and use risk management
🚨 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 decisions are your own — use proper validation and disciplined risk management.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.