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/

    access the last trading day OHLCV 1H time frame?

    Indicators/Strategies/Analyzers
    2
    3
    50
    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.
    • L
      luzzalgos last edited by

      Hello,
      Need your assistance as I have no idea how to solve the below issue (after reading documentation several times).

      Issue description:
      I am writing an indicator that is going to calculate some values/levels (unknown number of levels - depending on the last day price movement) based on the last day 1H time frame (OHLCV) and present those levels today 5M (or 15M) time frame.

      Data I deliver is: data0 - 1M OHLCV and additionally, I use “cerebro.resampledata” to resample date to 1H/5M/15M etc.

      The questions are:
      How can I access the last trading day OHLCV 1H time frame?
      How to deal with an unknown number of levels generated by indicator - how to create lines for them?

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

        @luzzalgos When you resample, you are accessing the last of higher timeframes in each minute bar. So in the current minute bar, you are getting the ohlc of the last hour, day, etc.

        To access the last hour of the last day, you will need to create a custom indicator that records that last hour's value at the end of the day, and then makes it available the next day for the entire day.

        1 Reply Last reply Reply Quote 1
        • L
          luzzalgos last edited by

          Thank you for your response @run-out
          Okay, maybe that’s the way…

          What if I will create an additional data feed OHLCV 1H time frame (I will be getting it from InfluxDB via influx_feed). Is there a way to get the last day data for calculation in 1H tf?

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