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-04-2008, 06:49 PM   #1
mike4398
Junior Member
 
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default order dont get submitted

protected override void OnBarUpdate()
{

IOrder orderBuy=null;
IOrder orderSell= null;

orderBuy = EnterLongStopLimit(Qty, 1, 1, "buy s1");
orderSell = EnterShortStopLimit(Qty, 1, 1, "sell s1");

}

the orderSell will not be submitted.
Last edited by mike4398; 03-05-2008 at 04:54 AM.
mike4398 is offline  
Reply With Quote
Old 03-04-2008, 09:59 PM   #2
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

That is correct. You can not have 2 entry order at both sides of the market at the same time.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 03-05-2008, 04:19 AM   #3
mike4398
Junior Member
 
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default

it doesn't give me any error messages, I have tried to use the limit orders instead and get incorrect results also.

How do I realize this:

if the price goes up (to price1) I want long position triggered,
if down (to price2) then enter a short position.

the best way to achieve this is to place two orders in opposite directions since we dont know where the price is going to (the next bar)

this is a standard situation and supported by most of the software and you say I cannot do that in NT? (!)

If you go to Elitetrader, software section, all the software that I know does that. I feel the customers should be aware about this limitation.
I looked up the help file and it doesn't say anything about this.

When it should generate the error I guess instead of the weird results like execution outside high-low range I get yesterday.
Last edited by mike4398; 03-05-2008 at 04:50 AM.
mike4398 is offline  
Reply With Quote
Old 03-05-2008, 04:42 AM   #4
mike4398
Junior Member
 
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default

FYI, this is a second limitation of NT which I encountered while doing a simple test strategy, the first was that you cannot have multiple orders at the SAME direction and targetprofits working correctly!!!

Do the multiple orders at the same direction "throw off internal logic of a strategy" as well?

So for example if you have SetprofitTarget 100 ticks and more than one order at the same direction the results will be incorrect.

It doesnt give you error messages as well and it takes lots of time to figure out what the NT gives you completely wrong results.

I think the order handling engine needs some serious development.
mike4398 is offline  
Reply With Quote
Old 03-05-2008, 06:23 AM   #5
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

You will see how NT internal order logic works as you turn TraceOrders on: http://www.ninjatrader-support.com/H...aceOrders.html

You always should should test your strategy to understand how the logic works. TraceOrders help you understanding the order details.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 03-05-2008, 08:13 AM   #6
mike4398
Junior Member
 
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
You will see how NT internal order logic works as you turn TraceOrders on: http://www.ninjatrader-support.com/HelpGuideV6/TraceOrders.html

You always should should test your strategy to understand how the logic works. TraceOrders help you understanding the order details.
Thats that I 've been doing, however you can spot only some discrepancies like negative profit with ProfitTarget exit.

If the NT does not allow to have opposite orders, why would it take them without errors? The same for profit targets, any profit target exit with negative profit should generate at least some alert.

It would be nice to have the alert (or assertion) when the code works not as expected because of "it's internal logic".

If the program in computer have error it terminates, the strategy should do the same, just my opinion.

I would prefer the strategy terminate itself other than running with errors.
Last edited by mike4398; 03-05-2008 at 08:20 AM.
mike4398 is offline  
Reply With Quote
Old 03-05-2008, 08:19 AM   #7
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

Thanks for your suggestion. We'll add it to the list of future considerations.
NinjaTrader_Dierk 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
patsystems dont show historical! Agamenon Connecting 2 01-08-2008 11:22 AM
Stop order submitted when employ strategy maxpi Strategy Development 7 12-11-2007 08:19 AM
News dont lay out correctly ofurbaldur Miscellaneous Support 4 08-16-2007 01:27 AM
Eurx charts dont' update until disconnect/reconnect Futures_Shark Charting 3 07-03-2007 03:21 PM
Orders submitted johncool Miscellaneous Support 1 01-19-2005 02:50 AM


All times are GMT -6. The time now is 11:36 AM.