Hierarchical + K-Means Clustering Strategy by wanghuacrow

By wanghuacrow

Performance Metrics

Description

Mar 6===== USER GUIDE =====Hierarchical + K-Means Clustering StrategyOVERVIEW:This strategy combines hierarchical clustering and K-means algorithms to analyze market volatility patternsand generate trading signals. It uses a modified SuperTrend indicator with ATR-based volatility clusteringto identify potential trend changes and market conditions.KEY FEATURES:- Advanced volatility analysis using hierarchical clustering and K-means algorithms- Modified SuperTrend indicator for trend identification- Multiple filter options including moving average and ADX trend strength- Volume-based exit mechanism to protect profits- Customizable appearance settingsSETTINGS EXPLANATION:1. SuperTrend Settings: - ATR Length: Period for ATR calculation (default: 11) - SuperTrend Factor: Multiplier for ATR to determine trend bands (default: 3)2. Hierarchical Clustering Settings: - Training Data Length: Number of bars used for clustering analysis (default: 200)3. Appearance Settings: - Transparency 1 & 2: Control the opacity of trend lines and fills - Bullish/Bearish Color: Colors for uptrend and downtrend visualization4. Time Settings: - Start Year/Month: Define when the strategy should start executing trades5. Filter Settings: - Moving Average Filter: Uses SMA to filter trades (only enter when price is on correct side of MA) - Trend Strength Filter: Uses ADX to ensure trades are taken in strong trend conditions6. Volume Stop Loss Settings: - Volume Ratio Threshold: Controls sensitivity of volume-based exits - Monitoring Delay Bars: Number of bars to wait before monitoring volume for exit signalsHOW TO USE:1. Apply the indicator to your chart2. Adjust settings according to your trading preferences and timeframe3. Long signals appear when price crosses above the SuperTrend line (▲k marker)4. Short signals appear when price crosses below the SuperTrend line (▼k marker)5. The strategy automatically manages exits based on volume balance conditionsINTERPRETATION:- Green line/area: Bullish trend - consider long positions- Red line/area: Bearish trend - consider short positions- Yellow line: Moving average for additional trend confirmation- Volume balance exits occur when buying/selling pressure equalizesRECOMMENDED TIMEFRAMES:This strategy works best on 1H, 4H, and daily charts for most markets.For highly volatile assets, shorter timeframes may also be effective.RISK MANAGEMENT:Always use proper position sizing and consider setting additional stop lossesbeyond the strategy's built-in exit mechanisms.===== END OF USER GUIDE =====Mar 6Release Notes===== USER GUIDE =====Hierarchical + K-Means Clustering StrategyOVERVIEW:This strategy combines hierarchical clustering and K-means algorithms to analyze market volatility patternsand generate trading signals. It uses a modified SuperTrend indicator with ATR-based volatility clusteringto identify potential trend changes and market conditions.KEY FEATURES:- Advanced volatility analysis using hierarchical clustering and K-means algorithms- Modified SuperTrend indicator for trend identification- Multiple filter options including moving average and ADX trend strength- Volume-based exit mechanism to protect profits- Customizable appearance settingsSETTINGS EXPLANATION:1. SuperTrend Settings: - ATR Length: Period for ATR calculation (default: 11) - SuperTrend Factor: Multiplier for ATR to determine trend bands (default: 3)2. Hierarchical Clustering Settings: - Training Data Length: Number of bars used for clustering analysis (default: 200)3. Appearance Settings: - Transparency 1 & 2: Control the opacity of trend lines and fills - Bullish/Bearish Color: Colors for uptrend and downtrend visualization4. Time Settings: - Start Year/Month: Define when the strategy should start executing trades5. Filter Settings: - Moving Average Filter: Uses SMA to filter trades (only enter when price is on correct side of MA) - Trend Strength Filter: Uses ADX to ensure trades are taken in strong trend conditions6. Volume Stop Loss Settings: - Volume Ratio Threshold: Controls sensitivity of volume-based exits - Monitoring Delay Bars: Number of bars to wait before monitoring volume for exit signalsHOW TO USE:1. Apply the indicator to your chart2. Adjust settings according to your trading preferences and timeframe3. Long signals appear when price crosses above the SuperTrend line (▲k marker)4. Short signals appear when price crosses below the SuperTrend line (▼k marker)5. The strategy automatically manages exits based on volume balance conditionsINTERPRETATION:- Green line/area: Bullish trend - consider long positions- Red line/area: Bearish trend - consider short positions- Yellow line: Moving average for additional trend confirmation- Volume balance exits occur when buying/selling pressure equalizesRECOMMENDED TIMEFRAMES:This strategy works best on 1H, 4H, and daily charts for most markets.For highly volatile assets, shorter timeframes may also be effective.RISK MANAGEMENT:Always use proper position sizing and consider setting additional stop lossesbeyond the strategy's built-in exit mechanisms.===== END OF USER GUIDE =====

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView