EnterLongLimit(bidprice, "buy bid"); EnterShortLimit(askprice, "sell ask");
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
two opposing entry limit orders?
Collapse
X
-
two opposing entry limit orders?
the internal order handling rules are currently preventing me from trying an idea out. how should I go about placing two opposing orders for something like the following?
Code:Tags: None
-
I've just run into the same problem trying to set up a straddle strategy. Basically:
EnterLongStop(highpoint, "we broke resistance");
EnterShortStop(lowpoint, "we broke support");
I assume the purpose of the internal order handling rule that stops me from doing this is so that I don't accidentally have both orders trigger and hence not know what, if any, position I'm in.
It would be nice if instead of having this rule NT could automatically link the two orders OCO, or alternatively allow the rule to be turned off.
Comment
-
Ben,
Has anyone gotten to this yet? I would like to create one OCO order and handle the cancelling of the order on my own. However, it seems like I cannot short and go long (via two opposing stop or limit orders within the same strategy). Is this true?
This is what I want:
At a certain time, I want to submit an two orders (one short, one long).
If one gets filled, I want to cancel the opposing order.
I understand I will need to handle the cancelling using OnOrderUpdate or OnExecution. If this is not allowed, then what is the purpose behind EntriesPerDirection? I'm essentially placing the same quantity on opposing sides. Once a fill occurs on one side, I will cancel the working order via CancelOrder.
Again, if this is not possible (entering opposing limit or stop orders) then why have EntriesPerDirection??
thanks!
jon
Originally posted by NinjaTrader_Ben View PostHello,
Since you are asking about NT7, I will have someone reply to you on Monday. Thank you for your patience.
For NT6.5, it is still true.
Comment
-
Jon, with this approach you're running into the Internal Order Handling Rules - http://www.ninjatrader-support.com/H...verview36.html (bottom section here).
Those exist in NT 6.5 and still exist per default in NT7, however with NT7 we also offer a completely new unmanaged order submission feature where you could custom code exactly what you need using the SubmitOrder, ChangeOrder and CancelOrder methods in NinjaScript.
New Unmanaged Order Submission
In 6.5 some users were burdened with our "Internal Order Handling" rules. We have introduced unmanaged order submission which bypasses the convenience of our order handling layer. This lower level of programming allows you to do what you want relative to order submission/management without any limitations other than any imposed by your broker. There are only three methods, SubmitOrder(), ChangeOrder() and CancelOrder(). You then get the flexibility of managing your orders how you see fit and optionally handling rejections.
Comment
-
Bertrand,
So with NT7 and the unmanaged order submission feature, I can SubmitOrder() two limit orders on opposing sides withing 1 strategy for the same market?
thanks!
jon
Originally posted by NinjaTrader_Bertrand View PostJon, with this approach you're running into the Internal Order Handling Rules - http://www.ninjatrader-support.com/H...verview36.html (bottom section here).
Those exist in NT 6.5 and still exist per default in NT7, however with NT7 we also offer a completely new unmanaged order submission feature where you could custom code exactly what you need using the SubmitOrder, ChangeOrder and CancelOrder methods in NinjaScript.
New Unmanaged Order Submission
In 6.5 some users were burdened with our "Internal Order Handling" rules. We have introduced unmanaged order submission which bypasses the convenience of our order handling layer. This lower level of programming allows you to do what you want relative to order submission/management without any limitations other than any imposed by your broker. There are only three methods, SubmitOrder(), ChangeOrder() and CancelOrder(). You then get the flexibility of managing your orders how you see fit and optionally handling rejections.
Comment
-
Bertrand,
Beautiful! This is perfect. I tested this and it works nicely.
Now moving on to supporting StopLoss and ProfitTarget collars on all unmanaged orders. I don't suppose I could use some of the NT functionality for this on an unmanaged strategy (like setStopLoss or setProfitTarget)?
THANKS!
jon
Originally posted by NinjaTrader_Bertrand View PostYes, as with Unmanaged set to 'true' in the Strategy Initialize() you would not get 'ignored' orders then as the Internal Order Handling Rules are not at play then under the hood.
Comment
-
Bertrand,
I was trying to have my cake and eat it too. In any case, how do I monitor the last price? NT needs more documentation regarding this NT7 feature.
thanks!
jon
Originally posted by NinjaTrader_Bertrand View PostCorrect, in unmanaged strategies only SubmitOrder, CancelOrder and ChangeOrder can be called...as their no NT signal tracking being applied and used. For the 'freedom' you gain you have to self manage order tracking aspects then in your code (storing as IOrder references).
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
671 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
379 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
111 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
582 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment