sleeyax / voltra

Cross-market volatile cryptocurrency trading bot
GNU General Public License v3.0
37 stars 4 forks source link

Trailing stop loss not implemented correctly #17

Open Newtoniano opened 5 months ago

Newtoniano commented 5 months ago

Describe the bug The trailing stop loss is set lower and lower as the coin price goes up and the trailing take profit rises

Steps to reproduce Just look at the logs while in a rising position while trailing sl/tp is enabled, the stop loss instead of rising as the position keeps gaining, becomes lower and lower.

Apart from this bug, the current implementation of the trailing sl/tp seems a bit awkward to me and it leads to thresholds I wouldn't guess according to the settings I input in the config file. It would probably be a good idea to rewrite it and use something like moving thresholds relative to the current coin price and not rely on compounding percentages and previous thresholds, as implemented in Freqtrade stoploss for example. I might work on this part of the logic in the next few days to make it more straightforward if you are ok with it.

sleeyax commented 5 months ago

It would probably be a good idea to rewrite it and use something like moving thresholds relative to the current coin price and not rely on compounding percentages and previous thresholds, as implemented in Freqtrade stoploss for example. I might work on this part of the logic in the next few days to make it more straightforward if you are ok with it.

Sounds good, I appreciate your help :)

Newtoniano commented 5 months ago

No problem! Sent you a friend request on discord btw, so we can better coordinate our efforts

sleeyax commented 4 months ago

@Newtoniano are you still interested in picking this up?

Newtoniano commented 4 months ago

Unfortunately I don't have much capacity to work on refactoring this right now, as I need to focus on a few other projects. Feel free to close this or address the bug in the current implementation yourself if you have time, it should be quite a quick fix anyway