Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Vivan Maitreya
    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
    • Groups 0

    Vivan Maitreya

    @Vivan Maitreya

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

    Vivan Maitreya Unfollow Follow

    Latest posts made by Vivan Maitreya

    • Calculating average beforehand

      I am trying to implement a Pairs trading strategy wherein i calculate the ratio of stock prices, find their zscore and use that zscore to create an upper and lower bound for it. I wanted to know if there was a way to calculate the average of all zscores in the init function. I tried using the Average class of Indicators, but it calculates the average at every bar, whereas i want a way to have precalculated average. Is there any way to do it using backtrader rather than doing it manually? Thanks for the help!

      posted in General Code/Help
      Vivan Maitreya
      Vivan Maitreya