Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ccxt/ccxt
- Loading branch information
Showing
57 changed files
with
1,019 additions
and
286 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict' | ||
|
||
const ccxt = require ('../../ccxt') | ||
, log = require ('ololog') | ||
, asTable = require ('as-table') | ||
|
||
;(async function main () { | ||
|
||
let kraken = new ccxt.kraken ({ enableRateLimit: true }) | ||
await kraken.loadMarkets () | ||
|
||
const markets = Object.values (kraken.markets).map (market => ({ | ||
symbol: market.symbol, | ||
active: market.active, | ||
})) | ||
|
||
log.bright.green.noLocate ('Markets:') | ||
log.green.noLocate (asTable (markets), '\n') | ||
|
||
const currencies = Object.values (kraken.currencies).map (currency => ({ | ||
code: currency.code, | ||
active: currency.active, | ||
status: currency.status, | ||
})) | ||
|
||
log.bright.yellow.noLocate ('Currencies:') | ||
log.yellow.noLocate (asTable (currencies)) | ||
|
||
}) () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
import sys | ||
from pprint import pprint | ||
|
||
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||
sys.path.append(root + '/python') | ||
|
||
import ccxt # noqa: E402 | ||
|
||
exchange = ccxt.cryptopia({'enableRateLimit': True}) | ||
|
||
symbol = 'ETH/BTC' | ||
timeframe = '1h' | ||
|
||
candles = exchange.fetch_ohlcv(symbol, timeframe) | ||
|
||
# timeframe duration in seconds | ||
duration = exchange.parse_timeframe(timeframe) | ||
|
||
# timeframe duration in milliseconds | ||
duration *= 1000 | ||
|
||
pprint([[ | ||
exchange.iso8601(int(round(candle[0] / duration)) * duration), | ||
candle[1], # o | ||
candle[2], # h | ||
candle[3], # l | ||
candle[4], # c | ||
candle[5] # v | ||
] for candle in candles]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.