OPEN-SOURCE SCRIPT
HTF Candles Pro by MurshidFx

# HTF Candles Pro by MurshidFx
## Professional Trading Indicator for Multi-Timeframe Market Structure Analysis
**HTF Candles Pro** is an advanced, open-source trading indicator that synthesizes Higher Timeframe (HTF) candle visualization with CISD (Change in State of Delivery) detection, providing comprehensive market structure analysis across multiple timeframes. Designed for traders at all experience levels—from scalpers to swing traders—this tool enables precise alignment of trades with higher timeframe momentum while identifying critical market structure transitions.
---
## Core Functionality
This indicator integrates three essential analytical frameworks:
- **HTF Candle Visualization** – Inspired by the innovative work of Fadi x MMT's MTF Candles indicator
- **CISD Detection System** – Algorithmic identification of significant market structure reversals
- **Intelligent Session Level Management** – Automated consolidation of overlapping session markers for enhanced chart clarity
The result is a sophisticated yet streamlined analytical tool that delivers actionable market insights with minimal visual complexity.
---
## Feature Set
### Higher Timeframe Candle Analysis
Monitor higher timeframe price action seamlessly without chart switching. The indicator employs automatic HTF selection based on current timeframe, with manual override capability.
**Components:**
- **Primary HTF Display**: Automatically positioned adjacent to current price action
- **Secondary HTF Display**: Optional dual-timeframe analysis capability
- **Adaptive Time Labeling**: Context-aware formatting (intraday times, day names, week numbers)
- **Real-Time Countdown**: Optional timer displaying remaining time until HTF candle close
- **Customizable Color Schemes**: Full color customization for bullish and bearish candles
### CISD Detection (Change in State of Delivery)
The CISD system identifies critical inflection points where market structure undergoes directional change, signaling potential trend reversals or continuations.
**Mechanism:**
- **Market Structure Monitoring**: Continuous tracking of swing highs and lows
- **Liquidity Sweep Detection**: Identification of stop-hunt patterns preceding reversals
- **Reversal Confirmation**: Validation-based CISD level plotting upon structure break confirmation
- **Clear Visual Signals**: Bullish CISD (blue) and bearish CISD (red) demarcation
- **Optimized Display**: Default 5-bar line length (adjustable) minimizes chart clutter
**Technical Definition:**
CISD occurs when price breaches structure in one direction—typically sweeping liquidity and triggering stops—then reverses to break structure in the opposite direction, indicating a fundamental shift in market delivery bias.
### Intelligent Session Level Management
Eliminates visual clutter caused by overlapping session opens at identical price levels through automated consolidation.
**Functionality:**
- **Automatic Consolidation**: Merges multiple concurrent session opens into single reference lines
- **Combined Labeling**: Creates unified labels (e.g., "Week-Day Open," "4H-Day-Week Open")
- **Enhanced Clarity**: Maintains professional chart aesthetics while preserving all relevant information
**Supported Session Intervals:**
- 30-Minute Opens
- 4-Hour Opens
- Daily Opens
- Weekly Opens
- Monthly Opens
### Advanced Market Structure Tools
**Liquidity Sweep Identification:**
Highlights price wicks extending beyond previous HTF extremes that close within range—characteristic liquidity grab patterns.
**HTF Midpoint Reference:**
Displays the 50% retracement level of the most recent completed HTF candle, serving as a key reference for entries and profit targets.
**HTF Opening Price:**
Tracks current HTF candle open price, frequently functioning as dynamic support or resistance.
**Interval Demarcation:**
Visual separators defining HTF period boundaries for enhanced temporal clarity.
### Information Dashboard
Compact, customizable dashboard displaying:
- Current symbol and active timeframe
- HTF candle countdown timer
- Active trading session (Asia/London/New York)
- Current date and time
Flexible positioning: configurable for any chart corner.
---
## Default Configuration
Optimized settings for immediate professional-grade chart presentation:
- **Secondary HTF**: Disabled (enable for multi-timeframe comparative analysis)
- **CISD Bullish Color**: Blue (#0080ff) – optimal visibility with reduced eye strain
- **CISD Line Width**: 1 pixel – subtle yet discernible
- **CISD Line Length**: 5 bars – balanced visibility without excessive clutter
- **Session Opens**: Smart consolidation enabled – eliminates overlapping labels
---
## Application Strategies
### Trend Following
1. Monitor CISD confirmations aligned with HTF trend direction
2. Utilize HTF candle color for directional bias confirmation
3. Execute entries on pullbacks to HTF midpoint or open price levels
### Reversal Trading
1. Identify counter-trend CISD formations
2. Await HTF candle close confirming new directional bias
3. Use session opens as secondary confirmation levels
### Scalping
1. Trade exclusively in HTF candle direction
2. Employ lower timeframe CISD signals for precise entry timing
3. Target HTF midpoint or subsequent session open levels
### Structure-Based Trading
1. Mark liquidity sweep levels as potential reversal zones
2. Monitor CISD formations at key session opens
3. Confirm trend changes via HTF candle closes
---
## Customization Parameters
Comprehensive customization options:
- **Color Schemes**: Independent control of bull/bear candles, borders, CISD signals, session levels
- **Dimensional Settings**: Candle width, line thickness, label sizing
- **Display Quantities**: HTF candle count (1-10 range)
- **Positioning**: Candle offset, dashboard placement, label positioning
- **Line Styles**: Solid, dashed, or dotted rendering
- **Timeframe Selection**: Manual secondary HTF specification
---
## Attribution
**HTF Candle Visualization:**
The HTF candle rendering methodology draws inspiration from Fadi x MMT's "MTF Candles" indicator. Their elegant implementation of multi-timeframe candle visualization provided valuable reference for this development. Recognition and appreciation to their contribution to the TradingView community.
**CISD Detection:**
Proprietary CISD detection algorithm engineered to identify market structure transitions with high signal clarity and reduced false positive rate.
**Session Level Consolidation:**
Custom-developed intelligent grouping system addressing the common challenge of overlapping session labels at coincident price levels.
---
## Open Source License
This indicator is released as open source for the TradingView community. Permitted uses include:
- Implementation in live trading
- Educational study for Pine Script learning
- Personal modification and customization
- Distribution among trading communities
Community contributions, improvements, and derivative works are welcomed and encouraged.
---
## Implementation Guide
1. **Installation**: Click "Add to Chart"
2. **Configuration Access**: Open indicator settings panel
3. **Initial Use**: Default settings provide optimal starting configuration
4. **Optional Features**: Enable secondary HTF for multi-timeframe analysis
5. **Theme Integration**: Adjust color schemes to match chart aesthetics
---
## Best Practices
**Timeframe Optimization:**
- 1-5 minute charts: Optimal with 15m or 1H HTF
- 15-30 minute charts: Effective with 4H HTF
- 1-4 hour charts: Suitable for Daily HTF
- Daily charts: Best utilized with Weekly/Monthly HTF
**CISD Trading Guidelines:**
- Require CISD confirmation before position entry
- Prioritize CISD signals at significant levels (session opens, HTF midpoints)
- Confirm CISD direction aligns with HTF candle bias
- Apply contextual filtering—not all CISD signals warrant trades
**Session Open Strategy:**
- Weekly opens typically provide robust support/resistance
- Daily opens offer reliable intraday reference points
- 4-Hour opens effective for short-term scalping
- Consolidated labels (e.g., "Week-Day Open") indicate confluence zones with elevated significance
---
## Technical Specifications
**Performance Optimization:**
- Intelligent object management prevents TradingView rendering limits
- Efficient array processing for session consolidation
- Proper memory management through systematic object deletion
- Consistent performance across all timeframe ranges
**Compatibility:**
- Universal timeframe support
- Optimized for all market types (forex, stocks, crypto, futures)
- Minimal computational overhead
---
## Support & Development
**Feedback Channels:**
- Comment section for user feedback and suggestions
- Bug reports and feature requests welcomed
- Community-driven enhancement consideration
**Documentation:**
- Well-commented source code for learning purposes
- Clear section organization for easy navigation
- Comprehensive type definitions for structural clarity
- Educational value for market structure concept understanding
---
## Version Information
**Version:** 1.0 (Initial Release)
**License:** Open Source
**Category:** Multi-Timeframe Analysis | Market Structure
**Compatibility:** All Timeframes
**Language:** Pine Script v5
---
**For optimal results:**
- Provide feedback through comments
- Share with trading communities
- Submit enhancement suggestions
- Report technical issues for resolution
**Professional Support:**
Available through comment section for technical inquiries, implementation questions, and feature requests.
---
*Developed for the TradingView trading community | Professional-grade market structure analysis | Open source contribution*
## Professional Trading Indicator for Multi-Timeframe Market Structure Analysis
**HTF Candles Pro** is an advanced, open-source trading indicator that synthesizes Higher Timeframe (HTF) candle visualization with CISD (Change in State of Delivery) detection, providing comprehensive market structure analysis across multiple timeframes. Designed for traders at all experience levels—from scalpers to swing traders—this tool enables precise alignment of trades with higher timeframe momentum while identifying critical market structure transitions.
---
## Core Functionality
This indicator integrates three essential analytical frameworks:
- **HTF Candle Visualization** – Inspired by the innovative work of Fadi x MMT's MTF Candles indicator
- **CISD Detection System** – Algorithmic identification of significant market structure reversals
- **Intelligent Session Level Management** – Automated consolidation of overlapping session markers for enhanced chart clarity
The result is a sophisticated yet streamlined analytical tool that delivers actionable market insights with minimal visual complexity.
---
## Feature Set
### Higher Timeframe Candle Analysis
Monitor higher timeframe price action seamlessly without chart switching. The indicator employs automatic HTF selection based on current timeframe, with manual override capability.
**Components:**
- **Primary HTF Display**: Automatically positioned adjacent to current price action
- **Secondary HTF Display**: Optional dual-timeframe analysis capability
- **Adaptive Time Labeling**: Context-aware formatting (intraday times, day names, week numbers)
- **Real-Time Countdown**: Optional timer displaying remaining time until HTF candle close
- **Customizable Color Schemes**: Full color customization for bullish and bearish candles
### CISD Detection (Change in State of Delivery)
The CISD system identifies critical inflection points where market structure undergoes directional change, signaling potential trend reversals or continuations.
**Mechanism:**
- **Market Structure Monitoring**: Continuous tracking of swing highs and lows
- **Liquidity Sweep Detection**: Identification of stop-hunt patterns preceding reversals
- **Reversal Confirmation**: Validation-based CISD level plotting upon structure break confirmation
- **Clear Visual Signals**: Bullish CISD (blue) and bearish CISD (red) demarcation
- **Optimized Display**: Default 5-bar line length (adjustable) minimizes chart clutter
**Technical Definition:**
CISD occurs when price breaches structure in one direction—typically sweeping liquidity and triggering stops—then reverses to break structure in the opposite direction, indicating a fundamental shift in market delivery bias.
### Intelligent Session Level Management
Eliminates visual clutter caused by overlapping session opens at identical price levels through automated consolidation.
**Functionality:**
- **Automatic Consolidation**: Merges multiple concurrent session opens into single reference lines
- **Combined Labeling**: Creates unified labels (e.g., "Week-Day Open," "4H-Day-Week Open")
- **Enhanced Clarity**: Maintains professional chart aesthetics while preserving all relevant information
**Supported Session Intervals:**
- 30-Minute Opens
- 4-Hour Opens
- Daily Opens
- Weekly Opens
- Monthly Opens
### Advanced Market Structure Tools
**Liquidity Sweep Identification:**
Highlights price wicks extending beyond previous HTF extremes that close within range—characteristic liquidity grab patterns.
**HTF Midpoint Reference:**
Displays the 50% retracement level of the most recent completed HTF candle, serving as a key reference for entries and profit targets.
**HTF Opening Price:**
Tracks current HTF candle open price, frequently functioning as dynamic support or resistance.
**Interval Demarcation:**
Visual separators defining HTF period boundaries for enhanced temporal clarity.
### Information Dashboard
Compact, customizable dashboard displaying:
- Current symbol and active timeframe
- HTF candle countdown timer
- Active trading session (Asia/London/New York)
- Current date and time
Flexible positioning: configurable for any chart corner.
---
## Default Configuration
Optimized settings for immediate professional-grade chart presentation:
- **Secondary HTF**: Disabled (enable for multi-timeframe comparative analysis)
- **CISD Bullish Color**: Blue (#0080ff) – optimal visibility with reduced eye strain
- **CISD Line Width**: 1 pixel – subtle yet discernible
- **CISD Line Length**: 5 bars – balanced visibility without excessive clutter
- **Session Opens**: Smart consolidation enabled – eliminates overlapping labels
---
## Application Strategies
### Trend Following
1. Monitor CISD confirmations aligned with HTF trend direction
2. Utilize HTF candle color for directional bias confirmation
3. Execute entries on pullbacks to HTF midpoint or open price levels
### Reversal Trading
1. Identify counter-trend CISD formations
2. Await HTF candle close confirming new directional bias
3. Use session opens as secondary confirmation levels
### Scalping
1. Trade exclusively in HTF candle direction
2. Employ lower timeframe CISD signals for precise entry timing
3. Target HTF midpoint or subsequent session open levels
### Structure-Based Trading
1. Mark liquidity sweep levels as potential reversal zones
2. Monitor CISD formations at key session opens
3. Confirm trend changes via HTF candle closes
---
## Customization Parameters
Comprehensive customization options:
- **Color Schemes**: Independent control of bull/bear candles, borders, CISD signals, session levels
- **Dimensional Settings**: Candle width, line thickness, label sizing
- **Display Quantities**: HTF candle count (1-10 range)
- **Positioning**: Candle offset, dashboard placement, label positioning
- **Line Styles**: Solid, dashed, or dotted rendering
- **Timeframe Selection**: Manual secondary HTF specification
---
## Attribution
**HTF Candle Visualization:**
The HTF candle rendering methodology draws inspiration from Fadi x MMT's "MTF Candles" indicator. Their elegant implementation of multi-timeframe candle visualization provided valuable reference for this development. Recognition and appreciation to their contribution to the TradingView community.
**CISD Detection:**
Proprietary CISD detection algorithm engineered to identify market structure transitions with high signal clarity and reduced false positive rate.
**Session Level Consolidation:**
Custom-developed intelligent grouping system addressing the common challenge of overlapping session labels at coincident price levels.
---
## Open Source License
This indicator is released as open source for the TradingView community. Permitted uses include:
- Implementation in live trading
- Educational study for Pine Script learning
- Personal modification and customization
- Distribution among trading communities
Community contributions, improvements, and derivative works are welcomed and encouraged.
---
## Implementation Guide
1. **Installation**: Click "Add to Chart"
2. **Configuration Access**: Open indicator settings panel
3. **Initial Use**: Default settings provide optimal starting configuration
4. **Optional Features**: Enable secondary HTF for multi-timeframe analysis
5. **Theme Integration**: Adjust color schemes to match chart aesthetics
---
## Best Practices
**Timeframe Optimization:**
- 1-5 minute charts: Optimal with 15m or 1H HTF
- 15-30 minute charts: Effective with 4H HTF
- 1-4 hour charts: Suitable for Daily HTF
- Daily charts: Best utilized with Weekly/Monthly HTF
**CISD Trading Guidelines:**
- Require CISD confirmation before position entry
- Prioritize CISD signals at significant levels (session opens, HTF midpoints)
- Confirm CISD direction aligns with HTF candle bias
- Apply contextual filtering—not all CISD signals warrant trades
**Session Open Strategy:**
- Weekly opens typically provide robust support/resistance
- Daily opens offer reliable intraday reference points
- 4-Hour opens effective for short-term scalping
- Consolidated labels (e.g., "Week-Day Open") indicate confluence zones with elevated significance
---
## Technical Specifications
**Performance Optimization:**
- Intelligent object management prevents TradingView rendering limits
- Efficient array processing for session consolidation
- Proper memory management through systematic object deletion
- Consistent performance across all timeframe ranges
**Compatibility:**
- Universal timeframe support
- Optimized for all market types (forex, stocks, crypto, futures)
- Minimal computational overhead
---
## Support & Development
**Feedback Channels:**
- Comment section for user feedback and suggestions
- Bug reports and feature requests welcomed
- Community-driven enhancement consideration
**Documentation:**
- Well-commented source code for learning purposes
- Clear section organization for easy navigation
- Comprehensive type definitions for structural clarity
- Educational value for market structure concept understanding
---
## Version Information
**Version:** 1.0 (Initial Release)
**License:** Open Source
**Category:** Multi-Timeframe Analysis | Market Structure
**Compatibility:** All Timeframes
**Language:** Pine Script v5
---
**For optimal results:**
- Provide feedback through comments
- Share with trading communities
- Submit enhancement suggestions
- Report technical issues for resolution
**Professional Support:**
Available through comment section for technical inquiries, implementation questions, and feature requests.
---
*Developed for the TradingView trading community | Professional-grade market structure analysis | Open source contribution*
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.