PROTECTED SOURCE SCRIPT

Venberg - MA Presets

51
Indicator: Moving Averages with Trend Detection

This script creates a versatile moving average indicator with two preset configurations and automatic trend detection. Here's what it does:

Core Functionality:
1. Dual Preset System:
- Intraday Preset*: Toggles 7-period SMA and 30-period SMA (short-term analysis)
- Trend Preset*: Toggles 365-period EMA, 200-period EMA, and 20-period EMA (long-term analysis)

2. Moving Average Calculations:
- EMA 365 (365-day exponential)
- EMA 200 (200-day exponential)
- EMA 20 (20-day exponential)
- SMA 30 (30-day simple)
- SMA 7 (7-day simple)

3. Trend Detection Logic:
- Monitors crossovers between SMA7 and SMA30
- ▲ Bullish signal when SMA7 crosses above SMA30
- ▼ Bearish signal when SMA7 crosses below SMA30
- Maintains last trend state when no new crosses occur

4. **Visual Customization**:
- Thin lines (width=1) for SMA7 and EMA20
- Thick lines (width=2) for other MAs
- Color scheme:
* SMA7: Orange
* SMA30: Blue
* EMA365: Green
* EMA200: Red
* EMA20: Purple

5. Trend Display Table:
- Appears in top-right corner
- Only visible when Intraday preset is active
- Dynamic coloring:
* Green text for bullish trends
* Red text for bearish trends
- Semi-transparent gray background

Key Features:
- Independent toggle for each preset
- Auto-updating trend labels
- Optimized line thickness for clear chart reading
- Multiple time horizon analysis in one indicator

Practical Uses:
1. Identify short-term reversals (SMA7/SMA30 crosses)
2. Confirm long-term trends (EMA200/EMA365 positions)
3. Filter market noise using multiple timeframe confirmation
4. Visualize support/resistance levels through MA clusters

The indicator automatically hides inactive elements when presets are disabled, keeping your chart clean while maintaining all functionality. The trend table provides instant visual confirmation of the current market direction based on your selected configuration.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.