Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ccxt-dev/ccxt
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Feb 25, 2018
2 parents 722c914 + 476d9fd commit e17b758
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 37 deletions.
30 changes: 21 additions & 9 deletions build/ccxt.browser.js

Large diffs are not rendered by default.

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.10.1207'
const version = '1.10.1208'

Exchange.ccxtVersion = version

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.10.1207",
"version": "1.10.1208",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 90+ exchanges",
"main": "./ccxt.js",
"unpkg": "build/ccxt.browser.js",
Expand Down
2 changes: 1 addition & 1 deletion php/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace ccxt;

$version = '1.10.1207';
$version = '1.10.1208';

abstract class Exchange {

Expand Down
2 changes: 2 additions & 0 deletions php/liqui.php
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,8 @@ public function handle_errors ($httpCode, $reason, $url, $method, $headers, $bod
throw new DDoSProtection ($feedback);
} else if ($message === 'not available') {
throw new DDoSProtection ($feedback);
} else if ($message === 'data unavailable') {
throw new DDoSProtection ($feedback);
} else if ($message === 'external service unavailable') {
throw new DDoSProtection ($feedback);
} else {
Expand Down
24 changes: 17 additions & 7 deletions php/poloniex.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,16 @@ public function parse_ticker ($ticker, $market = null) {
$symbol = null;
if ($market)
$symbol = $market['symbol'];
$open = null;
$change = null;
$average = null;
$last = floatval ($ticker['last']);
$relativeChange = floatval ($ticker['percentChange']);
if ($relativeChange !== -1) {
$open = $last / (1 . $relativeChange);
$change = $last - $open;
$average = ($last . $open) / 2;
}
return array (
'symbol' => $symbol,
'timestamp' => $timestamp,
Expand All @@ -267,13 +277,13 @@ public function parse_ticker ($ticker, $market = null) {
'bid' => floatval ($ticker['highestBid']),
'ask' => floatval ($ticker['lowestAsk']),
'vwap' => null,
'open' => null,
'close' => null,
'first' => null,
'last' => floatval ($ticker['last']),
'change' => floatval ($ticker['percentChange']),
'percentage' => null,
'average' => null,
'open' => $open,
'close' => $last,
'last' => $last,
'previousClose' => null,
'change' => $change,
'percentage' => $relativeChange * 100,
'average' => $average,
'baseVolume' => floatval ($ticker['quoteVolume']),
'quoteVolume' => floatval ($ticker['baseVolume']),
'info' => $ticker,
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

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

__version__ = '1.10.1207'
__version__ = '1.10.1208'

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

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

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

__version__ = '1.10.1207'
__version__ = '1.10.1208'

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

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

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

__version__ = '1.10.1207'
__version__ = '1.10.1208'

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

Expand Down
2 changes: 2 additions & 0 deletions python/ccxt/async/liqui.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ def handle_errors(self, httpCode, reason, url, method, headers, body):
raise DDoSProtection(feedback)
elif message == 'not available':
raise DDoSProtection(feedback)
elif message == 'data unavailable':
raise DDoSProtection(feedback)
elif message == 'external service unavailable':
raise DDoSProtection(feedback)
else:
Expand Down
23 changes: 16 additions & 7 deletions python/ccxt/async/poloniex.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ def parse_ticker(self, ticker, market=None):
symbol = None
if market:
symbol = market['symbol']
open = None
change = None
average = None
last = float(ticker['last'])
relativeChange = float(ticker['percentChange'])
if relativeChange != -1:
open = last / (1 + relativeChange)
change = last - open
average = (last + open) / 2
return {
'symbol': symbol,
'timestamp': timestamp,
Expand All @@ -265,13 +274,13 @@ def parse_ticker(self, ticker, market=None):
'bid': float(ticker['highestBid']),
'ask': float(ticker['lowestAsk']),
'vwap': None,
'open': None,
'close': None,
'first': None,
'last': float(ticker['last']),
'change': float(ticker['percentChange']),
'percentage': None,
'average': None,
'open': open,
'close': last,
'last': last,
'previousClose': None,
'change': change,
'percentage': relativeChange * 100,
'average': average,
'baseVolume': float(ticker['quoteVolume']),
'quoteVolume': float(ticker['baseVolume']),
'info': ticker,
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.10.1207'
__version__ = '1.10.1208'

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

Expand Down
2 changes: 2 additions & 0 deletions python/ccxt/liqui.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ def handle_errors(self, httpCode, reason, url, method, headers, body):
raise DDoSProtection(feedback)
elif message == 'not available':
raise DDoSProtection(feedback)
elif message == 'data unavailable':
raise DDoSProtection(feedback)
elif message == 'external service unavailable':
raise DDoSProtection(feedback)
else:
Expand Down
23 changes: 16 additions & 7 deletions python/ccxt/poloniex.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ def parse_ticker(self, ticker, market=None):
symbol = None
if market:
symbol = market['symbol']
open = None
change = None
average = None
last = float(ticker['last'])
relativeChange = float(ticker['percentChange'])
if relativeChange != -1:
open = last / (1 + relativeChange)
change = last - open
average = (last + open) / 2
return {
'symbol': symbol,
'timestamp': timestamp,
Expand All @@ -265,13 +274,13 @@ def parse_ticker(self, ticker, market=None):
'bid': float(ticker['highestBid']),
'ask': float(ticker['lowestAsk']),
'vwap': None,
'open': None,
'close': None,
'first': None,
'last': float(ticker['last']),
'change': float(ticker['percentChange']),
'percentage': None,
'average': None,
'open': open,
'close': last,
'last': last,
'previousClose': None,
'change': change,
'percentage': relativeChange * 100,
'average': average,
'baseVolume': float(ticker['quoteVolume']),
'quoteVolume': float(ticker['baseVolume']),
'info': ticker,
Expand Down

0 comments on commit e17b758

Please sign in to comment.