Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. jrothschild33
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    jrothschild33

    @jrothschild33

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    jrothschild33 Unfollow Follow

    Latest posts made by jrothschild33

    • How to process data by quarter?

      I want to resample or replay data by quarter, but find that bt.TimeFrame only support 'Days', 'Weeks', 'Months', 'Years',there is no 'Quarters' option.

      I know a simple way to process data quarterly is use compression, for example:

        tframes = dict( daily=bt.TimeFrame.Days,
                          weekly=bt.TimeFrame.Weeks,
                          monthly=bt.TimeFrame.Months)
      
        cerebro.replaydata(data,timeframe=tframes['monthly'],compression=3)
      
      

      You have to make sure the data is started on January,or the result will only compression by 3 continuous months, not by quarter.

      I hope someone could help me to solve this problem.

      posted in General Discussion
      jrothschild33
      jrothschild33