mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-03 13:26:01 +08:00
NYSE -> OPEN calendar for (most) default calendars
* Added extra bundle parameters for catalyst/poloniex bundles
This commit is contained in:
@@ -289,7 +289,7 @@ class TradingAlgorithm(object):
|
||||
# If a schedule has been provided, pop it. Otherwise, use NYSE.
|
||||
self.trading_calendar = kwargs.pop(
|
||||
'trading_calendar',
|
||||
get_calendar('NYSE')
|
||||
get_calendar('OPEN')
|
||||
)
|
||||
|
||||
self.sim_params = kwargs.pop('sim_params', None)
|
||||
|
||||
@@ -167,7 +167,7 @@ def poloniex_cryptoassets(symbols, start=None, end=None):
|
||||
# Hardcode the exchange to "POLONIEX" for all assets and (elsewhere)
|
||||
# register "YAHOO" to resolve to the OPEN calendar, because these are
|
||||
# all cryptoassets and thus use the OPEN calendar.
|
||||
metadata['exchange'] = "POLONIEX"
|
||||
metadata['exchange'] = 'POLO'
|
||||
asset_db_writer.write(equities=metadata)
|
||||
|
||||
return ingest
|
||||
@@ -185,6 +185,6 @@ register(
|
||||
pd.Timestamp('2010-01-01', tz='utc'),
|
||||
pd.Timestamp('2015-01-01', tz='utc'),
|
||||
),
|
||||
calendar_name='OPEN',
|
||||
minutes_per_day=1440,
|
||||
)
|
||||
|
||||
register_calendar_alias("POLONIEX", "OPEN")
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# limitations under the License.
|
||||
from catalyst.api import order, symbol
|
||||
|
||||
stocks = ['AAPL', 'MSFT']
|
||||
stocks = ['USDT_BTC']
|
||||
|
||||
|
||||
def initialize(context):
|
||||
|
||||
@@ -37,7 +37,7 @@ class CryptoPricingLoader(PipelineLoader):
|
||||
self.raw_price_loader = raw_price_loader
|
||||
self._columns = dataset.columns
|
||||
|
||||
cal = get_calendar('NYSE')
|
||||
cal = get_calendar('OPEN')
|
||||
|
||||
self._all_sessions = cal.all_sessions
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ def _run(handle_data,
|
||||
bundle_data.equity_minute_bar_reader.first_trading_day
|
||||
data = DataPortal(
|
||||
env.asset_finder,
|
||||
get_calendar('NYSE'),
|
||||
get_calendar('OPEN'),
|
||||
first_trading_day=first_trading_day,
|
||||
equity_minute_reader=bundle_data.equity_minute_bar_reader,
|
||||
equity_daily_reader=bundle_data.equity_daily_bar_reader,
|
||||
|
||||
Reference in New Issue
Block a user