diff --git a/vnpy/trader/app/algoTrading/twapAlgo.py b/vnpy/trader/app/algoTrading/twapAlgo.py index d3727136..a2c309c5 100644 --- a/vnpy/trader/app/algoTrading/twapAlgo.py +++ b/vnpy/trader/app/algoTrading/twapAlgo.py @@ -106,7 +106,7 @@ class TwapAlgo(AlgoTemplate): # 发出委托 self.buy(self.vtSymbol, price, size) - self.writeLog(u'委托买入%s,数量%,价格%s' %(self.vtSymbol, self.orderSize, price)) + self.writeLog(u'委托买入%s,数量%s,价格%s' %(self.vtSymbol, self.orderSize, price)) # 卖出 if self.direction == DIRECTION_SHORT: # 市场卖1价大于目标价 diff --git a/vnpy/trader/gateway/bitmexGateway/BITMEX_connect.json b/vnpy/trader/gateway/bitmexGateway/BITMEX_connect.json new file mode 100644 index 00000000..4aef1612 --- /dev/null +++ b/vnpy/trader/gateway/bitmexGateway/BITMEX_connect.json @@ -0,0 +1,6 @@ +{ + "apiKey": "", + "apiSecret": "", + "sessionCount": 3, + "symbols": ["XBTUSD", "EOSM18", "XRPM18"] +} \ No newline at end of file diff --git a/vnpy/trader/gateway/huobiGateway/huobiGateway.py b/vnpy/trader/gateway/huobiGateway/huobiGateway.py index 1d383342..7a0c837f 100644 --- a/vnpy/trader/gateway/huobiGateway/huobiGateway.py +++ b/vnpy/trader/gateway/huobiGateway/huobiGateway.py @@ -600,13 +600,14 @@ class HuobiTradeApi(TradeApi): if d['canceled-at']: order.cancelTime = datetime.fromtimestamp(d['canceled-at']/1000).strftime('%H:%M:%S') - newTradedVolume = d['field-amount'] + newTradedVolume = float(d['field-amount']) newStatus = statusMapReverse.get(d['state'], STATUS_UNKNOWN) if newTradedVolume != order.tradedVolume or newStatus != order.status: updated = True - order.tradedVolume = float(newTradedVolume) - order.status = newStatus + + order.tradedVolume = newTradedVolume + order.status = newStatus # 只推送有更新的数据 if updated: diff --git a/vnpy/trader/language/chinese/constant.py b/vnpy/trader/language/chinese/constant.py index e71970db..3bd294bc 100644 --- a/vnpy/trader/language/chinese/constant.py +++ b/vnpy/trader/language/chinese/constant.py @@ -94,6 +94,7 @@ EXCHANGE_COINCHECK = "COINCHECK" # COINCHECK日本比特币交易所 EXCHANGE_BINANCE = "BINANCE" # 币安比特币交易所 EXCHANGE_BITFINEX = "BITFINEX" # Bitfinex比特币交易所 EXCHANGE_BITMEX = 'BITMEX' # BitMEX比特币交易所 +EXCHANGE_FCOIN = 'FCOIN' # FCoin比特币交易所 # 货币类型 CURRENCY_USD = 'USD' # 美元 diff --git a/vnpy/trader/language/english/constant.py b/vnpy/trader/language/english/constant.py index 0676c8f5..852cfc56 100644 --- a/vnpy/trader/language/english/constant.py +++ b/vnpy/trader/language/english/constant.py @@ -90,6 +90,7 @@ EXCHANGE_COINCHECK = "COINCHECK" # COINCHECK日本比特币交易所 EXCHANGE_BINANCE = "BINANCE" # 币安比特币交易所 EXCHANGE_BITFINEX = "BITFINEX" # Bitfinex比特币交易所 EXCHANGE_BITMEX = 'BITMEX' # BitMEX比特币交易所 +EXCHANGE_FCOIN = 'FCOIN' # FCoin比特币交易所 # 货币类型 CURRENCY_USD = 'USD' # 美元