) def _format_wiki_url(self, api_key, symbol, start_date, end_date, data_frequency): """ Build a query URL for a quandl WIKI dataset. """ query_params = [ ('start_date', start_date.strftime('%Y-%m-%d')), ('end_date', end_date.strftime('%Y-%m-%d')), ('order', 'asc'), ] if api_key is not None: query_params = [('api_key', api_key)] + query_params return ( "https://www.quandl.com/api/v3/datasets/WIKI/" "{symbol}.csv?{query}".format( symbol=symbol, query=urlencode(query_params), ) ) register_calendar_alias('QUANDL', 'NYSE') register_bundle(QuandlBundle)
query_params = [ ('command', 'returnChartData'), ('currencyPair', symbol), ('start', start_date.value / 10**9), ('end', end_date.value / 10**9), ('period', period), ] return self._format_polo_query(query_params) def _format_polo_query(self, query_params): return 'https://poloniex.com/public?{query}'.format( query=urlencode(query_params), ) ''' As a second parameter, you can pass an array of currency pairs that will be processed as an asset_filter to only process that subset of assets in the bundle, such as: register_bundle(PoloniexBundle, ['USDT_BTC',]) For a production environment make sure to use (to bundle all pairs): register_bundle(PoloniexBundle) ''' if 'ingest' in sys.argv and '-c' in sys.argv: register_bundle(PoloniexBundle) else: register_bundle(PoloniexBundle, create_writers=False)
try: period = period_map[data_frequency] except KeyError: return None query_params = [ ('command', 'returnChartData'), ('currencyPair', symbol), ('start', start_date.value / 10**9), ('end', end_date.value / 10**9), ('period', period), ] return self._format_polo_query(query_params) def _format_polo_query(self, query_params): return 'https://poloniex.com/public?{query}'.format( query=urlencode(query_params), ) ''' As a second parameter, you can pass an array of currency pairs that will be processed as an asset_filter to only process that subset of assets in the bundle, such as: register_bundle(PoloniexBundle, ['USDT_BTC',]) For a production environment make sure to use (to bundle all pairs): register_bundle(PoloniexBundle) ''' register_bundle(PoloniexBundle)
query_params = [ ('command', 'returnChartData'), ('currencyPair', symbol), ('start', start_date.value / 10**9), ('end', end_date.value / 10**9), ('period', period), ] return self._format_polo_query(query_params) def _format_polo_query(self, query_params): # TODO: got against the exchange object return 'https://poloniex.com/public?{query}'.format( query=urlencode(query_params), ) ''' As a second parameter, you can pass an array of currency pairs that will be processed as an asset_filter to only process that subset of assets in the bundle, such as: register_bundle(PoloniexBundle, ['USDT_BTC',]) For a production environment make sure to use (to bundle all pairs): register_bundle(PoloniexBundle) ''' if 'ingest' in sys.argv and '-c' in sys.argv: register_bundle(PoloniexBundle) else: register_bundle(PoloniexBundle, create_writers=False)
from catalyst.data.bundles.core import register_bundle from kryptobot.catalyst_extensions.bundles.binance import BinanceBundle register_bundle(BinanceBundle)