Skip to content

Commit

Permalink
fix spread mean calc
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerabsurdity committed Jul 23, 2019
1 parent 63ec4fe commit aec5e4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SimpleBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def read_config(self, cfg_file):
self.amount_asset = pw.Asset(self.amount_asset_id)
self.price_asset_id = config.get('market', 'price_asset')
self.price_asset = pw.Asset(self.price_asset_id)
self.price_step = config.getint('market', 'price_step')
self.price_step = config.getfloat('market', 'price_step')
except OSError:
self.log("Error reading config file")
self.log("Exiting.")
Expand All @@ -78,7 +78,7 @@ def main():
order_book = waves_btc.orderbook()
best_bid = order_book["bids"][0]["price"]
best_ask = order_book["asks"][0]["price"]
spread_mean_price = ((best_bid + best_ask) // 2) * 10 ** (bot.price_asset.decimals - bot.amount_asset.decimals)
spread_mean_price = (best_bid + best_ask) // 2
bid_price = spread_mean_price * (1 - bot.price_step)
ask_price = spread_mean_price * (1 + bot.price_step)
bid_amount = int((btc_balance / bid_price) * 10 ** pw.WAVES.decimals) - bot.order_fee
Expand Down

0 comments on commit aec5e4a

Please sign in to comment.