fingersmcknee

TimeWarp: Simple Moving Average [Fingers]

Normally, looking at higher timeframe indicators on a chart leaves you with missing data. For example, here I use the security call function (https://www.tradingview.com/study-script-reference/#fun_security) to display 4 hour SMAs on a 30 minute ETH/BTC chart. Notice how the SMA values are only correct once every four hours? That is a lot of missing data.


The TimeWarp Solution

TimeWarp enables you to display higher timeframe simple moving averages on your chart while overcoming the data loss inherent with using the inbuilt security call function. To achieve this, the TimeWarp code calculates the higher timeframe SMA values for every period displayed in your chart. It then applies a smoothing function to even out variation in period-to-period values that commonly occur when calculating higher timeframe indicators at every period. I selected a smoothing function that seems to me to offer low lag and that produces smoothed values very similar to those produced by the security call function. Note that the smoother is not applied when a multiplier value of "1" is used.


How to Use:

It's simple. Apply to any chart, then adjust the "Multplier" value as desired. For example, if you want to see 4 hour indicator values on a 30 minute chart you use a multiplier of "8" (240 minutes / 30 minutes = 8).

Limitations:

The current version of TimeWarp does not account for "missing candles". If there are no buys or sells for a given candle, TradingView omits the candle from your chart. When there are missing candles TimeWarp values will be slightly different.

TradingView is unable to display high multiplier values combined with large period SMAs. For example, you won't be able to see 200 period SMAs with a multiplier of 20. This is a cap set by TradingView that errors out when it has been exceeded.
보호된 스크립트입니다
이 스크립트는 클로즈 소스로 게시되며 자유롭게 사용할 수 있습니다. 당신은 스크립트를 차트에 사용하기 위해 그것을 즐겨찾기 할 수 있습니다. 소스 코드는 보거나 수정할 수 없습니다.
면책사항

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

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