Skip to content

Commit

Permalink
1.17.371
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Oct 5, 2018
1 parent 820043c commit 083c59c
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build/ccxt.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.17.370'
const version = '1.17.371'

Exchange.ccxtVersion = version

Expand Down
2 changes: 1 addition & 1 deletion ccxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.17.370'
const version = '1.17.371'

Exchange.ccxtVersion = version

Expand Down
35 changes: 33 additions & 2 deletions doc/manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,11 @@ Although some exchanges do mix-in orderbook’s top bid/ask prices into their ti

To get historical prices and volumes use the unified ```fetchOHLCV`` <https://github.com/ccxt/ccxt/wiki/Manual#ohlcv-candlestick-charts>`__ method where available.

Methods for fetching tickers:

- ``fetchTicker (symbol[, params = {}]) // symbol is required, params are optional``
- ``fetchTickers ([symbols = undefined[, params = {}]]) // both argument are optional (mostly)``

Individually By Symbol
~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -1770,9 +1775,35 @@ Some exchanges (not all of them) also support fetching all tickers at once. See
var_dump ($exchange->fetch_tickers ()); // all tickers indexed by their symbols
}
Fetching all tickers requires more traffic than fetching a single ticker. If you only need one ticker, fetching by a particular symbol is faster in general. You probably want to fetch all tickers only if you really need all of them.
Fetching all tickers requires more traffic than fetching a single ticker. Also, note that some exchanges impose higher rate-limits on subsequent fetches of all tickers (see their docs on corresponding endpoints for details). **The cost of fetchTickers call in terms of rate limit is often higher than average**. If you only need one ticker, fetching by a particular symbol is faster as well. You probably want to fetch all tickers only if you really need all of them and, most likely, you don’t want to fetchTickers more frequently than once a minute or so.

Also, some exchanges may impose additional requirements on fetchTickers call, sometimes you can’t fetch tickers for all symbols because of API limitations of the exchange in question. Some exchanges allow specifying a list of symbols in HTTP URL query params, however, because URL length is limited, and in extreme cases exchanges can have thousands of markets – a list of all their symbols simply would not fit in the URL, so it has to be a limited subset of their symbols. Sometimes, there are other reasons for requiring a list of symbols, and there may be a limit on the number of symbols you can fetch at once, but whatever the limitation, please, blame the exchange. To pass the symbols of interest to the exchange, once can simply supply a list of strings as the first argument to fetchTickers:

.. code:: javascript
//JavaScript
if (exchange.has['fetchTickers']) {
console.log (await (exchange.fetchTickers ([ 'ETH/BTC', 'LTC/BTC' ]))) // listed tickers indexed by their symbols
}
.. code:: python
# Python
if (exchange.has['fetchTickers']):
print(exchange.fetch_tickers(['ETH/BTC', 'LTC/BTC'])) # listed tickers indexed by their symbols
.. code:: php
// PHP
if ($exchange->has['fetchTickers']) {
var_dump ($exchange->fetch_tickers (array ('ETH/BTC', 'LTC/BTC'))); // listed tickers indexed by their symbols
}
Note that the list of symbols is not required in most cases, but you must add additional logic if you want to handle all possible limitations that might be imposed on the exchanges’ side.

Like most methods of the Unified CCXT API, the last argument to fetchTickers is the ``params`` argument for overriding request parameters that are sent towards the exchange.

The structure of returned value is as follows:
The structure of the returned value is as follows:

.. code:: javascript
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.17.370",
"version": "1.17.371",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 100+ exchanges",
"main": "./ccxt.js",
"unpkg": "build/ccxt.browser.js",
Expand Down
4 changes: 2 additions & 2 deletions php/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
use kornrunner\Secp256k1;
use kornrunner\Solidity;

$version = '1.17.370';
$version = '1.17.371';

// rounding mode
const TRUNCATE = 0;
Expand All @@ -50,7 +50,7 @@

class Exchange {

const VERSION = '1.17.370';
const VERSION = '1.17.371';

public static $eth_units = array (
'wei' => '1',
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# ----------------------------------------------------------------------------

__version__ = '1.17.370'
__version__ = '1.17.371'

# ----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async_support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# -----------------------------------------------------------------------------

__version__ = '1.17.370'
__version__ = '1.17.371'

# -----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async_support/base/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# -----------------------------------------------------------------------------

__version__ = '1.17.370'
__version__ = '1.17.371'

# -----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/base/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# -----------------------------------------------------------------------------

__version__ = '1.17.370'
__version__ = '1.17.371'

# -----------------------------------------------------------------------------

Expand Down

0 comments on commit 083c59c

Please sign in to comment.