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/

    StopTrail giving weird Results ....Probably

    General Code/Help
    1
    3
    25
    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.
    • Z
      zuj last edited by

      I am using

      self.order_target_percent(d, target=self.perctarget, exectype=bt.Order.StopTrail, trailpercent=1)
      
      

      for the stoptrail implementation. I checked the source code and I expected it to give me the same result that I get when I only use

      self.order_target_percent(d, target=self.perctarget)
      

      But I am getting very different results

      without stoptrail trailpercent=1    143631.53
      with stoptrail trailpercent=1       75766.57
      

      I also got the same value without stoptrail, when I used stoptrail with trailpercent=0, but then I checked the source code and I saw that it is initialized with 0, so they are the same thing.

      I still think that if I have a trailing stop with 100% distance then it should be pretty similar(IF NOT SAME) to the case without stopTrail. Am I missing something here?

      Z 1 Reply Last reply Reply Quote 0
      • Z
        zuj @zuj last edited by

        @zuj Now I noticed that even setting trailpercent=0 gives similar but different results?????????

        Z 1 Reply Last reply Reply Quote 0
        • Z
          zuj @zuj last edited by

          I figured it out. StopTrail doesn't work correctly with target orders.

          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(); }); }