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/

    Resampled data candles looks very tiny

    General Code/Help
    2
    6
    631
    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.
    • N
      niceboss last edited by

      Hello,

      I have 2 data feeds daily & weekly, and want only weekly to be shown on plotting.

      I have this code to do this:

          d0 = cerebro.resampledata(data,
                               timeframe=bt.TimeFrame.Days,
                               compression=1)
          d0.plotinfo.plot = False
      
          d1 = cerebro.resampledata(data,
                                    timeframe=bt.TimeFrame.Weeks
          )
      

      but the problem is that date time axis still consist of days, and as result candles are very tiny.
      0_1536443728432_a3b4d644-080c-4209-859e-fcf30e177711-image.png

      ATR / CMO / EMA(ATR) - using weekly data feeds. so they should scale to weeks too.

      Could you say please how to fix it?

      B 1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators @niceboss last edited by

        @niceboss said in Resampled data candles looks very tiny:

        but the problem is that date time axis still consist of days

        Because the system has to tick at the rhythm of the lowest timeframe, i.e.: Days

        @niceboss said in Resampled data candles looks very tiny:

        ATR / CMO / EMA(ATR) - using weekly data feeds. so they should scale to weeks too.

        The data points are only calculated on the weekly feed, but they are scattered over a smaller timeframe on the plot.

        1 Reply Last reply Reply Quote 0
        • N
          niceboss last edited by

          So there is no way to resample timeframe to Weekly? because if i'll add Minute timeframe, it will even more tiny, but we only need this data to stop loss, for all other strategy decisions only weekly data feed used.

          What is your suggestion in this situation?

          B 1 Reply Last reply Reply Quote 0
          • B
            backtrader administrators @niceboss last edited by

            @niceboss said in Resampled data candles looks very tiny:

            So there is no way to resample timeframe to Weekly?

            You are already resampling.

            @niceboss said in Resampled data candles looks very tiny:

            ecause if i'll add Minute timeframe, it will even more tiny

            That has to do with plotting and not with resampling. Plotting is only meant as a visual aid.

            @niceboss said in Resampled data candles looks very tiny:

            What is your suggestion in this situation?

            What is your expectation?

            1 Reply Last reply Reply Quote 0
            • N
              niceboss last edited by

              If I use only Weekly data feed, I have this plot - with wide bars.

              0_1536495928050_c5a540c1-c687-480a-a11e-f7c552515b7f-image.png

              I want to use multi timeframed data feeds in the same strategy, but on the plot to show show them as wide Weekly candles, the same as on image above.

              1 Reply Last reply Reply Quote 0
              • B
                backtrader administrators last edited by

                Cannot be done with the plotting engine if you use lower timeframes.

                Again: the system runs at the frequency of the lower timeframe (for example the broker, in case you issued orders for the daily data feed), which implies that the resulting number of data points the entire system has, is the number of data points of the daily feed.

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