[Fix]修复TWAP日志输出格式化typo

This commit is contained in:
vn.py 2018-06-19 13:48:52 +08:00
parent f408cb30ca
commit 2742de7d4b
5 changed files with 13 additions and 4 deletions

View File

@ -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价大于目标价

View File

@ -0,0 +1,6 @@
{
"apiKey": "",
"apiSecret": "",
"sessionCount": 3,
"symbols": ["XBTUSD", "EOSM18", "XRPM18"]
}

View File

@ -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:

View File

@ -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' # 美元

View File

@ -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' # 美元