Coder Social home page Coder Social logo

Comments (6)

kroitor avatar kroitor commented on May 11, 2024 1

This should work now, haven't met those None values before. Sorry for the inconvenience. Everything now works as written above.

import ccxt
cmc = ccxt.coinmarketcap ()
cmc.load_products ()
cmc.fetch_tickers ()

from ccxt.

kroitor avatar kroitor commented on May 11, 2024

WIll add coinmarketcap support, thanks!

from ccxt.

kroitor avatar kroitor commented on May 11, 2024

I added CoinMarketCap, look for the id in the code to see details.
Basically, it has only three possible methods:

coinmarketcap.loadProducts ()
coinmarketcap.fetchGlobal ([currency])  # default is 'USD', returns global data dictionary
coinmarketcap.fetchTickers ([currency]) # also 'USD', returns tickers indexed by symbols
coinmarketcap.fetchTicker (symbol)      # standard unified fetchTicker

Thanks!

from ccxt.

nmiculinic avatar nmiculinic commented on May 11, 2024
cmc = ccxt.coinmarketcap()
cmc.load_products()
cmc.fetch_tickers()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-18-d099b6980226> in <module>()
----> 1 cmc.fetch_tickers()

/usr/lib/python3.6/site-packages/ccxt/__init__.py in fetch_tickers(self, currency)
   4957             product = self.products_by_id[id]
   4958             symbol = product['symbol']
-> 4959             tickers[symbol] = self.parseTicker (ticker, product)
   4960         return tickers
   4961 

/usr/lib/python3.6/site-packages/ccxt/__init__.py in parseTicker(self, ticker, product)
   4938             'first': None,
   4939             'last': float (ticker[price]),
-> 4940             'change': float (ticker['percent_change_24h']),
   4941             'percentage': None,
   4942             'average': None,

TypeError: float() argument must be a string or a number, not 'NoneType'

Can you show me some example usage in python? Overall I'm having issues powering it up.

from ccxt.

avatar-lavventura avatar avatar-lavventura commented on May 11, 2024

@kroitor : I have having following error:

import ccxt
cmc = ccxt.coinmarketcap ()

Traceback (most recent call last):
  File "run.py", line 3, in <module>
    cmc = ccxt.coinmarketcap ()
  File "/usr/local/lib/python2.7/site-packages/ccxt/base/exchange.py", line 303, in __init__
    self.web3 = Web3(HTTPProvider())
TypeError: __init__() takes at least 2 arguments (1 given)

from ccxt.

kroitor avatar kroitor commented on May 11, 2024

@avatar-lavventura what's your version of CCXT? Does that happen with the most recent version of it?

import ccxt
print(ccxt.__version__)
cmc = ccxt.coinmarketcap ()

?

from ccxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.