Exemplo n.º 1
0
def find_all_coin_prices():
    # Load the Coin Market Cap exchange
    coinmarketcap = ccxt.coinmarketcap()

    # Load the market for Coin Market Cap
    markets = coinmarketcap.load_markets()

    for symbol in markets:
        # Only check USD coins
        if (symbol[-3:] == 'USD'):
            price = str(markets[symbol]['info']['price_usd'])
            print(symbol + ' : ' + price)
Exemplo n.º 2
0
def symbol_price(symbol):

    # Load the Coin Market Cap exchange
    coinmarketcap = ccxt.coinmarketcap()

    # Load the market for Coin Market Cap
    markets = coinmarketcap.load_markets()

    # Get the price of bitcoin
    price = markets[symbol]['info']['price_usd']

    # Print it out
    print(symbol + ' : ' + price)
Exemplo n.º 3
0
def get_usdt_rates_for(*coins):
    """
    Get usdt price from coinmarket for coins: BTC, USDT, ETH 
    Return {'BTC': 6864.22, 'ETH': 416.851, 'USDT': 1}
    """
    usdt_rates = {'USDT': 1.0}

    ccap = ccxt.coinmarketcap()
    ccap.load_markets()
    for coin in coins:
        if coin != 'USDT':
            usdt_rates[coin] = float(
                ccap.market(f'{coin}/USD')['info']
                ['price_usd'])  #ccap.fetch_ticker(f'{coin}/USD')['close']
    return usdt_rates
Exemplo n.º 4
0
def get_itt_token_price():
    minimum_itt_price = 0.001

    ccap = ccxt.coinmarketcap()
    itt = ccap.fetch_ticker('ITT/USD')

    if itt['close'] < minimum_itt_price:
        itt_close = minimum_itt_price
    else:
        itt_close = itt['close']
    return {
        'symbol': 'ITT/USD',
        'close': itt_close,
        'quoteVolume': itt['quoteVolume'],
        'datetime': itt['datetime']
    }
Exemplo n.º 5
0
 def __init__(self):
     self.k = ct.kraken()
     self.y = ct.yobit()
     self.p = ct.poloniex()
     self.coinmarket = ct.coinmarketcap()
     self.liqui = ct.bitfinex()
     print(ct.exchanges)
     print(self.k.hasFetchOHLCV, self.k.rateLimit)
     print(self.y.hasFetchOHLCV, self.y.rateLimit)
     print(self.p.hasFetchOHLCV, self.p.rateLimit)
     # print(self.coinmarket.hasFetchOHLCV, self.coinmarket.rateLimit)
     keys_conf = conf.TradeKeys()
     #print(keys_conf.keys_info)
     self.k.apiKey = keys_conf.keys_info['kraken']['public']
     self.k.secret = keys_conf.keys_info['kraken']['secret']
     #self.k.load_markets()
     print(self.k.symbols)
Exemplo n.º 6
0
 def __init__(self):
     print("Obtaining coinmarketcap ticker...")
     try:
         coinmarketcap = ccxt.coinmarketcap()
         self.coin_data = coinmarketcap.fetch_tickers()
         with open('cache/coinmarketcap.json', 'w') as outfile:
             json.dump(self.coin_data, outfile)
     except:
         with open('cache/coinmarketcap.json', mode='r') as cache_file:
             self.coin_data = json.loads(cache_file.read())
     self.prices_manual = []
     reader = ConfigReader("prices_manual.txt", 2)
     for line in reader.fields:
         if len(line) >= 2:
             self.prices_manual.append({
                 "symbol": line[0],
                 "price": float(line[1])
             })
     self.disambiguation_tables = {}
     self.read_disambiguation_table("neo")
     self.read_disambiguation_table("coinmarketcap")
     return
Exemplo n.º 7
0
def findMidMarketCap(currencies):
    t = []
    for symbol in currencies:
        cap = ccxt.coinmarketcap()[symbol].market_cap_usd()
        if int(cap) > 100000 and int(cap) < 5000000000: t.append(symbol)
    return t
Exemplo n.º 8
0
def exchangeObject(exchange_in):
    exchanges = [
        ccxt.acx(),
        ccxt.bitbay(),
        ccxt.bitfinex(),
        ccxt.bitflyer(),
        ccxt.bithumb(),
        ccxt.bitlish(),
        ccxt.bitmarket(),
        ccxt.bitmex(),
        ccxt.bitso(),
        ccxt.bitstamp(),
        ccxt.bitstamp1(),
        ccxt.bittrex(),
        ccxt.bl3p(),
        ccxt.bleutrade(),
        ccxt.btcbox(),
        ccxt.btcchina(),
        ccxt.btcexchange(),
        ccxt.btcmarkets(),
        ccxt.btctradeua(),
        ccxt.btcturk(),
        ccxt.bxinth(),
        ccxt.ccex(),
        ccxt.cex(),
        ccxt.chbtc(),
        ccxt.chilebit(),
        ccxt.coincheck(),
        ccxt.coinfloor(),
        ccxt.coingi(),
        ccxt.coinmarketcap(),
        ccxt.coinmate(),
        ccxt.coinspot(),
        ccxt.cryptopia(),
        ccxt.dsx(),
        ccxt.exmo(),
        ccxt.flowbtc(),
        ccxt.foxbit(),
        ccxt.fybse(),
        ccxt.fybsg(),
        ccxt.gatecoin(),
        ccxt.gateio(),
        ccxt.gdax(),
        ccxt.gemini(),
        ccxt.getbtc(),
        ccxt.hitbtc(),
        ccxt.independentreserve(),
        ccxt.itbit(),
        ccxt.jubi(),
        ccxt.kraken(),
        ccxt.kucoin(),
        ccxt.kuna(),
        ccxt.lakebtc(),
        ccxt.liqui(),
        ccxt.livecoin(),
        ccxt.luno(),
        ccxt.mercado(),
        ccxt.mixcoins(),
        ccxt.nova(),
        ccxt.okcoincny(),
        ccxt.okcoinusd(),
        ccxt.okex(),
        ccxt.paymium(),
        ccxt.poloniex(),
        ccxt.qryptos(),
        ccxt.quadrigacx(),
        ccxt.southxchange(),
        ccxt.surbitcoin(),
        ccxt.therock(),
        ccxt.tidex(),
        ccxt.urdubit(),
        ccxt.vaultoro(),
        ccxt.vbtc(),
        ccxt.virwox(),
        ccxt.wex(),
        ccxt.xbtce(),
        ccxt.yobit(),
        ccxt.yunbi(),
        ccxt.zaif(),
        ccxt.zb()
    ]

    for count, exchange in enumerate([str(x) for x in exchanges]):
        if exchange_in.lower() in exchange:
            return exchanges[count]
            break
Exemplo n.º 9
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#

import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
import ccxt

#Coin checking part

cmc = ccxt.coinmarketcap()


def getPrice(coin):
    cointick = dict(cmc.fetch_ticker(coin + '/EUR'))
    cointick = cointick.get('info')
    coinPrice = cointick.get('price_eur')
    coinPrice = float(coinPrice)
    return coinPrice


LTC = getPrice('LTC')

XLM = getPrice('XLM')

TotalLTC = LTC * 19.442

getBack = TotalLTC / XLM

# Mail part
Exemplo n.º 10
0
 def upDateETHBTC(self):
     try:
         self.ETHBTC = ccxt.coinmarketcap().fetch_ticker("ETH/USD")['info']['price_btc']
     except:
         print('ETHBTC did not update')
         pass
Exemplo n.º 11
0
 def __init__(self):
     self.exchanges = [
         Exchange.Binance.binance(),
         Exchange.Kucoin.kucoin(),
         Exchange.Cryptopia.cryptopia(),
         Exchange.Bittrex.bittrex()
     ]
     self.coins = [
         'BTC',
         'ETH',
         'XRP',
         'BCH',
         'ADA',
         'LTC',
         'XLM',
         'NEO',
         'EOS',
         'XEM',
         'MIOTA',
         'DASH',
         'XMR',
         'LSK',
         'TRX',
         'USDT',
         'ETC',
         'BTG',
         'QTUM',
         'VEN',
         'ZEC',
         'ICX',
         'OMG',
         'XRB',
         'STEEM',
         'PPT',
         'BNB',
         'BCN',
         'SNT',
         'XVG',
         'SC',
         'STRAT',
         'MKR',
         'BTS',
         'AE',
         'REP',
         'DOGE',
         'VERI',
         'WAVES',
         'WTC',
         'DCR',
         'ARDR',
         'ZRX',
         'RHOC',
         'HSR',
         'KCS',
         'DGD',
         'R',
         'KMD',
         'KNC',
         'ETN',
         'ARK',
         'GAS',
         'LRC',
         'BTM',
         'DCN',
         'BAT',
         'DGB',
         'ZIL',
         'DRGN',
         'GBYTE',
         'PIVX',
         'ZCL',
         'CNX',
         'ELF',
         'QASH',
         'BTX',
         'ETHOS',
         'GXS',
         'NAS',
         'GNT',
         'SYS',
         'PLR',
         'POWR',
         'IOST',
         'FUN',
         'DENT',
         'CND',
         'MONA',
         'FCT',
         'KIN',
         'SALT',
         'SMART',
         'XZC',
         'BNT',
         'AION',
         'PART',
         'ENG',
         'NXT',
         'RDD',
         'MAID',
         'PAY',
         'IGNIS',
         'QSP',
         'AGI',
         'REQ',
         'XP',
         'NXS',
         'WAX',
         'XPA',
         'ICN',
         'GNO',
         'EMC',
         'SUB',
         'GAME',
         'XDN',
         'UCASH',
         'LINK',
         'NEBL',
         'CVC',
         'BLOCK',
         'VTC',
         'BTCD',
         'HPB',
         'STORJ',
         'SKY',
         'RDN',
         'MANA',
         'ECN',
         'POE',
         'DEW',
         'UNITY',
         'ACT',
         'TNB',
         'MED',
         'NAV',
         'ANT',
         'ZEN',
         'STORM',
         'ENJ',
         'HTML',
         'DTR',
         'RLC',
         'SAN',
         'UBQ',
         'PPP',
         'SRN',
         'VEE',
         'AGRS',
         'BLZ',
         'BCO',
         'MCO',
         'EMC2',
         'VIBE',
         'C20',
         'SPHTX',
         'BIX',
         'ITC',
         'JNT',
         'PPC',
         'XAS',
         'RPX',
         'SNGLS',
         'MDS',
         'LEND',
         'RCN',
         'AST',
         'COB',
         'PAC',
         'CMT',
         'SNM',
         'XBY',
         'DBC',
         'ADX',
         'SPANK',
         'XCP',
         'AMB',
         'MTL',
         'OST',
         'TEL',
         'UTK',
         'BAY',
         'QRL',
         'PRL',
         'EDG',
         'THETA',
         'MGO',
         'WABI',
         'NLG',
         'VIA',
         'MLN',
         'TNC',
         'WGR',
         'INS',
         'DATA',
         'APPC',
         'UKG',
         'MOD',
         'TRIG',
         'TNT',
         'EDO',
         'CDT',
         'ION',
         'WINGS',
         'NULS',
         'ETP',
         'CTR',
         'NGC',
         'ECA',
         'ATM',
         'GVT',
         'SOC',
         'FUEL',
         'LBC',
         'MER',
         'MNX',
         'LKK',
         'IDH',
         'BURST',
         'ECC',
         'INT',
         'QLC',
         'CRW',
         'SLS',
         'DNT',
         'BRD',
         'AEON',
         'CLOAK',
         'HVN',
         'ADT',
         'TSL',
         'GRS',
         'DCT',
         'TRAC',
         'COSS',
         'TAAS',
         'HST',
         'CAPP',
         'CV',
         'ONION',
         'DAT',
         'TKN',
         'SAFEX',
         'PURA',
         'OCN',
         'PRE',
         '1ST',
         'SBD',
         'GTO',
         'VIB',
         'LUN',
         'INK',
         'QBT',
         'FTC',
         'BDG',
         'BITCNY',
         'THC',
         'IOC',
         'NMC',
         'YOYOW',
         'DPY',
         'XWC',
         'SHIFT',
         'XSPEC',
         'HMQ',
         'PEPECASH',
         'DMD',
         'CFI',
         'POT',
         'SWFTC',
         'TRST',
         'NET',
         'VOX',
         'DIME',
         'IPL',
         'SIB',
         'TIX',
         'TAU',
         'UNO',
         'MTH',
         'LOCI',
         'ZSC',
         'BLT',
         'FLASH',
         'IXT',
         'TIO',
         'RISE',
         'KRM',
         'MOON',
         'POSW',
         'SNC',
         'AMP',
         'LEO',
         'WRC',
         'EVX',
         'CAT',
         'LA',
         'FAIR',
         'VRC',
         'PASC',
         'ORME',
         'MOT',
         'COLX',
         'PHR',
         'KEY',
         'XSH',
         'NEU',
         'AURA',
         'MDA',
         'DLT',
         'DRT',
         'GUP',
         'PRO',
         'NLC2',
         'PLC',
         'OTN',
         'XEL',
         'NVST',
         'BLK',
         'GRC',
         'QUN',
         'NMR',
         'BITB',
         'GTC',
         'SOAR',
         'EXP',
         'BOT',
         'MYB',
         'CAN',
         'COV',
         'HGT',
         'BBR',
         'UNIT',
         'HKN',
         'ZOI',
         'BCPT',
         'RADS',
         'AIR',
         'PKT',
         'PPY',
         'DNA',
         'SLR',
         'ARN',
         'SWT',
         'OK',
         'MSP',
         'NSR',
         'OMNI',
         'STX',
         'UQC',
         'SNOV',
         'ENRG',
         'DICE',
         'PUT',
         'WCT',
         'GOLOS',
         'MUE',
         'RBY',
         'NYC',
         'OXY',
         'BSD',
         'XMY',
         'BMC',
         'HOT',
         'KICK',
         'EDR',
         'BITUSD',
         'XNN',
         'EBTC',
         'MEE',
         'PST',
         'PRG',
         'OAX',
         'ICOS',
         'GBX',
         'XAUR',
         'VOISE',
         'LOC',
         'PLBT',
         'CLAM',
         'POLL',
         'BNTY',
         'OCT',
         'ATB',
         'NXC',
         'BLUE',
         'ECOB',
         'CSNO',
         'NEOS',
         'USNBT',
         'LMC',
         'XPM',
         'DBET',
         'RVT',
         'VIU',
         'PRA',
         'DAI',
         'GET',
         'LUX',
         'MINT',
         'XUC',
         'QAU',
         'TIME',
         'AUR',
         'INCNT',
         'RNT',
         'ALIS',
         'AIT',
         'GAM',
         'BPT',
         'FLO',
         'GAT',
         'DBIX',
         'PND',
         'FLDC',
         'DTB',
         'TIPS',
         'IFT',
         'PTOY',
         'AVT',
         'HDG',
         'XLR',
         'GCR',
         'RMC',
         'MYST',
         'PLU',
         'PIRL',
         'DYN',
         'BQ',
         'SYNX',
         'HAC',
         'DIVX',
         'OBITS',
         'COVAL',
         'PZM',
         'ODN',
         'ELIX',
         'LIFE',
         'ESP',
         'SEQ',
         'HORSE',
         'XRL',
         'POLIS',
         'NTRN',
         'DOVU',
         'LEV',
         'MUSIC',
         'SPF',
         'HAT',
         'BIS',
         'LINDA',
         'CAT',
         'BCY',
         'NIO',
         'XST',
         'SXUT',
         'XTO',
         'RC',
         'CURE',
         'DRP',
         'ABY',
         'EVR',
         'ARY',
         'BWK',
         'FLIXX',
         'CAG',
         'SPHR',
         'IOP',
         'DOPE',
         'PARETO',
         'CVCOIN',
         'PINK',
         'EAC',
         'PBL',
         'ING',
         'BTCZ',
         'AIX',
         'ALQO',
         'XVC',
         'SPRTS',
         'PIX',
         'XMCC',
         'TOA',
         'SUMO',
         'NVC',
         'AC',
         '1337',
         'PFR',
         'B2B',
         'HEAT',
         'ERO',
         'UFO',
         'WISH',
         'MEME',
         'HYP',
         'TIE',
         'VRM',
         'GCN',
         'SSS',
         'CRED',
         'QWARK',
         'HUSH',
         'FLIK',
         'PLAY',
         'ERC',
         'ADST',
         'DOT',
         'ATMS'
     ]
     self.tempInvalidCoins = ['BTG','BLZ','UKG']
     # UKG - kucoin says bittrex address is wrong
     for invalidCoin in self.tempInvalidCoins:
         self.coins.remove(invalidCoin)
     self.ETHBTC = ccxt.coinmarketcap().fetch_ticker("ETH/USD")['info']['price_btc']
Exemplo n.º 12
0
import ccxt
import pickler
cap = ccxt.coinmarketcap().fetch_currencies()


def findMidMarketCap(currencies):
    t = []
    for symbol in currencies:
        #print(symbol)
        if symbol in cap.keys():
            capSymbol = cap[symbol]['info']['market_cap_usd']
            if float(capSymbol) > 100000 and float(capSymbol) < 8000000000:
                if symbol not in t: t.append(symbol)
    return t


exchangesName = [
    'binance', 'bittrex', 'poloniex', 'kucoin', 'livecoin', 'coinexchange'
]
exchangeObjects = []
for names in exchangesName:
    market = getattr(ccxt, names)
    t = market()
    t.load_markets()
    exchangeObjects.append(t.fetch_currencies().keys())
exchange = ccxt.binance()
exchange.load_markets()
currencies = exchange.fetch_currencies().keys()
midMarketCapCurr = []
for n in exchangeObjects:
    midMarketCapCurr.extend(findMidMarketCap(list(n)))
Exemplo n.º 13
0
import ccxt
import json
import time
import unicodecsv as csv
from datetime import datetime

#hitbtc = ccxt.hitbtc({'verbose': True})
#bitmex = ccxt.bitmex()
#binance = ccxt.binance()
exchanges = {
    'coinmarketcap': ccxt.coinmarketcap(),
    'binance': ccxt.binance(),
    'bitmex': ccxt.bitmex(),
    'bitfinex': ccxt.bitfinex(),
    'kraken': ccxt.kraken(),
    'kucoin': ccxt.kucoin(),
    'hitbtc': ccxt.hitbtc({'verbose': True})
}

with open('ccxt_data.csv', 'wb') as outfile:
    fieldnames = ["exchange", "symbol", "data"]
    schreiber = csv.DictWriter(outfile,
                               fieldnames=fieldnames,
                               encoding='utf-8')
    #schreiber.writeheader()

    for name, ex in exchanges.items():
        exchange = ex
        exchange.load_markets()
        if exchange.has['fetchOHLCV']:
            for symbol in exchange.markets:
Exemplo n.º 14
0
 ccxt.btctradeua(),
 ccxt.btcturk(),
 ccxt.btcx(),
 ccxt.bxinth(),
 ccxt.ccex(),
 ccxt.cex(),
 ccxt.chbtc(),
 ccxt.chilebit(),
 ccxt.cobinhood(),
 ccxt.coincheck(),
 ccxt.coinegg(),
 ccxt.coinex(),
 ccxt.coinexchange(),
 ccxt.coinfloor(),
 ccxt.coingi(),
 ccxt.coinmarketcap(),
 ccxt.coinmate(),
 ccxt.coinnest(),
 ccxt.coinone(),
 ccxt.coinsecure(),
 ccxt.coinspot(),
 ccxt.coolcoin(),
 ccxt.cryptopia(),
 ccxt.dsx(),
 ccxt.ethfinex(),
 ccxt.exmo(),
 ccxt.exx(),
 ccxt.flowbtc(),
 ccxt.foxbit(),
 ccxt.fybse(),
 ccxt.fybsg(),