OPEN-SOURCE SCRIPT
AetherEdge - Echo State Network

🖊️ Overview
AE-ESN doesn't train on price — it pours price into a fixed, random recurrent core (a reservoir) and reads the future out of its rich nonlinear dynamics. No backpropagation, no offline training. Only the readout layer self-evolves online, bar by bar, continuously adapting to the prevailing regime. The result is projected forward as a confidence cone whose width is shaped by the model's own error distribution.
🔶 Key Features
Reservoir-computing engine — a fixed, sparsely-wired recurrent layer (4–48 neurons) maps the price stream into a high-dimensional state space.
Self-evolving online learning — the linear readout is updated every bar via normalized LMS; as the market shifts, the model quietly rewrites itself.
Guaranteed Echo State Property — the spectral radius is measured by power iteration and auto-scaled to the target ρ, ensuring stable memory dynamics.
Forward forecast cone — a free-running projection of multiple bars ahead, rendered as a confidence cone that widens with horizon.
Fully deterministic, non-repainting design — neuron wiring is reproducibly generated from a seed; learning and statistics update on confirmed bars only.
No look-ahead learning — weights are trained on a strict one-bar lag: the previous forecast versus the now-realized outcome.
Live statistics panel — directional accuracy, an R²-like confidence score, reservoir energy, and the projected return in real time.
Neon-grade visuals — gradient confidence cone, a glowing forecast line, and a directional background tint.
🧠 Technical Architecture
At the core is a reservoir driven by three normalized features (a standardized return, an ATR-normalized trend deviation, and momentum). State evolves through leaky integration — x(t) = (1−a)·x(t−1) + a·tanh(W_res·x(t−1) + W_in·u(t)). Both W_res and W_in are generated once via a deterministic LCG and then held fixed; the only thing that learns is the readout vector W_out.
That readout evolves on every confirmed bar through normalized LMS: each bar, the error between the previous forecast and the realized return is projected back along the state vector to correct the weights. An exponential moving variance of that error drives the cone's width (σ), while confidence is computed as explanatory skill over a zero-forecast baseline (an R²-like measure). The forward projection clones the current state and runs the reservoir free, feeding its own predictions back as input across the horizon.
🎯 Three design choices are worth highlighting. First, the spectral radius is measured via power
iteration before being normalized to ρ, so memory quality stays stable even as neuron count changes. Second, learning is confined to confirmed bars on a one-bar lag, eliminating future leakage. Third, because the wiring is seed-deterministic, identical settings reproduce an identical topology on any chart.
⚙️ Recommended Settings & Tuning Guide
As a crypto starting point — BTC/ETH (1D, 4H): 16 neurons, ρ = 0.90, Leak = 0.30, learning rate 0.15, horizon 12; it tracks trending instruments cleanly. High-volatility names (SOL, XRP): lower Leak to 0.20–0.25 to smooth noise, and widen Band σ toward 2.0 so the cone reflects the rougher price action.
Per parameter: Learning rate (μ) sets adaptation speed — use 0.2–0.3 for fast regime turns, 0.08–0.12 for stability in ranges. Spectral radius (ρ) sets memory length — higher retains longer context (0.95–1.05 reactive, 0.80–0.90 calmer). Neuron count sets expressiveness — 12–16 for lower timeframes, 24–32 for higher timeframes or complex structure. Horizon should match your trading style — 6–8 for scalps, 20–30 for swings.
💡 How to Use in Practice
The core read is cone direction × confidence. When the cone tilts up with both confidence and directional accuracy elevated, treat it as a tailwind for buying dips. A tag-and-reject at the cone's outer edge marks the boundary of the model's expected range — a mean-reversion cue. A rapidly expanding cone signals rising volatility; a contracting cone suggests a transition into consolidation. When the one-bar fit trail hugs actual price tightly, the model is reliable in that regime.
For multi-timeframe work, confirm the macro bias from the cone on the higher timeframe (1D), then execute aligned setups on a lower timeframe (1H–4H). Layering it over volume profile or market structure (S/R, order blocks) lets the cone add where and with what conviction, giving mutual confirmation.
⚠️ Important Notes
Signals are hidden until the warmup period (default 200 bars) completes. Reloading the indicator, or changing settings/seed, makes the network relearn across the entire history from scratch — learning state is not persisted between sessions. Reproducibility on a given chart is preserved, but expect confidence and accuracy to take time to settle after any change. The forecast cone is a probabilistic expected range, not a guarantee. Learning and statistics update on confirmed bars only, and the cone refreshes when a bar closes. Pushing neuron count high (40+) over very long history can approach Pine's ~40-second runtime limit.
🚨 Disclaimer
This indicator is for educational and informational purposes only and does not constitute financial or investment advice. Past performance is not indicative of future results. All trading involves risk. Use it alongside your own thorough testing and sound risk management; all trading decisions remain solely your own responsibility.
AE-ESN doesn't train on price — it pours price into a fixed, random recurrent core (a reservoir) and reads the future out of its rich nonlinear dynamics. No backpropagation, no offline training. Only the readout layer self-evolves online, bar by bar, continuously adapting to the prevailing regime. The result is projected forward as a confidence cone whose width is shaped by the model's own error distribution.
🔶 Key Features
Reservoir-computing engine — a fixed, sparsely-wired recurrent layer (4–48 neurons) maps the price stream into a high-dimensional state space.
Self-evolving online learning — the linear readout is updated every bar via normalized LMS; as the market shifts, the model quietly rewrites itself.
Guaranteed Echo State Property — the spectral radius is measured by power iteration and auto-scaled to the target ρ, ensuring stable memory dynamics.
Forward forecast cone — a free-running projection of multiple bars ahead, rendered as a confidence cone that widens with horizon.
Fully deterministic, non-repainting design — neuron wiring is reproducibly generated from a seed; learning and statistics update on confirmed bars only.
No look-ahead learning — weights are trained on a strict one-bar lag: the previous forecast versus the now-realized outcome.
Live statistics panel — directional accuracy, an R²-like confidence score, reservoir energy, and the projected return in real time.
Neon-grade visuals — gradient confidence cone, a glowing forecast line, and a directional background tint.
🧠 Technical Architecture
At the core is a reservoir driven by three normalized features (a standardized return, an ATR-normalized trend deviation, and momentum). State evolves through leaky integration — x(t) = (1−a)·x(t−1) + a·tanh(W_res·x(t−1) + W_in·u(t)). Both W_res and W_in are generated once via a deterministic LCG and then held fixed; the only thing that learns is the readout vector W_out.
That readout evolves on every confirmed bar through normalized LMS: each bar, the error between the previous forecast and the realized return is projected back along the state vector to correct the weights. An exponential moving variance of that error drives the cone's width (σ), while confidence is computed as explanatory skill over a zero-forecast baseline (an R²-like measure). The forward projection clones the current state and runs the reservoir free, feeding its own predictions back as input across the horizon.
🎯 Three design choices are worth highlighting. First, the spectral radius is measured via power
iteration before being normalized to ρ, so memory quality stays stable even as neuron count changes. Second, learning is confined to confirmed bars on a one-bar lag, eliminating future leakage. Third, because the wiring is seed-deterministic, identical settings reproduce an identical topology on any chart.
⚙️ Recommended Settings & Tuning Guide
As a crypto starting point — BTC/ETH (1D, 4H): 16 neurons, ρ = 0.90, Leak = 0.30, learning rate 0.15, horizon 12; it tracks trending instruments cleanly. High-volatility names (SOL, XRP): lower Leak to 0.20–0.25 to smooth noise, and widen Band σ toward 2.0 so the cone reflects the rougher price action.
Per parameter: Learning rate (μ) sets adaptation speed — use 0.2–0.3 for fast regime turns, 0.08–0.12 for stability in ranges. Spectral radius (ρ) sets memory length — higher retains longer context (0.95–1.05 reactive, 0.80–0.90 calmer). Neuron count sets expressiveness — 12–16 for lower timeframes, 24–32 for higher timeframes or complex structure. Horizon should match your trading style — 6–8 for scalps, 20–30 for swings.
💡 How to Use in Practice
The core read is cone direction × confidence. When the cone tilts up with both confidence and directional accuracy elevated, treat it as a tailwind for buying dips. A tag-and-reject at the cone's outer edge marks the boundary of the model's expected range — a mean-reversion cue. A rapidly expanding cone signals rising volatility; a contracting cone suggests a transition into consolidation. When the one-bar fit trail hugs actual price tightly, the model is reliable in that regime.
For multi-timeframe work, confirm the macro bias from the cone on the higher timeframe (1D), then execute aligned setups on a lower timeframe (1H–4H). Layering it over volume profile or market structure (S/R, order blocks) lets the cone add where and with what conviction, giving mutual confirmation.
⚠️ Important Notes
Signals are hidden until the warmup period (default 200 bars) completes. Reloading the indicator, or changing settings/seed, makes the network relearn across the entire history from scratch — learning state is not persisted between sessions. Reproducibility on a given chart is preserved, but expect confidence and accuracy to take time to settle after any change. The forecast cone is a probabilistic expected range, not a guarantee. Learning and statistics update on confirmed bars only, and the cone refreshes when a bar closes. Pushing neuron count high (40+) over very long history can approach Pine's ~40-second runtime limit.
🚨 Disclaimer
This indicator is for educational and informational purposes only and does not constitute financial or investment advice. Past performance is not indicative of future results. All trading involves risk. Use it alongside your own thorough testing and sound risk management; all trading decisions remain solely your own responsibility.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.