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 อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน