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/

    Using ParabolicSAR inside strategy

    Indicators/Strategies/Analyzers
    1
    2
    81
    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.
    • switchfire
      switchfire last edited by

      Good morning,
      I'm having difficulty implementing the ParabolicSAR in my strategy. I believe I've done the params and initialization correctly (not for sure, though), but I'm not sure how to add the conditions in. Am I supposed to build the calculations and use a variable for the condition? Or is that done inside backtrader? I want to include a psar condition inside the buy/sell conditions.

      Params:

      ('period', 2), # psar period ('start' in pine)
      ('af', 0.005), #psar af ('increment' in pine)
      ('afmax', 1), #psar afmax ('maximum' in pine)
      

      init:

      self.psar = bt.indicators.ParabolicSAR(
                  period = self.p.period,# Period
                  plot = False,
                  af = self.p.af,
                  afmax = self.p.afmax,
                  )
      

      I am new, thank you for your patience.

      1 Reply Last reply Reply Quote 0
      • switchfire
        switchfire last edited by

        I have searched google and backtrader references with no luck. I may just need a point in the right direction.

        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(); }); }