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/

    Saving and reusing resampled data

    General Code/Help
    3
    3
    682
    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
      Alexan last edited by

      I have written a custom data feed which resamples large amounts of tick data. That is of course quite slow. When tick data is not necessary I would like to start with less granular data.

      I know that I can add a writer to the resampler, however the output is not immediately useable as a data source. Is there some simple way to resample and output a usable data file?

      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @Alexan last edited by

        @alexan CSV writer to CSV reader?

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

          The Writer produces reusable output.

          In any case you can write each set of OHLC prices to a file during next

          print('','.join((self.data.datetime.datetime(0).isoformat(), str(self.data.close[0], ...))), file=myfile)
          
          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors