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/

    Maximum (MaxN/Highest) based on time interval (i.e. n days ago) rather than periods (bars)

    Indicators/Strategies/Analyzers
    2
    2
    169
    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.
    • S
      solk last edited by

      Is there a way to find the maximum value of a line based on a time period (i.e. a week / 7 calendar days) rather than a period (i.e. 5 periods/trading days)?

      I have a daily trading days, and I would like to get the maximum in the last 7 calendar days and not the last 5 trading days. So the period will sometimes be less than 5 when there are holidays.

      Is there a way to do this after pre-loading the OHLC data?

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

        You could import the csv into a dataframe, use pandas to find the max over 7 calendar days, and then add in the dataframe into cerebro with an additional line showing the max figure for each day.

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