Exemplo n.º 1
0
import sys
sys.path.append('../')
import time
from packages import binance as BINANCE
from packages import account as ACCOUNT
from packages import currency_pair as CURRENCYPAIR

# pgmanager
from packages import db as DB
import CONSTANTS
pgmanager = DB.PGManager(**CONSTANTS.DB_CONNECT_ARGS_LOCAL)

account = ACCOUNT.Account(
    'gBAyXDQx4SWJ1FKI5cG4xaYJVwTNnMWUVcrvHjNVAKjxmt0JrpLpowQ85Kg49Ak9',
    'EZaHgc67HCNeniUGiLbTBHZJyYsq5MyVPuwOugXUSeTz1mKma1wWaPm3yTeAN7En')
binance = BINANCE.Binance(account)
# liquid=LIQUID.Liquid(account)
# kraken=KRAKEN.Kraken(account)
exchange = binance

currency_pair = CURRENCYPAIR.CurrencyPair('btc', 'usdt')


def digest_data(interval=86400, market='Kraken'):
    _name_map = 'XXBT' + 'Z' + currency_pair.reference.upper()
    # table_name = 'trades_' + currency_pair.base + '_' + currency_pair.reference + '_kraken'
    table_name = 'trades_for_binance'
    # select * from trades_for_binance where tid=(select max(tid) from trades_for_binance)
    sql = 'select * from ' + table_name + ' where tid=(select max(tid) from ' + table_name + ') '
    rows = pgmanager.select(sql)
    if len(rows) == 0:
Exemplo n.º 2
0
from packages import itbit as IB
from packages import kraken_rest1 as KK
from packages import kucoin as KC
from packages import liquid as LQ
from packages import okex as OK
from packages import poloniex as PL
from packages import zb as ZB

pgmanager = DB.PGManager(database='quantum',
                         user='******',
                         pw='Caichong416',
                         host='localhost',
                         port='5432')

virtual_account = ACCOUNT.Account('', '')
binance = BN.Binance(virtual_account)
bitfinex = BF.Bitfinex(virtual_account)
bitso = BS.Bitso(virtual_account)
bitstamp = BST.Bitstamp(virtual_account)
bittrex = BTT.Bittrex(virtual_account)
coinbase = CB.Coinbase(virtual_account)
digifinex = DF.DigiFinex(virtual_account)
gate = G.Gateio(virtual_account)
huobi = HB.Huobi(virtual_account)
itbit = IB.Itbit(virtual_account)
kraken = KK.KrakenRest(virtual_account)
kucoin = KC.Kucoin(virtual_account)
liquid = LQ.Liquid(virtual_account)
okex = OK.Okex(virtual_account)
poloniex = PL.Poloniex(virtual_account)
zb = ZB.Zb(virtual_account)
Exemplo n.º 3
0
from packages import binance as B
from packages import currency_pair as CP
from packages import account as ACC
import time

account = ACC.Account(
    'gBAyXDQx4SWJ1FKI5cG4xaYJVwTNnMWUVcrvHjNVAKjxmt0JrpLpowQ85Kg49Ak9',
    'EZaHgc67HCNeniUGiLbTBHZJyYsq5MyVPuwOugXUSeTz1mKma1wWaPm3yTeAN7En')
binance = B.Binance(account)
trades = binance.trades(CP.CurrencyPair())
starting_timestamp = 0
ending_timestamp = time.time()
while starting_timestamp < ending_timestamp:
    pass
a = 1