This is and update to my original indicator "Intraday Trailing Stop Loss".
With this update it allows you manually setup the your entry price for the trade and desired stop loss value for either long or short positions.
The trailing stop will dynamically follow the price movement if price goes into the desired direction and will not change when price goes in undesired direction.
When price will cross the indicator line, the signal will appear on chart suggesting terminate position.
It's also possible to set up a regular chart Alert based on this condition.
Example for Short position
To setup indicator click on "Settings" and enter
- Entry Price
- Position (short or long). Default is long.
- Stop loss in $. Default $0.2
- Time and Date of entry (Minute, Hour, Date, Month, Year). Indicator can span on multiple sessions.
To setup Alert.
- Right click on indicator line and select "Add Alert on ....." (first entry in list)
- Use all defaults
Due to Pine script limitations following is very important.
1. When indicator first time applied it will not show anything until all input values are entered.
2. As soon as input values are set it will appear on chart and could be adjusted further.
3. For indicator to work properly entered information should be as accurate as possible. For example if the entry price was not actually available on the time bar you using the indicator behaviour is not fully predictable.
4. Since absolute value of stop loss is used the indicator will not automatically work when you switch securities plotted on the chart. Multiple chart window can use separate indicator settings
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
This is great!
I have been looking for a trailing stop loss with a date entry to start the indicator from.
I have also been looking for a volatility or ATR trailing stop loss with a date entry. I was able to add some code that allowed me to do this to your script which works on the long side but not the short side.
Would you be able to look at what I have done and see why it doesn't work on the short side? As I have pretty much zero coding experience.
It's possibly exists in strategy scripts, but I don't think it's possible to use strategy tools in study scripts.
He has done the associations necessary for price and trailing stop-loss.