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/

    slope and intercept inverted in OLS_Slope_InterceptN

    Indicators/Strategies/Analyzers
    3
    3
    128
    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.
    • André Tavares
      André Tavares last edited by

      The class OLS_Slope_InterceptN calculates slope and intercept. However I think it is on the wrong order. It is as follows:

      slope, intercept = sm.OLS(p0, p1).fit().params

      I think the correct is:

      intercept, slope = sm.OLS(p0, p1).fit().params

      I am right?

      1 Reply Last reply Reply Quote 1
      • Tom Feron
        Tom Feron last edited by

        Yes. I came here to report the same issue.

        1 Reply Last reply Reply Quote 1
        • run-out
          run-out last edited by

          Added as an issue in Backtrader2... https://github.com/backtrader2/backtrader/issues/28

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