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-21-2011, 03:59 PM   #1
greed999
Member
 
Join Date: Jun 2011
Posts: 42
Thanks: 24
Thanked 0 times in 0 posts
Default Orders do not obey orders :)

Code:
...
#region Variables
// Wizard generated variables
...
private IOrder entryOrder1 = null;
private IOrder entryOrder2 = null;
private IOrder entryOrder3 = null;
...
protected override void OnBarUpdate()
{
entryOrder1=EnterLong(1);
entryOrder2=EnterLong(1);
entryOrder3=EnterLong(1);
...
Print (Position.Quantity);
}

And at the end we have one opened position and Position.Quantity returns 1...

Have I missed something?
greed999 is offline  
Reply With Quote
Old 06-21-2011, 04:14 PM   #2
koganam
Senior Member
 
Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,218
Thanks: 24
Thanked 1,231 times in 1,002 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by greed999 View Post
Code:
...
#region Variables
// Wizard generated variables
...
private IOrder entryOrder1 = null;
private IOrder entryOrder2 = null;
private IOrder entryOrder3 = null;
...
protected override void OnBarUpdate()
{
entryOrder1=EnterLong(1);
entryOrder2=EnterLong(1);
entryOrder3=EnterLong(1);
...
Print (Position.Quantity);
}

And at the end we have one opened position and Position.Quantity returns 1...

Have I missed something?
You will need to specify EntriesPerDirection, which it seems defaults to "1".

ref; http://www.ninjatrader.com/support/h...rdirection.htm
koganam is offline  
Reply With Quote
The following 2 users say thank you to koganam for this post:
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
Why cannot reverse Entry orders execute on the same bar as exit orders? koganam Miscellaneous Support 10 04-11-2011 02:48 PM
Unmanaged Sell Limit orders not appearing in Orders window AlgoNaute Automated Trading 9 04-05-2011 06:53 AM
Holding orders in strategy somehow when waiting for fills & cancels (managed orders) adamus General Programming 5 10-12-2010 05:02 AM
Control Panel Orders shows no Order when an Orders must have occurred? mtthwbrnd Strategy Analyzer 4 02-10-2010 09:10 AM
Limit orders - book position kept when new orders are generated Fabrice Automated Trading 6 10-13-2007 03:16 PM


All times are GMT -6. The time now is 12:45 PM.