OPEN-SOURCE SCRIPT

Stop loss

144
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!

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.