VV Moving Average Convergence Divergence # VMACDv3 - Volume-Weighted MACD with A/D Divergence Detection
## Overview
**VMACDv3** (Volume-Weighted Moving Average Convergence Divergence Version 3) is a momentum indicator that applies volume-weighting to traditional MACD calculations on price, while using the Accumulation/Distribution (A/D) line for divergence detection. This hybrid approach combines volume-weighted price momentum with volume distribution analysis for comprehensive market insight.
## Key Features
- **Volume-Weighted Price MACD**: Traditional MACD calculation on price but weighted by volume for earlier signals
- **A/D Divergence Detection**: Identifies when A/D trend diverges from MACD momentum
- **Volume Strength Filtering**: Distinguishes high-volume confirmations from low-volume noise
- **Color-Coded Histogram**: 4-color system showing momentum direction and volume strength
- **Real-Time Alerts**: Background colors and alert conditions for bullish/bearish divergences
## Difference from ACCDv3
| Aspect | VMACDv3 | ACCDv3 |
|--------|---------|---------|
| **MACD Input** | **Price (Close)** | **A/D Line** |
| **Volume Weighting** | Applied to price | Applied to A/D line |
| **Primary Signal** | Volume-weighted price momentum | Volume distribution momentum |
| **Use Case** | Price momentum with volume confirmation | Volume flow and accumulation/distribution |
| **Sensitivity** | More responsive to price changes | More responsive to volume patterns |
| **Best For** | Trend following, breakouts | Volume analysis, smart money tracking |
**Key Insight**: VMACDv3 shows *where price is going* with volume weight, while ACCDv3 shows *where volume is accumulating/distributing*.
## Components
### 1. Volume-Weighted MACD on Price
Unlike standard MACD that uses simple price EMAs, VMACDv3 weights each price by its corresponding volume:
```
Fast Line = EMA(Price × Volume, 12) / EMA(Volume, 12)
Slow Line = EMA(Price × Volume, 26) / EMA(Volume, 26)
MACD = Fast Line - Slow Line
```
**Benefits of Volume Weighting**:
- High-volume price movements have greater impact
- Filters out low-volume noise and false moves
- Provides earlier trend change signals
- Better reflects institutional activity
### 2. Accumulation/Distribution (A/D) Line
Used for divergence detection, measuring buying/selling pressure:
```
A/D = Σ ((2 × Close - Low - High) / (High - Low)) × Volume
```
- **Rising A/D**: Accumulation (buying pressure)
- **Falling A/D**: Distribution (selling pressure)
- **Doji Handling**: When High = Low, contribution is zero
### 3. Signal Lines
- **MACD Line** (Blue, #2962FF): The fast-slow difference showing momentum
- **Signal Line** (Orange, #FF6D00): EMA or SMA smoothing of MACD
- **Zero Line**: Reference for bullish (above) vs bearish (below) bias
### 4. Histogram Color System
The histogram uses 4 distinct colors based on **direction** and **volume strength**:
| Condition | Color | Meaning |
|-----------|-------|---------|
| Rising + High Volume | **Dark Green** (#1B5E20) | Strong bullish momentum with volume confirmation |
| Rising + Low Volume | **Light Teal** (#26A69A) | Bullish momentum but weak volume (less reliable) |
| Falling + High Volume | **Dark Red** (#B71C1C) | Strong bearish momentum with volume confirmation |
| Falling + Low Volume | **Light Pink** (#FFCDD2) | Bearish momentum but weak volume (less reliable) |
Additional shading:
- **Light Cyan** (#B2DFDB): Positive but not rising (momentum stalling)
- **Bright Red** (#FF5252): Negative and accelerating down
### 5. Divergence Detection
VMACDv3 compares A/D trend against volume-weighted price MACD:
#### Bullish Divergence (Green Background)
- **Condition**: A/D is trending up BUT MACD is negative and trending down
- **Interpretation**: Volume is accumulating while price momentum appears weak
- **Signal**: Smart money accumulation, potential bullish reversal
- **Action**: Look for long entries, especially at support levels
#### Bearish Divergence (Red Background)
- **Condition**: A/D is trending down BUT MACD is positive and trending up
- **Interpretation**: Volume is distributing while price momentum appears strong
- **Signal**: Smart money distribution, potential bearish reversal
- **Action**: Consider exits, avoid new longs, watch for breakdown
## Parameters
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| **Source** | Close | OHLC/HLC3/etc | Price source for MACD calculation |
| **Fast Length** | 12 | 1-50 | Period for fast EMA (shorter = more sensitive) |
| **Slow Length** | 26 | 1-100 | Period for slow EMA (longer = smoother) |
| **Signal Smoothing** | 9 | 1-50 | Period for signal line (MACD smoothing) |
| **Signal Line MA Type** | EMA | SMA/EMA | Moving average type for signal calculation |
| **Volume MA Length** | 20 | 5-100 | Period for volume average (strength filter) |
## Usage Guide
### Reading the Indicator
1. **MACD Lines (Blue & Orange)**
- **Blue Line (MACD)**: Volume-weighted price momentum
- **Orange Line (Signal)**: Smoothed trend of MACD
- **Crossovers**: Blue crosses above orange = bullish, below = bearish
- **Distance**: Wider gap = stronger momentum
- **Zero Line Position**: Above = bullish bias, below = bearish bias
2. **Histogram Colors**
- **Dark Green (#1B5E20)**: Strong bullish move with high volume - **most reliable buy signal**
- **Light Teal (#26A69A)**: Bullish but low volume - wait for confirmation
- **Dark Red (#B71C1C)**: Strong bearish move with high volume - **most reliable sell signal**
- **Light Pink (#FFCDD2)**: Bearish but low volume - may be temporary dip
3. **Background Divergence Alerts**
- **Green Background**: A/D accumulating while price weak - potential bottom
- **Red Background**: A/D distributing while price strong - potential top
- Most powerful at key support/resistance levels
### Trading Strategies
#### Strategy 1: Volume-Confirmed Trend Following
1. Wait for MACD to cross above zero line
2. Look for **dark green** histogram bars (high volume confirmation)
3. Enter long on second consecutive dark green bar
4. Hold while histogram remains green
5. Exit when histogram turns light green or red appears
6. Set stop below recent swing low
**Example**:
```
Price: 26,400 → 26,450 (rising)
MACD: -50 → +20 (crosses zero)
Histogram: Light teal → Dark green → Dark green
Volume: 50k → 75k → 90k (increasing)
```
#### Strategy 2: Divergence Reversal Trading
1. Identify divergence background (green = bullish, red = bearish)
2. Confirm with price structure (support/resistance, chart patterns)
3. Wait for MACD to cross signal line in divergence direction
4. Enter on first **dark colored** histogram bar after divergence
5. Set stop beyond divergence area
6. Target previous swing high/low
**Example - Bullish Divergence**:
```
Price: Making lower lows (26,350 → 26,300 → 26,250)
A/D: Rising (accumulation)
MACD: Below zero but starting to curve up
Background: Green shading appears
Entry: MACD crosses signal line + dark green bar
Stop: Below 26,230
Target: 26,450 (previous high)
```
#### Strategy 3: Momentum Scalping
1. Trade only in direction of MACD zero line (above = long, below = short)
2. Enter on dark colored bars only
3. Exit on first light colored bar or opposite color
4. Quick in and out (1-5 minute holds)
5. Tight stops (0.2-0.5% depending on instrument)
#### Strategy 4: Histogram Pattern Trading
**V-Bottom Reversal (Bullish)**:
- Red histogram bars start rising (becoming less negative)
- Forms "V" shape at the bottom
- Transitions to light red → light teal → **dark green**
- Entry: First dark green bar
- Signal: Momentum reversal with volume
**Λ-Top Reversal (Bearish)**:
- Green histogram bars start falling (becoming less positive)
- Forms inverted "V" at the top
- Transitions to light green → light pink → **dark red**
- Entry: First dark red bar
- Signal: Momentum exhaustion with volume
### Multi-Timeframe Analysis
**Recommended Approach**:
1. **Higher Timeframe (15m/1h)**: Identify overall trend direction
2. **Trading Timeframe (5m)**: Time entries using VMACDv3 signals
3. **Lower Timeframe (1m)**: Fine-tune entry prices
**Example Setup**:
```
15-minute: MACD above zero (bullish bias)
5-minute: Dark green histogram appears after pullback
1-minute: Enter on break of recent high with volume
```
### Volume Strength Interpretation
The volume filter compares current volume to 20-period average:
- **Volume > Average**: Dark colors (green/red) - high confidence signals
- **Volume < Average**: Light colors (teal/pink) - lower confidence signals
**Trading Rules**:
- ✓ **Aggressive**: Take all dark colored signals
- ✓ **Conservative**: Only take dark colors that follow 2+ light colors of same type
- ✗ **Avoid**: Trading light colored signals during high volatility
- ✗ **Avoid**: Ignoring volume context during news events
## Technical Details
### Volume-Weighted Calculation
```pine
// Volume-weighted fast EMA
fast_ma = ta.ema(src * volume, fast_length) / ta.ema(volume, fast_length)
// Volume-weighted slow EMA
slow_ma = ta.ema(src * volume, slow_length) / ta.ema(volume, slow_length)
// MACD is the difference
macd = fast_ma - slow_ma
// Signal line smoothing
signal = ta.ema(macd, signal_length) // or ta.sma() if SMA selected
// Histogram
hist = macd - signal
```
### Divergence Detection Logic
```pine
// A/D trending up if above its 5-period SMA
ad_trend = ad > ta.sma(ad, 5)
// MACD trending up if above zero
macd_trend = macd > 0
// Divergence when trends oppose each other
divergence = ad_trend != macd_trend
// Specific conditions for alerts
bullish_divergence = ad_trend and not macd_trend and macd < 0
bearish_divergence = not ad_trend and macd_trend and macd > 0
```
### Histogram Coloring Logic
```pine
hist_color = (hist >= 0
? (hist < hist
? (vol_strength ? #1B5E20 : #26A69A) // Rising: dark/light green
: #B2DFDB) // Positive but falling: cyan
: (hist < hist
? (vol_strength ? #B71C1C : #FFCDD2) // Rising (less negative): dark/light red
: #FF5252)) // Falling more: bright red
```
## Alerts
Built-in alert conditions for divergence detection:
### Bullish Divergence Alert
- **Trigger**: A/D trending up, MACD negative and trending down
- **Message**: "Bullish Divergence: A/D trending up but MACD trending down"
- **Use Case**: Potential reversal or continuation after pullback
- **Action**: Look for long entry setups
### Bearish Divergence Alert
- **Trigger**: A/D trending down, MACD positive and trending up
- **Message**: "Bearish Divergence: A/D trending down but MACD trending up"
- **Use Case**: Potential top or trend reversal
- **Action**: Consider exits or short entries
### Setting Up Alerts
1. Click "Create Alert" in TradingView
2. Condition: Select "VMACDv3"
3. Choose alert type: "Bullish Divergence" or "Bearish Divergence"
4. Configure: Email, SMS, webhook, or popup
5. Set frequency: "Once Per Bar Close" recommended
## Comparison Tables
### VMACDv3 vs Standard MACD
| Feature | Standard MACD | VMACDv3 |
|---------|---------------|---------|
| **Price Weighting** | Equal weight all bars | Volume-weighted |
| **Sensitivity** | Fixed | Adaptive to volume |
| **False Signals** | More during low volume | Fewer (volume filter) |
| **Divergence** | Price vs MACD | A/D vs MACD |
| **Volume Analysis** | None | Built-in |
| **Color System** | 2 colors | 4+ colors |
| **Best For** | Simple trend following | Volume-confirmed trading |
### VMACDv3 vs ACCDv3
| Aspect | VMACDv3 | ACCDv3 |
|--------|---------|--------|
| **Focus** | Price momentum | Volume distribution |
| **Reactivity** | Faster to price moves | Faster to volume shifts |
| **Best Markets** | Trending, breakouts | Accumulation/distribution phases |
| **Signal Type** | Where price + volume going | Where smart money positioning |
| **Divergence Meaning** | Volume vs price disagreement | A/D vs momentum disagreement |
| **Use Together?** | ✓ Yes, complementary | ✓ Yes, different perspectives |
## Example Trading Scenarios
### Scenario 1: Strong Bullish Breakout
```
Time: 9:30 AM (market open)
Price: Breaks above 26,400 resistance
MACD: Crosses above zero line
Histogram: Dark green bars (#1B5E20)
Volume: 2x average (150k vs 75k avg)
A/D: Rising (no divergence)
Action: Enter long at 26,405
Stop: 26,380 (below breakout)
Target 1: 26,450 (risk:reward 1:2)
Target 2: 26,500 (risk:reward 1:4)
Result: High probability setup with volume confirmation
```
### Scenario 2: False Breakout (Avoided)
```
Time: 2:30 PM (slow period)
Price: Breaks above 26,400 resistance
MACD: Slightly positive
Histogram: Light teal bars (#26A69A)
Volume: 0.5x average (40k vs 75k avg)
A/D: Flat/declining
Action: Avoid trade
Reason: Low volume, no conviction, potential false breakout
Outcome: Price reverses back below 26,400 within 10 minutes
Saved: Avoided losing trade due to volume filter
```
### Scenario 3: Bullish Divergence Bottom
```
Time: 11:00 AM
Price: Making lower lows (26,350 → 26,300 → 26,280)
MACD: Below zero but curving upward
Histogram: Red bars getting shorter (V-bottom forming)
Background: Green shading (divergence alert)
A/D: Rising despite price falling
Volume: Increasing on down bars
Setup:
1. Divergence appears at 26,280 (green background)
2. Wait for MACD to cross signal line
3. First dark green bar appears at 26,290
4. Enter long: 26,295 (next bar open)
5. Stop: 26,265 (below divergence low)
6. Target: 26,350 (previous swing high)
Result: +55 points (30 point risk, 1.8:1 reward)
Key: Divergence + volume confirmation = high probability reversal
```
### Scenario 4: Bearish Divergence Top
```
Time: 1:45 PM
Price: Making higher highs (26,500 → 26,520 → 26,540)
MACD: Positive but flattening
Histogram: Green bars getting shorter (Λ-top forming)
Background: Red shading (bearish divergence)
A/D: Declining despite rising price
Volume: Decreasing on up bars
Setup:
1. Bearish divergence at 26,540 (red background)
2. MACD crosses below signal line
3. First dark red bar appears at 26,535
4. Enter short: 26,530
5. Stop: 26,555 (above divergence high)
6. Target: 26,475 (support level)
Result: +55 points (25 point risk, 2.2:1 reward)
Key: Distribution while price rising = smart money exiting
```
### Scenario 5: V-Bottom Reversal
```
Downtrend in progress
MACD: Deep below zero (-150)
Histogram: Series of dark red bars
Pattern Development:
Bar 1: Dark red, hist = -80, falling
Bar 2: Dark red, hist = -95, falling
Bar 3: Dark red, hist = -100, falling (extreme)
Bar 4: Light pink, hist = -98, rising!
Bar 5: Light pink, hist = -90, rising
Bar 6: Light teal, hist = -75, rising (crosses to positive momentum)
Bar 7: Dark green, hist = -55, rising + volume
Action: Enter long on Bar 7
Reason: V-bottom confirmed with volume
Stop: Below Bar 3 low
Target: Zero line on histogram (mean reversion)
```
## Best Practices
### Entry Rules
✓ **Wait for dark colors**: High-volume confirmation is key
✓ **Confirm divergences**: Use with price support/resistance
✓ **Trade with zero line**: Long above, short below for best odds
✓ **Multiple timeframes**: Align 1m, 5m, 15m signals
✓ **Watch for patterns**: V-bottoms and Λ-tops are reliable
### Exit Rules
✓ **Partial profits**: Take 50% at first target
✓ **Trail stops**: Use histogram color changes
✓ **Respect signals**: Exit on opposite dark color
✓ **Time stops**: Close positions before major news
✓ **End of day**: Square up before close
### Avoid
✗ **Don't chase light colors**: Low volume = low confidence
✗ **Don't ignore divergence**: Early warning system
✗ **Don't overtrade**: Wait for clear setups
✗ **Don't fight the trend**: Zero line dictates bias
✗ **Don't skip stops**: Always use risk management
## Risk Management
### Position Sizing
- **Dark green/red signals**: 1-2% account risk
- **Light signals**: 0.5% account risk or skip
- **Divergence plays**: 1% account risk (higher uncertainty)
- **Multiple confirmations**: Up to 2% account risk
### Stop Loss Placement
- **Trend trades**: Below/above recent swing (20-30 points typical)
- **Breakout trades**: Below/above breakout level (15-25 points)
- **Divergence trades**: Beyond divergence extreme (25-40 points)
- **Scalp trades**: Tight stops at 10-15 points
### Profit Targets
- **Minimum**: 1.5:1 reward to risk ratio
- **Scalps**: 15-25 points (quick in/out)
- **Swing**: 50-100 points (hold through pullbacks)
- **Runners**: Trail with histogram color changes
## Timeframe Recommendations
| Timeframe | Trading Style | Typical Hold | Advantages | Challenges |
|-----------|---------------|--------------|------------|------------|
| **1-minute** | Scalping | 1-5 minutes | Fast profits, many setups | Noisy, high false signals |
| **5-minute** | Intraday | 15-60 minutes | Balance of speed/clarity | Still requires quick decisions |
| **15-minute** | Swing | 1-4 hours | Clearer trends, less noise | Fewer opportunities |
| **1-hour** | Position | 4-24 hours | Strong signals, less monitoring | Wider stops required |
**Recommendation**: Start with 5-minute for best balance of signal quality and opportunity frequency.
## Combining with Other Indicators
### VMACDv3 + ACCDv3
- **Use**: Confirm volume flow with price momentum
- **Signal**: Both showing dark green = highest conviction long
- **Divergence**: VMACDv3 bullish + ACCDv3 bearish = examine price action
### VMACDv3 + RSI
- **Use**: Overbought/oversold with momentum confirmation
- **Signal**: RSI < 30 + dark green VMACD = strong reversal
- **Caution**: RSI > 70 + light green VMACD = potential false breakout
### VMACDv3 + Elder Impulse
- **Use**: Bar coloring + histogram confirmation
- **Signal**: Green Elder bars + dark green VMACD = aligned momentum
- **Exit**: Blue Elder bars + light colors = momentum stalling
## Limitations
- **Requires volume data**: Will not work on instruments without volume feed
- **Lagging indicator**: MACD inherently follows price (2-3 bar delay)
- **Consolidation noise**: Generates false signals in tight ranges
- **Gap handling**: Large gaps can distort volume-weighted values
- **Not standalone**: Should combine with price action and support/resistance
## Troubleshooting
**Problem**: Too many light colored signals
**Solution**: Increase Volume MA Length to 30-40 for stricter filtering
**Problem**: Missing entries due to waiting for dark colors
**Solution**: Lower Volume MA Length to 10-15 for more signals (accept lower quality)
**Problem**: Divergences not appearing
**Solution**: Verify volume data available; check if A/D line is calculating
**Problem**: Histogram colors not changing
**Solution**: Ensure real-time data feed; refresh indicator
## Version History
- **v3**: Removed traditional MACD, using volume-weighted MACD on price with A/D divergence
- **v2**: Added A/D divergence detection, volume strength filtering, enhanced histogram colors
- **v1**: Basic volume-weighted MACD on price
## Related Indicators
**Companion Tools**:
- **ACCDv3**: Volume-weighted MACD on A/D line (distribution focus)
- **RSIv2**: RSI with A/D divergence detection
- **DMI**: Directional Movement Index with A/D divergence
- **Elder Impulse**: Bar coloring system using volume-weighted MACD
**Use Together**: VMACDv3 (momentum) + ACCDv3 (distribution) + Elder Impulse (bar colors) = complete volume-based trading system
---
*This indicator is for educational purposes. Past performance does not guarantee future results. Always practice proper risk management and never risk more than you can afford to lose.*
Chỉ báo và chiến lược
ACCDv3# ACCDv3 - Accumulation/Distribution MACD with Divergence Detection
## Overview
**ACCDv3** (Accumulation/Distribution MACD Version 3) is an advanced volume-weighted momentum indicator that combines the Accumulation/Distribution (A/D) line with MACD methodology and divergence detection. It helps identify trend strength, momentum shifts, and potential reversals by analyzing volume-weighted price movements.
## Key Features
- **Volume-Weighted MACD**: Applies MACD calculation to volume-weighted A/D values for earlier, more reliable signals
- **Divergence Detection**: Identifies when A/D trend diverges from MACD momentum
- **Volume Strength Filtering**: Distinguishes high-volume confirmations from low-volume noise
- **Color-Coded Histogram**: 4-color system showing momentum direction and volume strength
- **Real-Time Alerts**: Background colors and alert conditions for bullish/bearish divergences
## Components
### 1. Accumulation/Distribution (A/D) Line
The A/D line measures buying and selling pressure by comparing the close price to the trading range, weighted by volume:
```
A/D = Σ ((2 × Close - Low - High) / (High - Low)) × Volume
```
- **Rising A/D**: More accumulation (buying pressure)
- **Falling A/D**: More distribution (selling pressure)
- **Doji Handling**: When High = Low, contribution is zero (avoids division errors)
### 2. Volume-Weighted MACD
Instead of simple EMAs, the indicator weights A/D values by volume:
- **Fast Line** (default 12): `EMA(A/D × Volume, 12) / EMA(Volume, 12)`
- **Slow Line** (default 26): `EMA(A/D × Volume, 26) / EMA(Volume, 26)`
- **MACD Line**: Fast Line - Slow Line (green line)
- **Signal Line** (default 9): EMA or SMA of MACD (orange line)
- **Histogram**: MACD - Signal (color-coded columns)
This volume-weighting ensures that periods with higher volume have greater influence on the indicator values.
### 3. Histogram Color System
The histogram uses 4 distinct colors based on **direction** and **volume strength**:
| Condition | Color | Meaning |
|-----------|-------|---------|
| Rising + High Volume | **Dark Green** (#1B5E20) | Strong bullish momentum with volume confirmation |
| Rising + Low Volume | **Light Teal** (#26A69A) | Bullish momentum but weak volume (less reliable) |
| Falling + High Volume | **Dark Red** (#B71C1C) | Strong bearish momentum with volume confirmation |
| Falling + Low Volume | **Light Red/Pink** (#FFCDD2) | Bearish momentum but weak volume (less reliable) |
Additional shading:
- **Light Cyan** (#B2DFDB): Positive but not rising (momentum stalling)
- **Bright Red** (#FF5252): Negative and accelerating down
### 4. Divergence Detection
Divergence occurs when A/D trend and MACD momentum move in opposite directions:
#### Bullish Divergence (Green Background)
- **Condition**: A/D is trending up BUT MACD is negative and trending down
- **Interpretation**: Accumulation increasing while momentum appears weak
- **Signal**: Potential bullish reversal or continuation
- **Action**: Look for entry opportunities or hold long positions
#### Bearish Divergence (Red Background)
- **Condition**: A/D is trending down BUT MACD is positive and trending up
- **Interpretation**: Distribution increasing while momentum appears strong
- **Signal**: Potential bearish reversal or weakening uptrend
- **Action**: Consider exits, tighten stops, or prepare for reversal
## Parameters
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| **Fast Length** | 12 | 1-50 | Period for fast EMA (shorter = more sensitive) |
| **Slow Length** | 26 | 1-100 | Period for slow EMA (longer = smoother) |
| **Signal Smoothing** | 9 | 1-50 | Period for signal line (MACD smoothing) |
| **Signal Line MA Type** | EMA | SMA/EMA | Moving average type for signal calculation |
| **Volume MA Length** | 20 | 5-100 | Period for volume average (strength filter) |
## Usage Guide
### Reading the Indicator
1. **MACD Lines (Green & Orange)**
- **Crossovers**: When green crosses above orange = bullish, below = bearish
- **Distance**: Wider gap = stronger momentum
- **Zero Line**: Above = bullish bias, below = bearish bias
2. **Histogram Colors**
- Focus on **dark colors** (dark green/red) for high-confidence signals
- Be cautious with **light colors** (teal/pink) - wait for volume confirmation
- Watch for **rising red bars** (V-bottom pattern) = potential bullish reversal
- Watch for **falling green bars** (Λ-top pattern) = potential bearish reversal
3. **Background Divergence Alerts**
- **Green background**: Bullish divergence - consider long entries
- **Red background**: Bearish divergence - consider exits or shorts
- Best used in combination with price action and support/resistance levels
### Trading Strategies
#### Trend Following
1. Wait for MACD to cross above zero line with dark green histogram
2. Enter long when histogram shows consecutive dark green bars
3. Exit when histogram turns light green or red appears
#### Divergence Trading
1. Wait for background divergence alert (green or red)
2. Confirm with price action (support/resistance, candlestick patterns)
3. Enter on next dark-colored histogram bar in divergence direction
4. Set stops beyond recent swing high/low
#### Volume Confirmation
1. Ignore signals during low-volume periods (light colors)
2. Take aggressive positions during high-volume confirmations (dark colors)
3. Use volume strength as position sizing guide (larger size on dark bars)
### Best Practices
✓ **Combine with price action**: Don't rely on indicator alone
✓ **Wait for dark colors**: High-volume bars are more reliable
✓ **Watch for divergences**: Early warning signs of reversals
✓ **Use multiple timeframes**: Confirm signals across 1m, 5m, 15m
✓ **Respect zero line**: Trading direction should align with MACD side
✗ **Don't chase light-colored signals**: Low volume = lower reliability
✗ **Don't ignore context**: Market structure and levels matter
✗ **Don't over-trade**: Wait for clear, high-volume setups
✗ **Don't ignore alerts**: Divergences are early warnings
## Technical Details
### Volume-Weighted Calculation Method
Traditional MACD uses simple price EMAs. ACCDv3 weights each A/D value by its corresponding volume:
```pine
// Volume-weighted fast EMA
close_vol_fast = ta.ema(ad × volume, fast_length)
vol_fast = ta.ema(volume, fast_length)
vw_ad_fast = close_vol_fast / vol_fast
// Same for slow EMA
close_vol_slow = ta.ema(ad × volume, slow_length)
vol_slow = ta.ema(volume, slow_length)
vw_ad_slow = close_vol_slow / vol_slow
// MACD is the difference
macd = vw_ad_fast - vw_ad_slow
```
This ensures high-volume periods have proportionally more impact on the indicator.
### Volume Strength Filter
Determines whether current volume is above or below average:
```pine
vol_avg = ta.sma(volume, vol_length)
vol_strength = volume > vol_avg
```
Used to select dark (high volume) vs light (low volume) histogram colors.
### Divergence Logic
```pine
// A/D trending up if above its 5-period SMA
ad_trend = ad > ta.sma(ad, 5)
// MACD trending up if above zero
macd_trend = macd > 0
// Divergence when trends oppose
divergence = ad_trend != macd_trend
// Specific conditions
bullish_divergence = ad_trend and not macd_trend and macd < 0
bearish_divergence = not ad_trend and macd_trend and macd > 0
```
## Alerts
The indicator includes built-in alert conditions:
- **Bullish Divergence**: "Bullish Divergence: A/D trending up but MACD trending down"
- **Bearish Divergence**: "Bearish Divergence: A/D trending down but MACD trending up"
To enable:
1. Click "Create Alert" button in TradingView
2. Select "ACCDv3" as condition
3. Choose "Bullish Divergence" or "Bearish Divergence"
4. Configure notification method (popup, email, webhook, etc.)
## Comparison with Standard MACD
| Feature | Standard MACD | ACCDv3 |
|---------|---------------|---------|
| **Input** | Close price | Accumulation/Distribution line |
| **Weighting** | Simple EMA | Volume-weighted EMA |
| **Divergence** | Price vs MACD | A/D vs MACD |
| **Volume Analysis** | None | Built-in strength filter |
| **Color System** | 2 colors (up/down) | 4+ colors (direction + volume) |
| **Leading/Lagging** | Lagging | More leading (volume-weighted) |
## Example Scenarios
### Scenario 1: Strong Bullish Signal
- **Chart**: MACD crosses above zero line
- **Histogram**: Dark green bars (#1B5E20) appearing
- **Volume**: Above 20-period average
- **Action**: Enter long, strong momentum with volume confirmation
### Scenario 2: Weak Bearish Signal
- **Chart**: MACD crosses below zero line
- **Histogram**: Light pink bars (#FFCDD2) appearing
- **Volume**: Below 20-period average
- **Action**: Avoid shorting, low volume = unreliable signal
### Scenario 3: Bullish Divergence Reversal
- **Chart**: Price making lower lows
- **Indicator**: A/D line trending up, MACD negative
- **Background**: Green shading appears
- **Histogram**: Transitions from red to dark green
- **Action**: Look for long entry on next dark green bar
### Scenario 4: V-Bottom Reversal
- **Chart**: Downtrend in place
- **Histogram**: Red bars start rising (becoming less negative)
- **Pattern**: Forms "V" shape at bottom
- **Confirmation**: Transitions to dark green bars
- **Action**: Bullish reversal signal, consider long entry
## Timeframe Recommendations
- **1-minute**: Scalping, very fast signals (noisy, use with caution)
- **5-minute**: Intraday momentum trading (recommended)
- **15-minute**: Swing entries, clearer trend signals
- **1-hour+**: Position trading, major trend identification
## Limitations
- **Requires volume data**: Will not work on instruments without volume
- **Lag during consolidation**: MACD is inherently trend-following
- **False signals in chop**: Sideways markets generate noise
- **Not a standalone system**: Should be combined with price action and risk management
## Version History
- **v3**: Removed traditional price MACD, using only volume-weighted A/D MACD with A/D divergence
- **v2**: Added A/D divergence detection, volume strength filtering, enhanced histogram colors
- **v1**: Basic MACD on A/D line with volume-weighted calculation
## Support & Further Reading
For questions, updates, or to report issues, refer to the main project documentation or contact the developer.
**Related Indicators in Suite:**
- **VMACDv3**: Volume-weighted MACD on price (not A/D)
- **RSIv2**: RSI with A/D divergence
- **DMI**: Directional Movement Index with A/D divergence
- **Elder Impulse**: Bar coloring system using volume-weighted MACD
---
*This indicator is for educational purposes. Always practice proper risk management and never risk more than you can afford to lose.*
CRT with sessions (by Simonezzi)original version is by Flux Charts. I just added sessions, so it was easier to trade on demand and not get signals at the wrong time.
Sessions added - Asian, London and NY.
CISD by tncylyvCISD (Change in State of Delivery) by tncylyv
The CISD (Change in State of Delivery) indicator is a precision price action tool designed to help traders identify key reversal points based on ICT concepts. Unlike standard support and resistance indicators, this script tracks the specific algorithmic opening prices responsible for the current delivery state and highlights when that state has been invalidated.
🧠 What is CISD?
Change in State of Delivery refers to the moment price shifts from a Buy Program to a Sell Program (or vice versa).
• Bearish CISD (-CISD): Occurs when price closes below the opening price of the up-candle sequence that created the most recent High.
• Bullish CISD (+CISD): Occurs when price closes above the opening price of the down-candle sequence that created the most recent Low.
This indicator automates the identification of these levels, tracking the "Active" reference price in real-time and marking historical reversals.
🚀 Key Features
1. Continuous Active Level Tracking:
o The indicator plots a continuous, stepped line (The "Active CISD") that follows the market structure. As the market expands (makes new highs or lows), the line updates to the new valid reference point.
o This allows you to see the current invalidation level at a glance without cluttering the chart with old lines.
2. Triggered Reversal Lines:
o When a candle closes beyond the Active CISD level, a "Triggered" line is drawn to mark the exact price and location of the reversal.
o These lines serve as excellent historical references for potential Order Blocks or Breakers later in time.
3. Smart Filtering:
o You can choose to display Both Bullish and Bearish setups, or filter to see Bullish Only or Bearish Only. This is ideal for traders who have a specific daily bias and want to remove noise from the chart.
4. Clean & Customizable:
o Fully customizable colors for Bullish and Bearish events.
o Options to toggle Labels, adjust Line Width, and change Line Styles (Solid, Dashed, Dotted).
o "No Continuation" Logic: This version focuses purely on major reversals (Change in State) rather than minor pullbacks, keeping your chart clean.
⚙️ Settings Guide
• Show Active CISD Level: Toggles the continuous stepped line representing the current threshold for a reversal.
• Triggered CISD Display: Choose between Both, Bullish Only, Bearish Only, or None. This controls the historical lines left behind after a reversal occurs.
• Visual Settings: Adjust line width, label sizes, and font styles to match your chart aesthetic.
• Colors: Customize the Shrek Mode (Bullish) and Blood Bath (Bearish) colors.
⚠️ A Note for Developers
This indicator is open source! If you are a Pine Script developer, feel free to check the source code. I’ve utilized some... creative variable naming conventions to make the coding experience more entertaining. Enjoy the read!
________________________________________
Risk Disclaimer: This tool is for educational purposes and market analysis. It does not guarantee future performance. Always manage your risk.
Moving Average ExponentialThe EMA 50 Trend Filter At the heart of the Sniper system lies the 50-period Exponential Moving Average. Unlike simple moving averages, the EMA applies a weighting factor to recent price data, significantly reducing lag. Role in Strategy:
Trend Identification: Serves as the binary divider between Long and Short bias.
Dynamic Structure: Acts as dynamic support in uptrends and resistance in downtrends.
Signal Filtering: The algorithm automatically suppresses any 'Buy' signals below the line and 'Sell' signals above it, ensuring you never trade against the institutional momentum.
Ashok 07 Dec 25 updated scriptTried to fix the bugs in previous script. Even now improvements are needed, but for now it looks reasonably profiting.
Volume Threshold Levels - Crypto LidyaVolume Threshold Levels – Crypto Lidya
Understanding volume behavior is one of the most effective ways to detect trend changes, manipulation candles, aggressive entries, and institutional activity.
Volume Threshold Levels (VTL) not only displays raw volume but also calculates dynamic volume thresholds (2x – 3x – 4x) based on the moving average, allowing you to identify statistically meaningful volume anomalies with precision.
📌 1. Volume Columns
The indicator plots each bar’s volume using traditional column-style visualization.
Green: Bullish candle
Red: Bearish candle
Gray: Neutral candle
This helps traders clearly understand the relationship between price and volume.
📌 2. Average Volume Area
VTL offers two types of moving averages for volume:
SMA (Simple Moving Average)
EMA (Exponential Moving Average)
The average volume is drawn as a soft yellow area across the chart.
This area acts as the baseline for normal volume levels.
📌 3. Dynamic Threshold Lines (2x / 3x / 4x)
The script calculates and displays multipliers of the average volume:
2x Average
3x Average
4x Average
These levels appear as bright yellow lines.
They are extremely useful for identifying breakouts, traps, and aggressive institutional entries.
📌 4. Volume Spike Detection (Alerts)
VTL identifies upward crossovers where volume breaks above key levels:
1x Volume Signal
2x Volume Signal
3x Volume Signal
4x Volume Signal
These can be used directly as TradingView alerts.
This allows you to automate detection of high-impact volume spikes.
📌 5. Use Cases
The indicator performs exceptionally well in:
Breakout confirmation
Liquidity sweep analysis
Detecting manipulation candles
Combining with OB, FVG, or other SMC structures
Scalping and low-timeframe aggressive volume interpretation
Algorithmic filters for volume-based strategies
📌 6. Summary
VTL delivers:
✔ Dynamic average volume baseline
✔ Clear 2x–3x–4x volume thresholds
✔ Accurate detection of upside volume explosions
✔ A strong tool for traders who rely on volume confirmation
Completely open-source and ready to be extended.
Perfect Trade Screener – Merthan KRYPTO PRO (v6) for cryptoPerfect Trade Screener – Merthan KRYPTO PRO (v6) for crypto
LibBarLibBar is a lightweight and practical Pine Script library designed to simplify candlestick analysis.
It provides a set of helper functions for identifying candle type, measuring body and wick sizes, and evaluating candle structure.
Perfect for building indicators, pattern detectors, or any script that relies on detailed bar-level analysis.
Available Functions
isBull(index) - Returns true if the bar is bullish.
isBear(index) - Returns true if the bar is bearish.
getBody(index) - Returns the candle’s body size.
getUpperWick(index) - Returns the size of the upper wick.
getLowerWick(index) - Returns the size of the lower wick.
getSize(index) - Returns the total candle size (high − low).
getBodyPercentage(index) - Returns the body size as a percentage of total candle size.
getUpperWickPercentage(index) - Returns the upper wick size as a percentage of the candle.
getLowerWickPercentage(index) - Returns the lower wick size as a percentage of the candle.
Trend Strength Meter [Eˣ]📊 Trend Strength Meter - Free Indicator
Overview
The Trend Strength Meter quantifies market momentum with a simple 0-100 score. No more guessing if a trend is strong or weak - this indicator gives you an objective, numerical measurement of trend strength that combines trend direction, momentum, volatility, and moving average alignment into one clear reading.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 What This Indicator Does
Quantifies Trend Strength:
• Measures trend on a scale from -100 (extreme bearish) to +100 (extreme bullish)
• Combines 4 key components: Trend Direction, Momentum, Volatility, MA Alignment
• Provides objective measurement instead of subjective interpretation
• Works on all timeframes and instruments
Visual Display:
• Green Histogram Bars = Bullish strength (0 to +100)
• Red Histogram Bars = Bearish strength (0 to -100)
• Smooth Overlay Line = Trend direction (filters noise)
• Triangle Markers = Trend reversals (zero-line crosses)
• Background Zones = Visual strength categories
Multi-Timeframe Analysis:
• See strength readings from 3 timeframes simultaneously
• Identify when trends align across multiple timeframes
• "ALIGNED" indicator shows when all timeframes agree
• Spot divergences between timeframes
Clean & Professional:
• Minimal clutter, maximum clarity
• Compact info panel in top-right corner
• No overwhelming indicators or text
• Easy to read at a glance
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Understanding The Strength Scale
Bullish Readings (0 to +100)
+75 to +100 - VERY STRONG BULL
• Extremely powerful uptrend
• All components aligned bullishly
• Best time for aggressive long positions
• Trend likely to continue
• Strategy: Hold longs, avoid shorts
+50 to +75 - STRONG BULL
• Strong uptrend with good momentum
• High probability of continuation
• Quality long setups
• Pullbacks are buying opportunities
• Strategy: Enter longs on dips
+25 to +50 - BULL
• Moderate bullish trend
• Decent upward momentum
• Trend following longs work
• Watch for weakening signals
• Strategy: Ride the trend, trail stops
+10 to +25 - WEAK BULL
• Weak bullish bias
• Trend may be exhausting
• Lower probability setups
• Consider taking profits
• Strategy: Caution, reduce position sizes
-10 to +10 - NEUTRAL
• No clear trend
• Choppy, range-bound market
• Conflicting signals
• Low probability for trend trades
• Strategy: Stay flat or trade ranges
Bearish Readings (0 to -100)
-10 to -25 - WEAK BEAR
• Weak bearish bias
• Trend may be exhausting
• Lower probability setups
• Consider taking profits on shorts
• Strategy: Caution, reduce position sizes
-25 to -50 - BEAR
• Moderate bearish trend
• Decent downward momentum
• Trend following shorts work
• Watch for weakening signals
• Strategy: Ride the trend down, trail stops
-50 to -75 - STRONG BEAR
• Strong downtrend with momentum
• High probability of continuation
• Quality short setups
• Bounces are selling opportunities
• Strategy: Enter shorts on rallies
-75 to -100 - VERY STRONG BEAR
• Extremely powerful downtrend
• All components aligned bearishly
• Best time for aggressive short positions
• Trend likely to continue
• Strategy: Hold shorts, avoid longs
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 How To Use This Indicator
Basic Usage
1. Check Current Strength
• Look at the histogram height and color
• Read the exact number in the info panel
• Note the status label (STRONG BULL, WEAK BEAR, etc.)
• Higher absolute value = stronger trend
2. Watch For Reversals
• Triangle markers appear when strength crosses zero
• 🟢 Green triangle up = Bullish reversal signal
• 🔴 Red triangle down = Bearish reversal signal
• These mark potential trend changes
3. Monitor Multi-Timeframe Alignment
• Check if all timeframes show same direction
• "✓ ALIGNED" = All timeframes agree (high confidence)
• "✗ Mixed" = Timeframes disagree (lower confidence)
• Aligned trends have higher probability
4. Observe Strength Changes
• Rising strength = Trend strengthening
• Falling strength = Trend weakening
• Strength near extremes (+75/-75) = Potential exhaustion
• Strength near zero = Indecision/consolidation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 Trading Strategies
Strategy 1: Trend Following
Best For: Capturing major moves
Timeframes: 1H, 4H, Daily
Rules:
1. Wait for strength to reach +50 or higher (or -50 or lower)
2. Check MTF alignment - all timeframes should agree
3. Enter on pullbacks in the direction of strength
4. Hold position while strength remains above +25 (or below -25)
5. Exit when strength crosses back to weak zone or reverses
Example - Long Setup:
• Strength crosses above +50 = Strong bull trend
• All MTF readings positive and aligned
• Wait for minor pullback to support
• Enter long with stop below recent swing low
• Hold while strength stays above +25
• Exit if strength drops below +10 or reverses to negative
Strategy 2: Reversal Trading
Best For: Catching trend changes early
Timeframes: 15min, 1H, 4H
Rules:
1. Watch for strength to reach extreme levels (+75 or -75)
2. Look for divergence (price new high/low but strength declining)
3. Wait for zero-line cross (triangle marker appears)
4. Enter in direction of new trend
5. Use tight stops since you're catching early
Example - Bullish Reversal:
• Strength at -80 (very strong bear)
• Price makes new low but strength only at -70 = Divergence
• Green triangle appears = Zero-line cross
• Enter long on confirmation
• Stop below recent swing low
• Target: Strength reaching +50
Strategy 3: Avoid Bad Trades
Best For: Improving win rate
Timeframes: All
Rules:
• DON'T trade when strength is between -10 and +10 (neutral zone)
• DON'T go long when strength is negative
• DON'T go short when strength is positive
• DON'T trade against MTF alignment
• DO wait for clear strength readings
Why It Works: Most losses come from trading in choppy markets or against the trend
Strategy 4: Position Sizing Based On Strength
Best For: Risk management
Timeframes: All
Rules:
• Strength +75 to +100 or -75 to -100 = Full position size (2-3% risk)
• Strength +50 to +75 or -50 to -75 = Normal position (1.5-2% risk)
• Strength +25 to +50 or -25 to -50 = Reduced position (1% risk)
• Strength -10 to +10 = No trades or minimal size (0.5% risk)
Why It Works: Bigger positions in stronger trends, smaller in weak trends
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ Settings Explained
Multi-Timeframe Analysis
• Toggle ON/OFF the MTF readings in the info panel
• Turn OFF for cleaner display if you only trade one timeframe
Timeframe 1, 2, 3 (Default: 15min, 1H, 4H)
• Choose which timeframes to analyze
• For day trading: Use 5min, 15min, 1H
• For swing trading: Use 1H, 4H, Daily
• For position trading: Use 4H, Daily, Weekly
• Higher timeframes show bigger picture trends
MA Length (Default: 20)
• Moving average period for trend direction component
• Lower values (10-15): More responsive, more signals
• Higher values (25-50): Smoother, fewer signals
• Recommended: 20 for most styles
ATR Length (Default: 14)
• Period for measuring volatility
• Standard setting works well for most markets
• Recommended: Keep at 14
RSI Length (Default: 14)
• Period for momentum measurement
• Standard setting works well for most markets
• Recommended: Keep at 14
Show Trend Labels on Chart
• Toggle ON to display "BULL" / "BEAR" text at reversals
• Keep OFF for cleaner chart (default)
• Useful when backtesting to see historical signals
Show Reversal Signals
• Toggle triangle markers at zero-line crosses
• Keep ON to catch trend changes
• Turn OFF if you only care about current strength
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎓 How The Calculation Works
The indicator measures 4 components, each worth 25 points (total = 100):
1. Trend Direction (25 points)
• Compares price to moving average
• Checks if MA is rising or falling
• Perfect score: Price above rising MA
• Minimum score: Price below falling MA
2. Momentum (25 points)
• Uses RSI to measure momentum strength
• RSI > 70 = Maximum bullish points
• RSI < 30 = Maximum bearish points
• RSI near 50 = Neutral points
3. Volatility Alignment (25 points)
• Checks if price moves align with volatility
• Strong moves in trending direction = High score
• Weak moves or counter-trend = Low score
• Uses ATR to measure volatility
4. Moving Average Alignment (25 points)
• Checks EMA 8, 21, and 55 positioning
• Perfect bullish: 8 > 21 > 55 above price
• Perfect bearish: 8 < 21 < 55 below price
• Misaligned = Reduced score
Final Score = Sum of all 4 components (-100 to +100)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📱 Info Panel Guide
Current
• Shows exact strength number for current timeframe
• Color-coded background (green = bullish, red = bearish)
• Larger number for quick visibility
Status
• Text description of current trend state
• Examples: "STRONG BULL", "WEAK BEAR", "NEUTRAL"
• Quick interpretation without looking at number
Timeframe Readings
• Shows strength for each selected timeframe
• Color-coded for quick reading
• Compare to spot divergences
MTF Alignment
• ✓ ALIGNED = All timeframes show same direction (high confidence)
• ✗ Mixed = Timeframes disagree (proceed with caution)
• Most reliable trades happen when aligned
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📱 Alert Setup
This indicator includes 4 alert types:
1. Bullish Reversal
• Triggers when strength crosses from negative to positive
• Potential trend change from bearish to bullish
• Early warning of new uptrend
2. Bearish Reversal
• Triggers when strength crosses from positive to negative
• Potential trend change from bullish to bearish
• Early warning of new downtrend
3. Very Strong Bull
• Triggers when strength reaches +75 or higher
• Extreme bullish conditions
• Aggressive long opportunity
4. Very Strong Bear
• Triggers when strength reaches -75 or lower
• Extreme bearish conditions
• Aggressive short opportunity
To Set Up Alerts:
1. Click "Alert" button (clock icon)
2. Select "Trend Strength Meter"
3. Choose your alert type
4. Configure notifications
5. Click "Create"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💎 Pro Tips & Best Practices
✅ DO:
• Trust the extremes - Readings above +75 or below -75 are highly reliable
• Wait for alignment - Best trades happen when MTF shows "ALIGNED"
• Use with price action - Combine with support/resistance for entries
• Respect the neutral zone - Avoid trading when strength is -10 to +10
• Scale position size - Bigger positions in stronger trends
• Watch for divergence - Price new high but strength declining = Warning
• Follow the trend - Don't fight strong readings (±50 or more)
⚠️ DON'T:
• Don't trade neutral readings - Wait for clear strength above ±25
• Don't fade extremes - Very strong trends (+75/-75) can stay extreme
• Don't ignore MTF - Mixed timeframes = Lower probability
• Don't overtrade - Wait for quality setups with good strength
• Don't use alone - Combine with support/resistance and risk management
• Don't expect perfection - Even strong trends can reverse suddenly
🎯 Best Timeframes:
• Scalping: 1min, 5min (fast readings, quick changes)
• Day Trading: 5min, 15min, 1H (balanced view)
• Swing Trading: 1H, 4H, Daily (stable trends)
• Position Trading: 4H, Daily, Weekly (major trends)
🔥 Best Markets:
• Trending markets (crypto, indices, commodities)
• High liquidity instruments (BTC, ES, NQ, EUR/USD)
• Avoid on low-volume stocks or exotic pairs
⏰ Works Best When:
• Market has clear direction
• Good volatility (not too choppy, not too quiet)
• Multiple timeframes aligned
• Away from major news events
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 What Makes This Different?
Unlike subjective trend analysis, the Trend Strength Meter:
• Objective Measurement - No guessing, exact numerical score
• Multi-Component - Combines 4 factors, not just one indicator
• Multi-Timeframe - See alignment across timeframes instantly
• Clean Visual - Professional display, easy to interpret
• Actionable - Clear signals for entries, exits, and position sizing
• Universal - Works on all timeframes and instruments
• Proven Components - Based on trend, momentum, volatility, MA alignment
Perfect For:
• Trend followers who want confirmation
• Swing traders seeking high-probability setups
• Risk managers wanting to size positions properly
• Anyone tired of subjective "is this trend strong?" questions
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Common Patterns To Watch
Pattern 1: The Steady Climb
• Strength gradually rises from +25 to +50 to +75
• Indicates building momentum
• Trade: Hold longs, add on pullbacks
Pattern 2: The Quick Spike
• Strength jumps from 0 to +75 in few bars
• Indicates explosive momentum
• Trade: Enter quickly, but expect pullback
Pattern 3: The Exhaustion
• Strength at +80, price new high, strength drops to +70
• Bearish divergence forming
• Trade: Take profits, prepare for reversal
Pattern 4: The Whipsaw
• Strength oscillates between +10 and -10
• Choppy, range-bound market
• Trade: Stay flat, wait for breakout
Pattern 5: The False Breakout
• Strength briefly crosses +50 then drops back
• Weak momentum, trend not confirmed
• Trade: Wait for sustained strength above +50
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Upgrade Your Trading System
This free indicator quantifies trend strength objectively. Want more?
🔥 Check out my premium scripts for:
• Automated entry and exit signals with trend confirmation
• Advanced multi-timeframe strategy systems
• Dynamic position sizing based on trend strength
• Backtested performance with statistics
• Complete trading solutions
• And much more...
👉 Visit my profile for professional-grade trading tools!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Important Notes
• This indicator measures trend strength, not direction alone
• Strong readings don't guarantee continuation (manage risk)
• Always use with proper stop losses
• Combine with support/resistance analysis
• Test on demo before live trading
• Past performance doesn't guarantee future results
• Adjust settings to match your trading style
Disclaimer: For educational purposes only. Trading involves substantial risk. Always do your own research and never risk more than you can afford to lose.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🙏 Support This Work
If this indicator helps your trading:
• ⭐ Give it a thumbs up
• 💬 Share your best strength-based trades in comments
• 🔔 Follow for more free professional tools
• 🚀 Share with traders who need objective trend analysis
Questions about trend strength? Drop a comment and I'll help!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Developed with ❤️ for traders who want objective, quantified analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Version History
• v1.0 - Initial release with 4-component strength calculation and MTF analysis
Liquidity Heatmap [Eˣ]💧 Liquidity Heatmap - Free Indicator
Overview
The Liquidity Heatmap reveals where stop losses are clustered in the market - the hidden liquidity zones that smart money targets. This indicator automatically identifies Buy-Side Liquidity (BSL) above price and Sell-Side Liquidity (SSL) below price, showing you exactly where institutional traders are likely to hunt for stops before major moves.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 What This Indicator Does
Identifies Liquidity Zones:
• Buy-Side Liquidity (BSL) - Stop losses from SHORT positions clustered above price
• Sell-Side Liquidity (SSL) - Stop losses from LONG positions clustered below price
• Automatically clusters nearby levels into high-probability zones
• Shows liquidity strength (1-5+) - higher numbers = more stops = bigger target
• Removes swept liquidity in real-time as price takes out stops
Visual Display:
• 🔴 Red Zones Above Price = Buy-Side Liquidity (shorts' stops)
• 🟢 Green Zones Below Price = Sell-Side Liquidity (longs' stops)
• Thicker/Darker Zones = Higher liquidity concentration
• BSL/SSL Labels = Show exact strength count
• Triangle Markers = Liquidity sweep alerts (when price takes stops)
Smart Features:
• Auto-removes old liquidity (customizable lookback period)
• Clusters nearby levels to reduce noise
• Tracks liquidity strength and age
• Updates in real-time as new swing points form
• Alerts when major liquidity zones are swept
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 How To Use This Indicator
Understanding Liquidity Concepts
What is Liquidity?
Liquidity refers to clusters of stop loss orders sitting in the market. These stops represent:
• Long traders' stop losses (below support) = Sell-Side Liquidity
• Short traders' stop losses (above resistance) = Buy-Side Liquidity
Why Does This Matter?
• Institutions NEED liquidity to fill large orders
• Price often "sweeps" liquidity zones before reversing
• Major liquidity = major target for smart money
• Understanding liquidity = understanding market maker behavior
The Liquidity Cycle:
1. Retail traders place stops at obvious levels (swing highs/lows)
2. Smart money identifies these clusters
3. Price is pushed to sweep the stops (liquidity grab)
4. Institutions fill their orders with this liquidity
5. Price reverses in the opposite direction
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 Trading Strategies
Strategy 1: Liquidity Sweep Reversals
Best For: Swing trading, catching reversals
Timeframes: 15min, 1H, 4H, Daily
Entry Setup:
1. Identify strong Sell-Side Liquidity (SSL) zone below price
2. Wait for price to sweep down into the SSL zone
3. Look for rejection/reversal candle pattern (pin bar, engulfing)
4. Enter LONG after sweep and reversal confirmation
5. Stop loss: Below the swept liquidity zone
6. Target: Opposite liquidity zone or key resistance
Why It Works: Smart money sweeps stops to fill buy orders, then pushes price higher
Example:
• SSL zone at $45,000 with strength 3
• Price drops to $44,950, sweeps the SSL
• Strong bullish reversal candle forms
• Enter long at $45,100
• Target: BSL zone at $47,000
Strategy 2: Liquidity-to-Liquidity Runs
Best For: Day trading, scalping
Timeframes: 5min, 15min, 1H
Entry Setup:
1. Price sweeps Sell-Side Liquidity below and reverses up
2. Identify Buy-Side Liquidity zone above
3. Enter LONG targeting the BSL zone above
4. Exit near/at the BSL zone (don't wait for sweep)
5. Stop loss: Below recent swing low
Why It Works: Price moves from liquidity pool to liquidity pool
Variation - Reverse for Shorts:
• BSL sweep above → Look for SSL zone below
• Enter short targeting lower liquidity
Strategy 3: Liquidity Avoidance (Stop Placement)
Best For: Improving win rate on existing strategies
Timeframes: All
Rules:
1. NEVER place stops exactly at obvious liquidity zones
2. Place stops beyond the liquidity zone with buffer
3. Or place stops before the liquidity zone (tighter, riskier)
4. Monitor liquidity strength - avoid zones with strength 3+
Why It Works: Market makers hunt obvious stop clusters
Example:
• Trading long, swing low at $100 (SSL zone, strength 4)
• Bad: Stop at $99.50 (will get swept)
• Better: Stop at $98.50 (beyond the liquidity)
• Alternative: Stop at $100.50 (tighter, before sweep zone)
Strategy 4: Confluence Trading
Best For: High probability setups
Timeframes: 1H, 4H, Daily
Entry Setup:
1. Find liquidity zone that aligns with:
• Major support/resistance level
• Fibonacci retracement (0.618, 0.786)
• Trendline
• Round psychological number ($50,000, $2,000, etc)
2. Wait for sweep of this high-confluence zone
3. Enter on reversal with multiple confirmations
4. Larger position size justified by confluence
Why It Works: Multiple factors = institutional interest = higher probability
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ Settings Explained
Core Settings
Swing Detection Length (Default: 10)
• Number of bars left/right to identify swing highs and lows
• Lower values (5-8): More sensitive, more liquidity zones, more noise
• Higher values (12-20): Less sensitive, only major swings, cleaner chart
• Recommended: 8-10 for intraday, 10-15 for swing trading
Liquidity Lookback Bars (Default: 100)
• How many historical bars to track liquidity zones
• Lower values (50-75): Shows only recent liquidity
• Higher values (100-200): Shows longer-term liquidity clusters
• Zones older than this are automatically removed
• Recommended: 100-150 for most timeframes
Zone Proximity % (Default: 0.5)
• Percentage threshold to group nearby levels into single zone
• Lower values (0.2-0.4): Keeps levels separate, more zones
• Higher values (0.6-1.0): Aggressive clustering, fewer zones
• Recommended: 0.4-0.6 for crypto, 0.3-0.5 for forex, 0.5-0.8 for stocks
Visualization Settings
Show Buy-Side Liquidity
• Toggle ON/OFF red zones above price
• Turn OFF if only interested in downside liquidity
Show Sell-Side Liquidity
• Toggle ON/OFF green zones below price
• Turn OFF if only interested in upside liquidity
Show Liquidity Labels
• Toggle BSL/SSL labels with strength numbers
• Turn OFF for cleaner chart appearance
• Keep ON to see exact liquidity strength
Display Style
• Boxes: Filled rectangular zones (best for visualizing strength)
• Lines: Horizontal dashed lines (minimal, clean look)
• Both: Boxes + Lines (maximum visibility)
Color Intensity
• Low: 85% transparency (subtle, less distracting)
• Medium: 75% transparency (balanced visibility)
• High: 65% transparency (bold, maximum visibility)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📱 Info Panel Guide
Located in the top-right corner, the info panel provides real-time liquidity statistics:
Buy-Side Zones
• Count of active BSL zones above current price
• Higher number = More upside targets for price
Sell-Side Zones
• Count of active SSL zones below current price
• Higher number = More downside targets for price
Total Zones
• Combined count of all active liquidity
• Useful for gauging overall market structure
Nearest BSL
• Distance in % to closest Buy-Side Liquidity above
• Example: +2.5% means BSL is 2.5% above current price
• Quick reference for next upside target
Nearest SSL
• Distance in % to closest Sell-Side Liquidity below
• Example: -1.8% means SSL is 1.8% below current price
• Quick reference for next downside target
Liquidity Bias
• ⬆️ Bullish : More BSL than SSL (upside targets dominate)
• ⬇️ Bearish : More SSL than BSL (downside targets dominate)
• ↔️ Balanced: Equal liquidity on both sides (range-bound)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎓 Understanding Liquidity Strength
What Do The Numbers Mean?
Strength 1 : Single swing point
• Light liquidity, minor target
• Can be ignored in trending markets
• Useful in ranging/choppy conditions
Strength 2-3 : Moderate liquidity cluster
• Multiple nearby swing points merged
• Decent target for intraday moves
• Watch for potential sweeps
Strength 4-5 : Strong liquidity cluster
• Major cluster of stops
• High-probability target for institutions
• Expect reactions when swept
Strength 6+ : Extreme liquidity pool
• Massive stop cluster (rare)
• Critical zone - high probability of sweep
• Often marks major support/resistance
• Ideal for confluence setups
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📱 Alert Setup
This indicator includes 2 powerful alert types:
1. Buy-Side Liquidity Sweep
• Triggers when price sweeps BSL zone above
• Shows potential bullish reversal opportunity
• Often precedes upward continuation after sweep
2. Sell-Side Liquidity Sweep
• Triggers when price sweeps SSL zone below
• Shows potential bearish reversal opportunity
• Often precedes downward continuation after sweep
To Set Up Alerts:
1. Click the "Alert" button (clock icon) in TradingView
2. Condition: Select "Liquidity Heatmap"
3. Choose alert type: BSL Sweep or SSL Sweep
4. Configure notification method (push, email, webhook)
5. Click "Create"
Pro Tip: Set alerts for both BSL and SSL sweeps to catch opportunities in both directions
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💎 Pro Tips & Best Practices
✅ DO:
• Wait for confirmation - Don't enter immediately on sweep, wait for reversal pattern
• Combine with trend - SSL sweeps in uptrends = higher probability longs
• Check multiple timeframes - 1H liquidity + 4H liquidity = strongest zones
• Monitor strength - Focus on zones with strength 3+
• Use proper risk management - Liquidity sweeps can go further than expected
• Watch for re-sweeps - Sometimes liquidity zones get swept multiple times
• Consider volume - High volume sweeps = stronger reversal potential
⚠️ DON'T:
• Don't fade strong trends - In strong trends, sweeps often continue rather than reverse
• Don't overtrade - Not every sweep is a tradeable setup
• Don't ignore context - Check broader market conditions and news
• Don't use alone - Combine with price action, support/resistance, and other analysis
• Don't place stops at liquidity - Your stops will be hunted
• Don't expect perfection
Next Month/Week/Day CPRNext Month/Week/Day CPR Next Month/Week/Day CPR Next Month/Week/Day CPR Next Month/Week/Day CPR Next Month/Week/Day CPR Next Month/Week/Day CPR
CPR + EMA(20/50/200) Strategy (5m) - NIFTY styleindicator best suited for nifty for 5 minute time frame.
CODY BOT – Breakout SignalsCODY BOT is a minimalist, high-probability breakout indicator designed to keep your chart clean while highlighting actionable trading opportunities.
Unlike traditional indicators that generate too many signals, CODY BOT only alerts you to strong directional moves following consolidation, helping you focus on high-quality entries.
Key Features:
Detects breakouts above recent highs and below recent lows.
Filters weak moves using minimum candle body size.
Includes a cooldown period to prevent signal spam.
Clean and intuitive visual signals with large arrows for easy interpretation.
Optional customization for consolidation lookback bars, minimum candle size, and arrow visibility.
Alerts built-in for server-side and mobile notifications.
How to Use:
Look for BUY arrows when price breaks above consolidation highs.
Look for SELL arrows when price breaks below consolidation lows.
Combine with your preferred risk management and trend confirmation strategies.
Smart Money Tracker [Eˣ]💰 Smart Money Tracker - Free Indicator
Overview
The Smart Money Tracker helps you identify when institutional traders (banks, hedge funds, and large players) are actively buying or selling. By analyzing unusual volume patterns and price action, this indicator reveals hidden accumulation and distribution zones that often precede major price moves.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 What This Indicator Does
Tracks Institutional Activity:
• Detects when "smart money" is accumulating (buying) at support levels
• Identifies when institutions are distributing (selling) at resistance levels
• Shows real-time buying and selling pressure through volume analysis
• Highlights bars where unusual institutional activity is detected
Visual Signals:
• 🟢 Green Circles Below Bars = Accumulation Zone (institutions buying at lows)
• 🔴 Red Circles Above Bars = Distribution Zone (institutions selling at highs)
• Green Background Tint = Strong buying pressure detected
• Red Background Tint = Strong selling pressure detected
• Dashed Lines = Key institutional levels to watch
Money Flow Histogram:
• Shows buying vs selling pressure in real-time
• Scale from -100 (extreme selling) to +100 (extreme buying)
• Green bars = Net buying pressure
• Red bars = Net selling pressure
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 How To Use This Indicator
Basic Usage
1. Look For Accumulation Signals (🟢)
• Green circles appear when institutions are buying at support
• These zones often mark the end of pullbacks
• Price typically bounces from these levels
• Trading Signal: Consider long positions when accumulation appears at key support
2. Watch For Distribution Signals (🔴)
• Red circles appear when institutions are selling at resistance
• These zones often mark local tops
• Price typically reverses from these levels
• Trading Signal: Consider taking profits or short positions when distribution appears at resistance
3. Monitor The Pressure Histogram
• Values above +20 = Strong buying pressure (bullish)
• Values above +5 = Moderate buying pressure
• Values between -5 and +5 = Neutral/ranging
• Values below -5 = Moderate selling pressure
• Values below -20 = Strong selling pressure (bearish)
4. Check The Info Panel (Top Right)
• Status: Quick summary of current market pressure
• Pressure: Numerical value of buying/selling force
• Volume: Current volume status (High/Normal)
• Accumulation Count: Number of accumulation signals in last 20 bars
• Distribution Count: Number of distribution signals in last 20 bars
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 Trading Strategies
Strategy 1: Accumulation Bounce
1. Wait for green accumulation circle at support level
2. Confirm with positive money flow histogram
3. Enter long when price bounces from accumulation zone
4. Set stop loss below the accumulation level
Strategy 2: Distribution Reversal
1. Watch for red distribution circle at resistance
2. Confirm with negative money flow histogram
3. Consider taking profits on longs or entering shorts
4. Set stop loss above the distribution level
Strategy 3: Pressure Divergence
1. Price making new highs but histogram declining = Bearish divergence
2. Price making new lows but histogram rising = Bullish divergence
3. These often signal trend exhaustion and reversals
Strategy 4: Zone Confluence
1. When accumulation zones align with major support = High probability long
2. When distribution zones align with major resistance = High probability short
3. Multiple signals at same level = Institutional interest confirmation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ Settings Explained
Volume Analysis Length (Default: 20)
• Lookback period for calculating average volume
• Lower values = More sensitive to recent volume spikes
• Higher values = Smoother, less sensitive to noise
• Recommended: 14-20 for day trading, 20-30 for swing trading
Smart Money Threshold (Default: 1.5)
• Multiplier for detecting "unusual" volume
• Lower values = More signals (more sensitive)
• Higher values = Fewer signals (only extreme volume)
• Recommended: 1.3-1.5 for volatile markets, 1.5-2.0 for calmer markets
Show Accumulation/Distribution Zones
• Toggle ON/OFF the dashed zone lines
• Keep ON to track key institutional levels
Show Smart Money Labels
• Toggle ON/OFF the zone labels
• Turn OFF for cleaner chart appearance
Show Pressure Histogram
• Toggle ON/OFF the money flow histogram
• Keep ON to see real-time pressure gauge
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎓 Understanding The Methodology
What Is "Smart Money"?
Smart money refers to institutional traders, banks, hedge funds, and large players who have significant capital and often move markets. These players:
• Buy during weakness (accumulation)
• Sell during strength (distribution)
• Create support and resistance zones
• Their activity precedes major moves
How The Indicator Detects Smart Money:
1. Volume Analysis: Compares current volume to average volume to detect unusual activity
2. Price Action: Analyzes candle closes, wicks, and position within the range
3. Context: Identifies if activity happens at key swing highs or lows
4. Flow Calculation: Measures directional volume flow (buying vs selling)
Why This Works:
• Institutions cannot hide large orders - they create volume spikes
• Accumulation at lows shows conviction in higher prices
• Distribution at highs shows institutions taking profits
• Following smart money increases probability of success
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📱 Alert Setup
This indicator includes 4 built-in alert types:
1. Accumulation Detected - Fires when institutions buy at support
2. Distribution Detected - Fires when institutions sell at resistance
3. Strong Buying Pressure - Fires when pressure histogram exceeds +30
4. Strong Selling Pressure - Fires when pressure histogram drops below -30
To Set Up Alerts:
1. Click the "Alert" button (clock icon) in TradingView
2. Select "Smart Money Tracker" from the indicator dropdown
3. Choose your alert condition
4. Configure notification settings
5. Click "Create"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💎 Pro Tips
✅ Best Timeframes: Works on all timeframes, but most effective on 15min, 1H, 4H, and Daily
✅ Combine With: Support/resistance levels, trend indicators, or your existing strategy
✅ Volume Matters: Signals are stronger on higher timeframes with significant volume
✅ Multiple Signals: Repeated accumulation/distribution at same level = Strong institutional interest
✅ Market Context: Use alongside broader market trend analysis for best results
⚠️ Avoid: Low volume periods, major news events (false signals possible), and over-relying on single indicator
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 What Makes This Different?
Unlike basic volume indicators, Smart Money Tracker:
• Contextual Analysis - Doesn't just measure volume, but WHERE and HOW it occurs
• Visual Clarity - Instant visual feedback on institutional activity
• Multi-Layered - Combines volume, price action, and flow analysis
• Actionable - Clear zones and signals for trading decisions
• Professional Grade - Uses techniques from institutional trading desks
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Upgrade Your Trading
This free indicator gives you institutional-level insights. Want more?
🔥 Check out my premium scripts for:
• Automated entry and exit signals
• Advanced multi-timeframe analysis
• Dynamic stop loss management
• Backtested strategies with performance stats
• And much more...
👉 Visit my profile to see all available tools!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Notes
• This indicator works best as part of a complete trading system
• Always use proper risk management and position sizing
• Past performance does not guarantee future results
• Consider combining with other forms of analysis
• Test thoroughly on demo accounts before live trading
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🙏 Support This Work
If you find this indicator helpful:
• ⭐ Give it a thumbs up
• 💬 Leave a comment with your experience
• 🔔 Follow for more free tools and updates
• 🚀 Share with fellow traders
Questions? Drop a comment below and I'll help you out!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Developed with ❤️ for the TradingView community
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Version History
• v1.0 - Initial release with core smart money detection features
5% Move Counter (Up vs Down)5% Move Counter (Up vs Down)
This indicator tracks how many times a stock has made a 5% or larger move in a single session, and shows the count separately for up days and down days. It’s meant for traders who want quick context on whether a stock has a history of making large moves, instead of manually scrolling through years of price action.
Most tools only tell you what’s happening right now. This one helps you understand what the stock is capable of.
What it shows
Number of 5%+ up days
Number of 5%+ down days
Optional display modes:
All
Up Only
Down Only
Why it’s useful
Different stocks behave differently. Some give clean, powerful bursts when they break out, while others rarely move big even when the setup looks perfect. This tool helps you gauge a stock’s historical “explosiveness” so you can decide whether your strategy fits its behavior.
If your setups depend on volatility or momentum, it helps to know whether the stock has produced big moves before. This gives you that information instantly.
Customization
You can place the stats box anywhere on the chart using a simple 1–9 selector.
You can hide the rows you don’t need through a dropdown.
When a row is hidden, its background becomes fully transparent so the chart stays clean.
Who it’s for
Short-term traders, breakout traders, swing traders, and anyone who wants a quick read on whether a stock moves enough to justify certain types of trades.
Next Month/Week/Day CPRNext Month/Week/Day CPR Next Month/Week/Day CPR Next Month/Week/Day CPR Next Mo nth/Week/Day CPR with S1 S3, R1 and R3
Next Month/Week/Day CPRNext Month/Week/Day CPR Next Month/Week/Day CPR Next Month/Week/Day CPR Next Month/Week/Day CPR Next Month/Week/Day CPR
Daily Range Box (RIC)This indicator draws a blue-bordered box for each trading day, visible across all timeframes without alteration. The box's upper boundary is the day's highest price, the lower boundary is the day's lowest price, starting from the first trade of the day and ending at the last trade (including extended trading hours). A dashed horizontal line is drawn at the midpoint between the high and low within the box.
Mirpapa_Lib_HTFLibrary "Mirpapa_Lib_HTF"
High Time Frame Handler Library:
Provides utilities for working with High Time Frame (HTF) and chart (LTF) conversions and data retrieval.
IsChartTFcomparisonHTF(_chartTf, _htfTf)
IsChartTFcomparisonHTF
@description
Determine whether the given High Time Frame (HTF) is greater than or equal to the current chart timeframe.
Parameters:
_chartTf (string) : The current chart’s timeframe string (examples: "5", "15", "1D").
_htfTf (string) : The High Time Frame string to compare (examples: "60", "1D").
@return
Returns true if HTF minutes ≥ chart minutes, false otherwise or na if conversion fails.
GetHTFrevised(_tf)
GetHTFrevised
@description
Retrieve a specific bar value from a Higher Time Frame (HTF) series.
Supports current and historical OHLC values, based on a case identifier.
Parameters:
_tf (string) : The target HTF string (examples: "60", "1D").
GetHTFrevised(_tf, _case)
Parameters:
_tf (string)
_case (string)
GetHTFfromLabel(_label)
GetHTFfromLabel
@description
Convert a Korean HTF label into a Pine Script-recognizable timeframe string.
Examples:
"5분" → "5"
"1시간" → "60"
"일봉" → "1D"
"주봉" → "1W"
"월봉" → "1M"
"연봉" → "12M"
Parameters:
_label (string) : The Korean HTF label string (examples: "5분", "1시간", "일봉").
@return
Returns the Pine Script timeframe string corresponding to the label, or "1W" if no match is found.
GetHTFoffsetToLTFoffset(_offset, _chartTf, _htfTf)
GetHTFoffsetToLTFoffset
@description
Adjust an HTF bar index and offset so that it aligns with the current chart’s bar index.
Useful for retrieving historical HTF data on an LTF chart.
Parameters:
_offset (int) : The HTF bar offset (0 means current HTF bar, 1 means one bar ago, etc.).
_chartTf (string) : The current chart’s timeframe string (examples: "5", "15", "1D").
_htfTf (string) : The High Time Frame string to align (examples: "60", "1D").
@return
Returns the corresponding LTF bar index after applying HTF offset. If result is negative, returns 0.
UpdateHTFCache(_cache, _tf)
UpdateHTFCache
@description HTF 데이터 캐싱 (성능 최적화).\
HTF의 OHLC 데이터를 캐싱하여 매 틱마다 request.security 호출 방지.\
_cache: 기존 캐시 (없으면 na, 첫 호출 시).\
_tf: 캐싱할 시간대 (예: "60", "1D").\
새 bar 또는 bar_index 변경 시에만 업데이트, 그 외에는 기존 캐시 반환.\
Parameters:
_cache (HTFCache) : 기존 캐시 데이터 (없으면 na)
_tf (string) : 시간대
Returns: HTFCache 업데이트된 캐시 데이터
GetTimeframeSettings(_currentTF, _midTF1m, _highTF1m, _midTF5m, _highTF5m, _midTF15m, _highTF15m, _midTF30m, _highTF30m, _midTF60m, _highTF60m, _midTF240m, _highTF240m, _midTF1D, _highTF1D, _midTF1W, _highTF1W, _midTF1M, _highTF1M)
GetTimeframeSettings
@description 현재 차트 시간대에 맞는 중위/상위 시간대 자동 선택.\
_currentTF: 현재 차트 시간대 (timeframe.period).\
1분~1월 차트별로 적절한 중위/상위 시간대 매핑.\
예: 5분 차트 → 중위 15분, 상위 60분.\
반환: .\
Parameters:
_currentTF (string) : 현재 차트 시간대
_midTF1m (string)
_highTF1m (string)
_midTF5m (string)
_highTF5m (string)
_midTF15m (string)
_highTF15m (string)
_midTF30m (string)
_highTF30m (string)
_midTF60m (string)
_highTF60m (string)
_midTF240m (string)
_highTF240m (string)
_midTF1D (string)
_highTF1D (string)
_midTF1W (string)
_highTF1W (string)
_midTF1M (string)
_highTF1M (string)
Returns:
HTFCache
Fields:
_timeframe (series string)
_lastBarIndex (series int)
_isNewBar (series bool)
_barIndex (series int)
_open (series float)
_high (series float)
_low (series float)
_close (series float)
_open1 (series float)
_close1 (series float)
_high1 (series float)
_low1 (series float)
_open2 (series float)
_close2 (series float)
_high2 (series float)
_low2 (series float)
_high3 (series float)
_low3 (series float)
_time1 (series int)
_time2 (series int)
Next Month/Week/Day CPRNext Month/Week/Day CPR with S1 and S3, R1 and R3. Next Month/Week/Day CPR with S1 and S3, R1 and R3. Next Month/Week/Day CPR with S1 and S3, R1 and R3.




















