Skip to content

Commit

Permalink
1.10.981
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Feb 2, 2018
1 parent 9c7bb5c commit 948a801
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 34 deletions.
21 changes: 13 additions & 8 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.980'
const version = '1.10.981'

Exchange.ccxtVersion = version

Expand Down
2 changes: 1 addition & 1 deletion doc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ Thank you!
:target: https://www.npmjs.com/package/ccxt
.. |Gitter| image:: https://badges.gitter.im/ccxt-dev/ccxt.svg
:target: https://gitter.im/ccxt-dev/ccxt?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
.. |Supported Exchanges| image:: https://img.shields.io/badge/exchanges-97-blue.svg
.. |Supported Exchanges| image:: https://img.shields.io/badge/exchanges-98-blue.svg
:target: https://github.com/ccxt/ccxt/wiki/Exchange-Markets
.. |_1broker| image:: https://user-images.githubusercontent.com/1294454/27766021-420bd9fc-5ecb-11e7-8ed6-56d0081efed2.jpg
.. |_1btcxe| image:: https://user-images.githubusercontent.com/1294454/27766049-2b294408-5ecc-11e7-85cc-adaff013dc1a.jpg
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.980",
"version": "1.10.981",
"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.980';
$version = '1.10.981';

abstract class Exchange {

Expand Down
17 changes: 11 additions & 6 deletions php/cobinhood.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ public function describe () {
'fetchClosedOrders' => true,
),
'timeframes' => array (
'1m' => '1m',
'5m' => '5m',
// the first two don't seem to work at all
// '1m' => '1m',
// '5m' => '5m',
'15m' => '15m',
'30m' => '30m',
'1h' => '1h',
Expand Down Expand Up @@ -299,7 +300,8 @@ public function fetch_trades ($symbol, $since = null, $limit = 50, $params = arr

public function parse_ohlcv ($ohlcv, $market = null, $timeframe = '5m', $since = null, $limit = null) {
return [
$ohlcv['timestamp'] * 1000,
// they say that timestamps are Unix Timestamps in seconds, but in fact those are milliseconds
$ohlcv['timestamp'],
floatval ($ohlcv['open']),
floatval ($ohlcv['high']),
floatval ($ohlcv['low']),
Expand All @@ -308,16 +310,19 @@ public function parse_ohlcv ($ohlcv, $market = null, $timeframe = '5m', $since =
];
}

public function fetch_ohlcv ($symbol, $timeframe = '5m', $since = null, $limit = null, $params = array ()) {
public function fetch_ohlcv ($symbol, $timeframe = '15m', $since = null, $limit = null, $params = array ()) {
$this->load_markets();
$market = $this->market ($symbol);
$query = array (
'trading_pair_id' => $market['id'],
'timeframe' => $this->timeframes[$timeframe],
// they say in their docs that end_time defaults to current server time
// but if you don't specify it, their range limits does not allow you to $query anything
'end_time' => $this->milliseconds (),
);
if ($since) {
$query['start_time'] = intval ($since / 1000); // defaults to 0
// end_time => timestamp in seconds defaults to server time
// in their docs they say that start_time defaults to 0, but, obviously it does not
$query['start_time'] = $since;
}
$response = $this->publicGetChartCandlesTradingPairId (array_merge ($query, $params));
$ohlcv = $response['result']['candles'];
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.980'
__version__ = '1.10.981'

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

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.980'
__version__ = '1.10.981'

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

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.980'
__version__ = '1.10.981'

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

Expand Down
17 changes: 11 additions & 6 deletions python/ccxt/async/cobinhood.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ def describe(self):
'fetchClosedOrders': True,
},
'timeframes': {
'1m': '1m',
'5m': '5m',
# the first two don't seem to work at all
# '1m': '1m',
# '5m': '5m',
'15m': '15m',
'30m': '30m',
'1h': '1h',
Expand Down Expand Up @@ -288,24 +289,28 @@ async def fetch_trades(self, symbol, since=None, limit=50, params={}):

def parse_ohlcv(self, ohlcv, market=None, timeframe='5m', since=None, limit=None):
return [
ohlcv['timestamp'] * 1000,
# they say that timestamps are Unix Timestamps in seconds, but in fact those are milliseconds
ohlcv['timestamp'],
float(ohlcv['open']),
float(ohlcv['high']),
float(ohlcv['low']),
float(ohlcv['close']),
float(ohlcv['volume']),
]

async def fetch_ohlcv(self, symbol, timeframe='5m', since=None, limit=None, params={}):
async def fetch_ohlcv(self, symbol, timeframe='15m', since=None, limit=None, params={}):
await self.load_markets()
market = self.market(symbol)
query = {
'trading_pair_id': market['id'],
'timeframe': self.timeframes[timeframe],
# they say in their docs that end_time defaults to current server time
# but if you don't specify it, their range limits does not allow you to query anything
'end_time': self.milliseconds(),
}
if since:
query['start_time'] = int(since / 1000) # defaults to 0
# end_time: timestamp in seconds defaults to server time
# in their docs they say that start_time defaults to 0, but, obviously it does not
query['start_time'] = since
response = await self.publicGetChartCandlesTradingPairId(self.extend(query, params))
ohlcv = response['result']['candles']
return self.parse_ohlcvs(ohlcv, market, timeframe, since, limit)
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.980'
__version__ = '1.10.981'

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

Expand Down
17 changes: 11 additions & 6 deletions python/ccxt/cobinhood.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ def describe(self):
'fetchClosedOrders': True,
},
'timeframes': {
'1m': '1m',
'5m': '5m',
# the first two don't seem to work at all
# '1m': '1m',
# '5m': '5m',
'15m': '15m',
'30m': '30m',
'1h': '1h',
Expand Down Expand Up @@ -288,24 +289,28 @@ def fetch_trades(self, symbol, since=None, limit=50, params={}):

def parse_ohlcv(self, ohlcv, market=None, timeframe='5m', since=None, limit=None):
return [
ohlcv['timestamp'] * 1000,
# they say that timestamps are Unix Timestamps in seconds, but in fact those are milliseconds
ohlcv['timestamp'],
float(ohlcv['open']),
float(ohlcv['high']),
float(ohlcv['low']),
float(ohlcv['close']),
float(ohlcv['volume']),
]

def fetch_ohlcv(self, symbol, timeframe='5m', since=None, limit=None, params={}):
def fetch_ohlcv(self, symbol, timeframe='15m', since=None, limit=None, params={}):
self.load_markets()
market = self.market(symbol)
query = {
'trading_pair_id': market['id'],
'timeframe': self.timeframes[timeframe],
# they say in their docs that end_time defaults to current server time
# but if you don't specify it, their range limits does not allow you to query anything
'end_time': self.milliseconds(),
}
if since:
query['start_time'] = int(since / 1000) # defaults to 0
# end_time: timestamp in seconds defaults to server time
# in their docs they say that start_time defaults to 0, but, obviously it does not
query['start_time'] = since
response = self.publicGetChartCandlesTradingPairId(self.extend(query, params))
ohlcv = response['result']['candles']
return self.parse_ohlcvs(ohlcv, market, timeframe, since, limit)
Expand Down

0 comments on commit 948a801

Please sign in to comment.