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.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Aksel Kibar, CMT
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Aksel Kibar, CMT
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.