qstrader
qstrader copied to clipboard
python buy_and_hold_backtest.py does not run
I followed the instructions from: https://www.quantstart.com/qstrader or https://github.com/mhallsmoore/qstrader
python buy_and_hold_backtest.py emits:
Could not subscribe ticker SP500TR as no data CSV found for pricing.
Traceback (most recent call last):
File "buy_and_hold_backtest.py", line 81, in
@stjordanis The error is nasty, but I think it might be because you're not passing in the configuration file ? i.e. "--config=~qstrader.yml" -- or if that file exists and is being passed in by default (might be, can't remember), the SP500TR.csv file doesn't exist where the config file suggests ("~/data" from memory)
@ryankennedyio thanks that's it! i ran: python buy_and_hold_backtest.py --config=~qstrader.yml after I moved the input file in ~/data like you said Thanks for the quick reply.
Might be worth keeping this open @stjordanis because it should probably return a more helpful error than what you saw the first time :)
I got a similar error, but the command "python buy_and_hold_backtest.py --config=~qstrader.yml" didn´t work as expected:
_C:\Users\Eduardo\Anaconda3\pkgs\qstrader\data>dir Volume in drive C has no label. Volume Serial Number is C0C3-6C1A
Directory of C:\Users\Eduardo\Anaconda3\pkgs\qstrader\data
22-Jan-18 03:20 AM <DIR> . 22-Jan-18 03:20 AM <DIR> .. 22-Jan-18 03:07 AM 279.879 AAPL.csv 22-Jan-18 03:07 AM 178.152 AGG.csv 22-Jan-18 03:07 AM 519 AMZN.csv 22-Jan-18 03:07 AM 2.151 buy_and_hold_backtest.py 22-Jan-18 03:07 AM 519 GOOG.csv 22-Jan-18 03:07 AM 3.640 monthly_liquidate_rebalance_backtest.py 22-Jan-18 03:07 AM 3.758 moving_average_cross_backtest.py 22-Jan-18 03:07 AM 499 MSFT.csv 22-Jan-18 03:07 AM 295.971 SPY.csv 22-Jan-18 03:07 AM 2.470 test_examples.py 22-Jan-18 03:07 AM 0 init.py 11 File(s) 767.558 bytes 2 Dir(s) 818.988.580.864 bytes free
C:\Users\Eduardo\Anaconda3\pkgs\qstrader\data>python buy_and_hold_backtest.py --config=~qstrader.yml
Could not subscribe ticker SPY as no data CSV found for pricing.
Traceback (most recent call last):
File "buy_and_hold_backtest.py", line 70, in
Can anyone help plz?