Sell even if the state is not known since you are almost certainly losing money

This commit is contained in:
Logan G 2021-02-04 01:09:59 -07:00
parent 9e6368cf2f
commit 1ae1b3ea66
Signed by: logan
GPG key ID: E328528C921E7A7A

View file

@ -36,9 +36,9 @@ if __name__ == "__main__":
current_state = "Selling"
# Sell shit
# If the previous state is known, and the short term EMA (accounting for the fee) is less than the long term EMA,
# If the short term EMA (accounting for the fee) is less than the long term EMA,
# and there is more than a 0.1% difference between short and long term EMA (accounting for the fee), sell
if previous_state != "Unknown" and k.short_ema.tail(1)[0][0] * (1-self.fee/100) < k.long_ema.tail(1)[0][0] and k.long_ema.tail(1)[0][0]/(k.short_ema.tail(1)[0][0] * (1-self.fee/100)) - 1 > 0.001:
if k.short_ema.tail(1)[0][0] * (1-self.fee/100) < k.long_ema.tail(1)[0][0] and k.long_ema.tail(1)[0][0]/(k.short_ema.tail(1)[0][0] * (1-self.fee/100)) - 1 > 0.001:
if k.short_ema.tail(1)[0][0]
print("Selling shit")
k.sell_order(currency_pair, currency_buy, currency_sell, k.balances["vol"][currency_buy])