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/

    Multi Example

    Indicators/Strategies/Analyzers
    2
    5
    541
    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.
    • A
      augustus last edited by

      Hi
      Can I ask someone to explain following script code snippet:

      class St(bt.Strategy):
      params = dict(
      enter=[1, 3, 4], # data ids are 1 based
      hold=[7, 10, 15], # data ids are 1 based
      it is cut from :
      backtrader.com/blog/posts/2017-04-09-multi-example/multi-example.html

      why such default values and not others?

      Thank You in advance for some comments especially from administrators.

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

        @augustus said in Multi Example:

        why such default values and not others?

        Why not? It is just an example.

        Can I ask why ...

        For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
        
        1 Reply Last reply Reply Quote 0
        • A
          augustus last edited by

          I thought that the values obtained from the some simulations were behind these values.

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

            It's just an example. It's not some secret sauce.

            1 Reply Last reply Reply Quote 0
            • A
              augustus last edited by augustus

              I apologize if what I am going to ask now seems plain but I am trying to familiarize myself with the sketch of creation of the backtest strategy, but this line of code is not obvious to me and I would like someone to clarify it for me :
              **eval('dict(' + args.strat + ')'))
              from what I know, this is a function eval () whose parameter is the sequence runs python code
              but this record absolutely puzzled me because it seems to me that it is from packing of
              a dictionary items .- **

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors