Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Non-flat strategy position after exit on close

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Non-flat strategy position after exit on close

    I have several strategies (both live and simulated) that run in regular trading hours. Most of my strategies are exiting at close, and they normally do that properly in my IB account. What I noticed however, is that if I get disconnected after the market close e.g. IB shuts down and I reconnect, or I disable the strategy to check/adjust something and then turn it back, I will see a non-flat strategy position associated with my strategy now. It should be flat, as the rule was to exit at the end of trading.

    How can I force a flat strategy position, or what settings do I need to change to make sure the strategy position persists during disconnects?

    #2
    mic414, this is one of the limitations unfortunately working of the default ExitOnClose orders, as you reload the bars would be processed as historical backtest data and thus the last bar of the day still open, as no open tick for a new bar would be seen yet. In realtime the PC clock would be used as reference to submit those orders in, so there's a difference in handling. You could workaround that be implementing a custom time exit for example on a bar before the session end that would historically then trigger as well as you would expect. This generally is an item we have on the list to further improve for our next major platform update.

    Comment


      #3
      Thanks Bertrand. I'll try the custom exit solution, that would be a good workaround for now, thanks for the tip.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      95 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      50 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      31 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      35 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      72 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X