Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to exclude trailing_stop_loss from StopLossGuard's radar? #7076

Open
JhorAVi opened this issue Jul 13, 2022 · 6 comments
Open

How to exclude trailing_stop_loss from StopLossGuard's radar? #7076

JhorAVi opened this issue Jul 13, 2022 · 6 comments
Labels
Good first issue Stoploss

Comments

@JhorAVi
Copy link

@JhorAVi JhorAVi commented Jul 13, 2022

Hi, I have a trailing_stop_loss exit with small loss of -0.42% probably due to slippage. The problem is the StopLossGuard caught it because it's still considered a stoploss exit even though loss is small. Is there a workaround so that StopLossGuard won't mind those micro losses? Or even better is a way to exclude trailing_stop_loss from StopLossGuard's radar?

Thanks for the help

@JhorAVi JhorAVi added the Question label Jul 13, 2022
@xmatthias
Copy link
Member

@xmatthias xmatthias commented Jul 13, 2022

Positive (winning) trailing stoplosses are ignored (they're a form of take profit to some degree).

The limit here is 0 - and i'm not sure about changing this, as i doubt the use of this. It may be a small loss, but its still a loss - based on some type of stoploss - so i don't really see why it should be excluded.

@xmatthias xmatthias added the Stoploss label Jul 13, 2022
@JhorAVi
Copy link
Author

@JhorAVi JhorAVi commented Jul 13, 2022

Thanks for the reply xmatthias. What I understand is that StopLossGuard is supposed to guard against further big losses from stoploss. But the loss coming from trailing_stop_loss slippage are very small which triggering StopLossGuard to it doesn't make sense.
For that reason can I suggest an additional parameter in StopLossGuard? An option to set the desired value so that only stoplosses exceeding that value will trigger the StopLossGuard.

thanks again.

@xmatthias
Copy link
Member

@xmatthias xmatthias commented Jul 13, 2022

Feel free to open a PR adding this functionality (should default to current behavior) if you think this is a necessity.

I've labeled it "good first issue" now - this implies that i'll leave it "laying around" for some time in hopes that someone will pick it up - as it should be a start / enter contributing.
The change necessary should be limited to 1-3 files - which should make this a easily manageable contribution without deep knowledge of the overall codebase.

@xmatthias xmatthias added Good first issue and removed Question labels Jul 13, 2022
@JhorAVi
Copy link
Author

@JhorAVi JhorAVi commented Jul 14, 2022

Hi, thanks for that. I found a workaround the problem by setting LowProfitPairs to work exactly like StopLossGuard with the benefit of not being bothered by trailing_stop_loss. The only bug in LowProfitPairs though is that switching "only_per_pair": True or False doesn't make any difference but I understand that Protections is still in testing phase.

cheers

@xmatthias
Copy link
Member

@xmatthias xmatthias commented Jul 14, 2022

"only_per_pair" does not make sense on LowProfitPairs. it's per pair implicitly - doing this cross-pair would not make any sense - and would probably lock the whole bot.

@JhorAVi
Copy link
Author

@JhorAVi JhorAVi commented Jul 14, 2022

Hi xmatthias,
Locking the whole bot is actually my point. In the month of May 2022 LUNA crash, a 3 day global lock by StoplossGuard made a profit difference from -23% to 90% and drawdown from 64% to only 21% on my backtesting for the entire MAY. I set the stoploss to -45% because only LUNA type of fall can pass through it on my strat so it's a very good way to catch and halt LUNA type catastrophe. Of course I use those settings too to backtest all months of 1 year using variety of pairs. The result is that the Protection took effect only during the LUNA crash so it has no side effect to other months. It works perfectly on backtesting but maybe not good in dry/live because of the trailing_stop_loss issue stated above.

cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Stoploss
Projects
None yet
Development

No branches or pull requests

2 participants