OPEN-SOURCE SCRIPT
Aktualisiert Advanced Moving Average Channel

Advanced Moving Average Channel (MAC) is a comprehensive technical analysis tool that combines multiple moving average types with volume analysis to provide a complete market perspective.
Key Features:
1. Dynamic Channel Formation
- Configurable moving average types (SMA, EMA, WMA, VWMA, HMA, TEMA)
- Separate upper and lower band calculations
- Customizable band offsets for precise channel adjustment
2. Volume Analysis Integration
- Multi-timeframe volume analysis (1H, 24H, 7D)
- Relative volume comparison against historical averages
- Volume trend detection with visual indicators
- Price-level volume distribution profile
3. Market Context Indicators
- RSI integration for overbought/oversold conditions
- Channel position percentage
- Volume-weighted price levels
- Breakout detection with visual signals
Usage Guidelines:
1. Channel Interpretation
- Price within channel: Normal market conditions
- Price above upper band: Potential overbought condition
- Price below lower band: Potential oversold condition
- Channel width: Indicates market volatility
2. Volume Analysis
- High relative volume (>150%): Strong market interest
- Low relative volume (<50%): Weak market interest
- Volume trend arrows: Indicate increasing/decreasing market participation
- Volume profile: Shows price levels with highest trading activity
3. Trading Signals
- Breakout arrows: Potential trend continuation
- RSI extremes: Confirmation of overbought/oversold conditions
- Volume confirmation: Validates price movements
Customization:
- Adjust MA length for different market conditions
- Modify band offsets for tighter/looser channels
- Fine-tune volume analysis parameters
- Customize visual appearance
This indicator is designed for traders who want to combine price action, volume analysis, and market structure in a single, comprehensive tool.
Key Features:
1. Dynamic Channel Formation
- Configurable moving average types (SMA, EMA, WMA, VWMA, HMA, TEMA)
- Separate upper and lower band calculations
- Customizable band offsets for precise channel adjustment
2. Volume Analysis Integration
- Multi-timeframe volume analysis (1H, 24H, 7D)
- Relative volume comparison against historical averages
- Volume trend detection with visual indicators
- Price-level volume distribution profile
3. Market Context Indicators
- RSI integration for overbought/oversold conditions
- Channel position percentage
- Volume-weighted price levels
- Breakout detection with visual signals
Usage Guidelines:
1. Channel Interpretation
- Price within channel: Normal market conditions
- Price above upper band: Potential overbought condition
- Price below lower band: Potential oversold condition
- Channel width: Indicates market volatility
2. Volume Analysis
- High relative volume (>150%): Strong market interest
- Low relative volume (<50%): Weak market interest
- Volume trend arrows: Indicate increasing/decreasing market participation
- Volume profile: Shows price levels with highest trading activity
3. Trading Signals
- Breakout arrows: Potential trend continuation
- RSI extremes: Confirmation of overbought/oversold conditions
- Volume confirmation: Validates price movements
Customization:
- Adjust MA length for different market conditions
- Modify band offsets for tighter/looser channels
- Fine-tune volume analysis parameters
- Customize visual appearance
This indicator is designed for traders who want to combine price action, volume analysis, and market structure in a single, comprehensive tool.
Versionshinweise
# 📊 MAC Pro v2.0 - Release Notes**Release Date:** October 2025 | **Pine Script v6**
---
## 🎯 What's New
### 📈 Multi-Timeframe Volume Analysis
- **1H, 24H & 7D Volume**: Real-time volume tracking with trend arrows (↑↓→)
- **Relative Volume**: Percentage vs MA with color coding (Green >120%, Red <80%)
- **Smart Alerts**: Notifications for volume spikes >100%
### 📊 Volume Profile + POC
- **10-Level Price Distribution**: ASCII histogram (█▓▒░) showing volume by price
- **Point of Control (POC)**: Yellow line marking highest volume price level
- **Configurable Lookback**: Analyze up to 10,000 bars
### 💹 Advanced Volume Indicators
- **OBV (On Balance Volume)**: Accumulation/Distribution signals
- **Volume Momentum**: Percentage change from average (-50% to +100%)
- **A/D Line**: Money flow tracking for trend confirmation
### 📉 VWAP Integration
- **Real-Time VWAP**: Orange cross-style line
- **Deviation %**: Distance from VWAP in info table
- **Extreme Deviation Alerts**: Triggers at ±3%
### 🔍 Divergence Detection
- **Bullish Divergence** 💎: Price ↓ + Volume ↓ (reversal signal)
- **Bearish Divergence** 💎: Price ↑ + Volume ↓ (reversal signal)
- **Auto-Detection**: Marks divergences with diamond shapes
### 📋 Enhanced Info Table
**13 Real-Time Metrics:**
1. MA Type
2. Channel Position (0-100% gradient)
3. RSI (color-coded)
4. Vol 1H/24H/7D (with trends)
5. VWAP Deviation
6. Volume Momentum
7. OBV Signal
8. POC Price
9. Volume Profile
10. Market State
### 🔔 12 Configurable Alerts
- Band crossovers (4 alerts)
- Overbought/Oversold conditions
- Volume spikes & OBV changes
- Divergences
- VWAP extreme deviations
---
## 🔧 Key Improvements
### Bug Fixes
- ✅ Fixed TEMA calculation syntax error (line 107)
- ✅ Removed tuple destructuring for v6 compatibility
- ✅ Replaced `hline()` with `plot()` for dynamic POC
- ✅ Added bar_index validation (prevents "historical data too far" error)
- ✅ Fixed volume color function return statement
### Performance
- ✅ Extracted `ta.sma()` from ternary operators for consistency
- ✅ Optimized Volume Profile calculation with conditional execution
- ✅ Added division by zero protection
- ✅ Early bar handling for all calculations
### Code Quality
- ✅ Modular function architecture
- ✅ Type-safe calculations
- ✅ Comprehensive error handling
- ✅ Clear documentation
---
## 📝 New Configuration Options
```pine
Enable Advanced Volume Analysis (default: true)
Volume MA Length (default: 20)
Volume Trend Length (default: 5)
Volume Profile Levels (5-20, default: 10)
Volume Profile Lookback (default: 100)
Show VWAP (default: true)
Show Divergences (default: true)
```
---
## 💡 Quick Usage Guide
### Volume Analysis
- **Green volume (>150%)**: Strong buying/selling pressure
- **Red volume (<50%)**: Weak participation
- **↑ arrow**: Volume trending up
- **OBV Accumulation**: Bullish sign
- **OBV Distribution**: Bearish sign
### POC & Volume Profile
- **POC above price**: Resistance area
- **POC below price**: Support area
- **█ in profile**: High volume zone (strong S/R)
- **░ in profile**: Low volume zone (weak S/R)
### Divergences
- **Bullish 💎 + oversold**: Strong buy setup
- **Bearish 💎 + overbought**: Strong sell setup
- **Volume spike + divergence**: High probability reversal
### VWAP Trading
- **Price > VWAP + positive deviation**: Overbought zone
- **Price < VWAP + negative deviation**: Oversold zone
- **>3% deviation**: Extreme - mean reversion likely
---
## 🎨 Visual Changes
- Gradient channel position coloring (Green → Yellow → Red)
- Dynamic bar coloring for overbought/oversold
- POC line with circles style
- Diamond markers for divergences
- ASCII volume profile in table
---
## 📊 Recommended Settings
**Crypto**: MA=14-20, Vol MA=14, Offset=±0.5%
**Forex**: MA=20-34, Vol MA=20, Offset=±0.3%
**Stocks**: MA=20-50, Vol MA=20-30, Offset=±0.2%
---
## 🔮 Coming Soon (v2.1)
- Multi-timeframe channel overlay
- Volume heatmap
- Custom alert builder
- Strategy backtesting
- Export to CSV
---
**Happy Trading! 📈**
*Use proper risk management. No indicator guarantees profit
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.