TradingView
mdeous
13 Th06 2020 19:51

Trailing Stop Loss 

NVIDIA CorporationNASDAQ

Mô tả

Trailing stop loss indicator to determine when to exit a position.

Multiple trailing stop loss calculation techniques are implemented:
  • ATR: Determines stop loss using a gap from recent highest value, that gap is defined by the ATR value and a multiplier
  • MA: Just a simple moving average used as a stop-loss
  • Percentage: Uses a percentage of the price


The script also implements alerting to be notified when the stop loss price is reached.

Phát hành các Ghi chú

Update to Pine Script v5
Bình luận
quattro7409
Hi mdeous,

I have been looking for a while now for simple percentage trailing stop loss indicator and had almost given up until I stumbled on your script. Thanks for sharing it - simple and yet very powerful.
There is however one (major) issue that I really do not know how to address, that makes it unusable for a fair amount of stocks.

I see nowhere to input for the purchase date, only the actual “Position Entry Price”. If the script only uses the entry price it becomes impossible to use the trailing stop loss (%) for investments that are traded much lower today than they did years ago. (?)

An example maybe is best at explaining the situation I am referring to. Consider for example this stock – BEGR (BE Group AB). I bought it at 82 (SEK) on 13th of August 2021. I configure the indicator as such: 82 as entry price, “long” position, “%” method and “Percentage Value” 10. With this config the script will basically draw the SL line as a straight horizontal line at the price level 937 which occurred back in 2007!
Please let me know if I have misunderstood how to use your indicator.

Cheers,
Paul
mdeous
@quattro7409, You are completely right, that's an issue I also encountered, I'll try to add an entry date setting whenever I can.
junkie190690
Thank you for the open source!
quality93308
Thanks a ton!
Thêm nữa