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

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/,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/

  • 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