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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
41 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
27 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
45 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
37 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment