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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    70 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    152 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
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X