Activity, Path Quality & MACD Momentum

117
The Activity, Path Quality & MACD Momentum indicator is an original TradingView Pine Script v6 tool designed to evaluate three complementary aspects of market behavior:

1. Market Activity: Measures current trading volume relative to its recent average.
2. Path Quality: Evaluates whether price is moving efficiently in one direction or following a choppy, inefficient path, and how directly price as moved over a configurable number of bars.
3. MACD Momentum: Identifies current MACD and signal-line alignment, including whether movement beyond zero is steady.
4. MACD Bias: The direction of the latest qualifying MACD crossover.

The purpose of combining these measurements is to provide a more complete view of market conditions than momentum indicators alone.

A market can exhibit bullish or bearish MACD momentum while simultaneously experiencing low trading activity or inefficient price movement. This indicator makes those distinctions visible through a compact conditions panel.

These readings can provide context for market conditions, but they do not combine into an entry signal, predict an outcome, or place trades. It is an analytical indicator, not an automated trading strategy. It does not generate trade entries, calculate stops or targets, or execute orders.

---

1. Market Activity: Relative Volume

The first component measures current trading activity using relative volume. The Activity reading compares the current bar’s volume with the average volume of the preceding bars.

Relative Volume Calculation

The indicator compares the current candle's volume against the average volume of the preceding bars.

The default lookback is 20 bars.

**Relative Volume = Current Bar Volume / Average Volume of Previous 20 Bars**

Importantly, the current candle is excluded from its own volume baseline. This allows the indicator to compare current activity against completed historical bars rather than allowing the current volume to influence its reference average.

Activity Classification

The default quiet-activity threshold is 0.70.

Below 0.70x - Quiet activity
0.70x or higher - Not classified as quiet

For example, 0.50× recent average · quiet means current volume is half the average for the selected lookback.

- 0.50x means current volume is approximately 50% of the recent average.
- 0.70x means current volume is approximately 70% of the recent average.
- 1.00x means current volume is equal to the recent average.
- 1.50x means current volume is approximately 150% of the recent average.

This is a comparison with recent bars on the same chart timeframe. It describes current activity relative to that baseline; it does not establish that low volume causes a level to fail or predicts whether a target will be reached.

Dashboard Presentation

The activity panel displays the relative-volume value as a multiple of recent average volume.

Examples:
- `0.55x recent average · quiet`
- `0.85x recent average`
- `1.30x recent average`

Color coding:
- Yellow: Quiet activity.
- Green: Activity is at or above the quiet threshold.
- Gray: Volume data or its baseline is unavailable.

The activity component measures participation relative to recent volume. It does not independently determine whether that activity is bullish or bearish.

---

2. Path Quality: Directional Efficiency

The second component measures how efficiently price travels between its starting and ending points over a configurable number of bars.

Its purpose is to distinguish relatively direct directional movement from choppy price action.

Path Efficiency Calculation

The indicator compares the absolute net price change against the total absolute close-to-close movement over the selected lookback.

**Path Efficiency = Absolute Net Price Change / Total Absolute Price Travel**

The default lookback is four bars.

The calculation considers:
- The net change between the current close and the close four bars earlier.
- The cumulative absolute close-to-close movement across those four bars.

The resulting value ranges from 0 to 1.

Interpreting Path Efficiency

Near 0.00 - Highly inefficient, choppy movement
Below 0.20 - Classified as choppy
0.20 or higher - Classified as efficient
Near 1.00 - Relatively direct directional movement |

For example, consider two market conditions:

**Scenario A: Efficient Movement**

Price moves consistently higher across four bars with relatively little retracement. The net price change represents most of the total price travel.

The efficiency ratio approaches 1.00.

**Scenario B: Choppy Movement**

Price moves higher, lower, higher, and lower again, ultimately ending near its starting point.

Although price has traveled considerably, the net change is small relative to the total movement.

The efficiency ratio approaches 0.00.

Dashboard Presentation

The default classification threshold is 0.20.

The panel displays:
- The calculated path-efficiency value.
- `choppy` when efficiency is below 0.20.
- `efficient` when efficiency is at or above 0.20.

Color coding:
- Yellow: Choppy price movement.
- Green: Efficient price movement.

Path efficiency does not establish trend direction. It measures the quality and consistency of price movement, regardless of whether that movement is bullish or bearish.

---

3. MACD Momentum

The third component evaluates directional momentum using the Moving Average Convergence Divergence (MACD) indicator.

MACD is calculated on the active chart timeframe. Its default settings are 12 for the fast length, 26 for the slow length, and 9 for signal smoothing.

The dashboard separates MACD bias from MACD momentum. A qualifying crossover sets the bias; it does not by itself confirm momentum.

Qualifying crosses and bias

A qualifying bullish cross occurs on a confirmed bar close when the MACD line crosses above the signal line while both are below zero. This sets bullish bias.

A qualifying bearish cross occurs on a confirmed bar close when the MACD line crosses below the signal line while both are above zero. This sets bearish bias.

The MACD Bias row records the latest qualifying cross and retains that bias until the opposite qualifying cross occurs. Its text describes the recorded event; it does not mean that a new cross is occurring on the current bar.

If no qualifying cross is present in the loaded chart history, the row displays No qualifying cross in loaded history.

---

4. Confirmed Momentum State and Transitions

The MACD Momentum row describes the current relationship between the MACD line, signal line, and zero line.

The default steady-movement setting is three bars. “Steady” means the relevant line moves in the same direction on each bar across that selected window.

Bullish momentum confirmed: both lines are above zero, MACD is above the signal line, and both lines have risen steadily over the selected number of bars.

Bearish momentum confirmed: both lines are below zero, MACD is below the signal line, and both lines have fallen steadily over the selected number of bars.

Momentum fading: the lines remain on one side of zero and retain their current alignment, but MACD has moved steadily toward the signal line. This can show weakening movement before a crossover.

Pressure or turn: the MACD and signal lines have crossed, but have not both moved to the opposite side of zero. The panel describes this as pressure, a turn, or waiting for confirmation.

Alignment: MACD and signal are on the same side of zero and ordered in one direction, but their movement does not meet the steady-movement condition.

Lines straddle zero: the lines are on opposite sides of zero; the panel labels the direction as a turn.

Bias and current momentum can point in different directions. For example, the Bias row may retain bullish bias from an earlier qualifying cross while the Momentum row reports that bullish momentum is fading or that bearish pressure is developing.

Dashboard Priority

The dashboard includes:

Activity - Relative volume compared with its recent average

Path quality - Efficiency ratio and choppy/efficient classification

MACD momentum - Current MACD alignment, zero-line position, and steady movement

MACD bias -Direction of the latest qualifying crossover

The header shows the active chart timeframe. Dashboard position is configurable as bottom right, bottom left, top right, top left, middle right, or middle left. Dashboard size is configurable as tiny, small, normal, large, or huge.

Activity and path-quality thresholds and lookbacks, MACD lengths, and the steady-momentum window can be adjusted in the indicator settings.

Labels and alerts

The indicator can display a label for the latest qualifying MACD crossover. When another qualifying crossover occurs, the previous label is replaced so only the latest one remains.

Two alert conditions are available:

Bullish MACD Bias: MACD crosses above the signal line with both lines below zero.

Bearish MACD Bias: MACD crosses below the signal line with both lines above zero.

Alerts trigger on confirmed bar closes. They report the qualifying crossover only; they do not alert for every momentum state, quiet-activity reading, or path-quality reading.

---

5. Combined Market Conditions

The primary value of this indicator comes from evaluating activity, path quality, and momentum together.

Each component answers a different question:

Relative Volume: Is there meaningful trading activity compared with recent bars?
Path Efficiency: Is price moving directionally or traveling inefficiently?
MACD Momentum: Is momentum bullish, bearish, or unclear? |

These measurements can help distinguish market conditions that might otherwise appear similar when viewed through MACD alone.

Example Market Conditions

**Bullish momentum with quiet activity**

- MACD momentum is bullish.
- Relative volume is below 0.70x.
- Path efficiency may be either choppy or efficient.

Interpretation: Bullish momentum is present, but current trading activity is relatively subdued.

**Bullish momentum with choppy price movement**

- MACD momentum is bullish.
- Relative volume may be elevated or subdued.
- Path efficiency is below 0.20.

Interpretation: The MACD relationship is bullish, but price movement is inefficient and may lack directional consistency.

**Bullish momentum with efficient movement**

- MACD momentum is bullish.
- Path efficiency is at least 0.20.
- Relative volume is at or above its quiet-activity threshold.

Interpretation: Directional momentum, price efficiency, and relative activity are aligned.

**Bearish momentum with quiet activity**

- MACD momentum is bearish.
- Relative volume is below 0.70x.
- Path efficiency provides additional information about the consistency of the decline.

Interpretation: Bearish momentum is present, but participation is relatively subdued.

These are analytical combinations rather than formal entry signals. The script does not calculate a combined bullish or bearish trade qualification from all three components.

---

6. Conditions Panel

The indicator includes a compact dashboard with adjustable positioning on the chart.

It contains four rows:

Activity: Relative volume and quiet-activity classification
Path Quality: Efficiency ratio and choppy/efficient classification
MACD Momentum: Current directional momentum state
Header: Indicator name and active chart timeframe

The dashboard updates on the latest chart bar.

It also identifies the active chart timeframe, making it easier to distinguish readings from different chart intervals.

The panel can be disabled independently of the underlying calculations.

---

7. Configurable Inputs

The indicator provides several inputs that allow users to adjust its sensitivity.

Activity: Relative volume lookback - 20 bars
Activity: Quiet-activity threshold - 0.70
Path Quality: Lookback - 4 bars
Path Quality: Choppy threshold - 0.20
MACD: Fast length - 12
MACD: Slow length -26
MACD: Signal smoothing - 9

Display options:
- Show latest MACD crossover label.
- Show or hide the conditions panel.

All calculations use the active chart timeframe. The indicator does not independently calculate relative volume, path efficiency, or MACD momentum on higher timeframes.

---

8. Important Technical Considerations

**Relative volume depends on the available volume feed.**

The indicator uses the volume data supplied by the chart's symbol and data provider. Volume availability and interpretation can differ across forex brokers and instruments. In particular, spot forex volume may represent broker-provided tick volume rather than centralized exchange-traded volume. The script does not distinguish between those volume types.

**The current bar is excluded from the volume baseline.**

This makes the relative-volume comparison independent of the current candle's contribution to its own average.

**Path efficiency is not directional.**

A highly efficient downward move and a highly efficient upward move can both produce values near 1.00. Direction must be interpreted separately.

**The path-quality lookback affects sensitivity.**

A shorter lookback responds more quickly to changes in price behavior, while a longer lookback evaluates directional efficiency over a broader window.

**MACD momentum and qualifying crossovers are different.**

The dashboard can show bullish or bearish momentum without a qualifying zero-line crossover. The qualifying crossover state specifically requires the MACD lines to be on the appropriate side of zero at the time of the crossover.

**Qualifying momentum persists until a reverse crossover.**

The stored momentum state does not automatically expire after a fixed number of bars.

**Alerts are independent of activity and path quality.**

A qualifying MACD crossover can trigger an alert even when relative volume is quiet or price movement is choppy.

**The indicator does not generate a combined trade signal.**

Its purpose is to provide separate readings that can be evaluated together with other market-analysis tools and trading criteria.

---

Summary

The Activity, Path Quality & MACD Momentum indicator combines three distinct measurements to provide a broader assessment of market conditions.

- **Relative Volume** evaluates whether current trading activity is subdued or elevated compared with recent bars.
- **Path Efficiency** evaluates whether price is moving directly or following a choppy path.
- **MACD Momentum** identifies bullish and bearish momentum relationships, with special attention to qualifying crossovers occurring on the appropriate side of the zero line.

The indicator's primary strength is that it separates momentum from participation and price efficiency. Rather than assuming that bullish or bearish MACD momentum automatically represents a strong directional move, it provides additional context about the activity and quality of that movement.

Ultimately, it serves as a market-condition assessment tool that can complement broader technical analysis, directional filters, and entry-confirmation systems.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.