Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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=flattenJesseNinjaTrader Customer Service
-
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.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by FishTrade, 05-13-2024, 11:11 PM
|
3 responses
12 views
0 likes
|
Last Post
by FishTrade
Yesterday, 11:09 PM
|
||
Started by Graci117, Yesterday, 09:02 PM
|
1 response
12 views
0 likes
|
Last Post Yesterday, 09:09 PM | ||
Started by ETFVoyageur, Yesterday, 07:55 PM
|
0 responses
9 views
0 likes
|
Last Post
by ETFVoyageur
Yesterday, 07:55 PM
|
||
Started by janio973, Yesterday, 07:24 PM
|
1 response
7 views
0 likes
|
Last Post Yesterday, 07:35 PM | ||
Started by aligator, 01-06-2022, 12:14 PM
|
4 responses
252 views
0 likes
|
Last Post
by john_44573
Yesterday, 06:11 PM
|
Comment