Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get Event for Flatten Everything

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

    Get Event for Flatten Everything

    How can I run a function when the flatten everything / flatten all / flatten button is pressed on an account? Possibly run it before the order gets sent, or another option: how can I recognise that the order is a flatten order and not a normal close order

    #2
    Hello Pole123,

    Do you have other tools running on the account in question? If so the other tools would need to incorporate some sort of logic to close any trades it has open and then shut down. Mosts tools that will do that and would keep track of that by knowing what orders it placed and checking that there is a position when shutting down. If you are using only the addon approach you can call flatenall https://ninjatrader.com/support/help...ghtsub=flatten

    Comment


      #3
      Click image for larger version

Name:	Screenshot 2023-10-09 at 23.13.08.png
Views:	190
Size:	116.1 KB
ID:	1272167

      No, I need to know when the user manually clicks the flatten button

      Comment


        #4
        Hello Pole123,

        If a user manually flattens the account your scripts won't specifically know about that. Strategies will close their positions but any other tools being used on the account will still be active, you need to disable any tools being used before doing manual actions like flatting.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        581 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        338 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X