AetherEdge - Sentiment-Proxy Correlation Mapper🖊️ Overview
A psychology-focused engine that infers crowd emotion without any social or news feed — purely from price action. It builds sentiment proxies — volume anomaly (panic/euphoria), volatility (fear), price velocity (momentum drive), wick asymmetry (greed vs. fear at extremes), and run-length (FOMO / capitulation) — then uses a NeuraLib correlation map to learn how these proxies move together and weighs them into a single Fear ⇄ Greed sentiment score. A self-adapting mapping continuously re-correlates the proxies against realized outcomes, and the engine flags sentiment turning points — the moments crowd emotion flips. Visualization: a chart-background gradient shading the tape from Fear (red) to Greed (green), plus emphasis dots only at the reversals.
🔶 Key Features
Sentiment proxies — five emotion proxies built from price action alone (no external data)
NeuraLib correlation mapping — learns the proxies' joint behavior and fuses them into a Fear⇄Greed score
Self-adapting correlation — continuously re-correlates proxies against realized outcomes (learns which matter)
Turning-point detection — flags fear⇄greed reversals on a zero-line cross with sufficient swing
Sentiment background gradient — shades the chart from fear (red) through neutral to greed (green), intensity by magnitude
Turning-point dots — only the reversal moments are emphasized with dots and labels (noise excluded)
Emotional extreme markers — faint diamonds when sentiment enters a greed/fear extreme zone
Intelligence panel — Fear⇄Greed gauge, each proxy's value and learned correlation strength, and the latest turn
🧠 Technical Architecture
The engine builds five sentiment proxies from price: (1) volume anomaly (volume z-score × candle direction = euphoric buying / panic selling), (2) volatility (ATR ratio = higher is fear/stress), (3) price velocity (ATR-normalized speed of change = momentum), (4) wick asymmetry (lower − upper wick = which side defended the extreme), and (5) run-length (consecutive up/down within the window = FOMO / capitulation).
These feed the NeuraLib correlation map: proxies(5) → hidden(tanh) → sentiment(1, tanh-bounded ), trained by supervision so sentiment correlates with realized forward direction — greed (positive) preceding up-moves, fear (negative) preceding down-moves. After each step, each proxy's contribution to the hidden layer (mean absolute weight) is recomputed as its correlation strength, shown in the panel so you can see which proxy currently dominates emotion.
Sentiment is smoothed into a Fear⇄Greed score. Turning-point detection flags a fear→greed (or reverse) reversal when a zero-line cross's magnitude clears the Turn Sensitivity. The background is colored continuously by color.from_gradient, with intensity proportional to emotional magnitude.
⚙️ Recommended Settings & Tuning Guide
BTC (1H–4H): Volume 20, Volatility 14, Velocity 10, Smoothing 4, Turn Sensitivity 0.20. Standard settings fit well
ETH (1H–4H): As BTC, with Outcome Lookahead 5–8
SOL (15m–1H): High volatility favors Smoothing 5–6 to smooth sentiment, Turn Sensitivity 0.25 to suppress false turns
XRP (1H–4H): Spike-prone; Volume window 15 for sensitive anomaly detection, Extreme Threshold 0.5 for early extremes
Turn Sensitivity: higher makes turns selective (only large emotional reversals); lower detects more frequently
Extreme Threshold: beyond ±this is "extreme greed/fear" — a contrarian guide at 0.5–0.6
Sentiment Smoothing: higher smooths the background and score; lower is more reactive
Background Intensity: lower makes the background more vivid — adjust to taste
💡 How to Use in Practice
Reading the gradient: deep green = greed dominates (possible overheating); deep red = fear dominates (possible capitulation); neutral = balanced — saturation is emotional strength
Using turning-point dots: a "FEAR→GREED" dot marks a flip from fear to greed (possible bottom); "GREED→FEAR" a possible top — a basis for contrarian/trend entries
Contrarian at extremes: at extreme greed (green diamond) beware a pullback from overheating; at extreme fear (red diamond) watch for an oversold bounce — quantifying "be fearful when others are greedy"
Watching proxy correlations: the panel's per-proxy value and correlation strength reveal what drives emotion now (e.g. high volume-anomaly correlation = volume-led sentiment)
Background vs. price divergence: price rising while the background reads fear (bearish sentiment) is an early reversal warning
Multi-timeframe usage: read the big-picture emotional regime on the higher timeframe (4H), then time entries on turning points on the lower one (15m–1H)
⚠️ Important Notes
Nature of proxies: this is not real social/news sentiment but an estimated proxy inferred from price action — an approximation of crowd psychology that differs from external sentiment data
Initial learning period: right after launch the map's buffer is nearly empty and emotion estimates are unstable; treat as low-confidence until it fills (100+ bars)
Learning resets: changing parameters, switching symbol/timeframe, or recompiling reinitializes the map weights and buffer, restarting learning from zero
Danger of contrarianism: extreme emotion can persist (greed runs long in strong trends) — an extreme is not an instant reversal; pair with risk management
On look-ahead: the map's target uses closed-bar realized direction (a standard training construct); current-bar emotion is on confirmed values, but as with any adaptive system, historical and live behavior can differ — always forward-test
Constraints: this is a lightweight implementation operating within Pine's compute budget
🚨 Disclaimer
This indicator is an analytical and educational visualization tool. The sentiment proxies, correlation mapping, Fear⇄Greed score, turning-point detection, and sentiment background are quantitative heuristics computed on-chart from price data — they are not financial advice, buy/sell signals, or any guarantee of future performance. Estimates of crowd psychology can be wrong. Always combine any tool with your own analysis and disciplined risk management. אינדיקטור

AetherEdge - Fractal Geometry + Diffusion Predictor🖊️ Overview
A geometric forecaster unlike any channel or trendline tool. Two ideas combine. First, fractal geometry — a Higuchi-style fractal-dimension estimate and a Hurst-like persistence exponent quantify the market's self-similarity (roughness vs. smoothness). A rough, mean-reverting tape and a smooth, trending one have distinct fractal signatures, and the engine reads which regime is live. Second, diffusion-style generation — echoing how a diffusion model denoises noise into data, the engine seeds many noise vectors and runs a guided reverse process to GENERATE multiple future price paths. Their drift and volatility structure are conditioned on the fractal signature, so trending regimes generate persistent paths and rough regimes generate mean-reverting ones. Visualization: a central forecast line (the mean of generated paths) plus a faint fan of prediction bands whose opacity encodes probability.
🔶 Key Features
Fractal dimension — Higuchi method quantifies market roughness (self-similarity) as D∈
Hurst persistence exponent — distinguishes trend-persistence (H>0.5) from mean-reversion (H<0.5)
Diffusion-style path generation — generates multiple future paths by guided reverse diffusion from noise
Fractal guidance — the self-similarity signature steers path drift (classifier-style guidance)
Multi-scenario forecasting — samples many paths to build a per-step distribution
Geometric prediction fan — a central line plus nested probability bands fanning out with horizon
Probability via opacity — band opacity follows Gaussian mass (inner = higher probability = denser)
Intelligence panel — fractal dimension, Hurst exponent, persistence, and the forecast target price at a glance
🧠 Technical Architecture
Fractal geometry: the Higuchi estimator computes the curve length L(k) at each interval k and derives the dimension D from the least-squares slope of log L(k) vs log(1/k). Higher D means a rougher (noisier) series; lower means smoother (more trending). In parallel, a rescaled-range (R/S)-style Hurst exponent is estimated as H = log(R/S) / log(n). The two combine into a persistence score ∈ (+1 strongly trending, −1 strongly mean-reverting).
Diffusion generation: for each path, starting from the current price, each future step runs a reverse-diffusion process over Denoising Steps iterations. Each denoise step shrinks the noise amplitude along a cosine schedule (noisy early, clean late) while progressively strengthening a fractal-guided drift (guidance bites as the noise clears — classifier-style guidance). When persistence is negative (a mean-reverting regime), a pull-back force toward the starting price is added. Repeated across Generated Paths paths, the per-step mean and variance are accumulated via Welford's online algorithm.
Visualization: the per-step mean price forms the central line, and nested bands at multiples of the standard deviation (±k·σ) form the fan. Band opacity is proportional to Gaussian mass exp(−0.5k²), denser inside (higher probability). The fan naturally widens with horizon as variance grows.
⚙️ Recommended Settings & Tuning Guide
BTC (1H–4H): Fractal Window 40, kMax 5, Persistence Window 50, Generated Paths 24, Denoising Steps 8, Horizon 16. Standard settings fit well
ETH (1H–4H): As BTC, with Fan Width 1.0 for standard spread
SOL (15m–1H): High volatility favors Noise Scale 1.2 / Fan Width 1.2 to widen path dispersion, Fractal Guidance 0.5 to soften guidance
XRP (1H–4H): Spike-prone; Persistence Window 40 to weight recent self-similarity, Paths 30 to smooth the distribution
Fractal Window / kMax: a wider window and higher kMax refine the dimension estimate but add compute; 40/5 is practical
Generated Paths: more smooths the distribution but is heavier; 20–40 is a practical balance
Denoising Steps: more smooths paths; ~8 is sufficient
Fractal Guidance: higher lets the fractal signature steer drift more; lower is noise-driven
Render load: the fan draws Fan Bands × Horizon × 2 boxes, so maxing both can hit the 500-object render cap
💡 How to Use in Practice
Reacting to the central line: the mean of generated paths is the most probable future path — its slope and target price are the forecast's core
Reading the fan: a narrow fan = high forecast confidence (paths converge); wide = high uncertainty (paths diverge); the dense inner bands are the high-probability zone
Using the fractal regime: in high-persistence (trending) conditions, follow the central line's direction; in low (mean-reverting), expect the forecast to pull back
Reading fractal dimension: low D (toward 1.0) = smooth trending tape; high (toward 2.0) = rough range/noise — an aid to regime classification
Checking Hurst: H>0.5 trend-persistent, H<0.5 reversion-prone — corroborates the central forecast's direction
Fan width and risk: tighten stops when the fan is narrow, give room when wide
Multi-timeframe usage: confirm the fractal regime and forecast direction on the higher timeframe (4H), then time entries on the lower one (15m–1H)
⚠️ Important Notes
Initial computation period: until the fractal and Hurst windows fill (tens to a hundred-plus bars), the dimension and persistence estimates are unstable; treat forecasts as low-confidence until then
Stochastic generation: diffusion paths are generated from noise seeds, so changing the seed (settings) changes the distribution — forecasts are probabilistic scenario sets, not deterministic
Interpreting the fan: the fan shows where generated paths landed, not a guarantee that price stays within it — it is a probability-density visualization
On look-ahead: fractal dimension, Hurst, and drift are all computed from confirmed past data; the forecast projects from now into the future and can of course be wrong — always forward-test
Render load: box count is Fan Bands × Horizon; lower either if it feels heavy
Constraints: this is a lightweight implementation within Pine's compute budget; the Higuchi dimension, Hurst, and path generation are all approximations
🚨 Disclaimer
This indicator is an analytical and educational visualization tool. The fractal dimension, Hurst exponent, diffusion-style path generation, prediction fan, and central line are quantitative heuristics computed on-chart from price data — they are not financial advice, buy/sell signals, or any guarantee of future performance. Even a probabilistically generated forecast can be wrong. Always combine any tool with your own analysis and disciplined risk management. אינדיקטור

AetherEdge - Transformer-Inspired Attention Bias🖊️ Overview
A Transformer-style attention mechanism rendered in Pine — an engine for the selective focus of memory. Just as a Transformer attends selectively to the most relevant elements of a sequence, this engine treats the current bar as a query and every recent bar as a key/value. It scores each past bar's relevance via scaled dot-product (Q·Kᵀ/√d), normalizes the scores with softmax, and forms a weighted blend of those bars' directional signals — automatically focusing on the past patterns that matter most right now to compute the current bias (bullish/bearish). Several heads run in parallel, each learning a different notion of relevance, then merge into one directional bias. Visualization: an Attention Heatbar across the top of the chart (a horizontal strip whose brightness shows how much attention each point in recent time receives) plus one main bias arrow — a Transformer-style "selective focus of memory" in Pine.
🔶 Key Features
Multi-head attention — scaled dot-product attention (Q·Kᵀ/√d → softmax → ·V) reproduced in Pine
Selective focus of memory — automatically focuses on important past bars while suppressing noisy ones
Multiple heads — heads learn different relevance notions in parallel, merging into one bias
Positional encoding — an optional recency signal so the model knows how far back each bar is
Attention Heatbar — visualizes time-axis importance as a horizontal strip above price (brighter = more attention, tinted by bias)
Main bias arrow — the post-attention directional bias shown as one arrow (with glow)
Temperature parameter — softmax temperature tunes between sharp focus on a single bar and diffuse attention
Intelligence panel — attention bias, focus sharpness and distance (how far back focus sits), head count, context length, and more
🧠 Technical Architecture
Each bar is encoded into a small feature "token": momentum, RSI deviation, one-bar return, and range width (all normalized). Each bar is also assigned a directional "value" value = tanh(...) capturing its bullish/bearish lean.
The core is multi-head attention. The current bar's token is projected by Wq into a d-dim query q; each of the past ctxLen bars' tokens is projected by Wk into kᵢ. Attention scores are the scaled dot-product score_i = (q·kᵢ)/√d / temperature, where √d scaling ensures gradient stability. With positional encoding enabled, a recency signal is added to the keys. The scores are normalized by softmax into weights wᵢ, and the past bars' values are blended as Σ wᵢ·valueᵢ — that head's bias. Since each head has distinct projection weights, each captures a different relevance, merged via head output weights Wo.
A key implementation detail: Pine's history operator cannot take a loop variable, so past tokens are accumulated into rolling arrays and accessed dynamically via array.get(idx). Attention weights are aggregated into time-axis buckets and shown, normalized, as the Attention Heatbar (a brighter cell = stronger attention to that bar). The final bias is EMA-smoothed, and the main arrow fires when it clears the gate.
⚙️ Recommended Settings & Tuning Guide
BTC (1H–4H): Context Window 40, Heads 3, Key Dim 4, Temperature 1.0. Standard settings fit well
ETH (1H–4H): As BTC, with Context Window 50 for slightly longer memory
SOL (15m–1H): High volatility favors Temperature ≈ 0.7 for sharp focus, Heads 4 to capture diverse relevance
XRP (1H–4H): Spike-prone; Context Window ≈ 30 to emphasize recency, Position Encoding ON
Context Window: longer references further back but is heavier; 30–60 is practical
Heads: more captures more relevance notions but adds compute; 2–4 is readable
Temperature: low (0.5–0.8) sharply focuses on the single most relevant bar; high (1.5–3) gives diffuse, smooth attention
Min |Bias| to Signal: higher makes arrows more selective — tune to your trade frequency
💡 How to Use in Practice
Reading the Heatbar: a bright cell means that bar strongly drives the current bias. Bright on the right (recent) = short-term pattern leads; bright on the left (older) = a past important moment is recurring
Reacting to the main arrow: the arrow is the verdict where multi-head attention's merged bias clears the gate — a core basis for trend-following entries
Using focus distance: small panel "Focus Distance" = recency-driven; large = attending to far-back patterns, suggesting recurrence of a past analog
Focus sharpness: high = attention concentrated on one point (clear pattern recognition); low = diffuse (ambiguous)
Pairing with temperature: if the heatbar is wide and faint, lower the temperature to sharpen focus and clarify what the engine attends to
Multi-timeframe usage: confirm the big-picture bias on the higher timeframe (4H), then refine timing on arrows on the lower one (15m–1H)
⚠️ Important Notes
Initial context period: attention is incomplete until the context window (ctxLen) fills; treat the bias as low-confidence until enough past bars accumulate
Effect of setting changes: changing parameters, switching symbol/timeframe, or recompiling reinitializes the projection weights and token history
On learning: the projection weights are seed-initialized fixed weights used to compute attention patterns; this tool does not update weights from reward — it focuses on visualizing the attention mechanism itself
Heatbar placement: the heatbar draws above price, so adjust Heatbar Height to avoid overlapping the candles
Adaptive-system nature: historical and live behavior can differ — always forward-test
Constraints: this is a lightweight implementation operating within Pine's compute budget; Context × Heads × Key Dim drives compute load, so extreme settings affect performance
🚨 Disclaimer
This indicator is an analytical and educational visualization tool. The attention mechanism, multi-head attention, positional encoding, bias computation, and Attention Heatbar are quantitative heuristics computed on-chart from price data — they are not financial advice, buy/sell signals, or any guarantee of future performance. Always combine any tool with your own analysis and disciplined risk management. אינדיקטור

AetherEdge - Bayesian Neural Market Microstructure🖊️ Overview
A NeuraLib Bayesian Neural Network that does what a point-estimate model (e.g. a plain LSTM) cannot: it predicts WITH a confidence. Instead of one number, it runs many stochastic forward passes (MC-Dropout / weight-perturbation style) to produce a DISTRIBUTION of next-move predictions, reporting both a mean forecast and an uncertainty (the spread of the samples). Inputs are market-microstructure proxies — volume delta (buy/sell pressure), an estimated spread, and a liquidity proxy — alongside price features. Visualization: a probability-density "cloud" of predicted price bands (opacity ∝ probability) and a single forward zone that reddens as uncertainty rises. The edge over LSTM-style tools is clear — you see not just where, but how sure.
🔶 Key Features
Bayesian NN (uncertainty estimation) — multi-sample weight perturbation yields a predictive distribution: mean + uncertainty
Confidence-aware prediction — "mean ± σ", not a point estimate — the decisive difference from LSTM-style tools
Microstructure inputs — volume delta (order-flow proxy), estimated spread, and a liquidity proxy as features
Probability-density cloud — predicted bands drawn as nested probability tiers, opacity encoding probability mass (denser inside)
Uncertainty zone — a single forward zone that reddens and gains opacity as uncertainty rises
Mean forecast line — one line from current price to predicted price (with glow)
Online learning — the network continuously regresses toward realized forward moves
Intelligence panel — predicted move, predicted price, confidence, uncertainty, and each microstructure component at a glance
🧠 Technical Architecture
The agent perceives the market as a four-dimensional microstructure state: price momentum, order-flow pressure (a normalized volume delta from candle-direction × volume EMA), spread regime (an estimated effective spread from the high-low range), and liquidity (volume per unit range) — all z-normalized.
The network is in(4) → hidden(tanh) → out(1) = predicted normalized move, but its Bayesian behavior is reproduced via stochastic forward passes. Each sample (1) injects Gaussian-style noise into the weights (variational weight perturbation) and (2) applies an MC-Dropout mask to hidden units. Repeating this MC Samples times, the mean of the predictions is the forecast and their standard deviation is the uncertainty (epistemic uncertainty) — the heart of the Bayesian approximation.
Learning is supervised regression: for each state, the realized normalized move (close − close ) / ATR over the prediction horizon is the target, and the mean network regresses toward it via squared error (sampled from a replay buffer). For visualization, around the predicted price close + mean·ATR, nested probability bands of half-width k·σ·ATR form the density cloud, with opacity proportional to Gaussian mass exp(−0.5k²). The uncertainty zone gradients from the forecast color to red, with a bold red border once normalized uncertainty crosses the threshold.
⚙️ Recommended Settings & Tuning Guide
BTC (1H–4H): MC Samples 12, Dropout 0.25, Weight Noise 0.05, Prediction Horizon 8, Cloud Bands 5. Standard settings fit well
ETH (1H–4H): As BTC, with Uncertainty Scale 1.0 for standard cloud width
SOL (15m–1H): High volatility favors Dropout 0.3 / Weight Noise 0.08 for more sensitive uncertainty, Red Zone Threshold 0.5 to warn risk early
XRP (1H–4H): Spike-prone; MC Samples ≈ 16 to smooth the distribution, Uncertainty Scale 1.2 for slightly wider clouds
MC Samples: more smooths the uncertainty estimate but is heavier; 10–16 is a practical balance
Dropout / Weight Noise: higher widens the predictive distribution and raises uncertainty — tune to market noise
Cloud Density Bands: more makes a smoother, prettier cloud but adds render load; 4–6 is readable
Red Zone Threshold: lower warns red earlier (conservative); higher keeps the cool color only when very confident
💡 How to Use in Practice
Reading the density cloud: a narrow, dense cloud = low uncertainty, high-confidence forecast; a wide, faint cloud = high uncertainty, unstable forecast. The cloud center (mean line) is the predicted price
Uncertainty zone color: a forecast-colored (teal/coral) zone means confidence; a red, bold-bordered zone means high uncertainty — enter cautiously
Using confidence-aware prediction: consider entries only when panel Confidence is high — unlike point predictors (LSTM etc.), you can judge whether to trust the forecast
Checking microstructure: when order-flow Δ, spread, and liquidity align with the forecast direction, the prediction is better supported
Cloud width and sizing: size larger when the cloud is narrow (low uncertainty), smaller when wide (high uncertainty)
Multi-timeframe usage: confirm the big-picture forecast direction and uncertainty on the higher timeframe (4H), then time entries in low-uncertainty windows on the lower one (15m–1H)
⚠️ Important Notes
Initial learning period: right after launch the buffer is nearly empty and the network is untrained, so forecasts are unstable; treat them as low-confidence until it fills (several hundred bars)
Learning resets: changing parameters, switching symbol/timeframe, or recompiling reinitializes the network weights and buffer, restarting learning from zero
On microstructure proxies: this uses microstructure proxies estimated from OHLCV, not a real order book — an approximation that differs from true book data
Interpreting uncertainty: the reported uncertainty is the model's epistemic uncertainty (its lack of confidence), not a complete measure of actual market risk
On look-ahead: the target uses closed-bar realized moves (a standard training construct); current-bar prediction is on confirmed values, but as with any adaptive system, historical and live behavior can differ — always forward-test
Constraints: this is a lightweight implementation operating within Pine's compute budget; raising MC Samples increases compute proportionally
🚨 Disclaimer
This indicator is an analytical and educational visualization tool. The Bayesian neural network, uncertainty estimation, microstructure proxies, predictive distribution, and density cloud are quantitative heuristics computed on-chart from price data — they are not financial advice, buy/sell signals, or any guarantee of future performance. Even a probabilistic forecast can be wrong. Always combine any tool with your own analysis and disciplined risk management. אינדיקטור

AetherEdge - Self-Evolving RL Dashboard Lite🖊️ Overview
A streamlined self-evolving agent built on a lightweight Actor-Critic core with prioritized experience, learning by pitting multiple specialist RL heads against each other. Internally, three heads — TREND-FOLLOWING, MEAN-REVERSION, and BREAKOUT — each propose a directional view from their own lens, while a meta-selector tracks each head's recent reward performance and re-allocates trust toward whichever is working now. As the market's character shifts, the agent automatically moves its weight toward the style that's paying off. Visualization is intentionally minimal: one main signal arrow, one prediction line, a small composite score, and a "Learning Progress" label that makes the evolution visible.
🔶 Key Features
Competing RL heads — trend / mean-reversion / breakout specialists run in parallel; the best drives the unified call
Dynamic trust re-allocation — softmax trust weights adapt to each head's reward-performance score
Lightweight Actor-Critic — each head has an Actor (policy) and Critic (state value), learning via advantage
Prioritized experience replay — high-reward transitions re-learned preferentially
Style-specific reward shaping — each head is rewarded more in its specialty regime, differentiating behavior
Ultra-minimal visuals — just one main arrow + one prediction line + a small composite score
Learning Progress label — visualizes agent maturity (bars trained, buffer fill, trust concentration) as a bar
Exploration vs. exploitation — ε-greedy exploration
🧠 Technical Architecture
The agent perceives the market as a four-dimensional state vector (momentum spread, RSI deviation, Bollinger position, position-within-range — all z-normalized). The core is three independent Actor-Critic heads, each producing Actor logits (3 actions → softmax policy) and a Critic value from a compact shared trunk (tanh).
Heads differentiate via style-specific reward shaping. From a common directional return (ATR-normalized), the trend head amplifies reward in strong trends (large |momentum|), the mean-reversion head when stretched from the mean (large |BB position|), and the breakout head near range edges. The three thus learn distinct behaviors from the same price data.
Learning is standard Actor-Critic. Each head's Critic computes the TD target r + γV(s′), the advantage A = TD target − V(s) drives the Actor's advantage-weighted policy gradient, and the Critic regresses via squared error — all from a prioritized replay buffer (|reward|^exponent). In meta-selection, each head's performance score is EMA-smoothed and turned into trust weights via softmax. The final policy blends the three heads' policies by trust and picks the max-value action. The composite score is the decisiveness of the blended policy; learning progress combines training maturity, buffer fill, and trust concentration.
⚙️ Recommended Settings & Tuning Guide
BTC (1H–4H): Training Horizon 800–1500, γ 0.93, Head Trust Adapt 0.05, Min Score 0.35. Standard settings fit well
ETH (1H–4H): As BTC, with Reward Lookahead 5–8
SOL (15m–1H): High volatility favors Head Trust Adapt ≈ 0.08 to switch styles quickly, Min Score 0.4 to be selective
XRP (1H–4H): Spike-prone; Priority Exponent ≈ 2.0 to learn hard from big experiences, shorter Prediction Length
Head Trust Adapt Rate: higher switches to the winning style faster but less stably; lower is stable but slower
Head Score Smoothing: higher (0.9–0.95) smooths performance assessment; lower is sensitive to recent results
Min Score to Signal: higher makes arrows more selective — tune to your trade frequency
Prediction Length: the projection distance of the line; a higher score steepens its slope
💡 How to Use in Practice
Reacting to the main arrow: an arrow is the "final verdict" where the trust-weighted consensus of all three heads clears the score gate — a core basis for trend-following entries
Using the prediction line: one line whose slope scales with score; steeper means a more confident directional view
Reading the composite score: a higher score % in the small label means clearer cross-head consensus; low means a balanced call (stand aside)
Using the Learning Progress label: as the "LEARNING" bar fills and the best head stabilizes, the policy is maturing; treat signals as indicative while progress is low
Watching the best head: the current leading head (TREND / MEAN-REV / BREAKOUT) in the progress label reveals how the agent reads the present market
Multi-timeframe usage: confirm the best head and direction on the higher timeframe (4H), then refine timing on arrows on the lower one (15m–1H)
⚠️ Important Notes
Initial learning period: right after launch the buffer is nearly empty and the heads are immature; treat signals as low-confidence until the Learning Progress bar fills (several hundred bars)
Learning resets: changing parameters, switching symbol/timeframe, or recompiling reinitializes all head weights, trust weights, and the buffer, restarting learning from zero
Nature of the Lite build: this distills the multi-head internals into ultra-simple output, omitting detailed internal-state visualization
On forward-looking reward: rewards use closed-bar forward returns (a standard RL training construct); current-bar decisions are on confirmed values, but as with any adaptive system, historical and live behavior can differ — always forward-test
Constraints: this is a lightweight implementation operating within Pine's compute budget
🚨 Disclaimer
This indicator is an analytical and educational visualization tool. The Actor-Critic, competing RL heads, prioritized experience replay, reward shaping, composite score, and prediction are quantitative heuristics computed on-chart from price data — they are not financial advice, buy/sell signals, or any guarantee of future performance. Reinforcement-learning agents can and do make wrong calls. Always combine any tool with your own analysis and disciplined risk management. אינדיקטור

AetherEdge - KNN-Augmented RL Hybrid🖊️ Overview
A self-evolving hybrid that fuses episodic memory with a learned value network. Each bar's state and its realized outcome are stored in an experience memory bank; to value the present, the agent runs a k-Nearest-Neighbors search over that bank — retrieving the most similar historical states and distance-weighting their outcomes — then blends that memory estimate with a NeuraLib NN/Q estimate. The fusion combines the generalization of gradient learning with the instant recall of episodic memory. A reward-driven update adapts the per-feature similarity weights, so the agent learns which dimensions of "similarity" actually matter for prediction. Visualization: auto breakout-zone boxes where high-similarity memory predicts a decisive move, plus directional arrows on the fused signal.
🔶 Key Features
kNN×RL hybrid — episodic-memory kNN retrieval fused with a NeuraLib value network
Episodic memory augmentation — instant distance-weighted recall of similar past outcomes
Memory ↔ network blend — continuously adjustable from pure memory (kNN) to pure network (NN/Q)
Reward-driven similarity-weight learning — learns which feature dimensions define "similar"
High-similarity breakout zones — zones spawn only when memory retrieval is confident; opacity tracks similarity
Fused signal arrows — the integrated kNN+NN verdict shown as directional arrows (with glow)
Exploration vs. exploitation — ε-greedy exploration
Premium panel — NN-vs-kNN breakdown, fused value, memory similarity, conviction, similarity weights, memory/zone counts
🧠 Technical Architecture
The agent perceives the market as a four-dimensional state vector (momentum spread, RSI deviation, a volatility-regime ratio, position-within-range — all z-normalized). The architecture fuses two value-estimation paths.
Episodic memory (kNN) path: each bar stores state, action taken, and realized value (reward) in a memory bank. To value the present, a weighted Euclidean distance — using adaptive per-feature weights — is computed against all memories, and the k nearest are retrieved. Each neighbor's distance is turned into similarity via a Gaussian-style kernel sim = exp(−sharpness × distance), and a per-action similarity-weighted average yields the kNN memory value.
Value network (NeuraLib) path: a single hidden-layer (tanh) network maps state to per-action Q-values, trained by a DQN-style update.
Fusion: per direction, fused = (1−blend)·Q_network + blend·Q_knn, and the action with the largest fused value is selected. The signature element is similarity-weight adaptation: on each reward, weights of feature dimensions consistent with the profitable outcome are raised and irrelevant ones lowered (w ← clip(w + lr·(|feature|·|reward| − baseline))). The very definition of "similar" thus evolves from reward. Zone spawning fires only when both memory similarity and conviction clear their gates, with box opacity tracking similarity.
⚙️ Recommended Settings & Tuning Guide
BTC (1H–4H): Training Horizon 800–1500, Neighbors k 6, Memory Depth 300, Blend 0.5, γ 0.93. A 50/50 memory-network fusion as standard
ETH (1H–4H): As BTC, with Reward Lookahead 5–8
SOL (15m–1H): High volatility favors Similarity Sharpness 2.5–3.0 to weight only close neighbors, Min Similarity 0.7 to be selective on zones
XRP (1H–4H): Spike-prone; Blend ≈ 0.6 to lean on memory (recalling past sharp moves), k ≈ 8
Memory ↔ Network Blend: toward 0 favors generalization (robust to novel states); toward 1 favors memory (replays known patterns) — tune to market repetitiveness
Neighbors (k): small (3–5) is sharp but noisy; large (8–15) is smooth but less responsive
Similarity Weight LR: higher adapts feature weights faster but less stably; 0.01–0.03 is the stable zone
Memory Bank Depth: deeper retains more diverse memory but mixes in older regimes — balance against Training Horizon
💡 How to Use in Practice
Reacting to fused arrows: an arrow means both kNN memory and NN value back the direction and conviction cleared the gate — the integrated verdict, a core basis for trend-following entries
Using high-similarity zones: zones mark areas where memory shows a decisive move occurred in similar past conditions; watch breaks/bounces at zone edges
Reading memory similarity: higher panel similarity means the present closely matches a clear past pattern — higher prediction confidence; be cautious when low (novel conditions)
NN vs. kNN agreement: when both (e.g. the "NN / kNN" in the LONG row) are high together, confidence is highest; stand aside when they disagree
Watching similarity weights: the panel's Sim Weights (M·R·V·P = momentum, RSI, volatility, position) reveal which features the agent currently weights for similarity
Multi-timeframe usage: map high-similarity zones on the higher timeframe (4H), then refine timing on fused arrows on the lower one (15m–1H)
Combinations: filter for high-similarity, high-conviction arrows to focus on memory-backed, high-quality entries
⚠️ Important Notes
Initial learning period: right after launch the memory bank is nearly empty and kNN retrieval is non-functional; treat signals and zones as low-confidence until memory accumulates (several hundred bars)
Learning resets: changing parameters, switching symbol/timeframe, or recompiling reinitializes the memory bank, network weights, similarity weights, and zones, restarting learning from zero
Memory bias: the bank is built from recent states, so when the regime shifts substantially, past memory fits the present less well — low Memory Similarity is the tell
On forward-looking reward: rewards and memory values use closed-bar forward returns (a standard RL training construct); current-bar evaluation is on confirmed values, but as with any adaptive system, historical and live behavior can differ — always forward-test
Constraints: this is a lightweight implementation operating within Pine's compute budget; kNN search scales with memory depth × neighbors, so extreme settings affect performance
🚨 Disclaimer
This indicator is an analytical and educational visualization tool. The kNN search, value network, reward shaping, similarity-weight adaptation, breakout zones, and fused signal are quantitative heuristics computed on-chart from price data — they are not financial advice, buy/sell signals, or any guarantee of future performance. Reinforcement-learning agents can and do make wrong calls. Always combine any tool with your own analysis and disciplined risk management. אינדיקטור

אינדיקטור

AetherEdge - RainbowDQN Multi-Component🖊️ Overview
A self-evolving multi-component agent that fuses the core pillars of Rainbow DQN into one policy: Double (overestimation control), Dueling (separating state value from action advantage), and Prioritized Replay (re-learning in proportion to surprise / TD error). It learns from a composite reward — risk-adjusted return, drawdown avoidance, and volatility scaling — so it generalizes across trending, ranging, and high-volatility regimes alike. The internals are multi-headed, but their complex valuation is distilled into a single refined unified-signal arrow, rendered with layered glow and a premium intelligence panel.
🔶 Key Features
Three Rainbow components fused — Double + Dueling + Prioritized Replay in one policy
Composite-reward learning — risk-adjusted return + drawdown avoidance + volatility scaling, weighted
Multi-regime adaptability — volatility scaling and drawdown penalty generalize across trend / range / high-vol
Overestimation control (Double) — online net selects, target net evaluates
V/A separation (Dueling) — state value V(s) and advantage A(s,a) on separate streams
Prioritized replay + importance sampling — high-TD-error transitions learned first, with IS bias correction
Unified signal arrow only — multi-head internals distilled into one clean arrow (Layered Glow / Minimal / Labeled styles)
Refined visuals — multi-layer glow arrows, conviction ribbon, signal pulse, and a sectioned premium panel
🧠 Technical Architecture
The agent perceives the market as a five-dimensional state vector: momentum spread, RSI deviation, ADX trend strength, a volatility-regime ratio, and position-within-range — all z-normalized. Two networks exist (online + target), each with a Dueling structure — a shared trunk (tanh) forks into a Value stream V(s) and an Advantage stream A(s,a), recombined as Q = V + (A − mean A).
As Double-DQN, next-state action selection uses the online net's argmax while its valuation uses the target net, curbing overestimation; weights hard-sync every Target Net Sync bars. The composite reward fuses three heads: (1) risk-adjusted return (forward return normalized by ATR), (2) drawdown avoidance (penalizing adverse excursion within the lookahead window), and (3) volatility scaling (shrinking rewards earned under abnormally high volatility).
For prioritized replay, each transition's TD error δ = pred − target is turned into a priority |δ|^α, skewing sampling toward surprising experiences, while an importance-sampling (β) weight corrects the resulting bias. Gradients flow through the dueling aggregation (dQ/dV = 1, dQ/dA = 𝟙 − 1/3) into each stream and the shared trunk via manual backpropagation. Finally, a unified conviction blending Q-spread and advantage-spread is computed, and a single arrow is drawn only when it clears the gate.
⚙️ Recommended Settings & Tuning Guide
BTC (1H–4H): Training Horizon 800–1500, γ 0.94, Target Net Sync 25, reward weights Ret 1.0 / DD 0.6 / Vol 0.4. The balanced defaults fit well
ETH (1H–4H): As BTC, with Reward Lookahead 5–8 to value trend persistence
SOL (15m–1H): High volatility favors Vol weight 0.6–0.8 to strengthen scaling, Conviction Gate 0.45–0.55 to be selective
XRP (1H–4H): Spike-prone; DD weight ≈ 0.8 to penalize adverse excursion harder, Priority Exponent ≈ 2.0
Composite weights: raise Ret for trend-seeking, DD for steadier operation, Vol for choppy markets — allocate by market character and style
Conviction Gate: higher (0.5–0.6) gives fewer, higher-quality arrows; lower (0.3–0.4) gives more — tune to your trade frequency
Target Net Sync (τ): short (10–15) adapts fast but less stable; long (40–60) is stable — match to market stability
💡 How to Use in Practice
Reacting to the unified arrow: every arrow shown is the "final verdict" — past the multi-head valuation, composite reward, and conviction gate — a high-confidence core basis for trend-following entries
Using the conviction ribbon: the more saturated the under-price ribbon, the stronger the directional conviction; arrow plus matching ribbon color (teal bullish, coral bearish) is the most coherent setup
Across regimes: follow arrows directly in trends; in ranges the drawdown-avoidance head reduces forced signals; in high-vol the volatility head tempers overreaction
Signal pulse: the pulse dot on the firing bar improves entry-timing visibility
Multi-timeframe usage: confirm the big-picture unified direction on the higher timeframe (4H), then refine timing on aligned arrows on the lower one (15m–1H)
Combinations: pair with volume or key S/R, filtering for high-conviction arrows to lift precision further
⚠️ Important Notes
Initial learning period: right after launch the replay buffer is nearly empty and both networks are unstable; treat signals as low-confidence until it fills (several hundred bars)
Learning resets: changing parameters, switching symbol/timeframe, or recompiling reinitializes all network weights and the buffer, restarting learning from zero
Target-sync effect: calls may briefly shift right after a sync — this is normal Double-DQN behavior
On forward-looking reward: rewards and drawdown use closed-bar forward data (a standard RL training construct); current-bar evaluation is on confirmed values, but as with any adaptive system, historical and live behavior can differ — always forward-test
Constraints: this is a lightweight implementation operating within Pine's compute budget
🚨 Disclaimer
This indicator is an analytical and educational visualization tool. The Rainbow DQN (Double/Dueling/Prioritized Replay), composite reward, networks, and signal outputs are quantitative heuristics computed on-chart from price data — they are not financial advice, buy/sell signals, or any guarantee of future performance. Reinforcement-learning agents can and do make wrong calls. Always combine any tool with your own analysis and disciplined risk management. אינדיקטור

אינדיקטור

AetherEdge - PPO Policy Optimizer🖊️ Overview
A self-evolving policy-gradient agent built on Proximal Policy Optimization (PPO) that optimizes its trading policy itself. A NeuraLib policy network outputs a softmax probability distribution over LONG / SHORT / FLAT, improved through a PPO-style clipped objective — the probability ratio between the new and old policy is clipped to , so a single update can never shove the policy too far, the key to PPO's stability. Updates are driven by a virtual advantage estimate (GAE-style) computed against a learned value baseline. Learning from experience on your chart, it visualizes its evolving conviction with a policy-probability line (LONG %) and a trend line that recolors with the policy's tilt.
🔶 Key Features
PPO clipping — the probability ratio is clipped to , structurally preventing oversized policy updates (the heart of PPO stability)
Actor-Critic architecture — a shared trunk forks into an Actor head (softmax policy) and a Critic head (value baseline)
Virtual advantage (GAE-style) — forward-return-minus-baseline smoothed over time for a low-bias, low-variance advantage signal
Entropy bonus — prevents premature collapse to a single action, encouraging exploration
Multi-epoch optimization — each collected minibatch is reused several times per bar (PPO's data efficiency)
Policy LONG % line — the policy's LONG probability plotted 0–100 (best on its own scale)
Color-shifting trend line — nudged up/down by policy tilt, recolored by dominant action and confidence
Intelligence panel — per-action probabilities, dominant action, value baseline, policy entropy, and rollout state at a glance
🧠 Technical Architecture
The agent perceives the market as a four-dimensional state vector: momentum spread (ATR-normalized fast/slow EMA gap), RSI deviation, a volatility-regime ratio, and position-within-range — all z-normalized. This state passes through a NeuraLib-style Actor-Critic network: a shared trunk (tanh hidden) forks into an Actor head producing three logits → softmax policy π(a|s), and a Critic head producing a scalar value V(s).
The virtual advantage follows GAE (Generalized Advantage Estimation). Iterating backward through the rollout, the TD residual δ = r + γV(s′) − V(s) is smoothed by γλ into  = δ + γλ·Â_next, then normalized to zero mean and unit variance (standard PPO practice).
The heart of the PPO update is the clipped objective. With the ratio r(θ) = π_new(a|s)/π_old(a|s), the objective is min(r·Â, clip(r, 1−ε, 1+ε)·Â). Outside the trust region — advantage positive with r above 1+ε, or negative with r below 1−ε — the gradient is zeroed, structurally bounding each update step. This combines with the policy gradient ∂logπ(a)/∂logit = 𝟙 − p, an entropy bonus, and the Critic's squared-error value regression (weighted by vfCoef), all backpropagated manually into the shared trunk. The collected rollout is re-optimized over several epochs and minibatches.
⚙️ Recommended Settings & Tuning Guide
BTC (1H–4H): Training Horizon 800–1500, Clip ε 0.2, GAE λ 0.95, γ 0.94, Epochs 3, Hidden 8. Standard PPO settings fit well
ETH (1H–4H): As BTC, with Reward Lookahead 5–8 to capture slightly longer advantage
SOL (15m–1H): High volatility favors Clip ε 0.15–0.2 (more conservative updates), Entropy ≈ 0.02 to strengthen exploration, ATR-normalization always ON
XRP (1H–4H): Spike-prone; GAE λ ≈ 0.9 to curb variance, Value Loss Weight 0.5–0.7 for baseline accuracy
Clip ε: smaller (0.1–0.15) is more conservative and stable; larger (0.25–0.3) learns faster but less stably — match to market stability
Learning Rate α: 0.02–0.04 is the stable zone; lower it if diverging, raise Epochs if convergence is slow
Entropy Bonus: raise to 0.02–0.05 if the policy biases too early to one side
💡 How to Use in Practice
Reacting to the LONG % line: 50% is neutral. A cross above 60% is a clearly bullish policy; below 40% is bearish. Drag it to its own scale to watch threshold breaks
Using the color-shifting trend line: when the line turns the LONG color and sits above price, it acts as a bullish-bias support line; the SHORT color makes it a bearish-bias resistance line
Policy tilt (flips): the moment the dominant action flips LONG↔SHORT, the trend line's color change is your directional-shift signal
Reading entropy: low panel entropy = the policy is confident; high = undecided. Low entropy plus a strong probability line marks the highest-confidence conditions
Multi-timeframe usage: confirm the big-picture policy bias on the higher timeframe (4H), then refine timing on aligned lower-timeframe (15m–1H) LONG %
Combinations: use divergence between price and the LONG % line as an early reversal warning
⚠️ Important Notes
Initial learning period: right after launch the rollout is nearly empty and both policy and value are unstable; treat signals as low-confidence until it fills (several hundred bars)
Learning resets: changing parameters, switching symbol/timeframe, or recompiling reinitializes the network weights and rollout, restarting learning from zero
On-policy nature: PPO is on-policy, so actions are sampled stochastically from the policy; selection can vary even in similar conditions — this is normal exploration
On forward-looking reward: rewards and advantages use closed-bar forward returns (a standard RL training construct); current-bar policy evaluation is on confirmed values, but as with any adaptive system, historical and live behavior can differ — always forward-test
Constraints: this is a lightweight implementation operating within Pine's compute budget
🚨 Disclaimer
This indicator is an analytical and educational visualization tool. The Proximal Policy Optimization, policy network, virtual advantage computation, reward shaping, and probability outputs are quantitative heuristics computed on-chart from price data — they are not financial advice, buy/sell signals, or any guarantee of future performance. Reinforcement-learning agents can and do make wrong calls. Always combine any tool with your own analysis and disciplined risk management. אינדיקטור

AetherEdge - DuelingDQN Breakout Hunter🖊️ Overview
A self-evolving breakout agent built on a Dueling Deep-Q-Network that learns to hunt breakouts on its own. Its defining trait is a forked network: a Value stream V(s) that learns "how promising is this state at all", and an Advantage stream A(s,a) that learns "which action is relatively better here", recombined as Q(s,a) = V(s) + (A(s,a) − mean A). This separation lets the agent value the breakout context independently of the directional decision, sharpening action selection exactly where it counts — inside detected breakout zones. Learning from experience on your chart, it visualizes its hunt with auto support/resistance boxes and faint probability arrows.
🔶 Key Features
Dueling DQN architecture — shared trunk → Value and Advantage streams → recombined via the dueling aggregation; state quality and action advantage learned separately
Self-evolving breakout learning — no pre-training; breakout context learned continuously from the live chart
Breakout reward bonus — extra reward for correct actions in breakout context, focusing learning on breakouts
Auto S/R zones — boxes spawn on rolling S/R breaks, with full lifecycle management
Faint probability arrows — drawn with subtle opacity scaled to softmax action probabilities derived from advantages
Prioritized Experience Replay (PER) — high-reward transitions re-learned preferentially
Exploration vs. exploitation — ε-greedy exploration avoids ossifying in local optima
Intelligence panel — V(s), per-action A(s,a), selected action, advantage spread, breakout context, and zone count at a glance
🧠 Technical Architecture
The agent perceives the market as a four-dimensional state vector: momentum spread (ATR-normalized fast/slow EMA gap), relative position within Bollinger Bands, ATR distance to the nearest S/R, and a volatility-regime ratio — all z-normalized.
The core is the Dueling structure. Input passes through a shared trunk (tanh hidden), then forks. The Value stream runs through its hidden layer to a scalar V(s); the Advantage stream runs through its hidden layer to three per-action values A(s,a). They aggregate as Q(s,a) = V(s) + (A(s,a) − mean_a A(s,a)), the mean-subtraction ensuring identifiability between Value and Advantage. Learning is done by manual backpropagation through this aggregation: gradients are correctly distributed to the advantage outputs (dQ/dA = 𝟙 − 1/3) and the value output (dQ/dV = 1), then propagated back through each stream's hidden layer and into the shared trunk.
The reward function is a directional, ATR-normalized forward return, plus a bonus for success in breakout context. Transitions (s, a, r, s′) enter the experience replay buffer, sampled by |reward|^exponent. As the zone lifecycle, boxes spawn on rolling S/R breaks and are pruned oldest-first on lifespan or cap overflow. Probability arrows vary in opacity by softmax advantage probability and are drawn only when the advantage spread clears the gate. The statistics panel makes the internal Value and Advantage readable.
⚙️ Recommended Settings & Tuning Guide
BTC (1H–4H): Training Horizon 800–1500, γ 0.92–0.95, Shared Hidden 8 / Stream Hidden 4, S/R Lookback 20, Breakout Bonus 0.5. Standard settings fit well
ETH (1H–4H): As BTC, with Reward Lookahead 5–8 to value post-break follow-through
SOL (15m–1H): High volatility favors Zone Width 0.3–0.5 (wider boxes absorb fakeouts), ε 0.05–0.08, Breakout Bonus 0.6–0.8 to strengthen breakout learning
XRP (1H–4H): Spike-prone; Priority Exponent ≈ 2.0, longer S/R Lookback (25–30) to focus on major levels
Learning Rate α: 0.02–0.04 in trending markets; 0.04–0.08 in choppy ones
Stream Hidden Units: widen to 6–8 for richer advantage representation on instruments with diverse breakout types
maxBoxes / Zone Lifespan: maxBoxes 4–6 to see only key levels; extend Lifespan to retain zones longer
💡 How to Use in Practice
Reacting to high-advantage actions: when one action's advantage dominates with a high spread, the agent sees a clear edge in the break direction — a basis for trend-following entries
Using S/R boxes: auto-spawned zones mark post-break retest (return-move) levels; watch reactions at zone edges
S/R flips: capture the classic pattern where a broken resistance zone flips to support, via the box plus the advantage shift
Arrow opacity: darker arrows mean higher action probability and stronger conviction; treat faint arrows as wait-and-see
Multi-timeframe usage: read the big-picture break and zones on the higher timeframe (4H), then refine timing on aligned high-advantage actions on the lower one (15m–1H)
Combinations: filter for breaks accompanied by volume surges to reject fakeouts and elevate signal quality
⚠️ Important Notes
Initial learning period: right after launch the replay buffer is nearly empty and both Value and Advantage are unstable; treat signals as low-confidence until it fills (several hundred bars)
Learning resets: changing parameters, switching symbol/timeframe, or recompiling reinitializes all network weights, the buffer, and zones, restarting learning from zero
Nature of zones: boxes are structural markers from rolling S/R breaks, not signals in themselves; judge alongside the agent's advantage
On forward-looking reward: rewards use closed-bar forward return (a standard RL training construct); current-bar action selection is made on confirmed values, but as with any adaptive system, historical and live behavior can differ — always forward-test
Constraints: this is a lightweight implementation operating within Pine's compute budget
🚨 Disclaimer
This indicator is an analytical and educational visualization tool. The Dueling Deep-Q-Network, experience replay, reward shaping, breakout-zone detection, and action probabilities are quantitative heuristics computed on-chart from price data — they are not financial advice, buy/sell signals, or any guarantee of future performance. Reinforcement-learning agents can and do make wrong calls. Always combine any tool with your own analysis and disciplined risk management.
אינדיקטור

אינדיקטור

אינדיקטור

Kitty's Law [theUltimator5]MOASS is tomorrow.
MOASS will always be tomorrow.
Murphy's law states anything that can go wrong will go wrong.
With GameStop, we have something called Kitty’s law .
Kitty’s law states that whenever people can fit in a March-May 2024 fractal, people will fit in a March-May 2024 fractal.
This indicator is an embodiment of Kitty's law.
This indicator matches the current price action to the GME fractal from 2024, finds a best fit section, then projects forwards the resulting price action. A short squeeze has never been so near!
HOW IT WORKS
Now getting into the technical aspects of this indicator, since it is a bit more complicated than the silly description has it seem.
The values from 2024 are hard coded into arrays. There are two arrays. Hourly and daily. If the timeframe is set to daily, it will use the daily array for comparison. If any other timeframe, it will use hourly (yes I know that weekly, monthly etc... are correlating to hourly but deal with it)
The indicator then uses a lookback period off the current bar (you can define the length) and finds the best fit section match from the selected array (hourly or daily) using a custom Pearson correlation algorithm. Once it finds the best fit section match, it plots it over the chart and projects the rest of the array onto the chart, filling out the fractal.
If the ticker you are looking at is NOT GME, then it won't project anything. Instead, it will tell you to stop looking at bad tickers and go back to GME.
Disclaimer: This indicator is meant for fun and is NOT a technical analysis indicator and is cosmetic only! אינדיקטור

Risk Manager [SkaleHub]Overview
The ultimate capital preservation tool. This indicator calculates mathematically secure stop-loss placements based on real-time market volatility (ATR) and features a dynamic dashboard that tells you the exact position size to take to protect your account.
The Edge
Amateurs blow accounts by guessing their lot sizes and placing arbitrary stop-losses. This tool professionalizes your risk. By adjusting your position size relative to the asset's current volatility, it ensures that whether you are trading a quiet forex pair or a volatile crypto asset, your monetary risk remains an exact, controlled percentage of your capital.
Key Features:
Volatility-Based Stops: Automatically calculates stop-loss levels using the Average True Range (ATR), ensuring your stop is safely tucked behind the market's natural "noise" to prevent early liquidations.
Auto-Position Sizing: Input your account balance and risk tolerance (e.g., 1%), and the built-in dashboard instantly outputs the exact number of shares or units you should buy.
On-Chart Visual Guardrails: Optionally plots dynamic crosshair lines on the chart so you can visually see exactly where your mathematically optimized stop-loss should be placed before entering a trade.
How to Use
Apply the indicator and open the settings menu. Enter your total account balance and your strict risk percentage (1-2% is highly recommended).
When your Level 3 Momentum Trigger fires an entry signal, look at the Risk Manager dashboard in the corner of your screen.
Execute the trade using the exact "Position Size (Units)" displayed on the dashboard, and immediately set your hard stop-loss at the "Stop Distance" mapped out on the chart.
Author's Note
This is a premium, Invite-Only script. It is Level 4 of the SkaleHub Training System. To gain access, your TradingView username must be explicitly authorized through the SkaleHub Academy. אינדיקטור

BNC Market Bias DashboardA multi-timeframe sentiment gauge built on the BullNaked Crypto strategy framework. No signals, no entries — just a clear read of where the market stands right now across 7 timeframes simultaneously.
Scores each timeframe (3min, 9min, 27min, 81min, 3H, Daily, Weekly) across 5 indicators — EMA stack, Naked RSI zones, Stochastic RSI, Ichimoku Cloud, and Keltner Channel — and combines them into a weighted overall bias rating. Higher timeframes carry more weight because the higher the timeframe, the stronger the signal.
Rating scale: Strong Bull → Bull → Lean Bull → Neutral → Lean Bear → Bear → Strong Bear
What each column shows:
EMA stack alignment (9/30/50/100/200)
Naked RSI health zone (36 / 46 / 56 / 65 system)
Stochastic RSI position
Ichimoku Cloud position
Keltner Channel position
Per-timeframe signal suggestion
The overall score is weighted so Daily and Weekly carry 3× the influence of the 3-minute, reflecting the core principle that trend is truth on the higher timeframe. Use this to build your story before placing any trade — if the higher timeframes disagree with your entry timeframe, the story isn't complete yet.
Overlays directly on your chart. Table anchors to the bottom-left corner. All timeframes and indicator settings are fully adjustable in the settings panel.
Not financial advice. For educational and informational purposes only. אינדיקטור

אינדיקטור

אינדיקטור

אינדיקטור

אינדיקטור

אינדיקטור

אינדיקטור

Markov Regime Oscillator PRO🟦 Markov Regime Oscillator PRO is a quantitative regime-classification and forward-probability forecasting engine rendered as a centred oscillator panel. Every bar is classified into one of three regimes — Bull, Bear, Sideways — using a drift-adjusted, volatility-normalised k·σ·√N threshold. The regime sequence feeds two parallel semi-Markov transition matrices (Young / Mature) with exponentially-decayed counts, producing live N-bar forward probabilities and 95 % Bayesian credible intervals on the next-bar probability vector.
The indicator integrates nine analytical layers — drift-adjusted classification, adaptive k·σ·√N threshold, EWMA-decayed transition matrix, semi-Markov duration conditioning, N-bar forecast cone via matrix iteration, Bayesian credible intervals, stationary distribution, velocity precursor with optional momentum filter, and multi-timeframe confluence — each rendered on a single oscillator panel through reference levels, a regime ribbon, gradient fill, three-layer neon glow signals, and an in-panel forecast polyline. A 30-row PRO status dashboard rendered on the main price chart (not the oscillator panel) reports every readout in real time.
Built with mathematical honesty. Every +1 forward probability carries a 95 % Dirichlet-posterior credible interval, the EWMA half-life is user-set so the model can adapt as market character evolves (2020 ≠ 2024), the semi-Markov split splits the chain on regime age so mature trends are not treated like young ones, and the documentation is explicit about what the model can and cannot predict.
🟦 HOW THE CORE ENGINE WORKS
Regime Classification
Each bar, the engine measures the rolling N-bar log return — optionally adjusted for the long-term drift of the asset:
logRet_raw = log(close / close )
meanDrift = SMA(log(close / close ), driftWin)
logRet = logRet_raw − N × meanDrift (when Drift Adjustment is ON)
The bar is labelled by comparing this return against the configured boundary:
- `logRet > +threshold` → BULL
- `logRet < −threshold` → BEAR
- otherwise → SIDEWAYS
The classification runs every bar with no look-ahead. When the optional Momentum Filter is enabled, the Bull / Bear labels additionally require the oscillator velocity to agree with the direction — killing late entries on exhausted moves.
Adaptive Threshold (k · σ · √N)
Traditional Markov regime indicators use a fixed percentage cut — e.g. "±5 % over 20 bars". This collapses on real markets: the same 5 % is trivial in a 2017 mania and never reached in 2023 chop. The fix is to scale the boundary with realised volatility:
threshold_adaptive = k × σ × √N
where σ is the per-bar log-return standard deviation over a configurable window (default 100 bars). Under a random walk, k = 1.0 cuts at the 16th / 84th percentiles; k = 2.0 at the 2.5th / 97.5th percentiles. The default k = 1.5 reproduces classic ±1.5-sigma thresholds.
Fixed-percentage mode is still available for users who want to lock the threshold deliberately.
Drift Adjustment (Alpha-Adjusted Classification)
Strong-trending markets (long BTC bull runs, persistently uptrending equity indices) carry a non-zero baseline drift. Without adjustment, the rolling log return systematically exceeds zero in such markets — producing excessive Bull-regime flips that reflect baseline drift rather than incremental kinetic energy.
The fix is to subtract the long-term mean drift before threshold comparison:
logRet_excess = log(close / close ) − N × mean(log returns, driftWin)
Log returns become EXCESS returns over the asset's own long-run drift — what quant desks call "alpha-adjusted" classification. The default 250-bar drift window approximates one trading year on the daily timeframe.
Oscillator Value
The classified log return is normalised by the active threshold and scaled to ±100 = boundary, clipped at ±300:
oscVal = clip( logRet / threshold × 100, ±300 )
The oscillator value is the central panel signal. Reference levels at ±100 (solid) mark the official regime boundaries, ±70 (dashed) mark the pending early-warning zone, and 0 (dashed) is the neutral midline.
Regime Confidence
Once classified, the move's strength is normalised relative to the active boundary:
confidence = |logRet| / threshold
| Confidence | Tier | Visual |
|---|---|---|
| < 1.0× | weak | ▱▱▱ |
| 1.0× – 2.0× | moderate | ▰▱▱ |
| 2.0× – 3.0× | strong | ▰▰▱ |
| ≥ 3.0× | stretched | ▰▰▰ |
The confidence value feeds the High Confidence alert (≥ 2.5× trigger) and is reported in the Status dashboard.
🟦 EWMA DECAY ON TRANSITION COUNTS
The Ancient-History Problem
A classic Markov chain counts every historical transition with equal weight — a Bull→Bear flip from five years ago contributes the same as one from yesterday. This breaks when market character changes: the 2020 COVID crash regime dynamics are not the same as 2024 retail mania, but a vanilla counter weighs them identically.
The Refinement (EWMA / RiskMetrics-style decay)
Markov Regime Oscillator PRO applies exponential decay to the transition counts every confirmed bar BEFORE incrementing for the new transition:
decayFactor = 0.5 ^ (1 / halfLife)
counts = counts × decayFactor (all 9 cells, every bar)
counts = counts + 1.0 (new transition)
After `halfLife` bars, an old count weighs HALF its original. This is the same math RiskMetrics uses for EWMA volatility — adapted here to regime transition memory.
| Half-life | Behaviour |
|---|---|
| 50 – 200 | highly reactive — adapts fast, probabilities noisy |
| 300 – 700 | balanced (default 500) |
| 1000+ | stable — slow adaptation, smooth probabilities |
The decay is applied to all three matrices in lockstep (full, young, mature) so the semi-Markov split below stays internally consistent.
🟦 SEMI-MARKOV DURATION CONDITIONING
The Memoryless Problem
A standard Markov chain says: "Given I'm in Bull, the probability of staying Bull tomorrow is X — regardless of whether Bull started yesterday or 200 bars ago." This is the memoryless property, and on real markets it's wrong. A 200-bar-old Bull regime carries different mean-reversion risk than a 5-bar-old one.
The Refinement
Markov Regime Oscillator PRO additionally builds two CONDITIONAL transition matrices:
- `P_young` — transitions counted when the source regime's age was below the Age Median input
- `P_mature` — transitions counted when the source regime's age was at or above the Age Median
Both matrices are constructed in parallel with the unconditional matrix, using the same per-bar bucketing logic, the same EWMA decay, and the same Dirichlet smoothing.
The active forecast then uses the matrix matching the CURRENT regime's tier — Young or Mature. A 5-bar-old Bull is statistically more likely to continue than a 50-bar-old one; semi-Markov captures this empirically without leaking into the unconditional chain.
The active matrix tier is reported live in the Status dashboard's "Matrix" cell.
🟦 N-BAR FORECAST CONE
Matrix Iteration
The 3×3 transition matrix P encodes one-bar-ahead probabilities. To project further out, the state vector is iterated through P:
s_0 = = unit vector on current regime
s_{k+1} = s_k · P (matrix multiplication)
For each step k = 1 … forecastSteps, the iteration produces the probability of each regime at that future bar.
Expected Oscillator Value
At each forecast step, the expected oscillator value is computed as:
E = 100 · ( P(Bull | k) − P(Bear | k) )
This number is +100 when the model expects pure Bull, −100 when pure Bear, and ~0 when Side.
In-Panel Polyline
The cone is rendered as a colored polyline extending PAST the last confirmed bar into the future, drawn via `line.new()` so segments are pixel-stable on any chart zoom. Each segment is colored by the dominant regime at that step (Bull / Bear / Side).
Honest Limitation
The cone is reliable up to ~5 bars; beyond that the iteration converges toward the stationary distribution and the forecast loses information. The default Forecast Horizon is 5 bars — covers the meaningful window without illusion.
The forecast is matrix-implied, not a momentum extrapolation. If the oscillator is currently at +250 (strong Bull) but the matrix says P(Bull → Side) is high, the cone will regress to the matrix-implied expected value — showing a visual "cliff" at step 1. This is mathematically honest, not a bug.
The dashboard's "HORIZON +N" cell reports the dominant regime at the terminal forecast step plus its probability — for a single-glance read of where the chain expects to be at horizon end.
🟦 BAYESIAN CREDIBLE INTERVALS
Why Ranges, Not Point Estimates
A forecast like "P(Bull) +1 = 75 %" carries hidden uncertainty. With only 30 historical Bull-source transitions, the true probability could plausibly be anywhere between 55 % and 90 %. With 2000 historical Bull-source transitions, the same 75 % is tightly bracketed at, say, 73 – 77 %.
Reporting a single number hides the difference. Hedge-fund and academic forecasts always carry uncertainty bands; this oscillator does the same.
The Derivation (Dirichlet Posterior, Gaussian Approximation)
The transition matrix posterior is Dirichlet(α + counts) with Laplace (α = 1) prior. Each marginal is Beta with parameters (α_i, Σα − α_i). The Gaussian approximation to that Beta gives:
mean = α_i / Σα
var = α_i · (Σα − α_i) / ( Σα² · (Σα + 1) )
95 % CI ≈ mean ± 1.96 · √var
The CI is computed for the +1 row (the most actionable forecast) and clipped to .
Reading the Dashboard
P(Bull) +1 75 %
| CI Width | Interpretation |
|---|---|
| Narrow (e.g. 73 – 77) | large sample, robust estimate, trust the call |
| Wide (e.g. 50 – 95) | small sample, fragile estimate, don't bet the desk |
This is the difference between a quantitative estimate and an indicator guess.
🟦 STATIONARY DISTRIBUTION π
Power-iterating the matrix to convergence yields the stationary distribution — the long-run probability of being in each regime, independent of the current state. With 50 iterations on a well-behaved stochastic matrix, the distribution is essentially converged.
π(Side) + π(Bull) + π(Bear) = 1.0
The dashboard's "STATIONARY π" section reports each component. Reading π reveals the asset's structural bias regardless of the current regime — e.g., π(Bull) = 55 % on BTC daily tells you the market spends a majority of its time in Bull regimes over the long run, which is fundamentally different from a sideways-grinding instrument with π(Side) = 60 %.
The stationary distribution also serves as the asymptote of the forecast cone: as k → ∞, the cone collapses to π.
🟦 VELOCITY PRECURSOR & MOMENTUM FILTER
Velocity Definition
The oscillator velocity is the N-bar rate-of-change of the oscillator value:
velocity = oscVal − oscVal
velocityThr = VELOCITY_BASE · √(velocityWin / 5)
The threshold auto-scales with the window so the accel / decel / flat labels stay meaningful at any setting.
Early-Warning Cue
Velocity flips direction BEFORE the official ±100 boundary is crossed — it is a leading indicator of regime change. The Status dashboard's "Velocity" cell displays:
- ↑ accelerating (velocity > +threshold) — colored bull
- ↓ decelerating (velocity < −threshold) — colored bear
- ═ flat — neutral
This partially mitigates the inherent lookback lag of threshold-based regime detection.
Optional Momentum Filter
When the Momentum Filter is enabled, regime classification additionally requires velocity sign agreement:
Bull → logRet > +threshold AND velocity > 0
Bear → logRet < −threshold AND velocity < 0
This kills late-entry signals where price has extended past the threshold but momentum is already exhausted — a classic source of false signals at trend tops/bottoms. Reduces signal count, raises signal quality. Recommended for swing trading, optional for scalping.
🟦 PENDING-REGIME EARLY WARNING
Because the regime is classified from `log(close / close )`, the official regime label inherently lags. This is structural, not a bug, but can be partially mitigated.
Inside Sideways, when the log return reaches 70 % of either boundary, the dashboard fires an early-warning cue:
distance_fraction = max(|logRet| / threshold, ...)
isPending = (regime == SIDE) AND (distance_fraction ≥ 0.70)
The Status panel's "Pending" cell displays the direction the return is leaning toward and the current fraction:
⚠ ▲ BULL 87 %
Color matches the leaning regime. The Pending Regime alert (default OFF, opt-in) fires on the first bar a pending state is entered.
This is not a regime change signal — it's a "watch this" cue, triggered roughly 30 % before the official threshold is crossed. Used alongside the official regime change, it gives the user advance notice without compromising the threshold's strictness.
🟦 SELECTABLE SIGNAL SMOOTHING
A second smoothed signal line overlays the main oscillator. Crossovers between the main and signal lines mark momentum-of-regime shifts — these often precede actual regime changes by 1-3 bars.
Four smoothing algorithms are available:
| Method | Character |
|---|---|
| EMA (default) | Exponential — classic lag/smoothness |
| HMA | Hull — near-zero lag for short windows |
| ALMA | Arnaud Legoux (0.85, 6.0) — Gaussian-weighted, smoothest |
| SMA | Simple — most stable, most lag |
The Signal Cross alert can be optionally filtered by HTF alignment — when enabled, the alert fires only when LTF and HTF regimes match. Filter is auto-bypassed when HTF Confluence is globally OFF (silent-kill protection).
🟦 MULTI-TIMEFRAME CONFLUENCE
The same regime logic runs on a user-configured higher timeframe via `request.security` with `lookahead = barmerge.lookahead_off` and `gaps = barmerge.gaps_off` (anti-repaint mandatory). The result is reported in the Status dashboard's HTF block:
| State | Display | Color |
|---|---|---|
| HTF regime matches LTF regime | ✓ ALIGNED | bull |
| HTF regime differs from LTF | ⚠ DIVERGENT | bear |
| Insufficient HTF data | — | foreground |
Divergent regimes are common at trend turns — the LTF flips before the HTF catches up. Aligned regimes carry higher conviction. A separate alert ("MTF Confluence") fires on regime entries only when the HTF agrees.
Recommended pairings:
| Chart | HTF |
|---|---|
| 15m | 1H |
| 1H | D |
| 4H | W |
| D | W |
| W | M |
Use at least 3× your chart timeframe — anything closer and the two regimes track each other with no information gain.
🟦 OSCILLATOR PANEL VISUAL LAYER
Main Oscillator Line
The oscillator value plotted as a continuous line with five color tiers reflecting regime strength:
| Range | Color |
|---|---|
| ≥ +100 | full Bull |
| +70 to +100 | dim Bull (pending up) |
| −70 to +70 | neutral Side |
| −100 to −70 | dim Bear (pending down) |
| ≤ −100 | full Bear |
Line width is configurable 1 – 5 pixels.
Signal Line
A smoothed overlay of the main oscillator, faded foreground color, single-pixel width. Drives the Signal Cross alert and the dashboard Signal cell.
Reference Levels
Three horizontal levels per panel side:
- ±100 — official regime boundaries (solid plot line)
- ±70 — pending early-warning zones (dashed `line.new`)
- 0 — neutral midline (dashed `line.new`)
The dashed lines use `line.new()` rather than `plot.style_circles` so they remain pixel-stable at any chart zoom — they will NOT rescale or fragment.
Regime Ribbon
The oscillator panel background is tinted to the current regime color at 20 % opacity. Provides instant regime context at a glance — Bull / Bear / Side periods are visually separated even when zoomed out on long history. Toggleable.
Gradient Fill
The area between the oscillator line and zero is filled in the regime color, with intensity scaling adaptively by distance from zero — stronger color = higher conviction. Empty at zero.
Three-Layer Neon Glow Signals
On every confirmed regime transition (after the Min Hold filter passes), the indicator drops a three-layer halo on the oscillator line:
| Layer | Size | Transparency | Purpose |
|---|---|---|---|
| Outer | size.large | 80 % | Soft halo |
| Middle | size.normal | 50 % | Mid-glow |
| Core | size.small | 0 % | Bright center |
Bull entries (▲ triangle up), Bear entries (▼ triangle down), and Side entries (◆ diamond). The Min Hold input (default 4 bars) requires a new regime to persist before its flip is drawn — kills label spam in choppy zones without affecting the underlying transition counts.
Forecast Cone Polyline
On the last confirmed bar, a colored polyline extends into the future for N bars, plotting the expected oscillator value at each step. Color reflects the dominant regime at that step. Drawn with `line.new()` so segments are pixel-stable; recomputed on every chart refresh.
🟦 PRO STATUS DASHBOARD
A single dashboard rendered on the MAIN PRICE CHART (not the oscillator panel) via `force_overlay = true`. This keeps the oscillator panel uncluttered so the oscillator line, signal line, gradient fill, and forecast cone get the full pane height.
The dashboard is structured in seven sections, all theme-aware:
| Section | Cells |
|---|---|
| REGIME | Regime, Age + tier, Confidence, Pending, Velocity |
| FORECAST +1 | P(Bull), P(Bear), P(Side) — each with 95 % CI |
| HORIZON +N | Dominant regime at terminal forecast step + probability |
| STATIONARY π | π(Bull), π(Bear), π(Side) — long-run equilibrium |
| OSCILLATOR | Value, Signal direction, Threshold, Drift basis points |
| HTF | Regime + Aligned / Divergent status |
| DATA | Mode, Decay half-life, Matrix tier, Sample N |
Position is configurable across 9 chart corners. Text size: Tiny / Small / Normal / Large. Default Tiny so the full 30-row layout fits on any chart without scrolling. Background and text colors flip between Dark and Light display modes.
🟦 COLOR THEMES
Ten cohesive palettes tuned to the Apex design system, each defining three regime axes (Bull, Bear, Sideways):
| Theme | Character | Bull | Bear | Sideways |
|---|---|---|---|---|
| Focus (default) | Modern | Cyan | Deep orange | Cool blue-grey |
| Prism | Classic | Forest green | Crimson | Slate grey |
| Solar | Warm | Amber | Indigo red | Lavender grey |
| Frost | Cool | Sky blue | Soft lavender | Pale steel |
| Laser | Neon | Lime green | Hot crimson | Charcoal grey |
| Aurora | Bright | Gold | Scarlet | Warm beige |
| Plasma | Electric | Aqua | Magenta | Slate teal |
| Bloom | Soft | Mint | Hot pink | Blue-grey |
| Eclipse | Deep | Navy | Dark crimson | Steel grey |
| Carbon | Minimal | Near-white | Mid-grey | Dark grey |
One theme selection drives every visual component: oscillator line, signal line, reference levels, ribbon, fill, glow signals, forecast cone, and all dashboard cells.
Dark / Light Display Mode
Dashboard chrome (background, foreground, borders, section dividers) flips between dark-on-bright and bright-on-dark. The regime axis colors remain consistent across modes — only the panel chrome changes.
🟦 ALERT SYSTEM
Seven alert conditions, each independently togglable:
| Alert | Condition |
|---|---|
| Bull Regime Entry | Regime flipped to BULL (after Min Hold confirmation) |
| Bear Regime Entry | Regime flipped to BEAR (after Min Hold confirmation) |
| Sideways Regime Entry | Regime flipped to SIDEWAYS (default OFF) |
| High Confidence | confidence ≥ 2.5× threshold, first bar of crossing |
| Pending Regime | Inside Sideways, log return ≥ 70 % of either boundary (default OFF) |
| MTF Confluence | Bull / Bear entry + HTF agrees |
| Signal Cross | Main oscillator crosses signal line (default OFF) |
All alerts fire on confirmed bar close. Entry alerts respect the Min Hold filter — a new regime must persist Min Hold bars before its entry alert fires, matching the on-chart glow markers.
The Signal Cross alert can be optionally filtered by HTF alignment (Multi-Timeframe → Filter Signal Cross by HTF). The filter is automatically bypassed when HTF Confluence is globally OFF, so enabling the filter without HTF doesn't silently kill the alert.
🟦 SETTINGS REFERENCE
Theme
- Theme — One of 10 Apex palettes. Default: Focus
- Display Mode — Dark / Light. Default: Dark
Regime Logic
- Threshold Mode — Adaptive (k·σ·√N) / Fixed (%). Default: Adaptive
- Lookback Window — Bars for the rolling log return. Default: 20
- Adaptive k — Sigma multiplier. Default: 1.5
- Fixed Bull Threshold — Used only in Fixed mode. Default: 5.0 %
- Fixed Bear Threshold — Used only in Fixed mode. Default: 5.0 %
- Volatility Window — Bars for the per-bar stdev. Default: 100
- Min Hold — Bars a new regime must persist for entry alerts and glow markers. Default: 4
- Drift-Adjusted Log Returns — Toggle the drift adjustment. Default: ON
- Drift Window — Bars for the long-term mean drift estimate. Default: 250
- Require Momentum Agreement — Velocity sign filter on regime classification. Default: OFF
Bayesian Math
- EWMA Transition Counts (Decay) — Toggle exponential decay. Default: ON
- Decay Half-Life — Bars after which an old count weighs half. Default: 500
- Semi-Markov Duration Conditioning — Toggle the Young / Mature split. Default: ON
- Age Median — Boundary between Young and Mature regimes. Default: 10
- Bayesian Credible Intervals (95 %) — Toggle CI display in the dashboard. Default: ON
Forecast
- Forecast Cone Horizon — Number of bars projected by matrix iteration. Default: 5
- Show Forecast Cone — Toggle the in-panel cone polyline. Default: ON
Oscillator
- Show Signal Line — Toggle the smoothed signal overlay. Default: ON
- Signal Smoothing Method — EMA / HMA / ALMA / SMA. Default: EMA
- Signal Smoothing Length — Window length. Default: 5
- Velocity Window — Bars for the rate-of-change measurement. Default: 5
- Oscillator Line Width — Pixels. Default: 2
Display
- Show Regime Ribbon — Toggle the panel background tint. Default: ON
- Show Gradient Fill — Toggle the oscillator-vs-zero fill. Default: ON
- Show Reference Levels — Toggle the ±100 / ±70 / 0 horizontal lines. Default: ON
- Show Regime Change Glow — Toggle the three-layer halo markers. Default: ON
Multi-Timeframe
- Enable HTF Confluence — Toggle. Default: ON
- HTF Resolution — Higher timeframe. Default: D
- Filter Signal Cross by HTF Alignment — Conditional filter on cross alert. Default: OFF
Dashboard
- Show Status Dashboard — Toggle. Default: ON
- Position — Nine chart corners. Default: Top Right
- Size — Tiny / Small / Normal / Large. Default: Tiny
Alerts
- Bull / Bear / Sideways Regime Entry — Independent toggles
- High Confidence (≥ 2.5×) — Default: ON
- Pending Regime — Default: OFF
- MTF Confluence — Default: ON
- Signal Cross — Default: OFF
🟦 COMPATIBILITY
Works on all asset classes and all timeframes in TradingView Pine Script v6.
- Crypto: Spot, futures, perpetual contracts
- Forex: All pairs
- Equities: Stocks, ETFs, indices
- Commodities: Metals, energy, agriculture
- Timeframes: 1m through Monthly
The adaptive threshold normalises by per-bar realised volatility, and the drift adjustment normalises by the asset's long-run mean drift — together making the regime classification volatility-and-drift-agnostic across assets without manual recalibration. The same default settings work on BTCUSDT daily, SPY weekly, and EURUSD 4H — only the HTF resolution input should be adjusted to match the chart timeframe.
🟦 TECHNICAL NOTES
- Pine Script v6
- `max_labels_count = 500`, `max_lines_count = 500`, `max_bars_back = 5000`
- No repainting — all regime classifications are computed on confirmed bar close. The HTF request uses `lookahead = barmerge.lookahead_off` and `gaps = barmerge.gaps_off`
- Transition counting uses `barstate.isconfirmed` to avoid double-counting the live bar
- Regime change debouncing uses `ta.barssince` to avoid runtime-indexed history reads (which can trip "cannot determine max_bars_back" in Pine v6)
- Heavy computation (P matrix construction, N-step iteration, Bayesian CI math, stationary distribution power iteration, dashboard rendering) is gated on `barstate.islast` to run once per chart render
- Matrix multiplication is implemented as unrolled single-line expressions over a flat 9-cell array for portability and speed
- EWMA decay multiplies all 9 cells of all 3 matrices (counts, countsYoung, countsMature) once per confirmed bar — O(27) per bar overhead
- Dirichlet smoothing prevents NaN propagation when a regime has not appeared in visible history — empty rows fall back to uniform 1/3
- Duration buckets classify by the SOURCE regime's age at the moment of transition (`regAge `), so the bucketing reflects the regime that was about to transition rather than the destination
- `ta.crossover` / `ta.crossunder` are computed at global scope every bar to satisfy Pine's stateful-series rule (the gated cross events read from the cached values)
- Dashboard is rendered with `force_overlay = true` on the main price chart — keeps the oscillator panel free of UI clutter
- Reference-level dashed lines use `line.new()` with `style = line.style_dashed` and `extend = extend.both` for pixel-stable rendering at any zoom
🟦 LIMITATIONS — READ THIS
This indicator is statistically honest about what it can and cannot do. Four known limitations:
1. The Markov assumption is partially violated. Markets are not memoryless. The semi-Markov Young / Mature split mitigates this but does not eliminate it. EWMA decay further mitigates by down-weighting ancient transitions, but a truly path-dependent process (one where the SEQUENCE of recent regimes matters, not just the last one) is not captured.
2. Forward probabilities are not predictions. They are conditional probabilities under the chain assumption with the credible intervals quantifying the SAMPLING uncertainty around them. A "Bull 58 % at +5 bars" reading does not mean "58 % chance the next 5 bars are bullish" — it means "given a long-run sample of similar starting states and the active EWMA-decayed transition matrix, 58 % were in Bull at +5 bars". Use the cone as ONE input alongside other analysis.
3. The regime label lags by N bars. This is structural — the rolling log return necessarily looks back. The Pending early warning and the optional Momentum Filter partially mitigate this but cannot eliminate the lag. Treat the official regime change as a confirmation, not a leading signal.
4. Forecast cone reliability decays with horizon. By +5 bars the cone is at the edge of usefulness; by +20 bars it collapses toward the stationary distribution and carries no additional information beyond π. The default horizon is 5 bars for this reason. Do not over-interpret the right side of the cone.
🟦 DISCLAIMER
This indicator is provided for educational and informational purposes only. It does not constitute financial advice. Past performance does not guarantee future results. The forward probabilities are conditional estimates derived from historical transition counts under a (semi-)Markov model assumption — they are NOT guarantees about future market behaviour. Always conduct your own analysis and apply proper risk management. אינדיקטור
