BackQuant

Exponentially Weighted Moving Average Oscillator [BackQuant]

Exponentially Weighted Moving Average (EWMA)
The Exponentially Weighted Moving Average (EWMA) is a quantitative or statistical measure used to model or describe a time series. The EWMA is widely used in finance, the main applications being technical analysis and volatility modeling.

The moving average is designed as such that older observations are given lower weights. The weights fall exponentially as the data point gets older – hence the name exponentially weighted.

Applications of the EWMA

The EWMA is widely used in technical analysis. It may not be used directly, but it is used in conjunction with other indicators to generate trading signals. A well-known example is the Negative Volume Index (NVI), which is used in conjunction with its EWMA.

Why is it different from the In-Built TradingView EWMA
Adaptive Algorithms: If your strategy requires the alpha parameter to change adaptively based on certain conditions (for example, based on market volatility), a for loop can be used to adjust the weights dynamically within the loop as opposed to the fixed decay rate in the standard EWMA.
Customization: A for loop allows for more complex and nuanced calculations that may not be directly supported by built-in functions. For example, you might want to adjust the weights in a non-standard way that the typical EWMA calculation doesn't allow for.

Use of the Oscillator
This mainly comes from 3 main premises, this is something I like to do personally since it is easier to work with them in the context of my system. E.g. Using them to spot clear trends without noise on longer timeframes.

Clarity: Plotting the EWMA as an oscillator provides a clear visual representation of the momentum or trend strength. It allows traders to see overbought or oversold conditions relative to a normalized range.

Comparison: An oscillator can make it easier to compare different securities or timeframes on a similar scale, especially when normalized. This is because the oscillator values are typically bounded within a range (like -1 to 1 or 0 to 100), whereas the actual price series can vary significantly.

Focus on Change: When plotted as an oscillator, the focus is on the rate of change or the relative movement of the EWMA, not on the absolute price levels. This can help traders spot divergences or convergences that may not be as apparent when the EWMA is plotted directly on the price chart. This is also one reason there is a conditional plotting on the chart.

Trend Strength: When normalized, the distance of the oscillator from its midpoint can be interpreted as the strength of the trend, providing a quantitative measure that can be used to make systematic trading decisions.

Here are the backtests on the 1D Timeframe for
BTCUSD
ETHUSD
SOLUSD

When using this script the user is able to define a source and period, which by extension calculates the alpha. An option to colour the bars accord to trend.

This makes it super easy to use in a system.

I recommend using this as above the midline (0) for a positive trend and below the midline for negative trend.
Hence why I put a label on the last bar to ensure it is easier for traders to read.

Lastly, The decreasing colour relative to RoC, this also helps traders to understand the strength of the indicator and gain insight into when to potentially reduce position size.
This indicator is best used in the medium timeframe.

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?