编辑精选OPEN-SOURCE SCRIPT

Supertrend - Ladder ATR

已更新
This is a supertrend with slight twisted concept which can be very benefecial in strong trending markets to reduce stop loss distance and exit slightly quicker.

⬜ Concept
▶ When the instrument is trending up, regular ATR shows high values if there are big green candles. This affect the stoploss distance in regular supertrend which leads to wide stops or delayed lagging. When you are in long trade, what matters for stoploss is how much a negative candle can move within bar. Hence, using ATR derived only based on red candles is more beneficial for trailing stops on long signals. Same applies to short trades where using ATR derived from only green candles is more efficient than overall ATR.
▶ ATR will be minimal when the volatility is less and ATR will increase with volatility. That means, once you are in trade, the trailing of stoploss also will vary based on ATR (or volatility). With regular ATR and supertrend, chances of stop loss distance widening is high with increased volatility even though stoploss levels will not move down. This again poses the risk of higher drawdown during trade closure and also keeps in the trade during ranging market. To avoid this, the second trick we are using here is only to reduce the atr stoploss difference when in trade. That is, when in long trade and negative candles ATR is increasing, we will not consider that. We will consider the new ATR only if it is lesser than previous bar ATR.

Effect of these changes on the trending market is quite visual. Lets take example of USDTRY

https://www.tradingview.com/x/9wtbnKiR/

Settings are quite simple and does not vary much from regular supertrend settings.

https://www.tradingview.com/x/w4WAnHN0/
版本注释
Updated libraries.
版本注释
Added Alert Conditions to Highlight bullish and bearish transition
Average True Range (ATR)hewhomustnotbenamedladderatrsupertrendTrend AnalysisVolatility

开源脚本

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

想在图表上使用此脚本?

免责声明