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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    65 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    149 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
    99 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