Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. niklay
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    N
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 3
    • Best 1
    • Groups 0

    niklay

    @niklay

    1
    Reputation
    291
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    niklay Unfollow Follow

    Best posts made by niklay

    • Cannot find file "orcl-1995-2014.txt" from the Quickstart tutorial

      Hi,
      I started using Backtrader with doing the Quickstart tutorial. At the beginning two variables modpath and datapath are declared with datapath searching for the file "orcl-1995-2014.txt". Unfortunately, my mac cannot find this file (I also searched for it using the terminal, but the file seems to be nonexistent). Is there anything wrong with the tutorial or did I miss something here?

      I'm using Python 3.6.1 with PyCharm and installed Backtrader via pip install backtrader

      Thanks for helping!

      posted in General Code/Help
      N
      niklay

    Latest posts made by niklay

    • Usage of multiple Datafeeds

      Hi,
      I built a simple strategy for learning purposes. The algorithm buys if the PE is lower than 5 and sells if its higher than 10 (please don't argue about the usefulness of this strategy since it's only for learning).

      My pricing data is stored in several Pandas Dataframe with each Dataframe representing one company. However, I don't want to apply my strategy to only one company, but all available ones. Additionally, I only want to apply the strategy to the five companies at once (guess I need to filter them daily before applying the strategy).

      So my questions:

      1. How can I bundle several DataFrames and add them to Cerebro at once?

      2. How can I filter out the companies with the best results every day (in zipline it worked with Pipelines)

      Thanks.

      posted in General Code/Help
      N
      niklay
    • How to access the "params" tuple?

      Hi there,
      I started with the Quickstart tutorials and found some confusing code (see attached). The "params" tuple is created with two separate tuples inside. However, I can access these inside tuples by typing params.maperiod . However, if I rename params to another name I cannot access them anymore.

       class TestStrategy():
        params = (
            ('maperiod', 15),
            ('printlog', False),
        )
      
      def log(self, txt, dt=None, doprint=False):
          if self.params.printlog or doprint:
              dt = dt or self.datas[0].datetime.date(0)
              print('%s, %s' % (dt.isoformat(), txt))
      
      posted in General Discussion
      N
      niklay
    • Cannot find file "orcl-1995-2014.txt" from the Quickstart tutorial

      Hi,
      I started using Backtrader with doing the Quickstart tutorial. At the beginning two variables modpath and datapath are declared with datapath searching for the file "orcl-1995-2014.txt". Unfortunately, my mac cannot find this file (I also searched for it using the terminal, but the file seems to be nonexistent). Is there anything wrong with the tutorial or did I miss something here?

      I'm using Python 3.6.1 with PyCharm and installed Backtrader via pip install backtrader

      Thanks for helping!

      posted in General Code/Help
      N
      niklay