Lorentzian Harmonic Flow - Adaptive ML⚡ LORENTZIAN HARMONIC FLOW — ADAPTIVE ML COMPLETE SYSTEM
THEORETICAL FOUNDATION: TEMPORAL RELATIVITY MEETS MACHINE LEARNING
The Lorentzian Harmonic Flow Adaptive ML system represents a paradigm shift in technical analysis by addressing a fundamental limitation that plagues traditional indicators: they assume time flows uniformly across all market conditions. In reality, markets experience time compression during volatile breakouts and time dilation during consolidation. A 50-period moving average calculated during a quiet overnight session captures vastly different market information than the same calculation during a high-volume news event.
This indicator solves this problem through Lorentzian spacetime modeling , borrowed directly from Einstein's special relativity. By calculating a dynamic gamma factor (γ) that measures market velocity relative to a volatility-based "speed of light," every calculation adapts its effective lookback period to the market's intrinsic clock. Combined with a dual-memory architecture, multi-regime detection, and Bayesian strategy selection, this creates a system that genuinely learns which approaches work in which market conditions.
CRITICAL DISTINCTION: TRUE ADAPTIVE LEARNING VS STATIC CLASSIFICATION
Before diving into the system architecture, it's essential to understand how this indicator fundamentally differs from traditional "Lorentzian" implementations, particularly the well-known Lorentzian Classification indicator.
THE ORIGINAL LORENTZIAN CLASSIFICATION APPROACH:
The pioneering Lorentzian Classification indicator (Jdehorty, 2022) introduced the financial community to Lorentzian distance metrics for pattern matching. However, it used offline training methodology :
• External Training: Required Python scripts or external ML tools to train the model on historical data
• Static Model: Once trained, the model parameters remained fixed
• No Real-Time Learning: The indicator classified patterns but didn't learn from outcomes
• Look-Ahead Bias Risk: Offline training could inadvertently use future data
• Manual Retraining: To adapt to new market conditions, users had to retrain externally and reload parameters
This was groundbreaking for bringing ML concepts to Pine Script, but it wasn't truly adaptive. The model was a snapshot—trained once, deployed, static.
THIS SYSTEM: TRUE ONLINE LEARNING
The Lorentzian Harmonic Flow Adaptive ML system represents a complete architectural departure :
✅ FULLY SELF-CONTAINED:
• Zero External Dependencies: No Python scripts, no external training tools, no data exports
• 100% Pine Script: Entire learning pipeline executes within TradingView
• One-Click Deployment: Load indicator, it begins learning immediately
• No Manual Configuration: System builds its own training data in real-time
✅ GENUINE FORWARD-WALK LEARNING:
• Real-Time Adaptation: Every trade outcome updates the model
• Forward-Only Logic: System uses only past confirmed data—zero look-ahead bias
• Continuous Evolution: Parameters adapt bar-by-bar based on rolling performance
• Regime-Specific Memory: Learns which patterns work in which conditions independently
✅ GETS BETTER WITH TIME:
• Week 1: Bootstrap mode—gathering initial data across regimes
• Month 2-3: Statistical significance emerges, parameter adaptation begins
• Month 4+: Mature learning, regime-specific optimization, confident selection
• Year 2+: Deep pattern library, proven parameter sets, robust to regime shifts
✅ NO RETRAINING REQUIRED:
• Automatic Adaptation: When market structure changes, system detects via performance degradation
• Memory Refresh: Old patterns naturally decay, new patterns replace them
• Parameter Evolution: Thresholds and multipliers adjust to current conditions
• Regime Awareness: If new regime emerges, enters bootstrap mode automatically
THE FUNDAMENTAL DIFFERENCE:
Traditional Lorentzian Classification:
"Here are patterns from the past. Current state matches pattern X, which historically preceded move Y. Signal fired."
→ Static knowledge, fixed rules, periodic retraining required
LHF Adaptive ML:
"In Trending Bull regime, Strategy B has 58% win rate and 1.4 Sharpe over last 30 trades. In High Vol Range, Strategy C performs better with 61% win rate and 1.8 Sharpe. Current state is Trending Bull, so I select Strategy B. If Strategy B starts failing, I'll adapt parameters or switch strategies. I'm learning which patterns matter in which contexts, and I improve every trade."
→ Dynamic learning, contextual adaptation, self-improving system
WHY THIS MATTERS:
Markets are non-stationary. A model trained on 2023 data may fail in 2024 when Fed policy shifts, volatility regime changes, or market structure evolves. Static models require constant human intervention—retraining, re-optimization, parameter updates.
This system learns continuously . It doesn't need you to tell it when markets changed. It discovers regime shifts through performance feedback, adapts parameters accordingly, and rebuilds its pattern library organically. The system running in Month 12 is fundamentally smarter than the system in Month 1—not because you retrained it, but because it learned from 1,000+ real outcomes.
This is the difference between pattern recognition (static ML) and reinforcement learning (adaptive ML). One classifies, the other learns and improves.
PART 1: LORENTZIAN TEMPORAL DYNAMICS
Markets don't experience time uniformly. During explosive volatility, price can compress weeks of movement into minutes. During consolidation, time dilates. Traditional indicators ignore this, using fixed periods regardless of market state.
The Lorentzian approach models market time using the Lorentz factor from special relativity:
γ = 1 / √(1 - v²/c²)
Where:
• v (velocity): Trend momentum normalized by ATR, calculated as (close - close ) / (N × ATR)
• c (speed limit): Realized volatility + volatility bursts, multiplied by c_multiplier parameter
• γ (gamma): Time dilation factor that compresses or expands effective lookback periods
When trend velocity approaches the volatility "speed limit," gamma spikes above 1.0, compressing time. Every calculation length becomes: base_period / γ. This creates shorter, more responsive periods during explosive moves and longer, more stable periods during quiet consolidation.
The system raises gamma to an optional power (gamma_power parameter) for fine control over compression strength, then applies this temporal scaling to every calculation in the indicator. This isn't metaphor—it's quantitative adaptation to the market's intrinsic clock.
PART 2: LORENTZIAN KERNEL SMOOTHING
Traditional moving averages use uniform weights (SMA) or exponential decay (EMA). The Lorentzian kernel uses heavy-tailed weighting:
K(distance, γ) = 1 / (1 + (distance/γ)²)
This Cauchy-like distribution gives more influence to recent extremes than Gaussian assumptions suggest, capturing the fat-tailed nature of financial returns. For any calculation requiring smoothing, the system loops through historical bars, computes Lorentzian kernel weights based on temporal distance and current gamma, then produces weighted averages.
This creates adaptive smoothing that responds to local volatility structure rather than imposing rigid assumptions about price distribution.
PART 3: HARMONIC FLOW (Multi-Timeframe Momentum)
The core directional signal comes from Harmonic Flow (HFL) , which blends three gamma-compressed Lorentzian smooths:
• Short Horizon: base_period × short_ratio / γ (default: 34 × 0.5 / γ ≈ 17 bars, faster with high γ)
• Mid Horizon: base_period × mid_ratio / γ (default: 34 × 1.0 / γ ≈ 34 bars, anchor timeframe)
• Long Horizon: base_period × long_ratio / γ (default: 34 × 2.5 / γ ≈ 85 bars, structural trend)
Each produces a Lorentzian-weighted smooth, converted to a z-score (distance from smooth normalized by ATR). These z-scores are then weighted-averaged:
HFL = (w_short × z_short + w_mid × z_mid + w_long × z_long) / (w_short + w_mid + w_long)
Default weights (0.45, 0.35, 0.20) favor recent momentum while respecting longer structure. Scalpers can increase short weight; swing traders can emphasize long weight. The result is a directional momentum indicator that captures multi-timeframe flow in compressed time.
From HFL, the system derives:
• Flow Velocity: HFL - HFL (momentum acceleration)
• Flow Acceleration: Second derivative (turning points)
• Temporal Compression Index (TCI): base_period / compressed_length (shows how much time is compressed)
PART 4: DUAL MEMORY ARCHITECTURE
Markets have memory—current conditions resonate with past regimes. But memory operates on two timescales, inspiring this indicator's dual-memory design:
SHORT-TERM MEMORY (STM):
• Capacity: 100 patterns (configurable 50-200)
• Decay Rate: 0.980 (50% weight after ~35 bars)
• Update Frequency: Every 10 bars
• Purpose: Capture current regime's tactical patterns
• Storage: Recent market states with 10-bar forward outcomes
• Analogy: Hippocampus (rapid encoding, fast fade)
LONG-TERM MEMORY (LTM):
• Capacity: 512 patterns (configurable 256-1024)
• Decay Rate: 0.997 (50% weight after ~230 bars)
• Quality Gate: Only high-quality patterns admitted (adaptive threshold per regime)
• Purpose: Strategic pattern library validated across regimes
• Storage: Validated patterns from weeks/months of history
• Analogy: Neocortex (slow consolidation, persistent storage)
Each memory stores 6-dimensional feature vectors:
1. HFL (harmonic flow strength)
2. Flow Velocity (momentum)
3. Flow Acceleration (turning points)
4. Volatility (realized vol EMA)
5. Entropy (market uncertainty)
6. Gamma (time compression state)
Plus the actual outcome (10-bar forward return).
K-NEAREST NEIGHBORS (KNN) PATTERN MATCHING:
When evaluating current market state, the system queries both memories using Lorentzian distance :
distance = Σ (1 - K(|feature_current - feature_memory|, γ))
This calculates similarity across all 6 dimensions using the same Lorentzian kernel, weighted by current gamma. The system finds K nearest neighbors (default: 8), weights each by:
• Similarity: Lorentzian kernel distance
• Age: Exponential decay based on bars since pattern
• Regime: Only patterns from similar regimes count
The weighted average of these neighbors' outcomes becomes the prediction. High-confidence predictions require both high similarity and agreement between multiple neighbors.
REGIME-AWARE BLENDING:
STM and LTM predictions are blended adaptively:
• High Vol Range regime: Trust STM 70% (recent matters in chaos)
• Trending regimes: Trust LTM 70% (structure matters in trends)
• Normal regimes: 50/50 blend
Agreement metric: When STM and LTM strongly disagree, the system flags low confidence—often indicating regime transition or novel market conditions requiring caution.
PART 5: FIVE-REGIME MARKET CLASSIFICATION
Traditional regime detection stops at "trending vs ranging." This system detects five distinct market states using linear regression slope and volatility analysis:
REGIME 0: TRENDING BULL ↗
• Detection: LR slope > trend_threshold (default: 0.3)
• Characteristics: Sustained positive HFL, elevated gamma, low entropy
• Best Strategy: B (Flow Momentum)
• Trading Behavior: Follow momentum, trail stops, pyramid winners
REGIME 1: TRENDING BEAR ↘
• Detection: LR slope < -trend_threshold
• Characteristics: Sustained negative HFL, elevated gamma, low entropy
• Best Strategy: B (Flow Momentum)
• Trading Behavior: Follow momentum short, aggressive exits on reversal
REGIME 2: HIGH VOL RANGE ↔
• Detection: |slope| < threshold AND vol_ratio > vol_expansion_threshold (default: 1.5)
• Characteristics: Oscillating HFL, high gamma spikes, high entropy
• Best Strategies: A (Squeeze Breakout) or C (Memory Pattern)
• Trading Behavior: Fade extremes, tight stops, quick profits
REGIME 3: LOW VOL RANGE —
• Detection: |slope| < threshold AND vol_ratio < vol_expansion_threshold
• Characteristics: Low HFL magnitude, gamma ≈ 1, squeeze conditions
• Best Strategy: A (Squeeze Breakout)
• Trading Behavior: Wait for breakout, wide stops on breakout entry
REGIME 4: TRANSITION ⚡
• Detection: Trend reversal OR volatility spike > 1.5× threshold
• Characteristics: Erratic gamma, high entropy, conflicting signals
• Best Strategy: None (often unfavorable)
• Trading Behavior: Stand aside, wait for clarity
Each regime gets a confidence score (0-1) measuring how clearly defined it is. Low confidence indicates messy, ambiguous conditions.
PART 6: THREE INDEPENDENT TRADING STRATEGIES
Rather than one signal logic, the system implements three distinct approaches:
STRATEGY A: SQUEEZE BREAKOUT
• Logic: Bollinger Bands squeeze release + HFL direction + flow velocity confirmation
• Calculation: Compares BB width to Keltner Channel width; fires when BB expands beyond KC
• Strength Score: 70 + compression_strength × 0.3 (tighter squeeze = higher score)
• Best Regimes: Low Vol Range (3), Transition exit (4→0 or 4→1)
• Pattern: Volatility contraction → directional expansion
• Philosophy: Calm before the storm; compression precedes explosion
STRATEGY B: LORENTZIAN FLOW MOMENTUM
• Logic: Strong HFL (×flow_mult) + positive velocity + gamma > 1.1 + NOT squeezing
• Calculation: |HFL × flow_mult| > 0.12, velocity confirms direction, gamma shows acceleration
• Strength Score: |HFL × flow_mult| × 80 + gamma × 10
• Best Regimes: Trending Bull (0), Trending Bear (1)
• Pattern: Established momentum → acceleration in compressed time
• Philosophy: Trend is friend when spacetime curves
STRATEGY C: MEMORY PATTERN MATCHING
• Logic: Dual KNN prediction > threshold + high confidence + agreement + HFL confirms
• Calculation: |memory_pred| > 0.005, memory_conf > 1.0, agreement > 0.5, HFL direction matches
• Strength Score: |prediction| × 800 × agreement
• Best Regimes: High Vol Range (2), sometimes others with sufficient pattern library
• Pattern: Historical similarity → outcome resonance
• Philosophy: Markets rhyme; learn from validated patterns
Each strategy generates independent strength scores. In multi-strategy mode (enabled by default), the system selects one strategy per regime based on risk-adjusted performance. In weighted mode (multi-strategy disabled), all three fire simultaneously with configurable weights.
PART 7: ADAPTIVE LEARNING & BAYESIAN SELECTION
This is where machine learning meets trading. The system maintains 15 independent performance matrices :
3 strategies × 5 regimes = 15 tracking systems
For each combination, it tracks:
• Trade Count: Number of completed trades
• Win Count: Profitable outcomes
• Total Return: Sum of percentage returns
• Squared Returns: For variance/Sharpe calculation
• Equity Curve: Virtual P&L assuming 10% risk per trade
• Peak Equity: All-time high for drawdown calculation
• Max Drawdown: Peak-to-trough decline
RISK-ADJUSTED SCORING:
For current regime, the system scores each strategy:
Sharpe Ratio: (mean_return / std_dev) × √252
Calmar Ratio: total_return / max_drawdown
Win Rate: wins / trades
Combined Score = 0.6 × Sharpe + 0.3 × Calmar + 0.1 × Win_Rate
The strategy with highest score is selected. This is similar to Thompson Sampling (multi-armed bandits) but uses deterministic selection rather than probabilistic sampling due to Pine Script limitations.
BOOTSTRAP MODE (Critical for Understanding):
For the first min_regime_samples trades (default: 10) in each regime:
• Status: "🔥 BOOTSTRAP (X/10)" displayed in dashboard
• Behavior: All signals allowed (gathering data)
• Regime Filter: Disabled (can't judge with insufficient data)
• Purpose: Avoid cold-start problem, build statistical foundation
After reaching threshold:
• Status: "✅ FAVORABLE" (score > 0.5) or "⚠️ UNFAVORABLE" (score ≤ 0.5)
• Behavior: Only trade favorable regimes (if enable_regime_filter = true)
• Learning: Parameters adapt based on outcomes
This solves a critical problem: you can't know which strategy works in a regime without data, but you can't get data without trading. Bootstrap mode gathers initial data safely, then switches to selective mode once statistical confidence emerges.
PARAMETER ADAPTATION (Per Regime):
Three parameters adapt independently for each regime based on outcomes:
1. SIGNAL QUALITY THRESHOLD (30-90):
• Starts: base_quality_threshold (default: 60)
• Adaptation:
Win Rate < 45% → RAISE threshold by learning_rate × 10 (be pickier)
Win Rate > 55% → LOWER threshold by learning_rate × 5 (take more)
• Effect: System becomes more selective in losing regimes, more aggressive in winning regimes
2. LTM QUALITY GATE (0.2-0.8):
• Starts: 0.4 (if adaptive gate enabled)
• Adaptation:
Sharpe < 0.5 → RAISE gate by learning_rate (demand better patterns)
Sharpe > 1.5 → LOWER gate by learning_rate × 0.5 (accept more patterns)
• Effect: LTM fills with high-quality patterns from winning regimes
3. FLOW MULTIPLIER (0.5-2.0):
• Starts: 1.0
• Adaptation:
Strong win (+2%+) → MULTIPLY by (1 + learning_rate × 0.1)
Strong loss (-2%+) → MULTIPLY by (1 - learning_rate × 0.1)
• Effect: Amplifies signal strength in profitable regimes, dampens in unprofitable
Each regime evolves independently. Trending Bull might develop threshold=55, gate=0.35, mult=1.3 while High Vol Range develops threshold=70, gate=0.50, mult=0.9.
PART 8: SHADOW PORTFOLIO VALIDATION
To validate learning objectively, the system runs three virtual portfolios :
Shadow Portfolio A: Trades only Strategy A signals
Shadow Portfolio B: Trades only Strategy B signals
Shadow Portfolio C: Trades only Strategy C signals
When any signal fires:
1. Open virtual position for corresponding strategy
2. On exit, calculate P&L (10% risk per trade)
3. Update equity, win count, profit factor
Dashboard displays:
• Equity: Current virtual balance (starts $10,000)
• Win%: Overall win rate across all regimes
• PF: Profit Factor (gross_profit / gross_loss)
This transparency shows which strategies actually perform, validates the selection logic, and prevents overfitting. If Shadow C shows $12,500 equity while A and B show $9,800, it confirms Strategy C's edge.
PART 9: HISTORICAL PRE-TRAINING
The system includes historical pre-training to avoid cold-start:
On Chart Load (if enabled):
1. Scan past pretrain_bars (default: 200)
2. Calculate historical HFL, gamma, velocity, acceleration, volatility, entropy
3. Compute 10-bar forward returns as outcomes
4. Populate STM with recent patterns
5. Populate LTM with high-quality patterns (quality > 0.4)
Effect:
• Without pre-training: Memories empty, no predictions for weeks, pure bootstrap
• With pre-training: System starts with pattern library, predictions from day one
Pre-training uses only past data (no future peeking) and fills memories with validated outcomes. This dramatically accelerates learning without compromising integrity.
PART 10: COMPREHENSIVE INPUT SYSTEM
The indicator provides 50+ inputs organized into logical groups. Here are the key parameters and their market-specific guidance:
🧠 ADAPTIVE LEARNING SYSTEM:
Enable Adaptive Learning (true/false):
• Function: Master switch for regime-specific strategy selection and parameter adaptation
• Enabled: System learns which strategies work in which regimes (recommended)
• Disabled: All strategies fire simultaneously with fixed weights (simpler, less adaptive)
• Recommendation: Keep enabled for all markets; system needs 2-3 months to mature
Learning Rate (0.01-0.20):
• Function: Speed of parameter adaptation based on outcomes
• Stocks/ETFs: 0.03-0.05 (slower, more stable)
• Crypto: 0.05-0.08 (faster, adapts to volatility)
• Forex: 0.04-0.06 (moderate)
• Timeframes:
1-5min scalping: 0.08-0.10 (rapid adaptation)
15min-1H day trading: 0.05-0.07 (balanced)
4H-Daily swing: 0.03-0.05 (conservative)
• Tradeoff: Higher = responsive but may overfit; Lower = stable but slower to adapt
Min Samples Per Regime (5-30):
• Function: Trades required before exiting bootstrap mode
• Active trading (>5 signals/day): 8-10 trades
• Moderate (1-5 signals/day): 10-15 trades
• Swing (few signals/week): 5-8 trades
• Logic: Bootstrap mode until this threshold; then uses Sharpe/Calmar for regime filtering
• Tradeoff: Lower = faster exit (risky, less data); Higher = more validation (safer, slower)
🌍 REGIME DETECTION:
Regime Lookback Period (20-200):
• Function: Bars used for linear regression to classify regime
• By Timeframe:
1-5min: 30-50 bars (~2-4 hour context)
15min: 40-60 bars (daily context)
1H: 50-100 bars (weekly context)
4H: 100-150 bars (monthly context)
Daily: 50-75 bars (quarterly context)
• By Market:
Crypto: 40-60 (faster regime changes)
Forex: 50-75 (moderate stability)
Stocks: 60-100 (slower structural trends)
• Tradeoff: Shorter = more regime switches (reactive); Longer = fewer switches (stable)
Trend Strength Threshold (0.1-0.8):
• Function: Minimum normalized LR slope to classify as trending vs ranging
• Lower (0.1-0.2): More markets classified as trending
• Higher (0.4-0.6): Only strong trends qualify
• Recommendations:
Choppy markets (BTC, small caps): 0.25-0.35
Smooth trends (major FX pairs): 0.30-0.40
Strong trends (indices during bull): 0.20-0.30
• Effect: Controls sensitivity of trending vs ranging classification
Vol Expansion Factor (1.2-3.0):
• Function: Volatility ratio to classify high-vol regimes (current_vol / avg_vol)
• By Asset:
Bitcoin: 1.4-1.6 (frequent vol spikes)
Altcoins: 1.3-1.5 (very volatile)
Major FX (EUR/USD): 1.6-2.0 (stable baseline)
Stocks (SPY): 1.5-1.8 (moderate)
Penny stocks: 1.3-1.4 (always volatile)
• Impact: Higher = fewer "High Vol Range" classifications; Lower = more sensitive to volatility spikes
🎯 SIGNAL GENERATION:
Base Quality Threshold (30-90):
• Function: Starting signal strength requirement (adapts per regime)
• THIS IS YOUR MAIN SIGNAL FREQUENCY CONTROL
• Conservative (70-80): Fewer, higher-quality signals
• Balanced (55-65): Moderate signal flow
• Aggressive (40-50): More signals, more noise
• By Trading Style:
Scalping (1-5min): 50-60
Day trading (15min-1H): 60-70
Swing (4H-Daily): 65-75
• Adaptive Behavior: System raises this in losing regimes (pickier), lowers in winning regimes (take more)
Min Confidence (0.1-0.9):
• Function: Minimum confidence score to fire signal
• Calculation: (Signal_Strength / 100) × Regime_Confidence
• Recommendations:
High-frequency (scalping): 0.2-0.3 (permissive)
Day trading: 0.3-0.4 (balanced)
Swing/position: 0.4-0.6 (selective)
• Interaction: During Transition regime (low regime confidence), even strong signals may fail confidence check; creates natural regime filtering
Only Trade Favorable Regimes (true/false):
• Function: Block signals in unfavorable regimes (where all strategies have negative risk-adjusted scores)
• Enabled (Recommended): Only trades when best strategy has positive Sharpe in current regime; auto-disables during bootstrap; protects capital
• Disabled: Always allows signals regardless of historical performance; use for manual regime assessment
• Bootstrap: Auto-allows trading until min_regime_samples reached, then switches to performance-based filtering
Min Bars Between Signals (1-20):
• Function: Prevents signal spam by enforcing minimum spacing
• By Timeframe:
1min: 3-5 bars (3-5 minutes)
5min: 3-6 bars (15-30 minutes)
15min: 4-8 bars (1-2 hours)
1H: 5-10 bars (5-10 hours)
4H: 3-6 bars (12-24 hours)
Daily: 2-5 bars (2-5 days)
• Logic: After signal fires, no new signals for X bars
• Tradeoff: Lower = more reactive (may overtrade); Higher = more patient (may miss reversals)
🌀 LORENTZIAN CORE:
Base Period (10-100):
• Function: Core time period for flow calculation (gets compressed by gamma)
• THIS IS YOUR PRIMARY TIMEFRAME KNOB
• By Timeframe:
1-5min scalping: 20-30 (fast response)
15min-1H day: 30-40 (balanced)
4H swing: 40-55 (smooth)
Daily position: 50-75 (very smooth)
• By Market Character:
Choppy (crypto, small caps): 25-35 (faster)
Smooth (major FX, indices): 35-50 (moderate)
Slow (bonds, utilities): 45-65 (slower)
• Gamma Effect: Actual length = base_period / gamma; High gamma compresses to ~20 bars, low gamma expands to ~50 bars
• Default 34 (Fibonacci) works well across most assets
Velocity Period (5-50):
• Function: Window for trend velocity calculation: (price_now - price ) / (N × ATR)
• By Timeframe:
1-5min scalping: 8-12 (fast momentum)
15min-1H day: 12-18 (balanced)
4H swing: 14-21 (smooth trend)
Daily: 18-30 (structural trend)
• By Market:
Crypto (fast moves): 10-14
Stocks (moderate): 14-20
Forex (smooth): 18-25
• Impact: Feeds into gamma calculation (v/c ratio); shorter = more sensitive to velocity spikes → higher gamma
• Relationship: Typically vel_period ≈ base_period / 2 to 2/3
Speed-of-Market (c) (0.5-3.0):
• Function: "Speed limit" for gamma calculation: c = realized_vol + vol_burst × c_multiplier
• By Asset Volatility:
High vol (BTC, TSLA): 1.0-1.3 (lower c = more compression)
Medium vol (SPY, EUR/USD): 1.3-1.6 (balanced)
Low vol (bonds, utilities): 1.6-2.5 (higher c = less compression)
• What It Does:
Lower c → velocity hits "speed limit" sooner → higher gamma → more compression
Higher c → velocity rarely hits limit → gamma stays near 1 → less adaptation
• Effect on Signals: More compression (low c) = faster regime detection, more responsive; Less compression (high c) = smoother, less adaptive
• Tuning: Start at 1.4; if gamma always ~1.0, lower to 1.0-1.2; if gamma spikes >5 often, raise to 1.6-2.0
Gamma Power (0.5-2.0):
• Function: Exponent applied to gamma: final_gamma = gamma^power
• Compression Strength:
0.5-0.8: Softens compression (gamma 4 → 2)
1.0: Linear (gamma 4 → 4)
1.2-2.0: Amplifies compression (gamma 4 → 16)
• Use Cases:
Reduce power (<1.0) if adaptive lengths swing too wildly or getting whipsawed
Increase power (>1.0) for more aggressive regime adaptation in fast markets
• Most users should leave at 1.0; only adjust if gamma behavior needs tuning
Max Kernel Lookback (20-200):
• Function: Computational limit for Lorentzian smoothing (performance control)
• Recommendations:
Fast PC / simple chart: 80-100
Slow PC / complex chart: 40-60
Mobile / lots of indicators: 30-50
• Impact: Each kernel smoothing loops through this many bars; higher = more accurate but slower
• Default 60 balances accuracy and speed; lower to 40-50 if indicator is slow
🎼 HARMONIC FLOW:
Short Horizon (0.2-1.0):
• Function: Fast timeframe multiplier: short_length = base_period × short_ratio / gamma
• Default: 0.5 (captures 2× faster flow than base)
• By Style:
Scalping: 0.3-0.4 (very fast)
Day trading: 0.4-0.6 (moderate)
Swing: 0.5-0.7 (balanced)
• Effect: Lower = more weight on micro-moves; Higher = smooths out fast fluctuations
Mid Horizon (0.5-2.0):
• Function: Medium timeframe multiplier: mid_length = base_period × mid_ratio / gamma
• Default: 1.0 (equals base_period, anchor timeframe)
• Usually keep at 1.0 unless specific strategy needs fine-tuning
Long Horizon (1.0-5.0):
• Function: Slow timeframe multiplier: long_length = base_period × long_ratio / gamma
• Default: 2.5 (captures trend/structure)
• By Style:
Scalping: 1.5-2.0 (less long-term influence)
Day trading: 2.0-3.0 (balanced)
Swing: 2.5-4.0 (strong trend component)
• Effect: Higher = more emphasis on larger structure; Lower = more reactive to recent price action
Short Weight (0-1):
Mid Weight (0-1):
Long Weight (0-1):
• Function: Relative importance in HFL calculation (should sum to 1.0)
• Defaults: Short: 0.45, Mid: 0.35, Long: 0.20 (day trading balanced)
• Preset Configurations:
SCALPING (fast response):
Short: 0.60, Mid: 0.30, Long: 0.10
DAY TRADING (balanced):
Short: 0.45, Mid: 0.35, Long: 0.20
SWING (trend-following):
Short: 0.25, Mid: 0.35, Long: 0.40
• Effect: More short weight = responsive but noisier; More long weight = smoother but laggier
🧠 DUAL MEMORY SYSTEM:
Enable Pattern Memory (true/false):
• Function: Master switch for KNN pattern matching via dual memory
• Enabled (Recommended): Strategy C (Memory Pattern) can fire; memory predictions influence all strategies; prediction arcs shown; heatmaps available
• Disabled: Only Strategy A and B available; faster performance (less computation); pure technical analysis (no pattern matching)
• Keep enabled for full system capabilities; disable only if CPU-constrained or testing pure flow signals
STM Size (50-200):
• Function: Short-Term Memory capacity (recent pattern storage)
• Characteristics: Fast decay (0.980), captures current regime, updates every 10 bars, tactical pattern matching
• Sizing:
Active markets (crypto): 80-120
Moderate (stocks): 100-150
Slow (bonds): 50-100
• By Timeframe:
1-15min: 60-100 (captures few hours of patterns)
1H: 80-120 (captures days)
4H-Daily: 100-150 (captures weeks/months)
• Tradeoff: More = better recent pattern coverage; Less = faster computation
• Default 100 is solid for most use cases
LTM Size (256-1024):
• Function: Long-Term Memory capacity (validated pattern storage)
• Characteristics: Slow decay (0.997), only high-quality patterns (gated), regime-specific recall, strategic pattern library
• Sizing:
Fast PC: 512-768
Medium PC: 384-512
Slow PC/Mobile: 256-384
• By Data Needs:
High-frequency (lots of patterns): 512-1024
Moderate activity: 384-512
Low-frequency (swing): 256-384
• Performance Impact: Each KNN search loops through entire LTM; 512 = good balance of coverage and speed; if slow, drop to 256-384
• Fills over weeks/months with validated patterns
STM Decay (0.95-0.995):
• Function: Short-Term Memory age decay rate: age_weight = decay^bars_since_pattern
• Decay Rates:
0.950: Aggressive fade (50% weight after 14 bars)
0.970: Moderate fade (50% after 23 bars)
0.980: Balanced (50% after 35 bars)
0.990: Slow fade (50% after 69 bars)
• By Timeframe:
1-5min: 0.95-0.97 (fast markets, old patterns irrelevant)
15min-1H: 0.97-0.98 (balanced)
4H-Daily: 0.98-0.99 (slower decay)
• Philosophy: STM should emphasize RECENT patterns; lower decay = only very recent matters; 0.980 works well for most cases
LTM Decay (0.99-0.999):
• Function: Long-Term Memory age decay rate
• Decay Rates:
0.990: 50% weight after 69 bars
0.995: 50% weight after 138 bars
0.997: 50% weight after 231 bars
0.999: 50% weight after 693 bars
• Philosophy: LTM should retain value for LONG periods; pattern from 6 months ago might still matter
• Usage:
Fast-changing markets: 0.990-0.995
Stable markets: 0.995-0.998
Structural patterns: 0.998-0.999
• Warning: Be careful with very high decay (>0.998); market structure changes, old patterns may mislead
• 0.997 balances long-term memory with regime evolution
K Neighbors (3-21):
• Function: Number of similar patterns to query in KNN search
• By Sample Size:
Small dataset (<100 patterns): 3-5
Medium dataset (100-300): 5-8
Large dataset (300-1000): 8-13
Very large (>1000): 13-21
• Tradeoff:
Fewer K (3-5): More reactive to closest matches; noisier; outlier-sensitive; better when patterns very distinct
More K (13-21): Smoother, more stable predictions; may dilute strong signals; better when patterns overlap
• Rule of Thumb: K ≈ √(memory_size) / 3; For STM=100, LTM=512: K ≈ 8-10 ideal
Adaptive Quality Gate (true/false):
• Function: Adapts LTM entry threshold per regime based on Sharpe ratio
• Enabled: Quality gate adapts: Low Sharpe → RAISE gate (demand better patterns); High Sharpe → LOWER gate (accept more patterns); each regime has independent gate
• Disabled: Fixed quality gate (0.4 default) for all regimes
• Recommended: Keep ENABLED; helps LTM focus on proven pattern types per regime; prevents weak patterns from polluting memory
🎯 MULTI-STRATEGY SYSTEM:
Enable Strategy Learning (true/false):
• Function: Core learning feature for regime-specific strategy selection
• Enabled: Tracks 3 strategies × 5 regimes = 15 performance matrices; selects best strategy per regime via Sharpe/Calmar/WinRate; adaptive strategy switching
• Disabled: All strategies fire simultaneously (weighted combination); no regime-specific selection; simpler but less adaptive
• Recommended: ENABLED (this is the core of the adaptive system); disable only for testing or simplification
Strategy A Weight (0-1):
• Function: Weight for Strategy A (Squeeze Breakout) when multi-strategy disabled
• Characteristics: Fires on Bollinger squeeze release; best in Low Vol Range, Transition; compression → expansion pattern
• When Multi-Strategy OFF: Default 0.33 (equal weight); increase to 0.4-0.5 for choppy ranges with breakouts; decrease to 0.2-0.3 for trending markets
• When Multi-Strategy ON: This is ignored (system auto-selects based on performance)
Strategy B Weight (0-1):
• Function: Weight for Strategy B (Lorentzian Flow) when multi-strategy disabled
• Characteristics: Fires on strong HFL + velocity + gamma; best in Trending Bull/Bear; momentum → acceleration pattern
• When Multi-Strategy OFF: Default 0.33; increase to 0.4-0.5 for trending markets; decrease to 0.2-0.3 for choppy/ranging markets
• When Multi-Strategy ON: Ignored (auto-selected)
Strategy C Weight (0-1):
• Function: Weight for Strategy C (Memory Pattern) when multi-strategy disabled
• Characteristics: Fires when dual KNN predicts strong move; best in High Vol Range; requires memory system enabled + sufficient data
• When Multi-Strategy OFF: Default 0.34; increase to 0.4-0.6 if strong pattern repetition and LTM has >200 patterns; decrease to 0.2-0.3 if new to system; set to 0.0 if memory disabled
• When Multi-Strategy ON: Ignored (auto-selected)
📚 PRE-TRAINING:
Historical Pre-Training (true/false):
• Function: Bootstrap feature that fills memory on chart load
• Enabled: Scans past bars to populate STM/LTM before live trading; calculates historical outcomes (10-bar forward returns); builds initial pattern library; system starts with context, not blank slate
• Disabled: Memories only populate in real-time; takes weeks to build pattern library
• Recommended: ENABLED (critical for avoiding "cold start" problem); disable only for testing clean learning
Training Bars (50-500):
• Function: How many historical bars to scan on load (limited by available history)
• Recommendations:
1-5min charts: 200-300 (few hours of history)
15min-1H: 200-400 (days/weeks)
4H: 300-500 (months)
Daily: 200-400 (years)
• Performance:
100 bars: ~1 second
300 bars: ~2-3 seconds
500 bars: ~4-5 seconds
• Sweet Spot: 200-300 (enough patterns without slow load)
• If chart loads slowly: Reduce to 100-150
🎨 VISUALIZATION:
Show Regime Background (true/false):
• Function: Color-code background by current regime
• Colors: Trending Bull (green tint), Trending Bear (red tint), High Vol Range (orange tint), Low Vol Range (blue tint), Transition (purple tint)
• Helps visually track regime changes
Show Flow Bands (true/false):
• Function: Plot upper/lower bands based on HFL strength
• Shows dynamic support/resistance zones; green fill = bullish flow; red fill = bearish flow
• Useful for visual trend confirmation
Show Confidence Meter (true/false):
• Function: Plot signal confidence (0-100) in separate pane
• Calculation: (Signal_Strength / 100) × Regime_Confidence
• Gold line = current confidence; dashed line = minimum threshold
• Signals fire when confidence exceeds threshold
Show Prediction Arc (true/false):
• Function: Dashed line projecting expected price move based on memory prediction
• NOT a price target - a probability vector; steep arc = strong expected move; flat arc = weak/uncertain prediction
• Green = bullish prediction; red = bearish prediction
Show Signals (true/false):
• Function: Triangle markers at entry points
• ▲ Green = Long signal; ▼ Red = Short signal
• Markers show on bar close (non-repainting)
🏆 DASHBOARD:
Show Dashboard (true/false):
• Function: Main info panel showing all system metrics
• Sections: Lorentzian Core, Regime, Dual Memory, Adaptive Parameters, Regime Performance, Shadow Portfolios, Current Signal Status
• Essential for understanding system state
Dashboard Position: Top Left, Top Right, Bottom Left, Bottom Right
Individual Section Toggles:
• System Stats: Lorentzian Core section (Gamma, v/c, HFL, TCI)
• Memory Stats: Dual Memory section (STM/LTM predictions, agreement)
• Shadow Portfolios: Shadow Portfolio table (equity, win%, PF)
• Adaptive Params: Adaptive Parameters section (threshold, quality gate, flow mult)
🔥 HEATMAPS:
Show Dual Heatmaps (true/false):
• Function: Visual pattern density maps for STM and LTM
• Layout: X-axis = pattern age (left=recent, right=old); Y-axis = outcome direction (top=bearish, bottom=bullish); Color intensity = pattern count; Color hue = bullish (green) vs bearish (red)
• Warning: Can clutter chart; disable if not using
Heatmap Position: Screen position for heatmaps (STM at selected position, LTM offset)
Resolution (5-15):
• Function: Grid resolution (bins)
• Higher = more detailed but smaller cells; Lower = clearer but less granular
• 10 is good balance; reduce to 6-8 if hard to read
PART 11: DASHBOARD METRICS EXPLAINED
The comprehensive dashboard provides real-time transparency into every aspect of the adaptive system:
⚡ LORENTZIAN CORE SECTION:
Gamma (γ):
• Range: 1.0 to ~10.0 (capped)
• Interpretation:
γ ≈ 1.0-1.2: Normal market time, low velocity
γ = 1.5-2.5: Moderate compression, trending
γ = 3.0-5.0: High compression, explosive moves
γ > 5.0: Extreme compression, parabolic volatility
• Usage: High gamma = system operating in compressed time; expect shorter effective periods and faster adaptation
v/c (Velocity / Speed Limit):
• Range: 0.0 to 0.999 (approaches but never reaches 1.0)
• Interpretation:
v/c < 0.3: Slow market, low momentum
v/c = 0.4-0.7: Moderate trending
v/c > 0.7: Approaching "speed limit," high velocity
v/c > 0.9: Parabolic move, system at limit
• Color Coding: Red (>0.7), Gold (0.4-0.7), Green (<0.4)
• Usage: High v/c warns of extreme conditions where trend may exhaust
HFL (Harmonic Flow):
• Range: Typically -3.0 to +3.0 (can exceed in extremes)
• Interpretation:
HFL > 0: Bullish flow
HFL < 0: Bearish flow
|HFL| > 0.5: Strong directional bias
|HFL| < 0.2: Weak, indecisive
• Color: Green (positive), Red (negative)
• Usage: Primary directional indicator; strategies often require HFL confirmation
TCI (Temporal Compression Index):
• Calculation: base_period / compressed_length
• Interpretation:
TCI ≈ 1.0: No compression, normal time
TCI = 1.5-2.5: Moderate compression
TCI > 3.0: Significant compression
• Usage: Shows how much time is being compressed; mirrors gamma but more intuitive
╔═══ REGIME SECTION ═══╗
Current:
• Display: Regime name with icon (Trending Bull ↗, Trending Bear ↘, High Vol Range ↔, Low Vol Range —, Transition ⚡)
• Color: Gold for visibility
• Usage: Know which regime you're in; check regime performance to see expected strategy behavior
Confidence:
• Range: 0-100%
• Interpretation:
>70%: Very clear regime definition
40-70%: Moderate clarity
<40%: Ambiguous, mixed conditions
• Color: Green (>70%), Gold (40-70%), Red (<40%)
• Usage: High confidence = trust regime classification; low confidence = regime may be transitioning
Mode:
• States:
🔥 BOOTSTRAP (X/10): Still gathering data for this regime
✅ FAVORABLE: Best strategy has positive risk-adjusted score (>0.5)
⚠️ UNFAVORABLE: All strategies have negative scores (≤0.5)
• Color: Orange (bootstrap), Green (favorable), Red (unfavorable)
• Critical Importance: This tells you whether the system will trade or stand aside (if regime filter enabled)
╔═══ DUAL MEMORY KNN SECTION ═══╗
STM (Size):
• Display: Number of patterns currently in STM (0 to stm_size)
• Interpretation: Should fill to capacity within hours/days; if not filling, check that memory is enabled
STM Pred:
• Range: Typically -0.05 to +0.05 (representing -5% to +5% expected 10-bar move)
• Color: Green (positive), Red (negative)
• Usage: STM's prediction based on recent patterns; emphasis on current regime
LTM (Size):
• Display: Number of patterns in LTM (0 to ltm_size)
• Interpretation: Fills slowly (weeks/months); only validated high-quality patterns; check quality gate if not filling
LTM Pred:
• Range: Similar to STM pred
• Color: Green (positive), Red (negative)
• Usage: LTM's prediction based on long-term validated patterns; more strategic than tactical
Agreement:
• Display:
✅ XX%: Strong agreement (>70%) - both memories aligned
⚠️ XX%: Moderate agreement (40-70%) - some disagreement
❌ XX%: Conflict (<40%) - memories strongly disagree
• Color: Green (>70%), Gold (40-70%), Red (<40%)
• Critical Usage: Low agreement often precedes regime change or signals novel conditions; Strategy C won't fire with low agreement
╔═══ ADAPTIVE PARAMS SECTION ═══╗
Threshold:
• Display: Current regime's signal quality threshold (30-90)
• Interpretation: Higher = pickier; lower = more permissive
• Watch For: If steadily rising in a regime, system is struggling (low win rate); if falling, system is confident
• Default: Starts at base_quality_threshold (usually 60)
Quality:
• Display: Current regime's LTM quality gate (0.2-0.8)
• Interpretation: Minimum quality score for pattern to enter LTM
• Watch For: If rising, system demanding higher-quality patterns; if falling, accepting more diverse patterns
• Default: Starts at 0.4
Flow Mult:
• Display: Current regime's flow multiplier (0.5-2.0)
• Interpretation: Amplifies or dampens HFL for Strategy B
• Watch For: If >1.2, system found strong edge in flow signals; if <0.8, flow signals underperforming
• Default: Starts at 1.0
Learning:
• Display: ✅ ON or ❌ OFF
• Shows whether adaptive learning is enabled
• Color: Green (on), Red (off)
╔═══ REGIME PERFORMANCE SECTION ═══╗
This table shows ONLY the current regime's statistics:
S (Strategy):
• Display: A, B, or C
• Color: Gold if selected strategy; gray if not
• Shows which strategies have data in this regime
Trades:
• Display: Number of completed trades for this pair
• Interpretation: Blank or low numbers mean bootstrap mode; >10 means statistical significance building
Win%:
• Display: Win rate percentage
• Color: Green (>55%), White (45-55%), Red (<45%)
• Interpretation: 52%+ is good; 58%+ is excellent; <45% means struggling
• Note: Short-term variance is normal; judge after 20+ trades
Sharpe:
• Display: Annualized Sharpe ratio
• Color: Green (>1.0), White (0-1.0), Red (<0)
• Interpretation:
>2.0: Exceptional (rare)
1.0-2.0: Good
0.5-1.0: Acceptable
0-0.5: Marginal
<0: Losing
• Usage: Primary metric for strategy selection (60% weight in score)
╔═══ SHADOW PORTFOLIOS SECTION ═══╗
Shows virtual equity tracking across ALL regimes (not just current):
S (Strategy):
• Display: A, B, or C
• Color: Gold if currently selected strategy; gray otherwise
Equity:
• Display: Current virtual balance (starts $10,000)
• Color: Green (>$10,000), White ($9,500-$10,000), Red (<$9,500)
• Interpretation: Which strategy is actually making virtual money across all conditions
• Note: 10% risk per trade assumed
Win%:
• Display: Overall win rate across all regimes
• Color: Green (>55%), White (45-55%), Red (<45%)
• Interpretation: Aggregate performance; strategy may do well in some regimes and poorly in others
PF (Profit Factor):
• Display: Gross profit / gross loss
• Color: Green (>1.5), White (1.0-1.5), Red (<1.0)
• Interpretation:
>2.0: Excellent
1.5-2.0: Good
1.2-1.5: Acceptable
1.0-1.2: Marginal
<1.0: Losing
• Usage: Confirms win rate; high PF with moderate win rate means winners >> losers
╔═══ STATUS BAR ═══╗
Display States:
• 🟢 LONG: Currently in long position (green background)
• 🔴 SHORT: Currently in short position (red background)
• ⬆️ LONG SIGNAL: Long signal present but not yet confirmed (waiting for bar close)
• ⬇️ SHORT SIGNAL: Short signal present but not yet confirmed
• ⚪ NEUTRAL: No position, no signal (white background)
Usage: Immediate visual confirmation of system state; check before manually entering/exiting
PART 12: VISUAL ELEMENT INTERPRETATION
REGIME BACKGROUND COLORS:
Green Tint: Trending Bull regime - expect Strategy B (Flow) to dominate; focus on long momentum
Red Tint: Trending Bear regime - expect Strategy B (Flow) shorts; focus on short momentum
Orange Tint: High Vol Range - expect Strategy A (Squeeze) or C (Memory); trade breakouts or patterns
Blue Tint: Low Vol Range - expect Strategy A (Squeeze); wait for compression release
Purple Tint: Transition regime - often unfavorable; system may stand aside; high uncertainty
Usage: Quick visual regime identification without reading dashboard
FLOW BANDS:
Upper Band: close + HFL × ATR × 1.5
Lower Band: close - HFL × ATR × 1.5
Green Fill: HFL positive (bullish flow); bands act as dynamic support/resistance in uptrend
Red Fill: HFL negative (bearish flow); bands act as dynamic resistance/support in downtrend
Usage:
• Bullish flow: Price bouncing off lower band = trend continuation; breaking below = possible reversal
• Bearish flow: Price rejecting upper band = trend continuation; breaking above = possible reversal
CONFIDENCE METER (Separate Pane):
Gold Line: Current signal confidence (0-100)
Dashed Line: Minimum confidence threshold
Interpretation:
• Line above threshold: Signal likely to fire if strength sufficient
• Line below threshold: Even if signal logic met, won't fire (insufficient confidence)
• Gradual rise: Signal building strength
• Sharp spike: Sudden conviction (check if sustainable)
Usage: Real-time signal probability; helps anticipate upcoming entries
PREDICTION ARC:
Dashed Line: Projects from current close to expected price 8 bars forward
Green Arc: Bullish memory prediction
Red Arc: Bearish memory prediction
Steep Arc: High conviction (strong expected move)
Flat Arc: Low conviction (weak/uncertain move)
Important: NOT a price target; this is a probability vector based on KNN outcomes; actual price may differ
Usage: Directional bias from pattern matching; confirms or contradicts flow signals
SIGNAL MARKERS:
▲ Green Triangle (below bar):
• Long signal confirmed on bar close
• Entry on next bar open
• Non-repainting (appears after bar closes)
▼ Red Triangle (above bar):
• Short signal confirmed on bar close
• Entry on next bar open
• Non-repainting
Size: Tiny (unobtrusive)
Text: "L" or "S" in marker
Usage: Historical signal record; alerts should fire on these; verify against dashboard status
DUAL HEATMAPS (If Enabled):
STM HEATMAP:
• X-axis: Pattern age (left = recent, right = older, typically 0-50 bars)
• Y-axis: Outcome direction (top = bearish outcomes, bottom = bullish outcomes)
• Color Intensity: Brightness = pattern count in that cell
• Color Hue: Green tint (bullish), Red tint (bearish), Gray (neutral)
Interpretation:
• Dense bottom-left: Many recent bullish patterns (bullish regime)
• Dense top-left: Many recent bearish patterns (bearish regime)
• Scattered: Mixed outcomes, ranging regime
• Empty areas: Few patterns (low data)
LTM HEATMAP:
• Similar layout but X-axis spans wider age range (0-500+ bars)
• Shows long-term pattern distribution
• Denser = more validated patterns
Comparison Usage:
• If STM and LTM heatmaps look similar: Current regime matches historical patterns (high agreement)
• If STM bottom-heavy but LTM top-heavy: Recent bullish activity contradicts historical bearish patterns (low agreement, transition signal)
PART 13: DEVELOPMENT STORY
The creation of the Lorentzian Harmonic Flow Adaptive ML system represents over six months of intensive research, mathematical exploration, and iterative refinement. What began as a theoretical investigation into applying special relativity to market time evolved into a complete adaptive learning framework.
THE CHALLENGE:
The fundamental problem was this: markets don't experience time uniformly, yet every indicator treats a 50-period calculation the same whether markets are exploding or sleeping. Traditional adaptive indicators adjust parameters based on volatility, but this is reactive—by the time you measure high volatility, the explosive move is over. What was needed was a framework that measured the market's intrinsic velocity relative to its own structural limits, then compressed time itself proportionally.
THE LORENTZIAN INSIGHT:
Einstein's special relativity provides exactly this framework through the Lorentz factor. When an object approaches the speed of light, time dilates—but from the object's reference frame, it experiences time compression. By treating price velocity as analogous to relativistic velocity and volatility structure as the "speed limit," we could calculate a gamma factor that compressed lookback periods during explosive moves.
The mathematics were straightforward in theory but devilishly complex in implementation. Pine Script has no native support for dynamically-sized arrays or recursive functions, forcing creative workarounds. The Lorentzian kernel smoothing required nested loops through historical bars, calculating kernel weights on the fly—a computational nightmare. Early versions crashed or produced bizarre artifacts (negative gamma values, infinite loops during volatility spikes).
Optimization took weeks. Limiting kernel lookback to 60 bars while still maintaining smoothing quality. Pre-calculating gamma once per bar and reusing it across all calculations. Caching intermediate results. The final implementation balances mathematical purity with computational reality.
THE MEMORY ARCHITECTURE:
With temporal compression working, the next challenge was pattern memory. Simple moving average systems have no memory—they forget yesterday's patterns immediately. But markets are non-stationary; what worked last month may not work today. The solution: dual-memory architecture inspired by cognitive neuroscience.
Short-Term Memory (STM) would capture tactical patterns—the hippocampus of the system. Fast encoding, fast decay, always current. Long-Term Memory (LTM) would store validated strategic patterns—the neocortex. Slow consolidation, persistent storage, regime-spanning wisdom.
The KNN implementation nearly broke me. Calculating Lorentzian distance across 6 dimensions for 500+ patterns per query, applying age decay, filtering by regime, finding K nearest neighbors without native sorting functions—all while maintaining sub-second execution. The breakthrough came from realizing we could use destructive sorting (marking found neighbors as "infinite distance") rather than maintaining separate data structures.
Pre-training was another beast. To populate memory with historical patterns, the system needed to scan hundreds of past bars, calculate forward outcomes, and insert patterns—all on chart load without timing out. The solution: cap at 200 bars, optimize loops, pre-calculate features. Now it works seamlessly.
THE REGIME DETECTION:
Five-regime classification emerged from empirical observation. Traditional trending/ranging dichotomy missed too much nuance. Markets have at least four distinct states: trending up, trending down, volatile range, quiet range—plus a chaotic transition state. Linear regression slope quantifies trend; volatility ratio quantifies expansion; combining them creates five natural clusters.
But classification is useless without regime-specific learning. That meant tracking 15 separate performance matrices (3 strategies × 5 regimes), computing Sharpe ratios and Calmar ratios for sparse data, implementing Bayesian-like strategy selection. The bootstrap mode logic alone took dozens of iterations—too strict and you never get data, too permissive and you blow up accounts during learning.
THE ADAPTIVE LAYER:
Parameter adaptation was conceptually elegant but practically treacherous. Each regime needed independent thresholds, quality gates, and multipliers that adapted based on outcomes. But naive gradient descent caused oscillations—win a few trades, lower threshold, take worse signals, lose trades, raise threshold, miss good signals. The solution: exponential smoothing via learning rate (α) and separate scoring for selection vs adaptation.
Shadow portfolios provided objective validation. By running virtual accounts for all strategies simultaneously, we could see which would have won even when not selected. This caught numerous bugs where selection logic was sound but execution was flawed, or vice versa.
THE DASHBOARD & VISUALIZATION:
A learning system is useless if users can't understand what it's doing. The dashboard went through five complete redesigns. Early versions were information dumps—too much data, no hierarchy, impossible to scan. The final version uses visual hierarchy (section headers, color coding, strategic whitespace) and progressive disclosure (show current regime first, then performance, then parameters).
The dual heatmaps were a late addition but proved invaluable for pattern visualization. Seeing STM cluster in one corner while LTM distributed broadly immediately signals regime novelty. Traders grasp this visually faster than reading disagreement percentages.
THE TESTING GAUNTLET:
Testing adaptive systems is uniquely challenging. Static backtest results mean nothing—the system should improve over time. Early "tests" showed abysmal performance because bootstrap periods were included. The breakthrough: measure pre-learning baseline vs post-learning performance. A system going from 48% win rate (first 50 trades) to 56% win rate (trades 100-200) is succeeding even if absolute performance seems modest.
Edge cases broke everything repeatedly. What happens when a regime never appears in historical data? When all strategies fail simultaneously? When memory fills with only bearish patterns during a bull run? Each required careful handling—bootstrap modes, forced diversification, quality gates.
THE DOCUMENTATION:
This isn't an indicator you throw on a chart with default settings and trade immediately. It's a learning system that requires understanding. The input tooltips alone contain over 10,000 words of guidance—market-specific recommendations, timeframe-specific settings, tradeoff explanations. Every parameter needed not just a description but a philosophical justification and practical tuning guide.
The code comments span 500+ lines explaining theory, implementation decisions, edge cases. Future maintainers (including myself in six months) need to understand not just what the code does but why certain approaches were chosen over alternatives.
WHAT ALMOST DIDN'T WORK:
The entire project nearly collapsed twice. First, when initial Lorentzian smoothing produced complete noise—hours of debugging revealed a simple indexing error where I was accessing instead of in the kernel loop. One character, entire system broken.
Second, when memory predictions showed zero correlation with outcomes. Turned out the KNN distance metric was dominated by the gamma dimension (values 1-10) drowning out normalized features (values -1 to 1). Solution: apply kernel transformation to all dimensions, not just final distance. Obvious in retrospect, maddening at the time.
THE PHILOSOPHY:
This system embodies a specific philosophy: markets are learnable but non-stationary. No single strategy works forever, but regime-specific patterns persist. Time isn't uniform, memory isn't perfect, prediction isn't possible—but probabilistic edges exist for those willing to track them rigorously.
It rejects the premise that indicators should give universal advice. Instead, it says: "In this regime, based on similar past states, Strategy B has a 58% win rate and 1.4 Sharpe. Strategy A has 45% and 0.2 Sharpe. I recommend B. But we're still in bootstrap for Strategy C, so I'm gathering data. Check back in 5 trades."
That humility—knowing what it knows and what it doesn't—is what makes it robust.
PART 14: PROFESSIONAL USAGE PROTOCOL
PHASE 1: DEPLOYMENT (Week 1-4)
Initial Setup:
1. Load indicator on primary trading chart with default settings
2. Verify historical pre-training enabled (should see ~200 patterns in STM/LTM on first load)
3. Enable all dashboard sections for maximum transparency
4. Set alerts but DO NOT trade real money
Observation Checklist:
• Dashboard Validation:
✓ Lorentzian Core shows reasonable gamma (1-5 range, not stuck at 1.0 or spiking to 10)
✓ HFL oscillates with price action (not flat or random)
✓ Regime classifications make intuitive sense
✓ Confidence scores vary appropriately
• Memory System:
✓ STM fills within first few hours/days of real-time bars
✓ LTM grows gradually (few patterns per day, quality-gated)
✓ Predictions show directional bias (not always 0.0)
✓ Agreement metric fluctuates with regime changes
• Bootstrap Tracking:
✓ Dashboard shows "🔥 BOOTSTRAP (X/10)" for each regime
✓ Trade counts increment on regime-specific signals
✓ Different regimes reach threshold at different rates
Paper Trading:
• Take EVERY signal (ignore unfavorable warnings during bootstrap)
• Log each trade: entry price, regime, selected strategy, outcome
• Calculate your actual P&L assuming proper risk management (1-2% risk per trade)
• Do NOT judge system performance yet—focus on understanding behavior
Troubleshooting:
• No signals for days:
- Check base_quality_threshold (try lowering to 50-55)
- Verify enable_regime_filter not blocking all regimes
- Confirm signal confidence threshold not too high (try 0.25)
• Signals every bar:
- Raise base_quality_threshold to 65-70
- Increase min_bars_between to 8-10
- Check if gamma spiking excessively (raise c_multiplier)
• Memory not filling:
- Confirm enable_memory = true
- Verify historical pre-training completed (check STM size after load)
- May need to wait 10 bars for first real-time update
PHASE 2: VALIDATION (Week 5-12)
Statistical Emergence:
By week 5-8, most regimes should exit bootstrap. Look for:
✓ Regime Performance Clarity:
- At least 2-3 strategies showing positive Sharpe in their favored regimes
- Clear separation (Strategy B strong in Trending, Strategy A strong in Low Vol Range, etc.)
- Win rates stabilizing around 50-60% for winning strategies
✓ Shadow Portfolio Divergence:
- Virtual portfolios showing clear winners ($10K → $11K+) and losers ($10K → $9K-)
- Profit factors >1.3 for top strategy
- System selection aligning with best shadow portfolio
✓ Parameter Adaptation:
- Thresholds varying per regime (not stuck at initial values)
- Quality gates adapting (some regimes higher, some lower)
- Flow multipliers showing regime-specific optimization
Validation Questions:
1. Do patterns make intuitive sense?
- Strategy B (Flow) dominating Trending Bull/Bear? ✓ Expected
- Strategy A (Squeeze) succeeding in Low Vol Range? ✓ Expected
- Strategy C (Memory) working in High Vol Range? ✓ Expected
- Random strategy winning everywhere? ✗ Problem
2. Is unfavorable filtering working?
- Regimes with negative Sharpe showing "⚠️ UNFAVORABLE"? ✓ System protecting capital
- Transition regime often unfavorable? ✓ Expected
- All regimes perpetually unfavorable? ✗ Settings too strict or asset unsuitable
3. Are memories agreeing appropriately?
- High agreement during stable regimes? ✓ Expected
- Low agreement during transitions? ✓ Expected (novel conditions)
- Perpetual conflict? ✗ Check memory sizes or decay rates
Fine-Tuning (If Needed):
Too Many Signals in Losing Regimes:
→ Increase learning_rate to 0.07-0.08 (faster adaptation)
→ Raise base_quality_threshold by 5-10 points
→ Enable regime filter if disabled
Missing Profitable Setups:
→ Lower base_quality_threshold by 5-10 points
→ Reduce min_confidence to 0.25-0.30
→ Check if bootstrap mode blocking trades (let it complete)
Excessive Parameter Swings:
→ Reduce learning_rate to 0.03-0.04
→ Increase min_regime_samples to 15-20 (more data before adaptation)
Memory Disagreement Too Frequent:
→ Increase LTM size to 768-1024 (broader pattern library)
→ Lower adaptive_quality_gate requirement (allow more patterns)
→ Increase K neighbors to 10-12 (smoother predictions)
PHASE 3: LIVE TRADING (Month 4+)
Pre-Launch Checklist:
1. ✓ At least 3 regimes show positive Sharpe (>0.8)
2. ✓ Top shadow portfolio shows >53% win rate and >1.3 profit factor
3. ✓ Parameters have stabilized (not changing more than 10% per month)
4. ✓ You understand every dashboard metric and can explain regime/strategy behavior
5. ✓ You have proper risk management plan independent of this system
Position Sizing:
Conservative (Recommended for Month 4-6):
• Risk per trade: 0.5-1.0% of account
• Max concurrent positions: 1-2
• Total exposure: 10-25% of intended full size
Moderate (Month 7-12):
• Risk per trade: 1.0-1.5% of account
• Max concurrent positions: 2-3
• Total exposure: 25-50% of intended size
Full Scale (Year 2+):
• Risk per trade: 1.5-2.0% of account
• Max concurrent positions: 3-5
• Total exposure: 100% (still following risk limits)
Entry Execution:
On Signal Confirmation:
1. Verify dashboard shows signal type (▲ LONG or ▼ SHORT)
2. Check regime mode (avoid if "⚠️ UNFAVORABLE" unless testing)
3. Note selected strategy (A/B/C) and its regime Sharpe
4. Verify memory agreement if Strategy C selected (want >60%)
Entry Method:
• Market entry: Next bar open after signal (for exact backtest replication)
• Limit entry: Slight improvement (2-3 ticks) if confident in direction
Stop Loss Placement:
• Strategy A (Squeeze): Beyond opposite band or recent swing point
• Strategy B (Flow): 1.5-2.0 ATR from entry against direction
• Strategy C (Memory): Based on predicted move magnitude (tighter if pred > 2%)
Exit Management:
System Exit Signals:
• Opposite signal fires: Immediate exit, potential reversal entry
• 20 bars no exit signal: System implies position stale, consider exiting
• Regime changes to unfavorable: Tighten stop, consider partial exit
Manual Exit Conditions:
• Stop loss hit: Take loss, log for validation (system expects some losses)
• Profit target hit: If using fixed targets (2-3R typical)
• Major news event: Flatten during high-impact news (system can't predict these)
Warning Signs (Exit Criteria):
🚨 Stop Trading If:
1. All regimes show negative Sharpe for 4+ weeks (market structure changed)
2. Your results >20% worse than shadow portfolios (execution problem)
3. Parameters hitting extremes (thresholds >85 or <35 across all regimes)
4. Memory agreement <30% for extended periods (unprecedented conditions)
5. Account drawdown >20% (risk management failure, system or otherwise)
⚠️ Reduce Size If:
1. Win rate drops 10%+ from peak (temporary regime shift)
2. Selected strategy underperforming another by >30% (selection lag)
3. Consecutive losses >5 (variance or problem, reduce until clarity)
4. Major market regime change (Fed policy shift, war, etc. - let system re-adapt)
PART 15: THEORETICAL IMPLICATIONS & LIMITATIONS
WHAT THIS SYSTEM REPRESENTS:
Contextual Bandits:
The regime-specific strategy selection implements a contextual multi-armed bandit problem. Each strategy is an "arm," each regime is a "context," and we select arms to maximize expected reward given context. This is reinforcement learning applied to trading.
Experience Replay:
The dual-memory architecture mirrors DeepMind's DQN breakthrough. STM = recent experience buffer; LTM = validated experience replay. This prevents catastrophic forgetting while enabling rapid adaptation—a key challenge in neural network training.
Meta-Learning:
The system learns how to learn. Parameter adaptation adjusts the system's own sensitivity and selectivity based on outcomes. This is "learning to learn"—optimizing the optimization process itself.
Non-Stationary Optimization:
Traditional backtesting assumes stationarity (past patterns persist). This system assumes non-stationarity and continuously adapts. The goal isn't finding "the best parameters" but tracking the moving optimum.
Regime-Conditional Policies:
Rather than a single strategy for all conditions, this implements regime-specific policies. This is contextual decision-making—environment state determines action selection.
FINAL WISDOM:
"The market is a complex adaptive system. To trade it successfully, one must also adapt. This indicator provides the framework—memory, learning, regime awareness—but wisdom comes from understanding when to trade, when to stand aside, and when to defer to conditions the system hasn't yet learned. The edge isn't in the algorithm alone; it's in the partnership between mathematical rigor and human judgment."
— Inspired by the intersection of Einstein's relativity, Kahneman's behavioral economics, and decades of quantitative trading research
Taking you to school. — Dskyz, Trade with insight. Trade with anticipation.
Search in scripts for "profitable"
PnL Bubble [%] | Fractalyst1. What's the indicator purpose?
The PnL Bubble indicator transforms your strategy's trade PnL percentages into an interactive bubble chart with professional-grade statistics and performance analytics. It helps traders quickly assess system profitability, understand win/loss distribution patterns, identify outliers, and make data-driven strategy improvements.
How does it work?
Think of this indicator as a visual report card for your trading performance. Here's what it does:
What You See
Colorful Bubbles: Each bubble represents one of your trades
Blue/Cyan bubbles = Winning trades (you made money)
Red bubbles = Losing trades (you lost money)
Bigger bubbles = Bigger wins or losses
Smaller bubbles = Smaller wins or losses
How It Organizes Your Trades:
Like a Photo Album: Instead of showing all your trades at once (which would be messy), it shows them in "pages" of 500 trades each:
Page 1: Your first 500 trades
Page 2: Trades 501-1000
Page 3: Trades 1001-1500, etc.
What the Numbers Tell You:
Average Win: How much money you typically make on winning trades
Average Loss: How much money you typically lose on losing trades
Expected Value (EV): Whether your trading system makes money over time
Positive EV = Your system is profitable long-term
Negative EV = Your system loses money long-term
Payoff Ratio (R): How your average win compares to your average loss
R > 1 = Your wins are bigger than your losses
R < 1 = Your losses are bigger than your wins
Why This Matters:
At a Glance: You can instantly see if you're a profitable trader or not
Pattern Recognition: Spot if you have more big wins than big losses
Performance Tracking: Watch how your trading improves over time
Realistic Expectations: Understand what "average" performance looks like for your system
The Cool Visual Effects:
Animation: The bubbles glow and shimmer to make the chart more engaging
Highlighting: Your biggest wins and losses get extra attention with special effects
Tooltips: hover any bubble to see details about that specific trade.
What are the underlying calculations?
The indicator processes trade PnL data using a dual-matrix architecture for optimal performance:
Dual-Matrix System:
• Display Matrix (display_matrix): Bounded to 500 trades for rendering performance
• Statistics Matrix (stats_matrix): Unbounded storage for complete statistical accuracy
Trade Classification & Aggregation:
// Separate wins, losses, and break-even trades
if val > 0.0
pos_sum += val // Sum winning trades
pos_count += 1 // Count winning trades
else if val < 0.0
neg_sum += val // Sum losing trades
neg_count += 1 // Count losing trades
else
zero_count += 1 // Count break-even trades
Statistical Averages:
avg_win = pos_count > 0 ? pos_sum / pos_count : na
avg_loss = neg_count > 0 ? math.abs(neg_sum) / neg_count : na
Win/Loss Rates:
total_obs = pos_count + neg_count + zero_count
win_rate = pos_count / total_obs
loss_rate = neg_count / total_obs
Expected Value (EV):
ev_value = (avg_win × win_rate) - (avg_loss × loss_rate)
Payoff Ratio (R):
R = avg_win ÷ |avg_loss|
Contribution Analysis:
ev_pos_contrib = avg_win × win_rate // Positive EV contribution
ev_neg_contrib = avg_loss × loss_rate // Negative EV contribution
How to integrate with any trading strategy?
Equity Change Tracking Method:
//@version=6
strategy("Your Strategy with Equity Change Export", overlay=true)
float prev_trade_equity = na
float equity_change_pct = na
if barstate.isconfirmed and na(prev_trade_equity)
prev_trade_equity := strategy.equity
trade_just_closed = strategy.closedtrades != strategy.closedtrades
if trade_just_closed and not na(prev_trade_equity)
current_equity = strategy.equity
equity_change_pct := ((current_equity - prev_trade_equity) / prev_trade_equity) * 100
prev_trade_equity := current_equity
else
equity_change_pct := na
plot(equity_change_pct, "Equity Change %", display=display.data_window)
Integration Steps:
1. Add equity tracking code to your strategy
2. Load both strategy and PnL Bubble indicator on the same chart
3. In bubble indicator settings, select your strategy's equity tracking output as data source
4. Configure visualization preferences (colors, effects, page navigation)
How does the pagination system work?
The indicator uses an intelligent pagination system to handle large trade datasets efficiently:
Page Organization:
• Page 1: Trades 1-500 (most recent)
• Page 2: Trades 501-1000
• Page 3: Trades 1001-1500
• Page N: Trades to
Example: With 1,500 trades total (3 pages available):
• User selects Page 1: Shows trades 1-500
• User selects Page 4: Automatically falls back to Page 3 (trades 1001-1500)
5. Understanding the Visual Elements
Bubble Visualization:
• Color Coding: Cyan/blue gradients for wins, red gradients for losses
• Size Mapping: Bubble size proportional to trade magnitude (larger = bigger P&L)
• Priority Rendering: Largest trades displayed first to ensure visibility
• Gradient Effects: Color intensity increases with trade magnitude within each category
Interactive Tooltips:
Each bubble displays quantitative trade information:
tooltip_text = outcome + " | PnL: " + pnl_str +
"\nDate: " + date_str + " " + time_str +
"\nTrade #" + str.tostring(trade_number) + " (Page " + str.tostring(active_page) + ")" +
"\nRank: " + str.tostring(rank) + " of " + str.tostring(n_display_rows) +
"\nPercentile: " + str.tostring(percentile, "#.#") + "%" +
"\nMagnitude: " + str.tostring(magnitude_pct, "#.#") + "%"
Example Tooltip:
Win | PnL: +2.45%
Date: 2024.03.15 14:30
Trade #1,247 (Page 3)
Rank: 5 of 347
Percentile: 98.6%
Magnitude: 85.2%
Reference Lines & Statistics:
• Average Win Line: Horizontal reference showing typical winning trade size
• Average Loss Line: Horizontal reference showing typical losing trade size
• Zero Line: Threshold separating wins from losses
• Statistical Labels: EV, R-Ratio, and contribution analysis displayed on chart
What do the statistical metrics mean?
Expected Value (EV):
Represents the mathematical expectation per trade in percentage terms
EV = (Average Win × Win Rate) - (Average Loss × Loss Rate)
Interpretation:
• EV > 0: Profitable system with positive mathematical expectation
• EV = 0: Break-even system, profitability depends on execution
• EV < 0: Unprofitable system with negative mathematical expectation
Example: EV = +0.34% means you expect +0.34% profit per trade on average
Payoff Ratio (R):
Quantifies the risk-reward relationship of your trading system
R = Average Win ÷ |Average Loss|
Interpretation:
• R > 1.0: Wins are larger than losses on average (favorable risk-reward)
• R = 1.0: Wins and losses are equal in magnitude
• R < 1.0: Losses are larger than wins on average (unfavorable risk-reward)
Example: R = 1.5 means your average win is 50% larger than your average loss
Contribution Analysis (Σ):
Breaks down the components of expected value
Positive Contribution (Σ+) = Average Win × Win Rate
Negative Contribution (Σ-) = Average Loss × Loss Rate
Purpose:
• Shows how much wins contribute to overall expectancy
• Shows how much losses detract from overall expectancy
• Net EV = Σ+ - Σ- (Expected Value per trade)
Example: Σ+: 1.23% means wins contribute +1.23% to expectancy
Example: Σ-: -0.89% means losses drag expectancy by -0.89%
Win/Loss Rates:
Win Rate = Count(Wins) ÷ Total Trades
Loss Rate = Count(Losses) ÷ Total Trades
Shows the probability of winning vs losing trades
Higher win rates don't guarantee profitability if average losses exceed average wins
7. Demo Mode & Synthetic Data Generation
When using built-in sources (close, open, etc.), the indicator generates realistic demo trades for testing:
if isBuiltInSource(source_data)
// Generate random trade outcomes with realistic distribution
u_sign = prand(float(time), float(bar_index))
if u_sign < 0.5
v_push := -1.0 // Loss trade
else
// Skewed distribution favoring smaller wins (realistic)
u_mag = prand(float(time) + 9876.543, float(bar_index) + 321.0)
k = 8.0 // Skewness factor
t = math.pow(u_mag, k)
v_push := 2.5 + t * 8.0 // Win trade
Demo Characteristics:
• Realistic win/loss distribution mimicking actual trading patterns
• Skewed distribution favoring smaller wins over large wins
• Deterministic randomness for consistent demo results
• Includes jitter effects to prevent visual overlap
8. Performance Limitations & Optimizations
Display Constraints:
points_count = 500 // Maximum 500 dots per page for optimal performance
Pine Script v6 Limits:
• Label Count: Maximum 500 labels per indicator
• Line Count: Maximum 100 lines per indicator
• Box Count: Maximum 50 boxes per indicator
• Matrix Size: Efficient memory management with dual-matrix system
Optimization Strategies:
• Pagination System: Handle unlimited trades through 500-trade pages
• Priority Rendering: Largest trades displayed first for maximum visibility
• Dual-Matrix Architecture: Separate display (bounded) from statistics (unbounded)
• Smart Fallback: Automatic page clamping prevents empty displays
Impact & Workarounds:
• Visual Limitation: Only 500 trades visible per page
• Statistical Accuracy: Complete dataset used for all calculations
• Navigation: Use page input to browse through entire trade history
• Performance: Smooth operation even with thousands of trades
9. Statistical Accuracy Guarantees
Data Integrity:
• Complete Dataset: Statistics matrix stores ALL trades without limit
• Proper Aggregation: Separate tracking of wins, losses, and break-even trades
• Mathematical Precision: Pine Script v6's enhanced floating-point calculations
• Dual-Matrix System: Display limitations don't affect statistical accuracy
Calculation Validation:
// Verified formulas match standard trading mathematics
avg_win = pos_sum / pos_count // Standard average calculation
win_rate = pos_count / total_obs // Standard probability calculation
ev_value = (avg_win * win_rate) - (avg_loss * loss_rate) // Standard EV formula
Accuracy Features:
• Mathematical Correctness: Formulas follow established trading statistics
• Data Preservation: Complete dataset maintained for all calculations
• Precision Handling: Proper rounding and boundary condition management
• Real-Time Updates: Statistics recalculated on every new trade
10. Advanced Technical Features
Real-Time Animation Engine:
// Shimmer effects with sine wave modulation
offset = math.sin(shimmer_t + phase) * amp
// Dynamic transparency with organic flicker
new_transp = math.min(flicker_limit, math.max(-flicker_limit, cur_transp + dir * flicker_step))
• Sine Wave Shimmer: Dynamic glowing effects on bubbles
• Organic Flicker: Random transparency variations for natural feel
• Extreme Value Highlighting: Special visual treatment for outliers
• Smooth Animations: Tick-based updates for fluid motion
Magnitude-Based Priority Rendering:
// Sort trades by magnitude for optimal visual hierarchy
sort_indices_by_magnitude(values_mat)
• Largest First: Most important trades always visible
• Intelligent Sorting: Custom bubble sort algorithm for trade prioritization
• Performance Optimized: Efficient sorting for real-time updates
• Visual Hierarchy: Ensures critical trades never get hidden
Professional Tooltip System:
• Quantitative Data: Pure numerical information without interpretative language
• Contextual Ranking: Shows trade position within page dataset
• Percentile Analysis: Performance ranking as percentage
• Magnitude Scaling: Relative size compared to page maximum
• Professional Format: Clean, data-focused presentation
11. Quick Start Guide
Step 1: Add Indicator
• Search for "PnL Bubble | Fractalyst" in TradingView indicators
• Add to your chart (works on any timeframe)
Step 2: Configure Data Source
• Demo Mode: Leave source as "close" to see synthetic trading data
• Strategy Mode: Select your strategy's PnL% output as data source
Step 3: Customize Visualization
• Colors: Set positive (cyan), negative (red), and neutral colors
• Page Navigation: Use "Trade Page" input to browse trade history
• Visual Effects: Built-in shimmer and animation effects are enabled by default
Step 4: Analyze Performance
• Study bubble patterns for win/loss distribution
• Review statistical metrics: EV, R-Ratio, Win Rate
• Use tooltips for detailed trade analysis
• Navigate pages to explore full trade history
Step 5: Optimize Strategy
• Identify outlier trades (largest bubbles)
• Analyze risk-reward profile through R-Ratio
• Monitor Expected Value for system profitability
• Use contribution analysis to understand win/loss impact
12. Why Choose PnL Bubble Indicator?
Unique Advantages:
• Advanced Pagination: Handle unlimited trades with smart fallback system
• Dual-Matrix Architecture: Perfect balance of performance and accuracy
• Professional Statistics: Institution-grade metrics with complete data integrity
• Real-Time Animation: Dynamic visual effects for engaging analysis
• Quantitative Tooltips: Pure numerical data without subjective interpretations
• Priority Rendering: Intelligent magnitude-based display ensures critical trades are always visible
Technical Excellence:
• Built with Pine Script v6 for maximum performance and modern features
• Optimized algorithms for smooth operation with large datasets
• Complete statistical accuracy despite display optimizations
• Professional-grade calculations matching institutional trading analytics
Practical Benefits:
• Instantly identify system profitability through visual patterns
• Spot outlier trades and risk management issues
• Understand true risk-reward profile of your strategies
• Make data-driven decisions for strategy optimization
• Professional presentation suitable for performance reporting
Disclaimer & Risk Considerations:
Important: Historical performance metrics, including positive Expected Value (EV), do not guarantee future trading success. Statistical measures are derived from finite sample data and subject to inherent limitations:
• Sample Bias: Historical data may not represent future market conditions or regime changes
• Ergodicity Assumption: Markets are non-stationary; past statistical relationships may break down
• Survivorship Bias: Strategies showing positive historical EV may fail during different market cycles
• Parameter Instability: Optimal parameters identified in backtesting often degrade in forward testing
• Transaction Cost Evolution: Slippage, spreads, and commission structures change over time
• Behavioral Factors: Live trading introduces psychological elements absent in backtesting
• Black Swan Events: Extreme market events can invalidate statistical assumptions instantaneously
Autoback Grid Lab [trade_lexx]Autoback Grid Lab: Your personal laboratory for optimizing grid strategies.
Introduction
First of all, it is important to understand that Autoback Grid Lab is a powerful professional tool for backtesting and optimization, created specifically for traders using both grid strategies and regular take profit with stop loss.
The main purpose of this script is to save you weeks and months of manual testing and parameter selection. Instead of manually testing one combination of settings after another, Autoback Grid Lab automatically tests thousands of unique strategies on historical data, providing you with a comprehensive report on the most profitable and, more importantly, sustainable ones.
If you want to find mathematically sound, most effective settings for your grid strategy on a specific asset and timeframe, then this tool was created for you.
Key Features
My tool has functionality that transforms the process of finding the perfect strategy from a routine into an exciting exploration.
🧪 Mass testing of thousands of combinations
The script is able to systematically generate and run a huge number of unique combinations of parameters through the built-in simulator. You set the ranges, and the indicator does all the work, testing all possible options for the following grid settings:
* Number of safety orders (SO Count)
* Grid step (SO Step)
* Step Multiplier (SO Multiplier) for building nonlinear grids
* Martingale for controlling the volume of subsequent orders
* Take Profit (%)
* Stop Loss (%), with the possibility of calculating both from the entry point and from the dynamic breakeven line
* The volume of the base order (Volume BO) as a percentage of the deposit
🏆 Unique `FinalScore` rating system
Sorting strategies by net profit alone is a direct path to self—deception and choosing strategies that are "tailored" to history and will inevitably fail in real trading. To solve this problem, we have developed FinalScore, a comprehensive assessment of the sustainability and quality of the strategy.
How does it work?
FinalScore analyzes each combination not one by one, but by nine key performance metrics at once, including Net Profit, Drawdown, Profit Factor, WinRate, Sharpe coefficients, Sortino, Squid and Omega. Each of these indicators is normalized, that is, reduced to a single scale. Then, to test the strategy for strength, the system performs 30 iterations, each time assigning random weights to these 9 metrics. A strategy gets a high FinalScore only if it shows consistently high results under different evaluation criteria. This proves her reliability and reduces the likelihood that her success was an accident.
📈 Realistic backtesting engine
The test results are meaningless if they do not take into account the actual trading conditions. Our simulator simulates real trading as accurately as possible, taking into account:
* Leverage: Calculation of the required margin to open and hold positions.
* Commission: A percentage commission is charged each time an order is opened and closed.
* Slippage: The order execution price is adjusted by a set percentage to simulate real market conditions.
* Liquidation model: This is one of the most important functions. The script continuously monitors the equity of the account (capital + unrealized P&L). If equity falls below the level of the supporting margin (calculated from the current value of the position), the simulator forcibly closes the position, as it would happen on a real exchange. This eliminates unrealistic scenarios where the strategy survives after a huge drawdown.
🔌 Integration with external signals
The indicator operates in two modes:
1. `No Signal': Standard mode. The trading cycle starts immediately as soon as the previous one has been closed. Ideal for testing the "pure" mechanics of the grid.
2. `External Signal`: In this mode, a new trading cycle will start only when a signal is received from an external source. You can connect any other indicator (such as the RSI, MACD, or your own strategy) to the script and use it as a trigger to log in. This allows you to combine the power of a grid strategy with your own entry points.
📊 Interactive and informative results panel
Upon completion of the calculations, a detailed table with the TOP N best strategies appears on the screen, sorted according to your chosen criterion. For each strategy in the rating, you will see not only the key metrics (Profit, Drawdown, duration of transactions), but also all the parameters that led to this result. You can immediately take these settings and apply them in your trading.
Application Options: How To Solve Your Problems
Autoback Grid Lab is a flexible tool that can be adapted to solve various tasks, from complete grid optimization to fine—tuning existing strategies. Here are some key scenarios for its use:
1. Complete Optimization Of The Grid Strategy
This is the basic and most powerful mode of use. You can find the most efficient grid configuration for any asset from scratch.
* How to use: Set wide ranges for all key grid parameters ('SO Count`, SO Step, SO Multiplier, Martingale, TP, etc.).
* In the `No Signal` mode: You will find the most stable grid configuration that works as an independent, constantly active strategy, regardless of which-or entrance indicators.
* In the `External Signal` mode: You can connect your favorite indicator for input (for example, RSI, MACD or a complex author's script) and find the optimal grid parameters that best complement your input signals. This allows you to turn a simple signaling strategy into a full-fledged grid system.
2. Selecting the Optimal Take Profit and Stop Loss for Your Strategy
Do you already have an entry strategy, but you are not sure where it is best to put Take Profit and Stop Loss? Autoback Grid Lab can solve this problem as well.
* How to use:
1. Disable optimization of all grid parameters (uncheck SO Count, SO Step, Martingale, etc.). Set the Min value for SO Count to 0.
2. Set the ranges for iteration only for 'Take Profit` and `Stop Loss'.
3. Turn on the External Signal mode and connect your indicator with input signals.
* Result: The script will run your historical entry signals with hundreds of different TP and SL combinations and show you which stop order levels bring maximum profit with minimal risk specifically for your entry points.
3. Building a Secure Network with Risk Management
Many traders are afraid of grid strategies because of the risk of large drawdowns. With the help of the optimizer, you can purposefully find the parameters for such a grid, which includes mandatory risk management through Stop Loss.
* How to use: Enable and set the range for Stop Loss, along with other grid parameters. Don't forget to test both types of SL calculations (`From entry point` and `From breakeven line`) to determine which one works more efficiently.
* Result: You will find balanced strategies in which the grid parameters (number of orders, martingale) and the Stop Loss level are selected in such a way as to maximize profits without going beyond the acceptable risk level for you.
How To Use The Indicator (Step-By-Step Guide)
Working with the Autoback Grid Lab is a sequential process consisting of four main steps: from initial setup to analysis of the finished results. Follow this guide to get the most out of the tool.
Step 1: Initial Setup
1. Add the indicator to the chart of your chosen asset and timeframe.
2. Open the script settings. The first thing you should pay attention to is the ⚙️ Optimization Settings ⚙️ group.
3. Set the `Bars Count'. This parameter determines how much historical data will be used for testing.
* Important: The more bars you specify, the more statistically reliable the backtest results will be. We recommend using the maximum available value (25,000) to test strategies at different market phases.
* Consider: The indicator performs all calculations on the last historical bar. After applying the TradingView settings, it will take some time to load all the specified bars. The results table will appear only after the data is fully loaded. Don't worry if it doesn't appear instantly. And if an error occurs, simply switch the number of combinations to 990 and back to 1000 until the table appears.
Step 2: Optimization Configuration
At this stage, you define the "universe" of parameters that our algorithm will explore.
1. Set the search ranges (🛠 Optimization Parameters 🛠 group).
For each grid parameter that you want to optimize (for example, SO Count or `Take Profit'), you must specify three values:
* Min: The minimum value of the range.
* Max: The maximum value of the range.
* Step: The step with which the values from Min to Max will be traversed.
*Example:* If you set Min=5, Max=10, and Step=1 for SO Count, the script will test strategies with 5, 6, 7, 8, 9, and 10 safety orders.
* Tip for users: To get the first results quickly, start with a larger step (for example, TP from 0.5% to 2.5% in 0.5 increments instead of 0.1). After you identify the most promising areas, you can perform a deeper analysis by expanding the ranges around these values.
2. Set Up Money Management (Group `💰 Money Management Settings 💰`).
Fill in these fields with the values that best match your actual trading conditions. This is critically important for obtaining reliable results.
* Capital: Your initial deposit.
* Leverage: Leverage.
* Commission (%): Your trading commission as a percentage.
* Slippage (%): Expected slippage.
* Liquidation Level (%): The level of the supporting margin (MMR in %). For example, for Binance Futures, this value is usually between 0.4% and 2.5%, depending on the asset and position size. Specify this value for your exchange.
3. Select the Sorting Criterion and the Direction (Group `⚙️ Optimization Settings ⚙️').
* `Sort by': Specify the main criteria by which the best strategies will be selected and sorted. I strongly recommend using finalScore to find the most balanced and sustainable strategies.
* `Direction': Choose which trades to test: Long, Short or Both.
Step 3: Start Testing and Work with "Parts"
The total number of unique combinations generated based on your ranges can reach tens of millions. TradingView has technical limitations on the number of calculations that the script can perform at a time. To get around this, I implemented a "Parts" system.
1. What are `Part` and `Combinations in Part'?
* `Combinations in Part': This is the number of backtests that the script performs in one run (1000 by default).
* `Part`: This is the number of the "portion" of combinations that you want to test.
2. How does it work in practice?
* After you have everything set up, leave Part:1 and wait for the results table to appear. You will see the TOP N best strategies from the first thousand tested.
* Analyze them. Then, to check the next thousand combinations, just change the Part to 2 in the settings and click OK. The script will run a test for the next batch.
* Repeat this process by increasing the Part number (`3`, 4, 5...), until you reach the last available part.
* Where can I see the total number of parts? In the information row below the results table, you will find Total parts. This will help you figure out how many more tests are left to run.
Step 4: Analyze the Results in the Table
The results table is your main decision—making tool. It displays the best strategies found, sorted by the criteria you have chosen.
1. Study the performance metrics:
* Rating: Position in the rating.
* Profit %: Net profit as a percentage of the initial capital.
* Drawdown%: The maximum drawdown of the deposit for the entire test period.
* Max Length: The maximum duration of one transaction in days, hours and minutes.
* Trades: The total number of completed trades.
2. Examine the winning parameters:
* To the right of the performance metrics are columns showing the exact settings that led to this result ('SO Count`, SO Step, TP (%), etc.).
3. How to choose the best strategy?
* Don't chase after the maximum profit! The strategy with the highest profit often has the highest drawdown, which makes it extremely risky.
* Seek a balance. The ideal strategy is a compromise between high profitability, low drawdown (Drawdown) and the maximum length of trades acceptable to you (Max Length).
* finalScore was created to find this balance. Trust him — he often highlights not the most profitable, but the most stable and reliable options.
Detailed Description Of The Settings
This section serves as a complete reference for each parameter available in the script settings. The parameters are grouped in the same way as in the indicator interface for your convenience.
Group: ⚙️ Optimization Settings ⚙️
The main parameters governing the testing process are collected here.
* `Enable Optimizer': The main switch. Activates or deactivates all backtesting functionality.
* `Direction': Determines which way trades will be opened during the simulation.
* Long: Shopping only.
* Short: Sales only.
* Both: Testing in both directions. Important: This mode only works in conjunction with an External Signal, as the script needs an external signal to determine the direction for each specific transaction.
* `Signal Mode`: Controls the conditions for starting a new trading cycle (opening a base order).
* No Signal: A new cycle starts immediately after the previous one is completed. This mode is used to test "pure" grid mechanics without reference to market conditions.
* External Signal: A new cycle begins only when a signal is received from an external indicator connected via the Signal field.
* `Signal': A field for connecting an external signal source (works only in the `External Signal` mode). You can select any other indicator on the chart.
* For Long** trades, the signal is considered received if the value of the external indicator ** is greater than 0.
* For Short** trades, the signal is considered received if the value of the external indicator ** is less than 0.
* `Bars Count': Sets the depth of the history in the bars for the backtest. The maximum value (25000) provides the most reliable results.
* `Sort by`: A key criterion for selecting and ranking the best strategies in the final table.
* FinalScore: Recommended mode. A comprehensive assessment that takes into account 9 metrics to find the most balanced and sustainable strategies.
* Profit: Sort by net profit.
* Drawdown: Sort by minimum drawdown.
* Max Length: Sort by the minimum length of the longest transaction.
* `Combinations Count': Indicates how many of the best strategies (from 1 to 50) will be displayed in the results table.
* `Close last trade`: If this option is enabled, any active trade will be forcibly closed at the closing price of the last historical bar. For grid strategies, it is recommended to always enable this option in order to get the correct calculation of the final profit and eliminate grid strategies that have been stuck for a long time.
Group: 💰 Money Management Settings 💰
The parameters in this group determine the financial conditions of the simulation. Specify values that are as close as possible to your actual values in order to get reliable results.
* `Capital': The initial deposit amount for the simulation.
* `Leverage`: The leverage used to calculate the margin.
* `Slippage` (%): Simulates the difference between the expected and actual order execution price. The specified percentage will be applied to each transaction.
* `Commission` (%): The trading commission of your exchange as a percentage. It is charged at the execution of each order (both at opening and closing).
* `Liquidation Level' (%): Maintenance Margin Ratio. This is a critical parameter for a realistic test. Liquidation in the simulator occurs if the Equity of the account (Capital + Unrealized P&L) falls below the level of the supporting margin.
Group: 🛠 Optimization Parameters 🛠
This is the "heart" of the optimizer, where you set ranges for iterating through the grid parameters.
* `Part`: The portion number of the combinations to be tested. Start with 1, and then increment (`2`, 3, ...) sequentially to check all generated strategies.
* `Combinations in Part': The number of backtests performed at a time (in one "Part"). Increasing the value may speed up the process, but it may cause the script to error due to platform limitations. If an error occurs, it is recommended to switch to the step below and back.
Three fields are available for each of the following parameters (`SO Count`, SO Step, SO Multiplier, etc.):
* `Min`: Minimum value for testing.
* `Max': The maximum value for testing.
* `Step`: The step with which the values in the range from Min to Max will be iterated over.
There is also a checkbox for each parameter. If it is enabled, the parameter will be optimized in the specified range. If disabled, only one value specified in the Min field will be used for all tests.
* 'Stop Loss': In addition to the standard settings Min, Max, Step, it has an additional parameter:
* `Type`: Defines how the stop loss price is calculated.
* From entry point: The SL level is calculated once from the entry price (base order price).
* From breakeven line: The SL level is dynamically recalculated from the average position price after each new safety order is executed.
Group: ⚡️Filters⚡️
Filters allow you to filter out those results from the final table that do not meet your minimum requirements.
For each filter (`Max Profit`, Min Drawdown, `Min Trade Length`), you can:
1. Turn it on or off using the checkbox.
2. Select the comparison condition: Greater (More) or Less (Less).
3. Set a threshold value.
*Example:* If you set Less and 20 for the Min Drawdown filter, only those strategies with a maximum drawdown of less than 20% will be included in the final table.
Group: 🎨 Visual Settings 🎨
Here you can customize the appearance of the results table.
* `Position': Selects the position of the table on the screen (for example, Bottom Left — bottom left).
* `Font Size': The size of the text in the table.
* `Header Background / Data Background`: Background colors for the header and data cells.
* `Header Font Color / Data Font Color`: Text colors for the header and data cells.
Important Notes and Limitations
So that you can use the Autoback Grid Lab as efficiently and consciously as possible, please familiarize yourself with the following key features of its work.
1. It is a Tool for Analysis, not for Signals
It is extremely important to understand that this script does not generate trading signals in real time. Its sole purpose is to conduct in—depth research (**backtesting**) on historical data.
* The results you see in the table are a report on how a particular strategy would have worked in the past.
* The script does not provide alerts and does not draw entry/exit points on the chart for the current market situation.
* Your task is to take the best sets of parameters found during optimization and use them in your real trading, for example, when setting up a trading bot or in a manual trading system.
2. Features Of Calculations (This is not a "Repainting")
You will notice that the results table appears and is updated only once — when all historical bars on the chart are loaded. It does not change in real time with each tick of the price.
This is correct and intentional behavior.:
* To test thousands, and sometimes millions of combinations, the script needs to perform a huge amount of calculations. In the Pine Script™ environment, it is technically possible to do this only once, at the very last bar in history.
* The script does not show false historical signals, which then disappear or change. It provides a static report on the results of the simulation, which remains unchanged for a specific historical period.
3. Past Results do not Guarantee Future Results.
This is the golden rule of trading, and it fully applies to the results of backtesting. Successful strategy performance in the past is not a guarantee that it will be as profitable in the future. Market conditions, volatility and trends are constantly changing.
My tool, especially when sorting by finalScore, is aimed at finding statistically stable and reliable strategies to increase the likelihood of their success in the future. However, it is a tool for managing probabilities, not a crystal ball for predicting the future. Always use proper risk management.
4. Dependence on the Quality and Depth of the Story
The reliability of the results directly depends on the quantity and quality of the historical data on which the test was conducted.
* Always strive to use the maximum number of bars available (`Bars Count: 25,000`) so that your strategy is tested on different market cycles (rise, fall, flat).
* The results obtained on data for one month may differ dramatically from the results obtained on data for two years. The longer the testing period, the higher the confidence in the parameters found.
Conclusion
The Autoback Grid Lab is your personal research laboratory, designed to replace intuitive guesses and endless manual selection of settings with a systematic, data—driven approach. Experiment with different assets, timeframes, and settings ranges to find the unique combinations that best suit your trading style.
Time Window Optimizer [theUltimator5]The Time Window Optimizer is designed to identify the most profitable 30-minute trading windows during regular market hours (9:30 AM - 4:00 PM EST). This tool helps traders optimize their intraday strategies by automatically discovering time periods with the highest historical performance or allowing manual selection for custom analysis. It also allows you to select manual timeframes for custom time period analysis.
🏆 Automatic Window Discovery
The core feature of this indicator is its intelligent Auto-Find Best 30min Window system that analyzes all 13 possible 30-minute time slots during market hours.
How the Algorithm Works:
Concurrent Analysis: The indicator simultaneously tracks performance across all 13 time windows (9:30-10:00, 10:00-10:30, 10:30-11:00... through 15:30-16:00)
Daily Performance Tracking: For each window, it captures the percentage change from window open to window close on every trading day
Cumulative Compounding: Daily returns are compounded over time to show the true long-term performance of each window, starting from a normalized value of 1.0
Dynamic Optimization: The system continuously identifies the window with the highest cumulative return and highlights it as the optimal choice
Statistical Validation: Performance is validated through multiple metrics including average daily returns, win rates, and total sample size
Visual Representation:
Best Window Line: The top-performing window is displayed as a thick colored line for easy identification
All 13 Lines (optional): Users can view performance lines for all time windows simultaneously to compare relative performance
Smart Coloring: Lines are color-coded (green for gains, red for losses) with the best performer highlighted in a user-selected color
📊 Comprehensive Performance Analysis
The indicator provides detailed statistics in an information table:
Average Daily Return: Mean percentage change per trading session
Cumulative Return: Total compounded performance over the analysis period
Win Rate: Percentage of profitable days (colored green if ≥50%, red if <50%)
Buy & Hold Comparison: Shows outperformance vs. simple buy-and-hold strategy
Sample Size: Number of trading days analyzed for statistical significance
🛠️ User Settings
imgur.com
Auto-Optimization Controls:
Auto-Find Best Window: Toggle to enable/disable automatic optimization
Show All 13 Lines: Display all time window performance lines simultaneously
Best Window Line Color: Customize the color of the top-performing window
Manual Mode:
imgur.com
Custom Time Window: Set any desired time range using session format (HHMM-HHMM)
Crypto Support: Built-in timezone offset adjustment for cryptocurrency markets
Chart Type Options: Switch between candlestick and line chart visualization
Visual Customization:
imgur.com
Background Highlighting: Optional background color during active time windows
Candle Coloring: Custom colors for bullish/bearish candles within the time window
Table Positioning: Flexible placement of the statistics table anywhere on the chart
🔧 Technical Features
Market Compatibility:
Stock Markets: Optimized for traditional market hours (9:30 AM - 4:00 PM EST)
Cryptocurrency: Includes timezone offset adjustment for 24/7 crypto markets
Exchange Detection: Automatically detects crypto exchanges and applies appropriate settings
Performance Optimization:
Efficient Calculation: Uses separate arrays for each time block to minimize computational overhead
Real-time Updates: Dynamically updates the best-performing window as new data becomes available
Memory Management: Optimized data structures to handle large datasets efficiently
💡 Use Cases
Strategy Development: Identify the most profitable trading hours for your specific instruments
Risk Management: Focus trading activity during historically successful time periods
Performance Comparison: Evaluate whether time-specific strategies outperform buy-and-hold
Market Analysis: Understand intraday patterns and market behavior across different time windows
📈 Key Benefits
Data-Driven Decisions: Base trading schedules on historical performance data
Automated Analysis: No manual calculation required - the algorithm does the work
Flexible Implementation: Works in both automated discovery and manual selection modes
Comprehensive Metrics: Multiple performance indicators for thorough analysis
Visual Clarity: Clear, color-coded visualization makes interpretation intuitive
This indicator transforms complex intraday analysis into actionable insights, helping traders optimize their time allocation and improve overall trading performance through systematic, data-driven approach to market timing.
TradingIQ - Reversal IQIntroducing "Reversal IQ" by TradingIQ
Reversal IQ is an exclusive trading algorithm developed by TradingIQ, designed to trade trend reversals in the market. By integrating artificial intelligence and IQ Technology, Reversal IQ analyzes historical and real-time price data to construct a dynamic trading system adaptable to various asset and timeframe combinations.
Philosophy of Reversal IQ
Reversal IQ integrates IQ Technology (AI) with the timeless concept of reversal trading. Markets follow trends that inevitably reverse at some point. Rather than relying on rigid settings or manual judgment to capture these reversals, Reversal IQ dynamically designs, creates, and executes reversal-based trading strategies.
Reversal IQ is designed to work straight out of the box. In fact, its simplicity requires just one user setting, making it incredibly straightforward to manage.
AI Aggressiveness is the only setting that controls how Reversal IQ works.
Traders don’t have to spend hours adjusting settings and trying to find what works best - Reversal IQ handles this on its own.
Key Features of Reversal IQ
Self-Learning Reversal Detection
Employs AI and IQ Technology to identify trend reversals in real-time.
AI-Generated Trading Signals
Provides reversal trading signals derived from self-learning algorithms.
Comprehensive Trading System
Offers clear entry and exit labels.
AI-Determined Profit Target and Stop Loss
Position exit levels are clearly defined and calculated by the AI once the trade is entered.
Performance Tracking
Records and presents trading performance data, easily accessible for user analysis.
Configurable AI Aggressiveness
Allows users to adjust the AI's aggressiveness to match their trading style and risk tolerance.
Long and Short Trading Capabilities
Supports both long and short positions to trade various market conditions.
IQ Channel
The IQ Channel represents what Reversal IQ considers a tradable long opportunity or a tradable short opportunity. The channel is dynamic and adjusts from chart to chart.
IQMA – Proprietary Moving Average
Introduces the IQ Moving Average (IQMA), designed to classify overarching market trends.
IQCandles – Trend Classification Tool
Complements IQMA with candlestick colors designed for trend identification and analysis.
How It Works
Reversal IQ operates on a straightforward heuristic: go long during an extended downside move and go short during an extended upside move.
What defines an "extended move" is determined by IQ Technology, TradingIQ's exclusive AI algorithm. For Reversal IQ, the algorithm assesses the extent to which historical high and low prices are breached. By learning from these price level violations, Reversal IQ adapts to trade future, similar violations in a recurring manner. It calculates a price area, distant from the current price, where a reversal is anticipated.
In simple terms, price peaks (tops) and troughs (bottoms) are stored for Reversal IQ to learn from. The degree to which these levels are violated by subsequent price movements is also recorded. Reversal IQ continuously evaluates this stored data, adapting to market volatility and raw price fluctuations to better capture price reversals.
What classifies as a price top or price bottom?
For Reversal IQ, price tops are considered the highest price attained before a significant downside reversal. Price bottoms are considered the lowest price attained before a significant upside reversal. The highest price achieved is continuously calculated before a significant counter trend price move renders the high price as a swing high. The lowest price achieved is continuously calculated before a significant counter trend price move renders the low price as a swing low.
The image above illustrates the IQ channel and explains the corresponding prices and levels
The blue lower line represents the Long Reversal Level, with the price highlighted in blue showing the Long Reversal Price.
The red upper line represents the Short Reversal Level, with the price highlighted in red showing the Short Reversal Price.
Limit orders are placed at both of these levels. As soon as either level is touched, a trade is immediately executed.
The image above shows a long position being entered after the Long Reversal Level was reached. The profit target and stop loss are calculated by Reversal IQ
The blue line indicates where the profit target is placed (acting as a limit order).
The red line shows where the stop loss is placed (acting as a stop loss order).
Green arrows indicate that the strategy entered a long position at the highlighted price level.
You can also hover over the trade labels to get more information about the trade—such as the entry price, profit target, and stop loss.
The image above demonstrates the profit target being hit for the trade. All profitable trades are marked by a blue arrow and blue line. Hover over the blue arrow to obtain more details about the trade exit.
The image above depicts a short position being entered after the Short Reversal Level was touched. The profit target and stop loss are calculated by the AI
The blue line indicates where the profit target is placed (acting as a limit order).
The red line shows where the stop loss is placed (acting as a stop loss order).
The image above shows the profit target being hit for the short trade. Profitable trades are indicated by a blue arrow and blue line. Hover over the blue arrow to access more information about the trade exit.
Long Entry: Green Arrow
Short Entry: Red Arrow
Profitable Trades: Blue Arrow
Losing Trades: Red Arrow
IQMA
The IQMA implements a dynamic moving average that adapts to market conditions by adjusting its smoothing factor based on its own slope. This makes it more responsive in volatile conditions (steeper slopes) and smoother in less volatile conditions.
The IQMA is not used by Reversal IQ as a trade condition; however, the IQMA can be used by traders to characterize the overarching trend and elect to trade only long positions during bullish conditions and only short positions during bearish conditions.
The IQMA is an adaptive smoothing function that applies a combination of multiple moving averages to reduce lag and noise in the data. The adaptiveness is achieved by dynamically adjusting the Volatility Factor (VF) based on the slope (derivative) of the price trend, making it more responsive to strong trends and smoother in consolidating markets.
This process effectively makes the moving average a self-adjusting filter, the IQMA attempts to track both trending and ranging market conditions by dynamically changing its sensitivity in response to price movements.
When IQMA is blue, an overarching uptrend is in place. When IQMA is red, an overarching downtrend is in place.
IQ Candles
IQ Candles are price candles color-coordinated with IQMA. IQ Candles help visualize the overarching trend and are not used by Reversal IQ to determine trade entries and trade exits.
AI Aggressiveness
Reversal IQ has only one setting that controls its functionality.
AI Aggressiveness controls the aggressiveness of the AI. This setting has three options: Sniper, Aggressive, and Very Aggressive.
Sniper Mode
In Sniper Mode, Reversal IQ will prioritize trading large deviations from established reversal levels and extracting the largest countertrend move possible from them.
Aggressive Mode
In Aggressive Mode, Reversal IQ still prioritizes quality but allows for strong, quantity-based signals. More trades will be executed in this mode with tighter stops and profit targets. Aggressive mode forces Reversal IQ to learn from narrower raw-dollar violations of historical levels.
Very Aggressive Mode
In Very Aggressive Mode, Reversal IQ still prioritizes the strongest quantity-based signals. Stop and target distances aren't inherently affected, but entries will be aggressive while prioritizing performance. Very Aggressive mode forces Reversal IQ to learn from narrower raw-dollar violations of historical levels and also forces it to embrace volatility more aggressively.
AI Direction
The AI Direction setting controls the trade direction Reversal IQ is allowed to take.
“Both” allows for both long and short trades.
“Long” allows for only long trades.
“Short” allows for only short trades.
Verifying Reversal IQ’s Effectiveness
Reversal IQ automatically tracks its performance and displays the profit factor for the long strategy and the short strategy it uses. This information can be found in a table located in the top-right corner of your chart.
The image above shows the long strategy profit factor and the short strategy profit factor for Reversal IQ.
A profit factor greater than 1 indicates a strategy profitably traded historical price data.
A profit factor less than 1 indicates a strategy unprofitably traded historical price data.
A profit factor equal to 1 indicates a strategy did not lose or gain money when trading historical price data.
Using Reversal IQ
While Reversal IQ is a full-fledged trading system with entries and exits, it was designed for the manual trader to take its trading signals and analysis indications to greater heights - offering numerous applications beyond its built-in trading system.
The hallmark feature of Reversal IQ is its sniper-like reversal signals. While exits are dynamically calculated as well, Reversal IQ simply has a knack for "sniping" price reversals.
When performing live analysis, you can use the IQ Channel to evaluate price reversal areas, whether price has extended too far in one direction, and whether price is likely to reverse soon.
Of course, in times of exuberance or panic, price may push through the reversal levels. While infrequent, it can happen to any indicator.
The deeper price moves into the bullish reversal area (blue) the better chance that price has extended too far and will reverse to the upside soon. The deeper price moves into the bearish reversal area (red) the better chance that price has extended too far and will reverse to the downside soon.
Of course, you can set alerts for all Reversal IQ entry and exit signals, effectively following along its systematic conquest of price movement.
Paid script
Descriptive Backtesting Framework (DBF)As the name suggests, this is a backtesting framework made to offer full backtesting functionality to any custom indicator in a visually descriptive way.
Any trade taken will be very clear to visualize on the chart and the equity line will be updated live allowing us to use the REPLAY feature to view the strategy performing in real time.
Stops and Targets will also get draw on the chart with labels and tooltips and there will be a table on the top right corner displaying lots of descriptive metrics to measure your strategy's performance.
IF YOU DECIDE TO USE THIS FRAMEWORK, PLEASE READ **EVERYTHING** BELOW
HOW TO USE IT
Step 1 - Insert Your Strategy Indicators:
Inside this framework's code, right at the beginning, you will find a dedicated section where you can manually insert any set of indicators you desire.
Just replace the example code in there with your own strategy indicators.
Step 2 - Specify The Conditions To Take Trades:
After that, there will be another section where you need to specify your strategy's conditions to enter and exit trades.
When met, those conditions will fire the trading signals to the trading engine inside the framework.
If you don't wish to use some of the available signals, please just assign false to the signal.
DO NOT DELETE THE SIGNAL VARIABLES
Step 3 - Specify Entry/Exit Prices, Stops & Targets:
Finally you'll reach the last section where you'll be able to specify entry/exit prices as well as add stops and targets.
On most cases, it's easier and more reliable to just use the close price to enter and exit trades.
If you decide to use the open price instead, please remember to change step 2 so that trades are taken on the open price of the next candle and not the present one to avoid the look ahead bias.
Stops and targets can be set in any way you want.
Also, please don't forget to update the spread. If your broker uses commissions instead of spreads or a combination of both, you'll need to manually incorporate those costs in this step.
And that's it! That's all you have to do.
Below this section you'll now see a sign warning you about not making any changes to the code below.
From here on, the framework will take care of executing the trades and calculating the performance metrics for you and making sure all calculations are consistent.
VISUAL FEATURES:
Price candles get painted according to the current trade.
They will be blue during long trades, purple on shorts and white when no trade is on.
When the framework receives the signals to start or close a trade, it will display those signals as shapes on the upper and lower limits of the chart:
DIAMOND: represents a signal to open a trade, the trade direction is represented by the shape's color;
CROSS: means a stop loss was triggered;
FLAG: means a take profit was triggered;
CIRCLE: means an exit trade signal was fired;
Hovering the mouse over the trade labels will reveal:
Asset Quantity;
Entry/Exit Prices;
Stops & Targets;
Trade Profit;
Profit As Percentage Of Trade Volume;
**Please note that there's a limit as to how many labels can be drawn on the chart at once.**
If you which to see labels from the beginning of the chart, you'll probably need to use the replay feature.
PERFORMANCE TABLE:
The performance table displays several performance metrics to evaluate the strategy.
All the performance metrics here are calculated by the framework. It does not uses the oficial pine script strategy tester.
All metrics are calculated in real time. If using the replay feature, they will be updated up to the last played bar.
Here are the available metrics and their definition:
INITIAL EQUITY: the initial amount of money we had when the strategy started, obviously...;
CURRENT EQUITY: the amount of money we have now. If using the replay feature, it will show the current equity up to the last bar played. The number on it's right side shows how many times our equity has been multiplied from it's initial value;
TRADE COUNT: how many trades were taken;
WIN COUNT: how many of those trades were wins. The percentage at the right side is the strategy WIN RATE;
AVG GAIN PER TRADE: the average percentage gain per trade. Very small values can indicate a fragile strategy that can behave in unexpected ways under high volatility conditions;
AVG GAIN PER WIN: the average percentage gain of trades that were profitable;
AVG GAIN PER LOSS: the average percentage loss on trades that were not profitable;
EQUITY MAX DD: the maximum drawdown experienced by our equity during the entire strategy backtest;
TRADE MAX DD: the maximum drawdown experienced by our equity after one single trade;
AVG MONTHLY RETURN: the compound monthly return that our strategy was able to create during the backtested period;
AVG ANNUAL RETURN: this is the strategy's CAGR (compound annual growth rate);
ELAPSED MONTHS: number of months since the backtest started;
RISK/REWARD RATIO: shows how profitable the strategy is for the amount of risk it takes. Values above 1 are very good (and rare). This is calculated as follows: (Avg Annual Return) / mod(Equity Max DD). Where mod() is the same as math.abs();
AVAILABLE SETTINGS:
SPREAD: specify your broker's asset spread
ENABLE LONGS / SHORTS: you can keep both enable or chose to take trades in only one direction
MINIMUM BARS CLOSED: to avoid trading before indicators such as a slow moving average have had time to populate, you can manually set the number of bars to wait before allowing trades.
INITIAL EQUITY: you can specify your starting equity
EXPOSURE: is the percentage of equity you wish to risk per trade. When using stops, the strategy will automatically calculate your position size to match the exposure with the stop distance. If you are not using stops then your trade volume will be the percentage of equity specified here. 100 means you'll enter trades with all your equity and 200 means you'll use a 2x leverage.
MAX LEVERAGE ALLOWED: In some situations a short stop distance can create huge levels of leverage. If you want to limit leverage to a maximum value you can set it here.
SEVERAL PLOTTING OPTIONS: You'll be able to specify which of the framework visuals you wish to see drawn on the chart.
FRAMEWORK **LIMITATIONS**:
When stop and target are both triggered in the same candle, this framework isn't able to enter faster timeframes to check which one was triggered first, so it will take the pessimistic assumption and annul the take profit signal;
This framework doesn't support pyramiding;
This framework doesn't support both long and short positions to be active at the same time. So for example, if a short signal is received while a long trade is open, the framework will close the long trade and then open a short trade;
FINAL CONSIDERATIONS:
I've been using this framework for a good time and I find it's better to use and easier to analyze a strategy's performance then relying on the oficial pine script strategy tester. However, I CANNOT GUARANTEE IT TO BE BUG FREE.
**PLEASE PERFORM A MANUAL BACKTEST BEFORE USING ANY STRATEGY WITH REAL MONEY**
Potential Divergence Checker#### Key Features
1. Potential Divergence Signals:
Potential divergences can signal a change in price movement before it occurs. This indicator identifies potential divergences instead of waiting for full confirmation, allowing it to detect signs of divergence earlier than traditional methods. This provides more flexible entry points and can act as a broader filter for potential setups.
2. Exposing Signals for External Use:
One of its advanced features is the ability to expose signals for use in other scripts. This allows users to integrate divergence signals and related entry/exit points into custom strategies or automated systems.
3. Custom Entry/Exit Timing Based on Years and Days:
The indicator provides entry and exit signals based on years and days, which could be useful for time-specific market behavior, long-term trades, and back testing.
#### Basic Usage
This indicator can check for all types of potential divergences: bullish, hidden bullish, bearish, hidden bearish. All you need to do is choose the type you want to check for under “DIVERGENCE TYPE” in the settings. On the chart, potential bullish divergences will show up as triangles below the price candles. one the chart potential bearish divergences will show up as upside down triangles above the price candles
#### Signals for Advanced Usage
You can use this indicator as a source in other indicators or strategies using the following information:
“ PD: Bull divergence signal ” will return “1” when a divergence is present and “0” when not present
“ PD: HBull divergence(hidden bull) signal ” will return “1” when a divergence is present and “0” when not present
“ PD: Bear divergence signal ” will return “1” when a divergence is present and “0” when not present
“ PD: HBear divergence(hidden bear) signal ” will return “1” when a divergence is present and “0” when not present
“ PD: enter ” signal will return a “1” when both the days and years criteria in the “entry filter settings” are met and “0” when not met.
“ PD: exit ” signal will return a “1” when the days criteria in the “exit filter settings” are met and “0” when not met.
#### Examples of Using Signals
1. If you are testing a long strategy for Bitcoin and do not want it to run during bear market years(e.g., the second year after a US presidential election), you can enable the “year and day filter for entry,” uncheck the following years in the settings: 2010, 2014, 2018, 2022, 2026, and reference the signal below in our strategy
signal: “ PD: enter ”
2. Let’s say you have a good long strategy, but want to make it a bit more profitable, you can tell the strategy not to run on days where there is potential bearish divergence and have it only run on more profitable days using these signals and the appropriate settings in the indicator
signal: “ PD: Bear divergence signal ” will return a ‘0’ with no bearish divergence present
signal: “ PD: enter ” will return a “1” if the entry falls on a specific, more profitable day chosen in the settings
#### Disclaimer
The "Potential Divergence Checker" indicator is a tool designed to identify potential market signals. It may have bugs and not do what it should do. It is not a guarantee of future trading performance, and users should exercise caution when making trading decisions based on its outputs. Always perform your own research and consider consulting with a financial advisor before making any investment decisions. Trading involves significant risk, and past performance is not indicative of future results.
Neon Juliet - PreviewThere is no TLDR, but there is a summary at the end. I strongly encourage to read full description before trying it out. Enjoy!
Background
=========
Having successful and adamant trading systems typically consists of two (oversimplified) elements: signals and risk management system. In most zero-sum games, such as trading, signals must offer an advantage against the market, and risk management system provides a safety mechanism to allow the system to exist in the future. Let me explain.
Say, I have a solid risk management system: it is diversified, with take profit and stop loss thresholds set for low risk, on average I trade less than 3% of my assets, and there’s a loss recovery mechanism, etc. Hypothetically, it’s pristine. Now, let’s trade this portfolio against a flip of a coin, essentially a signal that provides 50% probability of things turning out in my favour. How profitable is such system? My answer: it isn’t. I might be able to sustain this system for some time, but eventually this system is going to have to loosen risk restrictions to stay ahead of the commissions and borrowing costs, resulting in overtime detrimental trend.
Conversely, if the signals provide greater than 50% confidence of things turning out in my favour, but risk management is poor, I’d expect such system to end up in a disaster soon, perhaps after a few euphoric gains. (I’d isolate a top-notch signals, say >90% confidence, in another bucket, but this idealistic system is non-achievable in my practice, so I’ll leave it be)
Neon Juliet was developed to offer an advantage against given markets. Probabilities generated by this model are statistical historical outcomes. This model developed using only price action and is unable to consume any other data or price data across instruments. In other words, it doesn’t know anything you don’t see already on a chart.
Neon J performs best on complex instruments where there’s great diversity of actors and considerable daily volume .
Methodology
==========
In principle, Neon J is based on Bayes’ Theorem. Simply put, prior knowledge of price action ( aka patterns) provides basis for probability of future price action development (ex. long or short trend).
The training process is implemented outside of this script mainly due to Pine Script limitations. This script, however, contains inference portion of the model.
As input for training, daily candle data is used. From this data, feature engineering step of the training develops features, like price average divergence/convergence (think MACD ), price strength (think RSI , ADX ); multiple periods used to diversify long and short patterns. This is done to develop a “state” that is reflective of recent price development. Ex. what we’d call a trend is just a strong and consistent upward price action, but we’d need to look at most recent N candles and their pattern to know that.
Once features are developed, I train a model using Reinforcement Learning technique. Simply put, this technique allows an agent to interact with a trading simulator and take actions (ex. go long, go short, etc.). After many iterations, the agent learns conditions (patterns) that lead to positive outcomes and those that lead to negative outcomes. This learning is quantitative, which means there’s a way to tell which probabilities are strong and which are weak. These probabilities are indicated by this script.
Trained Neon J models are instruments-specific. Meaning, that model for DJI is not compatible with SP500 or any other instrument. Experimentally, I proved that such approach over-performs generalizable models (those that are trained on data from multiple instruments)
Neon J currently only support daily time frame. The limitation is purely practical to reduce the development load and model size.
Results
======
Tests show 60%-70% success rate (on average, some instruments are worse than that, some better) of individual signal when threshold is set to 0.3 (roughly equivalent to 65% probability). This is calculated with Pine Script Strategy with the following entry/exit rules:
Entry when individual signal (a dot) is above 0.3 (long) or below -0.3 (short)
Exit when 14-period smooth signal (a column) is above 0.0 (short exit) or below 0.0 (long exit)
No stop loss or take profit levels.
Pyramiding is set to 100 (to allow unrestricted action of all signals)
All trades are closed on last tested bar (to conclude all signals in-flight)
Percent Profitable is what we take as success rate in the context of this assessment. This number represents how many signals were profitable vs all signals actioned.
It is also worth noting that this assessment was performed on a time period previously unseen by the model. Simply put, we only train a model with data up until date X, then we test starting from date X onward. This ensures that the assessment is unbiased by the model already “knowing” the future. In practice, this gives confidence that future (unknown) market dynamics is going to be representative of our test results.
Be aware, the above “strategy” is not my recommended usage of this signal, it is simply an assessment technique that is meant to be as simple and unconstrained as possible.
How to use this script
================
The script calculates a probability. A term probability here is used in a loose form and means “a numeric value in roughly -1 to 1 space that represents the likelyhood of bullish or bearish price action”. Keep in mind that probability values can go over 1.0 or below -1.0. This is due to the fact that these value are normalized to -1/1 space using 95-percentile (this detail is largely unimportant for usability’s sake).
Indications
--------------
Dots (circles) indicate individual probability value on any given bar. Indicated value on a given bar indicates the probability of future price action. High (positive) values indicate high probability of long action in the future. Low (negative) values indicate high probability of short action in the future. You should interpret future as a gradient (a trend developing slowly over time) instead of being isolated to what’s immediately follows (ex. next bar)
Columns (histogram) provided as convenient view of smoothed probabilities of last N bars. This is controlled by the Smoothing parameter and defaults to 14.
Parameters
---------------
Model parameter is the backbone of this script. It is a required parameter and it is unique for each instrument. Example models provided at the end (see below). This parameter is a long 10000+ character representation of a model.
The script has two additional parameters for configuring interpretation: Threshold and Smoothing.
Threshold controls the level at which values change color (ex. above 0.3, turn neon blue, and below -0.3 turn neon purple).
Smoothing parameter provides a way to smooth out individual probabilities into a exponential moving average with the periods provided. This average is indicated using columns on the indicator.
Model expiration
----------------------
Models are valid for 1 month after training. This is done by design to prevent model deterioration. A month is proven to be a maximum period of time to hold model performance steady. After that, deterioration is likely to occur. Optimal time for model lifetime is 10 days (this is what I use for live trading), and of course most optimal (but unpractical for now) is to re-train daily.
Validity indicated with blue-tinted indicator background, while red-tinted background indicates expired period.
Preview
======
This script is released as a public script for anyone to try. My motives for this release are two-fold:
To subject the model to a variety of conditions, including traders with different experiences trading different instruments (subject to specific models offered of course). Essentially, my own testing is not enough to grasp a full breadths of scenarios. I’d like to harden it and understand where it is strong and where it might fall short (pun intended).
Get an idea on how Neon J might be useful when making trading decision. I tried to make the representation of the signals unconstrained and unopinionated, so there’s room to explore and experiment. I found that Neon J can be packaged in a number of different ways.
At this moment the script is closed-source. I might consider open-sourcing this script in future depending on how much feedback I get from this submission and whether it’d be deemed useful to others.
Summary
=======
Neon J is a set of probabilistic models for predicting future price action with ~65% accuracy. It indicates individual signals (circles) for probability of price action in a foreseeable future, while smoothed signals (columns) are provided for a more dynamic view of probable price action. Blue circle - strong long probability; Purple circle - strong short probability. Blue column - strong long trend ahead or in-progress; Purple column - strong short trend ahead or in-progress.
To use it, copy models below and provide them an input to “model” parameter when applying to a chart. Models are instrument-specific. Only daily (D) charts should be used.
The script is provided for evaluation purposes.
Models!
======
At last, here are the models (a piece of text you need to input in script parameters for each instrument)
TVC:DJI :
DJI|20121220|20221220|0.597,-0.032,0.0,-0.121,0.0,0.866,-0.046,0.0,-0.091,0.0|1.492,0.1,0.0,-0.162,0.0,-0.669,-0.037,0.0,-0.042,0.0|0.07,0.374,0.0,0.305,0.0,0.085,0.488,0.0,0.26,0.0|0.249,-0.257,0.0,0.529,0.0,-0.018,-0.233,0.0,0.502,0.0|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,30,30,10,10,10,10,60,10,10,10,20,10,40,10,10,10,80,10,10,60,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,20,10,10,10,20,10,10,10,10,20,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,20,50,10,10,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,20,30,10,10,10,10,10,50,10,10,10,10,60,10,10,10,10,10,40,10,10,10,10,10,20,30,10,10,10,10,60,10,10,10,10,10,20,10,10,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,50,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,20,20,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,30,10,10,10,10,10,30,20,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,20,40,10,10,10,70,10,10,10,10,60,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,70,10,10,10|-645,-188,-7,-97,-4,29,-18,90,60,-7,-30,117,-226,-82,-49,77,-245,53,78,221,-72,280,245,400,683,268,-74,-15,-106,-102,-3,251,302,536,47,3,-6,-179,-56,101,-62,172,176,98,-15,-71,-18,200,61,-249,-30,-38,1,94,-2,-9,47,79,-35,-15,34,-30,76,120,39,96,-47,-11,-61,-21,124,-704,0,-248,112,-193,143,-27,-14,133,170,-20,-17,-2,-120,61,-98,-32,-2,79,-2,109,-35,-16,132,-44,-63,-168,205,-28,919,235,-34,-53,-23,-243,-68,-26,-35,-54,60,-37,28,-91,-3,-21,-47,79,-127,229,61,59,-49,-139,-63,-43,91,201,-19,-80,-27,120,-122,-141,-100,-32,-25,-98,-27,50,-2,-65,-138,-7,-36,-9,53,-36,-36,-64,-11,216,-5,-664,-19,74,82,-83,-3,-66,21,386,-454,-1002,-282,-7,-52,-30,-9,-16,-148,-131,112,-484,-96,97,93,-13,-162,-49,38,31,-5,-199,-22,205,153,-29,14,-41,-222,-225,-145,107,70,-3,-8,-7,-20,-247,37,96,268,362,-95,706,-69,60,70,120,-34,-65,-152,-69,-7,69,-76,71,-5,384,109,-102,-484,-3,34,60,-20,380,244,678,292,-48,-2,-154,-17,-62,105,486,597,212,-26,-21,-310,-29,-22,-90,285,-204,-92,-290,-6,-516,-42,-16,127,-47,-7,-72,-247,76,-47,-13,43,-26,43,89,-38,30,-21,-106,-78,113,-19,-13,-8,-12,-12,362,247,-4,50,76,64,-14,-52,-16,-93,-172,53,-1,32,99,22,-75,-4,-9,31,70,116,-54,-61,-3,-55,-19,-15,176,143,-11,134,144,-11,-28,-47,-29,-136,-75,99,64,-9,-2,-24,-43,30,-161,-179,82,175,129,115,-71,-396,-202,101,-9,139,-6,-31,-312,-111,2,0,-234,-21,-52,-31,-12,-26,-37,-144,-23,68,23,-16,149,60,-64,10,-7,-8,46,210,393,-5,96,-56,89,48,475,176,20,-10,-31,-29,34,76,41,178,38,-32,-94,-33,76,-5,91,-15,123,72,-46,-13,-11,0,-37,-244,-161,155,-8,-3,165,23,77,16,-117,35,-74,-5,-107,-286,-24,-263,-14,-37,-5,-196,-290,-576,-188,41,-20,-98,-34,-45,-45,-242,40,60,-7,-10,-17,-43,73,48,-25,-8,-40,-27,-2,-5,42,73,-6,-23,8,-16,63,167,21,-99,-47,-119,-36,-59,192,158,115,123,54,-28,-1,-90,-169,-71,-72,114,156,-141,155,64,42,-88,69,-75,76,94,-4,65,102,152,-9,10,-17,-192,67,-10,-343,-90,-43,-106,12,-9,-79,-10,-73,-461,-509,-75,99,-57,0,-27,80,-156,-198,-642,-363,33,47,-28,-40,-43,-8,9,-27,-67,41,26,0,6,-49,-29,-60,32,70,34,-2,-9,-40,-240,-152,21,189,49,67,12,-12,-2,16,31,200,193,211,-150,-84,-45,58,75,44,260,128,105,-9,-11,-1,82,-94,184,-53,266,326,-55,-209,-9,54,85,308,-14,60,420,160,-39,-81,-17,-10,77,108,-28,257,-104,-53,-59,-128,-5,-13,8,119,-20,-130,-49,-9,-3,-23,-46,150,194,263,-214,-12,72,-6,-22,25,-10,290,-41,-21,-18,-1,-17,-42,-14,-21,0,-4,-23,-1,-1,-13,172,-9,224,86,-9,-2,-22,176,-6,33,186,-61,-187,-46,-33,94,172,0,16,-12,-37,59,103,118,194,1000,44,40,49,81,82,89,142,-34,-26,-2,-15,-19,0,271,-56,-45,-21,-96,-146,-5,-54,141,-11,-320,58,-23,-43,-14,-49,142,127,120,-285,-187,-102,-72,-11,-55,-25,44,52,-43,-13,20,-41,-23,-88,-25,-4,-23,11,-179,-9,96,-84,215,93,-5,-49,148,-2,-58,-14,24,-6,-33,-6,103,9,0,-61,-1,29,113,98,-97,-19,-52,87,-39,-146,-70,-72,-119,-844,-184,-45,-27,-96,-155,93,-56,-41,-20,-43,-63,-142,-89,263,66,21,-21,-32,-70,-70,-263,20,-99,-11,-32,-50,-122,-186,-159,-137,136,-77,-14,-814,-23,-22,-170,-137,-42,-36,-64,75,-123,-100,-53,68,133,124,-77,211,217,522|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,30,20,10,10,10,10,10,60,10,10,10,20,10,40,10,10,10,30,50,10,10,50,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,20,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,20,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,20,10,10,10,10,10,10,50,10,10,10,10,60,10,10,10,10,10,40,10,10,10,10,10,20,10,20,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,50,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,40,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,20,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,10,10,40,10,10,10,10,60,10,10,10,10,60,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,70,10,10,10|-73,-90,70,38,76,12,-269,-89,-47,-77,-43,-161,114,-83,-48,36,-18,-11,-2,-39,-239,-140,-40,-341,-106,-78,83,92,62,-34,-231,-381,-311,-15,-178,-49,-29,-29,-73,-44,-271,-2,-49,-102,-126,-65,-45,-51,-71,-75,-21,52,-19,-29,-24,-131,38,-79,-53,-8,271,43,-24,-60,-8,-8,-5,-15,8,21,-127,72,-16,-40,-43,-70,64,232,-28,172,-22,-27,-8,-100,-134,99,133,61,67,-37,-1,-7,-55,-75,108,-112,7,-70,469,-62,-12,116,-54,-259,-49,-150,-146,-58,-3,-5,-66,-45,-102,-17,-22,-71,-96,-27,0,-46,30,-22,-130,-233,-89,-189,-14,111,0,-9,12,-235,-178,-6,-9,27,-31,-70,-7,-7,-13,-71,27,-1,-14,-24,-101,-38,18,50,-79,-3,-191,-47,-2,-12,-12,112,24,-5,-93,-295,-80,0,-8,-1,115,112,200,235,114,67,-13,-37,-130,-96,85,71,232,141,-265,-137,-57,-8,81,391,-37,-68,-76,57,119,-240,-45,-102,53,40,-23,61,-71,-156,-26,-19,81,-123,-83,-59,104,0,-96,-7,-17,-34,-18,-11,0,-98,-52,-84,-8,-53,-11,48,-4,-34,-16,-143,-7,-31,-77,-44,-34,-15,-64,-65,-21,-152,-240,-26,-172,-50,-170,-32,-33,-1,-25,-15,-15,-91,-87,-231,-19,-34,-70,-59,55,17,-24,10,-29,-41,-2,-56,27,-134,-54,-41,-30,46,-3,-363,-20,-55,65,16,38,9,-79,-9,51,83,-97,-36,62,-5,-28,-73,-12,0,62,-198,-4,-20,-4,-17,-128,-34,68,-31,-247,-239,-21,-41,-93,-24,14,-81,-238,-165,-44,-40,-102,2,-99,661,-188,0,0,-9,-27,-20,27,33,639,-2,-20,-55,-99,-45,-31,-423,-152,-66,-30,-3,-86,-36,104,-45,-34,104,-227,-191,-80,-65,-56,-86,143,-26,-21,-80,-47,-23,73,165,-93,-7,-43,-9,70,123,-50,-5,-1,57,63,-36,-17,-62,-39,-14,-34,-5,-77,-37,-98,-45,-59,-49,4,-159,-74,-29,-16,-244,-486,-245,8,-13,-1,-34,-58,-182,-62,-695,372,44,-46,-5,-11,-156,-178,-64,-2,-67,-37,-24,-61,-57,-30,69,-27,-153,7,-19,-19,-78,-52,-31,231,-54,-18,-28,-40,51,117,117,-14,-84,-23,-38,134,197,-10,-51,-2,-71,-49,26,268,-15,-83,-49,-35,-29,-94,29,-39,-140,-167,-68,-1,-31,-120,0,74,-59,-116,-134,-37,-136,-154,-136,-303,6,44,-29,-32,-48,-7,-115,-667,-500,-242,0,-1,-30,-3,-21,119,-115,-565,-211,115,-9,-67,-84,-13,-68,-93,-80,-106,65,-8,-89,-417,-29,-27,-61,-27,-18,64,66,115,22,-57,-55,-1,-10,-18,-80,112,85,47,-28,-3,-75,-20,-69,-54,252,90,-63,-35,-12,-4,-15,-1,11,68,-23,-16,-95,-3,-3,-25,31,7,-101,-104,-63,-45,-91,-6,81,-6,-110,-70,49,-13,-85,-57,-179,-66,-92,-284,-152,-249,-80,45,-75,-158,-50,-115,-9,-22,-322,-124,-57,-64,-1,-100,-58,-104,-67,-106,-224,-45,287,-21,-314,-18,-50,-60,-19,-50,-74,-32,339,-8,-114,-164,-31,-16,-6,-37,-26,82,40,40,-13,-30,-75,-54,-124,-2,-37,-10,19,-67,-62,-307,-130,-153,44,-18,-15,-2,-5,-31,10,-11,-78,50,74,-1,-15,-35,-9,-29,-31,91,58,-45,-48,-14,-8,-123,-205,-7,-3,-15,-63,-17,-26,-48,-106,-153,-166,-7,-23,-116,-53,-50,-23,-6,-10,-22,3,-142,-251,-196,-80,-30,-21,75,-36,-6,-188,-28,-2,8,-6,-72,-40,-5,-49,-28,-4,-101,-12,49,33,-19,-96,-169,-58,-293,-201,-69,-25,-82,-17,0,-10,-149,-134,-41,-87,-12,-29,-10,-34,-30,35,59,-122,-5,9,24,0,-13,47,81,-47,104,-7,-17,-76,-34,-17,-49,-69,-47,-20,-26,-46,-49,-248,-35,51,-29,-15,-14,-9,-285,-46,-1,-51,-56,-45,-139,-17,-45,-22,-16,-35,-75,-5,-13,0,-5,-18,-13,2,-7,-10,89,-1,-3,-148,-16,-51,-5,-9,-10,33,37,-44,-125,-1,-7,-48,-20,-10,-1,61,65,100,43,-15,-6,-68,-9,-92,-47,-38,-47,-17,215,500,1000,45,-41,-45,-26,-91,73,24,-28,-27,-65,-102,-27,-96,-142,-34
VANTAGE:SP500 :
SP500|20121220|20221220|0.573,-0.033,0.0,-0.041,0.0,0.846,-0.045,0.0,-0.026,0.0|1.45,0.109,0.0,-0.119,0.0,-0.626,-0.007,0.0,-0.08,0.0|-0.06,0.475,0.0,0.142,0.0,0.089,0.612,0.0,0.13,0.0|0.214,-0.127,0.0,0.619,0.0,-0.057,-0.084,0.0,0.556,0.0|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,40,10,10,10,10,10,70,10,10,10,10,60,10,10,10,20,50,10,10,10,70,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,30,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,40,10,10,10,20,20,20,10,10,10,10,20,30,10,10,10,10,10,10,10,10,10,20,10,10,10,10,20,10,10,20,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,30,20,10,10,10,10,10,10,50,10,10,10,10,60,10,10,10,10,60,10,10,10,10,50,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,50,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,50,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,20,10,10,10,10,10,20,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,60,10,10,10,10,10,10,30,10,10,10,10,10,50,10,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,70,20,10,10|-94,-209,311,137,89,-128,-228,-15,79,-81,-631,743,252,116,128,-196,-100,-101,-6,207,237,724,345,190,118,-290,-17,-163,-33,-37,140,425,736,-17,-22,-61,-5,-20,85,150,-15,102,274,179,4,-58,-30,-161,-71,-17,-31,-44,-107,53,-3,-19,7,93,-153,-32,-3,-46,-16,-9,71,-131,396,-13,34,-83,-15,-11,-17,72,-457,-143,-67,63,-207,-155,-223,-48,-762,266,-66,339,503,-54,-303,-173,-45,-58,-5,-52,624,1000,496,85,-173,-51,-58,-71,46,92,127,-32,-70,-1,-45,-63,-84,-102,-79,-117,-1,-114,-39,52,-12,-18,-13,-2,192,153,190,-120,-147,-13,-75,-9,-54,-31,-7,-128,-39,-97,60,-29,-24,-23,-173,-133,-241,-118,22,-2,1,-2,-48,-12,-23,-89,-23,-37,-33,-10,-5,-60,-28,-80,-113,-128,184,-170,-93,-50,-7,-43,-52,-87,-143,37,-100,-39,-239,-24,-154,82,-27,100,766,-51,-23,168,-29,138,-35,-50,42,71,-23,38,-23,57,131,-16,-35,-12,-54,-15,181,128,127,131,-19,-47,-108,-43,84,-152,-5,-7,-10,-8,-20,59,53,-269,-44,-7,-67,-26,-13,-10,-116,-21,-49,87,-19,-8,-31,-35,-38,-13,170,185,-54,-4,-56,-85,-108,-147,-19,-15,76,-9,-59,-100,-36,-39,-31,-18,141,66,-85,-27,44,123,123,-13,-8,36,-13,-39,-13,8,189,82,-17,-33,-5,146,-100,-29,64,-20,-53,-23,-97,-2,-77,-89,-5,-21,-132,-31,-15,-47,-1,-8,32,-13,-39,-42,-27,-43,12,-97,-35,-29,-18,-32,152,41,-13,-39,-14,-13,-36,-10,-37,-25,49,109,97,118,85,-56,-59,-74,-21,-167,-145,-12,-5,-29,-63,-107,202,-15,-33,-46,-63,-89,-97,-56,17,-25,-74,-2,-101,-210,-127,-96,-15,-59,-105,-24,-106,-37,-52,-2,-25,-27,-47,-5,14,-8,51,-6,-32,-5,23,-57,-32,-17,39,-4,-20,-28,-42,-23,101,-8,-11,-30,-25,-165,-113,-53,-82,-4,-52,-3,-5,21,-22,-333,-3,94,25,-33,-14,-83,26,-26,-41,-43,-36,63,9,-343,-304,-231,-15,-54,44,-127,-182,139,-83,25,-30,-14,-36,-32,-84,-138,23,-49,-13,-17,-139,-168,-146,-2,-46,-54,-34,-17,-40,-132,-149,-79,-40,-116,-65,-50,-124,-69,37,-21,-29,-6,-48,-232,-84,-59,-3,-6,-13,-11,1,-6,-133,-252,-12,-44,-114,-25,-120,-24,128,-27,-166,-36,-47,-65,-43,-15,-3,-88,-170,-209,-58,-185,-101,-120,-106,65,-21,-40,-12,87,-104,-31,-333,-272,-177,43,-75,-89,-41,-65,-52,-29,3,-10,-44,-18,-11,-7,-46,-37,-7,-5,27,-19,-8,-55,85,54,-6,-141,19,-19,-19,-6,-55,1,-36,-148,-22,-66,-107,-13,-197,-36,39,117,94,31,-20,94,238,48,-18,-41,-9,-1,-24,-30,9,-6,232,-16,-16,79,-27,13,-15,-15,194,223,344,212,-33,13,49,136,-5,-7,227,-82,-42,155,65,86,-24,71,-38,-38,-10,-209,17,0,-41,-19,-87,-36,-18,-108,69,-38,-11,-25,-31,70,-10,135,62,-133,85,-1,-10,-14,-97,82,-5,-16,-81,-390,-83,-1,-35,-27,-115,-92,-4,130,145,-337,0,-1,-59,-32,-120,169,14,-34,25,-14,-30,7,-24,59,-5,35,-8,-11,-11,155,179,100,80,17,-6,-5,-46,-1,566,396,41,-13,-63,-10,53,60,253,820,325,202,-120,-23,18,-136,-42,6,-85,-26,-54,-60,0,14,-26,144,-24,-84,-12,-37,-37,25,134,157,-3,181,-23,-64,34,-10,53,-122,126,173,277,-323,-76,11,-8,-31,0,-5,156,-40,202,47,-33,22,-88,-127,-89,-171,-4,186,213,-24,-1,0,-17,-34,80,155,-53,-51,-113,-57,-36,-2,73,24,65,36,-21,191,-12,-42,-13,-16,-18,-13,90,541,125,-39,-1,-398,-43,-65,-496,-1,-11,-35,-21,-4,-68,-56,-78,66,-19,-51,51,39,330,-34,-173,11,18,-7,-24,-51,400,-19,173,-54,-208,-48,-29,-184,-34,-234,-26,178,178,-2,-63,-54,-71,-58,-91,-154,69,-40,-59,-136,-55,-122,-3,-18,-27,-203,-33,15,84,-10,-13,82,-93,317,0,215,80,37|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,50,10,10,10,10,10,60,10,10,10,10,60,10,10,10,20,50,10,10,10,70,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,20,10,30,10,10,10,10,30,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,30,10,10,10,20,50,10,10,10,20,10,30,10,10,10,10,10,10,10,30,10,10,10,10,20,10,10,20,10,10,10,30,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,30,20,10,10,10,10,10,10,50,10,10,10,10,60,10,10,10,10,60,10,10,10,10,50,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,40,10,10,10,10,20,30,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,50,10,10,10,10,10,40,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,50,10,10,10,10,10,10,40,10,10,10,10,10,60,10,10,10,10,10,10,30,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,10,60,20,10,10|-506,-65,-264,-239,-206,-1,45,-58,-192,-202,-134,-214,-304,-117,-129,-70,-148,-46,-2,-77,-253,-532,-138,-73,-6,-23,-6,-50,-94,-286,-213,-271,-190,107,150,-25,-46,-49,-121,-52,-166,-98,-54,-58,-100,-18,206,265,-58,-6,-137,163,-26,-152,-24,-52,3,-80,-71,-4,-20,-51,-42,-74,-111,93,-81,70,47,-51,-5,-93,-74,-139,-119,-11,-51,-17,438,252,-95,-52,-194,-175,-78,-285,-129,-310,-82,-75,-199,-36,-142,-186,-328,-371,-157,-57,175,0,-4,-142,-150,-36,-175,-22,-101,66,69,298,-39,-18,-37,100,-38,226,-50,-74,0,-58,-86,-80,-1,-104,153,62,-67,0,81,212,4,134,74,-121,-100,83,-2,94,-43,-36,-8,-27,2,-56,-8,-85,-35,-2,23,108,-15,452,-28,-15,-15,-60,-64,180,-98,64,-26,719,19,-91,-67,-149,-14,206,131,-201,276,319,185,-46,-176,-259,-57,-213,-149,-57,-96,-79,133,123,-13,-79,-164,-38,-68,69,-10,-19,-17,93,-20,-9,-61,-2,-19,-63,-164,-182,-16,-35,-115,-52,-4,-6,-28,-19,-162,-58,140,-30,26,49,-47,-78,-2,343,274,62,-61,-190,-1,-105,-98,-112,246,-98,-103,-165,-282,-5,-2,-142,-133,-41,-48,-23,-84,-250,-22,114,286,-22,-217,-149,-47,-135,-255,-26,-42,246,267,-130,-1,-32,-14,-50,-322,-62,-20,-135,-38,-51,-46,86,-23,-110,-155,-49,-9,14,-22,-23,135,-96,-51,-132,87,175,139,-14,-51,-53,-38,132,149,47,-97,-86,-65,-26,-70,-48,-11,-76,35,-149,-343,-163,-101,35,-4,-32,-3,-229,-102,-353,-94,-59,-157,-86,-22,-129,190,137,-79,-41,-136,-26,-10,-97,107,1,-56,-37,-35,-23,84,78,0,-9,75,-40,-41,-53,-23,80,88,-75,-114,-10,80,-21,-151,-67,-29,-87,-71,-42,-12,-67,-93,-47,-165,-98,-8,219,216,109,-9,-48,-161,-55,-83,9,-15,220,142,119,-24,-76,-97,-3,-57,-6,39,-7,-118,-186,-60,-10,-82,-50,-204,-47,-185,40,20,-83,-54,-9,55,-177,-18,289,568,228,15,-119,-172,-90,-35,-70,16,-51,-116,-43,-109,-32,-20,-14,-13,-142,-26,-36,-43,-81,-91,98,-27,155,130,-6,-26,-52,147,128,0,-74,-20,-149,-41,303,508,-21,-45,66,-130,-53,-69,657,105,104,-85,-95,-27,-8,-125,-268,312,-72,223,-78,-11,-79,-208,-147,-61,-505,-5,-4,-1,-10,-175,-259,-142,-178,-11,-102,72,83,306,-1,-5,-9,-72,-57,-5,-13,-119,239,776,567,46,-5,-53,-79,-25,-71,-24,93,-35,-10,-29,-160,-36,13,195,-34,80,-41,-2,-86,-116,-49,-1,-98,-52,-18,-36,-82,92,25,-3,158,-47,-56,-16,-61,118,450,-44,-132,-21,-28,-212,-202,-66,-25,-116,-228,-2,-140,-394,-10,-230,-120,32,-134,-140,-199,-99,-29,-437,-68,-32,-89,-134,-3,-28,-38,-3,-3,-521,-50,-66,-66,-24,-63,-74,-110,-80,-23,-4,-7,-21,-7,-73,-138,-29,-240,-109,-69,-77,-91,-10,-6,-26,-134,-82,-79,-92,-52,-112,69,-74,-89,-40,-8,-164,-271,-192,-45,110,246,-33,-83,-2,-59,-75,-9,-157,671,-43,-2,-9,39,-164,-85,-59,-84,-72,-83,-195,-180,36,-42,-37,-73,-58,-214,-78,-93,146,-27,-49,-5,-97,-31,-5,109,-111,-28,-36,-41,-90,-45,-123,-279,-338,-11,-150,-5,-72,-44,-7,-99,12,-279,-61,70,-173,-12,-45,-30,-19,-168,14,-231,-149,-58,-36,-84,-250,-160,-111,-28,-38,-129,-27,-116,-26,-409,-240,-89,-135,-64,-87,-95,-9,-65,-3,-7,-97,-203,-165,-52,-59,-41,-18,-7,-56,254,-44,-71,-40,207,-9,-41,-7,-85,-243,-18,-13,-67,-17,-41,-57,-1,-20,-20,-105,-120,-51,-29,-117,-72,-30,-44,-52,-33,-29,-172,-5,-28,-114,176,-14,-24,-137,-3,-157,18,-4,-194,-55,-159,-100,-195,-148,-60,-221,-46,-65,-5,-96,-10,-23,-17,-264,-79,-72,-70,-9,-45,-19,-15,196,262,-6,-207,17,-29,210,209,816,1000,84,-169,-112,-34,-3,-207,-92,-29,-61,0,209,-223,-91,-13,-5,-154,-124,-200,-64,22,-59,-58,-37
BINANCE:BTCUSD
BTCUSD|20121220|20221220|0.475,0.011,0.0,-0.003,0.0,0.881,0.013,0.0,-0.001,0.0|1.25,0.06,0.0,-0.022,0.0,-0.475,0.024,0.0,0.01,0.0|-0.077,0.46,0.0,0.231,0.0,0.015,0.566,0.0,0.169,0.0|0.034,-0.184,0.0,0.618,0.0,-0.004,-0.174,0.0,0.73,0.0|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,90,50,120,20,10,30,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,20,10,20,10,10,10,10,10,10,10,10,10,40,20,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,30,20,10,10,10,10,10,40,10,10,10,10,10,10,20,20,10,10,20,10,10,10,10,10,50,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,40,10,10,20,10,60,10,10,10,10,10,10,10,30,10,10,20,30,10,10,20,30,10,20,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,50,10,10,10,10,10,50,10,20,10,10,60,10,10,10,10,20,10,20,10,10,10,10,10,20,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,50,10,10,30,60,10,20,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,20,10,10,10,20,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,20,10,20,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10|48,-117,85,77,-23,-43,-130,-18,-95,-108,-79,-29,-6,-14,-71,-12,-20,-101,-109,-202,-33,39,-52,-66,-249,-74,-47,-266,-10,-27,-9,-1,-15,-17,-4,-63,-115,-37,36,-4,-10,-32,-29,-15,-62,-219,-132,-6,-9,-76,-35,-47,-82,-36,-82,-117,-33,-1,-6,23,108,-52,-84,-3,-285,18,186,378,124,-135,79,-172,21,299,-34,-16,-3,-53,-209,-10,-14,85,-4,-105,-14,-101,-159,-319,-67,69,45,-18,-63,-202,-30,-142,-504,-125,14,74,-2,-6,-13,1,-8,-187,-8,-9,-5,-66,-102,12,-49,77,-58,-238,-41,-7,0,-117,-6,-53,-60,-32,-81,-414,-426,-139,-11,-139,-48,38,-7,170,-515,-442,-24,89,134,-21,-11,-155,102,-121,13,70,-10,-138,-62,-148,-323,-72,-4,-67,384,-183,-75,-18,51,52,0,11,97,1000,184,-6,18,-93,69,-25,42,267,-76,-45,-226,-81,57,20,22,-50,8,-113,-11,-6,79,-11,28,27,87,-14,5,23,-2,3,-2,145,84,66,-32,-42,52,-60,36,-18,-34,-107,63,-198,-551,-189,-3,227,28,-127,-4,-41,127,-176,-1,-95,35,27,152,42,42,43,41,-73,13,-108,-140,-24,60,40,-5,-20,-79,-230,-245,-5,-26,-6,36,33,-1,15,-23,-31,-193,21,-15,24,30,43,-14,26,-11,121,139,199,-53,-31,14,74,77,112,268,-63,2,156,308,76,17,0,14,4,0,11,343,-36,14,-87,-171,-2,41,-75,-33,-646,-1298,-725,32,37,-232,-119,-353,-25,-9,-401,-4,12,45,111,53,-83,-118,-81,-52,-5,-18,-16,21,43,50,105,-26,0,-19,-67,-9,47,-2,0,-3,10,-3,-2,-21,-19,-1,12,-8,8,33,54,64,19,-33,-27,-86,-85,44,46,-11,59,75,0,12,-2,-1,5,-2,186,69,-21,-8,-22,73,5,7,0,128,-6,-90,44,-28,34,-388,-235,89,40,-138,-378,-147,-76,51,65,222,-5,53,51,68,-53,58,-63,-5,-11,-5,-7,10,4,63,137,40,234,141,-18,-9,-5,-73,-46,36,44,21,23,-4,-33,-9,0,-27,-1,-4,5,-140,-7,-2,-4,0,-8,92,-1,-48,-26,-70,-78,-78,11,-63,0,-4,0,48,48,-1,72,281,-4,-1,-1,76,143,18,167,57,40,-8,-11,-7,-5,69,63,84,415,64,45,-109,-40,-27,-16,65,63,-49,66,53,56,56,-6,3,-7,-6,-8,35,44,56,-2,54,65,180,0,61,42,43,-24,-18,81,43,-12,10,32,-3,6,39,37,-35,-164,-68,-25,97,96,69,-6,-99,-7,-3,-6,-158,66,37,74,-70,32,59,-94,-136,-65,-60,-11,-2,58,63,53,-16,-3,-86,-43,-75,-4,52,64,70,68,-15,35,-28,-37,0,-3,10,-14,63,-5,21,-20,-74,-67,-86,-7,35,-13,-8,41,31,65,154,62,-11,-19,33,39,37,29,21,42,39,467,6,58,55,41,23,10,50,61,-29,7,7,-53,-78,21,11,56,-50,-56,-18,14,29,49,23,59,45,41,-31,-16,-2,32,-118,-27,51,15,-19,47,-1,94,-1,-155,-77,-26,-11,-20,39,51,-12,114,-10,-201,-164,-97,-36,-4,0,-35,45,-2,-27,-21,-34,-234,0,29,-8,-5,71,62,-41,-4,-30,-21,-10,-2,56,-23,14,-11,49,-25,6,60,71,71,22,-7,-4,-8,14,14,-317,-7,228,55,99,-92,-14,-8,-65,-368,-134,-76,33,55,-4,-12,-20,80,-46,2,104,57,185,140,-3,25,-22,-51,-18,-21,68,-53,22,140,125,-30,-1,81,-22,-20,-75,-42,-19,0,18,-1,-1,56,21,-22,-18,-41,48,0,29,-11,-6,-55,-18,-21,-41,-194,-99,56,129,-2,15,-1,-17,-47,-10,131,49,-30,-105,-116,-1,57,0,-3,-20,-17,62,68,-20,30,-5,-28,-91,-171,-74,-69,22,36,-19,61,-8,-110,-33,-77,-18,-205,-106,27,-25,62,-121,-150,-65,-6,72,72,57,5,36,0,-31,-17,145,-4,88,-30,75,85,39,38,-5,33,-5,-9,-2,-188,-48,29,32,-25,36,-2,-59,2,-9,11,-33,49,-15,-14,-31,-211,-122,-20,-12,-67,-32,-1,42,-8,-75,-43,-2,0,78,-14,17,-136,253,-31,-101,-380,-105,-1,42,23,-4,-46,-46,64,-7,-38,-22,37,44,37,-32,-43,-58,37,27,-7,-11,14,109,56,-13,-5|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,20,10,10,10,90,20,30,140,10,30,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,30,20,10,10,10,10,10,10,10,10,50,20,20,10,20,20,10,10,10,10,10,10,10,10,10,10,10,30,20,10,10,10,10,10,40,10,10,10,10,10,10,20,20,10,10,20,10,10,20,10,20,30,10,20,10,10,40,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,40,10,10,10,10,10,10,20,20,10,10,10,10,10,10,20,10,30,10,20,30,10,10,50,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,10,20,10,20,10,10,10,10,10,20,10,10,20,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,40,10,10,10,10,50,10,10,20,10,60,10,20,10,10,10,30,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,30,10,10,10,20,10,10,10,20,10,10,10,10,10,10,10,10,20,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,30,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10|-97,-25,-103,-109,-104,-28,-6,167,37,-29,-123,-107,-11,-10,-21,-17,21,34,28,-2,-33,-7,44,95,83,109,64,-123,-118,-1,-13,55,2,-17,50,8,-34,-26,-24,-89,-17,-16,-24,55,38,29,-22,-14,-32,-12,-1,77,-3,44,47,-25,-29,-2,26,71,27,21,52,-108,-82,-86,-30,104,46,-39,-99,-64,-12,-179,63,47,-20,-49,-6,-28,-6,-3,-5,-4,17,59,-16,-16,-1,33,91,47,-10,25,96,59,-92,-62,-25,-6,44,-2,-6,-95,-18,-56,-12,-36,-42,-11,-12,36,40,-39,-44,0,173,58,-20,-4,22,49,62,77,-46,-14,-24,108,-10,-127,-8,66,-13,-42,-139,-82,-17,52,-125,0,-20,-23,76,97,57,44,50,50,65,51,78,11,-160,43,120,-50,-57,-10,17,50,-11,-124,-139,-42,-21,-53,29,30,-10,-97,-49,-3,-15,-7,79,1000,-5,-17,0,-9,-40,-24,40,-8,-14,-9,0,-21,-11,-12,173,105,-12,63,-10,52,-6,294,338,-14,-94,-65,-19,-50,-64,-6,-1,-97,329,30,-36,-25,-22,-112,-65,-65,-9,250,110,0,57,16,-56,-51,-9,25,185,-26,33,66,1,212,-44,-7,-20,67,50,-68,46,-23,36,34,5,-30,-84,81,-27,-31,-60,-4,-8,58,-23,-15,4,-34,-12,70,27,-58,10,-3,-5,-44,-2,28,-5,-2,-22,-6,-6,-3,42,-3,57,-3,3,66,351,16,187,48,-190,-104,-261,-132,-5,123,141,17,32,87,25,64,-51,-273,-135,57,-32,324,150,115,-4,-15,-168,-195,-63,-2,20,4,-65,4,-25,-170,-28,-30,15,-13,51,11,18,32,-14,-35,-144,-1,-60,-18,-79,-7,-76,19,-9,25,-52,0,-42,-10,-2,32,69,-16,-11,16,-8,-8,-1,-15,46,49,65,-1,-5,-9,-6,-16,41,43,-1,32,-22,-73,-3,0,-1,-63,-21,91,-59,-32,-37,-8,15,-9,-49,-209,-58,-47,-66,-60,-33,-12,-104,-1,-81,-31,-156,-2,-40,-6,-13,92,-3,-2,31,-118,-331,-166,-25,-32,44,120,-3,16,38,2,-48,-3,10,-7,36,-60,-25,-20,-19,68,39,39,24,-1,49,22,-20,33,-73,-98,5,-5,14,2,-12,-357,-40,-19,-3,0,-19,-6,20,-19,-138,-24,-158,-92,0,0,-28,-23,-13,-56,19,-21,-14,-43,22,-212,-104,-137,-74,-12,8,-13,-9,-109,-166,-293,-170,-54,-210,-99,-37,-98,-339,-215,-42,-3,-317,-450,-125,-77,-76,29,-4,-7,-45,-45,-95,63,106,-8,-51,-113,-107,-7,107,110,66,-168,101,-84,-21,-58,36,-34,-4,2,119,123,22,-2,-627,-75,-33,-14,79,28,0,-17,-111,-350,-234,-40,13,0,-6,-7,-373,-73,-99,-40,0,0,51,31,11,-29,-11,-11,-141,-40,31,-47,-12,-76,-22,-17,-58,-58,-196,-110,-186,-43,-30,-117,-17,12,-315,-148,-165,-11,-165,-287,-154,-20,0,-23,83,-90,-6,50,-190,-9,0,-3,-133,-101,-155,-71,-57,-57,-19,-4,143,-148,-226,-125,-22,-67,-52,-6,-109,16,-64,53,22,-72,-161,-116,-429,-126,-1,-20,-76,-5,41,22,-3,24,-111,-32,-86,31,-29,24,25,-7,-180,-142,-80,-294,-24,23,-2,-52,-34,-95,-29,-30,12,-6,71,-25,-5,-13,-11,-37,-14,-26,27,8,109,-1,127,38,-91,35,0,-24,-3,-3,-36,-21,0,124,-50,-183,0,-96,-7,-7,-10,-141,-256,-356,-322,-103,-2,-89,12,129,70,0,31,-45,-114,-48,-19,-88,-75,-2,-54,-1,8,69,38,-13,-61,-4,-63,55,34,-5,-11,0,-1,-14,6,-27,-76,-62,53,43,67,-4,48,-9,117,-36,-56,-17,-19,44,17,0,-19,-4,-6,-33,-6,63,278,-10,30,61,-1,-42,-5,-14,-3,-5,-1,-11,63,-2,-37,-128,-7,91,370,51,-12,-21,52,-2,-89,13,-21,129,26,52,55,-7,14,-62,-277,-196,-83,0,26,14,23,-11,-5,-64,-33,-20,-35,-1,-10,-13,-19,-9,-68,-17,-1,53,-9,45,-15,-11,-77,42,46,-6,-43,-28,-25,-21,-7,-14,31,41,33,-9,-20,338,594,182,-7,-2,12,27,2,90,-1,66,19,65,0,-44,40,8,77,67,-20,-13,23,42,8,-56,-25,-15,26,-79,-73,-201,-86,-8,-88,-113,-34,-32,64,-45,-9,-151,-7,17
OANDA:USDCAD :
USDCAD|20121220|20221220|0.503,-0.128,0.0,-0.383,0.0,1.0,-0.149,0.0,-0.22,0.0|1.151,0.499,0.0,-0.351,0.0,-0.492,0.163,0.0,-0.233,0.0|-0.723,0.493,0.0,-0.209,0.0,0.369,0.723,0.0,-0.206,0.0|0.373,0.141,0.0,0.498,0.0,0.214,0.334,0.0,0.23,0.0|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20|53,-18,-312,-155,-60,-19,-11,-17,-6,-66,-2,-12,-35,22,49,-61,-15,235,-24,-79,-44,62,136,41,16,310,123,148,104,-47,114,159,300,229,82,58,-10,0,-5,-13,-37,-103,891,1000,-3,-47,-123,-19,86,155,-4,-71,-54,-22,-13,-16,-134,-29,71,87,35,-113,-20,-7,-21,-13,-7,279,28,57,8,-32,-54,56,-63,-34,3,-3,69,29,13,18,45,-86,-124,-8,8,-7,-54,-3,42,0,-17,31,-10,-4,-37,-40,-49,-4,-88,69,-42,-6,54,-49,11,-5,-9,116,26,19,33,28,-123,-159,-20,19,24,67,30,132,206,41,33,-100,35,71,5,15,102,136,115,49,-43,59,95,51,51,349,282,88,70,-29,-11,113,51,-7,-12,-28,96,-10,-44,-35,4,104,75,-7,-6,-16,-48,-52,-23,-25,-1,154,-25,25,-116,-18,-34,-43,-55,-3,36,134,68,0,-11,40,-5,-105,-62,-39,-7,47,65,63,39,14,48,-33,-28,-27,16,-132,3,103,-6,196,35,90,23,-8,-35,-29,-2,67,-12,631,142,75,-17,-5,-53,-42,-236,-85,249,150,40,33,71,-15,56,-14,84,-35,41,19,9,0,-54,-14,-16,78,-4,93,86,95,-50,97,-142,19,116,-68,-2,-73,325,0,-53,-29,-291,-65,36,-12,-62,-183,-34,39,62,-16,-22,-5,-13,103,-35,-60,-18,8,-6,41,40,-3,105,-36,-3,0,-16,-65,102,-31,-36,-32,-30,72,-62,63,-22,-11,38,37,-8,-76,-120,-66,87,62,-6,-45,68,-16,-32,-28,-195,63,-3,65,74,-2,-87,-1,-156,-473,-97,-59,156,-53,67,174,-86,30,-13,-25,-77,-1,67,46,59,-33,121,-2,-59,48,-95,-198,-99,19,-8,-101,75,31,5,-29,-236,-198,-223,-25,-95,-111,-42,-13,-5,36,-3,-17,-324,-153,-156,-25,-27,-13,14,92,-6,-8,-16,-5,-26,79,72,-31,4,140,-31,-27,-7,-40,-16,-7,34,-6,-20,90,-47,-12,-11,98,-15,-13,-92,-24,15,-33,-52,-117,-7,123,-24,-3,-57,19,17,-42,-86,-23,63,-34,51,-11,-40,-2,20,-51,-98,-210,31,-83,-102,-15,51,-29,0,-3,-297,-7,36,-32,-35,83,-35,-134,-141,-157,-151,-56,73,-22,-25,-4,75,-84,-152,-1,-150,-28,-80,15,2,-135,-27,-7,-6,0,-17,-12,-3,-3,-13,-10,-2,-1,-3,16,-70,-11,-9,71,-147,36,136,-45,-38,77,-5,55,-44,-5,-5,-19,51,-4,-12,-46,-9,-33,14,-43,-14,-57,-9,-15,-113,46,31,33,84,-63,-51,10,-202,-23,25,-3,122,170,-81,-104,-32,64,-78,-8,-38,95,-19,-64,-197,-77,-133,-29,-10,-32,-43,-55,115,24,-89,-89,-31,-24,-17,-73,-171,-22,49,12,-7,63,92,52,-50,-45,-58,-6,-16,-45,-18,21,-37,-42,-24,-93,-219,-17,-7,37,-9,-24,-30,0,-46,-102,-173,-16,65,-1,-34,1,-4,-8,-77,-66,-216,-14,54,-30,-11,-39,-2,-44,-119,8,-56,-106,64,-12,-16,0,-148,-53,79,-20,-56,-34,50,-23,-37,-136,-28,-14,-20,68,153,60,-7,-50,-6,-80,-46,47,-17,-116,135,113,-8,-162,-276,-107,-75,12,-114,-29,291,25,-9,61,-239,-33,-28,-30,-33,-10,57,49,-11,-1,-18,-26,-14,-31,-160,62,-55,44,38,36,-1,-13,-54,-129,-107,-6,-21,-104,-3,-22,-15,50,-19,-10,-97,-37,-8,-2,-47,-2,-55,-127,-85,-45,-44,-16,-61,-25,-44,-4,-16,-63,-4,-26,-66,-57,-9,46,28,-8,-11,-3,27,-75,-102,-51,-53,-19,22,41,-41,-6,-1,-18,-96,-4,-4,-22,-50,-1,-138,-16,53,-122,-349,-70,-20,-51,-46,-197,-14,-87,-21,-35,-243,95,61,-28,-5,-92,-53,-2,-43,-34,-35,-135,12,-12,-19,-63,-124,0,-40,-10,-32,10,-35,-29,-2,-60,-364,-19,71,-7,0,39,-131,-8,-59,-18,-16,-136,-17,-7,-4,-65,-37,-4,-26,48,11,-23,-201,-61,-12,-109,-10,3,-2,-5,558,12,-216,-21,44,-148,-1,-2,-61,54,185,-9,-1,14,-48,-86,-73,-17,-173,-96,148,110,-18,-66,-249,-46,-152,-41,-12,-71,-255,-28,-20,-29,-517,-25,0,-9,-1,-4,-16,-198,-39,-3,-29,-16,80,-8,-21,-16,-24,-331,-123,-45,-52,35,50,-18,-41,-3,9,48,131,-23,-21,-8,-14,-65,-21,-105,-15,-59,63,-2,-30,-23,-79,-5,0,-5,-149,-50,-51,26,-44,-24,-58,-19,-54,0,-109,-39,-149,-66,-40,-80,-110,-4,-5,-30,107,-11,-228,-13,17,-11,-33,47,-1,-5,151,-2,-26,-3,39,-72,-181,-5,-33,9,73,74,-26,-72,-3,-4,-19,-2,-37,64,-16,-36,-20,-5,-20,-96,-120,-80,25,-24,-4,-29,-31,87,-55,-28,-15,-60,-9,-116,-271,-307,-147,-23,-14,-8,44,-15,-15,-17,-9,-18,-141,-64,-59,-133,11,-126,-42,65,-33,72,38,-70,-24,-79,49,25,-151,-2,-48,-38,41,-27,-3,-2,-19,-3,-108,-9,-84,-150,-118,-65,-286,-111,-8,165,-45,110,137,-6,-19,-55,-52,60,5,48,270,89,105|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10|-161,-70,111,67,-162,-38,-90,-134,18,-63,-66,-87,-33,-3,-13,-54,-58,-233,-88,-17,-144,-177,-76,-79,-8,-59,-151,-318,-62,-381,-113,0,-845,-93,-218,-81,-74,-190,-100,-41,10,-193,-1207,-87,-32,130,93,-349,-449,-205,-43,129,-269,-147,171,-7,125,-31,-392,-476,-200,58,144,-10,-37,-505,-28,-20,117,-20,266,-7,-46,-173,79,-206,-22,-361,-110,-158,-2,-108,-532,-90,-81,66,65,-7,-115,-85,-8,-11,-66,-68,20,-36,-72,-68,-4,-65,-40,-232,77,127,-116,87,-27,-23,-150,-47,-8,35,-54,-223,26,-251,-1,-364,-188,-109,-187,-137,-111,-228,-262,26,-193,-258,-8,-55,-252,0,-43,-807,-691,-642,-4,-25,-50,-2,-103,-613,-211,-357,-2,-11,-40,-175,-278,-110,34,-7,-556,-21,-29,-43,0,-245,-363,-4,-73,61,-9,-275,-329,-190,-58,-199,374,-15,-11,-43,-35,-187,-49,-212,-167,-495,-327,-48,102,-13,-184,-28,-185,-75,-416,-389,-204,-270,-172,-98,-33,-11,-637,-78,-142,-159,-32,-15,-10,104,-49,100,-252,-103,-58,-63,-245,-21,140,157,149,-46,-160,-203,100,29,-297,-220,58,160,-315,-51,-149,-22,23,-83,-282,47,-118,-143,-56,544,-40,-139,-582,-175,-272,-145,-54,-102,-301,-158,-26,-206,-466,-149,-304,-22,-16,-289,-8,247,112,197,-412,-33,91,100,129,113,-153,-223,0,-263,-34,-26,-274,293,-91,-739,-945,-260,-22,-9,-208,-205,-13,-198,-207,-220,-686,-126,-208,121,-496,-353,-686,-96,-413,-8,0,-411,-34,-126,181,52,-404,-416,-398,1,-237,-815,-38,117,77,-19,-22,71,119,-158,-2,-27,-56,182,-50,-87,-167,-751,-282,-416,-302,-11,-174,-153,-83,-57,-104,-24,-236,-568,-224,-60,-95,-97,-98,-175,-83,-343,-128,-166,-115,-75,-64,-28,-55,-216,232,-21,-153,-280,112,219,-29,-8,-40,-176,-60,192,108,-118,-531,-528,263,9,-60,-251,-115,-2,-177,-228,-903,-597,-168,-83,-284,-43,27,-134,-15,-146,-1055,-307,-5,-151,-146,-256,-4,-44,-164,-29,-75,-38,126,-38,-68,-423,-178,-231,-10,86,-56,-134,-14,-4,154,-149,-136,141,39,95,-16,-102,90,-14,-118,-92,-228,-253,-165,-269,53,-200,-248,-271,318,-405,-292,-131,-56,-236,-498,-487,-119,-230,154,134,-272,-59,152,-230,-228,-330,205,-85,-177,-95,-16,-74,-101,-271,-3,-143,-237,-326,-55,118,140,-56,-356,-292,-101,108,-15,-374,134,-84,426,-51,-216,-474,-667,-42,-70,-177,-16,-38,-154,-37,-91,-472,-450,-302,23,386,-216,-143,-112,-96,-51,-399,-13,-14,-9,-17,-711,-460,-572,-249,-228,-115,-38,-35,57,-71,-90,-864,-215,132,90,93,-29,-5,-20,282,-162,-293,-6,40,136,-116,-17,68,-165,18,-175,-107,-368,200,-4,-285,-743,-361,-234,79,-149,-313,-71,144,-780,-406,-839,-77,-121,90,-48,-5,-87,-57,-137,-321,-597,-258,-64,222,-148,96,-279,-369,-10,-62,-112,-32,-106,98,-15,-39,-483,-47,-2,-47,51,81,-32,147,-11,-249,-319,-277,-189,-45,289,155,-5,-7,-200,-43,-863,-25,-64,454,143,-131,-48,-637,-257,-21,36,813,371,64,0,46,-162,-805,-550,-5,83,198,0,-234,-523,-299,-484,-424,-200,-96,101,182,-6,-101,-84,-101,-63,-130,-130,-143,-192,-276,-394,-64,-265,-42,-19,-283,-77,-94,-300,-205,-164,-408,93,381,-65,-59,-527,-362,-109,-70,-62,401,700,-246,-63,-153,-203,-112,162,-32,-31,-93,-38,-100,-203,-73,-8,-90,-241,-80,-99,45,188,-64,-282,-33,-187,-58,-151,-11,-11,155,-28,-20,-102,-5,-65,-241,96,-117,223,155,-14,-90,105,-148,318,-91,66,-85,105,-9,111,-263,-56,113,156,197,-32,-263,-424,-314,-113,-205,-342,-33,-29,240,-27,-14,-268,-37,-203,-1085,-66,-267,-650,-525,-20,-16,-96,140,-52,-22,-51,-305,-40,-141,-44,-5,90,-65,-72,-28,-160,-147,-198,-1,82,-32,304,-55,-129,-23,-213,-2,-17,-14,-14,50,999,-132,-58,-97,-54,-145,59,-120,-130,375,368,484,-60,-149,-404,-27,-61,-165,210,106,-74,-161,240,-231,-74,-103,-23,-6,128,-10,-180,-439,187,328,153,280,-13,-75,236,-5,-28,-42,139,109,-9,-38,-19,141,-62,-83,-279,-163,-825,-10,69,-63,56,-73,141,188,139,-1774,-2845,-281,-2,-58,-14,-81,-36,196,89,-118,-319,-31,53,-45,-4,-82,-361,-25,-149,-263,-23,-49,-128,60,-82,-79,-97,-93,395,-1,-42,21,-22,-55,-247,0,164,258,912,-182,183,-78,-4,170,-51,-45,345,565,190,331,176,-380,-7,84,-46,-186,-200,112,-7,-72,66,-128,-82,-21,-34,-185,-1,-150,-93,-3,116,-5,-64,-18,-105,-87,-131,-77,-73,-57,137,-46,-8,-164,-101,-62,-108,-142,18,-35,-83,-5,77,-13,133,-1,83,-16,-72,-127,-87,-52,-26,-29,0,-50,87,103,-9,-206,27,-191,-54,-285,-255,-261,-197,-1,170,-64,-87,-42,-12,-133,-328,-293,-419,-110,-109,-39,115,56,-183,-3,-367,-159,-162,92,-17,-25,-91,-18,-19,-61,282,-28,-108,338,-107,110,-125,-163,-66,-242,-294,-667,-416,-435,-2,-43,-43,-295,-10,-105,-203,-133,-149
For more models, see a link on bio (description length limitation in this description restricts me to publish more).
Unimportant details
===============
“Neon” is the project code name, “J” is the iteration (versions “A” to “I” all led to a solid “J”)
Formatting options here make formatting very difficult, so forgive me poor readability.
Fund MasterFund Master, Revision 1, 3Apr2022
A. About Fund Master
1. An Oscillator with values between -100 to 100, with intention to simulate Fund inflow and outflow.
2. Presented itself in the form of solid candles without upper and lower tails.
B. Features and Setting
1. Fund Master(FM) will show up by default.
2. User has the option to turn Fund Master Bull Bear Line(BBL), and the label. Label text size is adjustable.
3. User has the option to turn on FM crossover BBL (alert text is coB) or FM crossunder BBL (alert text is cuB)
4. User has the option to turn on FM crossover 0 (alert text is co0) or FM crossunder 0 (alert text is cu0)
5. Band 0 will be shown(default), user can turn on additional band with user input value
6. Table will be shown(default), provides information on Indicator Name, FM values, FM Turn Green/Turn Red status,
FM crossover/crossunder status.
7. Alertcondition features are included. User can set the alert using the Create Alert (the Clock Icon).
The alerts includes : FM crossover or crossunder BBL, FM crossover or crossunder 0, FM turns Green, FM turns Red.
C. Using the Indicator
1. Band 0, baseline to tell if a stocks is potentially moving into bullish trend(above 0) or into bearish trend(0).
Band 0, approximately exponential 30 day of closing price(EMA30). User may use EMA30 on price chart as reference.
2. BBL, baseline to tell if fund is moving in or moving out. Above BBL means inflow of fund, vice versa.
BBL, approximately exponential 20d ay of closing price. User may use EMA20 on price chart as reference.
3. Below Band 0
After FM crossunder 0 and continues to move down, it means outflow of fund, while fund is reducing,
chips are potentially accumulated during this stage.
After FM hitting the minimum, rebounds and moving up, but still below BBL, chips are potentially being accumulated.
User can use Chips Master to visualise the chips accumulation stage.
When FM crossover BBL and continues to move up, it means inflow of fund in pushing up the stock price.
4. Above Band 0
After FM crossover 0, continues to move up and stays above BBL, stocks potentially moving into bullish trend with inflow of fund.
During retrace, FM may turn from Green to Red and moves sideways, and FM may turn from Red to Green when stocks price rebounds.
User can set the alert to notify on FM turn Red/turn red (as mentioned in Section B, point 7)
5. User can use MCDX Plus to visualise the increase or decrease of Profitable Level as shown by the Red Bar.
User can look and golden cross or death cross of Moving Average of Profitable Chips and Locked Chips.
Death cross, stock trend most likely moving into chips accumulating stage, FM may move down towards 0 or moving down below 0.
Golden cross, stock trend most likely moving into bullish trend, FM may move up towards 0 or moving up above 0.
6. Top Deviation and Bottom Deviation
FM has the potential ability to demonstrate Top Deviation (Stock Price is moving up while FM is moving down) as well as
Bottom Deviation (Stocks price is moving down or sideway while FM is moving up).
This helps to prepare user to buy during Bottom Deviation or sell during Top Deviation.
It is not perfect, user needs to use their technical analysis judgement.
D. Smart Money System
Indicators published includes : Chips Master, BBD Master, MCDX Plus, Trend Master, Ladder Master, Deviation Master, Fund Master
Chips Master for studying chips accumulating by banker/smart money
BBD Master for studying the big buy net deviation by banker/smart money
MCDX Plus for studying the profitable and locked chips
Trend Master for studying the Price Trends
Ladder Master for studying the Trends reversal (mid term) and short term entry/exit
Deviation Master for studying the Top and Bottom Deviation.
Fund Master for studying fund inflow/outflow, chips accumulating, price push up, top deviation and bottom deviation.
E. Disclaimer :
1. Attached chart is for the purpose of illustrating the use of indicator, no recommendation of buy/sell.
2. Based on feedback, there may be unethical individual with no respects of author's effort and originality, either.
a. claiming the published indicators as theirs, for their own business purposes, or
b. claiming paying the author to develop the scripts, for their own business purposes, or
c. Copy and modify the scripts for their own business purposes
This scripts is locked for the time being to prevent those unethical malpractice.
Public users are welcome to use indicator for their technical analysis.
BKN: Thick CutThick Cut is the juiciest BKN yet. This indicator is created to take a profitable trading strategy and turn it into an automated system. We've built in several pieces that professional traders use every day and turned it into an algo that produces on timeframes as low as 1, 3, and 5 minutes!
Limit Order Entries: When criteria is met, an alert is signaled that will send a value to enter a position at a limit price.
Built in Stop Loss: A stop is built in and the value can be sent to your bot using the {{plot}} function or you can rely on a TradingView alert when the stop is hit.
Built in Take Profits: We've built in two separate take profits and the ability to move your stop loss to breakeven after the first take profit is hit. Even if you take 50% profit at 1R and move your stop loss, you already have a profitable trade. Test results show 50% profits at 2R and the remainder at higher returns result in exceptional results.
Position Sizing: We've built in a position size based on your own predetermined risk. Want to risk $100 per trade? Great, put in 100 in the inputs and reference a quantity of {{plot("Position Size")}} in your alert to send a position size to the bot. You can also reference {{plot("Partial Close")}} to pull 50% of the position size closing 50% at TP1 and 50% at TP2.
Backtest results shown are very short term since we are viewing a 15m chart. This can be a profitable strategy on many timeframes, but lower timeframes will maximize results.
A unique script with incredible results. Further forward testing is live.
***IMPORTANT***
For access, please do not comment below. Comments here will not be replied to. Please send a DM here or on my linked Twitter . At this time, this strategy is considered a Beta release as we continue to fine tune settings and more. Expecting 2 weeks of beta with official release around June 6.
Crypto Tipster Study / Alerts -theCrypster===========
Crypto Tipster Study with Alerts
===========
Our Crypto Tipster Study with Alerts Script is a carbon copy of our tried and tested Crypto Tipster Pro Strategy , but now with the option of setting TradingView Alerts for your chosen trading plan. Making missing trades a thing of the past, and helping you to automate your own trading strategy.
-----------
Crypto Tipster Pro is a trading strategy with indicators based on Technical Analysis, Price Action and Momentum Swings for TradingView's charting platform.
We've compiled and continue to update a trading strategy that adapts to changes in the market; with custom indicator settings, fixed SL/TP, Trailing Stop, Safe Mode, Heikin Ashi Confirmation and more!
Our efforts have been focused towards the 1D time frame - using a larger time frame benefits most part-time or evening traders in multiple ways, catching bigger swings and earning a higher percentage per trade, the ability to reduce or remove any leverage associated with the trade, and only having to place a trade or move a stop loss ONCE per day ~ Meaning you are still able to go to work, tidy the house, play with the kids AND be a successful trader.
-----------
What's Included within Crypto Tipster Pro?
Crypto Tipster Pro comes with a host of features and is being continually updated, these features include (but are not limited to):
- Date Range Settings
Setting custom Start/End dates can help hone your strategy to suit the current times, or get a general overview of the market over the years.
- Heikin Ashi Confirmation
We added HA confirmation for both Entry & Exit of trades. This started as a form of "Safe Mode", we have since adapted this mode beyond Heikin Ashi; but kept this confirmation as an added extra.
- Variable Indicator Settings
As well as our Fixed Indicators and Price Action analysis going on in the background of the strategy, we've also included some Variable Indicators that you have access to edit.
Trend Detection Length for detecting trend! Higher numbers detect longer trends, but will inevitably make fewer trades and possibly miss the start of a new trend; a lower length will create more opportunities to trade but may get confused when ranging in choppy markets.
Range Short/Long Lengths are used for detecting percentage price movements over a given number of bars back. This enables you to effectively "zoom in" on market data and catch trends within trends.
- Safe Mode
Enabling Safe Mode will add a couple more confirmation indicators to the strategy - the aim of Safe Mode is, in essence, to remove any trading signals that would end of being false/bad moves. Usually resulting in less Overall Trades, a higher Net Profit, higher % Profitable, higher Profit Factor AND a lower Drawdown.
- Stop Loss/Take Profit Settings
This is where Crypto Tipster Pro really proves itself, Money Management. We have an editable Fixed SL/TP, as well as Trailing Stops for Long or Short orders, all of which you can use on their own, or combined with each other. Playing with these settings can turn an un-profitable system into a very-profitable system!
- Custom Stop Loss Indicator
This is a little extra indicator that we have found very useful over the years of trading markets, a custom Stop Loss Indicator. Simply turn it on, enter the price you want to calculate from, tick Long or Short, enter a % movement and watch as your new stop loss level is plotted on the chart. This is especially useful for when the strategy doesn't marry up with the prices you've actually obtained (for better or for worse!)
-----------
What's Included within Crypto Tipster Study / Alerts Script?
Our Study script will find Entry and Exit points exactly as our Pro Strategy would find them. The same indicators, methods and chart reading techniques are used, there are 2 big differences however...
The first difference is that our Pro Strategy has the ability to manage your money, Fixed Stops, Take Profit and Trailing Stops to name just a few. Our Study does not (and cannot) have these functions added due to the way TradingView's charting platform operates.
That's the bad news, the good news for our Crypto Tipster Study Script is that you can add Alerts to your trading plan! This is super handy if you decide to implement our methods into various time frames other than 1D and are looking for Intra-day alerts, or if you're looking to Automate your trading strategy using external software.
Help and Advice for setting up Alerts or to Automate your Strategy can be found on our website.
----------
For more information on the Crypto Tipster Pro Strategy visit the link in our signature.
Good Luck and Happy Trading!
Backtesting & Trading Engine [PineCoders]The PineCoders Backtesting and Trading Engine is a sophisticated framework with hybrid code that can run as a study to generate alerts for automated or discretionary trading while simultaneously providing backtest results. It can also easily be converted to a TradingView strategy in order to run TV backtesting. The Engine comes with many built-in strats for entries, filters, stops and exits, but you can also add you own.
If, like any self-respecting strategy modeler should, you spend a reasonable amount of time constantly researching new strategies and tinkering, our hope is that the Engine will become your inseparable go-to tool to test the validity of your creations, as once your tests are conclusive, you will be able to run this code as a study to generate the alerts required to put it in real-world use, whether for discretionary trading or to interface with an execution bot/app. You may also find the backtesting results the Engine produces in study mode enough for your needs and spend most of your time there, only occasionally converting to strategy mode in order to backtest using TV backtesting.
As you will quickly grasp when you bring up this script’s Settings, this is a complex tool. While you will be able to see results very quickly by just putting it on a chart and using its built-in strategies, in order to reap the full benefits of the PineCoders Engine, you will need to invest the time required to understand the subtleties involved in putting all its potential into play.
Disclaimer: use the Engine at your own risk.
Before we delve in more detail, here’s a bird’s eye view of the Engine’s features:
More than 40 built-in strategies,
Customizable components,
Coupling with your own external indicator,
Simple conversion from Study to Strategy modes,
Post-Exit analysis to search for alternate trade outcomes,
Use of the Data Window to show detailed bar by bar trade information and global statistics, including some not provided by TV backtesting,
Plotting of reminders and generation of alerts on in-trade events.
By combining your own strats to the built-in strats supplied with the Engine, and then tuning the numerous options and parameters in the Inputs dialog box, you will be able to play what-if scenarios from an infinite number of permutations.
USE CASES
You have written an indicator that provides an entry strat but it’s missing other components like a filter and a stop strategy. You add a plot in your indicator that respects the Engine’s External Signal Protocol, connect it to the Engine by simply selecting your indicator’s plot name in the Engine’s Settings/Inputs and then run tests on different combinations of entry stops, in-trade stops and profit taking strats to find out which one produces the best results with your entry strat.
You are building a complex strategy that you will want to run as an indicator generating alerts to be sent to a third-party execution bot. You insert your code in the Engine’s modules and leverage its trade management code to quickly move your strategy into production.
You have many different filters and want to explore results using them separately or in combination. Integrate the filter code in the Engine and run through different permutations or hook up your filtering through the external input and control your filter combos from your indicator.
You are tweaking the parameters of your entry, filter or stop strat. You integrate it in the Engine and evaluate its performance using the Engine’s statistics.
You always wondered what results a random entry strat would yield on your markets. You use the Engine’s built-in random entry strat and test it using different combinations of filters, stop and exit strats.
You want to evaluate the impact of fees and slippage on your strategy. You use the Engine’s inputs to play with different values and get immediate feedback in the detailed numbers provided in the Data Window.
You just want to inspect the individual trades your strategy generates. You include it in the Engine and then inspect trades visually on your charts, looking at the numbers in the Data Window as you move your cursor around.
You have never written a production-grade strategy and you want to learn how. Inspect the code in the Engine; you will find essential components typical of what is being used in actual trading systems.
You have run your system for a while and have compiled actual slippage information and your broker/exchange has updated his fees schedule. You enter the information in the Engine and run it on your markets to see the impact this has on your results.
FEATURES
Before going into the detail of the Inputs and the Data Window numbers, here’s a more detailed overview of the Engine’s features.
Built-in strats
The engine comes with more than 40 pre-coded strategies for the following standard system components:
Entries,
Filters,
Entry stops,
2 stage in-trade stops with kick-in rules,
Pyramiding rules,
Hard exits.
While some of the filter and stop strats provided may be useful in production-quality systems, you will not devise crazy profit-generating systems using only the entry strats supplied; that part is still up to you, as will be finding the elusive combination of components that makes winning systems. The Engine will, however, provide you with a solid foundation where all the trade management nitty-gritty is handled for you. By binding your custom strats to the Engine, you will be able to build reliable systems of the best quality currently allowed on the TV platform.
On-chart trade information
As you move over the bars in a trade, you will see trade numbers in the Data Window change at each bar. The engine calculates the P&L at every bar, including slippage and fees that would be incurred were the trade exited at that bar’s close. If the trade includes pyramided entries, those will be taken into account as well, although for those, final fees and slippage are only calculated at the trade’s exit.
You can also see on-chart markers for the entry level, stop positions, in-trade special events and entries/exits (you will want to disable these when using the Engine in strategy mode to see TV backtesting results).
Customization
You can couple your own strats to the Engine in two ways:
1. By inserting your own code in the Engine’s different modules. The modular design should enable you to do so with minimal effort by following the instructions in the code.
2. By linking an external indicator to the engine. After making the proper selections in the engine’s Settings and providing values respecting the engine’s protocol, your external indicator can, when the Engine is used in Indicator mode only:
Tell the engine when to enter long or short trades, but let the engine’s in-trade stop and exit strats manage the exits,
Signal both entries and exits,
Provide an entry stop along with your entry signal,
Filter other entry signals generated by any of the engine’s entry strats.
Conversion from strategy to study
TradingView strategies are required to backtest using the TradingView backtesting feature, but if you want to generate alerts with your script, whether for automated trading or just to trigger alerts that you will use in discretionary trading, your code has to run as a study since, for the time being, strategies can’t generate alerts. From hereon we will use indicator as a synonym for study.
Unless you want to maintain two code bases, you will need hybrid code that easily flips between strategy and indicator modes, and your code will need to restrict its use of strategy() calls and their arguments if it’s going to be able to run both as an indicator and a strategy using the same trade logic. That’s one of the benefits of using this Engine. Once you will have entered your own strats in the Engine, it will be a matter of commenting/uncommenting only four lines of code to flip between indicator and strategy modes in a matter of seconds.
Additionally, even when running in Indicator mode, the Engine will still provide you with precious numbers on your individual trades and global results, some of which are not available with normal TradingView backtesting.
Post-Exit Analysis for alternate outcomes (PEA)
While typical backtesting shows results of trade outcomes, PEA focuses on what could have happened after the exit. The intention is to help traders get an idea of the opportunity/risk in the bars following the trade in order to evaluate if their exit strategies are too aggressive or conservative.
After a trade is exited, the Engine’s PEA module continues analyzing outcomes for a user-defined quantity of bars. It identifies the maximum opportunity and risk available in that space, and calculates the drawdown required to reach the highest opportunity level post-exit, while recording the number of bars to that point.
Typically, if you can’t find opportunity greater than 1X past your trade using a few different reasonable lengths of PEA, your strategy is doing pretty good at capturing opportunity. Remember that 100% of opportunity is never capturable. If, however, PEA was finding post-trade maximum opportunity of 3 or 4X with average drawdowns of 0.3 to those areas, this could be a clue revealing your system is exiting trades prematurely. To analyze PEA numbers, you can uncomment complete sets of plots in the Plot module to reveal detailed global and individual PEA numbers.
Statistics
The Engine provides stats on your trades that TV backtesting does not provide, such as:
Average Profitability Per Trade (APPT), aka statistical expectancy, a crucial value.
APPT per bar,
Average stop size,
Traded volume .
It also shows you on a trade-by-trade basis, on-going individual trade results and data.
In-trade events
In-trade events can plot reminders and trigger alerts when they occur. The built-in events are:
Price approaching stop,
Possible tops/bottoms,
Large stop movement (for discretionary trading where stop is moved manually),
Large price movements.
Slippage and Fees
Even when running in indicator mode, the Engine allows for slippage and fees to be included in the logic and test results.
Alerts
The alert creation mechanism allows you to configure alerts on any combination of the normal or pyramided entries, exits and in-trade events.
Backtesting results
A few words on the numbers calculated in the Engine. Priority is given to numbers not shown in TV backtesting, as you can readily convert the script to a strategy if you need them.
We have chosen to focus on numbers expressing results relative to X (the trade’s risk) rather than in absolute currency numbers or in other more conventional but less useful ways. For example, most of the individual trade results are not shown in percentages, as this unit of measure is often less meaningful than those expressed in units of risk (X). A trade that closes with a +25% result, for example, is a poor outcome if it was entered with a -50% stop. Expressed in X, this trade’s P&L becomes 0.5, which provides much better insight into the trade’s outcome. A trade that closes with a P&L of +2X has earned twice the risk incurred upon entry, which would represent a pre-trade risk:reward ratio of 2.
The way to go about it when you think in X’s and that you adopt the sound risk management policy to risk a fixed percentage of your account on each trade is to equate a currency value to a unit of X. E.g. your account is 10K USD and you decide you will risk a maximum of 1% of it on each trade. That means your unit of X for each trade is worth 100 USD. If your APPT is 2X, this means every time you risk 100 USD in a trade, you can expect to make, on average, 200 USD.
By presenting results this way, we hope that the Engine’s statistics will appeal to those cognisant of sound risk management strategies, while gently leading traders who aren’t, towards them.
We trade to turn in tangible profits of course, so at some point currency must come into play. Accordingly, some values such as equity, P&L, slippage and fees are expressed in currency.
Many of the usual numbers shown in TV backtests are nonetheless available, but they have been commented out in the Engine’s Plot module.
Position sizing and risk management
All good system designers understand that optimal risk management is at the very heart of all winning strategies. The risk in a trade is defined by the fraction of current equity represented by the amplitude of the stop, so in order to manage risk optimally on each trade, position size should adjust to the stop’s amplitude. Systems that enter trades with a fixed stop amplitude can get away with calculating position size as a fixed percentage of current equity. In the context of a test run where equity varies, what represents a fixed amount of risk translates into different currency values.
Dynamically adjusting position size throughout a system’s life is optimal in many ways. First, as position sizing will vary with current equity, it reproduces a behavioral pattern common to experienced traders, who will dial down risk when confronted to poor performance and increase it when performance improves. Second, limiting risk confers more predictability to statistical test results. Third, position sizing isn’t just about managing risk, it’s also about maximizing opportunity. By using the maximum leverage (no reference to trading on margin here) into the trade that your risk management strategy allows, a dynamic position size allows you to capture maximal opportunity.
To calculate position sizes using the fixed risk method, we use the following formula: Position = Account * MaxRisk% / Stop% [, which calculates a position size taking into account the trade’s entry stop so that if the trade is stopped out, 100 USD will be lost. For someone who manages risk this way, common instructions to invest a certain percentage of your account in a position are simply worthless, as they do not take into account the risk incurred in the trade.
The Engine lets you select either the fixed risk or fixed percentage of equity position sizing methods. The closest thing to dynamic position sizing that can currently be done with alerts is to use a bot that allows syntax to specify position size as a percentage of equity which, while being dynamic in the sense that it will adapt to current equity when the trade is entered, does not allow us to modulate position size using the stop’s amplitude. Changes to alerts are on the way which should solve this problem.
In order for you to simulate performance with the constraint of fixed position sizing, the Engine also offers a third, less preferable option, where position size is defined as a fixed percentage of initial capital so that it is constant throughout the test and will thus represent a varying proportion of current equity.
Let’s recap. The three position sizing methods the Engine offers are:
1. By specifying the maximum percentage of risk to incur on your remaining equity, so the Engine will dynamically adjust position size for each trade so that, combining the stop’s amplitude with position size will yield a fixed percentage of risk incurred on current equity,
2. By specifying a fixed percentage of remaining equity. Note that unless your system has a fixed stop at entry, this method will not provide maximal risk control, as risk will vary with the amplitude of the stop for every trade. This method, as the first, does however have the advantage of automatically adjusting position size to equity. It is the Engine’s default method because it has an equivalent in TV backtesting, so when flipping between indicator and strategy mode, test results will more or less correspond.
3. By specifying a fixed percentage of the Initial Capital. While this is the least preferable method, it nonetheless reflects the reality confronted by most system designers on TradingView today. In this case, risk varies both because the fixed position size in initial capital currency represents a varying percentage of remaining equity, and because the trade’s stop amplitude may vary, adding another variability vector to risk.
Note that the Engine cannot display equity results for strategies entering trades for a fixed amount of shares/contracts at a variable price.
SETTINGS/INPUTS
Because the initial text first published with a script cannot be edited later and because there are just too many options, the Engine’s Inputs will not be covered in minute detail, as they will most certainly evolve. We will go over them with broad strokes; you should be able to figure the rest out. If you have questions, just ask them here or in the PineCoders Telegram group.
Display
The display header’s checkbox does nothing.
For the moment, only one exit strategy uses a take profit level, so only that one will show information when checking “Show Take Profit Level”.
Entries
You can activate two simultaneous entry strats, each selected from the same set of strats contained in the Engine. If you select two and they fire simultaneously, the main strat’s signal will be used.
The random strat in each list uses a different seed, so you will get different results from each.
The “Filter transitions” and “Filter states” strats delegate signal generation to the selected filter(s). “Filter transitions” signals will only fire when the filter transitions into bull/bear state, so after a trade is stopped out, the next entry may take some time to trigger if the filter’s state does not change quickly. When you choose “Filter states”, then a new trade will be entered immediately after an exit in the direction the filter allows.
If you select “External Indicator”, your indicator will need to generate a +2/-2 (or a positive/negative stop value) to enter a long/short position, providing the selected filters allow for it. If you wish to use the Engine’s capacity to also derive the entry stop level from your indicator’s signal, then you must explicitly choose this option in the Entry Stops section.
Filters
You can activate as many filters as you wish; they are additive. The “Maximum stop allowed on entry” is an important component of proper risk management. If your system has an average 3% stop size and you need to trade using fixed position sizes because of alert/execution bot limitations, you must use this filter because if your system was to enter a trade with a 15% stop, that trade would incur 5 times the normal risk, and its result would account for an abnormally high proportion in your system’s performance.
Remember that any filter can also be used as an entry signal, either when it changes states, or whenever no trade is active and the filter is in a bull or bear mode.
Entry Stops
An entry stop must be selected in the Engine, as it requires a stop level before the in-trade stop is calculated. Until the selected in-trade stop strat generates a stop that comes closer to price than the entry stop (or respects another one of the in-trade stops kick in strats), the entry stop level is used.
It is here that you must select “External Indicator” if your indicator supplies a +price/-price value to be used as the entry stop. A +price is expected for a long entry and a -price value will enter a short with a stop at price. Note that the price is the absolute price, not an offset to the current price level.
In-Trade Stops
The Engine comes with many built-in in-trade stop strats. Note that some of them share the “Length” and “Multiple” field, so when you swap between them, be sure that the length and multiple in use correspond to what you want for that stop strat. Suggested defaults appear with the name of each strat in the dropdown.
In addition to the strat you wish to use, you must also determine when it kicks in to replace the initial entry’s stop, which is determined using different strats. For strats where you can define a positive or negative multiple of X, percentage or fixed value for a kick-in strat, a positive value is above the trade’s entry fill and a negative one below. A value of zero represents breakeven.
Pyramiding
What you specify in this section are the rules that allow pyramiding to happen. By themselves, these rules will not generate pyramiding entries. For those to happen, entry signals must be issued by one of the active entry strats, and conform to the pyramiding rules which act as a filter for them. The “Filter must allow entry” selection must be chosen if you want the usual system’s filters to act as additional filtering criteria for your pyramided entries.
Hard Exits
You can choose from a variety of hard exit strats. Hard exits are exit strategies which signal trade exits on specific events, as opposed to price breaching a stop level in In-Trade Stops strategies. They are self-explanatory. The last one labelled When Take Profit Level (multiple of X) is reached is the only one that uses a level, but contrary to stops, it is above price and while it is relative because it is expressed as a multiple of X, it does not move during the trade. This is the level called Take Profit that is show when the “Show Take Profit Level” checkbox is checked in the Display section.
While stops focus on managing risk, hard exit strategies try to put the emphasis on capturing opportunity.
Slippage
You can define it as a percentage or a fixed value, with different settings for entries and exits. The entry and exit markers on the chart show the impact of slippage on the entry price (the fill).
Fees
Fees, whether expressed as a percentage of position size in and out of the trade or as a fixed value per in and out, are in the same units of currency as the capital defined in the Position Sizing section. Fees being deducted from your Capital, they do not have an impact on the chart marker positions.
In-Trade Events
These events will only trigger during trades. They can be helpful to act as reminders for traders using the Engine as assistance to discretionary trading.
Post-Exit Analysis
It is normally on. Some of its results will show in the Global Numbers section of the Data Window. Only a few of the statistics generated are shown; many more are available, but commented out in the Plot module.
Date Range Filtering
Note that you don’t have to change the dates to enable/diable filtering. When you are done with a specific date range, just uncheck “Date Range Filtering” to disable date filtering.
Alert Triggers
Each selection corresponds to one condition. Conditions can be combined into a single alert as you please. Just be sure you have selected the ones you want to trigger the alert before you create the alert. For example, if you trade in both directions and you want a single alert to trigger on both types of exits, you must select both “Long Exit” and “Short Exit” before creating your alert.
Once the alert is triggered, these settings no longer have relevance as they have been saved with the alert.
When viewing charts where an alert has just triggered, if your alert triggers on more than one condition, you will need the appropriate markers active on your chart to figure out which condition triggered the alert, since plotting of markers is independent of alert management.
Position sizing
You have 3 options to determine position size:
1. Proportional to Stop -> Variable, with a cap on size.
2. Percentage of equity -> Variable.
3. Percentage of Initial Capital -> Fixed.
External Indicator
This is where you connect your indicator’s plot that will generate the signals the Engine will act upon. Remember this only works in Indicator mode.
DATA WINDOW INFORMATION
The top part of the window contains global numbers while the individual trade information appears in the bottom part. The different types of units used to express values are:
curr: denotes the currency used in the Position Sizing section of Inputs for the Initial Capital value.
quote: denotes quote currency, i.e. the value the instrument is expressed in, or the right side of the market pair (USD in EURUSD ).
X: the stop’s amplitude, itself expressed in quote currency, which we use to express a trade’s P&L, so that a trade with P&L=2X has made twice the stop’s amplitude in profit. This is sometimes referred to as R, since it represents one unit of risk. It is also the unit of measure used in the APPT, which denotes expected reward per unit of risk.
X%: is also the stop’s amplitude, but expressed as a percentage of the Entry Fill.
The numbers appearing in the Data Window are all prefixed:
“ALL:” the number is the average for all first entries and pyramided entries.
”1ST:” the number is for first entries only.
”PYR:” the number is for pyramided entries only.
”PEA:” the number is for Post-Exit Analyses
Global Numbers
Numbers in this section represent the results of all trades up to the cursor on the chart.
Average Profitability Per Trade (X): This value is the most important gauge of your strat’s worthiness. It represents the returns that can be expected from your strat for each unit of risk incurred. E.g.: your APPT is 2.0, thus for every unit of currency you invest in a trade, you can on average expect to obtain 2 after the trade. APPT is also referred to as “statistical expectancy”. If it is negative, your strategy is losing, even if your win rate is very good (it means your winning trades aren’t winning enough, or your losing trades lose too much, or both). Its counterpart in currency is also shown, as is the APPT/bar, which can be a useful gauge in deciding between rivalling systems.
Profit Factor: Gross of winning trades/Gross of losing trades. Strategy is profitable when >1. Not as useful as the APPT because it doesn’t take into account the win rate and the average win/loss per trade. It is calculated from the total winning/losing results of this particular backtest and has less predictive value than the APPT. A good profit factor together with a poor APPT means you just found a chart where your system outperformed. Relying too much on the profit factor is a bit like a poker player who would think going all in with two’s against aces is optimal because he just won a hand that way.
Win Rate: Percentage of winning trades out of all trades. Taken alone, it doesn’t have much to do with strategy profitability. You can have a win rate of 99% but if that one trade in 100 ruins you because of poor risk management, 99% doesn’t look so good anymore. This number speaks more of the system’s profile than its worthiness. Still, it can be useful to gauge if the system fits your personality. It can also be useful to traders intending to sell their systems, as low win rate systems are more difficult to sell and require more handholding of worried customers.
Equity (curr): This the sum of initial capital and the P&L of your system’s trades, including fees and slippage.
Return on Capital is the equivalent of TV’s Net Profit figure, i.e. the variation on your initial capital.
Maximum drawdown is the maximal drawdown from the highest equity point until the drop . There is also a close to close (meaning it doesn’t take into account in-trade variations) maximum drawdown value commented out in the code.
The next values are self-explanatory, until:
PYR: Avg Profitability Per Entry (X): this is the APPT for all pyramided entries.
PEA: Avg Max Opp . Available (X): the average maximal opportunity found in the Post-Exit Analyses.
PEA: Avg Drawdown to Max Opp . (X): this represents the maximum drawdown (incurred from the close at the beginning of the PEA analysis) required to reach the maximal opportunity point.
Trade Information
Numbers in this section concern only the current trade under the cursor. Most of them are self-explanatory. Use the description’s prefix to determine what the values applies to.
PYR: Avg Profitability Per Entry (X): While this value includes the impact of all current pyramided entries (and only those) and updates when you move your cursor around, P&L only reflects fees at the trade’s last bar.
PEA: Max Opp . Available (X): It’s the most profitable close reached post-trade, measured from the trade’s Exit Fill, expressed in the X value of the trade the PEA follows.
PEA: Drawdown to Max Opp . (X): This is the maximum drawdown from the trade’s Exit Fill that needs to be sustained in order to reach the maximum opportunity point, also expressed in X. Note that PEA numbers do not include slippage and fees.
EXTERNAL SIGNAL PROTOCOL
Only one external indicator can be connected to a script; in order to leverage its use to the fullest, the engine provides options to use it as either an entry signal, an entry/exit signal or a filter. When used as an entry signal, you can also use the signal to provide the entry’s stop. Here’s how this works:
For filter state: supply +1 for bull (long entries allowed), -1 for bear (short entries allowed).
For entry signals: supply +2 for long, -2 for short.
For exit signals: supply +3 for exit from long, -3 for exit from short.
To send an entry stop level with an entry signal: Send positive stop level for long entry (e.g. 103.33 to enter a long with a stop at 103.33), negative stop level for short entry (e.g. -103.33 to enter a short with a stop at 103.33). If you use this feature, your indicator will have to check for exact stop levels of 1.0, 2.0 or 3.0 and their negative counterparts, and fudge them with a tick in order to avoid confusion with other signals in the protocol.
Remember that mere generation of the values by your indicator will have no effect until you explicitly allow their use in the appropriate sections of the Engine’s Settings/Inputs.
An example of a script issuing a signal for the Engine is published by PineCoders.
RECOMMENDATIONS TO ASPIRING SYSTEM DESIGNERS
Stick to higher timeframes. On progressively lower timeframes, margins decrease and fees and slippage take a proportionally larger portion of profits, to the point where they can very easily turn a profitable strategy into a losing one. Additionally, your margin for error shrinks as the equilibrium of your system’s profitability becomes more fragile with the tight numbers involved in the shorter time frames. Avoid <1H time frames.
Know and calculate fees and slippage. To avoid market shock, backtest using conservative fees and slippage parameters. Systems rarely show unexpectedly good returns when they are confronted to the markets, so put all chances on your side by being outrageously conservative—or a the very least, realistic. Test results that do not include fees and slippage are worthless. Slippage is there for a reason, and that’s because our interventions in the market change the market. It is easier to find alpha in illiquid markets such as cryptos because not many large players participate in them. If your backtesting results are based on moving large positions and you don’t also add the inevitable slippage that will occur when you enter/exit thin markets, your backtesting will produce unrealistic results. Even if you do include large slippage in your settings, the Engine can only do so much as it will not let slippage push fills past the high or low of the entry bar, but the gap may be much larger in illiquid markets.
Never test and optimize your system on the same dataset , as that is the perfect recipe for overfitting or data dredging, which is trying to find one precise set of rules/parameters that works only on one dataset. These setups are the most fragile and often get destroyed when they meet the real world.
Try to find datasets yielding more than 100 trades. Less than that and results are not as reliable.
Consider all backtesting results with suspicion. If you never entertained sceptic tendencies, now is the time to begin. If your backtest results look really good, assume they are flawed, either because of your methodology, the data you’re using or the software doing the testing. Always assume the worse and learn proper backtesting techniques such as monte carlo simulations and walk forward analysis to avoid the traps and biases that unchecked greed will set for you. If you are not familiar with concepts such as survivor bias, lookahead bias and confirmation bias, learn about them.
Stick to simple bars or candles when designing systems. Other types of bars often do not yield reliable results, whether by design (Heikin Ashi) or because of the way they are implemented on TV (Renko bars).
Know that you don’t know and use that knowledge to learn more about systems and how to properly test them, about your biases, and about yourself.
Manage risk first , then capture opportunity.
Respect the inherent uncertainty of the future. Cleanse yourself of the sad arrogance and unchecked greed common to newcomers to trading. Strive for rationality. Respect the fact that while backtest results may look promising, there is no guarantee they will repeat in the future (there is actually a high probability they won’t!), because the future is fundamentally unknowable. If you develop a system that looks promising, don’t oversell it to others whose greed may lead them to entertain unreasonable expectations.
Have a plan. Understand what king of trading system you are trying to build. Have a clear picture or where entries, exits and other important levels will be in the sort of trade you are trying to create with your system. This stated direction will help you discard more efficiently many of the inevitably useless ideas that will pop up during system design.
Be wary of complexity. Experienced systems engineers understand how rapidly complexity builds when you assemble components together—however simple each one may be. The more complex your system, the more difficult it will be to manage.
Play! . Allow yourself time to play around when you design your systems. While much comes about from working with a purpose, great ideas sometimes come out of just trying things with no set goal, when you are stuck and don’t know how to move ahead. Have fun!
@LucF
NOTES
While the engine’s code can supply multiple consecutive entries of longs or shorts in order to scale positions (pyramid), all exits currently assume the execution bot will exit the totality of the position. No partial exits are currently possible with the Engine.
Because the Engine is literally crippled by the limitations on the number of plots a script can output on TV; it can only show a fraction of all the information it calculates in the Data Window. You will find in the Plot Module vast amounts of commented out lines that you can activate if you also disable an equivalent number of other plots. This may be useful to explore certain characteristics of your system in more detail.
When backtesting using the TV backtesting feature, you will need to provide the strategy parameters you wish to use through either Settings/Properties or by changing the default values in the code’s header. These values are defined in variables and used not only in the strategy() statement, but also as defaults in the Engine’s relevant Inputs.
If you want to test using pyramiding, then both the strategy’s Setting/Properties and the Engine’s Settings/Inputs need to allow pyramiding.
If you find any bugs in the Engine, please let us know.
THANKS
To @glaz for allowing the use of his unpublished MA Squize in the filters.
To @everget for his Chandelier stop code, which is also used as a filter in the Engine.
To @RicardoSantos for his pseudo-random generator, and because it’s from him that I first read in the Pine chat about the idea of using an external indicator as input into another. In the PineCoders group, @theheirophant then mentioned the idea of using it as a buy/sell signal and @simpelyfe showed a piece of code implementing the idea. That’s the tortuous story behind the use of the external indicator in the Engine.
To @admin for the Volatility stop’s original code and for the donchian function lifted from Ichimoku .
To @BobHoward21 for the v3 version of Volatility Stop .
To @scarf and @midtownsk8rguy for the color tuning.
To many other scripters who provided encouragement and suggestions for improvement during the long process of writing and testing this piece of code.
To J. Welles Wilder Jr. for ATR, used extensively throughout the Engine.
To TradingView for graciously making an account available to PineCoders.
And finally, to all fellow PineCoders for the constant intellectual stimulation; it is a privilege to share ideas with you all. The Engine is for all TradingView PineCoders, of course—but especially for you.
Look first. Then leap.
Great Expectations [LucF]Great Expectations helps traders answer the question: What is possible? It is a powerful question, yet exploration of the unknown always entails risk. A more complete set of questions better suited to traders could be:
What opportunity exists from any given point on a chart?
What portion of this opportunity can be realistically captured?
What risk will be incurred in trying to do so, and how long will it take?
Great Expectations is the result of an exploration of these questions. It is a trade simulator that generates visual and quantitative information to help strategy modelers visually identify and analyse areas of optimal expectation on charts, whether they are designing automated or discretionary strategies.
WARNING: Great Expectations is NOT an indicator that helps determine the current state of a market. It works by looking at points in the past from which the future is already known. It uses one definition of repainting extensively (i.e. it goes back in the past to print information that could not have been know at the time). Repainting understood that way is in fact almost all the indicator does! —albeit for what I hope is a noble cause. The indicator is of no use whatsoever in analyzing markets in real-time. If you do not understand what it does, please stay away!
This is an indicator—not a strategy that uses TradingView’s backtesting engine. It works by simulating trades, not unlike a backtest, but with the crucial difference that it assumes a trade (either long or short) is entered on all bars in the historic sample. It walks forward from each bar and determines possible outcomes, gathering individual trade statistics that in turn generate precious global statistics from all outcomes tested on the chart.
Great Expectations provides numbers summarizing trade results on all simulations run from the chart. Those numbers cannot be compared to backtest-produced numbers since all non-filtered bars are examined, even if an entry was taken on the bar immediately preceding the current one, which never happens in a backtest. This peculiarity does NOT invalidate Great Expectations calculations; it just entails that results be considered under a different light. Provided they are evaluated within the indicator’s context, they can be useful—sometimes even more than backtesting results, e.g. in evaluating the impact of parameter-fitting or variations in entry, exit or filtering strats.
Traders and strategy modelers are creatures of hope often suffering from blurred vision; my hope is that Great Expectations will help them appraise the validity of their setup and strat intuitions in a realistic fashion, preventing confirmation bias from obstructing perspective—and great expectations from turning into financial great deceptions.
USE CASES
You’ve identified what looks like a promising setup on other indicators. You load Great Expectations on the chart and evaluate if its high-expectation areas match locations where your setup’s conditions occur. Unless today is your lucky day, chances are the indicator will help you realize your setup is not as promising as you had hoped.
You want to get a rough estimate of the optimal trade duration for a chart and you don’t mind using the entry and exit strategies provided with the indicator. You use the trade length readouts of the indicator.
You’re experimenting with a new stop strategy and want to know how long it will keep you in trades, on average. You integrate your stop strategy in the indicator’s code and look at the average trade length it produces and the TST ratio to evaluate its performance.
You have put together your own entry and exit criteria and are looking for a filter that will help you improve backtesting results. You visually ascertain the suitability of your filter by looking at its results on the charts with great Expectations, to see if your filter is choosing its areas correctly.
You have a strategy that shows backtested trades on your chart. Great Expectations can help you evaluate how well your strategy is benefitting from high-opportunity areas while avoiding poor expectation spots.
You want more complete statistics on your set of strategies than what backtesting will provide. You use Great Expectations, knowing that it tests all bars in the sample that correspond to your criteria, as opposed to backtesting results which are limited to a subset of all possible entries.
You want to fool your friends into thinking you’ve designed the holy grail of indicators, something that identifies optimal opportunities on any chart; you show them the P&L cloud.
FEATURES
For one trade
At any given point on the chart, assuming a trade is entered there, Great Expectations shows you information specific to that trade simulation both on the chart and in the Data Window.
The chart can display:
the P & L Cloud which shows whether the trade ended profitably or not, and by how much,
the Opportunity & Risk Cloud which the maximum opportunity and risk the simulation encountered. When superimposed over the P & L cloud, you will see what I call the managed opportunity and risk, i.e the portion of maximum opportunity that was captured and the portion of the maximum risk that was incurred,
the target and if it was reached,
a background that uses a gradient to show different levels of trade length, P&L or how frequently the target was reached during simulation.
The Data Window displays more than 40 values on individual trades and global results. For any given trade you will know:
Entry/Exit levels, including slippage impact,
It’s outcome and duration,
P/L achieved,
The fraction of the maximum opportunity/risk managed by the trade.
For all trades
After going through all the possible trades on the chart, the indicator will provide you with a rare view of all outcomes expressed with the P&L cloud, which allows us to instantly see the most/least profitable areas of a chart using trade data as support, while also showing its relationship with the opportunity/risk encountered during the simulation. The difference between the two clouds is the managed opportunity and risk.
The Data Window will present you with numbers which we will go through later. Some of them are: average stop size, P/L, win rate, % opportunity managed, trade lengths for different types of trade outcomes and the TST (Target:Stop Travel) ratio.
Let’s see Great Expectations in action… and remember to open your Data Window!
INPUTS
Trade direction : You must first choose if you wish to look at long or short trades. Because of the way the indicator works and the amount of visual information on the chart, it is only practical to look at one type of trades at a time. The default is Longs.
Maximum trade Length (MaxL) : This is the maximum walk forward distance the simulator will go in analyzing outcomes from any given point in the past. It also determines the size of the dead zone among the chart’s last bars. A red background line identifies the beginning of the dead zone for which not enough bars have elapsed to analyze outcomes for the maximum trade length defined. If an ATR-based entry stop is used, that length is added to the wait time before beginning simulations, so that the first entry starts with a clean ATR value. On a sample of around 16000 bars, my tests show that the indicator runs into server errors at lengths of around 290, i.e. having completed ~4,6M simulation loop iterations. That is way too high a length anyways; 100 will usually be amply enough to ring out all the possibilities out of a simulation, and on shorter time frames, 30 can be enough. While making it unduly small will prevent simulations of expressing the market’s potential, the less you use, the faster the indicator will run. The default is 40.
Unrealized P&L base at End of Trade (EOT) : When a simulation ends and the trade is still open, we calculate unrealized P&L from an exit order executed from either the last in-trade stop on the previous bar, or the close of the last bar. You can readily see the impact of this selection on the chart, with the P&L cloud. The default is on the close.
Display : The check box besides the title does nothing.
Show target : Shows a green line displaying the trade’s target expressed as a multiple of X, i.e. the amplitude of the entry stop. I call this value “X” and use it as a unit to express profit and loss on a trade (some call it “R”). The line is highlighted for trades where the close reached the target during the trade, whether the trade ended in profit or loss. This is also where you specify the multiple of X you wish to use in calculating targets. The multiple is used even if targets are not displayed.
Show P&L Cloud : The cloud allows traders to see right away the profitable areas of the chart. The only line printed with the cloud is the “end of trade line” (EOT). The EOT line is the only way one can see the level where a trade ended on the chart (in the Data Window you can see it as the “Exit Fill” value). The EOT level for the trade determines if the trade ended in a profit or a loss. Its value represents one of the following:
- fill from order executed at close of bar where stop is breached during trade (which produces “Realized P/L”),
- simulation of a fill pseudo-fill at the user-defined EOT level (last close or stop level) if the trade runs its course through MaxL bars without getting stopped (producing Unrealized P/L).
The EOT line and the cloud fill print in green when the trade’s outcome is profitable and in red when it is not. If the trade was closed after breaching the stop, the line appears brighter.
Show Opportunity&Risk Cloud : Displays the maximum opportunity/risk that was present during the trade, i.e. the maximum and minimum prices reached.
Background Color Scheme : Allows you to choose between 3 different color schemes for the background gradients, to accommodate different types of chart background/candles. Select “None” if you don’t want a background.
Background source : Determines what value will be used to generate the different intensities of the gradient. You can choose trade length (brighter is shorter), Trade P&L (brighter is higher) or the number of times the target was reached during simulation (brighter is higher). The default is Trade Length.
Entry strat : The check box besides the title does nothing. The default strat is All bars, meaning a trade will be simulated from all bars not excluded by the filters where a MaxL bars future exists. For fun, I’ve included a pseudo-random entry strat (an indirect way of changing the seed is to vary the starting date of the simulation).
Show Filter State : Displays areas where the combination of filters you have selected are allowing entries. Filtering occurs as per your selection(s), whether the state is displayed or not. The effect of multiple selections is additive. The filters are:
1. Bar direction: Longs will only be entered if close>open and vice versa.
2. Rising Volume: Applies to both long and shorts.
3. Rising/falling MA of the length you choose over the number of bars you choose.
4. Custom indicator: You can feed your own filtering signal through this from another indicator. It must produce a signal of 1 to allow long entries and 0 to allow shorts.
Show Entry Stops :
1. Multiple of user-defined length ATR.
2. Fixed percentage.
3. Fixed value.
All entry stops are calculated using the entry fill price as a reference. The fill price is calculated from the current bar’s open, to which slippage is added if configured. This simulates the case where the strategy issued the entry signal on the previous bar for it to be executed at the next bar’s open.
The entry stop remains active until the in-trade stop becomes the more aggressive of the two stops. From then on, the entry stop will be ignored, unless a bar close breaches the in-trade stop, in which case the stop will be reset with a new entry stop and the process repeats.
Show In-trade stops : Displays in bright red the selected in-trade stop (be sure to read the note in this section about them).
1. ATR multiple: added/subtracted from the average of the two previous bars minimum/maximum of open/close.
2. A trailing stop with a deviation expressed as a multiple of entry stop (X).
3. A fixed percentage trailing stop.
Trailing stops deviations are measured from the highest/lowest high/low reached during the trade.
Note: There is a twist with the in-trade stops. It’s that for any given bar, its in-trade stop can hold multiple values, as each successive pass of the advancing simulation loops goes over it from a different entry points. What is printed is the stop from the loop that ended on that bar, which may have nothing to do with other instances of the trade’s in-trade stop for the same bar when visited from other starting points in previous simulations. There is just no practical way to print all stop values that were used for any given bar. While the printed entry stops are the actual ones used on each bar, the in-trade stops shown are merely the last instance used among many.
Include Slippage : if checked, slippage will be added/subtracted from order price to yield the fill price. Slippage is in percentage. If you choose to include slippage in the simulations, remember to adjust it by considering the liquidity of the markets and the time frame you’ll be analyzing.
Include Fees : if checked, fees will be subtracted/added to both realized an unrealized trade profits/losses. Fees are in percentage. The default fees work well for crypto markets but will need adjusting for others—especially in Forex. Remember to modify them accordingly as they can have a major impact on results. Both fees and slippage are included to remind us of their importance, even if the global numbers produced by the indicator are not representative of a real trading scenario composed of sequential trades.
Date Range filtering : the usual. Just note that the checkbox has to be selected for date filtering to activate.
DATA WINDOW
Most of the information produced by this indicator is made available in the Data Window, which you bring up by using the icon below the Watchlist and Alerts buttons at the right of the TV UI. Here’s what’s there.
Some of the information presented in the Data Window is standard trade data; other values are not so standard; e. g. the notions of managed opportunity and risk and Target:Stop Travel ratio. The interplay between all the values provided by Great Expectations is inherently complex, even for a static set of entry/filter/exit strats. During the constant updating which the habitual process of progressive refinement in building strategies that is the lot of strategy modelers entails, another level of complexity is no doubt added to the analysis of this indicator’s values. While I don’t want to sound like Wolfram presenting A New Kind of Science , I do believe that if you are a serious strategy modeler and spend the time required to get used to using all the information this indicator makes available, you may find it useful.
Trade Information
Entry Order : This is the open of the bar where simulation starts. We suppose that an entry signal was generated at the previous bar.
Entry Fill (including slip.) : The actual entry price, including slippage. This is the base price from which other values will be calculated.
Exit Order : When a stop is breached, an exit order is executed from the close of the bar that breached the stop. While there is no “In-trade stop” value included in the Data Window (other than the End of trade Stop previously discussed), this “Exit Order” value is how we can know the level where the trade was stopped during the simulation. The “Trade Length” value will then show the bar where the stop was breached.
Exit Fill (including slip.) : When the exit order is simulated, slippage is added to the order level to create the fill.
Chart: Target : This is the target calculated at the beginning of the simulation. This value also appear on the chart in teal. It is controlled by the multiple of X defined under the “Show Target” checkbox in the Inputs.
Chart: Entry Stop : This value also appears on the chart (the red dots under points where a trade was simulated). Its value is controlled by the Entry Strat chosen in the Inputs.
X (% Fill, including Fees) and X (currency) : This is the stop’s amplitude (Entry Fill – Entry Stop) + Fees. It represents the risk incurred upon entry and will be used to express P&L. We will show R expressed in both a percentage of the Entry Fill level (this value), and currency (the next value). This value represents the risk in the risk:reward ratio and is considered to be a unit of 1 so that RR can be expressed as a single value (i.e. “2” actually meaning “1:2”).
Trade Length : If trade was stopped, it’s the number of bars elapsed until then. The trade is then considered “Closed”. If the trade ends without being stopped (there is no profit-taking strat implemented, so the stop is the only exit strat), then the trade is “Open”, the length is MaxL and it will show in orange. Otherwise the value will print in green/red to reflect if the trade is winning/losing.
P&L (X) : The P&L of the trade, expressed as a multiple of X, which takes into account fees paid at entry and exit. Given our default target setting at 2 units of “X”, a trade that closes at its target will have produced a P&L of +2.0, i.e. twice the value of X (not counting fees paid at exit ). A trade that gets stopped late 50% further that the entry stop’s level will produce a P&L of -1.5X.
P&L (currency, including Fees) : same value as above, but expressed in currency.
Target first reached at bar : If price closed above the target during the trade (even if it occurs after the trade was stopped), this will show when. This value will be used in calculating our TST ratio.
Times Stop/Target reached in sim. : Includes all occurrences during the complete simulation loop.
Opportunity (X) : The highest/lowest price reached during a simulation, i.e. the maximum opportunity encountered, whether the trade was previously stopped or not, expressed as a multiple of X.
Risk (X) : The lowest/highest price reached during a simulation, i.e. the maximum risk encountered, whether the trade was previously stopped or not, expressed as a multiple of X.
Risk:Opportunity : The greater this ratio, the greater Opportunity is, compared to Risk.
Managed Opportunity (%) : The portion of Opportunity that was captured by the highest/low stop position, even if it occurred after a previous stop closed the trade.
Managed Risk (%) : The portion of risk that was protected by the lowest/highest stop position, even if it occurred after a previous stop closed the trade. When this value is greater than 100%, it means the trade’s stop is protecting more than the maximum risk, which is frequent. You will, however, never see close to those values for the Managed Opportunity value, since the stop would have to be higher than the Maximum opportunity. It is much easier to alleviate the risk than it is to lock in profits.
Managed Risk:Opportunity : The ratio of the two preceding values.
Managed Opp. vs. Risk : The Managed Opportunity minus the Managed Risk. When it is negative, which is most often is, it means your strat is protecting a greater portion of the risk than it captures opportunity.
Global Numbers
Win Rate(%) : Percentage of winning trades over all entries. Open trades are considered winning if their last stop/close (as per user selection) locks in profits.
Avg X%, Avg X (currency) : Averages of previously described values:.
Avg Profitability/Trade (APPT) : This measures expectation using: Average Profitability Per Trade = (Probability of Win × Average Win) − (Probability of Loss × Average Loss) . It quantifies the average expectation/trade, which RR alone can’t do, as the probabilities of each outcome (win/lose) must also be used to calculate expectancy. The APPT combine the RR with the win rate to yield the true expectancy of a strategy. In my usual way of expressing risk with X, APPT is the equivalent of the average P&L per trade expressed in X. An APPT of -1.5 means that we lose on average 1.5X/trade.
Equity (X), Equity (currency) : The cumulative result of all trade outcomes, expressed as a multiple of X. Multiplied by the Average X in currency, this yields the Equity in currency.
Risk:Opportunity, Managed Risk:Opportunity, Managed Opp. vs. Risk : The global values of the ones previously described.
Avg Trade Length (TL) : One of the most important values derived by going through all the simulations. Again, it is composed of either the length of stopped trades, or MaxL when the trade isn’t stopped (open). This value can help systems modelers shape the characteristics of the components they use to build their strategies.
Avg Closed Win TL and Avg Closed Lose TL : The average lengths of winning/losing trades that were stopped.
Target reached? Avg bars to Stop and Target reached? Avg bars to Target : For the trades where the target was reached at some point in the simulation, the number of bars to the first point where the stop was breached and where the target was reached, respectively. These two values are used to calculate the next value.
TST (Target:Stop Travel Ratio) : This tracks the ratio between the two preceding values (Bars to first stop/Bars to first target), but only for trades where the target was reached somewhere in the loop. A ratio of 2 means targets are reached twice as fast as stops.
The next values of this section are counts or percentages and are self-explanatory.
Chart Plots
Contains chart plots of values already describes.
NOTES
Optimization/Overfitting: There is a fine line between optimizing and overfitting. Tools like this indicator can lead unsuspecting modelers down a path of overfitting that often turns strategies into over-specialized beasts that do not perform elegantly when confronted to the real-world. Proven testing strategies like walk forward analysis will go a long way in helping modelers alleviate this risk.
Input tuning: Because the results generated by the indicator will vary with the parameters used in the active entry, filtering and exit strats, it’s important to realize that although it may be fun at first, just slapping the default settings on a chart and time frame will not yield optimal nor reliable results. While using ATR as often as possible (as I do in this indicator) is a good way to make strat parametrization adaptable, it is not a foolproof solution.
There is no data for the last MaxL bars of the chart, since not enough trade future has elapsed to run a simulation from MaxL bars back.
Modifying the code: I have tried to structure the code modularly, even if that entails a larger code base, so that you can adapt it to your needs. I’ve included a few token components in each of the placeholders designed for entry strategies, filters, entry stops and in-trade stops. This will hopefully make it easier to add your own. In the same spirit, I have also commented liberally.
You will find in the code many instances of standard trade management tasks that can be lifted to code TV strategies where, as I do in mine, you manage everything yourself and don’t rely on built-in Pine strategy functions to act on your trades.
Enjoy!
THANKS
To @scarf who showed me how plotchar() could be used to plot values without ruining scale.
To @glaz for the suggestion to include a Chandelier stop strat; I will.
To @simpelyfe for the idea of using an indicator input for the filters (if some day TV lets us use more than one, it will be useful in other modules of the indicator).
To @RicardoSantos for the random generator used in the random entry strat.
To all scripters publishing open source on TradingView; their code is the best way to learn.
To my trading buddies Irving and Bruno; who showed me way back how pro traders get it done.
Crypto grabberSo, its my first position in crypto (and not only crypto) bots series. What we have there.. program writting on Pine script language what can analyse market data of any trading instrument and signalise to enter the deal. Its next versions will update. Trade system based on my x-volume indicator.In central part of system is analyzing volume accumulation and distribution process which decide good and bad time for investing.
So some important points:
1) In time when you change timeframe or trading symbol bot analise all bars history. The number of trading (signal) candles in the analysis history is marked in black.
2) The percent of profitable signals is marked in blue.
3) Total profit points are marked in green.
4) Total bars in history are marked in red.
For better indicator vision you can turn off non interesting plots in settings menu.
There is two kinds of alerts: Buy alert and Sell alert. Set it once per bar close or every minute ( because the best way you must open the deal at 20 sec before bar close ).
This trading system is great for creating a profitable trading portfolio. Try it yourself to find exchanges and cryptocurrencies with profitable historical views. For example, the KRAKEN exchange trades well: XBTCAD, XBTUSD in 30-45 min timeframe.
I will do better settings in new versions of this bot. Waiting your likes)
Bert LONG BTC Study (Alerts) - Profit 2018: 1319 % (no leverage)Bert LONG Term BTC study (BITMEX) - script for setting alerts and trading bots
This is a revolutionary strategy for bitcoin (XBT) trading. The strategy is perfectly configured for trading on the Bitmex exchange. No further configuration and setup is required.
The strategy itself recognizes a volatile period or whether the market is in downtrend, uptrend or sideways. Accordingly, it applies the appropriate orders to reach maximum profit.
The strategy can be handled manually, you can receive alerts (popup, email, sms) or can be fully automated by bot (works with: Autoview, Gunbot, Profitview, Jubot and others) without any manual intervention.
What is the minimum and maximum capital I can trade with?
You can trade with 0.0001BTC – 1000BTC. That is one of many advantages of using this strategy on XBT. There is enough liquidity to execute the order for the market price with a big investment amount.
What is the recommended setting?
Timeframe: 45m
Chart: Bitcoin/USD Dollar Perpetual Inverse Swap Contract (XBT)
Leverage: 2x
Orders: Long and Shorts
Why was this strategy created?
You have basically two option how to make money in crypto market. HODL (buy the coin and believe it will rise to the moon) and TRADING (only 3-5% traders are profitable, most of them are full time traders with 5+ years of experience in trading).
If you HODL btc in this year, you are -70 % this year
If you are TRADING, the results depend on how good you are (think about this, if you decide to be a heart surgeon, rocket star or NBA player, do you think you can be? Yes, you can but the chances are very small. The same probability you have that you will be in the 3-5% profitable traders 😊). It takes time, you need experience and still 96% all of you will never be a profitable traders!
If you use Bert BTC long term strategy, you are + 1319 % this year
How well the Bert BTC strategy performs?
Profit in 2018 was 1319 % / 13x (without leverage)
Profit in 2018 was 11 477 % / 115x (with leverage 2)
If you invested (with leverage 2) 1 000 USD you have now 114 766 USD
If you invested (with leverage 2) 10 000 USD you have now 1 147 660 USD
Detailed trades report for 2018 (you can calculate your own profit with specific investments and leverage) – download excel here
Notes:
You will hardly find better strategy on the market which achieves similar results with minimal risk and can operate in any market condition (downtrend, uptrend, sideways).
We guarantee the strategy does not repaint, and we use real candles (not heikin ashi or renko which does not reflect real prices).
We wish you to become financially independent and all your secret wishes to be fulfilled.
And in case if you still want to HODL or you want to be TRADING all the days watching to your monitors, consider to try our strategy at least with a minimum capital invested, you will see that you will not regret in long run. Be patient and the money will come to you!
For access to this strategy visit website: www.cryptobert.io
Entry Scanner Conservative Option AKeeping it simple,
Trend,
RSI,
Stoch RSI,
MACD, checked.
Do not have entry where there is noise on selection, look for cluster of same entry signals.
If you can show enough discipline, you will be profitable.
CT
Adaptive Genesis Engine [AGE]ADAPTIVE GENESIS ENGINE (AGE)
Pure Signal Evolution Through Genetic Algorithms
Where Darwin Meets Technical Analysis
🧬 WHAT YOU'RE GETTING - THE PURE INDICATOR
This is a technical analysis indicator - it generates signals, visualizes probability, and shows you the evolutionary process in real-time. This is NOT a strategy with automatic execution - it's a sophisticated signal generation system that you control .
What This Indicator Does:
Generates Long/Short entry signals with probability scores (35-88% range)
Evolves a population of up to 12 competing strategies using genetic algorithms
Validates strategies through walk-forward optimization (train/test cycles)
Visualizes signal quality through premium gradient clouds and confidence halos
Displays comprehensive metrics via enhanced dashboard
Provides alerts for entries and exits
Works on any timeframe, any instrument, any broker
What This Indicator Does NOT Do:
Execute trades automatically
Manage positions or calculate position sizes
Place orders on your behalf
Make trading decisions for you
This is pure signal intelligence. AGE tells you when and how confident it is. You decide whether and how much to trade.
🔬 THE SCIENCE: GENETIC ALGORITHMS MEET TECHNICAL ANALYSIS
What Makes This Different - The Evolutionary Foundation
Most indicators are static - they use the same parameters forever, regardless of market conditions. AGE is alive . It maintains a population of competing strategies that evolve, adapt, and improve through natural selection principles:
Birth: New strategies spawn through crossover breeding (combining DNA from fit parents) plus random mutation for exploration
Life: Each strategy trades virtually via shadow portfolios, accumulating wins/losses, tracking drawdown, and building performance history
Selection: Strategies are ranked by comprehensive fitness scoring (win rate, expectancy, drawdown control, signal efficiency)
Death: Weak strategies are culled periodically, with elite performers (top 2 by default) protected from removal
Evolution: The gene pool continuously improves as successful traits propagate and unsuccessful ones die out
This is not curve-fitting. Each new strategy must prove itself on out-of-sample data through walk-forward validation before being trusted for live signals.
🧪 THE DNA: WHAT EVOLVES
Every strategy carries a 10-gene chromosome controlling how it interprets market data:
Signal Sensitivity Genes
Entropy Sensitivity (0.5-2.0): Weight given to market order/disorder calculations. Low values = conservative, require strong directional clarity. High values = aggressive, act on weaker order signals.
Momentum Sensitivity (0.5-2.0): Weight given to RSI/ROC/MACD composite. Controls responsiveness to momentum shifts vs. mean-reversion setups.
Structure Sensitivity (0.5-2.0): Weight given to support/resistance positioning. Determines how much price location within swing range matters.
Probability Adjustment Genes
Probability Boost (-0.10 to +0.10): Inherent bias toward aggressive (+) or conservative (-) entries. Acts as personality trait - some strategies naturally optimistic, others pessimistic.
Trend Strength Requirement (0.3-0.8): Minimum trend conviction needed before signaling. Higher values = only trades strong trends, lower values = acts in weak/sideways markets.
Volume Filter (0.5-1.5): Strictness of volume confirmation. Higher values = requires strong volume, lower values = volume less important.
Risk Management Genes
ATR Multiplier (1.5-4.0): Base volatility scaling for all price levels. Controls whether strategy uses tight or wide stops/targets relative to ATR.
Stop Multiplier (1.0-2.5): Stop loss tightness. Lower values = aggressive profit protection, higher values = more breathing room.
Target Multiplier (1.5-4.0): Profit target ambition. Lower values = quick scalping exits, higher values = swing trading holds.
Adaptation Gene
Regime Adaptation (0.0-1.0): How much strategy adjusts behavior based on detected market regime (trending/volatile/choppy). Higher values = more reactive to regime changes.
The Magic: AGE doesn't just try random combinations. Through tournament selection and fitness-weighted crossover, successful gene combinations spread through the population while unsuccessful ones fade away. Over 50-100 bars, you'll see the population converge toward genes that work for YOUR instrument and timeframe.
📊 THE SIGNAL ENGINE: THREE-LAYER SYNTHESIS
Before any strategy generates a signal, AGE calculates probability through multi-indicator confluence:
Layer 1 - Market Entropy (Information Theory)
Measures whether price movements exhibit directional order or random walk characteristics:
The Math:
Shannon Entropy = -Σ(p × log(p))
Market Order = 1 - (Entropy / 0.693)
What It Means:
High entropy = choppy, random market → low confidence signals
Low entropy = directional market → high confidence signals
Direction determined by up-move vs down-move dominance over lookback period (default: 20 bars)
Signal Output: -1.0 to +1.0 (bearish order to bullish order)
Layer 2 - Momentum Synthesis
Combines three momentum indicators into single composite score:
Components:
RSI (40% weight): Normalized to -1/+1 scale using (RSI-50)/50
Rate of Change (30% weight): Percentage change over lookback (default: 14 bars), clamped to ±1
MACD Histogram (30% weight): Fast(12) - Slow(26), normalized by ATR
Why This Matters: RSI catches mean-reversion opportunities, ROC catches raw momentum, MACD catches momentum divergence. Weighting favors RSI for reliability while keeping other perspectives.
Signal Output: -1.0 to +1.0 (strong bearish to strong bullish)
Layer 3 - Structure Analysis
Evaluates price position within swing range (default: 50-bar lookback):
Position Classification:
Bottom 20% of range = Support Zone → bullish bounce potential
Top 20% of range = Resistance Zone → bearish rejection potential
Middle 60% = Neutral Zone → breakout/breakdown monitoring
Signal Logic:
At support + bullish candle = +0.7 (strong buy setup)
At resistance + bearish candle = -0.7 (strong sell setup)
Breaking above range highs = +0.5 (breakout confirmation)
Breaking below range lows = -0.5 (breakdown confirmation)
Consolidation within range = ±0.3 (weak directional bias)
Signal Output: -1.0 to +1.0 (bearish structure to bullish structure)
Confluence Voting System
Each layer casts a vote (Long/Short/Neutral). The system requires minimum 2-of-3 agreement (configurable 1-3) before generating a signal:
Examples:
Entropy: Bullish, Momentum: Bullish, Structure: Neutral → Signal generated (2 long votes)
Entropy: Bearish, Momentum: Neutral, Structure: Neutral → No signal (only 1 short vote)
All three bullish → Signal generated with +5% probability bonus
This is the key to quality. Single indicators give too many false signals. Triple confirmation dramatically improves accuracy.
📈 PROBABILITY CALCULATION: HOW CONFIDENCE IS MEASURED
Base Probability:
Raw_Prob = 50% + (Average_Signal_Strength × 25%)
Then AGE applies strategic adjustments:
Trend Alignment:
Signal with trend: +4%
Signal against strong trend: -8%
Weak/no trend: no adjustment
Regime Adaptation:
Trending market (efficiency >50%, moderate vol): +3%
Volatile market (vol ratio >1.5x): -5%
Choppy market (low efficiency): -2%
Volume Confirmation:
Volume > 70% of 20-bar SMA: no change
Volume below threshold: -3%
Volatility State (DVS Ratio):
High vol (>1.8x baseline): -4% (reduce confidence in chaos)
Low vol (<0.7x baseline): -2% (markets can whipsaw in compression)
Moderate elevated vol (1.0-1.3x): +2% (trending conditions emerging)
Confluence Bonus:
All 3 indicators agree: +5%
2 of 3 agree: +2%
Strategy Gene Adjustment:
Probability Boost gene: -10% to +10%
Regime Adaptation gene: scales regime adjustments by 0-100%
Final Probability: Clamped between 35% (minimum) and 88% (maximum)
Why These Ranges?
Below 35% = too uncertain, better not to signal
Above 88% = unrealistic, creates overconfidence
Sweet spot: 65-80% for quality entries
🔄 THE SHADOW PORTFOLIO SYSTEM: HOW STRATEGIES COMPETE
Each active strategy maintains a virtual trading account that executes in parallel with real-time data:
Shadow Trading Mechanics
Entry Logic:
Calculate signal direction, probability, and confluence using strategy's unique DNA
Check if signal meets quality gate:
Probability ≥ configured minimum threshold (default: 65%)
Confluence ≥ configured minimum (default: 2 of 3)
Direction is not zero (must be long or short, not neutral)
Verify signal persistence:
Base requirement: 2 bars (configurable 1-5)
Adapts based on probability: high-prob signals (75%+) enter 1 bar faster, low-prob signals need 1 bar more
Adjusts for regime: trending markets reduce persistence by 1, volatile markets add 1
Apply additional filters:
Trend strength must exceed strategy's requirement gene
Regime filter: if volatile market detected, probability must be 72%+ to override
Volume confirmation required (volume > 70% of average)
If all conditions met for required persistence bars, enter shadow position at current close price
Position Management:
Entry Price: Recorded at close of entry bar
Stop Loss: ATR-based distance = ATR × ATR_Mult (gene) × Stop_Mult (gene) × DVS_Ratio
Take Profit: ATR-based distance = ATR × ATR_Mult (gene) × Target_Mult (gene) × DVS_Ratio
Position: +1 (long) or -1 (short), only one at a time per strategy
Exit Logic:
Check if price hit stop (on low) or target (on high) on current bar
Record trade outcome in R-multiples (profit/loss normalized by ATR)
Update performance metrics:
Total trades counter incremented
Wins counter (if profit > 0)
Cumulative P&L updated
Peak equity tracked (for drawdown calculation)
Maximum drawdown from peak recorded
Enter cooldown period (default: 8 bars, configurable 3-20) before next entry allowed
Reset signal age counter to zero
Walk-Forward Tracking:
During position lifecycle, trades are categorized:
Training Phase (first 250 bars): Trade counted toward training metrics
Testing Phase (next 75 bars): Trade counted toward testing metrics (out-of-sample)
Live Phase (after WFO period): Trade counted toward overall metrics
Why Shadow Portfolios?
No lookahead bias (uses only data available at the bar)
Realistic execution simulation (entry on close, stop/target checks on high/low)
Independent performance tracking for true fitness comparison
Allows safe experimentation without risking capital
Each strategy learns from its own experience
🏆 FITNESS SCORING: HOW STRATEGIES ARE RANKED
Fitness is not just win rate. AGE uses a comprehensive multi-factor scoring system:
Core Metrics (Minimum 3 trades required)
Win Rate (30% of fitness):
WinRate = Wins / TotalTrades
Normalized directly (0.0-1.0 scale)
Total P&L (30% of fitness):
Normalized_PnL = (PnL + 300) / 600
Clamped 0.0-1.0. Assumes P&L range of -300R to +300R for normalization scale.
Expectancy (25% of fitness):
Expectancy = Total_PnL / Total_Trades
Normalized_Expectancy = (Expectancy + 30) / 60
Clamped 0.0-1.0. Rewards consistency of profit per trade.
Drawdown Control (15% of fitness):
Normalized_DD = 1 - (Max_Drawdown / 15)
Clamped 0.0-1.0. Penalizes strategies that suffer large equity retracements from peak.
Sample Size Adjustment
Quality Factor:
<50 trades: 1.0 (full weight, small sample)
50-100 trades: 0.95 (slight penalty for medium sample)
100 trades: 0.85 (larger penalty for large sample)
Why penalize more trades? Prevents strategies from gaming the system by taking hundreds of tiny trades to inflate statistics. Favors quality over quantity.
Bonus Adjustments
Walk-Forward Validation Bonus:
if (WFO_Validated):
Fitness += (WFO_Efficiency - 0.5) × 0.1
Strategies proven on out-of-sample data receive up to +10% fitness boost based on test/train efficiency ratio.
Signal Efficiency Bonus (if diagnostics enabled):
if (Signals_Evaluated > 10):
Pass_Rate = Signals_Passed / Signals_Evaluated
Fitness += (Pass_Rate - 0.1) × 0.05
Rewards strategies that generate high-quality signals passing the quality gate, not just profitable trades.
Final Fitness: Clamped at 0.0 minimum (prevents negative fitness values)
Result: Elite strategies typically achieve 0.50-0.75 fitness. Anything above 0.60 is excellent. Below 0.30 is prime candidate for culling.
🔬 WALK-FORWARD OPTIMIZATION: ANTI-OVERFITTING PROTECTION
This is what separates AGE from curve-fitted garbage indicators.
The Three-Phase Process
Every new strategy undergoes a rigorous validation lifecycle:
Phase 1 - Training Window (First 250 bars, configurable 100-500):
Strategy trades normally via shadow portfolio
All trades count toward training performance metrics
System learns which gene combinations produce profitable patterns
Tracks independently: Training_Trades, Training_Wins, Training_PnL
Phase 2 - Testing Window (Next 75 bars, configurable 30-200):
Strategy continues trading without any parameter changes
Trades now count toward testing performance metrics (separate tracking)
This is out-of-sample data - strategy has never seen these bars during "optimization"
Tracks independently: Testing_Trades, Testing_Wins, Testing_PnL
Phase 3 - Validation Check:
Minimum_Trades = 5 (configurable 3-15)
IF (Train_Trades >= Minimum AND Test_Trades >= Minimum):
WR_Efficiency = Test_WinRate / Train_WinRate
Expectancy_Efficiency = Test_Expectancy / Train_Expectancy
WFO_Efficiency = (WR_Efficiency + Expectancy_Efficiency) / 2
IF (WFO_Efficiency >= 0.55): // configurable 0.3-0.9
Strategy.Validated = TRUE
Strategy receives fitness bonus
ELSE:
Strategy receives 30% fitness penalty
ELSE:
Validation deferred (insufficient trades in one or both periods)
What Validation Means
Validated Strategy (Green "✓ VAL" in dashboard):
Performed at least 55% as well on unseen data compared to training data
Gets fitness bonus: +(efficiency - 0.5) × 0.1
Receives priority during tournament selection for breeding
More likely to be chosen as active trading strategy
Unvalidated Strategy (Orange "○ TRAIN" in dashboard):
Failed to maintain performance on test data (likely curve-fitted to training period)
Receives 30% fitness penalty (0.7x multiplier)
Makes strategy prime candidate for culling
Can still trade but with lower selection probability
Insufficient Data (continues collecting):
Hasn't completed both training and testing periods yet
OR hasn't achieved minimum trade count in both periods
Validation check deferred until requirements met
Why 55% Efficiency Threshold?
If a strategy earned 10R during training but only 5.5R during testing, it still proved an edge exists beyond random luck. Requiring 100% efficiency would be unrealistic - market conditions change between periods. But requiring >50% ensures the strategy didn't completely degrade on fresh data.
The Protection: Strategies that work great on historical data but fail on new data are automatically identified and penalized. This prevents the population from being polluted by overfitted strategies that would fail in live trading.
🌊 DYNAMIC VOLATILITY SCALING (DVS): ADAPTIVE STOP/TARGET PLACEMENT
AGE doesn't use fixed stop distances. It adapts to current volatility conditions in real-time.
Four Volatility Measurement Methods
1. ATR Ratio (Simple Method):
Current_Vol = ATR(14) / Close
Baseline_Vol = SMA(Current_Vol, 100)
Ratio = Current_Vol / Baseline_Vol
Basic comparison of current ATR to 100-bar moving average baseline.
2. Parkinson (High-Low Range Based):
For each bar: HL = log(High / Low)
Parkinson_Vol = sqrt(Σ(HL²) / (4 × Period × log(2)))
More stable than close-to-close volatility. Captures intraday range expansion without overnight gap noise.
3. Garman-Klass (OHLC Based):
HL_Term = 0.5 × ²
CO_Term = (2×log(2) - 1) × ²
GK_Vol = sqrt(Σ(HL_Term - CO_Term) / Period)
Most sophisticated estimator. Incorporates all four price points (open, high, low, close) plus gap information.
4. Ensemble Method (Default - Median of All Three):
Ratio_1 = ATR_Current / ATR_Baseline
Ratio_2 = Parkinson_Current / Parkinson_Baseline
Ratio_3 = GK_Current / GK_Baseline
DVS_Ratio = Median(Ratio_1, Ratio_2, Ratio_3)
Why Ensemble?
Takes median to avoid outliers and false spikes
If ATR jumps but range-based methods stay calm, median prevents overreaction
If one method fails, other two compensate
Most robust approach across different market conditions
Sensitivity Scaling
Scaled_Ratio = (Raw_Ratio) ^ Sensitivity
Sensitivity 0.3: Cube root - heavily dampens volatility impact
Sensitivity 0.5: Square root - moderate dampening
Sensitivity 0.7 (Default): Balanced response to volatility changes
Sensitivity 1.0: Linear - full 1:1 volatility impact
Sensitivity 1.5: Exponential - amplified response to volatility spikes
Safety Clamps: Final DVS Ratio always clamped between 0.5x and 2.5x baseline to prevent extreme position sizing or stop placement errors.
How DVS Affects Shadow Trading
Every strategy's stop and target distances are multiplied by the current DVS ratio:
Stop Loss Distance:
Stop_Distance = ATR × ATR_Mult (gene) × Stop_Mult (gene) × DVS_Ratio
Take Profit Distance:
Target_Distance = ATR × ATR_Mult (gene) × Target_Mult (gene) × DVS_Ratio
Example Scenario:
ATR = 10 points
Strategy's ATR_Mult gene = 2.5
Strategy's Stop_Mult gene = 1.5
Strategy's Target_Mult gene = 2.5
DVS_Ratio = 1.4 (40% above baseline volatility - market heating up)
Stop = 10 × 2.5 × 1.5 × 1.4 = 52.5 points (vs. 37.5 in normal vol)
Target = 10 × 2.5 × 2.5 × 1.4 = 87.5 points (vs. 62.5 in normal vol)
Result:
During volatility spikes: Stops automatically widen to avoid noise-based exits, targets extend for bigger moves
During calm periods: Stops tighten for better risk/reward, targets compress for realistic profit-taking
Strategies adapt risk management to match current market behavior
🧬 THE EVOLUTIONARY CYCLE: SPAWN, COMPETE, CULL
Initialization (Bar 1)
AGE begins with 4 seed strategies (if evolution enabled):
Seed Strategy #0 (Balanced):
All sensitivities at 1.0 (neutral)
Zero probability boost
Moderate trend requirement (0.4)
Standard ATR/stop/target multiples (2.5/1.5/2.5)
Mid-level regime adaptation (0.5)
Seed Strategy #1 (Momentum-Focused):
Lower entropy sensitivity (0.7), higher momentum (1.5)
Slight probability boost (+0.03)
Higher trend requirement (0.5)
Tighter stops (1.3), wider targets (3.0)
Seed Strategy #2 (Entropy-Driven):
Higher entropy sensitivity (1.5), lower momentum (0.8)
Slight probability penalty (-0.02)
More trend tolerant (0.6)
Wider stops (1.8), standard targets (2.5)
Seed Strategy #3 (Structure-Based):
Balanced entropy/momentum (0.8/0.9), high structure (1.4)
Slight probability boost (+0.02)
Lower trend requirement (0.35)
Moderate risk parameters (1.6/2.8)
All seeds start with WFO validation bypassed if WFO is disabled, or must validate if enabled.
Spawning New Strategies
Timing (Adaptive):
Historical phase: Every 30 bars (configurable 10-100)
Live phase: Every 200 bars (configurable 100-500)
Automatically switches to live timing when barstate.isrealtime triggers
Conditions:
Current population < max population limit (default: 8, configurable 4-12)
At least 2 active strategies exist (need parents)
Available slot in population array
Selection Process:
Run tournament selection 3 times with different seeds
Each tournament: randomly sample active strategies, pick highest fitness
Best from 3 tournaments becomes Parent 1
Repeat independently for Parent 2
Ensures fit parents but maintains diversity
Crossover Breeding:
For each of 10 genes:
Parent1_Fitness = fitness
Parent2_Fitness = fitness
Weight1 = Parent1_Fitness / (Parent1_Fitness + Parent2_Fitness)
Gene1 = parent1's value
Gene2 = parent2's value
Child_Gene = Weight1 × Gene1 + (1 - Weight1) × Gene2
Fitness-weighted crossover ensures fitter parent contributes more genetic material.
Mutation:
For each gene in child:
IF (random < mutation_rate):
Gene_Range = GENE_MAX - GENE_MIN
Noise = (random - 0.5) × 2 × mutation_strength × Gene_Range
Mutated_Gene = Clamp(Child_Gene + Noise, GENE_MIN, GENE_MAX)
Historical mutation rate: 20% (aggressive exploration)
Live mutation rate: 8% (conservative stability)
Mutation strength: 12% of gene range (configurable 5-25%)
Initialization of New Strategy:
Unique ID assigned (total_spawned counter)
Parent ID recorded
Generation = max(parent generations) + 1
Birth bar recorded (for age tracking)
All performance metrics zeroed
Shadow portfolio reset
WFO validation flag set to false (must prove itself)
Result: New strategy with hybrid DNA enters population, begins trading in next bar.
Competition (Every Bar)
All active strategies:
Calculate their signal based on unique DNA
Check quality gate with their thresholds
Manage shadow positions (entries/exits)
Update performance metrics
Recalculate fitness score
Track WFO validation progress
Strategies compete indirectly through fitness ranking - no direct interaction.
Culling Weak Strategies
Timing (Adaptive):
Historical phase: Every 60 bars (configurable 20-200, should be 2x spawn interval)
Live phase: Every 400 bars (configurable 200-1000, should be 2x spawn interval)
Minimum Adaptation Score (MAS):
Initial MAS = 0.10
MAS decays: MAS × 0.995 every cull cycle
Minimum MAS = 0.03 (floor)
MAS represents the "survival threshold" - strategies below this fitness level are vulnerable.
Culling Conditions (ALL must be true):
Population > minimum population (default: 3, configurable 2-4)
At least one strategy has fitness < MAS
Strategy's age > culling interval (prevents premature culling of new strategies)
Strategy is not in top N elite (default: 2, configurable 1-3)
Culling Process:
Find worst strategy:
For each active strategy:
IF (age > cull_interval):
Fitness = base_fitness
IF (not WFO_validated AND WFO_enabled):
Fitness × 0.7 // 30% penalty for unvalidated
IF (Fitness < MAS AND Fitness < worst_fitness_found):
worst_strategy = this_strategy
worst_fitness = Fitness
IF (worst_strategy found):
Count elite strategies with fitness > worst_fitness
IF (elite_count >= elite_preservation_count):
Deactivate worst_strategy (set active flag = false)
Increment total_culled counter
Elite Protection:
Even if a strategy's fitness falls below MAS, it survives if fewer than N strategies are better. This prevents culling when population is generally weak.
Result: Weak strategies removed from population, freeing slots for new spawns. Gene pool improves over time.
Selection for Display (Every Bar)
AGE chooses one strategy to display signals:
Best fitness = -1
Selected = none
For each active strategy:
Fitness = base_fitness
IF (WFO_validated):
Fitness × 1.3 // 30% bonus for validated strategies
IF (Fitness > best_fitness):
best_fitness = Fitness
selected_strategy = this_strategy
Display selected strategy's signals on chart
Result: Only the highest-fitness (optionally validated-boosted) strategy's signals appear as chart markers. Other strategies trade invisibly in shadow portfolios.
🎨 PREMIUM VISUALIZATION SYSTEM
AGE includes sophisticated visual feedback that standard indicators lack:
1. Gradient Probability Cloud (Optional, Default: ON)
Multi-layer gradient showing signal buildup 2-3 bars before entry:
Activation Conditions:
Signal persistence > 0 (same directional signal held for multiple bars)
Signal probability ≥ minimum threshold (65% by default)
Signal hasn't yet executed (still in "forming" state)
Visual Construction:
7 gradient layers by default (configurable 3-15)
Each layer is a line-fill pair (top line, bottom line, filled between)
Layer spacing: 0.3 to 1.0 × ATR above/below price
Outer layers = faint, inner layers = bright
Color transitions from base to intense based on layer position
Transparency scales with probability (high prob = more opaque)
Color Selection:
Long signals: Gradient from theme.gradient_bull_mid to theme.gradient_bull_strong
Short signals: Gradient from theme.gradient_bear_mid to theme.gradient_bear_strong
Base transparency: 92%, reduces by up to 8% for high-probability setups
Dynamic Behavior:
Cloud grows/shrinks as signal persistence increases/decreases
Redraws every bar while signal is forming
Disappears when signal executes or invalidates
Performance Note: Computationally expensive due to linefill objects. Disable or reduce layers if chart performance degrades.
2. Population Fitness Ribbon (Optional, Default: ON)
Histogram showing fitness distribution across active strategies:
Activation: Only draws on last bar (barstate.islast) to avoid historical clutter
Visual Construction:
10 histogram layers by default (configurable 5-20)
Plots 50 bars back from current bar
Positioned below price at: lowest_low(100) - 1.5×ATR (doesn't interfere with price action)
Each layer represents a fitness threshold (evenly spaced min to max fitness)
Layer Logic:
For layer_num from 0 to ribbon_layers:
Fitness_threshold = min_fitness + (max_fitness - min_fitness) × (layer / layers)
Count strategies with fitness ≥ threshold
Height = ATR × 0.15 × (count / total_active)
Y_position = base_level + ATR × 0.2 × layer
Color = Gradient from weak to strong based on layer position
Line_width = Scaled by height (taller = thicker)
Visual Feedback:
Tall, bright ribbon = healthy population, many fit strategies at high fitness levels
Short, dim ribbon = weak population, few strategies achieving good fitness
Ribbon compression (layers close together) = population converging to similar fitness
Ribbon spread = diverse fitness range, active selection pressure
Use Case: Quick visual health check without opening dashboard. Ribbon growing upward over time = population improving.
3. Confidence Halo (Optional, Default: ON)
Circular polyline around entry signals showing probability strength:
Activation: Draws when new position opens (shadow_position changes from 0 to ±1)
Visual Construction:
20-segment polyline forming approximate circle
Center: Low - 0.5×ATR (long) or High + 0.5×ATR (short)
Radius: 0.3×ATR (low confidence) to 1.0×ATR (elite confidence)
Scales with: (probability - min_probability) / (1.0 - min_probability)
Color Coding:
Elite (85%+): Cyan (theme.conf_elite), large radius, minimal transparency (40%)
Strong (75-85%): Strong green (theme.conf_strong), medium radius, moderate transparency (50%)
Good (65-75%): Good green (theme.conf_good), smaller radius, more transparent (60%)
Moderate (<65%): Moderate green (theme.conf_moderate), tiny radius, very transparent (70%)
Technical Detail:
Uses chart.point array with index-based positioning
5-bar horizontal spread for circular appearance (±5 bars from entry)
Curved=false (Pine Script polyline limitation)
Fill color matches line color but more transparent (88% vs line's transparency)
Purpose: Instant visual probability assessment. No need to check dashboard - halo size/brightness tells the story.
4. Evolution Event Markers (Optional, Default: ON)
Visual indicators of genetic algorithm activity:
Spawn Markers (Diamond, Cyan):
Plots when total_spawned increases on current bar
Location: bottom of chart (location.bottom)
Color: theme.spawn_marker (cyan/bright blue)
Size: tiny
Indicates new strategy just entered population
Cull Markers (X-Cross, Red):
Plots when total_culled increases on current bar
Location: bottom of chart (location.bottom)
Color: theme.cull_marker (red/pink)
Size: tiny
Indicates weak strategy just removed from population
What It Tells You:
Frequent spawning early = population building, active exploration
Frequent culling early = high selection pressure, weak strategies dying fast
Balanced spawn/cull = healthy evolutionary churn
No markers for long periods = stable population (evolution plateaued or optimal genes found)
5. Entry/Exit Markers
Clear visual signals for selected strategy's trades:
Long Entry (Triangle Up, Green):
Plots when selected strategy opens long position (position changes 0 → +1)
Location: below bar (location.belowbar)
Color: theme.long_primary (green/cyan depending on theme)
Transparency: Scales with probability:
Elite (85%+): 0% (fully opaque)
Strong (75-85%): 10%
Good (65-75%): 20%
Acceptable (55-65%): 35%
Size: small
Short Entry (Triangle Down, Red):
Plots when selected strategy opens short position (position changes 0 → -1)
Location: above bar (location.abovebar)
Color: theme.short_primary (red/pink depending on theme)
Transparency: Same scaling as long entries
Size: small
Exit (X-Cross, Orange):
Plots when selected strategy closes position (position changes ±1 → 0)
Location: absolute (at actual exit price if stop/target lines enabled)
Color: theme.exit_color (orange/yellow depending on theme)
Transparency: 0% (fully opaque)
Size: tiny
Result: Clean, probability-scaled markers that don't clutter chart but convey essential information.
6. Stop Loss & Take Profit Lines (Optional, Default: ON)
Visual representation of shadow portfolio risk levels:
Stop Loss Line:
Plots when selected strategy has active position
Level: shadow_stop value from selected strategy
Color: theme.short_primary with 60% transparency (red/pink, subtle)
Width: 2
Style: plot.style_linebr (breaks when no position)
Take Profit Line:
Plots when selected strategy has active position
Level: shadow_target value from selected strategy
Color: theme.long_primary with 60% transparency (green, subtle)
Width: 2
Style: plot.style_linebr (breaks when no position)
Purpose:
Shows where shadow portfolio would exit for stop/target
Helps visualize strategy's risk/reward ratio
Useful for manual traders to set similar levels
Disable for cleaner chart (recommended for presentations)
7. Dynamic Trend EMA
Gradient-colored trend line that visualizes trend strength:
Calculation:
EMA(close, trend_length) - default 50 period (configurable 20-100)
Slope calculated over 10 bars: (current_ema - ema ) / ema × 100
Color Logic:
Trend_direction:
Slope > 0.1% = Bullish (1)
Slope < -0.1% = Bearish (-1)
Otherwise = Neutral (0)
Trend_strength = abs(slope)
Color = Gradient between:
- Neutral color (gray/purple)
- Strong bullish (bright green) if direction = 1
- Strong bearish (bright red) if direction = -1
Gradient factor = trend_strength (0 to 1+ scale)
Visual Behavior:
Faint gray/purple = weak/no trend (choppy conditions)
Light green/red = emerging trend (low strength)
Bright green/red = strong trend (high conviction)
Color intensity = trend strength magnitude
Transparency: 50% (subtle, doesn't overpower price action)
Purpose: Subconscious awareness of trend state without checking dashboard or indicators.
8. Regime Background Tinting (Subtle)
Ultra-low opacity background color indicating detected market regime:
Regime Detection:
Efficiency = directional_movement / total_range (over trend_length bars)
Vol_ratio = current_volatility / average_volatility
IF (efficiency > 0.5 AND vol_ratio < 1.3):
Regime = Trending (1)
ELSE IF (vol_ratio > 1.5):
Regime = Volatile (2)
ELSE:
Regime = Choppy (0)
Background Colors:
Trending: theme.regime_trending (dark green, 92-93% transparency)
Volatile: theme.regime_volatile (dark red, 93% transparency)
Choppy: No tint (normal background)
Purpose:
Subliminal regime awareness
Helps explain why signals are/aren't generating
Trending = ideal conditions for AGE
Volatile = fewer signals, higher thresholds applied
Choppy = mixed signals, lower confidence
Important: Extremely subtle by design. Not meant to be obvious, just subconscious context.
📊 ENHANCED DASHBOARD
Comprehensive real-time metrics in single organized panel (top-right position):
Dashboard Structure (5 columns × 14 rows)
Header Row:
Column 0: "🧬 AGE PRO" + phase indicator (🔴 LIVE or ⏪ HIST)
Column 1: "POPULATION"
Column 2: "PERFORMANCE"
Column 3: "CURRENT SIGNAL"
Column 4: "ACTIVE STRATEGY"
Column 0: Market State
Regime (📈 TREND / 🌊 CHAOS / ➖ CHOP)
DVS Ratio (current volatility scaling factor, format: #.##)
Trend Direction (▲ BULL / ▼ BEAR / ➖ FLAT with color coding)
Trend Strength (0-100 scale, format: #.##)
Column 1: Population Metrics
Active strategies (count / max_population)
Validated strategies (WFO passed / active total)
Current generation number
Total spawned (all-time strategy births)
Total culled (all-time strategy deaths)
Column 2: Aggregate Performance
Total trades across all active strategies
Aggregate win rate (%) - color-coded:
Green (>55%)
Orange (45-55%)
Red (<45%)
Total P&L in R-multiples - color-coded by positive/negative
Best fitness score in population (format: #.###)
MAS - Minimum Adaptation Score (cull threshold, format: #.###)
Column 3: Current Signal Status
Status indicator:
"▲ LONG" (green) if selected strategy in long position
"▼ SHORT" (red) if selected strategy in short position
"⏳ FORMING" (orange) if signal persisting but not yet executed
"○ WAITING" (gray) if no active signal
Confidence percentage (0-100%, format: #.#%)
Quality assessment:
"🔥 ELITE" (cyan) for 85%+ probability
"✓ STRONG" (bright green) for 75-85%
"○ GOOD" (green) for 65-75%
"- LOW" (dim) for <65%
Confluence score (X/3 format)
Signal age:
"X bars" if signal forming
"IN TRADE" if position active
"---" if no signal
Column 4: Selected Strategy Details
Strategy ID number (#X format)
Validation status:
"✓ VAL" (green) if WFO validated
"○ TRAIN" (orange) if still in training/testing phase
Generation number (GX format)
Personal fitness score (format: #.### with color coding)
Trade count
P&L and win rate (format: #.#R (##%) with color coding)
Color Scheme:
Panel background: theme.panel_bg (dark, low opacity)
Panel headers: theme.panel_header (slightly lighter)
Primary text: theme.text_primary (bright, high contrast)
Secondary text: theme.text_secondary (dim, lower contrast)
Positive metrics: theme.metric_positive (green)
Warning metrics: theme.metric_warning (orange)
Negative metrics: theme.metric_negative (red)
Special markers: theme.validated_marker, theme.spawn_marker
Update Frequency: Only on barstate.islast (current bar) to minimize CPU usage
Purpose:
Quick overview of entire system state
No need to check multiple indicators
Trading decisions informed by population health, regime state, and signal quality
Transparency into what AGE is thinking
🔍 DIAGNOSTICS PANEL (Optional, Default: OFF)
Detailed signal quality tracking for optimization and debugging:
Panel Structure (3 columns × 8 rows)
Position: Bottom-right corner (doesn't interfere with main dashboard)
Header Row:
Column 0: "🔍 DIAGNOSTICS"
Column 1: "COUNT"
Column 2: "%"
Metrics Tracked (for selected strategy only):
Total Evaluated:
Every signal that passed initial calculation (direction ≠ 0)
Represents total opportunities considered
✓ Passed:
Signals that passed quality gate and executed
Green color coding
Percentage of evaluated signals
Rejection Breakdown:
⨯ Probability:
Rejected because probability < minimum threshold
Most common rejection reason typically
⨯ Confluence:
Rejected because confluence < minimum required (e.g., only 1 of 3 indicators agreed)
⨯ Trend:
Rejected because signal opposed strong trend
Indicates counter-trend protection working
⨯ Regime:
Rejected because volatile regime detected and probability wasn't high enough to override
Shows regime filter in action
⨯ Volume:
Rejected because volume < 70% of 20-bar average
Indicates volume confirmation requirement
Color Coding:
Passed count: Green (success metric)
Rejection counts: Red (failure metrics)
Percentages: Gray (neutral, informational)
Performance Cost: Slight CPU overhead for tracking counters. Disable when not actively optimizing settings.
How to Use Diagnostics
Scenario 1: Too Few Signals
Evaluated: 200
Passed: 10 (5%)
⨯ Probability: 120 (60%)
⨯ Confluence: 40 (20%)
⨯ Others: 30 (15%)
Diagnosis: Probability threshold too high for this strategy's DNA.
Solution: Lower min probability from 65% to 60%, or allow strategy more time to evolve better DNA.
Scenario 2: Too Many False Signals
Evaluated: 200
Passed: 80 (40%)
Strategy win rate: 45%
Diagnosis: Quality gate too loose, letting low-quality signals through.
Solution: Raise min probability to 70%, or increase min confluence to 3 (all indicators must agree).
Scenario 3: Regime-Specific Issues
⨯ Regime: 90 (45% of rejections)
Diagnosis: Frequent volatile regime detection blocking otherwise good signals.
Solution: Either accept fewer trades during chaos (recommended), or disable regime filter if you want signals regardless of market state.
Optimization Workflow:
Enable diagnostics
Run 200+ bars
Analyze rejection patterns
Adjust settings based on data
Re-run and compare pass rate
Disable diagnostics when satisfied
⚙️ CONFIGURATION GUIDE
🧬 Evolution Engine Settings
Enable AGE Evolution (Default: ON):
ON: Full genetic algorithm (recommended for best results)
OFF: Uses only 4 seed strategies, no spawning/culling (static population for comparison testing)
Max Population (4-12, Default: 8):
Higher = more diversity, more exploration, slower performance
Lower = faster computation, less exploration, risk of premature convergence
Sweet spot: 6-8 for most use cases
4 = minimum for meaningful evolution
12 = maximum before diminishing returns
Min Population (2-4, Default: 3):
Safety floor - system never culls below this count
Prevents population extinction during harsh selection
Should be at least half of max population
Elite Preservation (1-3, Default: 2):
Top N performers completely immune to culling
Ensures best genes always survive
1 = minimal protection, aggressive selection
2 = balanced (recommended)
3 = conservative, slower gene pool turnover
Historical: Spawn Interval (10-100, Default: 30):
Bars between spawning new strategies during historical data
Lower = faster evolution, more exploration
Higher = slower evolution, more evaluation time per strategy
30 bars = ~1-2 hours on 15min chart
Historical: Cull Interval (20-200, Default: 60):
Bars between culling weak strategies during historical data
Should be 2x spawn interval for balanced churn
Lower = aggressive selection pressure
Higher = patient evaluation
Live: Spawn Interval (100-500, Default: 200):
Bars between spawning during live trading
Much slower than historical for stability
Prevents population chaos during live trading
200 bars = ~1.5 trading days on 15min chart
Live: Cull Interval (200-1000, Default: 400):
Bars between culling during live trading
Should be 2x live spawn interval
Conservative removal during live trading
Historical: Mutation Rate (0.05-0.40, Default: 0.20):
Probability each gene mutates during breeding (20% = 2 out of 10 genes on average)
Higher = more exploration, slower convergence
Lower = more exploitation, faster convergence but risk of local optima
20% balances exploration vs exploitation
Live: Mutation Rate (0.02-0.20, Default: 0.08):
Mutation rate during live trading
Much lower for stability (don't want population to suddenly degrade)
8% = mostly inherits parent genes with small tweaks
Mutation Strength (0.05-0.25, Default: 0.12):
How much genes change when mutated (% of gene's total range)
0.05 = tiny nudges (fine-tuning)
0.12 = moderate jumps (recommended)
0.25 = large leaps (aggressive exploration)
Example: If gene range is 0.5-2.0, 12% strength = ±0.18 possible change
📈 Signal Quality Settings
Min Signal Probability (0.55-0.80, Default: 0.65):
Quality gate threshold - signals below this never generate
0.55-0.60 = More signals, accept lower confidence (higher risk)
0.65 = Institutional-grade balance (recommended)
0.70-0.75 = Fewer but higher-quality signals (conservative)
0.80+ = Very selective, very few signals (ultra-conservative)
Min Confluence Score (1-3, Default: 2):
Required indicator agreement before signal generates
1 = Any single indicator can trigger (not recommended - too many false signals)
2 = Requires 2 of 3 indicators agree (RECOMMENDED for balance)
3 = All 3 must agree (very selective, few signals, high quality)
Base Persistence Bars (1-5, Default: 2):
Base bars signal must persist before entry
System adapts automatically:
High probability signals (75%+) enter 1 bar faster
Low probability signals (<68%) need 1 bar more
Trending regime: -1 bar (faster entries)
Volatile regime: +1 bar (more confirmation)
1 = Immediate entry after quality gate (responsive but prone to whipsaw)
2 = Balanced confirmation (recommended)
3-5 = Patient confirmation (slower but more reliable)
Cooldown After Trade (3-20, Default: 8):
Bars to wait after exit before next entry allowed
Prevents overtrading and revenge trading
3 = Minimal cooldown (active trading)
8 = Balanced (recommended)
15-20 = Conservative (position trading)
Entropy Length (10-50, Default: 20):
Lookback period for market order/disorder calculation
Lower = more responsive to regime changes (noisy)
Higher = more stable regime detection (laggy)
20 = works across most timeframes
Momentum Length (5-30, Default: 14):
Period for RSI/ROC calculations
14 = standard (RSI default)
Lower = more signals, less reliable
Higher = fewer signals, more reliable
Structure Length (20-100, Default: 50):
Lookback for support/resistance swing range
20 = short-term swings (day trading)
50 = medium-term structure (recommended)
100 = major structure (position trading)
Trend EMA Length (20-100, Default: 50):
EMA period for trend detection and direction bias
20 = short-term trend (responsive)
50 = medium-term trend (recommended)
100 = long-term trend (position trading)
ATR Period (5-30, Default: 14):
Period for volatility measurement
14 = standard ATR
Lower = more responsive to vol changes
Higher = smoother vol calculation
📊 Volatility Scaling (DVS) Settings
Enable DVS (Default: ON):
Dynamic volatility scaling for adaptive stop/target placement
Highly recommended to leave ON
OFF only for testing fixed-distance stops
DVS Method (Default: Ensemble):
ATR Ratio: Simple, fast, single-method (good for beginners)
Parkinson: High-low range based (good for intraday)
Garman-Klass: OHLC based (sophisticated, considers gaps)
Ensemble: Median of all three (RECOMMENDED - most robust)
DVS Memory (20-200, Default: 100):
Lookback for baseline volatility comparison
20 = very responsive to vol changes (can overreact)
100 = balanced adaptation (recommended)
200 = slow, stable baseline (minimizes false vol signals)
DVS Sensitivity (0.3-1.5, Default: 0.7):
How much volatility affects scaling (power-law exponent)
0.3 = Conservative, heavily dampens vol impact (cube root)
0.5 = Moderate dampening (square root)
0.7 = Balanced response (recommended)
1.0 = Linear, full 1:1 vol response
1.5 = Aggressive, amplified response (exponential)
🔬 Walk-Forward Optimization Settings
Enable WFO (Default: ON):
Out-of-sample validation to prevent overfitting
Highly recommended to leave ON
OFF only for testing or if you want unvalidated strategies
Training Window (100-500, Default: 250):
Bars for in-sample optimization
100 = fast validation, less data (risky)
250 = balanced (recommended) - about 1-2 months on daily, 1-2 weeks on 15min
500 = patient validation, more data (conservative)
Testing Window (30-200, Default: 75):
Bars for out-of-sample validation
Should be ~30% of training window
30 = minimal test (fast validation)
75 = balanced (recommended)
200 = extensive test (very conservative)
Min Trades for Validation (3-15, Default: 5):
Required trades in BOTH training AND testing periods
3 = minimal sample (risky, fast validation)
5 = balanced (recommended)
10+ = conservative (slow validation, high confidence)
WFO Efficiency Threshold (0.3-0.9, Default: 0.55):
Minimum test/train performance ratio required
0.30 = Very loose (test must be 30% as good as training)
0.55 = Balanced (recommended) - test must be 55% as good
0.70+ = Strict (test must closely match training)
Higher = fewer validated strategies, lower risk of overfitting
🎨 Premium Visuals Settings
Visual Theme:
Neon Genesis: Cyberpunk aesthetic (cyan/magenta/purple)
Carbon Fiber: Industrial look (blue/red/gray)
Quantum Blue: Quantum computing (blue/purple/pink)
Aurora: Northern lights (teal/orange/purple)
⚡ Gradient Probability Cloud (Default: ON):
Multi-layer gradient showing signal buildup
Turn OFF if chart lags or for cleaner look
Cloud Gradient Layers (3-15, Default: 7):
More layers = smoother gradient, more CPU intensive
Fewer layers = faster, blockier appearance
🎗️ Population Fitness Ribbon (Default: ON):
Histogram showing fitness distribution
Turn OFF for cleaner chart
Ribbon Layers (5-20, Default: 10):
More layers = finer fitness detail
Fewer layers = simpler histogram
⭕ Signal Confidence Halo (Default: ON):
Circular indicator around entry signals
Size/brightness scales with probability
Minimal performance cost
🔬 Evolution Event Markers (Default: ON):
Diamond (spawn) and X (cull) markers
Shows genetic algorithm activity
Minimal performance cost
🎯 Stop/Target Lines (Default: ON):
Shows shadow portfolio stop/target levels
Turn OFF for cleaner chart (recommended for screenshots/presentations)
📊 Enhanced Dashboard (Default: ON):
Comprehensive metrics panel
Should stay ON unless you want zero overlays
🔍 Diagnostics Panel (Default: OFF):
Detailed signal rejection tracking
Turn ON when optimizing settings
Turn OFF during normal use (slight performance cost)
📈 USAGE WORKFLOW - HOW TO USE THIS INDICATOR
Phase 1: Initial Setup & Learning
Add AGE to your chart
Recommended timeframes: 15min, 30min, 1H (best signal-to-noise ratio)
Works on: 5min (day trading), 4H (swing trading), Daily (position trading)
Load 1000+ bars for sufficient evolution history
Let the population evolve (100+ bars minimum)
First 50 bars: Random exploration, poor results expected
Bars 50-150: Population converging, fitness improving
Bars 150+: Stable performance, validated strategies emerging
Watch the dashboard metrics
Population should grow toward max capacity
Generation number should advance regularly
Validated strategies counter should increase
Best fitness should trend upward toward 0.50-0.70 range
Observe evolution markers
Diamond markers (cyan) = new strategies spawning
X markers (red) = weak strategies being culled
Frequent early activity = healthy evolution
Activity slowing = population stabilizing
Be patient. Evolution takes time. Don't judge performance before 150+ bars.
Phase 2: Signal Observation
Watch signals form
Gradient cloud builds up 2-3 bars before entry
Cloud brightness = probability strength
Cloud thickness = signal persistence
Check signal quality
Look at confidence halo size when entry marker appears
Large bright halo = elite setup (85%+)
Medium halo = strong setup (75-85%)
Small halo = good setup (65-75%)
Verify market conditions
Check trend EMA color (green = uptrend, red = downtrend, gray = choppy)
Check background tint (green = trending, red = volatile, clear = choppy)
Trending background + aligned signal = ideal conditions
Review dashboard signal status
Current Signal column shows:
Status (Long/Short/Forming/Waiting)
Confidence % (actual probability value)
Quality assessment (Elite/Strong/Good)
Confluence score (2/3 or 3/3 preferred)
Only signals meeting ALL quality gates appear on chart. If you're not seeing signals, population is either still learning or market conditions aren't suitable.
Phase 3: Manual Trading Execution
When Long Signal Fires:
Verify confidence level (dashboard or halo size)
Confirm trend alignment (EMA sloping up, green color)
Check regime (preferably trending or choppy, avoid volatile)
Enter long manually on your broker platform
Set stop loss at displayed stop line level (if lines enabled), or use your own risk management
Set take profit at displayed target line level, or trail manually
Monitor position - exit if X marker appears (signal reversal)
When Short Signal Fires:
Same verification process
Confirm downtrend (EMA sloping down, red color)
Enter short manually
Use displayed stop/target levels or your own
AGE tells you WHEN and HOW CONFIDENT. You decide WHETHER and HOW MUCH.
Phase 4: Set Up Alerts (Never Miss a Signal)
Right-click on indicator name in legend
Select "Add Alert"
Choose condition:
"AGE Long" = Long entry signal fired
"AGE Short" = Short entry signal fired
"AGE Exit" = Position reversal/exit signal
Set notification method:
Sound alert (popup on chart)
Email notification
Webhook to phone/trading platform
Mobile app push notification
Name the alert (e.g., "AGE BTCUSD 15min Long")
Save alert
Recommended: Set alerts for both long and short, enable mobile push notifications. You'll get alerted in real-time even if not watching charts.
Phase 5: Monitor Population Health
Weekly Review:
Check dashboard Population column:
Active count should be near max (6-8 of 8)
Validated count should be >50% of active
Generation should be advancing (1-2 per week typical)
Check dashboard Performance column:
Aggregate win rate should be >50% (target: 55-65%)
Total P&L should be positive (may fluctuate)
Best fitness should be >0.50 (target: 0.55-0.70)
MAS should be declining slowly (normal adaptation)
Check Active Strategy column:
Selected strategy should be validated (✓ VAL)
Personal fitness should match best fitness
Trade count should be accumulating
Win rate should be >50%
Warning Signs:
Zero validated strategies after 300+ bars = settings too strict or market unsuitable
Best fitness stuck <0.30 = population struggling, consider parameter adjustment
No spawning/culling for 200+ bars = evolution stalled (may be optimal or need reset)
Aggregate win rate <45% sustained = system not working on this instrument/timeframe
Health Check Pass:
50%+ strategies validated
Best fitness >0.50
Aggregate win rate >52%
Regular spawn/cull activity
Selected strategy validated
Phase 6: Optimization (If Needed)
Enable Diagnostics Panel (bottom-right) for data-driven tuning:
Problem: Too Few Signals
Evaluated: 200
Passed: 8 (4%)
⨯ Probability: 140 (70%)
Solutions:
Lower min probability: 65% → 60% or 55%
Reduce min confluence: 2 → 1
Lower base persistence: 2 → 1
Increase mutation rate temporarily to explore new genes
Check if regime filter is blocking signals (⨯ Regime high?)
Problem: Too Many False Signals
Evaluated: 200
Passed: 90 (45%)
Win rate: 42%
Solutions:
Raise min probability: 65% → 70% or 75%
Increase min confluence: 2 → 3
Raise base persistence: 2 → 3
Enable WFO if disabled (validates strategies before use)
Check if volume filter is being ignored (⨯ Volume low?)
Problem: Counter-Trend Losses
⨯ Trend: 5 (only 5% rejected)
Losses often occur against trend
Solutions:
System should already filter trend opposition
May need stronger trend requirement
Consider only taking signals aligned with higher timeframe trend
Use longer trend EMA (50 → 100)
Problem: Volatile Market Whipsaws
⨯ Regime: 100 (50% rejected by volatile regime)
Still getting stopped out frequently
Solutions:
System is correctly blocking volatile signals
Losses happening because vol filter isn't strict enough
Consider not trading during volatile periods (respect the regime)
Or disable regime filter and accept higher risk
Optimization Workflow:
Enable diagnostics
Run 200+ bars with current settings
Analyze rejection patterns and win rate
Make ONE change at a time (scientific method)
Re-run 200+ bars and compare results
Keep change if improvement, revert if worse
Disable diagnostics when satisfied
Never change multiple parameters at once - you won't know what worked.
Phase 7: Multi-Instrument Deployment
AGE learns independently on each chart:
Recommended Strategy:
Deploy AGE on 3-5 different instruments
Different asset classes ideal (e.g., ES futures, EURUSD, BTCUSD, SPY, Gold)
Each learns optimal strategies for that instrument's personality
Take signals from all 5 charts
Natural diversification reduces overall risk
Why This Works:
When one market is choppy, others may be trending
Different instruments respond to different news/catalysts
Portfolio-level win rate more stable than single-instrument
Evolution explores different parameter spaces on each chart
Setup:
Same settings across all charts (or customize if preferred)
Set alerts for all
Take every validated signal across all instruments
Position size based on total account (don't overleverage any single signal)
⚠️ REALISTIC EXPECTATIONS - CRITICAL READING
What AGE Can Do
✅ Generate probability-weighted signals using genetic algorithms
✅ Evolve strategies in real-time through natural selection
✅ Validate strategies on out-of-sample data (walk-forward optimization)
✅ Adapt to changing market conditions automatically over time
✅ Provide comprehensive metrics on population health and signal quality
✅ Work on any instrument, any timeframe, any broker
✅ Improve over time as weak strategies are culled and fit strategies breed
What AGE Cannot Do
❌ Win every trade (typical win rate: 55-65% at best)
❌ Predict the future with certainty (markets are probabilistic, not deterministic)
❌ Work perfectly from bar 1 (needs 100-150 bars to learn and stabilize)
❌ Guarantee profits under all market conditions
❌ Replace your trading discipline and risk management
❌ Execute trades automatically (this is an indicator, not a strategy)
❌ Prevent all losses (drawdowns are normal and expected)
❌ Adapt instantly to regime changes (re-learning takes 50-100 bars)
Performance Realities
Typical Performance After Evolution Stabilizes (150+ bars):
Win Rate: 55-65% (excellent for trend-following systems)
Profit Factor: 1.5-2.5 (realistic for validated strategies)
Signal Frequency: 5-15 signals per 100 bars (quality over quantity)
Drawdown Periods: 20-40% of time in equity retracement (normal trading reality)
Max Consecutive Losses: 5-8 losses possible even with 60% win rate (probability says this is normal)
Evolution Timeline:
Bars 0-50: Random exploration, learning phase - poor results expected, don't judge yet
Bars 50-150: Population converging, fitness climbing - results improving
Bars 150-300: Stable performance, most strategies validated - consistent results
Bars 300+: Mature population, optimal genes dominant - best results
Market Condition Dependency:
Trending Markets: AGE excels - clear directional moves, high-probability setups
Choppy Markets: AGE struggles - fewer signals generated, lower win rate
Volatile Markets: AGE cautious - higher rejection rate, wider stops, fewer trades
Market Regime Changes:
When market shifts from trending to choppy overnight
Validated strategies can become temporarily invalidated
AGE will adapt through evolution, but not instantly
Expect 50-100 bar re-learning period after major regime shifts
Fitness may temporarily drop then recover
This is NOT a holy grail. It's a sophisticated signal generator that learns and adapts using genetic algorithms. Your success depends on:
Patience during learning periods (don't abandon after 3 losses)
Proper position sizing (risk 0.5-2% per trade, not 10%)
Following signals consistently (cherry-picking defeats statistical edge)
Not abandoning system prematurely (give it 200+ bars minimum)
Understanding probability (60% win rate means 40% of trades WILL lose)
Respecting market conditions (trending = trade more, choppy = trade less)
Managing emotions (AGE is emotionless, you need to be too)
Expected Drawdowns:
Single-strategy max DD: 10-20% of equity (normal)
Portfolio across multiple instruments: 5-15% (diversification helps)
Losing streaks: 3-5 consecutive losses expected periodically
No indicator eliminates risk. AGE manages risk through:
Quality gates (rejecting low-probability signals)
Confluence requirements (multi-indicator confirmation)
Persistence requirements (no knee-jerk reactions)
Regime awareness (reduced trading in chaos)
Walk-forward validation (preventing overfitting)
But it cannot prevent all losses. That's inherent to trading.
🔧 TECHNICAL SPECIFICATIONS
Platform: TradingView Pine Script v5
Indicator Type: Overlay indicator (plots on price chart)
Execution Type: Signals only - no automatic order placement
Computational Load:
Moderate to High (genetic algorithms + shadow portfolios)
8 strategies × shadow portfolio simulation = significant computation
Premium visuals add additional load (gradient cloud, fitness ribbon)
TradingView Resource Limits (Built-in Caps):
Max Bars Back: 500 (sufficient for WFO and evolution)
Max Labels: 100 (plenty for entry/exit markers)
Max Lines: 150 (adequate for stop/target lines)
Max Boxes: 50 (not heavily used)
Max Polylines: 100 (confidence halos)
Recommended Chart Settings:
Timeframe: 15min to 1H (optimal signal/noise balance)
5min: Works but noisier, more signals
4H/Daily: Works but fewer signals
Bars Loaded: 1000+ (ensures sufficient evolution history)
Replay Mode: Excellent for testing without risk
Performance Optimization Tips:
Disable gradient cloud if chart lags (most CPU intensive visual)
Disable fitness ribbon if still laggy
Reduce cloud layers from 7 to 3
Reduce ribbon layers from 10 to 5
Turn off diagnostics panel unless actively tuning
Close other heavy indicators to free resources
Browser/Platform Compatibility:
Works on all modern browsers (Chrome, Firefox, Safari, Edge)
Mobile app supported (full functionality on phone/tablet)
Desktop app supported (best performance)
Web version supported (may be slower on older computers)
Data Requirements:
Real-time or delayed data both work
No special data feeds required
Works with TradingView's standard data
Historical + live data seamlessly integrated
🎓 THEORETICAL FOUNDATIONS
AGE synthesizes advanced concepts from multiple disciplines:
Evolutionary Computation
Genetic Algorithms (Holland, 1975): Population-based optimization through natural selection metaphor
Tournament Selection: Fitness-based parent selection with diversity preservation
Crossover Operators: Fitness-weighted gene recombination from two parents
Mutation Operators: Random gene perturbation for exploration of new parameter space
Elitism: Preservation of top N performers to prevent loss of best solutions
Adaptive Parameters: Different mutation rates for historical vs. live phases
Technical Analysis
Support/Resistance: Price structure within swing ranges
Trend Following: EMA-based directional bias
Momentum Analysis: RSI, ROC, MACD composite indicators
Volatility Analysis: ATR-based risk scaling
Volume Confirmation: Trade activity validation
Information Theory
Shannon Entropy (1948): Quantification of market order vs. disorder
Signal-to-Noise Ratio: Directional information vs. random walk
Information Content: How much "information" a price move contains
Statistics & Probability
Walk-Forward Analysis: Rolling in-sample/out-of-sample optimization
Out-of-Sample Validation: Testing on unseen data to prevent overfitting
Monte Carlo Principles: Shadow portfolio simulation with realistic execution
Expectancy Theory: Win rate × avg win - loss rate × avg loss
Probability Distributions: Signal confidence quantification
Risk Management
ATR-Based Stops: Volatility-normalized risk per trade
Volatility Regime Detection: Market state classification (trending/choppy/volatile)
Drawdown Control: Peak-to-trough equity measurement
R-Multiple Normalization: Performance measurement in risk units
Machine Learning Concepts
Online Learning: Continuous adaptation as new data arrives
Fitness Functions: Multi-objective optimization (win rate + expectancy + drawdown)
Exploration vs. Exploitation: Balance between trying new strategies and using proven ones
Overfitting Prevention: Walk-forward validation as regularization
Novel Contribution:
AGE is the first TradingView indicator to apply genetic algorithms to real-time indicator parameter optimization while maintaining strict anti-overfitting controls through walk-forward validation.
Most "adaptive" indicators simply recalibrate lookback periods or thresholds. AGE evolves entirely new strategies through competitive selection - it's not parameter tuning, it's Darwinian evolution of trading logic itself.
The combination of:
Genetic algorithm population management
Shadow portfolio simulation for realistic fitness evaluation
Walk-forward validation to prevent overfitting
Multi-indicator confluence for signal quality
Dynamic volatility scaling for adaptive risk
...creates a system that genuinely learns and improves over time while avoiding the curse of curve-fitting that plagues most optimization approaches.
🏗️ DEVELOPMENT NOTES
This project represents months of intensive development, facing significant technical challenges:
Challenge 1: Making Genetics Actually Work
Early versions spawned garbage strategies that polluted the gene pool:
Random gene combinations produced nonsensical parameter sets
Weak strategies survived too long, dragging down population
No clear convergence toward optimal solutions
Solution:
Comprehensive fitness scoring (4 factors: win rate, P&L, expectancy, drawdown)
Elite preservation (top 2 always protected)
Walk-forward validation (unproven strategies penalized 30%)
Tournament selection (fitness-weighted breeding)
Adaptive culling (MAS decay creates increasing selection pressure)
Challenge 2: Balancing Evolution Speed vs. Stability
Too fast = population chaos, no convergence. Too slow = can't adapt to regime changes.
Solution:
Dual-phase timing: Fast evolution during historical (30/60 bar intervals), slow during live (200/400 bar intervals)
Adaptive mutation rates: 20% historical, 8% live
Spawn/cull ratio: Always 2:1 to prevent population collapse
Challenge 3: Shadow Portfolio Accuracy
Needed realistic trade simulation without lookahead bias:
Can't peek at future bars for exits
Must track multiple portfolios simultaneously
Stop/target checks must use bar's high/low correctly
Solution:
Entry on close (realistic)
Exit checks on current bar's high/low (realistic)
Independent position tracking per strategy
Cooldown periods to prevent unrealistic rapid re-entry
ATR-normalized P&L (R-multiples) for fair comparison across volatility regimes
Challenge 4: Pine Script Compilation Limits
Hit TradingView's execution limits multiple times:
Too many array operations
Too many variables
Too complex conditional logic
Solution:
Optimized data structures (single DNA array instead of 8 separate arrays)
Minimal visual overlays (only essential plots)
Efficient fitness calculations (vectorized where possible)
Strategic use of barstate.islast to minimize dashboard updates
Challenge 5: Walk-Forward Implementation
Standard WFO is difficult in Pine Script:
Can't easily "roll forward" through historical data
Can't re-optimize strategies mid-stream
Must work in real-time streaming environment
Solution:
Age-based phase detection (first 250 bars = training, next 75 = testing)
Separate metric tracking for train vs. test
Efficiency calculation at fixed interval (after test period completes)
Validation flag persists for strategy lifetime
Challenge 6: Signal Quality Control
Early versions generated too many signals with poor win rates:
Single indicators produced excessive noise
No trend alignment
No regime awareness
Instant entries on single-bar spikes
Solution:
Three-layer confluence system (entropy + momentum + structure)
Minimum 2-of-3 agreement requirement
Trend alignment checks (penalty for counter-trend)
Regime-based probability adjustments
Persistence requirements (signals must hold multiple bars)
Volume confirmation
Quality gate (probability + confluence thresholds)
The Result
A system that:
Truly evolves (not just parameter sweeps)
Truly validates (out-of-sample testing)
Truly adapts (ongoing competition and breeding)
Stays within TradingView's platform constraints
Provides institutional-quality signals
Maintains transparency (full metrics dashboard)
Development time: 3+ months of iterative refinement
Lines of code: ~1500 (highly optimized)
Test instruments: ES, NQ, EURUSD, BTCUSD, SPY, AAPL
Test timeframes: 5min, 15min, 1H, Daily
🎯 FINAL WORDS
The Adaptive Genesis Engine is not just another indicator - it's a living system that learns, adapts, and improves through the same principles that drive biological evolution. Every bar it observes adds to its experience. Every strategy it spawns explores new parameter combinations. Every strategy it culls removes weakness from the gene pool.
This is evolution in action on your charts.
You're not getting a static formula locked in time. You're getting a system that thinks , that competes , that survives through natural selection. The strongest strategies rise to the top. The weakest die. The gene pool improves generation after generation.
AGE doesn't claim to predict the future - it adapts to whatever the future brings. When markets shift from trending to choppy, from calm to volatile, from bullish to bearish - AGE evolves new strategies suited to the new regime.
Use it on any instrument. Any timeframe. Any market condition. AGE will adapt.
This indicator gives you the pure signal intelligence. How you choose to act on it - position sizing, risk management, execution discipline - that's your responsibility. AGE tells you when and how confident . You decide whether and how much .
Trust the process. Respect the evolution. Let Darwin work.
"In markets, as in nature, it is not the strongest strategies that survive, nor the most intelligent - but those most responsive to change."
Taking you to school. — Dskyz, Trade with insight. Trade with anticipation.
— Happy Holiday's
Apex Trend & Liquidity Master with TP/SLThe Apex Trend & Liquidity Master is a systematic trading framework that identifies trend direction and key structural price levels for entry and exit decisions. The system uses a volatility-adaptive trend detection mechanism built on Hull Moving Averages with ATR-based bands to filter consolidation periods and isolate directional moves.
The liquidity detection engine identifies potential reversal zones by marking swing highs and lows that meet statistical significance thresholds. These zones represent areas where institutional order flow previously caused price rejection. Zones remain active until price closes through them, indicating mitigation of the level.
This implementation is an enhanced derivative of the original system with fully automated risk management. Stop losses are calculated using ATR multiples with entry candle wick protection as a minimum threshold, while take profits maintain a fixed 3:1 risk-reward ratio. An additional exit mechanism closes profitable positions when price reaches opposing supply or demand zones, providing early profit-taking at probable reversal points before full target completion.
Entry signals generate only on trend changes when volume exceeds average levels, reducing false breakouts in ranging conditions. The system includes complete position tracking with three distinct exit types: take profit hits, stop loss hits, and profitable zone contact exits. All calculations use confirmed historical data with no forward-looking bias, though supply/demand zone identification operates with a confirmation lag inherent to pivot point detection.
Nexural ORB Nexural ORB - Multi-Timeframe Opening Range Breakout Indicator
Introduction
This indicator was built out of frustration. After testing dozens of ORB tools, both free and paid, I found that most of them either did too little or cluttered the chart with unnecessary information. The Opening Range Breakout is one of the oldest and most reliable intraday strategies, yet most indicators treat it as an afterthought - just a box on the chart with no context.
This is not that kind of indicator.
The Nexural Ultimate ORB tracks the Opening Range across three timeframes simultaneously, provides quality scoring to help you identify high-probability setups, detects when multiple levels align for confluence, and now includes historical ORB data so you can scroll back and review previous sessions. It does not tell you when to buy or sell. It does not promise profits. What it does is give you clean, accurate levels with the context you need to make informed decisions.
I am going to be completely transparent about what this indicator does, how it works, what it does well, and where it falls short. If you are looking for a magic solution that prints money, this is not it. If you are looking for a professional-grade tool that will become a permanent part of your charting setup, keep reading.
What Is The Opening Range Breakout
Before diving into the indicator itself, let me explain the strategy it is built around.
The Opening Range is simply the high and low price established during the first portion of the trading session. For US equities and futures, this typically begins at 9:30 AM Eastern Time. The theory behind trading the Opening Range is straightforward: the first 15, 30, or 60 minutes of trade often sets the tone for the rest of the day. Institutional traders, algorithms, and market makers are all actively positioning during this window, and the levels they establish become reference points for the remainder of the session.
When price breaks above the Opening Range High, it suggests bullish momentum and the potential for continuation higher. When price breaks below the Opening Range Low, it suggests bearish momentum and the potential for continuation lower. The strategy has been used by floor traders for decades and remains relevant today because the underlying market dynamics have not changed - the open is when the most information gets priced in, and the levels established during that period matter.
This indicator does not trade the ORB for you. It identifies the levels, tracks multiple timeframes, and provides context. The actual trading decisions are yours.
How The Opening Range Is Calculated
The indicator calculates the Opening Range for three timeframes:
The 15-Minute ORB captures the high and low from 9:30 AM to 9:45 AM. This is the shortest timeframe and typically produces the tightest range. Breakouts from the 15-minute ORB tend to occur earliest in the session and can provide early directional signals, though they are also more prone to false breakouts due to the narrow range.
The 30-Minute ORB captures the high and low from 9:30 AM to 10:00 AM. This is considered by many institutional traders to be the most significant timeframe. The 30-minute window allows enough time for the initial volatility to settle while still capturing the core opening activity. Many professional trading desks reference the 30-minute ORB as their primary intraday framework.
The 60-Minute ORB captures the high and low from 9:30 AM to 10:30 AM. This is the widest range and produces fewer signals, but those signals tend to be more reliable. The 60-minute ORB is particularly useful on high-volatility days when the 15 and 30-minute ranges get quickly violated.
The calculation itself is simple. As each bar completes during the opening period, the indicator compares the current high and low to the stored values and updates them if new extremes are reached. Once the timeframe completes, the levels lock in and do not change for the rest of the session.
I want to be absolutely clear about one thing: there is no repainting. The ORB levels are calculated in real-time as the opening period develops. Once a timeframe completes, those levels are final. You will not look back at your chart and see different levels than what appeared in real-time. This is critically important for any indicator you use for actual trading decisions.
Visual Hierarchy and Line Styles
One of the main problems with multi-timeframe indicators is visual clutter. When you have six lines on the chart representing three different ORBs, it becomes difficult to quickly identify which level belongs to which timeframe.
This indicator solves that problem through a clear visual hierarchy. Each timeframe has its own color, line width, and line style, all of which are fully customizable.
By default, the 15-Minute ORB uses solid lines with the heaviest weight. This makes it the most prominent on the chart because it is typically the first level to be tested and often the most actively traded.
The 30-Minute ORB uses dashed lines with a medium weight. This keeps it visible but clearly secondary to the 15-minute levels.
The 60-Minute ORB uses dotted lines with a medium weight. This places it in the background as a reference level rather than an active trading zone.
You can change any of these settings. If you prefer to trade the 30-minute ORB exclusively, you can make it solid and bold while keeping the others subtle. If you only want to see the 60-minute ORB, you can disable the other two entirely. The flexibility is there because every trader has different preferences.
The dashboard in the top right corner of the chart displays the corresponding line style next to each timeframe, so you always know which line on the chart matches which row in the dashboard.
The Quality Scoring System
Not every Opening Range is worth trading. Some days produce tight, clean ranges with strong follow-through. Other days produce wide, choppy ranges that lead to multiple false breakouts. One of the most valuable features of this indicator is the Quality Score, which grades each session from A-plus down to C.
The Quality Score is calculated based on several factors:
Range Size is the most important factor. The indicator compares the current ORB range to the average daily range over the past 20 sessions. A tight range, defined as less than 40 percent of the average daily range, receives the highest score. The logic here is simple: tight ranges indicate consolidation, and consolidation often precedes expansion. When the ORB is tight, a breakout has more room to run.
A normal range, between 40 and 80 percent of the average daily range, receives a moderate score. These are typical trading days without any particular edge from a range perspective.
A wide range, greater than 80 percent of the average daily range, receives the lowest score. When the ORB is already wide, much of the day's move may have already occurred during the opening period, leaving less opportunity for breakout continuation.
Volume is the second factor. Above-average volume during the opening period indicates genuine institutional participation. The indicator compares the current volume to the 20-bar average. Significantly elevated volume adds to the quality score, while below-average volume does not penalize the score but does not help it either.
Day of Week matters more than most traders realize. Statistical studies of market behavior consistently show that Tuesday, Wednesday, and Thursday produce cleaner trending days than Monday or Friday. Monday mornings often see erratic price action as the market digests weekend news and repositions. Friday afternoons often see reduced participation as traders close out positions before the weekend. The quality score reflects these tendencies by adding points for mid-week sessions and subtracting points for Monday mornings and Friday afternoons.
Overnight Activity is relevant primarily for futures traders. If the overnight session produced a significant range, defined as greater than half of the average true range, it suggests that institutions were active during the overnight hours. This often leads to more directional behavior during the regular session.
The quality score is displayed in the dashboard as a letter grade. A-plus indicates excellent conditions across multiple factors. A indicates good conditions. B indicates average conditions. C indicates below-average conditions that warrant caution.
I want to be honest about the limitations of this system. The quality score is a guideline, not a guarantee. A C-rated day can still produce a profitable breakout. An A-plus day can still result in a failed breakout that reverses. The score helps you calibrate your expectations and position sizing, but it does not predict the future.
Confluence Detection
Confluence occurs when multiple significant price levels cluster together within a tight range. When the 15-minute ORB high aligns with the overnight high, or when the ORB low sits right at the session opening price, you have confluence. These zones tend to produce stronger reactions because multiple types of traders are watching the same level.
The indicator automatically detects confluence using a tolerance-based system. By default, the tolerance is set to 0.15 percent of price. This means that if two levels are within 0.15 percent of each other, they are considered confluent.
The levels that are checked for confluence include the Session Opening Price, which is the exact price at 9:30 AM. This level matters because it represents the point where the market transitioned from overnight to regular session trading. Many traders reference the opening print throughout the day.
The Overnight High and Low are also checked. For futures markets, this includes all trading from 6:00 PM the previous evening through 9:29 AM. For stocks, this includes extended hours trading. These levels represent the extremes established before the regular session began.
Finally, the indicator checks whether the ORB levels from different timeframes align with each other. When the 15-minute high matches the 30-minute high, that level gains additional significance.
When confluence is detected, two things happen on the chart. First, the affected ORB line changes color to gold, making it visually obvious that this level has additional significance. Second, the dashboard displays a Confluence row at the bottom, alerting you to the condition.
The Confluence label also appears directly on the chart, positioned within the ORB zone so you can immediately see where the confluence exists.
Smart Label System
A common problem with indicators that display multiple price levels is label overlap. When you have six ORB levels plus auxiliary levels like the session open and overnight high and low, the right side of the chart can become a cluttered mess of overlapping text.
This indicator solves that problem with a smart labeling system that combines matching levels. If the 15-minute low, 30-minute low, and 60-minute low are all at the same price, instead of displaying three separate labels, the indicator displays a single label that reads 15L/30L/60L followed by the price.
The system uses a tolerance of 2 percent of the ORB range to determine whether levels are close enough to combine. This keeps the labels clean while still displaying separate labels when levels are meaningfully different.
The labels are positioned to the right of the current price action, extending beyond the last bar so they remain visible as new bars form. Each label includes the level identifier and the exact price value.
Historical ORB Display
This feature addresses one of the most common limitations of ORB indicators: the inability to see previous sessions when scrolling back through your chart.
With the history feature enabled, the indicator stores ORB data for up to 20 previous sessions. When you scroll back in time, you will see the ORB levels for each historical session, drawn from the session start to the session end.
Historical ORBs are displayed with slightly faded colors, using 50 percent transparency compared to the current session. This creates a clear visual distinction between current and historical levels while still allowing you to analyze past price action relative to those levels.
The history depth is configurable. You can set it anywhere from 1 to 20 days depending on your needs. If you primarily care about the current session and the previous day for context, set it to 1 or 2. If you want to analyze an entire week or more of ORB behavior, increase the setting.
You can also disable the history feature entirely by enabling Current Session Only mode. This returns the indicator to showing only the active session, which some traders prefer for a cleaner chart during live trading.
Breakout Detection and Filters
The indicator marks breakouts with triangle signals. A green triangle below the bar indicates a bullish breakout above the ORB high. A red triangle above the bar indicates a bearish breakout below the ORB low.
However, not every crossing of an ORB level represents a valid breakout worth acting on. The indicator includes several filters to reduce false signals.
The Volume Filter requires that volume on the breakout bar be at least 1.2 times the 20-bar average volume. You can adjust this multiplier in the settings. The logic is straightforward: breakouts on weak volume are more likely to fail. A genuine breakout that is going to follow through should be accompanied by above-average participation.
The Time Filter prevents breakout signals after a specified hour. The default is 2:00 PM Eastern. The rationale is that late-session breakouts often lack follow-through because there is not enough trading time remaining for the move to develop. You can adjust or disable this filter based on your trading style.
The Single Trigger mechanism ensures that each breakout fires exactly once per session. If price crosses above the ORB high, you will see one bullish signal on the bar where the crossing occurred. If price subsequently pulls back and crosses above again, you will not see a second signal. This prevents signal spam and keeps your chart clean.
The indicator also includes Reclaim Detection. If price breaks out and then returns back inside the ORB zone, you will see a warning signal marked with an X. This condition often indicates a failed breakout and potential reversal. It is not a trade signal, but rather information that the breakout you just witnessed may not be valid.
Range Extensions
Once the ORB is established, many traders look for profit targets based on the range itself. The indicator includes extension levels that project multiples of the ORB range above and below the extremes.
By default, two extension levels are shown: 1.0 times the range and 1.5 times the range. If the 15-minute ORB is 50 points, the 1.0 extension above the high would be 50 points above the high, and the 1.5 extension would be 75 points above the high.
These extensions serve as potential profit targets for breakout trades. The 1.0 extension represents a measured move equal to the ORB itself. The 1.5 extension represents a slightly more ambitious target.
You can adjust the extension multipliers in the settings. Some traders prefer 0.5 and 1.0. Others prefer 1.0 and 2.0. The flexibility is there to match your trading approach.
The extension lines are displayed as faint dotted lines so they do not compete visually with the ORB levels themselves. The labels show the multiplier value along with the exact price.
## The Midline
The 50 percent level of the ORB, known as the midline, is displayed as a dashed line within the ORB zone. This level matters because it often acts as short-term support or resistance during consolidation periods within the range.
When price is trading inside the ORB and approaches the midline, you may see a reaction. The midline can also serve as a reference for whether price is showing strength or weakness within the range. If price is spending most of its time above the midline, that suggests a bullish bias even before a breakout occurs. If price is spending most of its time below the midline, that suggests a bearish bias.
The midline can be disabled in the settings if you prefer a cleaner chart.
The Dashboard
The dashboard is positioned in the top right corner of the chart and provides all relevant ORB information at a glance.
The header row displays the indicator name, the current Quality Score grade, the Range Classification, and the Session Status.
The Range Classification shows whether the current 15-minute ORB is Tight, Normal, or Wide compared to the 20-day average. This gives you immediate context about whether the range is unusual in either direction.
The Session Status shows whether the market is currently in session or closed. A green Live indicator means the session is active. A red Closed indicator means the session has ended.
Below the header, each timeframe row displays the following information:
The Timeframe column shows 15m, 30m, or 60m along with a visual indicator of the line style you have selected for that timeframe.
The High column displays the ORB high price for that timeframe.
The Low column displays the ORB low price for that timeframe.
The Range column displays the distance between high and low.
The Status column shows the current state. Before the ORB completes, this shows a countdown of minutes remaining. After completion, it shows whether the price has broken out bullish, broken out bearish, or remains in range.
Below the timeframe rows, the Distance row shows how far the current price is from the nearest ORB level. This helps you gauge whether price is approaching a potential breakout zone.
If confluence is detected, a highlighted row appears at the bottom of the dashboard indicating that significant level alignment exists.
Supported Markets and Sessions
The indicator supports multiple market types with appropriate session times:
US Stocks use a session from 9:30 AM to 4:00 PM Eastern.
US Futures use a session from 9:30 AM to 4:00 PM Eastern, with overnight tracking from 6:00 PM the previous evening.
Forex uses a 24-hour session since the market trades continuously.
Crypto uses a 24-hour session since the market trades continuously.
Custom allows you to define your own session times for markets not covered by the presets.
The timezone is configurable. The default is America/New_York, but you can change it to Chicago, Los Angeles, London, Tokyo, or UTC depending on your location and preference.
Settings Overview
The settings are organized into logical groups:
General settings include the market type, current session only toggle, and history days.
Session settings include custom session times and timezone selection.
ORB Timeframes settings include individual toggles for showing or hiding each timeframe, color selection, line width, and line style. This is where you customize the visual appearance of each ORB level.
Quality Scoring settings include the ATR period and range comparison lookback. These affect how the quality score is calculated.
Confluence Detection settings include the tolerance percentage and toggles for the session open and overnight high and low levels.
Breakout Settings include the volume filter toggle and multiplier, time filter toggle and cutoff hour, and reclaim detection toggle.
Visuals settings include toggles for the fill zone, labels, dashboard, distance display, and midline.
Extensions settings include toggles for showing extensions and the multiplier values for each extension level.
How I Use This Indicator
I will share my personal approach, though you should adapt it to your own style.
First, I wait for the ORB to complete. I do not trade during the first 15 to 30 minutes of the session. The levels are still forming, and the price action during this window is often erratic. I let the dust settle and the range establish itself.
Second, I check the Quality Score. If it is an A or A-plus day with a tight range and good volume, I am more aggressive. If it is a C day with a wide range on a Friday afternoon, I am either sitting on my hands or trading with reduced size.
Third, I look for confluence. If the 15-minute high is sitting right at the overnight high, that level has additional significance. Breakouts through confluence zones tend to be more decisive.
Fourth, I confirm with volume. Even though the indicator filters for volume, I still glance at the volume bars. I want to see that breakout candle have conviction.
Fifth, I manage expectations based on range type. If the ORB is tight, I expect an explosive move and give the trade room to develop. If the ORB is wide, I expect choppier action and tighten my parameters.
Sixth, I use the distance reading. If price is already 50 points beyond the ORB high and the range was only 40 points, I have missed the move. Chasing extended price is not smart trading.
Honest Pros and Cons
What this indicator does well:
It provides clean, accurate ORB levels that do not repaint. This is the foundation, and it is done correctly.
It offers multi-timeframe tracking with clear visual differentiation. You can see all three ORBs at once without confusion.
The quality scoring system helps you avoid low-probability setups. It is not perfect, but it adds valuable context.
The confluence detection highlights significant level alignment automatically. This saves you from manually checking multiple levels.
The smart label system prevents visual clutter. Labels combine when appropriate and remain readable.
The historical ORB display allows you to scroll back and review previous sessions. This is valuable for analysis and pattern recognition.
The customization is extensive. Every visual element can be adjusted to match your preferences.
It works across stocks, futures, forex, and crypto with appropriate session handling.
What this indicator does not do:
It does not give you buy and sell signals with entries and exits. This is a levels and analysis tool, not a trading system.
It does not include backtesting or performance tracking. You need a separate strategy tester for that.
It does not guarantee that breakouts will follow through. The filters help, but failed breakouts still occur.
The quality score is a guideline, not a prediction. Low-quality days can still produce good trades. High-quality days can still produce losing trades.
The confluence detection is proximity-based. It identifies when levels are near each other but does not know if those levels are actually significant to other traders.
Technical limitations to be aware of:
On chart timeframes larger than 15 minutes, the ORB calculation becomes less precise because you have fewer bars in the opening period. This indicator works best on 1 to 15 minute charts.
The overnight high and low tracking works best on futures. Stocks do not have true overnight sessions in the same way.
If your chart does not have volume data, the volume filter will not function properly.
Risk Management
This section is not about the indicator. It is about trading.
No indicator, no matter how well designed, can protect you from poor risk management. Before you trade any ORB breakout, you need to define your risk.
Where is your stop? A common approach is to place the stop on the opposite side of the ORB zone. If you are taking a bullish breakout above the high, your stop goes below the low. This means your risk is the full ORB range plus any slippage.
Is that risk acceptable? If the ORB range is 100 points and you are trading a 50 dollar per point contract, your risk is 5000 dollars plus commissions. Can you afford that loss? If not, either reduce your size or skip the trade.
Where is your target? The extensions provide potential targets, but you need to decide in advance where you will take profits. Hoping for an unlimited run while watching your profits evaporate is not a strategy.
What is your win rate? ORB breakouts do not work every time. Depending on the market and conditions, you might win 50 to 60 percent of the time. That means you will have losing trades. Are you prepared for a string of three or four losers in a row? It will happen.
None of this is specific to this indicator. It applies to all trading. But I include it here because I see too many traders focus on the indicator while ignoring the fundamentals of risk management. The indicator can help you identify setups. It cannot manage your risk for you.
Final Thoughts
I built this indicator for my own trading, then refined it to the point where I felt comfortable sharing it. It is not a holy grail. It will not make you profitable if you do not already have a trading process. What it will do is give you clean, accurate ORB levels with context that most indicators do not provide.
The Opening Range Breakout works because institutions and algorithms reference these same levels. When the first 30 or 60 minutes of trading establishes a range, that becomes a reference point for the rest of the session. This indicator makes those levels visible and adds intelligence around when they are worth paying attention to.
Use it as a tool, not a crutch. Combine it with your own analysis. Manage your risk properly. And please, do not trade with money you cannot afford to lose.
If you have questions or feedback, I am actively maintaining this indicator and will consider feature requests for future updates.
Trade well.
Tags
ORB, Opening Range Breakout, Intraday, Day Trading, Futures, Stocks, Multi-Timeframe, Breakout, Support Resistance, Session, NQ, ES, SPY, QQQ, Opening Range, Institutional Levels
Recommended Timeframes
This indicator works best on 1-minute, 2-minute, 3-minute, 5-minute, 10-minute, and 15-minute charts. It can be used on higher timeframes, but the ORB calculation becomes less precise.
Recommended Markets
US Stock Indices and Futures including ES, NQ, YM, RTY, SPY, QQQ, DIA, IWM. Individual stocks with sufficient liquidity. Forex major pairs. Cryptocurrency with defined trading sessions.
ICT Smart Money Trading Suite PRO [SwissAlgo]ICT SMC Trading Suite Pro
Structure Detection. Imbalance Tracking. Trade Planning. Contextual Alerts.
Why This Integrated System Was Built
The ICT/SMC methodology requires tracking multiple analytical components simultaneously - a process prone to manual errors, time inefficiency, and visual clutter . This indicator consolidates these elements into a single, unified system , providing rules-based validation for experienced ICT traders who may struggle with execution speed, consistency, and manual calculations.
-----------------------------------------------------------------
What This Indicator Does
ICT/SMC methodology involves tracking multiple analytical components simultaneously. This indicator consolidates them into a single system.
Common challenges when applying ICT manually:
1️⃣ Structure Identification
Determining which pivots qualify as external (macro) structure versus internal (micro) structure requires consistent rules. Inconsistent structure identification affects the detection of the relevant trading range for entries , Change of Character (ChoCH) , and Break of Structure (BoS) . Accurate structure identification is paramount ; a faulty reading invalidates the entire ICT thesis for the current swing. While no automated system can replace human judgment, the indicator provides you with a rules-based starting point for structural analysis. The key goal is to help you find and map the relevant structural leg to focus on.
2️⃣ Chart Organization
Drawing Fibonacci retracements, Fair Value Gaps, Order Blocks, and other imbalances manually creates visual complexity that can obscure the analysis. The indicator addresses this by striving to show all imbalances in a consistent, unified, and understandable visual way , using color coding and z-order layering to maintain clarity even when multiple components are active.
3️⃣ Imbalance Tracking
ICT methodology requires monitoring a vast array of institutional footprints : Fair Value Gaps (FVG), Order Blocks (OB), Breaker Blocks (BB), Liquidity Pools (LP), Volume Imbalances, Wick Imbalances, and Kill Zone ranges. Tracking all these simultaneously and manually monitoring their mitigation status is highly time-intensive and prone to oversight . The indicator constantly scans and tracks all key imbalance types for you, automatically updating their status and creating a dynamic, real-time visual heatmap of unmitigated institutional inefficiency.
4️⃣ Trade Calculation
Determining structure-based Stop Loss (SL) placement, calculating multiple Take Profit (TP) levels with accurate position-sizing splits, and computing the final blended Risk-to-Reward (R:R) ratio involves multiple time-sensitive, manual calculations per setup . The indicator automates this entire trade calculation process for you, instantly providing the necessary pricing (entry, SL, TP), sizing, and performance projections, and mitigating the risk of execution error .
5️⃣ Condition Monitoring
ICT setups often require specific technical conditions to align: price reaching discount Fibonacci levels (0.618-0.882 for shorts, 0.118-0.382 for longs), EMA crossovers confirming momentum, or structural shifts (ChoCH/BoS). Identifying these moments requires continuous chart observation across multiple assets and timeframes.
This indicator includes an alert system that monitors these technical conditions and sends notifications when they occur (real-time). The alert system is designed to minimize spam. This allows traders to review potential setups on demand rather than through continuous observation - particularly relevant for those monitoring multiple instruments or trading sessions outside their local timezone.
-----------------------------------------------------------------
Intended Use
This indicator is designed for traders who:
♦ Apply ICT/SMC methodology - Familiarity with concepts such as Fair Value Gaps, Order Blocks, Liquidity Pools, market structure, and discount/premium zones is assumed. The indicator does not teach these concepts but provides tools to apply them.
♦ Trade on intraday to swing timeframes - The structure detection and Fibonacci zone mapping work across multiple timeframes. Recommended primary timeframe: 1H (adjustable based on trading approach).
♦ Prefer systematic entry planning - The trade calculation feature computes stop loss, take profit levels, and risk-to-reward ratios based on structure and Fibonacci positioning. Suitable for traders who use defined entry criteria.
♦ Monitor multiple instruments or sessions - The alert functionality notifies when specific technical conditions occur (discount zone entries, EMA crossovers, structure changes), reducing the need for continuous manual monitoring.
♦ Use trade execution platforms - The trade summary table displays pre-formatted values (entry, SL, TP levels with quantity splits) that can be manually input into trading platforms or bot services like 3Commas.
-----------------------------------------------------------------
How To Use
Step 1: Structure Analysis
The indicator automatically detects external and internal market structure using pivot analysis. Structure lines are color-coded: red for bearish structure, green for bullish. External pivots are marked with larger triangles, internal pivots with smaller markers. The pivot length parameters (default: 20/20) can be adjusted in settings to align with your structural analysis approach and the asset you are analyzing.
Step 2: Define Your Trading Zone
Use the "Start Swing" and "End Swing" date inputs to mark the beginning and end of the (external) structural leg you wish to analyze. The indicator calculates Fibonacci retracement levels based on these points and color-codes the zones:
* Green zones: Discount area (0.618-0.882 for bearish / 0.118-0.382 for bullish)
* Yellow zones: Premium area (0.786-1.0 for bearish / 0.0-0.214 for bullish)
* Red zones: Extension area beyond structure (potential fake-out zones)
Step 3: Review Imbalances
The indicator identifies and displays multiple imbalance types:
🔥 Volume imbalances (from displacement candles based on PVSRA methodology)
🔥 Fair Value Gaps (FVG)
🔥 Order Blocks (OB) and Breaker Blocks (BB)
🔥 Liquidity Pools (LP) at equal highs/lows
🔥 Wick imbalances (exceptional wick formations)
🔥 Kill Zone liquidity from specific trading sessions (Asian, London, NY AM)
Volume Imbalances
Fair Value Gaps
Order Blocks
Liquidity Pools
Wick Imbalances
Kill Zone Imbalances
According to ICT methodology, imbalances act as price magnets - areas where price tends to return for mitigation. When multiple imbalances overlap at the same price level, this creates a confluence zone with a higher probability of price reaction .
Imbalances are displayed as gray boxes , creating a visual heatmap of institutional inefficiencies. When imbalances overlap, the zones appear darker due to layering, and labels combine to show confluence (e.g., "FVG + OB" or "Vol + LP").
Heatmap of Imbalances
User can view each type alone, or all together (heatmap)
Each imbalance type is tracked until mitigated by price according to ICT principles and can be toggled on/off independently in settings.
Step 4: Reference Levels & Sessions
The indicator displays additional reference data:
🔥 Daily Pivot Points (PP, R1-R3, S1-S3) calculated from previous day
🔥Average Daily Range (ADR) projected from the current day's extremes
🔥 Daily OHLC levels: Today's Open (DO), Previous Day High (PDH), Previous Day Low (PDL)
🔥Session backgrounds (optional): Color-coded boxes for Asian, London, NY AM, and NY PM sessions
Sessions
While these are not ICT-specific imbalances, they represent widely-watched price levels that often attract institutional activity and can act as additional reference points for support, resistance, and liquidity targeting.
All reference levels can be toggled independently in settings.
Step 5: Momentum Reference
EMA 14 and EMA 21 lines are displayed for momentum analysis. When EMA 14 enters discount zones and crosses EMA 21, a triangle marker appears on the chart. This indicates a potential alignment of structure and momentum conditions.
Step 6: Trade Planning
Input your intended entry price in the "Entry Price" field along with your margin and leverage parameters. The indicator automatically calculates all trade parameters:
* Stop loss level (based on Fibonacci structure - typically at 1.118 extension)
* Three take profit levels (TP1, TP2, TP3) with position quantity splits
* Risk-to-reward ratio (blended across all three targets)
* Projected profit/loss values in both dollars and percentage
All calculated values are displayed both visually on the chart (as horizontal lines with labels) and in a formatted Trade Summary table. The table organizes the information for quick reference: entry details, take profit levels with quantities, stop loss parameters, and performance projections.
This pre-calculated data can be manually copied into trading platforms or bot services (such as 3Commas Smart Trades) without requiring additional calculations.
Step 7: Alert Configuration
Create alerts using TradingView's alert system (select "Any alert() function call"). The indicator sends notifications when:
* Price reaches specific discount Fibonacci levels (0.618, 0.786, 0.882 for shorts / 0.382, 0.214, 0.118 for longs)
* EMA 14/21 crossovers occur within discount zones
* Change of Character (ChoCH) is detected
* Break of Structure (BoS) is detected
Note: Alerts require active TradingView alert functionality. Update alerts when changing your trading zone parameters.
-----------------------------------------------------------------
Key Features
Structure & Zone Analysis
* Automated structure detection with external/internal pivots and zig-zag visualization
* Fibonacci retracement mapping with color-coded discount/premium zones
* Visual zone classification: Green (optimal discount), Yellow (premium), Red (fake-out risk)
ICT Imbalances Heatmap
* Volume imbalances (PVSRA displacement candles)
* Fair Value Gaps (FVG)
* Order Blocks (OB) and Breaker Blocks (BB)
* Liquidity Pools (LP) at equal highs/lows
* Wick imbalances (exceptional wick formations)
* Kill Zone liquidity (Asian, London, NY AM sessions)
* Confluence detection with combined labels and visual layering
Reference Levels
* Daily Pivot Points (PP, R1-R3, S1-S3)
* Average Daily Range (ADR) projections
* Daily OHLC levels (DO, PDH, PDL)
* Session backgrounds for kill zones
Trade Planning Tools
* Automated stop loss calculation based on Fibonacci structure
* Three-tier take profit system with position quantity splits
* Risk-to-reward ratio calculation (blended across all targets)
* P&L projections in dollars and percentages
* Trade Summary table formatted for manual platform entry
Momentum & Signals
* EMA 14/21 overlay for momentum analysis
* Visual crossover markers (triangles) in discount zones
* Change of Character (ChoCH) detection and labels
* Break of Structure (BoS) detection and labels
Chart Enhancements
* Higher timeframe candle overlay (5m to Monthly)
* PVSRA candle coloring (volume-based)
* Symbol legend for quick reference
* Customizable visual elements (toggle all components independently)
Alert System
* Discount zone entry notifications (Fibonacci level monitoring)
* EMA crossover signals within discount zones
* Structure change alerts (ChoCH and BoS)
* Configurable via TradingView alert functionality
Alert Functionality
The indicator includes an alert system that monitors technical conditions continuously.
When configured, alerts notify users when specific events occur:
❗ Discount Zone Monitoring
When EMA 14 crosses into key Fibonacci levels (0.618, 0.786, 0.882 for bearish structure / 0.382, 0.214, 0.118 for bullish structure), an alert is triggered. Example: Trading BTC and ETH simultaneously - instead of monitoring both charts for zone entries, alerts notify when either asset reaches the specified level.
❗ Momentum Alignment
When EMA 14 crosses EMA 21 within discount zones, an alert is sent. Example: Monitoring setups across multiple timeframes (1H, 4H, Daily) - alerts indicate when momentum conditions align on any timeframe being tracked.
❗ Structure Changes
Change of Character (ChoCH) and Break of Structure (BoS) events trigger alerts. Example: Trading during the Asian session while located in a different timezone - alerts notify of structure changes occurring outside active monitoring hours.
Configuration
Alerts are set up through TradingView's native alert system. Select "Any alert() function call" when creating the alert.
⚠️ Note: Alert parameters are captured at creation time, so alerts must be updated when changing trading zone settings (Start/End Swing dates) or any other parameter.
How to Create Alerts
Step 1: Open Alert Creation
Click the "Alert" button (clock icon) in the top toolbar of TradingView, or right-click on the chart and select "Add Alert."
Step 2: Configure Alert Condition
* In the alert dialog, set the Condition dropdown to select this indicator
* Set the alert type to ⚠️ " Any alert() function call "
* This configuration allows the indicator to trigger alerts based on its internal logic
Step 3: Set Alert Timing
* Timeframe: Same as chart
* Expiration: Choose "Open-ended (when triggered)" to keep the alert active until conditions occur
* Message tab: choose a name for the alert
Step 4: Notification Settings
Configure how you want to receive notifications:
* Popup within TradingView
* Email notification
* Mobile app push notification (requires TradingView mobile app)
Step 5: Create
Important Notes:
* Alert parameters are captured at creation time . If you change your trading zone (Start/End Swing dates) or entry price, delete the old alert and create a new one .
* One alert per chart: Create separate alerts for each instrument and timeframe you're monitoring.
* TradingView alert limits apply based on your TradingView subscription tier.
What Triggers Alerts: This indicator sends alerts for four key event types:
1. Discount Zone Entry - EMA 14 crossing key Fibonacci levels
2. Momentum Crossover - EMA 14/21 crossovers within discount zones
3. Change of Character (ChoCH) - Structure reversal detected
4. Break of Structure (BoS) - Trend continuation confirmed
All four conditions are monitored by a single alert configuration .
-----------------------------------------------------------------
Recommended Settings
* Timeframe : 1H works well for most assets
* Theme : Dark mode recommended
* Structural Pivots : Default 20/20 captures reasonable structure; adjust to match your analysis
-----------------------------------------------------------------
Chart Elements Guide
♦ Structure Visualization
Zig-zag lines
Automated structure detection - green lines indicate bullish structure, red lines indicate bearish structure. Thick lines represent external structure , thin faded lines show internal structure .
Triangle markers
Large triangles mark external pivots (swing highs/lows), small triangles mark internal pivots.
Fibonacci Zones
* Green zones: Discount area - potential entry zones (0.618-0.882 for shorts / 0.118-0.382 for longs)
* Yellow zones: Premium area - higher extension zones (0.786-1.0 for shorts / 0.0-0.214 for longs)
* Red zones: Fake-out risk area - price beyond structural extremes (above 1.0 for shorts / below 0.0 for longs)
* White dashed lines: Individual Fibonacci levels (1.0, 0.882, 0.786, 0.618, 0.5, 0.382, 0.214, 0.118, 0.0)
♦ Imbalance Heatmap
Gray boxes with dotted midlines
Unmitigated imbalances create a visual heatmap. Overlapping imbalances appear darker due to layering.
Combined labels
When multiple imbalances overlap, labels show confluence (e.g., "FVG + OB", "Vol + LP + Wick")
Types displayed : Vol (Volume), FVG (Fair Value Gap), OB (Order Block), BB (Breaker Block), LP (Liquidity Pool), Wick, KZ (Kill Zone)
♦ Momentum Indicators
* Red line: EMA 14
* Yellow line: EMA 21
* Small triangles on price: Crossover signals - red triangle (bearish crossover), green triangle (bullish crossover) when occurring within discount zones
♦ Structure Change Markers
* Labels with checkmarks/crosses: ChoCH (Change of Character) and BoS (Break of Structure) events (Green label with ✓: Bullish ChoCH or BoS, Red label with ✗: Bearish ChoCH or BoS)
♦ Trade Planning Lines (when entry price is set)
* Blue horizontal line: Entry price
* Green dashed lines: TP1 and TP2
* Green solid line: TP3 (final target)
* Red horizontal line: Stop Loss level
TP levels and SL are calculated based on the structure range, entry price, and mapped trading zone, and aim to achieve a minimum risk: reward ratio of 1:1.5 (R:R)
♦ Colored background zones:
Green shading between entry and TP3 (profit zone), red shading between entry and SL (loss zone)
♦ Reference Levels
* Orange dotted lines with labels: Daily Pivot Points (PP, R1-R3, S1-S3)
* Purple dotted lines with labels: ADR High and ADR Low projections
* Cyan dotted lines with labels: DO (Daily Open), PDH (Previous Day High), PDL (Previous Day Low)
♦ Session Backgrounds (optional)
* Yellow shaded box: Asian session (19:00-00:00 NY time)
* Blue shaded box: London session (02:00-05:00 NY time)
* Green shaded box: NY AM session (09:30-11:00 NY time)
* Orange shaded box: NY PM session (13:30-16:00 NY time)
♦ Trade Summary Table (top-right corner)
Displays a complete trade plan with sections:
* Sanity Check: Plan validation status
* Setup: Trade type, leverage, entry price, position size
* Take Profit: TP1, TP2, TP3 with prices, percentages, and quantity splits
* Stop Loss: SL price and type
* Performance: Potential profit/loss, ROI, and risk-to-reward ratio
♦ HTF Candle Overlay (optional, displayed to the right of the current price)
* Larger candlesticks representing higher timeframe price action
* Green bodies: Bullish HTF candles
* Red bodies: Bearish HTF candles
* Label shows selected timeframe (e.g., "HTF→ D" for daily)
♦ Legend Table (bottom-right corner)
Quick reference guide explaining all symbol abbreviations and color codes used on the chart.
-----------------------------------------------------------------
Methodology & Calculation Details
This indicator consolidates multiple ICT/SMC analytical components into a single integrated system. While individual elements could be created separately, this integration provides automated coordination between components , consistency, and reduces chart complexity.
Structure Detection External and internal pivots
Are identified using fractal pivot analysis with configurable lookback periods (default: 20 bars for both). A pivot high is confirmed when the high at the pivot bar exceeds all highs within the lookback range on both sides. Pivot lows use inverse logic. Structure lines connect validated pivots, with color coding based on price direction (higher highs/higher lows = bullish, lower highs/lower lows = bearish).
Fibonacci Retracement Calculation
Users define two swing points via date/time inputs. The indicator calculates the price range between these points and applies standard Fibonacci ratios (0.0, 0.118, 0.214, 0.382, 0.5, 0.618, 0.786, 0.882, 1.0, plus extensions at 1.118, 1.272, -0.118, -0.272). Zone classification is based on ICT discount/premium principles: 0.618-1.0 range for bearish setups, 0.0-0.382 for bullish setups.
Imbalance Identification
Volume Imbalances : Detected using PVSRA (Price, Volume, Support, Resistance Analysis) methodology. Candles are classified based on the percentile ranking of volume and price range over a 1344-bar lookback period. Type 1 imbalances require ≥95th percentile in both volume and range; Type 2 requires ≥85th percentile. Additional filters include body-to-range ratio (≥50% for Type 1, ≥30% for Type 2) and ATR validation.
Fair Value Gaps (FVG) : Identified when a three-candle sequence shows a price gap: low > high for bullish FVG, high < low for bearish FVG. The middle candle must close beyond the gap edge. Mitigation occurs when the price retraces into the gap.
Order Blocks (OB) : Detected by identifying the last opposing candle before a significant price move. When price breaks a swing high/low, the algorithm scans backwards to find the candle with the highest high (bearish OB) or lowest low (bullish OB) before the breakout. When an OB is breached, it converts to a Breaker Block (BB).
Liquidity Pools (LP) : Identified by detecting equal highs or equal lows using a tolerance threshold based on ATR. Pivot highs/lows within this tolerance range are grouped. Equal highs create Buy-Side Liquidity (BSL) zones above the level; equal lows create Sell-Side Liquidity (SSL) zones below the level.
Wick Imbalances: Flagged when a candle's wick exceeds 1.0x ATR and comprises >50% of the total candle range. These represent rapid rejections or absorption events.
Kill Zone Liquidity: Tracks the high/low range during specific ICT-defined sessions (Asian: 19:00-00:00 NY, London: 02:00-05:00 NY, NY AM: 09:30-11:00 NY). At session close, BSL and SSL zones are created above/below the session range.
Change of Character (ChoCH) & Break of Structure (BoS)
ChoCH is detected when price breaks counter to the established structure (bearish structure broken upward = bullish ChoCH; bullish structure broken downward = bearish ChoCH). BoS occurs when price breaks in the direction of the established trend (bearish structure breaking lower = bearish BoS; bullish structure breaking higher = bullish BoS).
Trade Calculations
Stop Loss and Take Profit levels are calculated based on the entry position within the Fibonacci zone structure:
* Premium entries (0.786-1.0 for shorts / 0.0-0.214 for longs): SL at 1.118/-0.118 extension, TP structure weighted toward zone extremes
* Golden entries (0.618-0.786 for shorts / 0.214-0.382 for longs): SL at 1.0/0.0 boundary, TP structure balanced across range
Risk-to-reward ratios are calculated as blended values across all three take profit levels, weighted by position quantity splits.
Reference Level Calculations
* Pivot Points: Standard formula using previous day's high, low, and close: PP = (H + L + C) / 3
* Support/Resistance: R1 = 2×PP - L, S1 = 2×PP - H, with R2/S2 and R3/S3 calculated using range extensions
* ADR: 14-period simple moving average of daily high-low range, projected from current day's extremes
Momentum Analysis
EMA 14 and EMA 21 use standard exponential moving average calculations. Crossovers are detected when EMA 14 crosses EMA 21 within user-defined discount zones, with directional confirmation (cross under in bearish discount = short signal; cross over in bullish discount = long signal).
Why This Integration Matters
While components like EMA crossovers, pivot detection, or Fibonacci retracements exist as separate indicators, this system provides:
1. Coordinated Analysis : All components reference the same structural framework (user-defined trading zone)
2. Automated Mitigation Tracking : Imbalances are monitored continuously and removed when mitigated according to ICT principles
3. Contextual Alerts : Notifications are triggered only when conditions align within the defined structural context
4. Trade Parameter Automation : Stop loss and take profit calculations adjust dynamically based on entry positioning within the structure
5. Consistent Visual Display : All elements use a unified color scheme, labeling system, and z-order layering. This eliminates visual conflicts that occur when stacking multiple independent indicators (overlapping lines, label collisions, inconsistent transparency levels, conflicting color schemes).
This consolidation reduces the need to manually coordinate 8-10 separate indicators, eliminates redundant calculations across disconnected tools, and maintains visual clarity even when all components are displayed simultaneously.
-----------------------------------------------------------------
Disclaimer
1. Indicator Functionality and Purpose
This indicator is solely a technical analysis tool built upon established methodologies (Smart Money Concepts/ICT) and statistical calculations (Pivots, Fibonacci, EMAs). It is designed to assist experienced traders in visualizing complex data, streamlining the analytical workflow, and automating conditional alerting.
The indicator is NOT:
♦ Financial Advice: It does not provide personalized investment recommendations, solicited advice, or instruction on buying, selling, or holding any financial instrument.
♦ A Guarantee of Profit: The presence of a signal, alert, or trade plan output by this tool does not guarantee that any trade will be profitable.
♦ A Predictor of Future Prices: The tool calculates probabilities and potential scenarios based on historical data and current structure; it does not predict future market movements.
2. General Trading Risks and Capital Loss
♦ All trading involves substantial risk of loss. You may lose some or all of your initial capital. Leveraged products, such as futures, CFDs, and margin trading, carry a high degree of risk and are not suitable for all investors.
♦ Risk Acknowledgment: By using this indicator, you acknowledge and accept that you are solely responsible for all trading decisions, and you bear the full risk of any resulting profit or loss.
♦ Risk Management is Crucial: This indicator is an analytical tool only. You must employ independent risk management techniques (position sizing, stop-loss orders) tailored to your personal financial situation and risk tolerance.
3. Calculation Limitations and Non-Real-Time Data
The calculations performed by this indicator are based on the data provided by your charting platform (e.g., TradingView).
♦ Data Accuracy: The accuracy of the outputs (e.g., Price Delivery Arrays, Pivots, P&L projections) is dependent on the accuracy and real-time nature of the underlying market data feed.
♦ Latencies: Trade alerts and signals may be subject to minor delays due to server processing, internet connectivity, or charting platform performance. Do not rely solely on alerts for execution.
♦ Backtesting and Performance: Any depiction of past performance, including data visible on the chart, is not indicative of future results. Trading results will vary based on market conditions, liquidity, and execution speed.
4. Software and Platform Disclaimer
"As Is" Basis: The indicator is provided on an "as is" basis without warranties of any kind, whether express or implied. The author does not guarantee the script will be error-free or operate without interruption.
Third-Party Integration: This indicator is not affiliated with, endorsed by, or connected to TradingView, 3Commas, or any other broker or execution platform. All third-party names are trademarks of their respective owners. The formatting of the Trade Summary Table for 3Commas is for user convenience only.
5. Required Competency (User Responsibility)
This indicator is built on the assumption that the user is an experienced trader with a working understanding of the complex concepts being visualized (ICT/SMC, FVG, Order Blocks, Liquidity, etc.). The indicator does not teach these concepts.
You Must Always Do Your Own Research (DYOR) before making any trading decision based on signals or visualization provided by this tool.
By installing and using this indicator, you explicitly agree to these terms and assume full responsibility for all trading activity.
NULL_SmartTrend_v3.5t.me
@null_company
@Alexa_Na1405 - X
It works well on 4H and 1D
Testing:
Initial capital: 10,000 US dollars (in US dollars).
Strategy: Only for long/only for short positions, but with switching (buying on long terms, selling on short terms, closing the previous position).
Fees: 0.1% on entry/exit (realistic for futures/crypts).
Risk: Full position (100% equity on each signal), non-stop (as in the basic version 3.3).
Data: OHLCV from Yahoo Finance (checked for compliance with TradingView).
Signals: Do not change when the bar is closed.
Indicators: Total return, number of trades, winning ratio (profitable trades), Sharpe ratio (risk to return ratio).Key points:
Daily (1 day): Signals are received rarely (1-2 per month), but they are very accurate — they capture the main trends (growth in 2021 to 69 thousand dollars, correction in 2022, jump in 2024-2025). The win rate is high because it ignores noise. The yield is more than 12 times higher than when buying and holding BTC (+1150% over the period).
4H: There are more signals (1-2 per week), but more false ones in the sideways trend (summer 2023). Still profitable, but with a large drawdown — suitable for active trading. The Sharpe ratio is lower because of the frequency.
General information: The indicator is strong in trends (the ADX filter works), but in a sideways trend (ADX<25) it gives out ~20% false signals. There is no redrawing, the closing signals are safe for live.
Examples of key signals (daily, BTC):
Purchase 2020-12-15: After correction, entry in the amount of ~20 thousand dollars → exit for sale 2021-04 → profit +220%.
Sell 2022-01-10: Before the collapse → profit +45% on a short position.
Buy 2023-01-20: Bearish bottom ~16 thousand dollars → +500% by 2025.
Sale 2024-07-05: Before correction from $70 thousand. → +15%.The result for BTC 1D in 5 years (approximately):
Without filter: ~53 signals, the winning bet is 68%
With filter: ~38 signals, 79% win rate, higher profit
RED-E Market Structure (Pro V2)RED-E Market Structure - Comprehensive Technical Analysis System
⚠️ EDUCATIONAL TOOL - NO GUARANTEES
This indicator is designed for educational purposes to help traders learn technical analysis concepts. It does not predict future price movements or guarantee profitable trades. Trading involves substantial risk of loss.
═══════════════════════════════════════════════════════════════
📊 WHAT THIS INDICATOR DOES
This indicator combines multiple standard technical analysis methods into a unified system for analyzing market structure, momentum, volume dynamics, and key price levels. Rather than adding 10 separate indicators to your chart, this consolidates related information into one cohesive interface where each component informs the others.
═══════════════════════════════════════════════════════════════
🔧 TECHNICAL METHODOLOGY - HOW IT WORKS
1️⃣ MOMENTUM CANDLE COLORING (6 Levels)
Calculation Method:
- Compares close vs EMA(9) and EMA(21)
- Applies RSI(14) thresholds for strength
- Color codes: Royal Blue (strongest bull) → Cyan → Green → Yellow → Orange → Red (strongest bear) → White (neutral)
Formula Logic:
IF close > EMA(9) AND close > EMA(21) AND close > open:
RSI > 70 = Level 3 Bull (Royal Blue)
RSI 60-70 = Level 2 Bull (Cyan)
RSI < 60 = Level 1 Bull (Green)
Purpose: Visualizes momentum strength by combining trend (EMAs), candle direction, and overbought/oversold conditions (RSI).
2️⃣ ENTRY SIGNAL LABELS
Calculation Method:
- Uses EMA alignment: EMA(9) > EMA(21) > EMA(50) for bullish
- Filters RSI to avoid extremes
- Requires confirming candle
BUY Signal Logic:
IF close > EMA(9) AND RSI between 40-70 AND EMA(9) > EMA(21) > EMA(50) AND close > open
THEN: Display "BUY" label
Purpose: Identifies potential entries when multiple trend and momentum conditions align. This is standard multi-confirmation technical analysis.
3️⃣ VOLUME DELTA PERCENTAGE
Calculation Method:
FOR each bar in lookback period (default 20):
IF close > open: add volume to bullish_volume
IF close < open: add volume to bearish_volume
bullish_percent = (bullish_volume / total_volume) × 100
Purpose: Quantifies buying vs selling pressure as percentages. Shows if volume supports the current trend.
Display: "🟢65.3% | 🔴34.7%" in dashboard
4️⃣ PRE-MARKET HIGH/LOW TRACKING
Calculation Method:
1. Detect pre-market session (4:00-9:30 AM ET)
2. Track highest high during pre-market
3. Track lowest low during pre-market
4. Draw horizontal lines when market opens
Purpose: Pre-market levels often act as support/resistance during regular hours. This automates their tracking and visualization.
5️⃣ OPENING RANGE BREAKOUT (ORB)
Calculation Method:
1. User sets start time (default 9:30 AM) and duration (default 15 min)
2. Track highest high and lowest low during this period
3. Draw box and extend lines
Purpose: The opening range breakout is a well-documented day trading strategy. First X minutes establish a range, and breakouts often signal directional moves.
6️⃣ SUPPORT/RESISTANCE TRENDLINES
Calculation Method:
1. Identify pivot highs: ta.pivothigh(high, 5, 5)
2. Identify pivot lows: ta.pivotlow(low, 5, 5)
3. Connect last two pivot highs = Resistance (red)
4. Connect last two pivot lows = Support (blue)
Purpose: Automatically connects significant pivot points. Based on standard pivot analysis where price respects these levels.
7️⃣ GAMMA ZONE DETECTION
Calculation Method:
1. Calculate 30-min range: (high - low)
2. Calculate 10-period SMA of range
3. Calculate ratio: current_range / average_range
IF ratio < (1.0 / sensitivity): HIGH GAMMA = Low volatility
IF ratio > (1.0 × sensitivity): LOW GAMMA = High volatility
Purpose: Approximates options gamma effects. High gamma = dealers hedge more = suppressed volatility. Low gamma = less hedging = potential explosive moves.
8️⃣ TAKE PROFIT LEVELS (5 Levels + ATR Stop Loss)
Calculation Method:
LONG: TP = entry_price × (1 + percentage/100)
SHORT: TP = entry_price × (1 - percentage/100)
Stop Loss (ATR): entry ± (ATR(14) × multiplier)
Purpose: Automatically calculates percentage-based targets and volatility-adjusted stops. ATR adapts stop to current market conditions.
9️⃣ THE STRAT PATTERN RECOGNITION
Calculation Method:
Compare current bar to previous:
- Strat 3 (outside bar): high > high AND low < low
- Strat 1 (inside bar): high ≤ high AND low ≥ low
- Strat 2 (directional): All others
Purpose: The Strat is a price action system categorizing bars by relationship to previous bars. This automates classification.
🔟 FIBONACCI RETRACEMENTS
Calculation Method:
1. Find highest high in lookback (default 30 bars)
2. Find lowest low in lookback
3. Calculate: 0.0, 0.382, 0.5, 0.618, 1.0 levels
Purpose: Standard Fibonacci tool. These ratios are commonly used support/resistance in technical analysis.
1️⃣1️⃣ MULTI-TIMEFRAME ANALYSIS
Calculation Method:
FOR each timeframe (default 15m, 1H, 4H):
Check if close > EMA(9) on that timeframe
IF true: "BULLISH", else: "BEARISH"
Purpose: Shows trend alignment across timeframes using Pine's request.security(). Common confirmation technique.
═══════════════════════════════════════════════════════════════
💡 WHY THESE COMPONENTS WORK TOGETHER
This indicator's originality lies in its unified system approach:
1. TREND IDENTIFICATION (EMAs, MTF) - Shows direction
2. MOMENTUM MEASUREMENT (RSI, candles) - Shows strength
3. VOLUME CONFIRMATION (Volume Delta) - Shows conviction
4. KEY LEVELS (PM, ORB, Fib, S/R) - Shows decision points
5. RISK MANAGEMENT (TP levels, ATR stops) - Shows exits
VALUE OF INTEGRATION:
Rather than 10 separate indicators creating chart clutter, this consolidates related concepts where each component provides different information that, when viewed together, gives a more complete market picture.
Example Integration:
- Entry signal appears (EMA + RSI aligned)
- Volume Delta confirms (more buying than selling)
- MTF shows higher timeframes agree
- TP levels auto-calculate with good risk:reward
- Support trendline nearby provides stop reference
═══════════════════════════════════════════════════════════════
⚙️ CUSTOMIZATION OPTIONS
All features independently toggleable:
- EMAs: Adjust lengths (9, 21, 50, 200), colors, widths
- RSI: Change overbought/oversold levels (70/30)
- Volume Delta: Adjust lookback period (20)
- ORB: Set custom start time, duration, timezone
- Gamma: Adjust sensitivity (1-10)
- TP Levels: Customize all 5 percentages
- Dashboard: Reposition, resize, recolor
═══════════════════════════════════════════════════════════════
📖 HOW TO USE
Step 1 - Assess Context:
- Check MTF Dashboard for alignment
- Check EMA indicator for trend
- Check Gamma Zone for volatility expectation
Step 2 - Identify Setups:
- Wait for BUY/SELL signal
- Check Volume Delta matches direction
- Verify RSI not extreme (30-70)
- Look for support/resistance confluence
Step 3 - Evaluate Risk:Reward:
- Review TP3 R:R ratio (target 2:1+)
- Check stop loss placement
- Ensure risk acceptable
Step 4 - Monitor:
- Track P&L % in real-time
- Use TP levels as potential exits
- Adjust stops based on S/R
═══════════════════════════════════════════════════════════════
⚠️ LIMITATIONS & REALISTIC EXPECTATIONS
This indicator does NOT:
- Predict future price movements
- Guarantee profitable trades
- Work in all market conditions
- Replace proper education and practice
This indicator CAN:
- Display standard technical indicators in organized way
- Automate common calculations
- Visualize multiple analysis methods simultaneously
- Help learn how different indicators relate
Key Understanding:
All technical indicators use historical data. They help identify patterns and conditions but cannot predict the future. Successful trading requires risk management, psychology, and experience—not just indicators.
═══════════════════════════════════════════════════════════════
📚 EDUCATIONAL CONCEPTS TAUGHT
- How EMAs show trend direction and alignment
- How RSI identifies momentum extremes
- How volume confirms or diverges from price
- How support/resistance levels form
- How multiple timeframes provide context
- How ATR adapts stops to volatility
- How risk:reward ratios work
═══════════════════════════════════════════════════════════════
📊 BEST SUITED FOR
- Scalping: 1m-5m charts with quick entries/exits
- Day Trading: 15m-1H focusing on ORB and PM levels
- Swing Trading: 4H-D following major trends
═══════════════════════════════════════════════════════════════
⚠️ RISK DISCLAIMER
Trading involves substantial risk of loss. This educational tool:
- Does NOT guarantee profits
- Cannot predict future performance
- Requires proper risk management
- Should be practiced on demo accounts first
Always use stop losses, risk only 1-2% per trade, and consult licensed financial professionals before trading with real capital.
═══════════════════════════════════════════════════════════════
Educational tool for learning technical analysis. Not financial advice. Past results do not indicate future performance.
Bifurcation Point Adaptive (Auto Oscillator ML)Bifurcation Point Adaptive - Auto Oscillator ML
Overview
Bifurcation Point Adaptive (🧬 BPA-ML) represents a paradigm shift in divergence-based trading systems. Rather than relying on static oscillator settings that quickly become obsolete as market dynamics shift, BPA-ML employs multi-armed bandit machine learning algorithms to continuously discover and adapt to the optimal oscillator configuration for your specific instrument and timeframe. This self-learning core is enhanced by a Cognitive Analytical Engine (CAE) that provides market-state intelligence, filtering out low-probability setups before they reach your chart.
The result is a system that doesn't just detect divergences - it understands context, learns from outcomes, and evolves with the market.
What Sets This Apart: Technical Comparison
The TradingView community has many excellent divergence indicators and several claiming "machine learning" capabilities. However, a detailed technical analysis reveals that BPA-ML operates at a fundamentally different level of sophistication.
Machine Learning: Real vs Marketing
Most indicators labeled "ML" or "AI" on TradingView use one of three approaches:
K-Nearest Neighbors (KNN): These indicators find similar historical patterns and assume current price will behave similarly. This is pattern matching, not learning. The system doesn't improve over time or adapt based on outcomes - it simply searches historical data for matches.
Clustering (K-Means): These indicators group volatility or market states into categories (high/medium/low). This is statistical classification, not machine learning. The clusters are recalculated but don't learn which classifications produce better results.
Gaussian Process Regression (GPR): These indicators use kernel weighting to create responsive moving averages. This is advanced curve fitting, not learning. The system doesn't evaluate outcomes or adjust strategy.
BPA-ML's Approach: True Reinforcement Learning
BPA-ML implements multi-armed bandit algorithms - a proven reinforcement learning technique used in clinical trials, A/B testing, and recommendation systems. This is fundamentally different:
Exploration vs Exploitation: The system actively balances trying new configurations (exploration) against using proven winners (exploitation). KNN and clustering don't do this - they simply process current data against historical patterns.
Reward-Based Learning: Every configuration is scored based on actual forward returns, normalized by volatility and clipped to prevent outlier dominance. The system receives a bonus when signals prove profitable. This creates a feedback loop where the indicator literally learns what works for your specific instrument and timeframe.
Four Proven Algorithms: UCB1 (Upper Confidence Bound), Thompson Sampling (Bayesian), Epsilon-Greedy, and Gradient-based learning. Each has different exploration characteristics backed by peer-reviewed research. You're not getting marketing buzzwords - you're getting battle-tested algorithms from academic computer science.
Continuous Adaptation: The learning never stops. As market microstructure evolves, the bandit discovers new optimal configurations. Other "adaptive" indicators recalculate but don't improve - they use the same logic on new data. BPA-ML fundamentally changes which logic it uses based on what's working.
The Configuration Grid: 40 Arms vs Fixed Settings
Traditional divergence indicators use a single oscillator with fixed parameters - typically RSI with length 14. More advanced systems might let you choose between RSI, Stochastic, or CCI, but you're still picking one manually.
BPA-ML maintains a grid of 40 candidate configurations:
- 5 oscillator families (RSI, Stochastic, CCI, MFI, Williams %R)
- 4 length parameters (short, medium, medium-long, long)
- 2 smoothing settings (fast, slow)
The bandit evaluates all 40 continuously and automatically selects the optimal one. When market microstructure changes - say, from trending crypto to ranging forex - the system discovers this and switches configurations without your intervention.
Why This Matters: Markets exhibit different characteristics. Bitcoin on 5-minute charts might favor fast Stochastic (high sensitivity to quick moves), while EUR/USD on 4-hour charts might favor smoothed RSI (filtering noise in steady trends). Manual optimization is guesswork. The bandit discovers these nuances mathematically.
Cognitive Analytical Engine: Beyond Simple Filters
Many divergence indicators include basic filters - perhaps checking if RSI is overbought/oversold or if volume increased. These are single-metric gates that treat all market states the same.
BPA-ML's CAE synthesizes five intelligence layers into a comprehensive market-state assessment:
Trend Conviction Score (TCS): Combines ADX normalization, multi-timeframe EMA alignment, and structural persistence. This isn't just "is ADX above 25?" - it's a weighted composite that captures trending vs ranging regimes with nuance. The threshold itself is adaptive via mini-bandit if enabled.
Directional Momentum Alignment (DMA): ATR-normalized EMA spread creates a regime-aware momentum indicator. The same price move reads differently in high vs low volatility environments. Most indicators ignore this context.
Exhaustion Modeling: Aggregates volume spikes, pin bar formations, extended runs without pullback, and extreme oscillator readings into a unified probability of climax. This multi-factor approach catches exhaustion signals that single metrics miss. High exhaustion can override trend filters - allowing reversal trades at genuine turning points that basic filters would block.
Adversarial Validation: Before approving a bullish signal, the engine quantifies both the bull case AND the bear case. If the opposing case dominates by a threshold, the signal is blocked. This is game-theory applied to trading - most indicators don't check if you're fighting obvious strength in the opposite direction.
Confidence Scoring: Every signal receives a 0-1 quality score blending all CAE components plus divergence strength. You can size positions by confidence - a concept absent in most divergence indicators that treat all signals identically.
Adaptive Parameters: Mini-Bandits
Even the filtering thresholds themselves learn. Most indicators have you set pivot lookback periods, minimum divergence strength, and trend filter strictness manually. These are instrument-specific - what works for one asset fails on another.
BPA-ML's mini-bandits optimize:
- Pivot lookback strictness (balance between catching small structures vs requiring major swings)
- Minimum slope change threshold (filter weak divergences vs allow early entries)
- TCS threshold for trend filtering (how strict counter-trend blocking should be)
These learn the same way the oscillator bandit does - via reward scoring and outcome evaluation. The entire system personalizes to your trading context.
Visual Intelligence: Five Presentation Modes
Most indicators offer basic customization - perhaps choosing colors or line thickness. BPA-ML includes five distinct visual modes, each designed for specific use cases:
Quantum Mode: Renders signals as probability clouds where opacity encodes confidence. High-confidence signals are bold and opaque; low-confidence signals are faint and translucent. This visually guides position sizing in a way that static markers cannot. No other divergence indicator I've found uses confidence-based visual encoding.
Holographic Mode: Multi-layer gradient bands create depth perception showing signal quality zones. Excellent for teaching and presentations.
Cyberpunk Mode: Neon centerlines with particle glow trails. High-contrast for immersive dark-theme trading.
Standard Mode: Professional dashed lines and zones. Clean, presentation-ready.
Minimal Mode: Maximum performance for backtesting and low-powered devices.
The visual system isn't cosmetic - it's part of the decision support infrastructure.
Dashboard: Real-Time Intelligence
Many indicators include dashboards showing current indicator values or basic statistics. BPA-ML's dashboard is a comprehensive control center:
Oscillator Section: Shows which configuration is currently selected, why it's selected (pull statistics, reward scores), and learning progression (warmup, learning, active).
CAE Section: Real-time TCS, DMA, Exhaustion, Adversarial cases, and Confidence scores with visual indicators (emoji-coded states, bar graphs, trend arrows).
Bandit Performance: Algorithm selection, mode (Switch vs Blend), arm distribution, differentiation metrics, learning diagnostics.
State Metrics Grid (Large mode): Normalized readings for trend alignment, momentum, volatility, volume flow, Bollinger position, ROC, directional movement, oscillator bias - all synthesized into a composite market state.
This level of transparency is rare. Most "black box" indicators hide their decision logic. BPA-ML shows you exactly why it's making decisions in real-time, enabling informed discretionary overrides.
Repainting: Complete Transparency
Many divergence indicators don't clearly disclose repainting behavior. BPA-ML offers three explicit timing modes:
Realtime: Shows developing signals on current bar. Repaints by design - this is a preview mode for learning, not for trading.
Confirmed: Signals lock at bar close. Zero repainting. Recommended for live trading.
Pivot Validated: Waits for full pivot confirmation (5+ bar delay). Highest purity, zero repainting, ideal for backtesting divergence quality.
You choose the mode based on your priority - speed vs certainty. The transparency empowers rather than obscures.
Educational Value: Learning Platform
Most indicators are tools - you use them, but you don't learn from them. BPA-ML is designed as a learning platform:
Advisory Mode: Signals always appear, but blocked signals receive warning annotations explaining why CAE would have filtered them. You see the decision logic in action without missing learning opportunities.
Dashboard Transparency: Real-time display of all metrics shows exactly how market state influences decisions.
Comprehensive Documentation: In-indicator tooltips, extensive publishing statement, and user guides explain not just what to click, but why the algorithms work and how to apply them strategically.
Algorithm Comparisons: By trying different bandit algorithms (UCB1 vs Thompson vs Epsilon vs Gradient), you learn the differences between exploration strategies - knowledge applicable beyond trading.
This isn't just a signal generator - it's an educational tool that teaches machine learning concepts, market intelligence interpretation, and systematic decision-making.
What This System Is NOT
To be completely transparent about positioning:
Not a Prediction System: BPA-ML doesn't predict future prices. It identifies structural divergences, assesses current market state, and learns which oscillator configurations historically correlated with better forward returns. The learning is retrospective optimization, not fortune telling.
Not Fully Automated: This is a decision support tool, not a push-button profit machine. You still need to execute trades, manage risk, and apply discretionary judgment. The confidence scores guide position sizing, but you determine final risk allocation.
Not Beginner-Friendly: The sophistication comes with complexity. This system requires understanding of divergence trading, basic machine learning concepts, and market state interpretation. It's designed for intermediate to advanced traders willing to invest time in learning the system.
Not Magic: Even with optimal configurations and intelligent filtering, markets are probabilistic. Losing trades are inevitable. The system improves your probability distribution - it doesn't eliminate risk or guarantee profits.
The Fundamental Difference
Here's the core distinction:
Traditional Divergence Indicators: Detect patterns and hope they work.
"ML" Indicators (KNN/Clustering): Detect patterns and compare to historical similarities.
BPA-ML: Detects patterns, evaluates outcomes, learns which detection methods work best for this specific context, understands market state before suggesting trades, and continuously improves without manual intervention.
The difference isn't incremental - it's architectural. This is trading system infrastructure with embedded intelligence, not just a pattern detector with filters.
Who This Is For
BPA-ML is ideal for traders who:
- Value systematic approaches over discretionary guessing
- Appreciate transparency in decision logic
- Are willing to let systems learn over 200+ bars before judging performance
- Trade liquid instruments on 5-minute to daily timeframes
- Want to learn machine learning concepts through practical application
- Seek professional-grade tools without institutional price tags
It's not ideal for:
- Absolute beginners needing simple plug-and-play systems
- 1-minute scalpers (noise dominates at very low timeframes)
- Traders of illiquid instruments (insufficient data for learning)
- Those seeking magic solutions without understanding methodology
- Impatient optimizers wanting instant perfection
What Makes This Original
The innovation in BPA-ML lies in three interconnected breakthroughs that work synergistically:
1. Multi-Armed Bandit Oscillator Selection
Traditional divergence indicators require manual optimization - you choose RSI with a length of 14, or Stochastic with specific settings, and hope they work. BPA-ML eliminates this guesswork through machine learning. The system maintains a grid of 40 candidate oscillator configurations spanning five oscillator families (RSI, Stochastic, CCI, MFI, Williams %R), four length parameters, and two smoothing settings. Using proven bandit algorithms (UCB1, Thompson Sampling, Epsilon-Greedy, or Gradient-based learning), the system continuously evaluates which configuration produces the best forward returns and automatically switches to the winning arm. This isn't random testing - it's intelligent exploration with exploitation, balancing the discovery of new opportunities against leveraging proven configurations.
2. Cognitive Analytical Engine (CAE)
Divergences occur constantly, but most fail. The CAE solves this by computing a comprehensive market intelligence layer:
Trend Conviction Score (TCS): Synthesizes ADX normalization, multi-timeframe EMA alignment, and structural persistence into a single 0-1 metric that quantifies how strongly the market is trending. When TCS exceeds your threshold, the system knows to avoid counter-trend trades unless other factors override.
Directional Momentum Alignment (DMA): Measures the spread between fast and slow EMAs, normalized by ATR. This creates a regime-aware momentum indicator that adjusts its interpretation based on current volatility.
Exhaustion Modeling: Aggregates volume spikes, pin bar formations, extended runs above/below EMAs, and extreme RSI readings into a probability that the current move is reaching climax. High exhaustion can override trend filters, allowing reversal trades at genuine turning points.
Adversarial Validation: Before approving a bullish signal, the engine quantifies both the bull case (proximity to support EMAs, oversold conditions, volume confirmation) and the bear case (distance to resistance, overbought conditions). If the opposing case dominates by your threshold, the signal is blocked or flagged with a warning.
Confidence Scoring: Every signal receives a 0-1 confidence score blending TCS, momentum magnitude, pullback quality, market state metrics, divergence strength, and adversarial advantage. You can gate signals on minimum confidence, ensuring only high-probability setups reach your attention.
3. Adaptive Parameter Mini-Bandits
Beyond the oscillator itself, BPA-ML uses additional bandit systems to optimize:
- Pivot lookback strictness
- Minimum slope change threshold
- TCS threshold for trend filtering
These parameters are often instrument-specific. The adaptive bandits learn these nuances automatically.
Why These Components Work Together
Each layer serves a specific purpose in the signal generation hierarchy:
Layer 1 - Oscillator Selection: The bandit ensures you're always using the oscillator configuration best suited to current market microstructure.
Layer 2 - Divergence Detection: With the optimal oscillator selected, the engine scans for structural divergences using confirmed pivots.
Layer 3 - CAE Filtering: Raw divergences are validated against market intelligence.
Layer 4 - Spacing & Timing: Quality signals need proper spacing to avoid over-trading.
This isn't a random collection of indicators. It's a decision pipeline where each stage refines signal quality, and the machine learning ensures the entire system stays calibrated to your specific trading context.
Core Components - Deep Dive
Divergence Engine
The foundation is a dual-mode divergence detector:
Regular Divergence: Price makes a higher high while oscillator makes a lower high (bearish), or price makes a lower low while oscillator makes a higher low (bullish). These signal potential reversals.
Hidden Divergence: Price makes a lower high while oscillator makes a higher high (bullish continuation), or price makes a higher low while oscillator makes a lower low (bearish continuation). These signal trend strength.
Pivots are confirmed using symmetric lookback periods. Divergence strength is quantified via slope separation between price and oscillator.
Signal Timing Modes
Realtime (live preview): Shows potential signals on current bar. Repaints by design. Use for learning only.
Confirmed (1-bar delay): Signals lock at bar close. No repainting. Recommended for live trading.
Pivot Validated: Waits for full pivot confirmation (5+ bar delay). Highest purity, best for backtesting.
Multi-Armed Bandit Algorithms
UCB1: Optimism under uncertainty. Excellent balance for most use cases.
Thompson Sampling: Bayesian approach with smooth exploration. Great for long-term adaptation.
Epsilon-Greedy: Simple exploitation with random exploration. Easy to understand.
Gradient-based: Lightweight weight adjustment based on rewards. Fast and efficient.
Bandit Operating Modes
Switch Mode: Uses top-ranked arm directly. Maximum amplitude, crisp signals.
Blend Mode: Softmax mixture with dominant-arm preservation. Ensemble stability while maintaining amplitude for overbought/oversold crossings.
How to Use This Indicator
Initial Setup
1. Apply BPA-ML to your chart
2. Select visual mode (Minimal/Standard/Holographic/Cyberpunk/Quantum)
3. Choose signal timing - "Confirmed (1-bar delay)" for live trading
4. Set Oscillator Type to "Auto (ML)" and enable it
5. Select bandit algorithm - UCB1 recommended
6. Choose Blend mode with temperature 0.4-0.5
CAE Configuration
Start with "Advisory" mode to learn the system. Signals appear with warnings if CAE would have blocked them.
Switch to "Filtering" mode when comfortable - CAE actively blocks low-quality signals.
Enable the three primary filters:
- Strong Trend Filter
- Adversarial Validation
- Confidence Gating
Parameter Guidance by Trading Style
Scalping (1-5 minute charts):
- Algorithm: Thompson or UCB1
- Mode: Blend (temp 0.3-0.4)
- Horizon: 8-12 bars
- Min Confidence: 0.30-0.40
- TCS Threshold: 0.70-0.80
- Spacing: 8-12 any, 16-24 same-side
Day Trading (15min-1H charts):
- Algorithm: UCB1
- Mode: Blend (temp 0.4-0.6)
- Horizon: 12-24 bars
- Min Confidence: 0.35-0.45
- TCS Threshold: 0.80-0.85
- Spacing: 12-20 any, 20-30 same-side
Swing Trading (4H-Daily charts):
- Algorithm: UCB1 or Thompson
- Mode: Blend (temp 0.6-1.0) or Switch
- Horizon: 20-40 bars
- Min Confidence: 0.40-0.55
- TCS Threshold: 0.85-0.95
- Spacing: 20-40 any, 30-60 same-side
Signal Interpretation
Bullish Signals: Green markers below price. Enter long when detected.
Bearish Signals: Red markers above price. Enter short when detected.
Blocked Signals: Orange X markers show filtered signals (Advisory mode).
Confidence Rings: Single ring at 50%+ confidence, double at 70%+. Use for position sizing.
Dashboard Metrics
Oscillator Section: Shows active type, value, state, and parameters.
Cognitive Engine:
- TCS: 0.80+ indicates strong trend
- DMA: Momentum direction and strength
- Exhaustion: 0.75+ warns of reversal
- Bull/Bear Case: Adversarial scoring
- Differential: Net directional advantage
Bandit Performance: Shows algorithm, mode, selected configuration, and learning diagnostics.
Visual Zones
- Bullish Zone: Blue/cyan tint - favorable for longs
- Bearish Zone: Red/magenta tint - favorable for shorts
- Exhaustion Zone: Yellow warning - reduce sizing
Visual Mode Selection
Minimal: Clean triangles, maximum performance
Standard: Dashed lines with zones, professional presentation
Holographic: Gradient bands, excellent for teaching
Cyberpunk: Neon glow trails, high contrast
Quantum: Probability cloud with confidence-based opacity
Calculation Methodology
Oscillator Computation
For each bandit arm: calculate base oscillator, apply smoothing, normalize to 0-100.
Switch mode: use top arm directly.
Blend mode: softmax mixture blended with dominant arm (70/30) to preserve amplitude.
Divergence Detection
1. Identify price and oscillator pivots using symmetric periods
2. Store recent pivots with bar indices
3. Scan for slope disagreements within lookback range
4. Require minimum slope separation
5. Classify as regular or hidden divergence
6. Compute strength score
CAE Metrics
TCS: 0.35×ADX + 0.35×structural + 0.30×alignment
DMA: (EMA21 - EMA55) / ATR14
Exhaustion: Aggregates volume, divergence, RSI extremes, pins, extended runs
Confidence: 0.30×TCS + 0.25×|DMA| + 0.20×pullback + 0.15×state + 0.10×divergence + adversarial
Bandit Rewards
Every horizon period: compute log return normalized by ATR, clip to ±0.5, bonus if signal was positive. Update arm statistics per algorithm.
Ideal Market Conditions
Best Performance:
- Liquid instruments with clear structure
- Trending markets with consolidations
- 5-minute to daily timeframes
- Consistent volume and participation
Learning Requirements:
- Minimum 200 bars for warmup
- Ideally 500-1000 bars for full confidence
- Performance improves as bandit accumulates data
Challenging Conditions:
- Extremely low liquidity
- Very low timeframes (1-minute or below)
- Extended sideways consolidation
- Fundamentally-driven gap markets
Dashboard Interpretation Guide
TCS:
- 0.00-0.50: Weak trend, reversals viable
- 0.50-0.75: Moderate trend, mixed approach
- 0.75-0.85: Strong trend, favor continuation
- 0.85-1.00: Very strong trend, counter-trend high risk
DMA:
- -2.0 to -1.0: Strong bearish
- -0.5 to 0.5: Neutral
- 1.0 to 2.0: Strong bullish
Exhaustion:
- 0.00-0.50: Fresh move
- 0.50-0.75: Mature, watch for reversals
- 0.75-0.85: High exhaustion
- 0.85-1.00: Critical, reversal imminent
Confidence:
- 0.00-0.30: Low quality
- 0.30-0.50: Moderate quality
- 0.50-0.70: High quality
- 0.70-1.00: Premium quality
Common Questions
Why no signals?
- Blend mode: lower temperature to 0.3-0.5
- Loosen OB/OS to 65/35
- Lower min confidence to 0.35
- Reduce spacing requirements
- Use Confirmed instead of Pivot Validated
Why frequent oscillator switching?
- Normal during warmup (first 200+ bars)
- After warmup: may indicate regime shifting market
- Lower temperature in Blend mode
- Reduce learning rate or epsilon
Blend vs Switch?
Use Switch for backtesting and maximum exploitation.
Use Blend for live trading with temperature 0.3-0.5 for stability.
Recalibration frequency?
Never needed. System continuously adapts via bandit learning and weight decay.
Risk Management Integration
Position Sizing:
- 0.30-0.50 confidence: 0.5-1.0% risk
- 0.50-0.70 confidence: 1.0-1.5% risk
- 0.70+ confidence: 1.5-2.0% risk (maximum)
Stop Placement:
- Reversals: beyond divergence pivot plus 1.0-1.5×ATR
- Continuations: beyond recent swing opposite direction
Targets:
- Primary: 2-3×ATR from entry
- Scale at interim levels
- Trail after 1.5×ATR in profit
Important Disclaimers
BPA-ML is an advanced technical analysis tool for identifying high-probability divergence patterns and assessing market state. It is not a complete trading system. Machine learning components adapt to historical patterns, which does not guarantee future performance. Proper risk management, position sizing, and additional confirmation methods are essential. No indicator eliminates losing trades.
Backtesting results may differ from live performance due to execution factors and dynamic bandit learning. Always validate on demo before committing real capital. CAE filtering reduces but does not eliminate false signals. Market conditions change rapidly. Use appropriate stops and never risk excessive capital on any single trade.
— Dskyz, Trade with insight. Trade with anticipation.






















