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
-
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
-
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.
-
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'
-
Please share some lines of your input csv file..