Dear Zipline Maintainers,
My zipline back testing script worked well 2 or 3 days ago.
But, last weekend, the script showed "JSONDecodeError".
You can see the detail error and source code in the attached text files.
I called the "TradingAlgorithm()" in the ipython console without or with parameters. It showed same error always.
In [4]: algo=TradingAlgorithm() or
In [5]: TradingAlgorithm() or
In [6]: algo = TradingAlgorithm(sim_params=create_simulation_parameters(capital_base=1000000000,trading_calendar=xkrx),initialize=initialize,handle_data=handle_data,trading_calendar=xkrx)
I think that this issue maybe related to the following issue.
https://github.com/quantopian/zipline/issues/2480
Although, I referenced the this issue, I am not using IEX as a data source. Attached "DataDownloader.txt" is the download script and using Yahoo.
Sincerely,
SeungYong
zipline-json-error.txt
zipline-MR.txt
DataDownloader.txt
Hello MarikoKujo ,
Thank you for your comment. I really appreciate for your help.
Unfortunately, it doesn't works. I should wait the fix for this and test
with different way.
Thanks again,
SeungYong
2019년 6월 18일 (화) 오전 5:20, MarikoKujo notifications@github.com님이 작성:
Hi SeungYong,
Came from #2480 https://github.com/quantopian/zipline/issues/2480. My
error message is the same as yours.
I think the issue is related to downloading process of benchmark data.
Whatever your custom data source is, as long as you are using default
benchmark data, this error occurs.
If you are using csvdir bundle or a custom data bundle, one workaround is
setting benckmark to your own asset in def initialize(context), by
calling set_benchmark(). For example,from zipline.api import set_benchmark, symbol
def initialize(context):
set_benchmark(symbol('AAPL'))It works for me on custom data bundle, minute frequency csv data, but the
drawback is that it slows down my backtests significantly. Still, I am
looking for a way to run backtests without benchmark.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/quantopian/zipline/issues/2481?email_source=notifications&email_token=AE4A7PQYFHPEEDHMAGA7MP3P27WXNA5CNFSM4HYTC3LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX4KRGA#issuecomment-502835352,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE4A7PQOMYUC5BNEP4CJUPDP27WXNANCNFSM4HYTC3LA
.
@SeungYong-Baek
Sorry for deleting my earlier reply, because I found that I mistook my cached benchmark file with a newly created one.
If you do not need benchmark in your backtests, you can try this hack.
I'm getting the same issue with python 3.5.6 and zipline 1.3.0. Any ideas? I'm using the quandl data bundle. -Thanks.
I'm getting same issue too, With Python 3.6.8
Now, When i run any command from zipline, It's got this error always.
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Same issue, trying to run zipline using jupyter notebooks
@rwuebker
@bozzlab
@jonathanmiller2
Some fix which is mentioned at the issue #2480 works for my script.
I used the IEXCLOUD API.
Thank you.
I'm getting the same issue with python 3.5.6 and zipline 1.3.0,How to reduce version installation?
Still getting this issue with Python 3.6.8 and zipline 1.3.0, so I downgraded zipline to 1.2.0, but still getting the same error with 1.2.0.
I have the same problem, tried Python 2.7 and 3.5
I have the same problem and I am using zipline 1.30 and python 2.7 (jupyter notebook).
@rwuebker
@bozzlab
@jonathanmiller2
Some fix which is mentioned at the issue #2480 works for my script.
I used the IEXCLOUD API.
Thank you.
this works!
Hey guys, I'm a bit late, but same issue with the code --
Here's my output:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Is there ever going to be an official response to this problem?
Seriously — I cannot get these fixes to work, can’t they just update the library? Kinda ridiculous. It’s been like this for 2 or 3 Python updates.
Get Outlook for iOShttps://aka.ms/o0ukef
From: Daraul Harris notifications@github.com
Sent: Monday, January 20, 2020 11:26:04 AM
To: quantopian/zipline zipline@noreply.github.com
Cc: Zach Mazz zach_oakes@outlook.com; Comment comment@noreply.github.com
Subject: Re: [quantopian/zipline] zipline 1.3.0 JSONDecodeError (#2481)
Is there ever going to be an official response to this problem?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fquantopian%2Fzipline%2Fissues%2F2481%3Femail_source%3Dnotifications%26email_token%3DALPUCIFO34FPR4HHUQC2DLDQ6XNCZA5CNFSM4HYTC3LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJNLD3Y%23issuecomment-576369135&data=02%7C01%7C%7C86c55f5aa2e84ee47f8208d79dcdd3e4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637151379650225219&sdata=MgauVvifGRvTz75Ve3k65cbmUg970woD6h7H7e%2B5FhA%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALPUCIBWN5Y7W7ZMETPLK3LQ6XNCZANCNFSM4HYTC3LA&data=02%7C01%7C%7C86c55f5aa2e84ee47f8208d79dcdd3e4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637151379650225219&sdata=mQ6pwMm9%2FtCMDA%2Bs%2FwOUfM%2F8Uz%2FGDqNuTLzfQIYGytw%3D&reserved=0.
FWIW the fixes suggested here worked for me: https://stackoverflow.com/a/58661288/3403924 (ignore step 3, though)
I tried many times and it is not working for me as well.
I'm getting same issue too, With Python 3.6.8
Now, When i run any command from zipline, It's got this error always.simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I am having the same issue.
+1, even the sample in readme.md on github or tutorial crashes with this!!!
zipline is useless
anyone still maintains this library???
The error is due benchmark.py needing to download benchmark SPY data from IEX, and the API for IEX has changed so that you now need to get a free API key and add this to the zipline benckmark.py file. You can also use pandas Yahoo data - see: https://stackoverflow.com/questions/56957791/getting-jsondecodeerror-expecting-value-line-1-column-1-char-0-with-python
The IEX token solution worked for me:
But this is only for 5 year data right? If you want, on my repository I have data from 1993 to 2020, you would have to manually implement the benchmark function, but it works. (In case you want longer time frames).
Hi all, I'm going to close this in favor of the consolidated issue for the benchmark downloading problems: https://github.com/quantopian/zipline/issues/2627.
https://github.com/quantopian/zipline/pull/2642 should help now, if you're using master, but it isn't released on PyPI yet.
Feel free to ping there or to reopen this if you think there's information in this issue that's not captured in the other one.
Most helpful comment
The error is due benchmark.py needing to download benchmark SPY data from IEX, and the API for IEX has changed so that you now need to get a free API key and add this to the zipline benckmark.py file. You can also use pandas Yahoo data - see: https://stackoverflow.com/questions/56957791/getting-jsondecodeerror-expecting-value-line-1-column-1-char-0-with-python
The IEX token solution worked for me:
anaconda3pkgszipline-1.3.0-np114py35_0Libsite-packagesziplinedata
IEX_API_KEY = "YOUR-IEX-TOKEN"
r = requests.get(
"https://cloud.iexapis.com/stable/stock/{}/chart/5y?chartCloseOnly=True&token={}".format(symbol, IEX_API_KEY)
)