fja05680 / pinkfish

A backtester and spreadsheet library for security analysis.
https://fja05680.github.io/pinkfish
MIT License
264 stars 60 forks source link

Not able to specify the leaf data dir for benchmark #45

Closed fja05680 closed 2 years ago

fja05680 commented 2 years ago

benchmark always tries to use the data cache. It only downloads from yahoo finance if it can't find the timeseries for a symbol in the data cache. This part is correct, as it shouldn't be allowed to fetch a newer timeseries than the one used in the backtest. You have identified a valid issue though, the benchmark doesn't use the data cache that's specified in fetch_timeseries() for the non-benchmark backtest. They should use the same data cache.

fja05680 commented 2 years ago

A new parameter was added to Benchmark class that allows you to specify the leaf data dir, namely dir_name. You would normally set this to the same value as fetch_timeseries() that you are using for your symbols.