2019-10-02: The community is currently in read-only mode
Calendar Problem - GenericCSVData
Raptor last edited by
I used GenericCSVData to add my own data with the following dtformat: ('%d.%m.%Y %H:%M').
Even if I add params=(('calendar', NYSE_2014), ...) [within GenericCSVData] and cerebro.addcalendar(NYSE_2014) the system is still buying on holidays and at night.
In https://www.backtrader.com/docu/dataautoref.html I read that for GenericCSVData is no default calendar set. But I should be able to set one through params or cerebro, right? If it's possible then I got some bug in my code.
I think you are expecting too much from a calendar. The calendar does only provide information about when the market is open, which for allows synchronization of multi-timeframe feeds (because suddenly the system knows that the asset doesn't trade on Saturdays and the resampler doesn't have to wait until Monday) The calendar is not omnipotent and won't filter the data for you.
the system is still buying on holidays and at night.
That means you are actually putting data in the system for such occasions.