For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

documents error in https://www.backtrader.com/docu/datafeed/



  • btfeed is not btfeeds or btfreeds,maybe. just give other reader a softer experience.

    The code:
    
    
    import datetime
    import backtrader as bt
    import backtrader.feeds as btfeed
    
    ...
    ...
    
    data = btfeeds.GenericCSVData(
        dataname='mydata.csv',
    
        fromdate=datetime.datetime(2000, 1, 1),
        todate=datetime.datetime(2000, 12, 31),
    
        nullvalue=0.0,
    
        dtformat=('%Y-%m-%d'),
        tmformat=('%H.%M.%S'),
    
        datetime=0,
        time=1,
        high=2,
        low=3,
        open=4,
        close=5,
        volume=6,
        openinterest=-1
    )
    This can also be made permanent with subclassing:
    
    
    import datetime
    import backtrader.feeds as btfeed
    
    class MyHLOC(btfreeds.GenericCSVData):
    
      params = (
        ('fromdate', datetime.datetime(2000, 1, 1)),
        ('todate', datetime.datetime(2000, 12, 31)),
        ('nullvalue', 0.0),
        ('dtformat', ('%Y-%m-%d')),
        ('tmformat', ('%H.%M.%S')),
    
        ('datetime', 0),
        ('time', 1),
        ('high', 2),
        ('low', 3),
        ('open', 4),
        ('close', 5),
        ('volume', 6),
        ('openinterest', -1)
    )
    

Log in to reply
 

});