OPEN-SOURCE SCRIPT

X4 Moving Average

The X4 Moving Averages (X4MA) indicator is designed to provide traders with an enhanced view of market trends by combining multiple dimensions of price data. Unlike traditional moving averages that rely solely on closing prices, X4MA integrates high, low, open, and close values for a more nuanced analysis of market movements.

1- High-Low Average (HLAvg):
Captures the market's range during a given period:
HLAvg = (High + Low) / 2

2- Open-Close Average (OCAvg):
Reflects the directional momentum of the price during the same period:
OCAvg = (Open + Close) / 2

3- Combined Average (CMA):
Combines the range (HLAvg) and momentum (OCAvg) for a balanced view of price behavior:
CMA = (HLAvg + OCAvg) / 2

4- Exponential Moving Average (X4MA):
Smooths the combined average using an EMA for better responsiveness to recent price changes while filtering noise:

X4MA = EMA(CMA, Length)

Bands and Channels

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer