MiniXC / simple-back

A simple daily python backtester that works out of the box.
Mozilla Public License 2.0
59 stars 12 forks source link

do not force pandas_market_calendars #20

Open R-K-H opened 4 years ago

R-K-H commented 4 years ago

Hello,

I was trying to setup the backtester with crypto and due to this line it's expecting an mcal name, which is not what I would expect if the .calendar() is optional.

https://github.com/MiniXC/simple-back/blob/master/simple_back/backtester.py#L812

Perhaps a check against this optional so that it doesn't try or if the feature is required, it is expanded to allow for additional calendars?

This also could be due to my lack of knowledge with pandas and calendars, however as an optional (https://minixc.github.io/simple-back/api/simple_back.html#simple_back.backtester.BacktesterBuilder.calendar) parameter, I wouldn't expect it to fail if I didn't provide one.

Thank you for this. I was going to prepare an example and submit a pull request for extending this to work with crypto data if you are interested in including such an example.

MiniXC commented 4 years ago

.calendar is optional in that it defaults to 'NYSE' when not called. I will add a None option for not "filtering" any dates in 0.6.1, which I'll release today.

A crypto example would be amazing - it makes me wish I had added an option for intraday data (maybe for 1.0, but would be a big undertaking).