Lyapunov Market Instability (LMI)Lyapunov Market Instability (LMI)
What is Lyapunov Market Instability?
Lyapunov Market Instability (LMI) is a revolutionary indicator that brings chaos theory from theoretical physics into practical trading. By calculating Lyapunov exponents—a measure of how rapidly nearby trajectories diverge in phase space—LMI quantifies market sensitivity to initial conditions. This isn't another oscillator or trend indicator; it's a mathematical lens that reveals whether markets are in chaotic (trending) or stable (ranging) regimes.
Inspired by the meditative color field paintings of Mark Rothko, this indicator transforms complex chaos mathematics into an intuitive visual experience. The elegant simplicity of the visualization belies the sophisticated theory underneath—just as Rothko's seemingly simple color blocks contain profound depth.
Theoretical Foundation (Chaos Theory & Lyapunov Exponents)
In dynamical systems, the Lyapunov exponent (λ) measures the rate of separation of infinitesimally close trajectories:
λ > 0: System is chaotic—small changes lead to dramatically different outcomes (butterfly effect)
λ < 0: System is stable—trajectories converge, perturbations die out
λ ≈ 0: Edge of chaos—transition between regimes
Phase Space Reconstruction
Using Takens' embedding theorem , we reconstruct market dynamics in higher dimensions:
Time-delay embedding: Create vectors from price at different lags
Nearest neighbor search: Find historically similar market states
Trajectory evolution: Track how these similar states diverged over time
Divergence rate: Calculate average exponential separation
Market Application
Chaotic markets (λ > threshold): Strong trends emerge, momentum dominates, use breakout strategies
Stable markets (λ < threshold): Mean reversion dominates, fade extremes, range-bound strategies work
Transition zones: Market regime about to change, reduce position size, wait for confirmation
How LMI Works
1. Phase Space Construction
Each point in time is embedded as a vector using historical prices at specific delays (τ). This reveals the market's hidden attractor structure.
2. Lyapunov Calculation
For each current state, we:
- Find similar historical states within epsilon (ε) distance
- Track how these initially similar states evolved
- Measure exponential divergence rate
- Average across multiple trajectories for robustness
3. Signal Generation
Chaos signals: When λ crosses above threshold, market enters trending regime
Stability signals: When λ crosses below threshold, market enters ranging regime
Divergence detection: Price/Lyapunov divergences signal potential reversals
4. Rothko Visualization
Color fields: Background zones represent market states with Rothko-inspired palettes
Glowing line: Lyapunov exponent with intensity reflecting market state
Minimalist design: Focus on essential information without clutter
Inputs:
📐 Lyapunov Parameters
Embedding Dimension (default: 3)
Dimensions for phase space reconstruction
2-3: Simple dynamics (crypto/forex) - captures basic momentum patterns
4-5: Complex dynamics (stocks/indices) - captures intricate market structures
Higher dimensions need exponentially more data but reveal deeper patterns
Time Delay τ (default: 1)
Lag between phase space coordinates
1: High-frequency (1m-15m charts) - captures rapid market shifts
2-3: Medium frequency (1H-4H) - balances noise and signal
4-5: Low frequency (Daily+) - focuses on major regime changes
Match to your timeframe's natural cycle
Initial Separation ε (default: 0.001)
Neighborhood size for finding similar states
0.0001-0.0005: Highly liquid markets (major forex pairs)
0.0005-0.002: Normal markets (large-cap stocks)
0.002-0.01: Volatile markets (crypto, small-caps)
Smaller = more sensitive to chaos onset
Evolution Steps (default: 10)
How far to track trajectory divergence
5-10: Fast signals for scalping - quick regime detection
10-20: Balanced for day trading - reliable signals
20-30: Slow signals for swing trading - major regime shifts only
Nearest Neighbors (default: 5)
Phase space points for averaging
3-4: Noisy/fast markets - adapts quickly
5-6: Balanced (recommended) - smooth yet responsive
7-10: Smooth/slow markets - very stable signals
📊 Signal Parameters
Chaos Threshold (default: 0.05)
Lyapunov value above which market is chaotic
0.01-0.03: Sensitive - more chaos signals, earlier detection
0.05: Balanced - optimal for most markets
0.1-0.2: Conservative - only strong trends trigger
Stability Threshold (default: -0.05)
Lyapunov value below which market is stable
-0.01 to -0.03: Sensitive - quick stability detection
-0.05: Balanced - reliable ranging signals
-0.1 to -0.2: Conservative - only deep stability
Signal Smoothing (default: 3)
EMA period for noise reduction
1-2: Raw signals for experienced traders
3-5: Balanced - recommended for most
6-10: Very smooth for position traders
🎨 Rothko Visualization
Rothko Classic: Deep reds for chaos, midnight blues for stability
Orange/Red: Warm sunset tones throughout
Blue/Black: Cool, meditative ocean depths
Purple/Grey: Subtle, sophisticated palette
Visual Options:
Market Zones : Background fields showing regime areas
Transitions: Arrows marking regime changes
Divergences: Labels for price/Lyapunov divergences
Dashboard: Real-time state and trading signals
Guide: Educational panel explaining the theory
Visual Logic & Interpretation
Main Elements
Lyapunov Line: The heart of the indicator
Above chaos threshold: Market is trending, follow momentum
Below stability threshold: Market is ranging, fade extremes
Between thresholds: Transition zone, reduce risk
Background Zones: Rothko-inspired color fields
Red zone: Chaotic regime (trending)
Gray zone: Transition (uncertain)
Blue zone: Stable regime (ranging)
Transition Markers:
Up triangle: Entering chaos - start trend following
Down triangle: Entering stability - start mean reversion
Divergence Signals:
Bullish: Price makes low but Lyapunov rising (stability breaking down)
Bearish: Price makes high but Lyapunov falling (chaos dissipating)
Dashboard Information
Market State: Current regime (Chaotic/Stable/Transitioning)
Trading Bias: Specific strategy recommendation
Lyapunov λ: Raw value for precision
Signal Strength: Confidence in current regime
Last Change: Bars since last regime shift
Action: Clear trading directive
Trading Strategies
In Chaotic Regime (λ > threshold)
Follow trends aggressively: Breakouts have high success rate
Use momentum strategies: Moving average crossovers work well
Wider stops: Expect larger swings
Pyramid into winners: Trends tend to persist
In Stable Regime (λ < threshold)
Fade extremes: Mean reversion dominates
Use oscillators: RSI, Stochastic work well
Tighter stops: Smaller expected moves
Scale out at targets: Trends don't persist
In Transition Zone
Reduce position size: Uncertainty is high
Wait for confirmation: Let regime establish
Use options: Volatility strategies may work
Monitor closely: Quick changes possible
Advanced Techniques
- Multi-Timeframe Analysis
- Higher timeframe LMI for regime context
- Lower timeframe for entry timing
- Alignment = highest probability trades
- Divergence Trading
- Most powerful at regime boundaries
- Combine with support/resistance
- Use for early reversal detection
- Volatility Correlation
- Chaos often precedes volatility expansion
- Stability often precedes volatility contraction
- Use for options strategies
Originality & Innovation
LMI represents a genuine breakthrough in applying chaos theory to markets:
True Lyapunov Calculation: Not a simplified proxy but actual phase space reconstruction and divergence measurement
Rothko Aesthetic: Transforms complex math into meditative visual experience
Regime Detection: Identifies market state changes before price makes them obvious
Practical Application: Clear, actionable signals from theoretical physics
This is not a combination of existing indicators or a visual makeover of standard tools. It's a fundamental rethinking of how we measure and visualize market dynamics.
Best Practices
Start with defaults: Parameters are optimized for broad market conditions
Match to your timeframe: Adjust tau and evolution steps
Confirm with price action: LMI shows regime, not direction
Use appropriate strategies: Chaos = trend, Stability = reversion
Respect transitions: Reduce risk during regime changes
Alerts Available
Chaos Entry: Market entering chaotic regime - prepare for trends
Stability Entry: Market entering stable regime - prepare for ranges
Bullish Divergence: Potential bottom forming
Bearish Divergence: Potential top forming
Chart Information
Script Name: Lyapunov Market Instability (LMI) Recommended Use: All markets, all timeframes Best Performance: Liquid markets with clear regimes
Academic References
Takens, F. (1981). "Detecting strange attractors in turbulence"
Wolf, A. et al. (1985). "Determining Lyapunov exponents from a time series"
Rosenstein, M. et al. (1993). "A practical method for calculating largest Lyapunov exponents"
Note: After completing this indicator, I discovered @loxx's 2022 "Lyapunov Hodrick-Prescott Oscillator w/ DSL". While both explore Lyapunov exponents, they represent independent implementations with different methodologies and applications. This indicator uses phase space reconstruction for regime detection, while his combines Lyapunov concepts with HP filtering.
Disclaimer
This indicator is for research and educational purposes only. It does not constitute financial advice or provide direct buy/sell signals. Chaos theory reveals market character, not future prices. Always use proper risk management and combine with your own analysis. Past performance does not guarantee future results.
See markets through the lens of chaos. Trade the regime, not the noise.
Bringing theoretical physics to practical trading through the meditative aesthetics of Mark Rothko
Trade with insight. Trade with anticipation.
— Dskyz , for DAFE Trading Systems
Volatilidade
Support and Resistance Profile with Volatility ClusteringThe indicator begins by looking at recent volatility behavior in the market: it measures the average true range over your chosen “Length” and compares it to the average true range over ten times that period. When volatility over the short window is high relative to longer-term volatility, we mark that period as a “cluster.” As price moves through these clusters—whether in a quiet period or a sudden burst of activity—the script isolates each cluster and examines the sequence of closing prices within it.
Within every cluster, the algorithm next finds the points along the price path that matter most to a human eye, smoothing out minor wobbles and highlighting the peaks and valleys that define the cluster’s shape. It does this by drawing a straight line between the beginning and end of the cluster, then repeatedly snapping the single point that deviates most from that line back onto it and re-interpolating, until it has identified a fixed number of perceptually important points. Those points capture where price really turned or accelerated, stripping away noise so that you see the genuine memory-markers in each volatility episode.
Each of those important points inherits a “weight” based on the cluster’s normalized volatility—essentially how large the average true range in that cluster was relative to its average close. Over your “Main Length for Profile” window, every time one of these weighted points occurs at a particular price level, it adds to a running total in that level’s bin. At the end of the window you see a silhouette of boxes extending to the right of the chart: where boxes are wide, many important points (with high volatility weight) have happened there in the past; where boxes are thin or absent, price memory is light.
For a trader, the value of this profile lies in spotting zones where the market has repeatedly “remembered” price extremes during volatile episodes—those are areas where support or resistance is likely to be strongest. Conversely, gaps in the profile—price levels with little weighted history—suggest frictionless zones. If price enters such a gap, it may move swiftly until it encounters another region of heavy memory. You can use this in several ways: as a filter on breakouts and breakdowns (only trade through a gap when you see sufficient momentum), as a guide for scaling into positions (add when price enters a low-memory zone and tighten stops where memory boxes thicken), or to anticipate where price might pause or reverse (when it reaches a band of wide boxes). By turning raw volatility clusters into a human-readable map of price memory, this tool helps you see at a glance where the market is likely to push or pause—and plan entries, exits, and risk targets accordingly.
Eigenvector Centrality Drift (ECD) - Market State Network What is Eigenvector Centrality Drift (ECD)?
Eigenvector Centrality Drift (ECD) is a groundbreaking indicator that applies concepts from network science to financial markets. Instead of viewing price as a simple series, ECD models the market as a dynamic network of “micro-states”—distinct combinations of price, volatility, and volume. By tracking how the influence of these states changes over time, ECD helps you spot regime shifts and transitions in market character before they become obvious in price.
This is not another moving average or momentum oscillator. ECD is inspired by eigenvector centrality—a measure of influence in network theory—and adapts it to the world of price action, volatility, and volume. It’s about understanding which market states are “in control” and when that control is about to change.
Theoretical Foundation
Network Science: In complex systems, nodes (states) and edges (transitions) form a network. Eigenvector centrality measures how influential a node is, not just by its direct connections, but by the influence of the nodes it connects to.
Market Micro-States: Each bar is classified into a “state” based on price change, volatility, and volume. The market transitions between these states, forming a network of possible regimes.
Centrality Drift: By tracking the centrality (influence) of the current state, and how it changes (drifts) over time, ECD highlights when the market’s “center of gravity” is shifting—often a precursor to major moves or regime changes.
How ECD Works
State Classification: Each bar is assigned to one of N market micro-states, based on a weighted combination of normalized price change, volatility, and volume.
Transition Matrix: Over a rolling window, ECD tracks how often the market transitions from each state to every other state, forming a transition probability matrix.
Centrality Calculation: Using a simplified eigenvector approach, ECD calculates the “influence” score for each state, reflecting how central it is to the network of recent market behavior.
Centrality Drift: The indicator tracks the Z-score of the change in centrality for the current state. Rapid increases or decreases, or a shift in the dominant state, signal a potential regime shift.
Dominant State: ECD also highlights which state currently has the highest influence, providing insight into the prevailing market character.
Inputs:
🌐 Market State Configuration
Number of Market States (n_states, default 6): Number of distinct micro-states to track.
3–4: Simple (Up/Down/Sideways)
5–6: Balanced (recommended)
7–9: Complex, more nuanced
Price Change Weight (price_weight, default 0.4):
How much price movement defines a state. Higher = more directional.
Volatility Weight (vol_weight, default 0.3):
How much volatility defines a state. Higher = more regime focus.
Volume Weight (volume_weight, default 0.3):
How much volume defines a state. Higher = more participation focus.
🔗 Network Analysis
Transition Matrix Window (transition_window, default 50): Lookback for building the state transition matrix.
Shorter: Adapts quickly
Longer: More stable
Influence Decay Factor (influence_decay, default 0.85): How much influence propagates through the network.
Higher: Distant transitions matter more
Lower: Only immediate transitions matter
Drift Detection Sensitivity (drift_sensitivity, default 1.5): Z-score threshold for significant centrality drift.
Lower: More signals
Higher: Only major shifts
🎨 Visualization
Show Network Visualization (show_network, default true): Background color and effects based on network structure.
Show Centrality Score (show_centrality, default true): Plots the current state’s centrality measure.
Show Drift Indicator (show_drift, default true): Plots the centrality drift Z-score.
Show State Map (show_state_map, default true): Dashboard showing all state centralities and which is dominant.
Color Scheme (color_scheme, default "Quantum"):
“Quantum”: Cyan/Magenta
“Neural”: Green/Blue
“Plasma”: Yellow/Pink
“Matrix”: Green/Black
Color Schemes
Dynamic gradients reflect the current state’s centrality and drift, using your chosen color palette.
Background network effect: The more central the current state, the more intense the background.
Centrality and drift lines: Color-coded for clarity and regime shift detection.
Visual Logic
Centrality Score Line: Plots the influence of the current state, with glow for emphasis.
Drift Indicator: Histogram of centrality drift Z-score, green for positive, red for negative.
Threshold Lines: Dotted lines mark the drift sensitivity threshold for regime shift alerts.
State Map Dashboard: Top-right panel shows all state centralities, highlights the current and dominant state, and visualizes influence with bars.
Information Panel: Bottom-left panel summarizes current state, centrality, dominant state, drift Z-score, and regime shift status.
How to Use ECD
Centrality Score: High = current state is highly influential; low = state is peripheral.
Drift Z-Score:
Large positive/negative = rapid change in influence, regime shift likely.
Near zero = stable network, no major shift.
Dominant State: The state with the highest centrality is “in control” of the market’s transitions.
State Map: Use to see which states are rising or falling in influence.
Tips:
Use fewer states for simple markets, more for nuanced analysis.
Watch for drift Z-score crossing the threshold—these are your regime shift signals.
Combine with your own system for confirmation.
Alerts:
ECD Regime Shift: Significant centrality drift detected—potential regime change.
ECD State Change: Market state transition occurred.
ECD Dominance Shift: Dominant market state has changed.
Originality & Usefulness
ECD is not a mashup or rehash of standard indicators. It is a novel application of network science and eigenvector centrality to market microstructure, providing a new lens for understanding regime shifts and market transitions. The state network, centrality drift, and dashboard are unique to this script. ECD is designed for anticipation, not confirmation—helping you see the market’s “center of gravity” shift before price action makes it obvious.
Chart Info
Script Name: Eigenvector Centrality Drift (ECD) – Market State Network
Recommended Use: Any asset, any timeframe. Tune parameters to your style.
Disclaimer
This script is for research and educational purposes only. It does not provide financial advice or direct buy/sell signals. Always use proper risk management and combine with your own strategy. Past performance is not indicative of future results.
See the market as a network. Anticipate the shift in influence.
— Dskyz , for DAFE Trading Systems
Information Asymmetry Gradient (IAG) What is the Information Asymmetry Gradient (IAG)?
The Information Asymmetry Gradient (IAG) is a unique market regime and imbalance detector that quantifies the subtle, directional “information flow” in price and volume. Inspired by information theory and market microstructure, IAG is designed to help traders spot the early buildup of conviction or surprise—the kind of hidden imbalance that often precedes major price moves.
Unlike traditional volume or momentum indicators, IAG focuses on the efficiency and directionality of information transfer: how much “informational energy” is being revealed by up-moves versus down-moves, normalized by price movement. It’s not just about net flow, but about the quality and asymmetry of that flow.
Theoretical Foundation
Information Asymmetry: Markets move when new information is revealed. If one side (buyers or sellers) is consistently more “informationally efficient” per unit of price change, an imbalance is building—even if price hasn’t moved much yet.
Gradient: By tracking the rate of change (gradient) between fast and slow information flows, IAG highlights when a subtle imbalance is accelerating.
Volatility of Asymmetry: Sudden spikes in the volatility of information asymmetry often signal regime uncertainty or the approach of a “surprise” move.
How IAG Works
Directional Information Content: For each bar, IAG estimates the “information per unit of price change” for both up-moves and down-moves, using volume and price action.
Asymmetry Calculation: Computes the difference (or ratio) between up and down information content, revealing directional bias.
Gradient Detection: Calculates both a fast and slow EMA of the asymmetry, then measures their difference (the “gradient”), normalized as a Z-score.
Volatility of Asymmetry: Tracks the standard deviation of asymmetry over a rolling window, with Z-score normalization to spot “information shocks.”
Flow Strength: Quantifies the conviction of the current information flow on a 0–100 scale.
Regime Detection: Flags “extreme” asymmetry, “building” flow, and “high volatility” states.
Inputs:
🌌 Core Asymmetry Parameters
Fast Information Period (short_len, default 8): EMA period for detecting immediate information flow changes.
5–8: Scalping (1–5min)
8–12: Day trading (15min–1hr)
12–20: Swing trading (4hr+)
Slow Information Period (long_len, default 34): EMA period for baseline information context. Should be 3–5x fast period.
Default (34): Fibonacci number, stable for most assets.
Gradient Smoothing (gradient_smooth, default 3): Smooths the gradient calculation.
1–2: Raw, responsive
3–5: Balanced
6–10: Very smooth
📊 Asymmetry Method
Calculation Mode (calc_mode, default "Weighted"):
“Simple”: Basic volume split by direction
“Weighted”: Volume × price movement (default, most robust)
“Logarithmic”: Log-scaled for large moves
Use Ratio (show_ratio, default false):
“Difference”: UpInfo – DownInfo (additive)
“Ratio”: UpInfo / DownInfo (multiplicative, better for comparing volatility regimes)
🌊 Volatility Analysis
Volatility Window (stdev_len, default 21): Lookback for measuring asymmetry volatility.
Volatility Alert Level (vol_threshold, default 1.5): Z-score threshold for volatility alerts.
🎨 Visual Settings
Color Theme (color_theme, default "Starry Night"):
Van Gogh-inspired palettes:
“Starry Night”: Deep blues and yellows
“Sunflowers”: Warm yellows and browns
“Café Terrace”: Night blues and warm lights
“Wheat Field”: Golden and sky blue
Show Swirl Effects (show_swirls, default true): Adds swirling background to visualize information turbulence.
Show Signal Stars (show_stars, default true): Star markers at significant asymmetry points.
Show Info Dashboard (show_dashboard, default true): Top-right panel with current metrics and market state.
Show Flow Visualization (show_flow, default true): Main gradient line with artistic effects.
Color Schemes
Dynamic color gradients adapt to both the direction and intensity of the information gradient, using Van Gogh-inspired palettes for visual clarity and artistic flair.
Glow and aura effects: The main line is layered with glows for depth and to highlight strong signals.
Swirl background: Visualizes the “turbulence” of information flow, darker and more intense as flow strength and volatility rise.
Visual Logic
Main Gradient Line: Plots the normalized information gradient (Z-score), color-coded by direction and intensity.
Glow/Aura: Multiple layers for visual depth and to highlight strong signals.
Threshold Zones: Dotted lines and filled areas mark “Building” and “Extreme” asymmetry zones.
Volatility Ribbon: Area plot of volatility Z-score, highlighting information shocks.
Signal Stars: Circular markers at each “Extreme” event, color-coded for bullish/bearish; cross markers for volatility spikes.
Dashboard: Top-right panel shows current status (Extreme, Building, High Volatility, Balanced), gradient value, flow strength, information balance, and volatility status.
Trading Guide: Bottom-left panel explains all states and how to interpret them.
How to Use IAG
🌟 EXTREME: Major information imbalance—potential for explosive move or reversal.
🌙 BUILDING: Asymmetry is forming—watch for a breakout or trend acceleration.
🌪️ HIGH VOLATILITY: Information flow is unstable—expect regime uncertainty or “surprise” moves.
☁️ BALANCED: No clear bias—market is in equilibrium.
Positive Gradient: Bullish information flow (buyers have the edge).
Negative Gradient: Bearish information flow (sellers have the edge).
Flow >66%: Strong conviction—crowd is acting in unison.
Volatility Spike: Regime uncertainty—be alert for sudden moves.
Tips:
- Use lower periods for scalping, higher for swing trading.
- “Weighted” mode is most robust for most assets.
- Combine with price action or your own system for confirmation.
- Works on all assets and timeframes—tune to your style.
Alerts
IAG Extreme Asymmetry: Extreme information asymmetry detected.
IAG Building Flow: Information flow building.
IAG High Volatility: Information volatility spike.
IAG Bullish/Bearish Extreme: Directional extreme detected.
Originality & Usefulness
IAG is not a mashup of existing indicators. It is a novel approach to quantifying the “surprise” or “conviction” element in market moves, focusing on the efficiency and directionality of information transfer per unit of price change. The multi-layered color logic, artistic visual effects, and regime dashboard are unique to this script. IAG is designed for anticipation, not confirmation—helping you see subtle imbalances before they become obvious in price.
Chart Info
Script Name: Information Asymmetry Gradient (IAG) – Starry Night
Recommended Use: Any asset, any timeframe. Tune parameters to your style.
Disclaimer
This script is for research and educational purposes only. It does not provide financial advice or direct buy/sell signals. Always use proper risk management and combine with your own strategy. Past performance is not indicative of future results.
Trade with insight. Trade with anticipation.
— Dskyz , for DAFE Trading Systems
Reflexivity Resonance Factor (RRF) - Quantum Flow Reflexivity Resonance Factor (RRF) – Quantum Flow
See the Feedback Loops. Anticipate the Regime Shift.
What is the RRF – Quantum Flow?
The Reflexivity Resonance Factor (RRF) – Quantum Flow is a next-generation market regime detector and energy oscillator, inspired by George Soros’ theory of reflexivity and modern complexity science. It is designed for traders who want to visualize the hidden feedback loops between market perception and participation, and to anticipate explosive regime shifts before they unfold.
Unlike traditional oscillators, RRF does not just measure price momentum or volatility. Instead, it models the dynamic feedback between how the market perceives itself (perception) and how it acts on that perception (participation). When these feedback loops synchronize, they create “resonance” – a state of amplified reflexivity that often precedes major market moves.
Theoretical Foundation
Reflexivity: Markets are not just driven by external information, but by participants’ perceptions and their actions, which in turn influence future perceptions. This feedback loop can create self-reinforcing trends or sudden reversals.
Resonance: When perception and participation align and reinforce each other, the market enters a high-energy, reflexive state. These “resonance” events often mark the start of new trends or the climax of existing ones.
Energy Field: The indicator quantifies the “energy” of the market’s reflexivity, allowing you to see when the crowd is about to act in unison.
How RRF – Quantum Flow Works
Perception Proxy: Measures the rate of change in price (ROC) over a configurable period, then smooths it with an EMA. This models how quickly the market’s collective perception is shifting.
Participation Proxy: Uses a fast/slow ATR ratio to gauge the intensity of market participation (volatility expansion/contraction).
Reflexivity Core: Multiplies perception and participation to model the feedback loop.
Resonance Detection: Applies Z-score normalization to the absolute value of reflexivity, highlighting when current feedback is unusually strong compared to recent history.
Energy Calculation: Scales resonance to a 0–100 “energy” value, visualized as a dynamic background.
Regime Strength: Tracks the percentage of bars in a lookback window where resonance exceeded the threshold, quantifying the persistence of reflexive regimes.
Inputs:
🧬 Core Parameters
Perception Period (pp_roc_len, default 14): Lookback for price ROC.
Lower (5–10): More sensitive, for scalping (1–5min).
Default (14): Balanced, for 15min–1hr.
Higher (20–30): Smoother, for 4hr–daily.
Perception Smooth (pp_smooth_len, default 7): EMA smoothing for perception.
Lower (3–5): Faster, more detail.
Default (7): Balanced.
Higher (10–15): Smoother, less noise.
Participation Fast (prp_fast_len, default 7): Fast ATR for immediate volatility.
5–7: Scalping.
7–10: Day trading.
10–14: Swing trading.
Participation Slow (prp_slow_len, default 21): Slow ATR for baseline volatility.
Should be 2–4x fast ATR.
Default (21): Works with fast=7.
⚡ Signal Configuration
Resonance Window (res_z_window, default 50): Z-score lookback for resonance normalization.
20–30: More reactive.
50: Medium-term.
100+: Very stable.
Primary Threshold (rrf_threshold, default 1.5): Z-score level for “Active” resonance.
1.0–1.5: More signals.
1.5: Balanced.
2.0+: Only strong signals.
Extreme Threshold (rrf_extreme, default 2.5): Z-score for “Extreme” resonance.
2.5: Major regime shifts.
3.0+: Only the most extreme.
Regime Window (regime_window, default 100): Lookback for regime strength (% of bars with resonance spikes).
Higher: More context, slower.
Lower: Adapts quickly.
🎨 Visual Settings
Show Resonance Flow (show_flow, default true): Plots the main resonance line with glow effects.
Show Signal Particles (show_particles, default true): Circular markers at active/extreme resonance points.
Show Energy Field (show_energy, default true): Background color based on resonance energy.
Show Info Dashboard (show_dashboard, default true): Status panel with resonance metrics.
Show Trading Guide (show_guide, default true): On-chart quick reference for interpreting signals.
Color Mode (color_mode, default "Spectrum"): Visual theme for all elements.
“Spectrum”: Cyan→Magenta (high contrast)
“Heat”: Yellow→Red (heat map)
“Ocean”: Blue gradients (easy on eyes)
“Plasma”: Orange→Purple (vibrant)
Color Schemes
Dynamic color gradients are used for all plots and backgrounds, adapting to both resonance intensity and direction:
Spectrum: Cyan/Magenta for bullish/bearish resonance.
Heat: Yellow/Red for bullish, Blue/Purple for bearish.
Ocean: Blue gradients for both directions.
Plasma: Orange/Purple for high-energy states.
Glow and aura effects: The resonance line is layered with multiple glows for depth and signal strength.
Background energy field: Darker = higher energy = stronger reflexivity.
Visual Logic
Main Resonance Line: Shows the smoothed resonance value, color-coded by direction and intensity.
Glow/Aura: Multiple layers for visual depth and to highlight strong signals.
Threshold Zones: Dotted lines and filled areas mark “Active” and “Extreme” resonance zones.
Signal Particles: Circular markers at each “Active” (primary threshold) and “Extreme” (extreme threshold) event.
Dashboard: Top-right panel shows current status (Dormant, Building, Active, Extreme), resonance value, energy %, and regime strength.
Trading Guide: Bottom-right panel explains all states and how to interpret them.
How to Use RRF – Quantum Flow
Dormant (💤): Market is in equilibrium. Wait for resonance to build.
Building (🌊): Resonance is rising but below threshold. Prepare for a move.
Active (🔥): Resonance exceeds primary threshold. Reflexivity is significant—consider entries or exits.
Extreme (⚡): Resonance exceeds extreme threshold. Major regime shift likely—watch for trend acceleration or reversal.
Energy >70%: High conviction, crowd is acting in unison.
Above 0: Bullish reflexivity (positive feedback).
Below 0: Bearish reflexivity (negative feedback).
Regime Strength: % of bars in “Active” state—higher = more persistent regime.
Tips:
- Use lower lookbacks for scalping, higher for swing trading.
- Combine with price action or your own system for confirmation.
- Works on all assets and timeframes—tune to your style.
Alerts
RRF Activation: Resonance crosses above primary threshold.
RRF Extreme: Resonance crosses above extreme threshold.
RRF Deactivation: Resonance falls below primary threshold.
Originality & Usefulness
RRF – Quantum Flow is not a mashup of existing indicators. It is a novel oscillator that models the feedback loop between perception and participation, then quantifies and visualizes the resulting resonance. The multi-layered color logic, energy field, and regime strength dashboard are unique to this script. It is designed for anticipation, not confirmation—helping you see regime shifts before they are obvious in price.
Chart Info
Script Name: Reflexivity Resonance Factor (RRF) – Quantum Flow
Recommended Use: Any asset, any timeframe. Tune parameters to your style.
Disclaimer
This script is for research and educational purposes only. It does not provide financial advice or direct buy/sell signals. Always use proper risk management and combine with your own strategy. Past performance is not indicative of future results.
Trade with insight. Trade with anticipation.
— Dskyz , for DAFE Trading Systems
EMA Pullback Speed Strategy 📌 **Overview**
The **EMA Pullback Speed Strategy** is a trend-following approach that combines **price momentum** and **Exponential Moving Averages (EMA)**.
It aims to identify high-probability entry points during brief pullbacks within ongoing uptrends or downtrends.
The strategy evaluates **speed of price movement**, **relative position to dynamic EMA**, and **candlestick patterns** to determine ideal timing for entries.
One of the key concepts is checking whether the price has **“not pulled back too much”**, helping focus only on situations where the trend is likely to continue.
⚠️ This strategy is designed for educational and research purposes only. It does not guarantee future profits.
🧭 **Purpose**
This strategy addresses the common issue of **"jumping in too late during trends and taking unnecessary losses."**
By waiting for a healthy pullback and confirming signs of **trend resumption**, traders can enter with greater confidence and reduce false entries.
🎯 **Strategy Objectives**
* Enter in the direction of the prevailing trend to increase win rate
* Filter out false signals using pullback depth, speed, and candlestick confirmations
* Predefine Take-Profit (TP) and Stop-Loss (SL) levels for safer, rule-based trading
✨ **Key Features**
* **Dynamic EMA**: Reacts faster when price moves quickly, slower when market is calm – adapting to current momentum
* **Pullback Filter**: Avoids trades when price pulls back too far (e.g., more than 5%), indicating a trend may be weakening
* **Speed Check**: Measures how strongly the price returns to the trend using candlestick body speed (open-to-close range in ticks)
📊 **Trading Rules**
**■ Long Entry Conditions:**
* Current price is above the dynamic EMA (indicating uptrend)
* Price has pulled back toward the EMA (a "buy the dip" situation)
* Pullback depth is within the threshold (not excessive)
* Candlesticks show consecutive bullish closes and break the previous high
* Price speed is strong (positive movement with momentum)
**■ Short Entry Conditions:**
* Current price is below the dynamic EMA (indicating downtrend)
* Price has pulled back up toward the EMA (a "sell the rally" setup)
* Pullback is within range (not too deep)
* Candlesticks show consecutive bearish closes and break the previous low
* Price speed is negative (downward momentum confirmed)
**■ Exit Conditions (TP/SL):**
* **Take-Profit (TP):** Fixed 1.5% target above/below entry price
* **Stop-Loss (SL):** Based on recent price volatility, calculated using ATR × 4
💰 **Risk Management Parameters**
* Symbol & Timeframe: BTCUSD on 1-hour chart (H1)
* Test Capital: \$3000 (simulated account)
* Commission: 0.02%
* Slippage: 2 ticks (minimal execution lag)
* Max risk per trade: 5% of account balance
* Backtest Period: Aug 30, 2023 – May 9, 2025
* Profit Factor (PF): 1.965 (Net profit ÷ Net loss, including spreads & fees)
⚙️ **Trading Parameters & Indicator Settings**
* Maximum EMA Length: 50
* Accelerator Multiplier: 3.0
* Pullback Threshold: 5.0%
* ATR Period: 14
* ATR Multiplier (SL distance): 4.0
* Fixed TP: 1.5%
* Short-term EMA: 21
* Long-term EMA: 50
* Long Speed Threshold: ≥ 1000.0 (ticks)
* Short Speed Threshold: ≤ -1000.0 (ticks)
⚠️Adjustments are based on BTCUSD.
⚠️Forex and other currency pairs require separate adjustments.
🔧 **Strategy Improvements & Uniqueness**
Unlike basic moving average crossovers or RSI triggers, this strategy emphasizes **"momentum-supported pullbacks"**.
By combining dynamic EMA, speed checks, and candlestick signals, it captures trades **as if surfing the wave of a trend.**
Its built-in filters help **avoid overextended pullbacks**, which often signal the trend is ending – making it more robust than traditional trend-following systems.
✅ **Summary**
The **EMA Pullback Speed Strategy** is easy to understand, rule-based, and highly reproducible – ideal for both beginners and intermediate traders.
Because it shows **clear visual entry/exit points** on the chart, it’s also a great tool for practicing discretionary trading decisions.
⚠️ Past performance is not a guarantee of future results.
Always respect your Stop-Loss levels and manage your position size according to your risk tolerance.
Smoothed Rate Of ChangeSmoothed ROC - simple. Can be controlled in the settings how smooth you want it.
FlowSpike Bollinger-VWAP-Stoch StrategyHere’s a concise description you can use when publishing the “FlowSpike Bollinger-VWAP-Stoch Strategy,” incorporating both how it works and how it performed in your recent backtest:
⸻
Strategy Overview
The FlowSpike Bollinger-VWAP-Stoch Strategy is a 1-minute, intraday futures system designed for the CME E-mini Nasdaq-100 (NQM, June 2025). It combines three core signals:
1. Bollinger Bands (20, 2) – Identifies volatility extremes.
2. Stochastic Slow (14, 3, 3) – Provides momentum confirmation, with oversold (< 45) and overbought (> 55) thresholds, exiting at a mid-line crossover (50).
3. VWAP Filter (optional) – Ensures trades align with the intraday value trend.
A lightweight volume-spike filter (“FlowSpike”) further refines entries, requiring current bar volume to exceed a configurable multiple of its 20-bar average. Trades are only taken when price touches the lower or upper Bollinger band, stochastic and VWAP confirm direction, and a volume spike signals genuine market conviction.
⸻
Execution Rules
• Session: 09:30 – 11:30 Eastern (customizable via input.session).
• Contract Size: 1 contract per signal.
• Risk Management: No pyramiding (single open trade), zero commissions/slippage assumed.
• Exits: RSI reversion or end-of-session flush ensures no overnight exposure.
⸻
Backtest Performance (Apr 14 – May 23, 2025)
• Net Profit: $6,130 (12.26% on $50,000 capital)
• Gross Profit/Loss: $27,750 / $21,620
• Profit Factor: 1.28
• Total Trades: 85 (Win Rate: 68.2%)
• Avg P&L per Trade: $72
• Avg Win/Loss: $478 / $801
• Max Drawdown: $6,165 (12.16%)
• Sharpe & Sortino Ratios: 0.13 / 0.19
Compared to a buy-and-hold return of 78.4% over the same period, this strategy delivers modest—but consistent—intraday gains with controlled risk, making it a good candidate for traders seeking session-only exposure and clear, rule-based entries.
Bollinger Bands - Multi Symbol Alert (Miu)This script extends the classic Bollinger Bands indicator with support for up to 8 user-defined symbols and a unique alert system.
Unlike traditional Bollinger Band indicators, it allows traders to configure alerts across multiple assets without keeping the indicator visible on the chart, making it ideal for passive multi-asset monitoring.
What it does:
This script calculates Bollinger Bands using a 100-period simple moving average and a standard deviation multiplier of 3 (or any input you set in the settings panel).
For each selected symbol, the upper and lower bands are retrieved using request.security() and monitored for breakouts.
Alerts are triggered when the closing price of the selected symbol breaks above the upper band (Overbought) or below the lower band (Oversold) — at the bar close.
How to use it:
1) Add the indicator to your chart.
2) Open the settings panel.
3) Select up to 8 symbols to monitor.
4) After setting parameters, click the three dots next to the indicator title and choose "Add Alert on...".
5) Name your alert and confirm.
6) If you don’t wish to keep the indicator visible, you can remove it from the chart — alerts will still function as expected.
Alert message includes:
- Symbol name (e.g., BTC, ETH, LTC)
- (OB) for overbought or (OS) for oversold
- Symbol’s price at the alert moment
Technical note:
This script uses request.security() to fetch Bollinger Band levels and closing prices from up to 8 selected symbols in real time.
Feel free to leave your feedback or suggestions in the comments section below.
Enjoy!
Realtime ATR-Based Stop Loss Numerical OverlayRealtime ATR-Based Stop Loss Numerical Overlay
A simple, effective tool for dynamic risk management based on ATR (Average True Range) without adding cluttered and distracting lines all over your chart.
📌 Description
This script plots a real-time stop loss level using the Average True Range (ATR) on your chart, helping you set consistent, volatility-based stops. It supports both:
✅ Current chart timeframe
✅ Custom fixed timeframe inputs (1m, 5m, 15m, 1h, etc.)
The stop level is calculated as:
Stop = ATR × Multiplier
and updates in real-time. An overlay table displays on the bottom-right of your chart with the calculated stop value in a clean, simple way.
⚙️ Settings
ATR Timeframe Source:
Choose between using the current chart's timeframe or a fixed one (e.g. 5, 15, 60, D, etc).
ATR Length:
Period used to calculate the ATR (default is 14).
Stop Loss Multiplier:
Multiplies the ATR value to define your stop (e.g., 1.5 × ATR).
Wait for Timeframe Closes:
If enabled, the ATR value waits for the selected timeframe’s candle to close before updating. If unselected, it will update in real time.
🛠️ How to Use
Add this script to your chart from your indicators list.
Configure your desired timeframe, ATR length, and multiplier in the settings panel.
Use the value shown in the table overlay as your suggested stop loss distance from entry.
Adjust your position sizing accordingly to fit your risk tolerance.
This tool is especially useful for traders looking for adaptive risk management that evolves with market volatility — whether scalping intraday or swing trading.
💡 Pro Tip
The ATR stop can also be used to dynamically trail your stop behind price movement.
Adaptive Momentum Flow (AMF)Overview
The Adaptive Momentum Flow (AMF) indicator is a powerful, multi-faceted tool designed to provide a comprehensive and adaptive view of market momentum and trend strength. Unlike traditional oscillators with fixed settings, AMF dynamically adjusts its calculations based on market volatility , ensuring its signals remain relevant across varying market conditions. By combining advanced Double Exponential Moving Averages (DEMA) with a powerful volume analysis component and a customizable scoring system, AMF offers a unique perspective on price action and underlying buying/selling pressure.
Key Features & How It Works
1. Adaptive DEMA Trend Strength:
At its core, AMF utilizes three DEMA lines (Fast, Medium, Slow) to assess the current trend's alignment and strength.
The indicator dynamically adjusts the lengths of these DEMA lines based on real-time market volatility, measured by Average True Range (ATR). This means AMF becomes more responsive in volatile markets and smoother in calmer periods.
A "Volatility Sensitivity" input allows you to fine-tune how aggressively the indicator adapts to these changes.
2. Volume Analysis (Buying/Selling Pressure):
AMF incorporates a dedicated volume analysis module to gauge whether volume is predominantly supporting upward or downward price movements. This helps identify periods of significant buying or selling pressure.
This volume analysis component is smoothed with an adjustable Moving Average (SMA, EMA, WMA, or DEMA) and contributes to the overall momentum score, adding a crucial layer of volume-driven confirmation to the analysis.
3. Comprehensive Scoring System:
The indicator generates a normalized "Oscillator Score" that ranges from -100 to 100. This score is a weighted sum of:
Price's relationship to the Fast DEMA.
The Fast DEMA's relationship to the Medium DEMA.
The Medium DEMA's relationship to the Slow DEMA.
The smoothed value from the volume analysis.
Each component's influence on the final score can be individually adjusted via input weights, allowing for deep customization.
Signal Line & Crossovers:
A smoothed "Signal Line" provides additional confirmation for momentum shifts. Crossovers between the main AMF line and its Signal Line can indicate potential changes in market direction.
Overbought/Oversold Levels:
Adjustable Overbought (default 70) and Oversold (default -70) levels visually highlight extreme momentum conditions.
These zones are enhanced with a color fill effect (bright red for overbought, bright cyan for oversold), making it easy to spot when the market is entering potentially exhausted states.
Crucially, these extreme zones can often be further validated by combining them with volatility bands (like Bollinger Bands or Keltner Channels as shown in the chart above) or other confluence indicators, offering stronger signals for potential reversals or exhaustion.
Benefits for Traders
Reduced Lag: DEMA's inherent design helps minimize lag compared to traditional moving averages, providing more timely signals.
Adaptive Intelligence: Automatically adjusts to market volatility, ensuring the indicator's sensitivity is appropriate for current conditions.
Holistic Momentum View: Combines price-based trend alignment with volume-based pressure for a more robust assessment of market flow.
Clear Visual Cues: Intuitive plots, signal line, and vibrant overbought/oversold zone fills make interpretation straightforward.
Customizable: Extensive input options allow traders to tailor the indicator to their specific trading style, asset, and timeframe.
How to Use
Trend Confirmation: Look for the AMF line and its Signal Line to align with the price trend.
Momentum Shifts: Crossovers between the AMF line and its Signal Line can indicate shifts in momentum.
Extreme Conditions: Pay attention when the AMF line enters the neon-highlighted overbought or oversold zones, signaling potential reversals or pauses in the current momentum. Always consider confirming these signals with other analysis tools, such as price action, chart patterns, support/resistance levels, or volatility indicators.
Customization: Experiment with the "Volatility Sensitivity," DEMA multipliers, and scoring weights to find the optimal settings for your trading strategy.
CME Futures RTH net change % levelsRTH Session time calculated for AMERICAN FUTURES ONLY.
Plots the net change % from the last session's RTH close, a.k.a daily % change for that specific instrument. Best used as support and resistance zones in confluence with other analysis, and also serve as a gauge for how volatile the session is.
Momentum Long + Short Strategy (BTC 3H)Momentum Long + Short Strategy (BTC 3H)
🔍 How It Works, Step by Step
Detect the Trend (📈/📉)
Calculate two moving averages (100-period and 500-period), either EMA or SMA.
For longs, we require MA100 > MA500 (uptrend).
For shorts, we block entries if MA100 exceeds MA500 by more than a set percentage (to avoid fading a powerful uptrend).
Apply Momentum Filters (⚡️)
RSI Filter: Measures recent strength—only allow longs when RSI crosses above its smoothed average, and shorts when RSI dips below the oversold threshold.
ADX Filter: Gauges trend strength—ensures we only enter when a meaningful trend exists (optional).
ATR Filter: Confirms volatility—avoids choppy, low-volatility conditions by requiring ATR to exceed its smoothed value (optional).
Confirm Entry Conditions (✅)
Long Entry:
Price is above both MAs
Trend alignment & optional filters pass ✅
Short Entry:
Price is below both MAs and below the lower Bollinger Band
RSI is sufficiently oversold
Trend-blocker & ATR filter pass ✅
Position Sizing & Risk (💰)
Each trade uses 100 % of account equity by default.
One pyramid addition allowed, so you can scale in if the move continues.
Commission and slippage assumptions built in for realistic backtests.
Stops & Exits (🛑)
Long Stop-Loss: e.g. 3 % below entry.
Long Auto-Exit: If price falls back under the 500-period MA.
Short Stop-Loss: e.g. 3 % above entry.
Short Take-Profit: e.g. 4 % below entry.
🎨 Why It’s Powerful & Customizable
Modular Filters: Turn on/off RSI, ADX, ATR filters to suit different market regimes.
Adjustable Thresholds: Fine-tune stop-loss %, take-profit %, RSI lengths, MA gaps and more.
Multi-Timeframe Potential: Although coded for 3 h BTC, you can adapt it to stocks, forex or other cryptos—just recalibrate!
Backtest Fine-Tuned: Default settings were optimized via backtesting on historical BTC data—but they’re not guarantees of future performance.
⚠️ Warning & Disclaimer
This strategy is for educational purposes only and designed for a toy fund. Crypto markets are highly volatile—you can lose 100 % of your capital. It is not a predictive “holy grail” but a rules-based framework using past data. The parameters have been fine-tuned on historical data and are not valid for future trades without fresh calibration. Always practice with paper-trading first, use proper risk management, and do your own research before risking real money. 🚨🔒
Good luck exploring and experimenting! 🚀📊
Dual Stochastic Enhanced (with Presets giua64)Script Title: Dual Stochastic Enhanced (with Presets giua64)
Overview:
This indicator enhances the traditional Dual Stochastic strategy, aiming to provide more filtered and potentially reliable trading signals. By integrating dynamic overbought/oversold levels via Bollinger Bands on the slow stochastic, a trend filter based on a moving average, momentum confirmation via RSI, and user-friendly selectable presets, "Dual Stochastic Enhanced" seeks to offer a more robust approach to identifying potential entry points.
Key Features:
Dual Stochastics: Utilizes a slow stochastic (configurable, e.g., 14 periods) as a context filter and a fast stochastic (configurable, e.g., 5 periods) as a signal trigger.
Bollinger Bands on Slow Stochastic: Instead of fixed overbought/oversold levels (80/20), Bollinger Bands are applied to the %K line of the slow stochastic. This creates dynamic zones that adapt to the stochastic's own volatility.
Trend Filter: A moving average (configurable type and length, e.g., EMA 100 as seen in the example chart for general context) on the price helps filter signals, allowing only trades aligned with the prevailing trend.
RSI Confirmation: An RSI oscillator (configurable length, e.g., 14 periods) is used to confirm momentum. Signals require the RSI to cross certain thresholds to validate the strength of the move.
User Presets: Includes presets for "Scalping," "Intraday," and "Swing trading," which quickly set all key parameters to suit different styles and timeframes. A "Custom" option is also available for full manual configuration.
Clear Visual Signals: Long (green) and Short (red) arrows appear on the chart when all entry conditions are met.
Active Zone Highlighting: The background of the indicator panel changes color (green or red) when "active zone" conditions (a combination of stochastics, trend, and RSI) are favorable.
Information Panel: A table in the top-right corner of the indicator panel displays the current status of the selected preset, trend filter, RSI value, and stochastic levels.
Signal Logic:
A LONG signal is generated when:
The fast stochastic %K crosses above its %D line.
The slow stochastic %K line is below its lower Bollinger Band (dynamic oversold condition).
The fast stochastic %K line is also in a low area (e.g., <25) to confirm the trigger is not premature.
The closing price is above the trend moving average (uptrend).
The RSI is above its long confirmation level (e.g., >40), indicating sufficient bullish momentum.
A SHORT signal is generated when:
The fast stochastic %K crosses below its %D line.
The slow stochastic %K line is above its upper Bollinger Band (dynamic overbought condition).
The fast stochastic %K line is also in a high area (e.g., >75).
The closing price is below the trend moving average (downtrend).
The RSI is below its short confirmation level (e.g., <60), indicating sufficient bearish momentum.
How to Use:
Select a Preset suitable for your trading style and the timeframe you are analyzing (e.g., Scalping for M1-M15, Intraday for M5-H1, Swing for H4-D1).
Alternatively, choose "Custom" and manually adjust all parameters (stochastic lengths, smoothing, Bollinger Bands, Moving Average, RSI, confirmation thresholds).
Observe the Information Panel for a quick understanding of the current conditions.
Evaluate the arrow signals, always considering the broader market context, price action, and any other confluences (supports/resistances, chart patterns).
The background highlighting can help quickly identify periods where conditions are aligned for potential trades.
Disclaimer:
This script is provided for educational and informational purposes only. Trading involves significant risk, and past performance is not indicative of future results. Always thoroughly test any strategy or indicator on historical data and on a demo account before risking real capital. The author assumes no responsibility for any losses incurred from the use of this script.
Author: giua64
CVD VWAP (1m CVD, Daily/Weekly + EMA + WMA)🟠 CVD VWAP (1m CVD, Daily/Weekly + EMA + WMA)
This custom indicator combines Cumulative Volume Delta (CVD) with a VWAP-style calculation, built on 1-minute resolution data, and includes smoothed trend analysis via EMA and WMA.
🔍 Key Features:
1-Minute CVD Calculation:
Captures buying vs. selling pressure by comparing close vs. open price per minute.
CVD-Based VWAP:
A custom VWAP that uses CVD instead of price, reset Daily or Weekly (user-selectable). This helps identify volume-weighted mean "pressure" rather than price-weighted mean value.
Smoothed Trend Lines:
EMA (Exponential Moving Average): Applied to the CVD to show short-term momentum shifts.
WMA (Weighted Moving Average): Highlights trend strength and sensitivity with adjustable period, thickness, and color.
Flexible Visuals:
Adjustable thickness for each line.
Displayed in a separate pane for clear analysis, independent of price action.
⚙️ Inputs:
VWAP Reset Mode: Choose between Daily or Weekly reset.
EMA Period & Thickness
WMA Period, Color & Thickness
🧠 Use Cases:
Detect divergence between price and CVD-based VWAP.
Monitor trend alignment via CVD, EMA, and WMA.
Evaluate volume-driven moves, especially during session opens or key volume spikes.
💡 Ideal for traders focused on volume-based analysis, order flow insights, or those looking to enhance VWAP strategies using a more nuanced approach with CVD.
Volume-Weighted SMI with Divergence Alerts📊 Volume-Weighted SMI with Divergence Alerts
This indicator is a modified version of the Stochastic Momentum Index (SMI) that incorporates volume-weighting to give more significance to price movements during high-volume periods. It also includes optional divergence alerts for improved signal precision.
🔍 Key Features:
Volume-Weighted SMI: Enhances the traditional SMI by amplifying signals during high-volume conditions.
WMA Smoothing: Applies a weighted moving average for clearer trend structure.
Custom Thresholds: Adjustable upper and lower bounds (default ±80) to identify overbought/oversold zones.
Divergence Alerts:
Detects bullish divergence (price makes lower lows, SMI makes higher lows).
Detects bearish divergence (price makes higher highs, SMI makes lower highs).
Sends alerts without plotting markers to keep your chart clean.
⚙️ Inputs:
SMI Length: Lookback for high/low range.
K Smoothing: Smooths the volume-weighted SMI signal.
WMA Length: Period of the WMA applied to the smoothed SMI.
Upper/Lower Threshold: Custom levels for signal zones.
Pivot Lookback: Defines the swing structure used in divergence detection.
🔔 Alerts:
Set a TradingView alert on:
“Any alert() function call”
to receive real-time divergence notifications (bullish or bearish) directly from the indicator.
🧠 How to Use:
Look for crossovers of the WMA with the SMI line to confirm shifts in momentum.
Use threshold levels for overbought/oversold identification.
Watch for divergence alerts to anticipate potential reversals or exhaustion.
Volume and Volatility Ratio Indicator-WODI策略名称
交易量与波动率比例策略-WODI
一、用户自定义参数
vol_length:交易量均线长度,计算基础交易量活跃度。
index_short_length / index_long_length:指数短期与长期均线长度,用于捕捉中短期与中长期趋势。
index_magnification:敏感度放大倍数,调整指数均线的灵敏度。
index_threshold_magnification:阈值放大因子,用于动态过滤噪音。
lookback_bars:形态检测回溯K线根数,用于捕捉反转模式。
fib_tp_ratio / fib_sl_ratio:斐波那契止盈与止损比率,分别对应黄金分割(0.618/0.382 等)级别。
enable_reversal:反转信号开关,开启后将原有做空信号反向为做多信号,用于单边趋势加仓。
二、核心计算逻辑
交易量百分比
使用 ta.sma 计算 vol_ma,并得到 vol_percent = volume / vol_ma * 100。
价格波动率
volatility = (high – low) / close * 100。
构建复合指数
volatility_index = vol_percent * volatility,并分别计算其短期与长期均线(乘以 index_magnification)。
动态阈值
index_threshold = index_long_ma * index_threshold_magnification,过滤常规波动。
三、信号生成与策略执行
做多/做空信号
当短期指数均线自下而上突破长期均线,且 volatility_index 突破 index_threshold 时,发出做多信号。
当短期指数均线自上而下跌破长期均线,且 volatility_index 跌破 index_threshold 时,发出做空信号。
反转信号模式(可选)
若 enable_reversal = true,则所有做空信号反向为做多,用于在强趋势行情中加仓。
止盈止损管理
进场后自动设置斐波那契止盈位(基于入场价 × fib_tp_ratio)和止损位(入场价 × fib_sl_ratio)。
支持多级止盈:可依次以 0.382、0.618 等黄金分割比率分批平仓。
四、图表展示
策略信号标记:图上用箭头标明每次做多/做空(或反转加仓)信号。
斐波那契区间:在K线图中显示止盈/止损水平线。
复合指数与阈值线:与原版相同,在独立窗口绘制短、长期指数均线、指数曲线及阈值。
量能柱状:高于均线时染色,反转模式时额外高亮。
Strategy Name
Volume and Volatility Ratio Strategy – WODI
1. User-Defined Parameters
vol_length: Length for volume SMA.
index_short_length / index_long_length: Short and long MA lengths for the composite index.
index_magnification: Sensitivity multiplier for index MAs.
index_threshold_magnification: Threshold multiplier to filter noise.
lookback_bars: Number of bars to look back for pattern detection.
fib_tp_ratio / fib_sl_ratio: Fibonacci take-profit and stop-loss ratios (e.g. 0.618, 0.382).
enable_reversal: Toggle for reversal mode; flips short signals to long for trend-following add-on entries.
2. Core Calculation
Volume Percentage:
vol_ma = ta.sma(volume, vol_length)
vol_percent = volume / vol_ma * 100
Volatility:
volatility = (high – low) / close * 100
Composite Index:
volatility_index = vol_percent * volatility
Short/long MAs applied and scaled by index_magnification.
Dynamic Threshold:
index_threshold = index_long_ma * index_threshold_magnification.
3. Signal Generation & Execution
Long/Short Entries:
Long when short MA crosses above long MA and volatility_index > index_threshold.
Short when short MA crosses below long MA and volatility_index < index_threshold.
Reversal Mode (optional):
If enable_reversal is on, invert all short entries to long to scale into trending moves.
Fibonacci Take-Profit & Stop-Loss:
Automatically set TP/SL levels at entry price × respective Fibonacci ratios.
Supports multi-stage exits at 0.382, 0.618, etc.
4. Visualization
Signal Arrows: Marks every long/short or reversal-add signal on the chart.
Fibonacci Zones: Plots TP/SL lines on the price panel.
Index & Threshold: Same as v1.0, with MAs, index curve, and threshold in a separate sub-window.
Volume Bars: Colored when above vol_ma; extra highlight if a reversal-add signal triggers
Supertrend with Volume Filter AlertSupertrend with Volume Filter Alert - Indicator Overview
What is the Supertrend Indicator?
The Supertrend indicator is a popular trend-following tool used by traders to identify the direction of the market and potential entry/exit points. It is based on the Average True Range (ATR), which measures volatility, and plots a line on the chart that acts as a dynamic support or resistance level. When the price is above the Supertrend line, it signals an uptrend (bullish), and when the price is below, it indicates a downtrend (bearish). The indicator is particularly effective in trending markets but can generate false signals during choppy or sideways conditions.
How This Script Works
The "Supertrend with Volume Filter Alert" enhances the classic Supertrend indicator by adding a customizable volume filter to improve signal reliability.
Here's how it functions:
Supertrend Calculation:The Supertrend is calculated using the ATR over a user-defined period (default: 55) and a multiplier (default: 1.85). These parameters control the sensitivity of the indicator:A higher ATR period smooths out volatility, making the indicator less reactive to short-term price fluctuations.The multiplier determines the distance of the Supertrend line from the price, affecting how quickly it responds to trend changes.The script plots the Supertrend line in cyan for uptrends and red for downtrends, making it easy to visualize the market direction.
Volume Filter:A key feature of this script is the volume filter, which helps filter out false signals in choppy markets. The filter compares the current volume to the average volume over a lookback period (default: 20) and only triggers signals if the volume exceeds the average by a specified multiplier (default: 2.0).This ensures that trend changes are accompanied by significant market participation, increasing the likelihood of a genuine trend shift.
Signals and Alerts:
Buy signals (cyan triangle below the bar) are generated when the price crosses above the Supertrend line (indicating an uptrend) and the volume condition is met.Sell signals (red triangle above the bar) are generated when the price crosses below the Supertrend line (indicating a downtrend) and the volume condition is met.Alerts are set up for both buy and sell signals, notifying traders only when the volume filter confirms the trend change.
Customizable Settings for Multiple Markets
The default settings in this script (ATR Period: 55, ATR Multiplier: 1.85, Volume Lookback Period: 20, Volume Multiplier: 2.0) were carefully chosen to provide a balance of sensitivity and reliability across various markets, including stocks, indices (like the S&P 500), forex, and cryptocurrencies.
Here's why these settings work well:
ATR Period (55): A longer ATR period smooths out volatility, making the indicator less prone to whipsaws in volatile markets like crypto or forex, while still being responsive enough for trending markets like indices.
ATR Multiplier (1.85): This multiplier strikes a balance between capturing early trend changes and avoiding noise. A smaller multiplier would make the indicator too sensitive, while a larger one might miss early opportunities.
Volume Lookback Period (20): A 20-bar lookback for volume averaging provides a robust baseline for identifying significant volume spikes, adaptable to both short-term (e.g., daily charts) and longer-term (e.g., weekly charts) timeframes.
Volume Multiplier (2.0): Requiring volume to be at least 2x the average ensures that only high-conviction moves trigger signals, which is crucial for markets with varying liquidity levels.
These parameters are fully customizable, allowing traders to adjust the indicator to their specific market, timeframe, or trading style. For example, you might reduce the ATR period for faster-moving markets or increase the volume multiplier for more conservative signal filtering.
How the Volume Filter Reduces Bad Trades in Choppy Markets
One of the main drawbacks of the Supertrend indicator is its tendency to generate false signals during choppy or ranging markets, where price fluctuates without a clear trend. The volume filter in this script addresses this issue by ensuring that trend changes are backed by significant market activity:
In choppy markets, price movements often lack strong volume, leading to false breakouts or reversals. By requiring volume to be a multiple (default: 2x) of the average volume over the lookback period, the script filters out these low-volume, low-conviction moves.This reduces the likelihood of taking bad trades during sideways markets, as only trend changes with strong volume confirmation will trigger signals. For example, on a daily chart of the S&P 500, a buy signal will only fire if the price crosses above the Supertrend line and the volume on that day is at least twice the 20-day average, indicating genuine buying pressure.
Usage Tips
Markets and Timeframes: This indicator is versatile and can be used on various assets (stocks, indices, forex, crypto) and timeframes (1-minute, 1-hour, daily, etc.). Adjust the settings based on the market's volatility and your trading strategy.
Combine with Other Indicators: While the volume filter improves reliability, consider using additional indicators like RSI or MACD to confirm trends, especially in ranging markets.
Backtesting: Test the indicator on historical data for your chosen market to optimize the settings and ensure they align with your trading goals.
Alerts: Set up alerts for buy and sell signals to stay informed of high-probability trend changes without constantly monitoring the chart.
ConclusionThe "Supertrend with Volume Filter Alert" is a powerful tool for trend-following traders, combining the simplicity of the Supertrend indicator with a volume-based filter to enhance signal accuracy. Its customizable settings make it adaptable to multiple markets, while the volume filter helps reduce false signals in choppy conditions, allowing traders to focus on high-probability trades. Whether you're trading stocks, indices, forex, or crypto, this indicator can help you identify trends with greater confidence.
Ultimate Volatility CloudUltimate Volatility Cloud
The Ultimate Volatility Cloud is a powerful and highly customizable indicator designed to help traders visualize market volatility, easily identify trend, and overextended moves in price with adaptive bands. It combines the strengths of the Arnaud Legoux Moving Average, Kaufman's Adaptive Moving Average, ATR Channels, and Standard Deviation bands, offering multiple pre-configured profiles and extensive customization options.
Key Features:
Dynamic Volatility Bands: The indicator plots multiple layers of volatility bands around a central basis line, providing a comprehensive view of price deviation.
Hybrid Band Calculation: Bands are a sophisticated blend of Keltner Channels, KAMA ATR Channels and Standard Deviation, allowing for a nuanced representation of volatility.
Adaptive Smoothing: Bands are smoothed using either Exponential Moving Average (EMA) or Kaufman's Adaptive Moving Average (KAMA) based on the selected profile, ensuring responsiveness tailored to market conditions.
Layered Fills: The cloud uses distinct color fills for different volatility levels, making it easy to visually interpret price action relative to its typical range.
Customizable Color Themes: Choose from a variety of pre-set color themes, including "Rainbow," "Wild," and "Monochrome," or stick with classic options to suit your visual preference.
Optional Basis Line Plots: Display the EMA or KAMA basis lines (used in Keltner Channel calculations) separately on the chart for additional analysis.
Understanding the Profiles:
The indicator comes with several pre-configured "Settings Profiles" that adjust the internal parameters (Keltner Channel/KAMA Channel/Standard Deviation band blend, and band smoothing) to suit different trading styles or market environments.
1. Standard Profile:
Blend: 60% Keltner Channel, 40% Standard Deviation.
Smoothing: EMA smoothing of 3 periods.
Purpose: A balanced, general-purpose profile suitable for a wide range of market conditions. It offers a good blend of trend following and volatility awareness.
2. Responsive Profile:
Blend: 40% Keltner Channel, 60% Standard Deviation.
Smoothing: EMA smoothing of 2 period.
Purpose: Designed for traders who need quick reactions to price changes. The higher Standard Deviation blend and minimal smoothing make it highly sensitive to immediate volatility shifts, ideal for short-term analysis or identifying early moves.
3. Ranging Market Profile:
Blend: 80% KAMA ATR Channel, 20% Standard Deviation.
Smoothing: KAMA smoothing.
Purpose: Optimized for sideways or consolidating markets. By utilizing KAMA-based ATR bands and KAMA for band smoothing, this profile adapts its responsiveness to reduce whipsaws in choppy conditions, providing clearer boundaries for range-bound price action.
4. Trend Following Profile:
Blend: 90% Keltner Channel, 10% Standard Deviation.
Smoothing: EMA smoothing of 5 periods.
Purpose: Tailored for riding strong trends. The heavy emphasis on the Keltner Channel and slightly smoother bands help filter out minor fluctuations, allowing traders to focus on the dominant directional movement.
5. Conservative Profile:
Blend: 65% KAMA ATR Channel, 35% Standard Deviation.
Smoothing: EMA smoothing of 10 periods.
Purpose: Aims to provide more filtered signals and reduce noise. The KAMA basis for the Keltner Channel combined with a longer EMA smoothing period offers a slower, more confirmed view of volatility, suitable for traders seeking higher conviction entries or exits.
Example of the Ranging Market Profile
How to Use:
The volatility cloud can be interpreted in various ways:
Price within the inner bands: May indicate consolidation or a period of lower volatility.
Price pushing into outer bands: Suggests increasing volatility and potential for a strong move.
Price breaking out of extreme outer bands: Can signal significant momentum and the start or continuation of a strong trend.
Cloud expansion/contraction: Visually indicates periods of increasing or decreasing market energy.
Experiment with different profiles and settings to find the combination that best suits your trading strategy and the instruments you trade.
SOFR Spread (proxy: FEDFUNDS - US03MY)📊 SOFR Spread (Proxy: FEDFUNDS - US03MY) – Monitoring USD Money Market Liquidity
In 2008, the spread exhibits a sharp vertical spike, signaling a severe liquidity dislocation: investors rushed into short-term U.S. Treasuries, pushing their yields down dramatically, while the FEDFUNDS rate remained relatively high.
This behavior indicates extreme systemic stress in the interbank lending market, preceding massive Federal Reserve interventions such as rate cuts, emergency liquidity operations, and the launch of quantitative easing (QE).
Description:
This indicator plots the spread between the Effective Federal Funds Rate (FEDFUNDS) and the 3-Month US Treasury Bill yield (US03MY), used here as a proxy for the SOFR spread.
It serves as a simple yet powerful tool to detect liquidity dislocations and stress signals in the US short-term funding markets.
Interpretation:
🔴 Spread > 0.20% → Possible liquidity stress: elevated repo rates, cash shortage, interbank distrust.
🟡 Spread ≈ 0% → Normal market conditions, balanced liquidity.
🟢 Spread < 0% → Excess liquidity: strong demand for T-Bills, “flight to safety”, or distortion due to expansionary monetary policy.
Ideal for:
Monitoring Fed policy impact
Anticipating market-wide liquidity squeezes
Correlation with DXY, SPX, VIX, MOVE Index, and risk sentiment
🧠 Note: As SOFR is not directly available on TradingView, FEDFUNDS is used as a reliable proxy, closely tracking the same trends in most macro conditions.
Big Mover Catcher BTC 4h🧠 Big Mover Catcher (BTC 4H Strategy) — Educational Tool
⚠️ Disclaimer: I am not a financial advisor. This script is for educational and testing purposes only. Cryptocurrency trading is highly volatile and involves significant risk. You can lose all of your invested capital.
📌 Overview
The Big Mover Catcher strategy is a work-in-progress trading system designed for Bitcoin (BTC) on the 4-hour chart. It aims to identify strong breakout moves by combining multiple technical indicators and conditions, allowing for high customization and filter-based confirmations.
This script is part of a personal project to learn Pine Script and backtesting on TradingView. It is currently in the testing and research phase.
🎯 Strategy Objective
Catch large, high-momentum breakout moves in the BTC market using:
Bollinger Band breakouts for entry signals
Momentum, volatility, and trend filters for trade confirmation
🧰 Features & Filters
The script provides a flexible set of filters that can be turned ON/OFF and adjusted directly from the settings panel:
✅ Entry Conditions
Price must break above or below Bollinger Bands
All selected filters must align before entry
🧪 Available Filters:
Relative Strength Index (RSI) with EMA/SMA smoothing
Average Directional Index (ADX) with EMA/SMA smoothing
Average True Range (ATR) with EMA/SMA smoothing
MACD Signal above or below zero
EMA 350 trend filter
ATR / ADX / RSI Threshold toggles for added control
🔥 Additional Feature:
Force Take Profit: Optionally closes the trade immediately if a candle closes with more than a defined % movement (default: 5%). This can help lock in quick profits during high volatility moves.
⚙️ Customizable Inputs
You can configure:
Stop loss percentage
All indicator lengths
Smoothing types (EMA/SMA)
Threshold activation toggles
Individual filter ON/OFF switches
This makes the strategy highly adaptable for educational exploration and optimization.
📊 Best Used For
Learning Pine Script and strategy structure
Testing filter combinations for BTC on the 4H timeframe
Understanding how different indicators interact in live markets
⚠️ Note: ❌ Short trades are currently disabled by default, as short-side logic is still under development.
❗ Final Reminder
This script is not financial advice. It is an educational tool. Use it to learn and explore trading logic. Trading cryptocurrencies carries high risk — only invest what you can afford to lose.
Swing Highs and Lows Detector🔍 Swing Highs and Lows Detector
The Swing Highs and Lows Detector is a powerful tool for traders looking to identify meaningful structural shifts in price action, based on swing point logic and internal trend shifts.
📈 What It Does
This indicator automatically identifies and labels:
HH (Higher High) – Price broke above the previous swing high
LH (Lower High) – Price failed to break the previous high, signaling potential weakness
LL (Lower Low) – Price broke below the previous swing low
HL (Higher Low) – Price maintained a higher support level, indicating strength
The script distinguishes between bullish and bearish internal shifts and tracks the highest/lowest points between those shifts to determine the swing structure.
⚙️ How It Works
You can choose between two shift detection modes:
"Open": Compares closing price to the first open of the opposite streak
"High/Low": Uses the high of bearish or low of bullish candles
Once a shift is confirmed, the indicator scans the bars between shifts to find the most significant swing high or low
When a valid swing is detected, it’s labeled directly on the chart with color-coded markers
🛎️ Built-in Alerts
Set alerts for:
Higher High
Lower High
Lower Low
Higher Low
These alerts help you catch key structural shifts in real time — great for breakout traders, structure-based analysts, and smart money concepts (SMC) strategies.
✅ How to Use
Confirm Trend Strength or Reversals – Use HH/HL to confirm an uptrend, LL/LH to confirm a downtrend
Combine with Liquidity Sweeps or Zones – Ideal for SMC or Wyckoff-style setups
Entry/Exit Triggers – Use swing breaks to time entries or exits near key structural points
Statistical Pairs Trading IndicatorZ-Score Stat Trading — Statistical Pairs Trading Indicator
📊🔗
---
What is it?
Z-Score Stat Trading is a powerful indicator for statistical pairs trading and quantitative analysis of two correlated assets.
It calculates the Z-Score of the log-price spread between any two symbols you choose, providing both long-term and short-term Z-Score signals.
You’ll also see real-time correlation, volatility, spread, and the number of long/short signals in a handy on-chart table!
---
How to Use 🛠️
1. Add the indicator to your chart.
2. Select two assets (symbols) to analyze in the settings.
3. Watch the Z-Score plots (blue and orange lines) and threshold levels (+2, -2 by default).
4. Check the info table for:
- Correlation
- Volatility
- Spread
- Number of long (NL) and short (NS) signals in the last 1000 bars
5. Set up alerts for signal generation or threshold crossings if you want to be notified automatically.
---
Trading Strategy 💡
- This indicator is designed for statistical arbitrage (mean reversion) strategies.
- Long Signal (🟢):
When both Z-Scores drop below the negative threshold (e.g., -2), a long signal is generated.
→ Buy Symbol A, Sell Symbol B, expecting the spread to revert to the mean.
- Short Signal (🔴):
When both Z-Scores rise above the positive threshold (e.g., +2), a short signal is generated.
→ Sell Symbol A, Buy Symbol B, again expecting mean reversion.
- The info table helps you quickly assess the frequency of signals and the current statistical relationship between your chosen assets.
---
Best Practices & Warnings 🚦
- Avoid high leverage! Pairs trading can be risky, especially during periods of divergence. Use conservative position sizing.
- Check for cointegration: Before using this indicator, make sure both assets are cointegrated or have a strong historical relationship. This increases the reliability of mean reversion signals.
- Check correlation: Only use asset pairs with a high correlation (preferably 0.8–0.9 or higher) for best results. The correlation value is shown in the info table.
- Scale in and out gradually: When entering or exiting positions, consider doing so in parts rather than all at once. This helps manage slippage and risk, especially in volatile markets.
---
⚠️ Note on Performance:
This indicator may work a bit slowly, especially on large timeframes or long chart histories, because the calculation of NL and NS (number of long/short signals) is computationally intensive.
---
Disclaimer ⚠️
This script is provided for educational and informational purposes only .
It is not financial advice or a recommendation to buy or sell any asset.
Use at your own risk. The author assumes no responsibility for any trading decisions or losses.