OPEN-SOURCE SCRIPT

Supertrend - Delayed Trail

已更新
I use supertrend for for trailing stops. One of the problem of trailing stops in long term trend trading is we get stopped too early and then trend continues. To avoid this problem, we can limit or delay our trailing.

In this modified version of supertrend, we can delay trailing by two methods:

  • Bars : Trail after certain bars. Input DelayBars says after how many bars it should trail.
  • Steps : Trail after reaching equivalent stop on the other side.


ConsiderWicks option reverse direction upon high reaching trailing Sell stop or low reaching trailing buy stop (instead of close)
ConsiderWicksForDelayByStep does the same thing for calculating if the steps have reached.
版本注释
Added separate multiplier for stop and target.

Lesser value of target multiplier leads to more often trailing. Higher value of target multiplier lead to less often trailing.
版本注释
Added alertcondition on demand :)
版本注释
Added new type of delay based on breakouts. Breakouts are based on breakout candles logic present here:

Breakout Candles
Average True Range (ATR)supertrailsupertrendTrend AnalysisVolatility Stop

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明