Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitLong and ExitShort and position flattening questions

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

    ExitLong and ExitShort and position flattening questions

    Hi There,
    I have a few questions on flattening positions in an account from within a strategy. First, the ExitLong() and ExitShort() functions, do those flatten ONLY positions that the strategy has taken?

    For example, if I have strategy xyz running and its taking trades.

    But then I manually enter a trade by myself on a separate instrument. When the ExitLong or Short is called from the strategy , will that leave my manually entered trade alone and only exit the strategies positions? From initial testing that seems to be true, but looking for confirmation.

    Also, is there a way, unsupported if need be , that a strategy could flatten everything within the account , even manually taken trades? Importantly, not globally so all accounts flatten but an account wide position flatten.

    Thanks!

    #2
    Hello slocumtrader,

    Yes, the ExitLong() and ExitShort() commands will only close orders that are submitted by the current instance of the strategy. Orders from other instances of strategies and manual orders will be left alone.

    It is unsupported to flatten everything from code, but to do so call:
    NinjaTrader.Gui.SuperDom.SuperDom.FlattenEverythin g();

    This will flatten all orders across all accounts connected to NinjaTrader.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    660 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    375 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X