btrun passing parameters to strategy



  • I am trying to execute a strategy using btrun. I would also like to pass parameters stoploss and profit to the strategy. Following command line code -

     btrun --csvformat btcsv  --data /home/dev/backTest/btDev/data/EOD/data1.csv --data /home/dev/backTest/btDev/data/EOD/data2.csv --data /home/dev/backTest/btDev/data/EOD/data3.csv --data /home/dev/backTest/btDev/data/EOD/data4.csv --strategy :/home/dev/backTest/btDev/data/tbadu99/strategy00113.py:stoploss=0.01,profit=0.1 --cash 100000 --commission 0.006 --fromdate 2016-01-01 --todate 2016-04-04 --analyzer :Returns --analyzer :DrawDown --analyzer :SharpeRatio --analyzer :Transactions --observer :Value --nostdstats --write csv=True > /home/dev/backTest/btDev/data/tbadu99/result.csv
    

    Passing two parameter to strategy00113 - stoploss and profit
    While execution it produces no results
    Error below -
    No class stoploss=0.01 profit=0.1 / module /home/dev/backTest/btDev/data/tbadu99/strategy00113.py


  • administrators

    See: Docs - Automating BackTesting

    The notation is:

    • module:strategy:kwargs

    You provide module and kwargs, but neither a strategy nor an empty separator to simply load the 1st one available in the module.


Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.