Thanks for your time.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to cancel buy limit if target fills
Collapse
X
-
How to cancel buy limit if target fills
Often I find myself wanting to leave a buy limit order to add to a position but then I would also like that limit order (adding to position) to cancel if my original target fills. Is there a way I can do this?
Thanks for your time.Tags: None
-
Hello, thanks for writing in. The best way to do this would be through the use of Exit orders for your stop and target rather than using SetStopLoss/SetProfitTarget. The Exit methods can be canceled where the Set methods can not be directly canceled unless ExitLong()/ExitShort() is called. While using Exit orders, you will be able to keep track of each order using OnExecutionUpdate/OnOrderUpdate and cancel the pending entry order if the stop or target of the original position closes. See the related example here:
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
75 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
45 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
26 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
32 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
62 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment