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/

    Passing GenericCSVData to Pandas Data Frame

    Indicators/Strategies/Analyzers
    1
    1
    31
    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.
    • S
      sat7134 last edited by

      Hi Everyone

      I have loaded my csv data to the "data" object as shown below

      data = btfeeds.GenericCSVData(
              dataname='E:\\Algorthmic Trading\\Data\\BIOCON\\BIOCON.day.csv',
              # fromdate=dt.datetime(2020, 7, 6),
              # todate=dt.datetime(2022, 7, 6),
              nullvalue=0.0,
              dtformat=('%Y-%m-%d %H:%M:%S+05:30'),
              datetime=0,
              open=1,
              high=2,
              low=3,
              close=4,
              volume=5,
              openinterest=-1)
      

      I am developing an indicator by following one of the articles and in that article for indicator development they are using Pandas Data Frame for all calculations. I am not sure how to convert this "data" object which is of type "GenericCSVData" to Pandas Data Frame

      I tried the below way, but it's not working

      df = pd.DataFrame(data)
      

      It's giving me below error

      ValueError: DataFrame constructor not properly called!
      
      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors