ka66

ka66: ATR Stop Channel

ka66 Mis à jour   
ATR Stop Channel: Often used as a dynamic stop loss management tool, this indicator:

  • Calculates the ATR over a configurable period, default 14
  • Based on configurable multipliers, draws a channel of (close + atr-multiple, close - atr-multiple)

The reference point of close is also configurable to allow a different source, e.g. you can use an EMA if you wanted to make a Keltner channel.

The upper channel line can be used for short position stop management, while the bottom one is for long positions. Multipliers can also be configured separately for long vs. short, given that one common market anomaly is that short positions can often have more aggressive stops.

ATR is calculated as the Simple Moving Average of TRs, no fancy weighted averaging. The tradingview atr function uses RMA, an EMA variant used in RSI, I prefer simpler averaging. The lag can be a feature if used well. Additionally, it's easier to reason about.

Note: For a more dedicated and full-featured multi-ATR|Keltner channels however, see my: "ka66: Multi ATR Channels", which is likely better suited for price analysis and channel trading.
Notes de version:
Enhancements

  • Much more consistent use of the chosen centre source line. Previously, there were too many adjustments around high and low when drawing bands, a logical bug really. This is the most important change.
  • Updated to Pine v5
  • Allow different timeframe selection.
  • Allow several different averaging types for the ATR, defaulting to the original Wilder RMA.
  • Display current ATR Price Distance from centre source line in a table.
  • Option to display values in points, but requires the correct divisor to show pips, for example.
  • Add more usage guidance in source code, namely: besides use as a stop channel, also as a no-trade zone with adjustable low-volatility multipliers. And thus, use as a potential breakout identification points, when price goes beyond the low-volatility zone.
Notes de version:
This is a further refinement of the ATR bands, to now allow for trailing stops, and a more explicit choice of centre line using configurable common moving averages.

The key thing to note is that ATR shifts from long to short and vice versa when price closes above or below the stop line, not when it just goes high or low (so you'll see high/low wicks penetrating the the trailing stop band, and the band remains there).

Thus, in a particularly volatile market, you need to adjust the multiplier if you are using it to trail stops. However, note that if your entry is decent, the idea is to get into a smooth trend to actually trail, something with reasonably low (but directional) volatility on the trailing timeframe.

If you enable the Debugging checkbox, you'll see the original bands and how the trailing stop band works. You can show/hide it from the UI settings as needed.

There are a few of these trailing stop indicators on TradingView, mine's not special in terms of function, but I needed to understand the logic if I want to use it to manage risk, and decided to write it myself, with code that is rather more verbose, but clearer, in my view, in its intent.

A recent tweet by Linda Raschke (of Market Wizard fame, and all-round awesome person), showed using trailing stops with a very short ATR period (2 to 3), tracking a price mean, with some deviation/multiple from that mean, capturing a sizeable chunk of the swing when trailed. This is the inspiration behind these latest changes.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?