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/

    Generic PandasDirectData (and others) ?

    General Code/Help
    2
    3
    1128
    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.
    • K
      kfeeeeee last edited by

      Hi,
      I see that you have enabled the possibility to add custom data lines using GenericCSVData (see the blog post) - however, I think it would be beneficial to enable custom data lines for other feeds as well (e.g., PandasDirectData etc.).

      I tried to naivly adopt the code of GenericCSVData for PandasDirectDate, i.e.:

      class GenericPandas(bt.feeds.PandasDirectData):
      
      
          lines = ('feature',)
          params = (('feature', 3),)
      

      and then

      data = GenericPandas(dataname=df,...)
      

      But this does not seem to work. The question is whether I am doing something wrong or if it is currently just not possible.

      Any help is very much appreciated. Thank you.

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

        @kfeeeeee said in Generic PandasDirectData (and others) ?:

        I see that you have enabled the possibility to add custom data lines using GenericCSVData (see the blog post)

        That's not right. Defining line hierarchies is the basis of platform. Each indicator defines its own set of lines.

        The linked blog post doesn't even mention the topic. It simply describes how to use the GenericCSVData feed.

        Pandas based data feeds can also be extended. See here Community - Pandas DataFeed Example

        1 Reply Last reply Reply Quote 1
        • K
          kfeeeeee last edited by

          Thanks for the clarification. I had a few misleading conceptual ideas about backtrader but the reference cleared things up.

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