Navigation

    Backtrader Community

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

    flix

    @flix

    0
    Reputation
    1
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    flix Unfollow Follow

    Latest posts made by flix

    • RE: how to execute on the close price of the next bar

      newbie here.

      self.buy(price=self.dataclose[1]) may help

      posted in General Code/Help
      F
      flix
    • StopTrail / trail(percent-amount) changes but exec time

      Hi,
      I try to use stoptrail in buy orders, but different values of parameters(trailpercent-trailamount) change execution day of buy order:
      <<
      self.order = self.buy(size = 100, exectype = bt.Order.StopTrail, trailpercent=0.02)

      output:
      2019-01-07 buy CREATE: 31120
      2019-01-12 BUY EXECUTED @ Price: 31100 Cost: 3110000


      self.order = self.buy(size = 100, exectype = bt.Order.StopTrail, trailpercent=0)

      output:
      2019-01-07 buy CREATE: 31120
      2019-01-08 BUY EXECUTED @ Price: 31000 Cost: 9920000

      with regular buy order(no stoptrail, market type) i get same result as last one which I understand must be correct one.(order executes the day after creating)
      did I miss something?

      posted in General Code/Help
      F
      flix