NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM 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 06-20-2009, 08:50 PM   #1
cesas
Member
 
Join Date: Feb 2009
Posts: 71
Thanks: 0
Thanked 0 times in 0 posts
Default OCO order error

Hi. When I place a profit target order and a stop loss order throught setstoploss and setprofittarget, and my stop loss is filled, I see the following error. Can you tell me what is going on?


[IMG]file:///C:/Users/CES/Desktop/error1.jpg[/IMG][IMG]file:///C:/Users/CES/Desktop/error1.jpg[/IMG]
Attached Images
File Type: jpg error5.jpg (65.3 KB, 19 views)
cesas is offline  
Reply With Quote
Old 06-20-2009, 11:59 PM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

cesas, which TWS version do you use? We recommend using 892.7 with NinjaTrader 6.5.1000.11 as per the IB connection guide - http://www.ninjatrader.com/webnew/su...ivebrokers.htm

On top of that, please check with IB tech support on their error message 161
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 06-21-2009, 10:28 AM   #3
cesas
Member
 
Join Date: Feb 2009
Posts: 71
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Bertrand. I am using ninjatrader 6.5.1000.11 already and I am using TWS version from ninjatrader website. If I understand what youre saying, the problem is not form ninjatrader, is from TWS, ok?
cesas is offline  
Reply With Quote
Old 06-22-2009, 06:51 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

cesas, yes this appears to be a native error (error code 161). If you like I can take a look at your trace and log files, for this please contact me using the Help > Mail to Support feature and put Attn Bertrand in the subject. Thanks!
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 06-22-2009, 07:53 AM   #5
cesas
Member
 
Join Date: Feb 2009
Posts: 71
Thanks: 0
Thanked 0 times in 0 posts
Default

sent........
cesas is offline  
Reply With Quote
Old 06-22-2009, 08:07 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

Ok thanks got them, will follow up via email.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 06-22-2009, 02:03 PM   #7
cesas
Member
 
Join Date: Feb 2009
Posts: 71
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi bertrand. I receive your e mail, I sent an email to IB. But I receive another error. See the attach.
Thanks
Attached Images
File Type: jpg error 6.jpg (73.9 KB, 9 views)
cesas is offline  
Reply With Quote
Old 06-22-2009, 02:06 PM   #8
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

cesas,

Please provide background information as to what you were doing when this occurred. Thank you.
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-22-2009, 02:14 PM   #9
cesas
Member
 
Join Date: Feb 2009
Posts: 71
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi. Fully automated trading this way when happens:

-Short SP eMINI Futures.
-Large order, about 200 contracts
-Several partial fills, about 8.
-When the short order was filled, my strategy put in a take profit and stop loss order throght setprofittarget and setstoploss conditions.
-My profit was filled and the error appear
-several partial fills at take profit
-Using IB paper trading account
-Using 1min chart
Last edited by cesas; 06-22-2009 at 02:18 PM.
cesas is offline  
Reply With Quote
Old 06-22-2009, 02:18 PM   #10
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Please attach your trace and log files. Thank you.
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-22-2009, 02:24 PM   #11
cesas
Member
 
Join Date: Feb 2009
Posts: 71
Thanks: 0
Thanked 0 times in 0 posts
Default

josh, another useful information. The first attach (error 161) occurs when the stop loss is hit. The second attach (error 201) occurs when the take profit is hit.
cesas is offline  
Reply With Quote
Old 06-22-2009, 02:28 PM   #12
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

If you could send in trace/log files just like you have done earlier with the 161 errors, we would like to see when the 201 occurs. Thank you.
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-22-2009, 02:31 PM   #13
cesas
Member
 
Join Date: Feb 2009
Posts: 71
Thanks: 0
Thanked 0 times in 0 posts
Default

how I do that?
cesas is offline  
Reply With Quote
Old 06-22-2009, 02:32 PM   #14
cesas
Member
 
Join Date: Feb 2009
Posts: 71
Thanks: 0
Thanked 0 times in 0 posts
Default

I already sent to you the files
cesas is offline  
Reply With Quote
Old 06-22-2009, 02:38 PM   #15
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

cesas,

Unfortunately I did not receive any files. Please send it in to support [at] ninjatrader [dot] com with Attn Josh in the subject line and mention this thread. Thank you.
NinjaTrader_Josh 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
Backtesting strategy with oco order Tommyknocker Strategy Development 4 03-30-2009 08:42 AM
OCO Order Handling issue sammano Strategy Development 3 12-12-2008 06:48 AM
in an automated strategy can you do a OCO order HelloHello Automated Trading 11 09-14-2007 10:23 PM
OCO or Sim Order 'Lights' for chart trader zoltran Charting 3 05-24-2007 12:53 PM
OCO Order Entry Function zoltran SuperDOM and other Order Entry Windows 4 03-29-2007 02:27 AM


All times are GMT -6. The time now is 06:09 AM.