Sell even if the state is not known since you are almost certainly losing money
This commit is contained in:
parent
9e6368cf2f
commit
1ae1b3ea66
1 changed files with 2 additions and 2 deletions
4
main.py
4
main.py
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue