Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    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 passing parameters to strategy

    General Code/Help
    2
    2
    919
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      Tausif last edited by

      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

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
        $(document).ready(function () { app.coldLoad(); }); }