OPEN-SOURCE SCRIPT
Simplified ATR Trailing Stop

The Simplified ATR Trailing Stop will start calculating on a set date that you specify. This is great because you want to trail the price from the breakout day or even after exceeding specific price level (can be your breakeven level or even to capture more of the upside after the price target is met).
Entry price: If you act at the close of the day, you can leave this value as 0 and it will take the close of the day for the initial protective stop-loss calculation. You can choose to add a value such as the pattern boundary and in that case it will subtract the initial protective stop-loss from the pattern boundary and not the close of the day. If you use a scaling in tactic during the day (buying in tranches intraday as the breakout takes place) and your average purchase price is different than the close of the day, you can also plug that number in to calculate the initial protective stop-loss.
ATR period: You can select the ATR period. It can be 10 day, 14 day or 30 day or any ATR period of your choice.
ATR Multiplier for Stop-loss: This is the multiplier that you want to trail the price with. From the highest level price reached it will trail the price with a 3 x ATR () distance. The higher the number, the wider the trailing stop-loss. A multiplier of 1 will trail the price so close that and adverse movement can result in triggering the stop-loss.
Custom Value for First day Trailing Stop: This is my favorite part. For aggressive risk management, your initial protective stop can be smaller than what the ATR Trailing Stop will use in its calculation after entry day. In this case you can take 1xATR () or even with FX and Futures you can apply 0.5xATR() as the first day to calculate initial protective stop. The protective stop turns into a trailing stop after the first day.
Entry price: If you act at the close of the day, you can leave this value as 0 and it will take the close of the day for the initial protective stop-loss calculation. You can choose to add a value such as the pattern boundary and in that case it will subtract the initial protective stop-loss from the pattern boundary and not the close of the day. If you use a scaling in tactic during the day (buying in tranches intraday as the breakout takes place) and your average purchase price is different than the close of the day, you can also plug that number in to calculate the initial protective stop-loss.
ATR period: You can select the ATR period. It can be 10 day, 14 day or 30 day or any ATR period of your choice.
ATR Multiplier for Stop-loss: This is the multiplier that you want to trail the price with. From the highest level price reached it will trail the price with a 3 x ATR () distance. The higher the number, the wider the trailing stop-loss. A multiplier of 1 will trail the price so close that and adverse movement can result in triggering the stop-loss.
Custom Value for First day Trailing Stop: This is my favorite part. For aggressive risk management, your initial protective stop can be smaller than what the ATR Trailing Stop will use in its calculation after entry day. In this case you can take 1xATR () or even with FX and Futures you can apply 0.5xATR() as the first day to calculate initial protective stop. The protective stop turns into a trailing stop after the first day.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
Aksel Kibar, CMT
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
Aksel Kibar, CMT
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.