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:	208
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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        94 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        140 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        125 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        74 views
        0 likes
        Last Post PaulMohn  
        Working...
        X