OPEN-SOURCE SCRIPT
EEQI [Environment Quality Index] PyraTime

The Problem: Why Good Strategies Fail
The number one reason traders lose capital is not a lack of strategy—it is forced execution in poor environments.
Most indicators (RSI, MACD, Stochastic) are continuously active, generating signals even when the market is dead, choppy, or chaotic. A breakout strategy that prints money in a trend will destroy your account in a consolidation range. A mean-reversion system that works in chop will fail during a parabolic expansion.
The Solution: PyraTime EEQI The Execution Environment Quality Index (EEQI) is a "Gatekeeper" layer for your trading. It does not tell you what to buy or sell; it tells you if you should be trading at all.
By aggregating Volatility, Price Structure, and Efficiency into a single composite score, the EEQI answers the most critical question in discretionary trading: "Is the market efficient enough to deploy capital right now?"
How It Works: The 3 Core Engines
The EEQI calculates a raw "Environment Score" (from -2 to +4) by analyzing three distinct dimensions of price action.
1. Volatility Engine (Usability)
The Logic: Measures the "Alive-ness" of the market using ATR Percentiles.
The Filter: It detects "Dead Zones" (where price is too flat to hit targets) and "Chaos Zones" (where volatility is too dangerous).
Smart Feature (Parabolic Override): If price moves significantly (>2x ATR) in a single candle, the engine recognizes this as "High Momentum" rather than chaos, unlocking Green signals during breakouts.
2. Structure Engine (Bar Quality)
The Logic: Analyzes the relationship between candle bodies, wicks, and overlap.
The Filter: It penalizes "Barbed Wire" price action—candles with long wicks and high overlap—which indicate indecision and algo-chop.
The Goal: We want to trade during "Clean Flow," where candle bodies are large and overlap is low.
3. Efficiency Engine (Directional Flow)
The Logic: Compares Net Displacement (start-to-finish distance) vs. Total Distance Traveled.
The Filter: Identifies "Whipsaw" conditions where price moves a lot but goes nowhere.
Smart Feature (Velocity Lock): If price travels a massive distance quickly, the efficiency requirement is relaxed to catch explosive moves that might otherwise look "messy."
The "Smart Gatekeepers"
Even if the Core Engines look good, the EEQI applies three final safety checks before granting a PRIME status.
Regime Persistence (Stability Check): The market must hold a high score for a set number of bars (default: 1) before the signal turns Green. This prevents "fake-outs" where a single anomaly candle tricks you into entering a bad trend.
Volume Validation (Liquidity Check): Price movement without participation is a trap. The EEQI checks Relative Volume (RVOL). If volume is below average (e.g., lunch hour, holidays, or late-night sessions), the score is capped at "Fair" or "Low Vol," preventing execution in thin liquidity.
Macro Context (HTF Filter): You cannot trade against the higher timeframe. The EEQI checks the trend and volatility of the Higher Timeframe (default: Weekly). If the macro view is compressed or dead, the local signal is vetoed.
How to Read the HUD
The Dashboard (Bottom Right) gives you an instant read on the market state.
🟢 PRIME (+4): Execution Optimal. The market is trending, efficient, and backed by volume. This is the "Green Light" for your strategy.
🔵 FAIR (+1 to +3): Tradeable. Conditions are decent, but one factor (e.g., volume or structure) is imperfect. Exercise caution.
⚪ NEUTRAL (0): Indecision. The market is transitioning. Stand aside.
🟡 BUILDING: Wait. The market is good, but hasn't proven itself yet (Persistence Check).
🟠 POOR / LOW VOL: Chop. Price is messy or lacking participation.
🔴 AVOID (-2): Danger Zone. The market is either dead flat or violently chaotic. Do not trade.
Settings & Customization
The indicator comes with calibrated presets for different asset classes:
Crypto: Tolerates higher volatility and requires stronger efficiency confirmation.
Forex: Stricter dead-zone filters to handle ranging sessions.
Indices: Balanced settings for standard equity hours.
Disclaimer
This tool is designed for environment analysis only. It does not provide buy or sell signals, entry prices, or stop-losses. It is intended to be used as a filter to improve the performance of your own discretionary strategies.
The number one reason traders lose capital is not a lack of strategy—it is forced execution in poor environments.
Most indicators (RSI, MACD, Stochastic) are continuously active, generating signals even when the market is dead, choppy, or chaotic. A breakout strategy that prints money in a trend will destroy your account in a consolidation range. A mean-reversion system that works in chop will fail during a parabolic expansion.
The Solution: PyraTime EEQI The Execution Environment Quality Index (EEQI) is a "Gatekeeper" layer for your trading. It does not tell you what to buy or sell; it tells you if you should be trading at all.
By aggregating Volatility, Price Structure, and Efficiency into a single composite score, the EEQI answers the most critical question in discretionary trading: "Is the market efficient enough to deploy capital right now?"
How It Works: The 3 Core Engines
The EEQI calculates a raw "Environment Score" (from -2 to +4) by analyzing three distinct dimensions of price action.
1. Volatility Engine (Usability)
The Logic: Measures the "Alive-ness" of the market using ATR Percentiles.
The Filter: It detects "Dead Zones" (where price is too flat to hit targets) and "Chaos Zones" (where volatility is too dangerous).
Smart Feature (Parabolic Override): If price moves significantly (>2x ATR) in a single candle, the engine recognizes this as "High Momentum" rather than chaos, unlocking Green signals during breakouts.
2. Structure Engine (Bar Quality)
The Logic: Analyzes the relationship between candle bodies, wicks, and overlap.
The Filter: It penalizes "Barbed Wire" price action—candles with long wicks and high overlap—which indicate indecision and algo-chop.
The Goal: We want to trade during "Clean Flow," where candle bodies are large and overlap is low.
3. Efficiency Engine (Directional Flow)
The Logic: Compares Net Displacement (start-to-finish distance) vs. Total Distance Traveled.
The Filter: Identifies "Whipsaw" conditions where price moves a lot but goes nowhere.
Smart Feature (Velocity Lock): If price travels a massive distance quickly, the efficiency requirement is relaxed to catch explosive moves that might otherwise look "messy."
The "Smart Gatekeepers"
Even if the Core Engines look good, the EEQI applies three final safety checks before granting a PRIME status.
Regime Persistence (Stability Check): The market must hold a high score for a set number of bars (default: 1) before the signal turns Green. This prevents "fake-outs" where a single anomaly candle tricks you into entering a bad trend.
Volume Validation (Liquidity Check): Price movement without participation is a trap. The EEQI checks Relative Volume (RVOL). If volume is below average (e.g., lunch hour, holidays, or late-night sessions), the score is capped at "Fair" or "Low Vol," preventing execution in thin liquidity.
Macro Context (HTF Filter): You cannot trade against the higher timeframe. The EEQI checks the trend and volatility of the Higher Timeframe (default: Weekly). If the macro view is compressed or dead, the local signal is vetoed.
How to Read the HUD
The Dashboard (Bottom Right) gives you an instant read on the market state.
🟢 PRIME (+4): Execution Optimal. The market is trending, efficient, and backed by volume. This is the "Green Light" for your strategy.
🔵 FAIR (+1 to +3): Tradeable. Conditions are decent, but one factor (e.g., volume or structure) is imperfect. Exercise caution.
⚪ NEUTRAL (0): Indecision. The market is transitioning. Stand aside.
🟡 BUILDING: Wait. The market is good, but hasn't proven itself yet (Persistence Check).
🟠 POOR / LOW VOL: Chop. Price is messy or lacking participation.
🔴 AVOID (-2): Danger Zone. The market is either dead flat or violently chaotic. Do not trade.
Settings & Customization
The indicator comes with calibrated presets for different asset classes:
Crypto: Tolerates higher volatility and requires stronger efficiency confirmation.
Forex: Stricter dead-zone filters to handle ranging sessions.
Indices: Balanced settings for standard equity hours.
Disclaimer
This tool is designed for environment analysis only. It does not provide buy or sell signals, entry prices, or stop-losses. It is intended to be used as a filter to improve the performance of your own discretionary strategies.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
While the world trades price, we trade Time & Price.
Access our proprietary Cardical Indicator Suite: whop.com/pyratime
Access our proprietary Cardical Indicator Suite: whop.com/pyratime
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
While the world trades price, we trade Time & Price.
Access our proprietary Cardical Indicator Suite: whop.com/pyratime
Access our proprietary Cardical Indicator Suite: whop.com/pyratime
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.