Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Get Event for Flatten Everything
Collapse
X
-
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 -
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
-
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
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
338 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment