View Full Version : Managed Approach Orders question
ScottB
07-30-2010, 11:47 AM
HI,
It appears that if I am using the live until cancelled option for placing orders (Managed Approach) and I want to change the order, I have to cancel the order and resubmit it. If this isn't correct, could someone please point me to the correct place in the documentation?
Also, I know simulated stops are held on the local machine but where is the information contained in IOrder held? If I test IOrder (myOrderVariable).LimitPrice or .StopPrice, is that call going beyond my address space or worse yet over the internet to a remote server, and if so, what is the relative time cost of doing that vs. storing those same variables in a local variable within the strategy?
I need this information in various places in my strategy and it seems silly to store it separately from the IOrder object unless there is a performance hit to using the IOrder object.
Thanks,
Scott
NinjaTrader_Bertrand
07-30-2010, 12:12 PM
Scott, the IOrder call would be to the local reference object tracking the order related property changes, so I don't see a performance 'hit' here.
Which NinjaTrader version are you using here?
ScottB
07-30-2010, 12:26 PM
Bertrand, I am using version 7 build 19. I thought the calls would be local but since I am making the call in more than one place, I wanted to be sure.
I had another question about CancelOrder() in my post. I want to stay with live until cancelled but can't see a way to modify an order without cancelling it and then resubmitting it. Is there an easier/faster way?
I ask because the way the CME matching engine works now, it is much faster to modify an order rather than cancel/replace the order.
Thanks,
Scott
NinjaTrader_Bertrand
07-30-2010, 01:08 PM
Hi Scott, good point on the modification vs submitting fresh difference. You should be able to just resubmit the original order to 'update' it to a new price even with LiveUntiCancelled set to 'true' - have you checked with the TraceOrders to debug?
ScottB
07-30-2010, 01:29 PM
Oops, I hadn't even thought to try that. As always thanks for your help and guidance.
Scott
ScottB
07-30-2010, 01:32 PM
Double oops, now I remember why I didn't do that. How does NinjaTrader sort through whether this is a new order or a modification of the old order and what happens to the old order?
Is there a link that explains this when using live until cancelled? I have read the documentation but it didn't seem to address this issue.
Scott
NinjaTrader_Bertrand
07-30-2010, 01:36 PM
Scott, I'm sorry I don't follow you, in the TraceOrders output you would see amended orders showing as such - http://www.ninjatrader.com/support/forum/showthread.php?t=3627
ScottB
07-30-2010, 01:43 PM
I can probably figure it out now that I see how to use TradeOrders (I am new to NinjaTrader but a very experienced trader/programmer).
If I have an IOrder object representing a new order (live until cancelled) and I modify that order via EnterLongLimit(), I then assume NinjaTrader sees all subsequent calls to EnterLongLimit as modifications to the original order.
So far, so good but then how would I get a second order out if I needed one because it seems that it would always think I am modifying the first one. Worse yet, assuming I can do that and now have 2 orders (live until cancelled), then how would NinjaTrader know which order to modify if I again called EnterLongOrder.
In the end, I am asking how NinjaTrader tells the difference between a modification to an existing order and a brand new order if you are using the Managed Approach with live until cancelled.
Thanks, I hope I am being a little more clear.
Scott
NinjaTrader_Bertrand
07-30-2010, 02:04 PM
Scott, if you need to work with two concurrent ones, just use a new IOrder object then for this task to separate - NinjaTrader knows which order to update as you would supply the change via resubmitting the order with the orignal used signal name used for internal tracking.
Another way to know to be working with a unique order id, is the NnjaTrader internally generated token value you can access, too in your code.
http://www.ninjatrader.com/support/helpGuides/nt7/iorder.htm
For a sample how to work with IOrders, please see this link below -
http://www.ninjatrader.com/support/forum/showthread.php?t=7499
Note: in NT7 you can now compare the IOrder objects directly for equality while for 6.5 the token needed to be used.
ScottB
07-30-2010, 02:19 PM
Perfect, thank you so much. Have a great weekend.
Scott