diff --git a/examples/CryptoTrader/BITMEX_connect.json b/examples/CryptoTrader/BITMEX_connect.json index baeb638b..4aef1612 100644 --- a/examples/CryptoTrader/BITMEX_connect.json +++ b/examples/CryptoTrader/BITMEX_connect.json @@ -1,6 +1,6 @@ { - "apiKey": "dVOUiqMzayJSW8gCGax_zWpy", - "apiSecret": "dTh0NWAvGA3h9YczL90R1MGxGc_BZtG05EJ3MoiMYRvtS5mL", + "apiKey": "", + "apiSecret": "", "sessionCount": 3, "symbols": ["XBTUSD", "EOSM18", "XRPM18"] } \ No newline at end of file diff --git a/vnpy/trader/app/algoTrading/algoEngine.py b/vnpy/trader/app/algoTrading/algoEngine.py index 22214811..b3d855dc 100644 --- a/vnpy/trader/app/algoTrading/algoEngine.py +++ b/vnpy/trader/app/algoTrading/algoEngine.py @@ -228,6 +228,10 @@ class AlgoEngine(object): event.dict_['data'] = d self.eventEngine.put(event) + # RPC推送 + if self.rpcServer: + self.rpcServer.publish('AlgoTrading', event) + # 保存数据到数据库 history = self.historyDict.setdefault(algoName, {}) history['algoName'] = algoName @@ -238,7 +242,8 @@ class AlgoEngine(object): history, {'algoName': algoName}, True) - + + #---------------------------------------------------------------------- def putParamEvent(self, algo, d): """更新参数""" @@ -249,6 +254,10 @@ class AlgoEngine(object): event.dict_['data'] = d self.eventEngine.put(event) + # RPC推送 + if self.rpcServer: + self.rpcServer.publish('AlgoTrading', event) + # 保存数据到数据库 history = self.historyDict.setdefault(algoName, {}) history['algoName'] = algoName diff --git a/examples/CryptoTrader/testRpc.py b/vnpy/trader/app/algoTrading/testRpc.py similarity index 100% rename from examples/CryptoTrader/testRpc.py rename to vnpy/trader/app/algoTrading/testRpc.py