Comments (6)
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.
WIll add coinmarketcap support, thanks!
from ccxt.
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.
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.
@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.
@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)
- coinex v2 version HOT 6
- Missing documentation in VS Code HOT 7
- Kraken client downloading orders again in fetchOrder? HOT 2
- "Malformed request" errors using watchOrderBooks on kraken HOT 4
- Hyperliquid - fetch_spot_markets() returns nothing HOT 4
- coinex Signature Incorrect HOT 2
- ccxtpro bug: the watched ohlcvs cache in OKX exchange not updated HOT 3
- Missing close time from Order Structure HOT 2
- JS ClosePosition and CloseAllPositions For BitGet Missing - In Documentation Not In Code HOT 1
- WatchOrders error for Bitget. C# HOT 3
- Throttler wrong cost calculation. C# HOT 2
- Bitget TONCOIN issue in 4.3.4 HOT 3
- Bingx : Having issues calling setLeverage in one way mode. HOT 4
- Coinbase sandbox HOT 3
- coinbasepro webproxy not working HOT 3
- coinbase: n = string[0] if isinstance(string[0], int) else ord(string[0]), IndexError: index out of range HOT 3
- exchange.fetchConvertTradeHistory: "KeyError: 'currency'" on binance HOT 8
- BingX handle_balance() keyError, called in watch_orders() HOT 2
- okx {"msg":"Request header OK-ACCESS-PASSPHRASE incorrect.","code":"50105"} HOT 5
- New Updater Has Been Released. Download here. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccxt.