Skip to content

Commit

Permalink
last_action bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
whittlem committed May 12, 2021
1 parent 268b9c7 commit 691c96d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pycryptobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
raise Exception('Insufficient available funds to place buy order: ' + str(account.getBalance(app.getQuoteCurrency())) + ' < 50 ' + app.getQuoteCurrency() + "\nNote: A manual limit order places a hold on available funds.")
elif state.last_action == 'BUY' and account.getBalance(app.getBaseCurrency()) < 0.001:
raise Exception('Insufficient available funds to place sell order: ' + str(account.getBalance(app.getBaseCurrency())) + ' < 0.1 ' + app.getBaseCurrency() + "\nNote: A manual limit order places a hold on available funds.")
print (state.last_action, account.getBalance(app.getQuoteCurrency()))

orders = account.getOrders(app.getMarket(), '', 'done')
if len(orders) > 0:
df = orders[-1:]
Expand All @@ -76,11 +76,6 @@
#state.last_action = 'SELL'
state.last_buy_price = 0.0

print (df)

print (state.last_action)
sys.exit()

def calculateMargin(buy_size: float=0.0, buy_filled: int=0.0, buy_price: int=0.0, buy_fee: float=0.0, sell_percent: float=100, sell_price: float=0.0, sell_fee: float=0.0, sell_taker_fee: float=0.0, debug: bool=False) -> float:
if debug is True:
print (f'buy_size: {buy_size}')
Expand Down

0 comments on commit 691c96d

Please sign in to comment.