OPEN-SOURCE SCRIPT
Stop loss

Hi all!
This simple indicator will alert you when a price limit is reached (stop loss). I've created this indicator out of 2 reasons:
1. My broker only lets me to set a stop loss limit until a certain time. The time is a couple of months forward in time, but with a Tradingview plan that lets you set open-ended alerts this can alert you later than that.
2. I would like a stop loss on closing price only. This will not get you stopped out by a wick, but needing a 'close' price to be equal or below (for long trades) or equal or above (for short trades).
So this indicator will alert you when your stop to is hit and exit with a 'runtime.error' on the tick after the alert. It won't give you any good looking visuals, just a red line of your chosen stop loss price. Set it in the settings or click '...'->'Reset points...' and drag the line to your desired limit price. Also choose if your trade direction is long or short and if the bar that enters below/above your stop loss needs to be closed.
Note that there's a limitation depending on your style of trading (short term or long term) and if your Tradingview subscription provides live data or not. Also this will only alert you, not buy (for short trades) or sell (for long trades) your contracts when the stop loss is hit.
Best of trading luck!
This simple indicator will alert you when a price limit is reached (stop loss). I've created this indicator out of 2 reasons:
1. My broker only lets me to set a stop loss limit until a certain time. The time is a couple of months forward in time, but with a Tradingview plan that lets you set open-ended alerts this can alert you later than that.
2. I would like a stop loss on closing price only. This will not get you stopped out by a wick, but needing a 'close' price to be equal or below (for long trades) or equal or above (for short trades).
So this indicator will alert you when your stop to is hit and exit with a 'runtime.error' on the tick after the alert. It won't give you any good looking visuals, just a red line of your chosen stop loss price. Set it in the settings or click '...'->'Reset points...' and drag the line to your desired limit price. Also choose if your trade direction is long or short and if the bar that enters below/above your stop loss needs to be closed.
Note that there's a limitation depending on your style of trading (short term or long term) and if your Tradingview subscription provides live data or not. Also this will only alert you, not buy (for short trades) or sell (for long trades) your contracts when the stop loss is hit.
Best of trading luck!
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。