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

btrun - How to pass GenericCSVData parameters?



  • I am trying to replicate the behaviour of a full script via the command line with btrun and have the following command:

    btrun --csvformat btcsv \
          --data data/gbpusd-1m.csv \
          --strategy strategies/TemplateStrategy.py \
          --fromdate 2003-1-1 \
          --todate 2003-1-5 \
          --timeframe minutes \
          --commission 0 \
          --cash 10000 \
          --compression 1
    

    How would I pass parameters to GenericCSVData such as open, high, low, close, openinterest as below?

        data = bt.feeds.GenericCSVData(
            timeframe=bt.TimeFrame.Minutes,
            compression=1,
            dataname=datafile,
            fromdate=datetime.datetime(2003, 1, 1),
            todate=datetime.datetime(2003, 1, 5),
            dtformat=('%Y-%m-%d %H:%M:%S'),
            datetime=0,
            high=2,
            low=3,
            open=1,
            close=4,
            volume=5,
            openinterest=-1)
    

    Thanks


Log in to reply
 

});