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/

    Help with PPO

    General Code/Help
    2
    2
    118
    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.
    • A
      amit last edited by

      Hello,

      I am new to the backtrader community and need help with a specific indicator that I am trying to convert. Indicator is used for finding market tops and bottom based on the calculations.

      I am struggling to replicate those calculations in backtrader. Below is the specific function that I am not sure how to convert. As you can see in the function it used L0[1], I am not sure how to get this value. I was thinking of putting this value in an array but how would I reference it. or I should create an array the first time it will be zero and for the next candle it will have an value at index 1 and keep track of the candle number and use always candle-1. just thinking out loud

      lag(g, p) =>
      L0 = (1 - g)p+gnz(L0[1])
      L1 = -gL0+nz(L0[1])+gnz(L1[1])
      L2 = -gL1+nz(L1[1])+gnz(L2[1])
      L3 = -gL2+nz(L2[1])+gnz(L3[1])
      f = (L0 + 2L1 + 2L2 + L3)/6
      f

      Link to the Indicator
      https://www.tradingview.com/script/ngr0qRmw-CM-Laguerre-PPO-PercentileRank-Mkt-Tops-Bottoms/

      A 1 Reply Last reply Reply Quote 0
      • A
        ab_trader @amit last edited by

        @amit https://community.backtrader.com/post/15929

        and please keep one post for one issue.

        • If my answer helped, hit reputation up arrow at lower right corner of the post.
        • Python Debugging With Pdb
        • New to python and bt - check this out
        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors