Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 iceman2018, Today, 05:07 PM
    0 responses
    4 views
    0 likes
    Last Post iceman2018  
    Started by rhyminkevin, Today, 04:58 PM
    0 responses
    23 views
    0 likes
    Last Post rhyminkevin  
    Started by lightsun47, Today, 03:51 PM
    0 responses
    6 views
    0 likes
    Last Post lightsun47  
    Started by 00nevest, Today, 02:27 PM
    1 response
    14 views
    0 likes
    Last Post 00nevest  
    Started by futtrader, 04-21-2024, 01:50 AM
    4 responses
    49 views
    0 likes
    Last Post futtrader  
    Working...
    X