Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Blanket flattening using flatten()

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

    Blanket flattening using flatten()

    Guys,
    . Looking at creating an indicator that when certain criteria is met, it will flatten all positions linked to that account. I know it can do it for a single instrument, and multiple instruments, but how can it be done for any instrument tied to that account?

    Thanks in advance John

    #2
    Hello JLSwin,

    Thank you for your post.

    To flatten a list of instruments on an account you would need to call Flatten() for a collection of instruments. First, you would initiate a list of instruments, add instruments to that collection, then pass the instrument collection to the Flatten() method to flatten all instruments in that list.

    See an example of this and more information in the help guide documentation below.
    Flatten() - https://ninjatrader.com/support/help...t8/flatten.htm

    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    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