-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set_benchmark() does not work #2072
Comments
Hi @jasonchk this is due to some changes that Google had made to their API, so we removed that code in #2031. If you install the latest zipline master branch from GitHub, you should be able to run a backtest up to 5 years ago from the current day. Installing from GitHub:
Running a Backtest:
|
Hi @freddiev4 thanks for the quick reply. I created a new Condo environment and installed the latest zipline master branch by downloading the zip file and running
I have read somewhere that bottleneck is optional and that zipline can function without it. After removing 'bottleneck' (
|
Hmm.. so it looks like there's a mismatch for the version numpy that you have and the and the version zipline is compiled against. Two other options here in the meantime:
|
I created a new conda environment (via Anaconda Navigator) and tried
|
Closing this as you should be able to do this in the latest release of zipline. You can see the release notes here Feel free to update to 1.2.0 with either:
or
If there are any problems, please open a new issue 🙂 |
Dear Zipline Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment
Now that you know a little about me, let me tell you about the issue I am
having:
Description of Issue
I am receiving the following error, which appears to be caused by an issue with Google's finance data URL when trying to retrieve the default benchmark (SPY) when running the algorithm.
I have previously managed to update the URL in the appropriate file in pandas-datareader to resolve the issue but I wanted to try and use the set_benchmark function to work around this error.
What did you expect to happen?
Set_benchmark to apply a different asset for benchmarking purpose.
What happened instead?
The following error occurred:
RemoteDataError: Unable to read URL: http://www.google.com/finance/historical?startdate=Dec+31%2C+1989&q=SPY&enddate=Dec+31%2C+2017&output=csv
It indicated that it's still trying to query data for a default asset (SPY) instead of the assigned asset in set_benchmark(symbol('AAPL')).
Here is how you can reproduce this issue on your machine:
Reproduction Steps
`%%zipline --start 2010-1-1 --end 2011-1-1
from zipline.api import order, record, symbol, set_benchmark
def initialize(context):
set_benchmark(symbol('AAPL'))
def handle_data(context, data):
order(symbol('AAPL'), 10)
record(AAPL=data.current(symbol('AAPL'), 'price'))`
...
What steps have you taken to resolve this already?
I have tried to run the algorithm using the CLI but the same error message appears.
...
Anything else?
...
Sincerely,
Jason
The text was updated successfully, but these errors were encountered: