-1

currently I was working a bot in Bitcoin exchange Bitmex with python, Click here! I followed instruction and the sample program works!! but when I am trying to implement my own custom trading strategies and add some strategy code into custom_strategy.py. Run python custom_strategy.py in windows Powershell, nothing happened, no error information, no order has been placed in Testnet Bitmex. Can anyone help to me with this? did I do something wrong?

$ python custom_strategy.py $ #nothing show

my custom_strategy.py is quite simple:

import sys
from market_maker.market_maker import OrderManager
class CustomOrderManager(OrderManager):
    buy_orders = []
    sell_orders = []
    ticker = self.exchange.get_ticker()
    buy_orders.append({'price': ticker["buy"], 'orderQty': 100, 'side': "Buy"})
    sell_orders.append({'price': ticker["buy"]+50, 'orderQty': 100, 'side': "Sell"})
    self.converge_orders(buy_orders, sell_orders)
def run() -> None:
    order_manager = CustomOrderManager()
try:
    order_manager.run_loop()
except (KeyboardInterrupt, SystemExit):
sys.exit()

1 Answers1

1

use this answer - https://github.com/BitMEX/sample-market-maker/issues/139#issuecomment-424530071

It's worked for me..

Just - Instead of running the custom strategy directly (python3 market_maker/custom_strategy.py), create a script to run it from the top-level directory..