Seungdori_

Moving Average SAR

Seungdori_ 업데이트됨   
Hello Traders,

Today, I have brought to you an indicator that utilizes the Parabolic SAR.

To begin with, the Parabolic SAR is an indicator that trails the price in the form of a parabola, seeking out Stop And Reverse points.

The indicator I present merges the calculation formula of the Parabolic SAR with the Moving Average.

One aspect I pondered over was how to determine the starting point of this SAR. Trailing the price flow with the logic set by the moving average was fine, but the question was where to begin.

My approach involves a variable I call 'sensitiveness,' which automatically adjusts the length according to the timeframe you are observing. Using pinescript's math.ceil, I formulated:

interval_to_len = timeframe.multiplier * (timeframe.isdaily ? 1440 : timeframe.isweekly ? 1440 * 7 : timeframe.ismonthly ? 1440 * 30 : 1)

main_len = math.ceil(sensitiveness / interval_to_len)

This formula represents the length, and through variables like:
_highest = math.min(ta.highest(high, main_len), close + ta.atr(46)*4)
_lowest = math.max(ta.lowest(low, main_len), close - ta.atr(46)*4)

I have managed to set the risk at a level that does not impose too great a burden.

Moreover, the 'Trend Strength Parameter' allows you to choose how strongly to trail the current price.

Lastly, think of the Band Width as a margin for accepting changes in the trend. As the value increases, the Band Width expands, measured through the ATR.

This indicator is particularly useful for holding positions and implementing trailing stops. It will be especially beneficial for those interested in price tracking of trends, like with Parabolic SAR or Supertrend.

I hope you find this tool useful.
릴리즈 노트:
I've added an option for signals that I initially overlooked.

If you select 'Show Signals', it is set to display the signals.
릴리즈 노트:
Fixed Overlay
오픈 소스 스크립트

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

면책사항

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

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