Compare commits
No commits in common. "7ca8f57c72c8fc52ca8493bf811a9aff2c54907d" and "39c7895afbdc335a278f66443389c69401683080" have entirely different histories.
7ca8f57c72
...
39c7895afb
1 changed files with 3 additions and 3 deletions
6
main.py
6
main.py
|
@ -8,9 +8,9 @@ if __name__ == "__main__":
|
||||||
current_state = "Unknown"
|
current_state = "Unknown"
|
||||||
previous_state = "Unknown"
|
previous_state = "Unknown"
|
||||||
|
|
||||||
currency_buy = "XXDG"
|
currency_buy = "XXBT"
|
||||||
currency_sell = "ZUSD"
|
currency_sell = "ZUSD"
|
||||||
currency_pair = "XDGUSD"
|
currency_pair = "XXBTZUSD"
|
||||||
|
|
||||||
k = Kraken()
|
k = Kraken()
|
||||||
print(1)
|
print(1)
|
||||||
|
@ -55,7 +55,7 @@ if __name__ == "__main__":
|
||||||
# Buy shit
|
# Buy shit
|
||||||
# If the previous state is known, and the short term EMA (accounting for the fee) is greater than the long term EMA,
|
# If the previous state is known, and the short term EMA (accounting for the fee) is greater than the long term EMA,
|
||||||
# and there is more than a 0.1% difference between short and long term EMA (accounting for the fee), buy
|
# and there is more than a 0.1% difference between short and long term EMA (accounting for the fee), buy
|
||||||
if previous_state != "Unknown" and k.short_ema.tail(1)[0][0] * (1-k.fee/100) > k.long_ema.tail(1)[0][0] and (k.short_ema.tail(1)[0][0] * (1-k.fee/100))/k.long_ema.tail(1)[0][0] - 1 > 0.001:
|
if previous_state != "Unknown" and k.short_ema.tail(1)[0][0] * (k.fee/100+1) > k.long_ema.tail(1)[0][0] and (k.short_ema.tail(1)[0][0] * (k.fee/100+1))/k.long_ema.tail(1)[0][0] - 1 > 0.001:
|
||||||
print("Buying shit")
|
print("Buying shit")
|
||||||
k.buy_order(currency_pair, currency_buy, currency_sell, k.balances["vol"][currency_sell] * 0.95 * (1/k.prices.tail(1)[0][0]))
|
k.buy_order(currency_pair, currency_buy, currency_sell, k.balances["vol"][currency_sell] * 0.95 * (1/k.prices.tail(1)[0][0]))
|
||||||
print(k.balances)
|
print(k.balances)
|
||||||
|
|
Loading…
Reference in a new issue