add binance gateway

This commit is contained in:
msincenselee 2018-05-29 11:20:08 +08:00
parent 4c83eca3fe
commit fd8ff33731
4 changed files with 1117 additions and 0 deletions

View File

@ -0,0 +1,6 @@
{
"accountID": "---",
"accessKey": "----",
"secretKey": "---",
"interval": 6
}

View File

@ -0,0 +1,24 @@
# encoding: utf-8
'''
ethusdt --> eth_usdt
etcbtc --> etc_btc
ethusdt.HUOBI --> eth_usdt
etcbtc.HUOBI --> etc_btc
'''
def systemSymbolToVnSymbol(symbol):
symbol = symbol.replace('_','')
symbol = ((symbol.split('.'))[0]).lower()
if 'usdt' in symbol:
return symbol[:-4] + "_usdt"
else:
return symbol[:-3] + "_" + symbol[-3:]
'''
etc_btc --> etcbtc
eth_usdt --> ethusdt
'''
def VnSymbolToSystemSymbol(symbol):
symbol = (symbol.split('.'))[0]
return (''.join(symbol.split('_'))).lower()

View File

@ -0,0 +1,11 @@
# encoding: UTF-8
from vnpy.trader import vtConstant
from vnpy.trader.gateway.binanceGateway.binanceGateway import BinanceGateway
gatewayClass = BinanceGateway
gatewayName = 'BINANCE'
gatewayDisplayName = u'BINANCE'
gatewayType = vtConstant.GATEWAYTYPE_BTC
gatewayQryEnabled = True

File diff suppressed because it is too large Load Diff