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 kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    28 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    17 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    26 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    24 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    139 views
    0 likes
    Last Post SalmaTrader  
    Working...
    X