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()