OPEN-SOURCE SCRIPT

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.
ewmaexponentialwmaMoving AveragesnormalizedROCTrend AnalysisVolatility

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

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


Check out whop.com/backquant for Access to Invite Only Scripts!
또한 다음에서도:

면책사항