Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnFlatten() method

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

    OnFlatten() method

    heres a question - is there a way to see if a OnFlatten event handler is fired or a way to detect it?

    On strategies there is a disablement if the trades are closed etc, but if you are handling trades via a indicator there is not a great way to see if flatten has been attempted.

    #2
    Hello WHICKED,

    The only way that I would be aware of would be to monitor the position updates or the execution updates looking for orders with the name of Close assuming you are using one of the flatten all options.

    Comment


      #3
      In the log file when using Account.Flatten(instrument) there is a log entry that a flatten was executed on instrument - is it possible to monitor for that event?

      Comment


        #4
        Hello WHICKED,

        There are not any means to monitor the log output from NinjaScript, you would need to monitor one of the account events like position or order updates to know something had happened.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        83 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        143 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        83 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        256 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        334 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X