TradingView
HayeTrading
13. Jul. 2018 13:33

Stop Loss with Exits 

Bitcoin / DollarBitfinex

Beschreibung

Standard Percentage-based Stop Loss for long and short, with configurable extra exit conditions.

Just copy/paste into your script.

Uses "low" and "high" values for crossing the stop loss threshold, but can be changed to "close" if you prefer (change "low" and "high" on lines 31 and 32 to "close")
Kommentare
DateRaid
This is great for flipping long/short, but does anyone know what to delete out of the code, so it only functions for buying and selling?

I'm trying to edit out the shorting parts and changed things like "long_price" to "buy_price" in the functions, it compiles properly, but my strategy is showing no difference in loss/gain when I change the stop loss input. If I can get it working then I'll also put the code into my indicator version (of the strategy). I've always wanted to include a stop loss in my indicator and this is the only thing I have seen that looks like it does it. Thanks in advance to anyone that can help.
Jagatap
Excellent
mincho1010
Thanks for sharing. This script can be used on a strategy ?
Mehr