Entropy Chart Analysis [PhenLabs]📊 Entropy Chart analysis -
Version: PineScript™ v6
📌 Description
The Entropy Chart indicator analysis applies Approximate Entropy (ApEn) to identify zones of potential support and resistance on your price chart. It is designed to locate changes in the market’s predictability, with a focus on zones near significant psychological price levels (e.g., multiples of 50). By quantifying entropy, the indicator aims to identify zones where price action might stabilize (potential support) or become randomized (potential resistance).
This tool automates the visualization of these key areas for traders, which may have the effect of revealing reversal levels or consolidation zones that would be hard to discern through traditional means. It also filters the signals by proximity to key levels in an attempt to reduce noise and highlight higher-probability setups. These dynamic zones adapt to changing market conditions by stretching, merging, and expiring based on user-inputted rules.
🚀 Points of Innovation
Combines Approximate Entropy (ApEn) calculation with price action near significant levels.
Filters zone signals based on proximity (in ticks) to predefined significant price levels (multiples of 50).
Dynamically merges overlapping or nearby zones to consolidate signals and reduce chart clutter.
Uses ApEn crossovers relative to its moving average as the core trigger mechanism.
Provides distinct visual coloring for bullish, bearish, and merged (mixed-signal) zones.
Offers comprehensive customization for entropy calculation, zone sensitivity, level filtering, and visual appearance.
🔧 Core Components
Approximate Entropy (ApEn) Calculation : Measures the regularity or randomness of price fluctuations over a specified window. Low ApEn suggests predictability, while high ApEn suggests randomness.
Zone Trigger Logic : Creates potential support zones when ApEn crosses below its average (indicating increasing predictability) and potential resistance zones when it crosses above (indicating increasing randomness).
Significant Level Filter : Validates zone triggers only if they occur within a user-defined tick distance from significant price levels (multiples of 50).
Dynamic Zone Management : Automatically creates, extends, merges nearby zones based on tick distance, and removes the oldest zones to maintain a maximum limit.
Zone Visualization : Draws and updates colored boxes on the chart to represent active support, resistance, or mixed zones.
🔥 Key Features
Entropy-Based S/R Detection : Uses ApEn to identify potential support (low entropy) and resistance (high entropy) areas.
Significant Level Filtering : Enhances signal quality by focusing on entropy changes near key psychological price points.
Automatic Zone Drawing & Merging : Visualizes zones dynamically, merging close signals for clearer interpretation.
Highly Customizable : Allows traders to adjust parameters for ApEn calculation, zone detection thresholds, level filter sensitivity, merging distance, and visual styles.
Integrated Alerts : Provides built-in alert conditions for the formation of new bullish or bearish zones near significant levels.
Clear Visual Output : Uses distinct, customizable colors for buy (support), sell (resistance), and mixed (merged) zones.
🎨 Visualization
Buy Zones : Represented by greenish boxes (default: #26a69a), indicating potential support areas formed during low entropy periods near significant levels.
Sell Zones : Represented by reddish boxes (default: #ef5350), indicating potential resistance areas formed during high entropy periods near significant levels.
Mixed Zones : Represented by bluish/purple boxes (default: #8894ff), formed when a buy zone and a sell zone merge, indicating areas of potential consolidation or conflict.
Dynamic Extension : Active zones are automatically extended to the right with each new bar.
📖 Usage Guidelines
Calculation Parameters
Window Length
Default: 15
Range: 10-100
Description: Lookback period for ApEn calculation. Shorter lengths are more responsive; longer lengths are smoother.
Embedding Dimension (m)
Default: 2
Range: 1-6
Description: Length of patterns compared in ApEn calculation. Higher values detect more complex patterns but require more data.
Tolerance (r)
Default: 0.5
Range: 0.1-1.0 (step 0.1)
Description: Sensitivity factor for pattern matching (as a multiple of standard deviation). Lower values require closer matches (more sensitive).
Zone Settings
Zone Lookback
Default: 5
Range: 5-50
Description: Lookback period for the moving average of ApEn used in threshold calculations.
Zone Threshold
Default: 0.5
Range: 0.5-3.0
Description: Multiplier for the ApEn average to set crossover trigger levels. Higher values require larger ApEn deviations to create zones.
Maximum Zones
Default: 5
Range: 1-10
Description: Maximum number of active zones displayed. The oldest zones are removed first when the limit is reached.
Zone Merge Distance (Ticks)
Default: 5
Range: 1-50
Description: Maximum distance in ticks for two separate zones to be merged into one.
Level Filter Settings
Tick Size
Default: 0.25
Description: The minimum price increment for the asset. Must be set correctly for the specific instrument to ensure accurate level filtering.
Max Ticks Distance from Levels
Default: 40
Description: Maximum allowed distance (in ticks) from a significant level (multiple of 50) for a zone trigger to be valid.
Visual Settings
Buy Zone Color : Default: color.new(#26a69a, 83). Sets the fill color for support zones.
Sell Zone Color : Default: color.new(#ef5350, 83). Sets the fill color for resistance zones.
Mixed Zone Color : Default: color.new(#8894ff, 83). Sets the fill color for merged zones.
Buy Border Color : Default: #26a69a. Sets the border color for support zones.
Sell Border Color : Default: #ef5350. Sets the border color for resistance zones.
Mixed Border Color : Default: color.new(#a288ff, 50). Sets the border color for mixed zones.
Border Width : Default: 1, Range: 1-3. Sets the thickness of zone borders.
✅ Best Use Cases
Identifying potential support/resistance near significant psychological price levels (e.g., $50, $100 increments).
Detecting potential market turning points or consolidation zones based on shifts in price predictability.
Filtering entries or exits by confirming signals occurring near significant levels identified by the indicator.
Adding context to other technical analysis approaches by highlighting entropy-derived zones.
⚠️ Limitations
Parameter Dependency : Indicator performance is sensitive to parameter settings ( Window Length , Tolerance , Zone Threshold , Max Ticks Distance ), which may need optimization for different assets and timeframes.
Volatility Sensitivity : High market volatility or erratic price action can affect ApEn calculations and potentially lead to less reliable zone signals.
Fixed Level Filter : The significant level filter is based on multiples of 50. While common, this may not capture all relevant levels for every asset or market condition. Accurate Tick Size input is essential.
Not Standalone : Should be used in conjunction with other analysis methods (price action, volume, other indicators) for confirmation, not as a sole basis for trading decisions.
💡 What Makes This Unique
Entropy + Level Context : Uniquely combines ApEn analysis with a specific filter for proximity to significant price levels (multiples of 50), adding locational context to entropy signals.
Intelligent Zone Merging : Automatically consolidates nearby buy/sell zones based on tick distance, simplifying visual analysis and highlighting stronger confluence areas.
Targeted Signal Generation : Focuses alerts and zone creation on specific market conditions (entropy shifts near key levels).
🔬 How It Works
Calculate Entropy : The script computes the Approximate Entropy (ApEn) of the closing prices over the defined Window Length to quantify price predictability.
Check Triggers : It monitors ApEn relative to its moving average. A crossunder below a calculated threshold (avg_apen / zone_threshold) indicates potential support; a crossover above (avg_apen * zone_threshold) indicates potential resistance.
Filter by Level : A potential zone trigger is confirmed only if the low (for support) or high (for resistance) of the trigger bar is within the Max Ticks Distance of a significant price level (multiple of 50).
Manage & Draw Zones : If a trigger is confirmed, a new zone box is created. The script checks for overlaps with existing zones within the Zone Merge Distance and merges them if necessary. Zones are extended forward, and the oldest are removed to respect the Maximum Zones limit. Active zones are drawn and updated on the chart.
💡 Note:
Crucially, set the Tick Size parameter correctly for your specific trading instrument in the “Level Filter Settings”. Incorrect Tick Size will make the significant level filter inaccurate.
Experiment with parameters, especially Window Length , Tolerance (r) , Zone Threshold , and Max Ticks Distance , to tailor the indicator’s sensitivity to your preferred asset and timeframe.
Always use this indicator as part of a comprehensive trading plan, incorporating risk management and seeking confirmation from other analysis techniques.
Reversalzones
Support/Resistance Strength [UAlgo]The Support/Resistance Strength indicator is a tool designed for traders seeking a precise understanding of key support and resistance levels in the market. This tool dynamically identifies and visualizes support and resistance zones based on pivot points and strength criteria, providing traders with actionable insights for better decision-making.
By incorporating features such as ATR-based or percentage-based channel calculations, customizable strength thresholds, and intuitive visualization of key levels, the indicator caters to traders of various skill levels and strategies. It also adapts dynamically to market conditions, allowing users to identify frequently tested zones with minimal manual input.
🔶 Key Features
Dynamic Support and Resistance Zones
Automatically detects significant support and resistance levels using pivot high and low calculations.
Offers ATR-based or percentage-based channel customization to cater to diverse trading styles.
Customizable Parameters
Lookback period for pivot calculations, strength threshold, and maximum stored pivots are fully adjustable.
Display options for showing specific numbers of recent support/resistance lines.
Intuitive Visualization
Highlights key support and resistance levels with color-coded lines and labels.
Includes percentage deviation from the current price for quick assessment.
Interactive Updates
Continuously updates support and resistance levels to reflect changing market dynamics.
Displays pivot points visually for enhanced clarity.
Can be used effectively on various timeframes, from intraday to daily and weekly charts.
🔶 Interpreting the Indicator
Identifying Key Levels
Support levels are indicated by green (lime) lines and resistance levels by red lines. The transparency of colors is adjustable for visual preference.
Labels display the exact price level and the percentage difference from the current price.
Strength Threshold
The "Minimum S/R Strength" parameter defines how frequently a level must be tested to be considered significant.
Higher strength values indicate zones that have been tested more frequently, suggesting stronger support or resistance.
Pivot Points
The indicator marks pivot high and low points on the chart to provide a visual representation of the calculated levels.
Dynamic Updates
The indicator adapts to the most recent price action. If the price moves above a resistance level or below a support level, the color of the lines and labels will dynamically change to reflect the current price positioning.
🔶 Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
Nadaraya-Watson: Envelope (Non-Repainting)Due to popular request, this is an envelope implementation of my non-repainting Nadaraya-Watson indicator using the Rational Quadratic Kernel. For more information on this implementation, please refer to the original indicator located here:
What is an Envelope?
In technical analysis, an "envelope" typically refers to a pair of upper and lower bounds that surrounds price action to help characterize extreme overbought and oversold conditions. Envelopes are often derived from a simple moving average (SMA) and are placed at a predefined distance above and below the SMA from which they were generated. However, envelopes do not necessarily need to be derived from a moving average; they can be derived from any estimator, including a kernel estimator such as Nadaraya-Watson.
How to use this indicator?
Overall, this indicator offers a high degree of flexibility, and the location of the envelope's bands can be adjusted by (1) tweaking the parameters for the Rational Quadratic Kernel and (2) adjusting the lookback window for the custom ATR calculation. In a trending market, it is often helpful to use the Nadaraya-Watson estimate line as a floating SR and/or reversal zone. In a ranging market, it is often more convenient to use the two Upper Bands and two Lower Bands as reversal zones.
How are the Upper and Lower bounds calculated?
In this indicator, the Rational Quadratic (RQ) Kernel estimates the price value at each bar in a user-defined lookback window. From this estimation, the upper and lower bounds of the envelope are calculated based on a custom ATR calculated from the kernel estimations for the high, low, and close series, respectively. These calculations are then scaled against a user-defined multiplier, which can be used to further customize the Upper and Lower bounds for a given chart.
How to use Kernel Estimations like this for other indicators?
Kernel Functions are highly underrated, and when calibrated correctly, they have the potential to provide more value than any mundane moving average. For those interested in using non-repainting Kernel Estimations for technical analysis, I have written a Kernel Functions library that makes it easy to access various well-known kernel functions quickly. The Rational Quadratic Kernel is used in this implementation, but one can conveniently swap out other kernels from the library by modifying only a single line of code. For more details and usage examples, please refer to the Kernel Functions library located here: