The purpose for the limit order is that using market orders develops at least 2 ticks of slippage where as using limit orders with 1 tick offset from the close is a built in 1 tick slippage, but NinjaTrader, for some reason I am not clear on, won't allow limit order reverses.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Internal Order Handling Errors
Collapse
X
-
Internal Order Handling Errors
When using limit orders for entries how can I get Ninja to reverse when a condition is true. When I program the same strategy using market orders the reverse is just fine, but when I change to limit orders my entries are "ignored" because of "Internal Order Handling Errors". I am using an offset of 1 tick from the close of the current bar so not going through the price is not the issue. It's strickly NinjaTrader's ignoring the trade. What is the work around for this problem and why does NinjaTrader feel the need to ignore my trade anyway?
The purpose for the limit order is that using market orders develops at least 2 ticks of slippage where as using limit orders with 1 tick offset from the close is a built in 1 tick slippage, but NinjaTrader, for some reason I am not clear on, won't allow limit order reverses.Tags: None
-
Hi kenb2004,
There's nothing inherent in limit orders that prevents them from being used to reverse. You are running into internal order handling rules due to a conflict with another working order. Maybe you have also SetProfitTarget()?
Internal order rules are detailed on this page.Ryan M.NinjaTrader Customer Service
-
With a working ExitLongLimit(), you're running into the rule below. NinjaTrader is a real-time live trading platform and thus we need to ensure that we prevent situations in real-time where you may have multiple orders working accomplishing the same task.
You can cancel the working ExitLongLimit() prior to submitting the short limit reversal. If the internal handling rules prevent you from accomplishing your coding goals, you can use the unmanaged approach, which has no rules and no NT position management.
Methods that generate orders to enter a position will be ignored if:
• A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction
• A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction
• The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
• The entry signal name is not uniqueRyan M.NinjaTrader Customer Service
Comment
-
Ryan
You say "There's nothing inherent in limit orders that prevents them from being used to reverse", but when I use a market order in the very same instance both the ExitLongLimit and the ExitLongStop are cancelled automatically. But when I use Limit entry to reverse the order is ignored and the Exits are NOT cancelled. Why are the Exits not cancelled when using limit orders? How can the Exits be cancelled in order to reverse with a limit order?
Comment
-
The rules do not apply to market orders. Yes, if you're in a position and have working exit orders, an Enter method will automatically cancel these exit orders. Your EnterLimit order is never sent though - it's ignored.
You need to manually cancel your working exit orders if you want your EnterLimit order to be submitted. This sample can help with using CancelOrder()
When using NinjaTrader's Enter() and Exit() methods, the default behavior is to automatically expire them at the end of a bar unless they are resubmitted to keep them alive. Sometimes you may want more flexibility in this behavior and wish to submit orders as live-until-cancelled. When orders are submitted as live-untilLast edited by NinjaTrader_RyanM1; 06-16-2011, 10:18 AM.Ryan M.NinjaTrader Customer Service
Comment
-
-
Line 71 cancels entryorder but then Line 88 "
Replace entry limit order with a market order"
Why? What is the purpose of replacing with market order?
How would I use this CancelOrder() to cancel an ExitLongLimit(BuyProfit) and cancel an ExitLongStop(BuyStop), so I can EnterShortLimit()?
if (condition)
{
CancelOrder(BuyProfit);
CancelOrder(BuyStop);
EnterShortLimit();
}
?????
Comment
-
Originally posted by kenb2004 View PostRyan
You say "There's nothing inherent in limit orders that prevents them from being used to reverse", but when I use a market order in the very same instance both the ExitLongLimit and the ExitLongStop are cancelled automatically. But when I use Limit entry to reverse the order is ignored and the Exits are NOT cancelled. Why are the Exits not cancelled when using limit orders? How can the Exits be cancelled in order to reverse with a limit order?
ref: http://www.ninjatrader.com/support/f...ad.php?t=39971
Comment
-
Originally posted by NinjaTrader_RyanM View Postkoganam,
The symptoms are the same but you have a different issue - related to the timing of position updates in historical context.
Original poster is not seeing a limit order reversed due to internal order handling rules.
Comment
-
Ryan
The point is the same. We need to be able to reverse with LimitOrders on the same bar just like Market orders. Whatever it takes to cancel any other Limit orders that were launched with the previous EntryLimit should be able to be cancelled the same way the Market Order does. Market orders loose too much in slippage and Unmanaged Order Handling is too involved.
You haven't answered my question from my previous post...
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by haas88, 03-21-2024, 02:22 AM
|
18 responses
208 views
0 likes
|
Last Post
by haas88
Today, 02:37 AM
|
||
Started by Board game geek, Today, 02:20 AM
|
0 responses
1 view
0 likes
|
Last Post Today, 02:20 AM | ||
Started by knighty6508, Today, 01:20 AM
|
2 responses
14 views
0 likes
|
Last Post
by knighty6508
Today, 02:13 AM
|
||
Started by franatas, Today, 01:53 AM
|
0 responses
2 views
0 likes
|
Last Post
by franatas
Today, 01:53 AM
|
||
Started by knighty6508, Today, 01:17 AM
|
0 responses
9 views
0 likes
|
Last Post
by knighty6508
Today, 01:17 AM
|
Comment