OPEN-SOURCE SCRIPT

AetherEdge - TIDE | Flow + RL Oscillator

622
🖊️ Overview

AE-TIDE is a lower-panel oscillator measuring participation-weighted money flow and its excess — the "Overflow" of one-sided activity. Where most flow tools simply display that excess, AE-TIDE adds a reinforcement-learning agent that learns, from realized outcomes, whether fading an Overflow exhaustion actually leads to a reversal in this market. It also scores every divergence with a Bayesian posterior, automatically down-weighting the divergences that do not work. It is a flow oscillator that gets smarter per market rather than relying on fixed thresholds.

🔶 Key Features

Participation-weighted Money Flow ([-50, 50]) plus an Overflow band for one-sided extremes
A fast Hyperwave momentum line for early shifts in drive
An RL (tabular Q-learning) agent that learns when fading exhaustion pays, firing reversal signals only then
Beta-Bernoulli online reliability scoring for divergences — each one shows a learned reliability %
Divergences below relGate are hidden automatically
Gold-framed HUD; no repaint — every signal gates on bar close

🧠 Technical Architecture

Flow: impulse = (ATR-normalized return) × (relative volume), EMA-smoothed and z-scored into a [-50, 50] Money Flow; the part beyond ± threshold is the Overflow. Hyperwave is the same normalization on a short EMA.
RL (Q-learning, TD(0)): state = flow regime (overflow side ×3 × momentum slope ×2 = 6 states), actions = {wait, fade}. The fade reward is the realized return conditioned on the overflow side at the moment the fade was taken (fade an overbought flow → rewarded if price falls). Update Q(s,a) ← Q + α[r + γ·maxQ(s′) − Q]; the fade action is optimistically initialized to guarantee exploration. A signal fires only when fade-value > 0 (learned to pay) and an Overflow exhaustion triggers.
Bayesian divergences: regular divergences are detected on oscillator pivots; each (side × extreme) bucket holds a Beta(a, b) posterior, updated by the realized outcome divK bars later. The displayed reliability is the posterior mean.
Honest scope: classic tabular Q-learning plus Beta-Bernoulli estimation — not deep RL, not a crystal ball.

⚙️ Recommended Settings & Tuning Guide

Key parameters: ofThr (Overflow threshold), rlAlpha / rlGamma / warmup, divK (outcome horizon), relGate (minimum reliability to show).
Raise ofThr → stricter overflow (suits alts); lower → more sensitive
Crypto starting points (tune on your chart):
BTC / ETH (1H–4H): defaults are the baseline (ofThr = 30)
SOL / XRP and high-vol alts: wicky and spiky — ofThr = 35–40, relGate = 0.6 for proven divergences only
Scalping (5–15m): shorter hwLen, divK = 5–8 for quick verdicts
Swing (daily): divK = 15–20, longer warmup so the agent learns enough
The RL needs time to learn a market's character; in trending markets fade signals thin out automatically (correct behavior)

💡 How to Use in Practice

FADE signals: appear only when Overflow recedes from an extreme AND the agent has learned that fading pays in this regime — use as a reversal trigger
Reading Overflow: a bright color is excessive one-sided participation; when it stalls or recedes, that exhaustion often precedes a reversal
Reliability-scored divergences: readings above ~70% mark contexts that historically reversed; ~50% means stand aside
Multi-timeframe: combine higher-timeframe flow direction with lower-timeframe FADE entries
Combinations: pair AE-TIDE's exhaustion fades with directional signals from AE-QUORUM or AE-KALMAN to separate trend pullbacks from range reversals

⚠️ Important Notes

Learning period: no FADE signals appear until the Q-learning agent spins up (warmup bars) — this is by design
Reliability starts at 50%: each divergence bucket sits near neutral until its posterior accumulates enough samples
Learning reset: changing inputs, symbol, or timeframe re-learns the internal state
Fading is countertrend: fading a strong trend too early is dangerous; even when the agent suppresses it, the final call is yours

🚨 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.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.