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 > Miscellaneous Support > Historical Version 7 Beta Threads > Version 7 Beta General Questions & Bug Reports

Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports.

 
 
Thread Tools Display Modes
Old 10-05-2009, 08:04 AM   #1
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default Unmanaged Order Submission

Hi All,

As of this post, we have yet to document the new unmanaged order handling in strategies.

This is a quick pointer.

- In Initialize() set "Unmanaged" to a value of "True"
- This will disable all internal order handling rules
- You now "can and must" place orders using the new SubmitOrder() method, all other order entry methods will be ignored
NinjaTrader_Ray is offline  
Old 10-21-2009, 06:28 AM   #2
hemlock
Senior Member
 
Join Date: Nov 2007
Location: Michigan, USA
Posts: 116
Thanks: 1
Thanked 0 times in 0 posts
Default

With unmanged order submission, what is the best way to modify an existing order? Say I want to change the limit price of an existing limit order.

Thanks.
hemlock is offline  
Old 10-21-2009, 06:55 AM   #3
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Please try the .ChangeOrder() method.
NinjaTrader_Dierk is offline  
Old 10-21-2009, 06:59 AM   #4
hemlock
Senior Member
 
Join Date: Nov 2007
Location: Michigan, USA
Posts: 116
Thanks: 1
Thanked 0 times in 0 posts
Default

Ah, that makes sense. I looked for a ModifyOrder (that's what I call it in my code), never thought to look for ChangeOrder. Thanks Dierk.
hemlock is offline  
Old 10-21-2009, 07:36 AM   #5
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

Just another pointer, the familiar CancelOrder() method is also used for Unmanaged since unmanaged orders will not auto cancel/expire and will need to be done by your code when desired.
NinjaTrader_Josh is offline  
Old 10-21-2009, 08:43 AM   #6
hemlock
Senior Member
 
Join Date: Nov 2007
Location: Michigan, USA
Posts: 116
Thanks: 1
Thanked 0 times in 0 posts
Default

Thanks for the pointer Josh.

The unmanaged order submission methods (SubmitOrder() and ChangeOrder()) seem to working nicely. Good job.

Also, thanks for removing the popup dialog at the end of a compile. Greatly appreciated.
hemlock is offline  
Old 10-22-2009, 02:39 PM   #7
trend
Senior Member
 
Join Date: Jan 2009
Posts: 221
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi is there any special overload on SubmitOrder() for Market Orders?
So that you don't have to post anything for Limit/Stop Prices and "OCO"

L0=SubmitOrder(
0,OrderAction.Buy,OrderType.Market,1,100000,0,"OCO", "L0");

thanks,
trend is offline  
Old 10-22-2009, 02:47 PM   #8
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Quote:
Originally Posted by trend View Post
Hi is there any special overload on SubmitOrder() for Market Orders?
So that you don't have to post anything for Limit/Stop Prices and "OCO"

L0=SubmitOrder(
0,OrderAction.Buy,OrderType.Market,1,100000,0,"OCO", "L0");

thanks,
No, any value put in I believe is just ignored. Just pass in zero's and empty string for OCO.
NinjaTrader_Ray is offline  
Old 10-24-2009, 11:23 PM   #9
Chris_M
Junior Member
 
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default

"Unmanaged = true" gives an error in initialize. What is the correct spelling?

Regards,
Chris

Quote:
Originally Posted by NinjaTrader_Ray View Post
Hi All,

As of this post, we have yet to document the new unmanaged order handling in strategies.

This is a quick pointer.

- In Initialize() set "Unmanaged" to a value of "True"
- This will disable all internal order handling rules
- You now "can and must" place orders using the new SubmitOrder() method, all other order entry methods will be ignored
Chris_M is offline  
Old 10-25-2009, 03:16 AM   #10
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

It always helps saving time you and us if you provided error description as exact (!) as possible. Not sure what you mean by "gives an error". Compile error? Runtime error? else?

Anyway: I added this line of a code to a blank strategy compiled it and enabled it on a chart. Worked no problem. No compile nor runtime error.

Code:
Unmanaged = true;
NinjaTrader_Dierk is offline  
Old 10-25-2009, 05:29 AM   #11
Chris_M
Junior Member
 
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default

I'm receiving compile error CS0103 (Unmanaged unknown), when I call it in the Initialize()-method. Do I have to manually add an include? Mine are
Code:
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
Many thanks for your help,
Christian

Edit: Oh, I see this is the bug report thread for version 7, but I'm using 6.5.1000.14. Is it possible to use unmanaged code with this version?


Quote:
Originally Posted by NinjaTrader_Dierk View Post
It always helps saving time you and us if you provided error description as exact (!) as possible. Not sure what you mean by "gives an error". Compile error? Runtime error? else?

Anyway: I added this line of a code to a blank strategy compiled it and enabled it on a chart. Worked no problem. No compile nor runtime error.

Code:
Unmanaged = true;
Last edited by Chris_M; 10-25-2009 at 05:43 AM.
Chris_M is offline  
Old 10-25-2009, 08:25 AM   #12
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

>> possible to use unmanaged code with this version?
No
NinjaTrader_Dierk is offline  
Old 10-25-2009, 07:59 PM   #13
Aussie2
Member
 
Join Date: Oct 2007
Location: Sydney
Posts: 78
Thanks: 0
Thanked 0 times in 0 posts
Default Unmanaged orders query

Quote:
Originally Posted by NinjaTrader_Ray View Post
Hi All,

As of this post, we have yet to document the new unmanaged order handling in strategies.

This is a quick pointer.

- In Initialize() set "Unmanaged" to a value of "True"
- This will disable all internal order handling rules
- You now "can and must" place orders using the new SubmitOrder() method, all other order entry methods will be ignored
Please advise with NT7B2 when Unmanaged=true and therfore internal order handling rules are disabled, whether the SetStopLoss() method is also disabled.

Thanks.
Aussie2 is offline  
Old 10-25-2009, 11:44 PM   #14
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

The SetStopLoss/SetTrailStop/SetProfitTarget methods won't work when your strategy is in Unmanaged=true mode.
NinjaTrader_Dierk is offline  
Old 10-26-2009, 05:37 AM   #15
Aussie2
Member
 
Join Date: Oct 2007
Location: Sydney
Posts: 78
Thanks: 0
Thanked 0 times in 0 posts
Default Unmanaged=false mode

Quote:
Originally Posted by NinjaTrader_Dierk View Post
The SetStopLoss/SetTrailStop/SetProfitTarget methods won't work when your strategy is in Unmanaged=true mode.
Thanks for this Dierk,

Would you also confirm about the converse in NT7B2 . Namely will SubmitOrder() or ChangeOrder()work when in the Unmanaged=false mode?
Last edited by Aussie2; 10-26-2009 at 05:52 AM.
Aussie2 is offline  
 

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
oco order submission thru oif Mindset ATM Strategies (Discretionary Trading) 13 09-29-2009 09:17 AM
NT7: New Unmanaged Order Submission BillCh Suggestions And Feedback 1 06-26-2009 08:30 AM
stop and target order submission mdm72 Strategy Development 3 02-26-2009 07:08 AM
Require market data for order submission / Why? BCA Connecting 33 02-25-2009 09:29 AM
Order submission error in NT6b6 nip Automated Trading 2 02-11-2007 09:13 AM


All times are GMT -6. The time now is 05:08 AM.