from zipline.pipeline.data.equity_pricing import USEquityPricing
from zipline.pipeline.engine import SimplePipelineEngine
from zipline.pipeline import Pipeline
from zipline.pipeline.loaders import USEquityPricingLoader
from zipline.data.bundles.core import load
import os
import pandas as pd
from ALPHAS101 import Alpha101
if __name__ == '__main__':
bundle_data = load('quantopian-quandl', os.environ, None)
my_pipeline = Pipeline(
columns={
'MyFactor': Alpha101(),
}
)
pipeline_loader = USEquityPricingLoader(bundle_data.equity_daily_bar_reader, bundle_data.adjustment_reader)
def choose_loader(column):
if column in USEquityPricing.columns:
return pipeline_loader
raise ValueError("No PipelineLoader registered for column %s." % column)
cal = bundle_data.equity_daily_bar_reader.trading_calendar.all_sessions
cal2 = cal[(cal >= "2012-01-03") & (cal <= '2012-03-01')]
spe = SimplePipelineEngine(get_loader=choose_loader,
calendar=cal2,
asset_finder=bundle_data.asset_finder)
results = spe.run_pipeline(my_pipeline,
pd.to_datetime('2012-01-04', utc=True),
pd.to_datetime('2012-03-01', utc=True))
print results.head()
print "all done, boss!"
--
You received this message because you are subscribed to the Google Groups "Zipline Python Opensource Backtester" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
15 March 2018 at 22:29
Which parts are you missing? Out of the box zipline can run pipelines using the USEquityPricing dataset which pulls pricing data out of the bundle. The corporate fundamentals and other third party datasets are not in Zipline because you would need to own your own personal license to use them, however, you can add your own datasets to pipeline by using the blaze pipeline loader. If that is what you are looking to do I can explain that in more detail.
15 March 2018 at 22:26
Hi Pete,--A lot of the things that you do here like getting the cal, the bundle, we already know that when the algo is running. Should we extend the pipeline function so that it looks like in Quantopian? The question is actually, what do we have to develop to make it work like in Quantopian so we can make porting of algo's easier?Peter
On Tuesday, 13 March 2018 18:18:44 UTC+11, Philip Schrader wrote:
You received this message because you are subscribed to a topic in the Google Groups "Zipline Python Opensource Backtester" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zipline/kOazUWbki6U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zipline+u...@googlegroups.com.
cool, Havent played too much with it, just was wondering why there were so many steps to get the pipeline to work in the script of Peter.,..
15 March 2018 at 22:29Which parts are you missing? Out of the box zipline can run pipelines using the USEquityPricing dataset which pulls pricing data out of the bundle. The corporate fundamentals and other third party datasets are not in Zipline because you would need to own your own personal license to use them, however, you can add your own datasets to pipeline by using the blaze pipeline loader. If that is what you are looking to do I can explain that in more detail.15 March 2018 at 22:26
Hi Pete,--A lot of the things that you do here like getting the cal, the bundle, we already know that when the algo is running. Should we extend the pipeline function so that it looks like in Quantopian? The question is actually, what do we have to develop to make it work like in Quantopian so we can make porting of algo's easier?Peter
On Tuesday, 13 March 2018 18:18:44 UTC+11, Philip Schrader wrote:
You received this message because you are subscribed to a topic in the Google Groups "Zipline Python Opensource Backtester" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zipline/kOazUWbki6U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zipline+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+u...@googlegroups.com.