Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

FLATTENEVERYTHING vs CLOSEPOSITION

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

    FLATTENEVERYTHING vs CLOSEPOSITION

    please explain the difference, if any, between sending an OIF to CLOSEPOSITION and FLATTENEVERYTHING

    my main concern is if FLATTENEVERYTHING is safer as it can not result in a race condition as it just closes anything open and cancels any order

    however CLOSEPOSITION may result in an exception if there are no open positions...or...maybe if long it sends a sell which can result in a reverse if the race is lost

    #2
    Close position closes any already open positions at the time you sent the order. While it is closing that position you could have filled another order and still be left with an open position from such an in flight execution.

    FlattenEverything tries to cancel open orders first to ensure no inflight executions come in. That is the difference.

    Of course you can use ClosePosition in the same vein as FlattenEverything if you just manually cancel all your orders yourself and wait for confirmation on those cancels before submitting ClosePosition.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    628 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    359 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    562 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X