JPStrydom / Crypto-Trading-Bot

Automated Bittrex crypto-currency technical analysis and trading tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sell pause on negative margins

areh opened this issue · comments

When a coin being tracked for sale has a negative margin, and the sell pause profitMarginThreshold is set at a positive number, there is no pause.

Example:
I have sell pause profitMarginThreshold set at 0.5 (a reasonable number IMO)
I have sell pauseTime set to 30
I have a coin at -6.61% profit margin.
Since -6.61 is less than 0.5 the sell tracking should have paused for 30 minutes

I've made a fork-change to trader.py on line 122 from:
elif "sell" in self.pause_params and profit_margin <= self.pause_params["sell"]["profitMarginThreshold"] < 0:
to:
elif "sell" in self.pause_params and profit_margin <= self.pause_params["sell"]["profitMarginThreshold"] != 0:

The problem with pausing on a positive sell margin is that your trades will immediately get paused when they're bought. This is due to the fact that the bot takes the Bittrex commission into account, which is 0.5% — which means that trades will almost always immediately have a negative margin of roughly -0.5%.
This might mean that you'll lose out on profits during the paused period — as most of the price spikes come and go pretty soon.

I could make the change if you'd like, I'd just omit the != 0 check as it's not allowing for 0 as a pauseTime value.