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/

    Timezone issue

    General Code/Help
    2
    4
    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.
    • R
      Rajesh last edited by

      i downloaded data from Zerodha API, it has timezone info along with day and time. When i feeding this information to GenericCSVData, i am facing issue like

      ValueError: unconverted data remains: +05:30

      can any one tell me how solve this issue

      R 1 Reply Last reply Reply Quote 0
      • R
        rajanprabu @Rajesh last edited by

        @rajesh

        It's hard to say without seeing the input data. My guess is that you can try pandas data feed with specific date format for your data.

        R 1 Reply Last reply Reply Quote 0
        • R
          Rajesh @rajanprabu last edited by

          @rajanprabu

          from_date = "01-10-2020"
          to_date = "05-01-2021"
          
          # 
          ohlc_TCS = fetchOHLCExtended("TCS",from_date, to_date, '5minute')
          
          cerebro = bt.Cerebro()
          cerebro.broker.set_cash(100000)
          cerebro.broker.setcommission(commission=0.001)
          
          data = bt.feeds.PandasData(dataname=ohlc_TCS,timeframe = 1)
          cerebro.adddata(data)
          cerebro.addstrategy(macdStrategy)
          
          
          print('Starting Portfolio Value : %0.2f' % cerebro.broker.getvalue())
          cerebro.run()
          cerebro.plot()
          
          print('Final Portfolio Value : %0.2f' % cerebro.broker.getvalue())
          

          i tried by using pandas dataframe, i am getting below error, i don't know how to solve this.

          AttributeError: 'Lines_LineSeries_DataSeries_OHLC_OHLCDateTime_Abst' object has no attribute 'datatime'
          
          R 1 Reply Last reply Reply Quote 0
          • R
            rajanprabu @Rajesh last edited by

            @rajesh

            Please share some lines of your input csv file..

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