NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 01-06-2011, 12:46 PM   #1
dox58333
Junior Member
 
Join Date: Dec 2010
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Default Changing Order_Error Invalid Order ID/Name

#1:
1/6/2011 12:33:33 PM ATI AT, 'PLACE;Sim101;ES 03-11;BUY;2;MARKET;0;0;;;ES 03-11.T2S1.2;T2S1;T2S1-ES 03-11-2' processing

#2:
1/6/2011 12:33:39 PM ATI OIF, 'CHANGE;Sim101;ES 03-11;BUY;2;MARKET;0;0;;;ES 03-11.T2S1.2;;T2S1-ES 03-11-2' invalid order ID/Name 'ES 03-11.T2S1.2'

In #1 above [Place order command] The Order ID given to order is shown in Bold.
In #2 above [Change order command] The same Order ID given to original order is shown in Bold.

Yet the #2 shows the error message, also shown in Bold, that the Order ID/Name is invalid, but they match as shown.

I should add . . . this seemed to work yesterday but I was using "PLACE" to add to the order instead of "CHANGE" . . . which did not work in real-time today . . . giving error . . . "Order already exists" . . . so it seems "CHANGE" should work somehow.

I have tried . . . "", . . . "Entry", . . . "Entry1", etc. and nothing works.

Thanks for insight you can give.

Dox
Last edited by dox58333; 01-06-2011 at 12:53 PM.
dox58333 is offline  
Reply With Quote
Old 01-06-2011, 12:59 PM   #2
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Please take the periods and spaces out of the order ID. This should do the trick. I believe that - is ok though.

Let me know if I can be of further assistance.
NinjaTrader_Brett is offline  
Reply With Quote
Old 01-06-2011, 01:16 PM   #3
dox58333
Junior Member
 
Join Date: Dec 2010
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Default

That proves not to be the problem. If I make the Order ID be Bob . . . Bob is not accepted in the "CHANGE" order for adding to position.

So the question becomes . . . Can a position be added to using the 'CHANGE' command? . . . and if not . . . Can an existing order be added to by using the 'PLACE' command and the original Order ID?

Neither of the above seems to work . . . I'm looking for verification that any addition to a position qty has to have a new Order ID . . . and hopefully this is not the case . . . as further changes are infinitely more complicated. This can't possibly be true.

From the Ninja 7 Help file:
CHANGE COMMAND
This command will change the parameters of an order and requires an order ID value. The order ID value must match the order ID value given to an order placed through the PLACE command

1/6/2011 1:10:15 PM ATI AT, 'PLACE;Sim101;ES 03-11;BUY;2;MARKET;0;0;;;BOB;T2S1;T2S1-ES 03-11-2' processing

1/6/2011 1:10:34 PM ATI OIF, 'CHANGE;Sim101;ES 03-11;BUY;2;MARKET;0;0;;;BOB;;T2S1-ES 03-11-2' invalid order ID/Name 'BOB'

Thanks for your help,
Dox
Last edited by dox58333; 01-06-2011 at 01:26 PM.
dox58333 is offline  
Reply With Quote
Old 01-06-2011, 02:19 PM   #4
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Can you please check in the NT Control Center orders tab and see what the actual order ID is reported by NinjaTrader after the order is made.
NinjaTrader_Brett is offline  
Reply With Quote
Old 01-06-2011, 02:36 PM   #5
dox58333
Junior Member
 
Join Date: Dec 2010
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Default

Answer to your request: 40c6da3b1a59483a8ab327828a77ca13

From a previous post a user writes:
The order places and fills like it's supposed to, but it's not using the OrderID that I've supplied. In this case, the orderID variable is a GUID that I generate for each order. What's confusing is that I can see in the NinjaTrader log that it received my ID, but chose to assign a different one to the order. Is this expected behavior? How can I place an order with a user-assigned ID?

and Ninja responds:
this is expected behavior, you can assign a user defined order id to your ATI order to be able to CHANGE / CANCEL it from your external code later, so you have a reference.

and user responds:
Ok, thank you for the clarification. So NinjaTrader has an internal reference to my user-supplied OrderID, but will expose an application-supplied ID in the log. Is there a lifetime on my ID?

and Ninja responds:
This is correct bsgetson, the lifetime would be determined by when your order reaches a terminal state (cancelled / filled / rejected states).


I'm supplying the above previous correspondence since the route you are going has already been clarified by Ninja. And clearly states that my user supplied Order ID is available for change . . . even though Ninja internally is supplying it's own ID.

Thanks for your help,
Dox
dox58333 is offline  
Reply With Quote
Old 01-07-2011, 10:08 AM   #6
dox58333
Junior Member
 
Join Date: Dec 2010
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Default

I am still looking for the answer to these questions, ie. a response to this thread.

Dox
dox58333 is offline  
Reply With Quote
Old 01-07-2011, 10:29 AM   #7
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Did not see a question? Thought you had researched your own issue and you where good to go and closed the case.

I take your still hving issue. I do see one thing that is a little off here:


1/6/2011 1:10:15 PM ATI AT, 'PLACE;Sim101;ES 03-11;BUY;2;MARKET;0;0;;;BOB;T2S1;T2S1-ES 03-11-2' processing

1/6/2011 1:10:34 PM ATI OIF, 'CHANGE;Sim101;ES 03-11;BUY;2;MARKET;0;0;;;BOB;;T2S1-ES 03-11-2' invalid order ID/Name 'BOB'

Notice how on is:

1/6/2011 1:10:15 PM ATI AT
The other is:

1/6/2011 1:10:34 PM ATI OIF

Are you using two different Automation methods, the DLL interface to submit the order and a OIF to change it?
NinjaTrader_Brett is offline  
Reply With Quote
Old 01-07-2011, 10:47 AM   #8
dox58333
Junior Member
 
Join Date: Dec 2010
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Default

As I stated earlier . . . I posted the previous post material because you were going the route of looking at 'Ninja's Order ID like there was a problem there. I posted it so you didn't pursue that course of thinking. The problem still exists as I have shown.

Answer to your current question is no. Same ATI method. I'm placing the order . . . and cannot add to the position using the 'CHANGE' command. OIF is a yellow message from Ninja that signifies a problem and Ninja is providing 'INFORMATION' about the problem . . . in this case it says the order ID's do not match . . . BUT THEY DO! . . . as I have shown.

So let's solve this.

Dox
dox58333 is offline  
Reply With Quote
Old 01-07-2011, 11:02 AM   #9
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

dox58333, can you please contact me at support at ninjatrader dot com with your test strategy and trace / logs files from the day of the issue? I'll then look into your setup here on our end.

Thanks in advance,
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 01-07-2011, 11:08 AM   #10
dox58333
Junior Member
 
Join Date: Dec 2010
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Default

This is not a test strategy and there is no day of issue.

You have a dll interface that is not working as it is described.

You have a 'PLACE' command . . . which as shown is working fine.

You have a 'CHANGE' command . . . which as shown is not working fine and gives an error message that I have provided.

and I have posted the two lines of code that should work according to your help file . . . and the 'CHANGE' command does not.

This is not a test strategy. Your function call filled out like the help file says . . . is not working.

You have the command lines in front of you.

This is not a test strategy.

Please have someone look at the code and see what the problem is.

Dox
Last edited by dox58333; 01-07-2011 at 11:24 AM.
dox58333 is offline  
Reply With Quote
Old 01-07-2011, 11:32 AM   #11
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Dox, I tested your scenario with the ATI's OIF file builder and don't see any issue: please go to Tools > ATI > General > OIF File Builder to PLACE > CHANGE an order with your user supplied order ID / Name. You can see the changes applied and working if the AT interface is enabled in your Control Center's order tab. The corresponding string can be viewed as well so you should get an idea how to debug your custom external code calling the interface functions.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 01-07-2011, 12:31 PM   #12
dox58333
Junior Member
 
Join Date: Dec 2010
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Default

Using the OIF builder produces all of the following:

1. OIF: Place order . . . formats as follows:
PLACE;SIM101;6E 03-11;BUY;2;MARKET;0;0;DAY;;Bob;T2S1;Sally

dll call formats as follows: (exact same except for 'DAY' is missing . . . but order processed fine. Added 'Day' and get same results)
ATI AT, 'PLACE;Sim101;6E 03-11;BUY;2;MARKET;0;0;;;Bob;T2S1;Sally' processing

2. OIF: Change order . . . formats as follows:
CHANGE;;;;4;;0;0;;;Bob;;Sally [Side Note: Now I don't see how this is going to "BUY" 2 or "Change" the Qty to 4 if it's not told to "Buy" 4 but . . . just doing what you said so . . .]

dll call formats as follows: [exact same as OIF builder except . . . SAME ERROR AS BEFORE
ATI OIF, 'CHANGE;;;;4;;0;0;;;Bob;;Sally' invalid order ID/Name 'Bob'

in other words . . . same problem as described from the beginning . . . and I will now restate the question.

How do you add to a position that is already open if Ninja will not accept the same Order ID as used in 'PLACING' the original order?
Last edited by dox58333; 01-07-2011 at 12:40 PM.
dox58333 is offline  
Reply With Quote
Old 01-07-2011, 12:52 PM   #13
dox58333
Junior Member
 
Join Date: Dec 2010
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Default

If you look at the OIF builder you can see that with the Change command selected . . . BUY or Sell is not an option . . . which suggests that you cannot add of subtract from an open order using the 'CHANGE' command . . . and OK . . . that makes sense . . . EXCEPT . . .

The 'PLACE' command will not let you add to an existing order because it gives you the error . . . 'Order ID' already in use.

So again . . . the question is how to add to a position without having multiple order ID's to have to keep track of. And by the way . . . why is 'Entry' not available like 'Target1' and 'Stop1' is. That would solve this problem also . . . and the help file suggests it is . . . but does not seem so.

Dox
dox58333 is offline  
Reply With Quote
Old 01-07-2011, 03:33 PM   #14
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Dox,

Please see the linked video of placing a trade while calling an ATM strategy, changing the entry order, having it filled and still have the ATM strategy applied.

http://www.screencast.com/t/YDdmkeO54Ib

In a nutshell, when you do CHANGE, you should not be providing the Strategy ID.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-07-2011, 04:00 PM   #15
dox58333
Junior Member
 
Join Date: Dec 2010
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Default

Josh,

Unfortunately the video runs neither in Chrome or Explorer. Just a blank screen on Explorer and perpetually 'opening' in Chrome.

Can you make sure it works and repost or something.

Dox
dox58333 is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
entry order id Kentoes General Programming 13 07-19-2010 03:35 PM
Get ID Order Number MAX Automated Trading 1 02-09-2010 05:23 PM
Invalid Stop Order problem molecool Strategy Development 4 04-13-2009 06:16 PM
qif order id kiwibird Automated Trading 3 05-15-2008 01:30 AM
order ID changed? BCA Automated Trading 3 12-28-2005 08:53 AM


All times are GMT -6. The time now is 10:40 PM.