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:	205
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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        84 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        47 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        66 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        69 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        58 views
        0 likes
        Last Post CarlTrading  
        Working...
        X