Thanks!
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
NT8 Equivalent - CancelAllOrders()
Collapse
X
-
NT8 Equivalent - CancelAllOrders()
In NT7 I used CancelAllOrders() in a strategy. I cannot find on the forums or in code where the equivalent method is. If it doesn't exist, is there a preferred way to cancel all orders for a strategy?
Thanks!Tags: None
-
Hello thomaspartyof10,
Thanks for opening the thread.
CancelAllOrders() is available under the Account object. This will cancel all orders on the account, not limited to the strategy.
This method is documented here: https://ninjatrader.com/support/help...lallorders.htm
For cancelling orders for a strategy itself, I would recommend tracking the orders with Order objects and cancelling those orders with your own method that will call CancelOrder() for each of those orders. The SampleOnOrderUpdate strategy for NT8 demonstrates how such a method can be created and how Order objects can be used.
CancelOrder() - https://ninjatrader.com/support/help...ancelorder.htm
SampleOnOrderUpdate - https://ninjatrader.com/support/foru...ead.php?t=7499
Also worth mentioning is the CloseStrategy() method that will cancel order and close open positions of that strategy.
CloseStrategy() - https://ninjatrader.com/support/help...sestrategy.htm
Please let me know if I may be of further help.JimNinjaTrader Customer Service
- Likes 1
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by GussJ, 03-04-2020, 03:11 PM
|
15 responses
3,270 views
0 likes
|
Last Post Today, 03:15 PM | ||
Started by Tim-c, Today, 02:10 PM
|
1 response
8 views
0 likes
|
Last Post Today, 02:52 PM | ||
Started by Taddypole, Today, 02:47 PM
|
0 responses
2 views
0 likes
|
Last Post
by Taddypole
Today, 02:47 PM
|
||
Started by chbruno, 04-24-2024, 04:10 PM
|
4 responses
51 views
0 likes
|
Last Post
by chbruno
Today, 02:38 PM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
10 responses
403 views
1 like
|
Last Post
by beobast
Today, 02:35 PM
|
Comment