OPEN-SOURCE SCRIPT

AetherEdge - Generative Flow Synthesizer

342
🖊️ Overview

The Generative Flow Synthesizer is a path-synthesis engine inspired by the principles of a Variational Autoencoder (VAE), learning the market's "generative distribution." It compresses past price action into a low-dimensional latent distribution, samples latent variables via the reparameterization trick, and synthesizes multiple future price paths from them. Unlike conventional tools that draw a single forecast line, it renders the very spread of plausible futures as a stream of generated samples flowing forward like particles.

🔶 Key Features

VAE-inspired generative model: encode (latent compression) → sample (reparameterization) → decode (path expansion)
Reparameterization trick: latent sampling via z = μ + σ·ε (identical math to a real VAE)
Central predicted flow: a deterministic mean path generated from the latent mean
Multiple generated sample paths: stochastic draws from the latent distribution stream forward like particles
Generative confidence band: a ±σ uncertainty envelope widening each step
Online-learned latent distribution: drift, volatility, and autocorrelation adapt via EWMA
Sampling temperature: control future spread from conservative to bold
Mean-reversion strength: tune from pure random walk to convergent paths
Generative/fluid palettes (Plasma Flow et al.) with particle fade toward the horizon

🧠 Technical Architecture

This tool is a translation that realizes the VAE's mathematical core within Pine, which lacks autodiff. The encoder extracts sufficient statistics from log returns — drift (mean), volatility (standard deviation), and autocorrelation (persistence) — and online-learns the latent distribution parameters (μ, logσ²) via EWMA, a Pine realization of the posterior an encoder network would learn.
The sampling stage is identical to a real VAE, drawing latent variables through the reparameterization trick z = μ + σ·ε (ε a standard normal via Box–Muller). The decoder expands each latent sample into a forward price path through a mean-reverting stochastic process r_t = z + φ·(r_{t-1} − z) + σ·temp·ε_t. Because each path uses its own random sequence, they diversify like particles. The central predicted flow is the deterministic mean path with the noise term removed; the confidence band is the ±σ envelope built from accumulated step variance.

⚙️ Recommended Settings & Tuning Guide

Tuned with crypto in mind. On BTC and ETH, Encoder Window 60 and Generation Horizon ~24 are a starting point. Sampling Temperature is the generative core — below 1 yields narrow, conservative futures; above 1, wide, bold exploration. In trends, lower Mean-Reversion Strength for freer paths; in ranges, raise it for convergent paths, matching the possibility distribution to market character. Number of Sample Paths trades visual richness against compute; ~12 is a good balance.

💡 How to Use in Practice

The central predicted flow serves as the model's most average future trajectory for reading trend bias. The spread of the sample paths (particle scatter) expresses uncertainty itself — tight scatter signals clear direction, wide scatter a hard-to-predict regime. The confidence band width offers an objective reference for stop placement and target setting. For multi-timeframe trading, pair a higher-timeframe generative flow with a lower timeframe for timing.

⚠️ Important Notes

This tool is VAE-inspired, not a true backprop-trained neural-network VAE; within Pine's constraints it reproduces the VAE's core principles in a feasible form. Generated paths are samples from a learned distribution, not predictions of the future — purely a visualization of the spread of possibilities. Generation occurs only on the last bar and does not repaint confirmed history. Learning the latent distribution requires accumulated data and cannot overcome the fundamental constraint of market predictability.

🚨 Disclaimer

This indicator is provided for educational and informational purposes only and does not constitute financial or investment advice. No generated path guarantees future prices, and past performance does not indicate future results. All trading decisions are made at your own risk.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.