Here is an attempt to segregate ATR into ATR of up days and down days.
While setting trailing stops based on ATR, you probably need to consider more on how an instrument can drop during red days. Hence, ATR of only red days makes more compelling case than overall ATR. Another use case for this kind of indicator may be in options if you are selling puts and calls with the intent of pocketing premiums on expiry.
Parameters are as explained below:
Range Type : Different range types are tr (True Range) , close (difference between close prices), highlow (difference between high and low of candle)
Period : ATR Period
Moving Average Type : Moving Average Type for calculating ATR. Two additional types - min and max are added which calculates lowest and highest range in last n bars
HideFullAtr : Hides combined ATR if checked.
릴리즈 노트
Removed min/max options as they are not working on na values
Added ATR multiplier and candle coloring to notify out of range candles
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.