--
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.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--BR,
Ed
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+unsubscribe@googlegroups.com.
$ zipline bundles
quandl <no ingestions>
quantopian-quandl <no ingestions>
$
This should make zipline to create .zipline directory in your home directory /Users/<your username> with empty extension.py in it. You can list directory content using 'ls' command:
$ ls -la ~/.zipline
total 0
drwxr-xr-x 3 ed staff 102B Oct 16 11:57 ./
drwx------ 53 ed staff 1.8K Oct 16 11:57 ../
-rw-r--r-- 1 ed staff 0B Oct 16 11:57 extension.py
$
Now you can prepare your ~/.zipline/extension.py to use yahoo bundle. Open it with nano text editor:
$ nano ~/.zipline/extension.py
and add this content:
from zipline.data.bundles import register, yahoo_equities # these are the tickers you would like data for equities = { 'AAPL', 'MSFT', 'GOOG', } register( 'my-yahoo-equities-bundle', # name this whatever you like yahoo_equities(equities), )
as suggested here: http://www.zipline.io/bundles.html#yahoo-bundle-factories.
You can replace equities list with S&P 500 equities later. At this point I'd suggest to stick with 3 suggested tickers to make sure zipline can ingest them.
Now you should be ready to run zipline ingest for your bundle:
$ zipline ingest -b my-yahoo-equities-bundle
Merging daily equity files: [-------------#----------------------] 2#] 100%
Merging daily equity files: [####################################]
Downloading Yahoo adjustment data: [####################################] 100%
$
If all goes well you should be able to see your bundle in 'zipline bundles' output:
$ zipline bundles
my-yahoo-equities-bundle 2016-10-16 09:16:25.095616
quandl <no ingestions>
quantopian-quandl <no ingestions>
And the last step is to run test algo with your bundle. If you're lucky you'll see something like that:
$ zipline run --algofile ./zipline/examples/buyapple.py --start 2000-01-01 --end 2016-01-01 --bundle my-yahoo-equities-bundle
[2016-10-16 09:24:49.095224] INFO: Loader: Cache at /Users/ebartosh/.zipline/data/^GSPC_benchmark.csv does not have data from 1990-01-02 00:00:00+00:00 to 2016-10-12 00:00:00+00:00.
Downloading benchmark data for '^GSPC'.
[2016-10-16 09:24:54.471509] INFO: Performance: after split: sid: Equity(1 [AAPL]), amount: 2340.0, cost_basis: 55.65, last_sale_price: 101.25
[2016-10-16 09:24:54.471665] INFO: Performance: returning cash: 0.0
[2016-10-16 09:24:57.333482] INFO: Performance: after split: sid: Equity(1 [AAPL]), amount: 28220.0, cost_basis: 15.77, last_sale_price: 88.99
[2016-10-16 09:24:57.333620] INFO: Performance: returning cash: 0.0
[2016-10-16 09:25:03.676233] INFO: Performance: after split: sid: Equity(1 [AAPL]), amount: 361060.0, cost_basis: 18.23, last_sale_price: 645.57
[2016-10-16 09:25:03.676354] INFO: Performance: returning cash: 0.0
[2016-10-16 09:25:04.865082] INFO: Performance: Simulated 4025 trading days out of 4025.
[2016-10-16 09:25:04.865228] INFO: Performance: first open: 2000-01-03 14:31:00+00:00
[2016-10-16 09:25:04.865365] INFO: Performance: last close: 2015-12-31 21:00:00+00:00
...
Good luck with exploring power of command line tools :) !
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.
Error: Got unexpected extra arguments (b- my-yahoo-equities-bundle)
PierreAsMacBook:~ Pierre$ zipline ingest b- my-yahoo-equities-bundle
/Users/Pierre/anaconda/lib/python2.7/site-packages/zipline/__main__.py:50: UserWarning: Failed to load extension: '/Users/Pierre/.zipline/extension.py'
cannot import name yahoo_equities
os.environ,
Usage: zipline ingest [OPTIONS]
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.