Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

fill algorithm/ force a fill at a given price

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

    fill algorithm/ force a fill at a given price

    I want to close all open positions at beginning of a sessions and then reopen them at the same price, because I want the strategy stats to recognize the unrealized pnl as realized pnl. (since the strategy stats report only realized pnl.

    When I implemented this work around, I found that when I try to close all positions and then reopen them I actually have to wait for the fills before i can reopen the positions. that means the operation can't be completed at the end of the first bar of session, which is limiting to me because I would not really be doing this in real time.

    so I am wondering if I can somehow force a fill in the system?

    Thanks you

    #2
    Hello newworldguy,

    Thank you for your post.

    Unfortunately, there is no method to force a fill. You could use Market Orders, but in a backtest they would need the next bar's close. You could look into ExitOnClose and ExitOnCloseSeconds:
    Please let me know if you have any questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    60 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    148 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    98 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X