OPEN-SOURCE SCRIPT
Zaktualizowano

EMA Volume Trend Signals

307
# EMA Volume Trend Signals v6

[中文文档](README.md) | English

A Pine Script v6 trend-following indicator for TradingView, designed for altcoin short-to-mid-term swing trading. The script uses **SuperTrend** for trend direction, a multi-layer EMA structure (EMA20 / EMA144·169 / EMA576·696) to identify short-term momentum, core trend zone, and long-term trend zone, combined with volume analysis, ADX/DI health checks, and higher-timeframe filtering to generate staged entry, partial exit, and full exit signals.

> This project is intended for strategy research and signal assistance only. It does not constitute financial advice.

## Features

- Overlays SuperTrend, EMA20, EMA144, EMA169, EMA576, and EMA696 on the main chart.
- Higher-timeframe direction filter (default 4H).
- Generates buy signals based on trend structure, volume, ADX/DI, and pullback conditions.
- Staged position building with up to 4 position units (configurable).
- Supports partial reduce on weakness, core structure breakdown, and full exit on trend reversal.
- Built-in TradingView `alertcondition` for alerts and webhooks.
- Optional background color highlights for breakout, pullback, reduce, and exit zones.

## Quick Start

1. Open TradingView and navigate to any crypto chart.
2. Open the **Pine Editor** panel.
3. Copy the entire content of `tradingview_ema_volume_signal_v6.pine` and paste it in.
4. Click **Add to chart**.
5. Adjust parameters for your trading pair and timeframe.

Recommended timeframes for observation: **30m**, **1h**, **4h**. Lower timeframes tend to produce more noise and wicks on altcoins.

## Signal Types

### Buy Signals

The script displays buy labels when trend conditions are met:

- **Buy 20%** — Default trial or standard add position size (adjustable).
- **Buy 10%** — Default setup add size for earlier probing within a consolidation.
- The first buy may come from a trial entry, breakout, fresh trend initiation, or an early strength reclaim near the core EMA zone.
- Subsequent buys include: move add (price progression), trend add (trend continuation), setup add (consolidation breakout), breakout add (volume breakout), reclaim add (EMA reclaim after pullback), and pullback add (low-volume pullback to EMA support). Each requires volume-price progression relative to the last buy.

Key filters:

- SuperTrend is bullish.
- Higher-timeframe filter passes.
- Price is above EMA20 or breaking through the EMA144/169 core zone.
- Volume meets breakout or pullback thresholds.
- ADX and DI structure is healthy.
- No recent reduce, core breakdown, or bearish risk events.
- Price is not overly extended from EMA20 or SuperTrend.
- The second add uses a tighter ATR progression threshold but requires a volume breakout above recent highs, a buffer above the core zone, and non-weakening EMA slopes. Later adds require the larger `Move Add ATR` distance.
- Setup adds capture consolidation patterns where price holds above EMA20, range compresses, and volume has not yet broken out.
- Reclaim adds trigger when price revisits EMA20/core support and reclaims above EMA20 with strength; blocked if the pullback from recent highs is too deep or EMA20 is weakening.

### Sell Signals

The script displays reduce labels when trend weakens but has not fully reversed:

- **Sell 25%** — Light reduce (default requires structure risk confirmation).
- **Sell 50%** — Core structure breakdown reduce.

Common triggers:

- Consecutive closes below the EMA144/169 core zone.
- Price breaks below EMA20 buffer with confirmation, and structure risk is present.
- DI+ weakening with optional DI− > DI+ crossover requirement.
- SuperTrend still bullish but structural risk has emerged.

### Exit Signal

**Exit 100%** indicates a full trend exit, typically triggered when SuperTrend flips bearish. All position stages are reset, marking the end of a trend cycle.

## Key Parameters

### Trend

| Parameter | Default | Description |
|---|---|---|
| SuperTrend ATR Length | 10 | ATR period for SuperTrend |
| SuperTrend Factor | 3.0 | SuperTrend multiplier |

### EMA Structure

| Parameter | Default | Description |
|---|---|---|
| EMA20 | 20 | Short-term momentum line |
| EMA144 / EMA169 | 144 / 169 | Core trend zone |
| EMA576 / EMA696 | 576 / 696 | Long-term trend zone |

### Multi Timeframe

| Parameter | Default | Description |
|---|---|---|
| Use HTF Filter | true | Enable higher-timeframe direction filter |
| HTF Direction | 240 (4H) | Higher-timeframe resolution in minutes |

### Volume

| Parameter | Default | Description |
|---|---|---|
| Volume MA Length | 20 | Volume moving average period |
| Breakout Volume Multiplier | 1.25 | Volume ratio required for breakout |
| Pullback Max Volume Multiplier | 0.95 | Max volume ratio for low-volume pullback |
| Weak Rally Volume Multiplier | 0.75 | Min volume for trial buy |
| Use Volume Price Filter For Adds | true | Enable volume-price filter for add signals |
| Volume Price Lookback | 3 | Bars to check for recent bearish volume pressure |
| Bear Pressure Volume Multiplier | 1.10 | Volume threshold for bearish candle identification |
| Bull Reclaim Volume Multiplier | 0.95 | Volume required to confirm bullish reclaim |

### ADX Health

| Parameter | Default | Description |
|---|---|---|
| Min ADX For Add | 18.0 | Minimum ADX value for add signals |
| Require ADX Rising For Add | true | ADX must be rising for adds |
| Require DI+ > DI- For Add | true | DI+ must exceed DI− for adds |
| Use Early Sell On Momentum Weakness | true | Enable early sell when momentum fades |

### Signals

| Parameter | Default | Description |
|---|---|---|
| Stable Closes Above Core EMA | 2 | Bars to confirm price above core zone |
| Signal Cooldown Bars | 3 | Cooldown between same-type signals |
| Stage Cooldown Bars | 12 | Cooldown between staged buys |
| Reclaim Add Cooldown Bars | 8 | Cooldown for reclaim add signals |
| Setup Add Lookback | 4 | Lookback for consolidation range |
| Setup Add Max Range ATR | 1.2 | Max ATR range for setup consolidation |
| Max Position Units | 4 | Maximum staged position units |
| Second Add ATR From Last Buy | 1.2 | Min ATR progression for second add |
| Move Add ATR From Last Buy | 2.0 | Min ATR progression for move add |
| Late Add Max Distance From EMA20 ATR | 1.2 | Max distance from EMA20 for late adds |
| Trend Add Max Distance From EMA20 ATR | 2.2 | Max distance from EMA20 for trend adds |
| Breakout Add Lookback | 20 | Lookback for breakout reference high |
| Breakout Add Max Distance From EMA20 ATR | 3.0 | Max distance from EMA20 for breakout adds |
| Sell Grace Bars After Buy | 8 | Bars to wait after buy before allowing sell |
| EMA20 Sell Buffer ATR | 0.30 | Buffer below EMA20 for light sell |
| EMA20 Sell Confirm Bars | 3 | Bars to confirm EMA20 sell |
| Sell Requires Structure Risk | true | Require structure risk before selling |
| Trial Buy % | 20 | Position size label for trial buy |
| Setup Buy % | 10 | Position size label for setup add |
| Add Buy % | 20 | Position size label for standard add |
| Light Sell % | 25 | Position size label for light reduce |
| Core Sell % | 50 | Position size label for core reduce |

### Visual

| Parameter | Default | Description |
|---|---|---|
| Show Background | true | Display background color highlights |
| Show EMA Lines | true | Display EMA lines on chart |
| Label Offset ATR | 1.0 | Vertical offset of labels from candles in ATR units |

## Alert Configuration

The script includes 3 built-in `alertcondition` definitions:

- **Buy Signal**
- **Sell Reduce Signal**
- **Exit Signal**

Default alert messages:

```text
Buy signal: {{ticker}} {{interval}}
Sell reduce signal: {{ticker}} {{interval}}
Exit signal: {{ticker}} {{interval}}
```

For webhook integration, configure a webhook URL in the TradingView alert dialog and customize the message body with exchange, position size, order side, and other fields as needed.

## Risk Management Notes

- Individual signals should not be treated as full position trades. The script is designed for staged position building by default.
- Altcoins are highly correlated. When holding multiple positions, control overall beta exposure.
- Volume breakouts suit trend initiation; low-volume pullbacks suit trend continuation. Backtest each scenario in different market regimes.
- For high-volatility assets, consider increasing cooldown periods and reducing per-signal position sizes.
- After a full exit signal, wait for the next trend cycle to establish before re-entering. Avoid immediately counter-trading.

## Files

- `tradingview_ema_volume_signal_v6.pine` — TradingView Pine Script v6 indicator source code.
- `README.md` — 中文文档
- `README_EN.md` — English documentation
Informacje o Wersji
A Pine Script v6 trend-following indicator designed for altcoin short-to-mid-term swing trading. It uses SuperTrend for trend direction, a multi-layer EMA structure to identify momentum, core trend zone, and long-term trend zone, combined with volume analysis, ADX/DI, RSI, Order Block, OBV divergence, and higher-timeframe filtering to generate staged entry, partial take-profit/stop-loss, and full exit signals.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.