Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Scrip oco
Collapse
X
-
Scrip oco
Hello, I want you to send two orders, a BUYSTOP and SELLSTOP, given the conditions of my strategy, according to a level defined by my strategy, and that when one is filled, it cancels the other. And I looked for the information but everything is referred to the DOM. I want to program the script. Thank you!Tags: None
-
Hello Misel,
Thank you for your post.
The Managed approach contains Set methods such as SetProfitTarget and SetStopLoss that could be used to place One Cancels Other (OCO) orders. This means that two orders could be placed and are tied together by an OCO Id. When one order is filled, the other order is canceled.
Please see the attached SetMethodsSample example which demonstrates how to use SetProfitTarget and SetStopLoss to place a profit target and stop-loss when an entry order is filled.
Also, please see this help guide link about using the Managed approach - https://ninjatrader.com/support/help...d_approach.htm
The Unmanaged approach is able to use the OCO feature also and would need to be used for bracketed entry orders.
Please see the attached UnmanagedTemplate example which demonstrates how you could use the Unmanaged approach to accomplish this.
Also, please review this help guide link about using the Unmanaged approach - https://ninjatrader.com/support/help...d_approach.htm
Let us know if we may assist furtherBrandon H.NinjaTrader Customer Service
-
Thanks for the reply, I mean to put a buy order and a sell order each at a certain level. If you fill the sell order, you cancel the unfilled purchase order. If you fill the purchase order, you cancel the unfilled sell order. After filling the order, whether it is to buy or sell, the target and stop are designated there.
The problem I have is that it only places a buy or a sell order and not both at the same time.
Comment
-
Hello Misel,
Thank you for your note.
The UnmanagedTemplate example attached in the previous post demonstrates how you could submit buy and sell entry orders that are tied together using an OCO Id. The way this works is that the strategy submits the buy and sell entry orders and if the buy entry order is filled, the sell entry order is canceled and a profit target and stop-loss are placed for the buy entry order that was filled.
Please see the video in the link below which shows the UnmanagedTemplate example doing this.
Let us know if we may assist further.Brandon H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by andrewtrades, Today, 04:57 PM
|
1 response
5 views
0 likes
|
Last Post Today, 05:02 PM | ||
Started by chbruno, Today, 04:10 PM
|
0 responses
3 views
0 likes
|
Last Post
by chbruno
Today, 04:10 PM
|
||
Started by josh18955, 03-25-2023, 11:16 AM
|
6 responses
436 views
0 likes
|
Last Post
by Delerium
Today, 03:42 PM
|
||
Started by FAQtrader, Today, 03:35 PM
|
0 responses
7 views
0 likes
|
Last Post
by FAQtrader
Today, 03:35 PM
|
||
Started by rocketman7, Today, 09:41 AM
|
5 responses
19 views
0 likes
|
Last Post Today, 03:33 PM |
Comment