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/

    Adding money flow field to data series / resampling

    General Code/Help
    2
    2
    448
    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 Alexan

      I have tick data and would like to include the money flow information I can gather in resampled data, e.g. +/- for buy/sell side ticks and accumulate to a money flow total for the resample period.

      In order to do this I have done something very ugly and modified dataseries.py to += instead of = the openinterest in the bupdate method. This works but is not sustainable, and I may want to do similar things in the future.

      Is there a better way to get this behavior? I'm not clear on the implications of adding a new field.

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

        You can either add a filter Docs - Filters and manipulate the field in the way you want (record previous values and add them)

        You can create an Indicator and keep the money flow in it - Docs - Indicator Development

        Or you can extend any data feed with new fields with no implications: Docs - Extending a data feed

        Any of the 3 approaches is generic.

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