Ejemplo n.º 1
0
def loadPolPrices():

    polPrices = polConn.returnTicker()
    for key, value in polPrices.iteritems():
        coinPair = key
        price = value['last']
        dbMod.insertPrices('POLONIEX', coinPair, price)
        dbMod.updatePrices('POLONIEX', coinPair, price)
Ejemplo n.º 2
0
def loadBittPrices():

    bittPrices = bittConn.get_markets()
    price = 0
    for key, value in bittPrices.iteritems():
        if key == 'result':
            for coinMarkets in value:
                coinPair = coinMarkets["MarketName"]
                priceDict = bittConn.get_ticker(coinPair)
                thisPriceDict = priceDict['result']
                if thisPriceDict is not None:
                    thisLast = thisPriceDict['Last']
                    dbMod.insertPrices('BITTREX', coinPair, thisLast)
                    dbMod.updatePrices('BITTREX', coinPair, thisLast)
Ejemplo n.º 3
0
def loadBitfPrices():

    bitfCoinHeld = dbMod.getCoinBalances('BITFINEX')

    for tuples in bitfCoinHeld:
        sym = tuples[0]
        print "Sym is " + sym

        if sym == 'BTC':
            symDB = 'USDT_' + sym
            sym = sym + 'usd'
        else:
            symDB = 'BTC_' + sym
            sym = sym + 'btc'

        print "Price for " + sym + " is " + str(bitfConnClient.ticker(sym))
        thisPriceDict = bitfConnClient.ticker(sym)

        thisLast = thisPriceDict['last_price']
        dbMod.insertPrices('BITFINEX', symDB, thisLast)
        dbMod.updatePrices('BITFINEX', symDB, thisLast)