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/

    IB trailing stop price

    General Code/Help
    1
    2
    56
    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.
    • M
      mmbot last edited by

      Hi
      I am trying to implement trailing stop in IB paper account but I find the execution odd or I lack understanding in it.
      Is there a way in next{} to get the trailing stop price in tws at every step?

      Am not sure if this will work in IB (got from docs) :

      print('trailing price long: {}, short: {}'.format(self.long_trailstop.created.price, self.short_trailstop.created.price))
      

      Thanks!!

      M 1 Reply Last reply Reply Quote 0
      • M
        mmbot @mmbot last edited by

        I read again IB's definition on trailing stop. It says it follows the market price, and I think if its a sell stop, it trails the high. I was expecting it to trail the interval I am looking at, for example, trail the close of 5min candle...apparently not but maybe it makes sense as not sure if IB knows I am looking at 5 min bars or 1 min bars or 4 hour bars?

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