Hi Chris,
I tried to follow the Steps but was not able to figure out how to use the uploaded custom data. I can see the data was uploaded in Research:
from quantopian.pipeline import Pipeline
from quantopian.research import run_pipeline
from quantopian.pipeline.data.user_5915411cde5cfc72f641f655 import cboe_vix
pipe = Pipeline(
columns={
'my_dataset': cboe_vix.vix_open.latest
},
screen=cboe_vix.vix_open.latest.notnull()
)
df = run_pipeline(pipe, '2004-01-02', '2020-07-17')
df.head()
But not sure how to get it work on IDE.
I used to get VIX from quandl as follows:
class GetVIX(CustomFactor):
window_length = 1
def compute(self, today, assets, out, slice):
out[:] = slice
def initialize(context):
# only using the pipe for VIX currently
context.spy = sid(8554)
The_Pipe = Pipeline()
attach_pipeline(The_Pipe, 'The_Pipeline')
#get VIX at market open
The_Pipe.add(GetVIX(inputs=[cboe_vix.vix_open]), 'VixOpen')
schedule_function(Rebalance,date_rules.every_day(),time_rules.market_open(minutes=1))
def before_trading_start(context, data):
# The Pipeline Output
The_Output = pipeline_output('The_Pipeline')
context.VIXprice = The_Output["VixOpen"].iloc[0] # VIX at market open
Any way to re-purpose this code to work with the custom data by just replacing the import statement:
from quantopian.pipeline.data.user_5915411cde5cfc72f641f655 import cboe_vix
Please advise.
Thank you!
Hieu