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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    68 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    61 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X