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 05-20-2009, 12:03 AM   #1
azuul
Member
 
Join Date: Mar 2009
Posts: 68
Thanks: 0
Thanked 0 times in 0 posts
Default buy limit /sell limit order at the same time possible?

Hi

I am trying to figure out wether it is possible to have a buy limit and sell limit order at the same time within an automated strategy? (similar to superDOM)

I tried with enter long/short position by limit order - but somehow I get only fills on one side (bid OR ask - depending what i put first in my script)- the other side seems to be ignored.
Maybe I have some logic errors in my code?

A workaround could be to have a second strategy with different name running the same time doing the other "direction" , but this seems rather inconvenient.

I do not want a strategy that does only react after things happened, but before things happen! (means I need to have orders in the market before a certain event is going to happen) This is a VERY important feature in my opionion!

Is that possible with NT automated strategies?

greetings Steve
azuul is offline  
Reply With Quote
Old 05-20-2009, 05:42 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
Default

Hi steve, thanks for your post - with this you would run into the 'Internal Order Handling Rules' as outlined in the bottom section of this link - http://www.ninjatrader-support.com/H...verview36.html

To track ignored orders the TraceOrders features is helpful - http://www.ninjatrader-support.com/H...aceOrders.html

Please also check into this tip here - http://www.ninjatrader-support2.com/...ead.php?t=3627

A workaround would be to monitor the last price and only send one order as the breakout / fade occurs.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 05-20-2009, 06:41 AM   #3
azuul
Member
 
Join Date: Mar 2009
Posts: 68
Thanks: 0
Thanked 0 times in 0 posts
Default

Bertrand, thank you for your reply -

the workaround you suggest does not really help, since you would miss the really interesting part of the action.
(consider stops, or wild market orders sent in the market that cause only one short up or downburst in the price - if you cannot "wait" on the bid and ask side for it... you miss it!) - and entering "after" those things happen does not make sense.

Methods that generate orders (excluding market orders) to enter a position will be ignored if:
  • A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction
That rule means for example : you are long, have a sell limit order in the market in case someone buys a larger amount and your limit is reached - but you cannot enter a buy order to "improve" your average price - or to catch some expected stops below a certain price?
If the stops happen - its too late already, since NT will only enter after the stops are gone and the price is up again at the "right" lvl.

The Superdom lets you do exactly what the Internal Order handling for automated strategies is trying to prevent?
Is this "protection" not rather a limitation? I feel one should have the choice wether to use or not use these "protective" rules.
azuul is offline  
Reply With Quote
Old 05-20-2009, 07:42 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
Default

Steve, not sure I follow - in your example you could issue an additional buy order to improve the average price of your long position, but you can't issue an order in the opposite direction (market orders excluded) while an Exit() method is working. Those 'internal order handling rules' are in place to prevent unwanted positions from overfills or inflight executions - http://www.ninjatrader-support.com/H...njaTrader.html

Changes to this approach are already on our list for future consideration.
NinjaTrader_Bertrand 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
Entering Buy/Sell Limit orders before Market opens scjohn SuperDOM and other Order Entry Windows 1 01-22-2009 08:56 AM
buy stop limit and sell stop limit avalanche800 ATM Strategies (Discretionary Trading) 1 09-12-2008 06:24 AM
Submitting a Buy Limit at the same time as Sell Limit (Problem) vjsworld Strategy Development 2 08-26-2008 03:09 PM
Turn off prompt to confirm 'buy/sell stop limit' orders.. newbouldm Miscellaneous Support 2 01-16-2008 03:52 PM
Placing resting limit BUY & SELL orders on the DOM Nelson1980 Miscellaneous Support 2 06-02-2006 12:06 AM


All times are GMT -6. The time now is 02:44 PM.