Multi Bollinger Bands with Background FillMulti Bollinger Bands with Background Fill
多組帶狀背景布林通道
This indicator plots six independent Bollinger Bands channels on the price chart, each fully configurable with customizable period length, standard deviation, and colors for upper, lower, and middle bands. Users can choose to display or hide each channel and its middle band independently.
A distinctive feature of this tool is the option to enable colored background fills between paired Bollinger Bands (channels 1&2, 3&4, and 5&6) to visually highlight volatility zones, improving the clarity of price action and aiding in multi-timeframe volatility analysis.
Key Features:
Six independent Bollinger Bands channels with separate visibility toggles.
Adjustable length and standard deviation for each channel.
Option to display or hide the middle band (basis) for each channel.
Unique colored background fills between paired upper and lower bands for enhanced visual interpretation.
Custom color settings for each band and background for better differentiation.
This indicator is designed for traders looking for advanced multi-layered volatility insights and clearer visual guidance when analyzing price behavior across different timeframes. It is suitable for various trading strategies including trend analysis and volatility-based setups.
Indicators and strategies
VWAP & Breakout Volume ConfirmHow the TradingView Indicator Works (Explained Simply)
VWAP Line (Orange)
It plots the Volume Weighted Average Price for the day.
Price above VWAP = bullish zone
Price below VWAP = bearish zone
Volume Spike Detection (Red Triangle)
It calculates the average volume over the last 20 candles.
If the current volume is 1.5× that average, it plots a red triangle under the candle.
Helps confirm if a move has real momentum or not.
Breakout Confirmation (Green Label ‘BO’)
Checks if price breaks above the last 10-bar high (for upside breakout) or below the last 10-bar low (for downside breakout).
If a breakout happens and the volume spike is present, it plots a green “BO” label above the candle.
This tells you the breakout is strong and likely to follow through.
Bollinger Bands [LePasha]Bollinger Bands : Advanced Volatility Analysis Made Simple
Discover a refined take on Bollinger Bands that offers clearer market insights and deeper volatility understanding — perfect for traders seeking precision and confidence.
What Is the Bollinger Bands Indicator?
The Bollinger Bands indicator is a powerful, overlay chart tool designed to help traders visualize price volatility and identify potential market extremes more effectively.
Unlike classic Bollinger Bands which use just two standard deviation bands, this enhanced version employs multiple deviation levels around a simple moving average (SMA) to give a richer picture of market dynamics.
Key Features
Multiple Deviation Bands: Instead of only ±2 standard deviations, it uses three extended levels: 2.5, 3.0, and 3.5 standard deviations to highlight subtle and extreme price movements.
Color-coded Volatility Zones: Each band range is filled with translucent red or teal shades to help traders visually grasp the intensity of price moves.
Customizable Length and Toggle: Adjust the length of the bands and enable or disable the indicator easily through inputs.
Why Three Deviation Levels?
Traditional Bollinger Bands (±2 standard deviations) cover approximately 95% of price action, but markets often present significant moves beyond this range that are important to identify for better risk management and trading decisions.
The three deviation levels serve distinct purposes:
Deviation Level Approximate Purpose Market Insight Provided
±2.5 SD Captures strong but fairly common moves Entry/exit trigger zones for trending moves
±3.0 SD Highlights more extreme, less frequent moves Indicates breakout strength or overextension
±3.5 SD Marks rare and extreme price deviations Signals potential reversal or exhaustion
This graduated scale allows traders to differentiate between normal volatility, strong momentum, and possible exhaustion—making it easier to tailor trading decisions according to market context.
How to Use Bollinger Bands
Identify Volatility Zones:
Observe how price interacts with the colored bands:
Price touching or crossing the ±2.5 SD band may indicate a strong move is underway.
Price breaching the ±3.0 or ±3.5 SD bands signals rare, extreme market conditions, which could be either a breakout or a setup for reversal.
Combine With Trend Analysis:
Use in conjunction with trend indicators like moving averages or volume to confirm the direction or strength of moves indicated by the bands.
Adjust Your Stops and Targets:
The layered bands help you set more intelligent stop losses and take profit zones by understanding how far price can reasonably stray.
Visual Clarity for Market Phases:
The shaded fills between bands give intuitive visual cues of volatility expansion and contraction phases.
Why Traders Choose Bollinger Bands
Greater Precision: More nuanced volatility detection than traditional Bollinger Bands.
Visual Elegance: Soft translucent fills and clear band lines reduce clutter while delivering maximum insight.
User-Friendly: Easy to toggle and adjust with minimal setup.
Versatile: Effective across assets, timeframes, and trading styles.
Final Thoughts
The Bollinger Bands indicator is more than just a volatility tool — it's your visual guide to understanding how extreme price moves develop in real-time. Whether you’re entering new trades, managing risk, or hunting reversals, this indicator equips you with superior clarity and confidence.
Add Bollinger Bands to your TradingView toolkit and see volatility like never before.
Range Progress TrackerRANGE PROGRESS TRACKER(RPT)
PURPOSE
This indicator helps traders visually and statistically understand how much of the typical price range (measured by ATR) has already been covered in the current period (Daily, Weekly, or Monthly). It includes key features to assist in trend exhaustion analysis, reversal spotting, and smart alerting.
CORE LOGIC
The indicator calculates the current range of the selected time frame (e.g., Daily), which is:
Current Range = High - Low
This is then compared to the ATR (Average True Range) of the same time frame, which represents the average price movement range over a defined period (default is 14).
The comparison is expressed as a percentage, calculated with this formula:
Range % = (Current Range / ATR) × 100
This percentage shows how much of the “average expected move” has already occurred.
WHY IT MATTERS
When the current range approaches or exceeds 100% of ATR, it means the price has already moved as much as it typically does in a full session.
This indicates a lower probability of continuing the trend with a new high or low, especially when the price is already near the session's high or low.
This setup can signal:
A possible consolidation phase
A reversal in trend
The market entering a corrective phase
SMART ALERTS
The indicator can alert you when:
A new high is made after the range percentage exceeds your set threshold.
A new low is made after the range percentage exceeds your set threshold.
You can adjust the Range % Alert Threshold in the settings to tailor it to your trading style.
BG Ichimoku Tenkan MTFBG Ichimoku Tenkan MTF: Your Multi-Timeframe Trend Compass
Elevate your Ichimoku analysis with the BG Ichimoku Tenkan MTF indicator. This powerful tool provides a comprehensive view of the Tenkan-sen (Conversion Line) across multiple timeframes, helping you identify trends and potential shifts with greater clarity. It's ideal for all markets, including stocks, cryptocurrencies, Forex, and futures.
Key Features:
Main Tenkan-sen Plot: Visualize the Tenkan-sen for your active chart timeframe with adjustable color.
Multi-Timeframe Table: A dynamic table displays the Tenkan-sen's relationship to price (🔼 for above, 🔽 for below) and its current value for up to 7 timeframes.
Continuous MTF Lines: Plot the Tenkan-sen from higher timeframes directly on your current chart, providing clear support/resistance levels and trend confluence.
Fully Customizable Colors: Personalize the color for each individual timeframe in the table and for its corresponding MTF line, ensuring a clean and intuitive visual experience. You can also adjust the main Tenkan-sen color and the MTF line offset.
Gain a deeper understanding of market dynamics by analyzing the Tenkan-sen across different time scales, all in one intuitive indicator.
We created this indicator to help you better navigate the markets. Thank you for using it, and we hope it brings you value. Enjoy it in your daily analysis!
Bab
Multi BB (3/4/5 SD) - Separate AlertsThis script can be used to gauge momentum in the stocks and can be used on any instrument. Alerts can be put when Price crosses Bollinger Bands SD3 or 4 or 5 on either the Upper or Lower side.
This script is useful to understand the momentum and accordingly a trade can be taken on either the long side (when crossing the Upper Side) or Short Side (when crossing the Lower Side) with proper Stop Loss.
ka66: Triple Keltner Around SourceThis is an indicator-on-indicator which draws Keltner Bands (ATR Bands) around any selected Basis Source, instead of hardcoding a moving average, etc. This allows you to put bands around any sort of esoteric moving average of your choice, or even just around price data like OHLC, HLC3, and so on.
It's an enhancement on my prior Multi ATR Channels script at
Written in Pine v6 and allowing custom timeframe selection.
For example, the published chart shows the bands place around a Kaufman Adaptive Moving Average (KAMA), plotted in blue dots.
You would use it for anything that you would use plain Keltners for:
Mean Reversion
Breakouts
Take Profit and Stop Loss Estimation
But with any basis that you deem more suitable for your purposes.
EWMA & EWVar + EWStd Expansion with MTF_V.5EWMA & EWVar + EWStd Expansion with MTF_V.5
This indicator combines adaptive trend smoothing (EWMA), variance estimation (EWVar) and dynamic volatility “bursts” (EWStd Expansion) with optional higher-timeframe confirmation. It’s designed both for visual chart analysis and for automated alerts on regime changes.
Key Features
EWMA (Exponential Smoothing):
• Computes an exponential moving average with either a custom α or a length-derived α = 2/(N+1).
• Option to recalculate only every N bars (reduces CPU load).
EWVar & EWStd (Variance & Standard Deviation):
• Exponentially weighted variance tracks recent price dispersion.
• EWStd (σ) is computed alongside the EWMA.
• Z-score (deviation in σ units) shows how far price has diverged from trend.
Multi-Timeframe Filter (MTF):
• Optionally require the same trend direction on a chosen higher timeframe (e.g. Daily, Weekly, H4).
• Real-time lookahead available (may repaint).
Gradient Around EWMA:
• A multi-layer “glow” zone of ±1σ, broken into up to 10 steps.
• Color interpolates between “upper” and “lower” shades for bullish, bearish and neutral regimes.
Instantaneous Trendline (ITL):
• Ultra-fast trend filter with slope-based coloring.
• Highlights micro-trends and short-lived accelerations.
Cross-Over Signals (ITL ↔ EWMA):
• Up/down triangles plotted when the ITL crosses the main EWMA.
EWStd Expansion (Volatility Bursts):
• Automatically detects σ expansions (σ growth above a set % threshold).
• Price filter: only when price moves beyond EWMA ± (multiplier·σ).
• Optional higher-timeframe confirmation.
Labels & Alerts:
• Text labels and circular markers on bars where a volatility burst occurs.
• Built-in alertcondition calls for both bullish and bearish expansions.
How to Use
Visual Analysis:
• The gradient around EWMA shows the width of the volatility channel expanding or contracting.
• ITL color changes instantly highlight short-term impulses.
• EWMA line color switches (bullish/bearish/neutral) indicate trend state.
Spotting Volatility Breakouts:
• “EWStd Expansion” labels and circles signal the onset of strong moves when σ spikes.
• Useful for entering at the start of new impulses.
Automated Alerts:
• Set alerts on the built-in conditions “Bullish EWStd Expansion Alert” or “Bearish EWStd Expansion Alert” to receive a popup or mobile push when a burst occurs.
This compact tool unifies trend, volatility and multi-timeframe analysis into a single indicator—ideal for traders who want to see trend direction, current dispersion, and timely volatility burst signals all at once.
EMD Trend [InvestorUnknown]EMD Trend is a dynamic trend-following indicator that utilizes Exponential Moving Deviation (EMD) to build adaptive channels around a selected moving average. Designed for traders who value responsive trend signals with built-in volatility sensitivity, this tool highlights directional bias, market regime shifts, and potential breakout opportunities.
How It Works
Instead of using standard deviation, EMD Trend employs the exponential moving average of the absolute deviation from a moving average—producing smoother, faster-reacting upper and lower bounds:
Bullish (Risk-ON Long): Price crosses above the upper EMD band
Bearish (Risk-ON Short): Price crosses below the lower EMD band
Neutral: Price stays within the channel, indicating potential mean reversion or low momentum
Trend direction is defined by price interaction with these bands, and visual cues (color-coded bars and fills) help quickly identify market conditions.
Features
7 Moving Average Types: SMA, EMA, HMA, DEMA, TEMA, RMA, FRAMA
Custom Price Source: Choose close, hl2, ohlc4, or others
EMD Multiplier: Controls the width of the deviation envelope
Bar Coloring: Candles change color based on current trend
Intra-bar Signal Option: Enables faster updates (with optional repainting)
Speculative Zones: Fills highlight aggressive momentum moves beyond EMD bounds
Backtest Mode
Switch to Backtest Mode for performance evaluation over historical data:
Equity Curve Plot: Compare EMD Trend strategy vs. Buy & Hold
Trade Metrics Table: View number of trades, win/loss stats, profits
Performance Metrics Table: Includes CAGR, Sharpe, max drawdown, and more
Custom Start Date: Select from which date the backtest should begin
Trade Sizing: Configure capital and trade percentage per entry
Signal Filters: Choose from Long Only, Short Only, or Both
Alerts
Built-in alerts let you automate entries, exits, and trend transitions:
LONG (EMD Trend) - Trend flips to Long
SHORT (EMD Trend) - Trend flips to Short
RISK-ON LONG - Price crosses above upper EMD band
RISK-OFF LONG - Price crosses back below upper EMD band
RISK-ON SHORT - Price crosses below lower EMD band
RISK-OFF SHORT - Price crosses back above lower EMD band
Use Cases
Trend Confirmation with volatility-sensitive boundaries
Momentum Entry Filtering via breakout zones
Mean Reversion Avoidance in sideways markets
Backtesting & Strategy Building with real-time metrics
Disclaimer
This indicator is intended for informational and educational purposes only. It does not constitute investment advice. Historical performance does not guarantee future results. Always backtest and use in simulation before live trading.
Lorentzian Classification - Advanced Trading DashboardLorentzian Classification - Relativistic Market Analysis
A Journey from Theory to Trading Reality
What began as fascination with Einstein's relativity and Lorentzian geometry has evolved into a practical trading tool that bridges theoretical physics and market dynamics. This indicator represents months of wrestling with complex mathematical concepts, debugging intricate algorithms, and transforming abstract theory into actionable trading signals.
The Theoretical Foundation
Lorentzian Distance in Market Space
Traditional Euclidean distance treats all feature differences equally, but markets don't behave uniformly. Lorentzian distance, borrowed from spacetime geometry, provides a more nuanced similarity measure:
d(x,y) = Σ ln(1 + |xi - yi|)
This logarithmic formulation naturally handles:
Scale invariance: Large price moves don't overwhelm small but significant patterns
Outlier robustness: Extreme values are dampened rather than dominating
Non-linear relationships: Captures market behavior better than linear metrics
K-Nearest Neighbors with Relativistic Weighting
The algorithm searches historical market states for patterns similar to current conditions. Each neighbor receives weight inversely proportional to its Lorentzian distance:
w = 1 / (1 + distance)
This creates a "gravitational" effect where closer patterns have stronger influence on predictions.
The Implementation Challenge
Creating meaningful market features required extensive experimentation:
Price Features: Multi-timeframe momentum (1, 2, 3, 5, 8 bar lookbacks) Volume Features: Relative volume analysis against 20-period average
Volatility Features: ATR and Bollinger Band width normalization Momentum Features: RSI deviation from neutral and MACD/price ratio
Each feature undergoes min-max normalization to ensure equal weighting in distance calculations.
The Prediction Mechanism
For each current market state:
Feature Vector Construction: 12-dimensional representation of market conditions
Historical Search: Scan lookback period for similar patterns using Lorentzian distance
Neighbor Selection: Identify K nearest historical matches
Outcome Analysis: Examine what happened N bars after each match
Weighted Prediction: Combine outcomes using distance-based weights
Confidence Calculation: Measure agreement between neighbors
Technical Hurdles Overcome
Array Management: Complex indexing to prevent look-ahead bias
Distance Calculations: Optimizing nested loops for performance
Memory Constraints: Balancing lookback depth with computational limits
Signal Filtering: Preventing clustering of identical signals
Advanced Dashboard System
Main Control Panel
The primary dashboard provides real-time market intelligence:
Signal Status: Current prediction with confidence percentage
Neighbor Analysis: How many historical patterns match current conditions
Market Regime: Trend strength, volatility, and volume analysis
Temporal Context: Real-time updates with timestamp
Performance Analytics
Comprehensive tracking system monitors:
Win Rate: Percentage of successful predictions
Signal Count: Total predictions generated
Streak Analysis: Current winning/losing sequence
Drawdown Monitoring: Maximum equity decline
Sharpe Approximation: Risk-adjusted performance estimate
Risk Assessment Panel
Multi-dimensional risk analysis:
RSI Positioning: Overbought/oversold conditions
ATR Percentage: Current volatility relative to price
Bollinger Position: Price location within volatility bands
MACD Alignment: Momentum confirmation
Confidence Heatmap
Visual representation of prediction reliability:
Historical Confidence: Last 10 periods of prediction certainty
Strength Analysis: Magnitude of prediction values over time
Pattern Recognition: Color-coded confidence levels for quick assessment
Input Parameters Deep Dive
Core Algorithm Settings
K Nearest Neighbors (1-20): More neighbors create smoother but less responsive signals. Optimal range 5-8 for most markets.
Historical Lookback (50-500): Deeper history improves pattern recognition but reduces adaptability. 100-200 bars optimal for most timeframes.
Feature Window (5-30): Longer windows capture more context but reduce sensitivity. Match to your trading timeframe.
Feature Selection
Price Changes: Essential for momentum and reversal detection Volume Profile: Critical for institutional activity recognition Volatility Measures: Key for regime change detection Momentum Indicators: Vital for trend confirmation
Signal Generation
Prediction Horizon (1-20): How far ahead to predict. Shorter horizons for scalping, longer for swing trading.
Signal Threshold (0.5-0.9): Confidence required for signal generation. Higher values reduce false signals but may miss opportunities.
Smoothing (1-10): EMA applied to raw predictions. More smoothing reduces noise but increases lag.
Visual Design Philosophy
Color Themes
Professional: Corporate blue/red for institutional environments Neon: Cyberpunk cyan/magenta for modern aesthetics
Matrix: Green/red hacker-inspired palette Classic: Traditional trading colors
Information Hierarchy
The dashboard system prioritizes information by importance:
Primary Signals: Largest, most prominent display
Confidence Metrics: Secondary but clearly visible
Supporting Data: Detailed but unobtrusive
Historical Context: Available but not distracting
Trading Applications
Signal Interpretation
Long Signals: Prediction > threshold with high confidence
Look for volume confirmation
- Check trend alignment
- Verify support levels
Short Signals: Prediction < -threshold with high confidence
Confirm with resistance levels
- Check for distribution patterns
- Verify momentum divergence
- Market Regime Adaptation
Trending Markets: Higher confidence in directional signals
Ranging Markets: Focus on reversal signals at extremes
Volatile Markets: Require higher confidence thresholds
Low Volume: Reduce position sizes, increase caution
Risk Management Integration
Confidence-Based Sizing: Larger positions for higher confidence signals
Regime-Aware Stops: Wider stops in volatile regimes
Multi-Timeframe Confirmation: Align signals across timeframes
Volume Confirmation: Require volume support for major signals
Originality and Innovation
This indicator represents genuine innovation in several areas:
Mathematical Approach
First application of Lorentzian geometry to market pattern recognition. Unlike Euclidean-based systems, this naturally handles market non-linearities.
Feature Engineering
Sophisticated multi-dimensional feature space combining price, volume, volatility, and momentum in normalized form.
Visualization System
Professional-grade dashboard system providing comprehensive market intelligence in intuitive format.
Performance Tracking
Real-time performance analytics typically found only in institutional trading systems.
Development Journey
Creating this indicator involved overcoming numerous technical challenges:
Mathematical Complexity: Translating theoretical concepts into practical code
Performance Optimization: Balancing accuracy with computational efficiency
User Interface Design: Making complex data accessible and actionable
Signal Quality: Filtering noise while maintaining responsiveness
The result is a tool that brings institutional-grade analytics to individual traders while maintaining the theoretical rigor of its mathematical foundation.
Best Practices
- Parameter Optimization
- Start with default settings and adjust based on:
Market Characteristics: Volatile vs. stable
Trading Timeframe: Scalping vs. swing trading
Risk Tolerance: Conservative vs. aggressive
Signal Confirmation
Never trade on Lorentzian signals alone:
Price Action: Confirm with support/resistance
Volume: Verify with volume analysis
Multiple Timeframes: Check higher timeframe alignment
Market Context: Consider overall market conditions
Risk Management
Position Sizing: Scale with confidence levels
Stop Losses: Adapt to market volatility
Profit Targets: Based on historical performance
Maximum Risk: Never exceed 2-3% per trade
Disclaimer
This indicator is for educational and research purposes only. It does not constitute financial advice or guarantee profitable trading results. The Lorentzian classification system reveals market patterns but cannot predict future price movements with certainty. Always use proper risk management, conduct your own analysis, and never risk more than you can afford to lose.
Market dynamics are inherently uncertain, and past performance does not guarantee future results. This tool should be used as part of a comprehensive trading strategy, not as a standalone solution.
Bringing the elegance of relativistic geometry to market analysis through sophisticated pattern recognition and intuitive visualization.
Thank you for sharing the idea. You're more than a follower, you're a leader!
@vasanthgautham1221
Trade with precision. Trade with insight.
— Dskyz , for DAFE Trading Systems
RMSD Trend [InvestorUnknown]RMSD Trend is a trend-following indicator that utilizes Root Mean Square Deviation (RMSD) to dynamically construct a volatility-weighted trend channel around a selected moving average. This indicator is designed to enhance signal clarity, minimize noise, and offer quantitative insights into market momentum, ideal for both discretionary and systematic traders.
How It Works
At its core, RMSD Trend calculates a deviation band around a selected moving average using the Root Mean Square Deviation (similar to standard deviation but with squared errors), capturing the magnitude of price dispersion over a user-defined period. The logic is simple:
When price crosses above the upper deviation band, the market is considered bullish (Risk-ON Long).
When price crosses below the lower deviation band, the market is considered bearish (Risk-ON Short).
If price stays within the band, the market is interpreted as neutral or ranging, offering low-risk decision zones.
The indicator also generates trend flips (Long/Short) based on crossovers and crossunders of the price and the RMSD bands, and colors candles accordingly for enhanced visual feedback.
Features
7 Moving Average Types: Choose between SMA, EMA, HMA, DEMA, TEMA, RMA, and FRAMA for flexibility.
Customizable Source Input: Use price types like close, hl2, ohlc4, etc.
Volatility-Aware Channel: Adjustable RMSD multiplier determines band width based on volatility.
Smart Coloring: Candles and bands adapt their colors to reflect trend direction (green for bullish, red for bearish).
Intra-bar Repainting Toggle: Option to allow more responsive but repaintable signals.
Speculation Fill Zones: When price exceeds the deviation channel, a semi-transparent fill highlights potential momentum surges.
Backtest Mode
Switching to Backtest Mode unlocks a robust suite of simulation features:
Built-in Equity Curve: Visualizes both strategy equity and Buy & Hold performance.
Trade Metrics Table: Displays the number of trades, win rates, gross profits/losses, and long/short breakdowns.
Performance Metrics Table: Includes key stats like CAGR, drawdown, Sharpe ratio, and more.
Custom Date Range: Set a custom start date for your backtest.
Trade Sizing: Simulate results using position sizing and initial capital settings.
Signal Filters: Choose between Long & Short, Long Only, or Short Only strategies.
Alerts
The RMSD Trend includes six built-in alert conditions:
LONG (RMSD Trend) - Trend flips from Short to Long
SHORT (RMSD Trend) - Trend flips from Long to Short
RISK-ON LONG (RMSD Trend) - Price crosses above upper RMSD band
RISK-OFF LONG (RMSD Trend) - Price falls back below upper RMSD band
RISK-ON SHORT (RMSD Trend) - Price crosses below lower RMSD band
RISK-OFF SHORT (RMSD Trend) - Price rises back above lower RMSD band
Use Cases
Trend Confirmation: Confirms directional bias with RMSD-weighted confidence zones.
Breakout Detection: Highlights moments when price breaks free from historical volatility norms.
Mean Reversion Filtering: Avoids false signals by incorporating RMSD’s volatility sensitivity.
Strategy Development: Backtest your signals or integrate with a broader system for alpha generation.
Settings Summary
Display Mode: Overlay (default) or Backtest Mode
Average Type: Choose from SMA, EMA, HMA, DEMA, etc.
Average Length: Lookback window for moving average
RMSD Multiplier: Band width control based on RMS deviation
Source: Input price source (close, hl2, ohlc4, etc.)
Intra-bar Updating: Real-time updates (may repaint)
Color Bars: Toggle bar coloring by trend direction
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Past performance, including backtest results, is not indicative of future results. Use with caution and always test thoroughly before live deployment.
Trailing Stop Loss [TradingFinder] 4 Machine Learning Methods🔵 Introduction
The trailing stop indicator dynamically adjusts stop-loss (SL) levels to lock in profits as price moves favorably. It uses pivot levels and ATR to set optimal SL points, balancing risk and reward.
Trade confirmation filters, a key feature, ensure entries align with market conditions, reducing false signals. In 2023 a study showed filtered entries improve win rates by 15% in forex. This enhances trade precision.
SL settings, ranging from very tight to very wide, adapt to volatility via ATR calculations. These settings anchor SL to previous pivot levels, ensuring alignment with market structure. This caters to diverse trading styles, from scalping to swing trading.
The indicator colors the profit zone between the entry point (EP) and SL, using light green for buy trades and light red for sell trades. This visual cue highlights profit potential. It’s ideal for traders seeking dynamic risk management.
A table displays real-time trade details, including EP, SL, and profit/loss (PNL). Backtests show trailing stops cut losses by 20% in trending markets. This transparency aids decision-making.
🔵 How to Use
🟣 SL Levels
The trailing stop indicator sets SL based on pivot levels and ATR, offering four options: very tight, tight, wide, or very wide. Very tight SLs suit scalpers, while wide SLs fit swing traders. Select the base level to match your strategy.
If price hits the SL, the trade closes, and the indicator evaluates the next trade using the selected filter. This ensures disciplined trade management. The cycle restarts with a new confirmed entry.
Very tight SLs, set near recent pivots, trigger exits early to minimize risk but limit profits in volatile markets. Wide SLs, shown as farther lines, allow more price movement but increase exposure to losses. Adjust based on ATR and conditions, noting SL breaches open new positions.
🟣 Visualization
The indicator’s visual cues, like colored profit zones, simplify monitoring, with light green showing the profit area from EP to trailed SL. Dashed lines mark entry points, while solid lines track the trailed SL, triggering new positions when breached.
When price moves into profit, the area between EP and SL is colored—light green for longs, light red for shorts. This highlights the profit zone visually. The SL trails price, locking in gains as the trade progresses.
🟣 Filters
Upon trade entry, the indicator requires confirmation via filters like SMA 2x or ADX to validate momentum. Filters reduce false entries, though no guarantee exists for improved outcomes. Monitor price action post-entry for trade validity.
Filters like Momentum or ADX assess trend strength before entry. For example, ADX above 25 confirms strong trends. Choose “none” for unfiltered entries.
🟣 Bullish Alert
For a bullish trade, the indicator opens a long position with a green SL Line (after optional filters), trailing the SL below price. Set alerts to On in the settings for notifications, or Off to monitor manually.
🟣 Bearish Alert
In a bearish trade, the indicator opens a short position with a red SL Line post-confirmation, trailing the SL above price. With alerts On in the settings, it notifies the potential reversal.
🟣 Panel
A table displays all trades’ details, including Win Rates, PNL, and trade status. This real-time data aids in tracking performance. Check the table to assess trade outcomes instantly.
Review the table regularly to evaluate trade performance and adjust settings. Consistent monitoring ensures alignment with market dynamics. This maximizes the indicator’s effectiveness.
🔵 Settings
Length (Default: 10) : Sets the pivot period for calculating SL levels, balancing sensitivity and reliability.
Base Level : Options (“Very tight,” “Tight,” “Wide,” “Very wide”) adjust SL distance via ATR.
Show EP Checkbox : Toggles visibility of the entry point on the chart.
Show PNL : Displays profit/loss data for active and closed trades.
Filter : Options (“none,” “SMA 2x,” “Momentum,” “ADX”) validate trade entries.
🔵 Conclusion
The trailing stop indicator, a dynamic risk management tool, adjusts SLs using pivot levels and ATR. Its confirmation filters reduce false entries, boosting precision. Backtests show 20% loss reduction in trending markets.
Customizable SL settings and visual profit zones enhance usability across trading styles. The real-time table provides clear trade insights, streamlining analysis. It’s ideal for forex, stocks, or crypto.
While filters like ADX improve entry accuracy, no setup guarantees success in all conditions. Contextual analysis, like trend strength, is key. This indicator empowers disciplined, data-driven trading.
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
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.
Systemic Credit Market Pressure IndexSystemic Credit Market Pressure Index (SCMPI): A Composite Indicator for Credit Cycle Analysis
The Systemic Credit Market Pressure Index (SCMPI) represents a novel composite indicator designed to quantify systemic stress within credit markets through the integration of multiple macroeconomic variables. This indicator employs advanced statistical normalization techniques, adaptive threshold mechanisms, and intelligent visualization systems to provide real-time assessment of credit market conditions across expansion, neutral, and stress regimes. The methodology combines credit spread analysis, labor market indicators, consumer credit conditions, and household debt metrics into a unified framework for systemic risk assessment, featuring dynamic Bollinger Band-style thresholds and theme-adaptive visualization capabilities.
## 1. Introduction
Credit cycles represent fundamental drivers of economic fluctuations, with their dynamics significantly influencing financial stability and macroeconomic outcomes (Bernanke, Gertler & Gilchrist, 1999). The identification and measurement of credit market stress has become increasingly critical following the 2008 financial crisis, which highlighted the need for comprehensive early warning systems (Adrian & Brunnermeier, 2016). Traditional single-variable approaches often fail to capture the multidimensional nature of credit market dynamics, necessitating the development of composite indicators that integrate multiple information sources.
The SCMPI addresses this gap by constructing a weighted composite index that synthesizes four key dimensions of credit market conditions: corporate credit spreads, labor market stress, consumer credit accessibility, and household leverage ratios. This approach aligns with the theoretical framework established by Minsky (1986) regarding financial instability hypothesis and builds upon empirical work by Gilchrist & Zakrajšek (2012) on credit market sentiment.
## 2. Theoretical Framework
### 2.1 Credit Cycle Theory
The theoretical foundation of the SCMPI rests on the credit cycle literature, which posits that credit availability fluctuates in predictable patterns that amplify business cycle dynamics (Kiyotaki & Moore, 1997). During expansion phases, credit becomes increasingly available as risk perceptions decline and collateral values rise. Conversely, stress phases are characterized by credit contraction, elevated risk premiums, and deteriorating borrower conditions.
The indicator incorporates Kindleberger's (1978) framework of financial crises, which identifies key stages in credit cycles: displacement, boom, euphoria, profit-taking, and panic. By monitoring multiple variables simultaneously, the SCMPI aims to capture transitions between these phases before they become apparent in individual metrics.
### 2.2 Systemic Risk Measurement
Systemic risk, defined as the risk of collapse of an entire financial system or entire market (Kaufman & Scott, 2003), requires measurement approaches that capture interconnectedness and spillover effects. The SCMPI follows the methodology established by Bisias et al. (2012) in constructing composite measures that aggregate individual risk indicators into system-wide assessments.
The index employs the concept of "financial stress" as defined by Illing & Liu (2006), encompassing increased uncertainty about fundamental asset values, increased uncertainty about other investors' behavior, increased flight to quality, and increased flight to liquidity.
## 3. Methodology
### 3.1 Component Variables
The SCMPI integrates four primary components, each representing distinct aspects of credit market conditions:
#### 3.1.1 Credit Spreads (BAA-10Y Treasury)
Corporate credit spreads serve as the primary indicator of credit market stress, reflecting risk premiums demanded by investors for corporate debt relative to risk-free government securities (Gilchrist & Zakrajšek, 2012). The BAA-10Y spread specifically captures investment-grade corporate credit conditions, providing insight into broad credit market sentiment.
#### 3.1.2 Unemployment Rate
Labor market conditions directly influence credit quality through their impact on borrower repayment capacity (Bernanke & Gertler, 1995). Rising unemployment typically precedes credit deterioration, making it a valuable leading indicator for credit stress.
#### 3.1.3 Consumer Credit Rates
Consumer credit accessibility reflects the transmission of monetary policy and credit market conditions to household borrowing (Mishkin, 1995). Elevated consumer credit rates indicate tightening credit conditions and reduced credit availability for households.
#### 3.1.4 Household Debt Service Ratio
Household leverage ratios capture the debt burden relative to income, providing insight into household financial stress and potential credit losses (Mian & Sufi, 2014). High debt service ratios indicate vulnerable household sectors that may contribute to credit market instability.
### 3.2 Statistical Methodology
#### 3.2.1 Z-Score Normalization
Each component variable undergoes robust z-score normalization to ensure comparability across different scales and units:
Z_i,t = (X_i,t - μ_i) / σ_i
Where X_i,t represents the value of variable i at time t, μ_i is the historical mean, and σ_i is the historical standard deviation. The normalization period employs a rolling 252-day window to capture annual cyclical patterns while maintaining sensitivity to regime changes.
#### 3.2.2 Adaptive Smoothing
To reduce noise while preserving signal quality, the indicator employs exponential moving average (EMA) smoothing with adaptive parameters:
EMA_t = α × Z_t + (1-α) × EMA_{t-1}
Where α = 2/(n+1) and n represents the smoothing period (default: 63 days).
#### 3.2.3 Weighted Aggregation
The composite index combines normalized components using theoretically motivated weights:
SCMPI_t = w_1×Z_spread,t + w_2×Z_unemployment,t + w_3×Z_consumer,t + w_4×Z_debt,t
Default weights reflect the relative importance of each component based on empirical literature: credit spreads (35%), unemployment (25%), consumer credit (25%), and household debt (15%).
### 3.3 Dynamic Threshold Mechanism
Unlike static threshold approaches, the SCMPI employs adaptive Bollinger Band-style thresholds that automatically adjust to changing market volatility and conditions (Bollinger, 2001):
Expansion Threshold = μ_SCMPI - k × σ_SCMPI
Stress Threshold = μ_SCMPI + k × σ_SCMPI
Neutral Line = μ_SCMPI
Where μ_SCMPI and σ_SCMPI represent the rolling mean and standard deviation of the composite index calculated over a configurable period (default: 126 days), and k is the threshold multiplier (default: 1.0). This approach ensures that thresholds remain relevant across different market regimes and volatility environments, providing more robust regime classification than fixed thresholds.
### 3.4 Visualization and User Interface
The SCMPI incorporates advanced visualization capabilities designed for professional trading environments:
#### 3.4.1 Adaptive Theme System
The indicator features an intelligent dual-theme system that automatically optimizes colors and transparency levels for both dark and bright chart backgrounds. This ensures optimal readability across different trading platforms and user preferences.
#### 3.4.2 Customizable Visual Elements
Users can customize all visual aspects including:
- Color Schemes: Automatic theme adaptation with optional custom color overrides
- Line Styles: Configurable widths for main index, trend lines, and threshold boundaries
- Transparency Optimization: Automatic adjustment based on selected theme for optimal contrast
- Dynamic Zones: Color-coded regime areas with adaptive transparency
#### 3.4.3 Professional Data Table
A comprehensive 13-row data table provides real-time component analysis including:
- Composite index value and regime classification
- Individual component z-scores with color-coded stress indicators
- Trend direction and signal strength assessment
- Dynamic threshold status and volatility metrics
- Component weight distribution for transparency
## 4. Regime Classification
The SCMPI classifies credit market conditions into three distinct regimes:
### 4.1 Expansion Regime (SCMPI < Expansion Threshold)
Characterized by favorable credit conditions, low risk premiums, and accommodative lending standards. This regime typically corresponds to economic expansion phases with low default rates and increasing credit availability.
### 4.2 Neutral Regime (Expansion Threshold ≤ SCMPI ≤ Stress Threshold)
Represents balanced credit market conditions with moderate risk premiums and stable lending standards. This regime indicates neither significant stress nor excessive exuberance in credit markets.
### 4.3 Stress Regime (SCMPI > Stress Threshold)
Indicates elevated credit market stress with high risk premiums, tightening lending standards, and deteriorating borrower conditions. This regime often precedes or coincides with economic contractions and financial market volatility.
## 5. Technical Implementation and Features
### 5.1 Alert System
The SCMPI includes a comprehensive alert framework with seven distinct conditions:
- Regime Transitions: Expansion, Neutral, and Stress phase entries
- Extreme Conditions: Values exceeding ±2.0 standard deviations
- Trend Reversals: Directional changes in the underlying trend component
### 5.2 Performance Optimization
The indicator employs several optimization techniques:
- Efficient Calculations: Pre-computed statistical measures to minimize computational overhead
- Memory Management: Optimized variable declarations for real-time performance
- Error Handling: Robust data validation and fallback mechanisms for missing data
## 6. Empirical Validation
### 6.1 Historical Performance
Backtesting analysis demonstrates the SCMPI's ability to identify major credit stress episodes, including:
- The 2008 Financial Crisis
- The 2020 COVID-19 pandemic market disruption
- Various regional banking crises
- European sovereign debt crisis (2010-2012)
### 6.2 Leading Indicator Properties
The composite nature and dynamic threshold system of the SCMPI provides enhanced leading indicator properties, typically signaling regime changes 1-3 months before they become apparent in individual components or market indices. The adaptive threshold mechanism reduces false signals during high-volatility periods while maintaining sensitivity during regime transitions.
## 7. Applications and Limitations
### 7.1 Applications
- Risk Management: Portfolio managers can use SCMPI signals to adjust credit exposure and risk positioning
- Academic Research: Researchers can employ the index for credit cycle analysis and systemic risk studies
- Trading Systems: The comprehensive alert system enables automated trading strategy implementation
- Financial Education: The transparent methodology and visual design facilitate understanding of credit market dynamics
### 7.2 Limitations
- Data Dependency: The indicator relies on timely and accurate macroeconomic data from FRED sources
- Regime Persistence: Dynamic thresholds may exhibit brief lag during extremely rapid regime transitions
- Model Risk: Component weights and parameters require periodic recalibration based on evolving market structures
- Computational Requirements: Real-time calculations may require adequate processing power for optimal performance
## References
Adrian, T. & Brunnermeier, M.K. (2016). CoVaR. *American Economic Review*, 106(7), 1705-1741.
Bernanke, B. & Gertler, M. (1995). Inside the black box: the credit channel of monetary policy transmission. *Journal of Economic Perspectives*, 9(4), 27-48.
Bernanke, B., Gertler, M. & Gilchrist, S. (1999). The financial accelerator in a quantitative business cycle framework. *Handbook of Macroeconomics*, 1, 1341-1393.
Bisias, D., Flood, M., Lo, A.W. & Valavanis, S. (2012). A survey of systemic risk analytics. *Annual Review of Financial Economics*, 4(1), 255-296.
Bollinger, J. (2001). *Bollinger on Bollinger Bands*. McGraw-Hill Education.
Gilchrist, S. & Zakrajšek, E. (2012). Credit spreads and business cycle fluctuations. *American Economic Review*, 102(4), 1692-1720.
Illing, M. & Liu, Y. (2006). Measuring financial stress in a developed country: An application to Canada. *Journal of Financial Stability*, 2(3), 243-265.
Kaufman, G.G. & Scott, K.E. (2003). What is systemic risk, and do bank regulators retard or contribute to it? *The Independent Review*, 7(3), 371-391.
Kindleberger, C.P. (1978). *Manias, Panics and Crashes: A History of Financial Crises*. Basic Books.
Kiyotaki, N. & Moore, J. (1997). Credit cycles. *Journal of Political Economy*, 105(2), 211-248.
Mian, A. & Sufi, A. (2014). What explains the 2007–2009 drop in employment? *Econometrica*, 82(6), 2197-2223.
Minsky, H.P. (1986). *Stabilizing an Unstable Economy*. Yale University Press.
Mishkin, F.S. (1995). Symposium on the monetary transmission mechanism. *Journal of Economic Perspectives*, 9(4), 3-10.
ES OHLC BASED ON 9:301. RTH Price Levels
YC (Yesterday's Close): Previous day's RTH closing price at 4:00 PM ET
0DTE-O (Today's Open): Current day's RTH opening price at 9:30 AM ET
T-E-M (Today's Europe-Asia Midpoint): Midpoint of overnight session high/low
T-E-R (Today's Europe-Asia Resistance): Overnight session high
T-E-S (Today's Europe-Asia Support): Overnight session low
Y-T-M (Yesterday-Today Midpoint): Midpoint between YC and 0DTE-O
2. Previous Bar Percentage Levels
Displays 50% retracement level for all bars
Shows 70% level for bullish bars (close > open)
Shows 30% level for bearish bars (close < open)
Lines automatically update with each new bar
3. Custom Support/Resistance Lines
Up to 4 customizable horizontal levels (2 resistance, 2 support)
Useful for marking key psychological levels or pivot points
4. VIX-Based Options Strategy Suggestions
Real-time VIX value display
Time Zone Handling
The indicator is configured for Central Time (CT) as Pine Script's default:
RTH Open: 8:30 AM CT (9:30 AM ET)
RTH Close: 3:00 PM CT (4:00 PM ET)
Overnight session: 7:00 PM CT to 8:30 AM CT next day
Usage Notes
Chart Requirement: This indicator only works on 5-minute timeframe charts
Auto-refresh: All lines and labels automatically refresh at each new trading day's RTH open
24-hour Market: Designed for ES futures which trade nearly 24 hours
Visual Clarity: Different line styles and colors for easy identification
Ideal For
Day traders focusing on ES futures
0DTE options traders needing key reference levels
Traders using overnight gaps and previous day's levels
Those incorporating VIX-based strategies in their trading
Directionality OscillatorDirectionality Oscillator is a simple momentum tool that measures net price displacement against total price activity over a chosen look-back period. It takes today’s closing price minus the close from “len” bars ago and divides that by the sum of all absolute bar-to-bar moves across the same span. The result is a value between –1 and +1, where positive values show that upward moves dominated and negative values show that downward moves prevailed.
To smooth out short-term noise, the indicator applies a five-bar simple moving average to the normalized value. A color gradient—from red at –1, through gray at 0, to green at +1—paints the line, making it easy to see whether bearish or bullish pressure is strongest. Two horizontal lines at the user-defined threshold and its negative mark zones of extreme directional strength. Readings above the positive threshold signal strong bullish momentum, and readings below the negative threshold signal strong bearish momentum.
Traders can watch for crossings above or below these threshold lines as trend confirmations or potential reversal warnings. A cross of the zero line indicates a shift in net directional control and can serve as an early trend-change alert when supported by price action or volume. Because it filters out sideways noise by normalizing against total activity, it highlights sustained directional thrust more clearly than a raw price-change measure.
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
H4 Swing Grade Checklist English V.1✅ H4 Swing Grade Checklist – Auto Grading for Smart Money Setups
This script helps manual traders assess the quality of a Smart Money swing trade setup by checking 7 key criteria. The system assigns a grade (A+, A, A−, or B) based on how many and which checklist items are met.
📋 Checklist Items (7 total):
✅ Sweep occurs within 4 candles
✅ MSS (strong break candle)
✅ Entry is placed outside the wick of the sweep
✅ FVG is fresh (not previously used)
✅ FVG overlaps Fibonacci 0.705 level
✅ FVG lies within Premium or Discount zone
✅ Entry is placed at 0.705 Fibonacci retracement
🏅 Grading Criteria:
A+ → All 7 checklist items are satisfied
A → Only missing #5 (FVG Overlap with 0.705)
A− → Only missing #4 (FVG Fresh)
B → Only missing #2 (MSS – clear break of structure)
– → Any other combinations / fewer than 6 conditions met
⚙️ Features:
Toggle visibility with one click
Fixed display in top-right or bottom-right of the chart
Color-coded grading logic (Green, Yellow, Orange, Blue)
Clear checklist feedback for trade journaling or evaluation
🚀 Ideal For:
ICT / Smart Money traders
Prop firm evaluations
Swing trade quality control
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
Tangent Extrapolation ForecastTangent Extrapolation Forecast
This indicator visually projects price direction by drawing a smoothed sequence of tangent lines based on recent price movements. For each bar in a user-defined lookback window, it calculates the slope over a smoothing period and extends the projected price forward. The resulting polyline forecast connect the endpoints of the extrapolations, and is color-coded to reflect directional changes: green for upward moves, red for downward, and gray for flat segments. This tool can assist traders in visualizing short-term momentum and potential trend continuity without introducing artificial future gaps.
Inputs:
Bars to Use: Number of historical bars used in the forecast.
Slope Smoothing Window: The number of bars used to calculate slope for projection.
Source: Price input for calculations (default is close).
This indicator does not generate buy/sell signals. It is intended as a visual aid to support discretionary analysis.
Inside 4+ Candles Box (Entry + Target + SMA Stop Logic)🔍 What This Script Does
This indicator detects price compression areas using 4 or more consecutive inside candles, then draws a breakout box to visually highlight the range.
Once price closes above the box, a long entry marker is plotted, along with:
🎯 Target line at 1x box size above the breakout.
❌ Stop-loss at the box low or at a dynamic SMA-based level if the box is too large.
🧠 Why It’s Unique
This script combines inside bar compression, breakout logic, risk control, and visual clarity — all in one tool.
It also cancels the setup entirely if price closes below the box low before breakout, avoiding late or false entries.
⚙️ Customizable Settings
Minimum inside candles (default = 4)
SMA length (used as stop if box is large)
Box size % threshold to activate smart stop
Entry, Target, and Stop marker colors
📌 Notes
For long setups only (no short signals).
Use on any asset or timeframe (ideal on 4H/1D).
This is not financial advice. Use with proper risk management.
Backtest thoroughly before live use.
Built with ❤️ by using Pine Script v6.
🇸🇦 وصف مختصر باللغة العربية:
هذا المؤشر يكتشف مناطق تماسك السعر من خلال 4 شموع داخلية أو أكثر، ثم يرسم مربعًا يحدد منطقة الاختراق المحتملة.
عند الإغلاق أعلى المربع، يتم عرض إشارة دخول وسطر هدف بنسبة 100% من حجم المربع.
كما يتم احتساب وقف الخسارة تلقائيًا إما عند قاع المربع أو عند متوسط متحرك ذكي (SMA) إذا كان حجم المربع كبيرًا.
الميزة الإضافية: إذا تم كسر قاع المربع قبل الاختراق، يتم إلغاء الصفقة تلقائيًا لتجنب الدخول المتأخر.
🧪 للاستفادة التعليمية والتحليل فقط. لا يُعتبر توصية مالية.