OPEN-SOURCE SCRIPT
Permutation Entropy Complexity Oscillator

Permutation Entropy (PE) Complexity Oscillator
The Permutation Entropy Complexity Oscillator is a sophisticated market regime filter that measures the "order" vs. "chaos" of price action. Unlike traditional oscillators (RSI, MACD) that rely on price values, this indicator analyzes ordinal patterns (the relative "up-down" sequence of bars).
This makes it exceptionally robust against noise and extremely fast at detecting when a market transitions from a random state into a structured trend.
How it works:
The indicator calculates the Shannon Entropy of price motifs.
High Entropy (Red Zone): The market is in a state of maximum randomness (Chaos). Ordinal patterns occur with equal probability. This is a "No-Trade" zone for trend followers.
Low Entropy (Green Zone): The market is structured and predictable. A specific pattern (e.g., constant higher highs) is dominating. This indicates a strong trending regime.
Trading Edge & Usage:
This tool is designed to be a Regime Filter, not a directional signal generator.
Avoid the "Chop": When the line is Red (High Chaos), avoid trend-following entries. The market is in a "Random Walk" phase where fakeouts are highly likely.
Confirm the Trend: When the line is Green (Predictable), the market has high structural order. This is the time to look for entries using your favorite trend-following system.
Regime Shift Alert: A drop from the Red zone into the Neutral/Green zone often precedes a massive volatility breakout. It signals that "order" is returning to the market.
Key Features:
Noise Immunity: Since it only looks at the rank of prices, it isn't fooled by sudden "fat-finger" spikes or minor gaps.
Visual Clarity: The background and line color change dynamically based on the complexity of the current market state.
V6 Optimized: Built with the latest Pine Script v6 standards for maximum performance and stability.
Settings:
Complexity Lookback: The window size for pattern analysis (Default 100).
Noise/Predictable Thresholds: Adjustable levels to fine-tune the sensitivity to market chaos.
The Permutation Entropy Complexity Oscillator is a sophisticated market regime filter that measures the "order" vs. "chaos" of price action. Unlike traditional oscillators (RSI, MACD) that rely on price values, this indicator analyzes ordinal patterns (the relative "up-down" sequence of bars).
This makes it exceptionally robust against noise and extremely fast at detecting when a market transitions from a random state into a structured trend.
How it works:
The indicator calculates the Shannon Entropy of price motifs.
High Entropy (Red Zone): The market is in a state of maximum randomness (Chaos). Ordinal patterns occur with equal probability. This is a "No-Trade" zone for trend followers.
Low Entropy (Green Zone): The market is structured and predictable. A specific pattern (e.g., constant higher highs) is dominating. This indicates a strong trending regime.
Trading Edge & Usage:
This tool is designed to be a Regime Filter, not a directional signal generator.
Avoid the "Chop": When the line is Red (High Chaos), avoid trend-following entries. The market is in a "Random Walk" phase where fakeouts are highly likely.
Confirm the Trend: When the line is Green (Predictable), the market has high structural order. This is the time to look for entries using your favorite trend-following system.
Regime Shift Alert: A drop from the Red zone into the Neutral/Green zone often precedes a massive volatility breakout. It signals that "order" is returning to the market.
Key Features:
Noise Immunity: Since it only looks at the rank of prices, it isn't fooled by sudden "fat-finger" spikes or minor gaps.
Visual Clarity: The background and line color change dynamically based on the complexity of the current market state.
V6 Optimized: Built with the latest Pine Script v6 standards for maximum performance and stability.
Settings:
Complexity Lookback: The window size for pattern analysis (Default 100).
Noise/Predictable Thresholds: Adjustable levels to fine-tune the sensitivity to market chaos.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。