Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Calendar Problem - GenericCSVData

    General Discussion
    2
    2
    463
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      Raptor last edited by

      Hi,
      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.

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        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.

        @raptor said in Calendar Problem - GenericCSVData:

        the system is still buying on holidays and at night.

        That means you are actually putting data in the system for such occasions.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors