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/

    Fundamental Data

    Indicators/Strategies/Analyzers
    3
    4
    1517
    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.
    • C
      chaT123 last edited by

      I have fundamental data (say stock P/E time series) saved as a dataframe. How should I input and use it in backtrader? I load the dataframe using bt.feeds.PandasData and put "close" = "PE?

      1 Reply Last reply Reply Quote 0
      • A
        ab_trader last edited by

        It is not clear what format are you going to use for your fundamental data. But check the following link - P/E was added -

        Docs - Extending a Datafeed

        • If my answer helped, hit reputation up arrow at lower right corner of the post.
        • Python Debugging With Pdb
        • New to python and bt - check this out
        1 Reply Last reply Reply Quote 2
        • C
          chaT123 last edited by

          Thank you. The fundamental data is in pandas dataframe format.
          Yes, adding a line and use it through method data.pe is what I need.
          What if I already have dataframe as hand, instead of a CSV file?

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

            Extend the PandasData feed instead.

            See here for example: https://community.backtrader.com/topic/158/how-to-feed-backtrader-alternative-data/5

            1 Reply Last reply Reply Quote 1
            • 1 / 1
            • First post
              Last post
            Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors