问题描述
尝试使用来自 cbpro 的 websocket 提交订单,但由于某种原因它不起作用,它在 on_open 和 on_close 或作为独立定义工作,但在 on_message 作为正在运行的 websocket 的一部分不起作用
代码示例:
def web_socket_testing():
class myWebsocketClient(cbpro.WebsocketClient):
def on_open(self):
self.auth_client = cbpro.AuthenticatedClient(api_key,api_secret,passphrase)
def on_message(self,msg):
if some criteria....
self.auth_client.place_market_order(product_id='xxx',side='xxx',size='xxx')
wsClient = myWebsocketClient()
wsClient.start()
time.sleep(7000)
wsClient.close()
if __name__ == "__main__":
web_socket_testing()
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)