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 > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 03-27-2009, 08:19 AM   #1
j2009
Junior Member
 
Join Date: Mar 2009
Posts: 1
Thanks: 0
Thanked 0 times in 0 posts
Default two limite orders at one time

Hi, I tried to enter two limit ordres at the same time (see code below) - it seems that only the first one get executed... if the "sell high" is the first, I see all short orders in the result. If I move "buy low" before "sell high" in the code below, I will get a bunch of long orders and nothing for short.

Can I have both? Does one cancel the other?

Thanks very much !

-J

if (....)
{

//when it reach yesterday's high, sell short limit
orderShort = EnterShortLimit(0,
true, DefaultQuantity, priceHigh, "SellHigh");
//when it reaches yesterday's low, buy long limit
orderLong = EnterLongLimit(0,
true, DefaultQuantity, priceLow, "BuyLow");
}
j2009 is offline  
Reply With Quote
Old 03-27-2009, 08:33 AM   #2
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

j2009,

You cannot have orders in opposite directions both working simultaneously.
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
Multi-time frame orders heech Automated Trading 1 11-19-2008 04:53 PM
Time Not Showing in Orders Tab TapeReader Miscellaneous Support 1 09-24-2008 09:09 AM
Limit Orders Pile Up In Real Time JOHN FORTUNE Automated Trading 5 06-26-2008 03:06 PM
Market at time orders ddunne82 Miscellaneous Support 3 04-05-2005 06:02 AM
Entering orders based on time mtrader ATM Strategies (Discretionary Trading) 0 03-28-2005 01:23 AM


All times are GMT -6. The time now is 04:23 PM.