add binance gateway
This commit is contained in:
parent
4c83eca3fe
commit
fd8ff33731
6
vnpy/trader/gateway/binanceGateway/BINANCE_connect.json
Normal file
6
vnpy/trader/gateway/binanceGateway/BINANCE_connect.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"accountID": "---",
|
||||||
|
"accessKey": "----",
|
||||||
|
"secretKey": "---",
|
||||||
|
"interval": 6
|
||||||
|
}
|
24
vnpy/trader/gateway/binanceGateway/DigitalCurrency.py
Normal file
24
vnpy/trader/gateway/binanceGateway/DigitalCurrency.py
Normal 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()
|
11
vnpy/trader/gateway/binanceGateway/__init__.py
Normal file
11
vnpy/trader/gateway/binanceGateway/__init__.py
Normal 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
|
||||||
|
|
1076
vnpy/trader/gateway/binanceGateway/binanceGateway.py
Normal file
1076
vnpy/trader/gateway/binanceGateway/binanceGateway.py
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user