Navigation

    Backtrader Community

    • Register
    • 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/

    Indicator Period Days or Trading Days?

    General Code/Help
    3
    4
    1082
    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.
    • C
      cwse last edited by

      Hi,

      Just wanted to clarify a basic one - when you set the period in an indicator (i.e. SMA), is this period equal to trading days (i.e. count of dates in the data feed)... OR... calendar days?

      Eg. bt.indicators.SimpleMovingAverage(d, period=30) for a theoretical ending date of 14 June 2017, will the window start on 15 May 2017, or several days earlier (if using trading days).

      Thank you!

      1 Reply Last reply Reply Quote 0
      • Curtis Miller
        Curtis Miller last edited by

        My understanding is most of the time parameters like period apply to data points, so that would imply trading days, or points in your data feed (in short, the first thing in your question). backtrader is not aware of time frames, just data points.

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

          So it is, or else working in different timeframes wouldn't be feasible. Furthermore it would seem pointless to define a period of 30 and get a different number of items in the calculation.

          This is, on the other hand, nothing specific to this library.

          1 Reply Last reply Reply Quote 0
          • C
            cwse last edited by

            Cool thanks guys

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
            $(document).ready(function () { app.coldLoad(); }); }