OPEN-SOURCE SCRIPT
AetherEdge - RL Momentum Filter

🖊️ Overview
AE-RLMF wraps two classical signal sources — MACD and Momentum — in an adaptive filter built on the reward concept from reinforcement learning. It online-learns which source is "recently effective" and automatically suppresses false signals from a source going through a bad patch. Arrows are minimal, and only agreement signals — where both indicators align — stand out.
🔶 Key Features
Two signal sources: MACD histogram cross and Momentum (ROC) zero-cross
RL-style adaptive filter: learns each source's "value" from outcomes and excludes signals from low-value sources
Recency-weighted: exponential averaging makes recent performance dominate
Agreement emphasis: BUY/SELL labels appear only when MACD and Momentum agree
Minimal arrows: solo signals are subtle triangles; only agreement signals print bubbles
Integrated HUD showing each source's current value, recent accuracy, and the strongest source
Per-channel alerts (agreement/solo × buy/sell)
🧠 Technical Architecture
This tool is not a full reinforcement-learning agent but reproduces its core idea — learn action values from outcomes, prefer high-value actions — as an online value table over the two signal sources. MACD histogram and Momentum zero-crosses are the raw signals; on each, the context is buffered. After the outcome horizon, a reward (0 or 1) is generated from whether price moved in the signal direction beyond the ATR-scaled win threshold, and the value Q is updated via Q ← Q + α(reward − Q). Higher Learning Rate weights recent performance more, strengthening the "recent winners" behavior. Signals from sources below Pass Threshold are filtered out, and the strongest "agreement signal" arises when both sources pass simultaneously in the same direction.
⚙️ Recommended Settings & Tuning Guide
Tuned with crypto in mind. Classical MACD 12/26/9 and Momentum 10 are a starting point. Outcome Horizon for reaction evaluation: 5–10 intraday, 15–25 for swing. Pass Threshold sets strictness — too many signals, raise to 0.55; too few, lower to 0.30. Higher Learning Rate (0.3–0.5) makes the filter more reactive to recent streaks; lower (0.1) stabilizes over the long run.
💡 How to Use in Practice
Highest-conviction are agreement signals (BUY/SELL bubbles): both MACD and Momentum are currently classified as "effective sources" and both flipped in the same direction. The smaller solo triangles are supporting cues, best used when they align with other evidence. Read the HUD's two source values (Q) and recent accuracies to see which is working in the current market and whether the filter is doing its job. Being trend-following, accuracy degrades in ranges; pairing with trend tools is effective.
⚠️ Important Notes
This tool is RL-inspired, not a true reinforcement-learning agent; within Pine's constraints it reproduces the core idea as experience-based value learning. The value learning requires accumulated data, so on new instruments or short windows Q-values stay near the initial 0.5 and the filter has little effect. Empty recent accuracy in the HUD signals insufficient learning samples. Setting Pass Threshold too high (0.6+) may suppress signals almost entirely.
🚨 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.
AE-RLMF wraps two classical signal sources — MACD and Momentum — in an adaptive filter built on the reward concept from reinforcement learning. It online-learns which source is "recently effective" and automatically suppresses false signals from a source going through a bad patch. Arrows are minimal, and only agreement signals — where both indicators align — stand out.
🔶 Key Features
Two signal sources: MACD histogram cross and Momentum (ROC) zero-cross
RL-style adaptive filter: learns each source's "value" from outcomes and excludes signals from low-value sources
Recency-weighted: exponential averaging makes recent performance dominate
Agreement emphasis: BUY/SELL labels appear only when MACD and Momentum agree
Minimal arrows: solo signals are subtle triangles; only agreement signals print bubbles
Integrated HUD showing each source's current value, recent accuracy, and the strongest source
Per-channel alerts (agreement/solo × buy/sell)
🧠 Technical Architecture
This tool is not a full reinforcement-learning agent but reproduces its core idea — learn action values from outcomes, prefer high-value actions — as an online value table over the two signal sources. MACD histogram and Momentum zero-crosses are the raw signals; on each, the context is buffered. After the outcome horizon, a reward (0 or 1) is generated from whether price moved in the signal direction beyond the ATR-scaled win threshold, and the value Q is updated via Q ← Q + α(reward − Q). Higher Learning Rate weights recent performance more, strengthening the "recent winners" behavior. Signals from sources below Pass Threshold are filtered out, and the strongest "agreement signal" arises when both sources pass simultaneously in the same direction.
⚙️ Recommended Settings & Tuning Guide
Tuned with crypto in mind. Classical MACD 12/26/9 and Momentum 10 are a starting point. Outcome Horizon for reaction evaluation: 5–10 intraday, 15–25 for swing. Pass Threshold sets strictness — too many signals, raise to 0.55; too few, lower to 0.30. Higher Learning Rate (0.3–0.5) makes the filter more reactive to recent streaks; lower (0.1) stabilizes over the long run.
💡 How to Use in Practice
Highest-conviction are agreement signals (BUY/SELL bubbles): both MACD and Momentum are currently classified as "effective sources" and both flipped in the same direction. The smaller solo triangles are supporting cues, best used when they align with other evidence. Read the HUD's two source values (Q) and recent accuracies to see which is working in the current market and whether the filter is doing its job. Being trend-following, accuracy degrades in ranges; pairing with trend tools is effective.
⚠️ Important Notes
This tool is RL-inspired, not a true reinforcement-learning agent; within Pine's constraints it reproduces the core idea as experience-based value learning. The value learning requires accumulated data, so on new instruments or short windows Q-values stay near the initial 0.5 and the filter has little effect. Empty recent accuracy in the HUD signals insufficient learning samples. Setting Pass Threshold too high (0.6+) may suppress signals almost entirely.
🚨 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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.