OPEN-SOURCE SCRIPT
ATR Last-Bar Horizontal Stop Lines

This script draws ATR‑based horizontal levels only on the most recent candle, without plotting any historical lines. It uses TradingView’s line.new() engine instead of plot(), ensuring that:
Only one horizontal line per direction (Short/Long) is shown
The line is drawn only on the latest bar, never across previous bars
The line automatically updates on every new candle
Older lines are deleted instantly, avoiding chart clutter
Lines extend to the right for full visibility, but do not stretch across the entire historical chart
The script calculates ATR using the selected length and multiplier, then draws:
A Short ATR line above the current candle (High + ATR × Multiplier)
A Long ATR line below the current candle (Low − ATR × Multiplier)
Both lines can be enabled or disabled individually.
This tool is ideal for traders who want a clean chart with a single, dynamic ATR stop‑reference updated only for the current bar.
Only one horizontal line per direction (Short/Long) is shown
The line is drawn only on the latest bar, never across previous bars
The line automatically updates on every new candle
Older lines are deleted instantly, avoiding chart clutter
Lines extend to the right for full visibility, but do not stretch across the entire historical chart
The script calculates ATR using the selected length and multiplier, then draws:
A Short ATR line above the current candle (High + ATR × Multiplier)
A Long ATR line below the current candle (Low − ATR × Multiplier)
Both lines can be enabled or disabled individually.
This tool is ideal for traders who want a clean chart with a single, dynamic ATR stop‑reference updated only for the current bar.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。