is there something to add to cancel limit orders that don't fill? Maybe cancel them in x second after the order?
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
How to cancel limit orders that don't fill
Collapse
X
-
How to cancel limit orders that don't fill
I did the "Enter Long Limit @ Ask" / "Exit Long Limit @ Bid" in the strategy wizard...
is there something to add to cancel limit orders that don't fill? Maybe cancel them in x second after the order?Tags: None
-
Hello crimsonite,
Thanks for writing in and I am happy to assist you.
Unfortunately you cannot cancel an order via the Strategy Wizard.
To cancel an order you have to unlock the code and edit the code via the NinjaScript editor.
To cancel any order you can use the CancelOrder function http://www.ninjatrader.com/support/h...ancelorder.htm
Please let me know if I can assist you any further.JoydeepNinjaTrader Customer Service
-
Unlocking the code is fine. Thanks for the pointer -
is it possible to enter a piece of code that will allow the order to cancel or fill immediately?
Comment
-
Hello crimsonite,
Yes, you can custom code to cancel the order as per your requirement. For example in the help file sample code the limit order is cancelled if it is not filled within the next 5 bars.
Code:private IOrder myEntryOrder = null; private int barNumberOfOrder = 0; protected override void OnBarUpdate() { // Submit an entry order at the low of a bar if (myEntryOrder == null) { myEntryOrder = EnterLongLimit(0, true, 1, Low[0], "Long Entry"); barNumberOfOrder = CurrentBar; } // If more than 5 bars has elapsed, cancel the entry order if (CurrentBar > barNumberOfOrder + 5) CancelOrder(myEntryOrder); }
Please let me know if I can assist you any further.JoydeepNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by inanazsocial, Today, 01:15 AM
|
0 responses
2 views
0 likes
|
Last Post
by inanazsocial
Today, 01:15 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
5 responses
22 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by Davidtowleii, Today, 12:15 AM
|
0 responses
3 views
0 likes
|
Last Post
by Davidtowleii
Today, 12:15 AM
|
||
Started by guillembm, Yesterday, 11:25 AM
|
2 responses
9 views
0 likes
|
Last Post
by guillembm
Yesterday, 11:58 PM
|
||
Started by junkone, 04-21-2024, 07:17 AM
|
9 responses
71 views
0 likes
|
Last Post
by jeronymite
Yesterday, 11:51 PM
|
Comment