Whats is the best way to place such an OCO-exit-order?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
OCO orders
Collapse
X
-
OCO orders
I am using EnterLongStop() to place an order. As soon as that order gets filled, I need to place both an ExitLongStop and an ExitLongLimit such that as soon as one of these exit orders are executed, the other is canceled. Additionally, both of these exit orders will depend on the real price of the EnterLong order which is only known after this order is executed.
Whats is the best way to place such an OCO-exit-order?Tags: None
-
Hello,
You can submit logic for when an order is filled by placing the order submission logic into the OnExecution() event method. In addition to having logic entered into this method you can use IExecution to get information such as price which you could use to set a variable to submit your exit orders based off of.
You would need to use the Unamanaged Approach to submit OCO orders, this would not be possible using the Managed Approach.
In addition to the help guide sections hyperlinked about I would recommend that you review our reference sample on Using OnOrderUpdate() and OnExecution() methods to submit protective orders
If you have any further questions please let us know.Last edited by NinjaTrader_CodyB; 06-16-2016, 02:02 PM.Cody B.NinjaTrader Customer Service
-
In the sample you mentioned:
What happens to the targetOrder if the stopOrder is executed and what happens to the stopOrder if the targetOrder gets executed? There is no explicit CancelOrder in the sampleCode. Does one of these orders implicitely cancel the other?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by CommonWhale, Today, 09:55 AM
|
1 response
2 views
0 likes
|
Last Post Today, 10:11 AM | ||
Started by Gerik, Today, 09:40 AM
|
2 responses
7 views
0 likes
|
Last Post
by Gerik
Today, 10:04 AM
|
||
Started by RookieTrader, Today, 09:37 AM
|
2 responses
11 views
0 likes
|
Last Post
by RookieTrader
Today, 10:02 AM
|
||
Started by alifarahani, Today, 09:40 AM
|
1 response
7 views
0 likes
|
Last Post Today, 10:01 AM | ||
Started by KennyK, 05-29-2017, 02:02 AM
|
3 responses
1,285 views
0 likes
|
Last Post Today, 09:35 AM |
Comment