NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 04-06-2010, 11:58 AM   #1
joanNT
Senior Member
 
Join Date: Feb 2010
Posts: 128
Thanks: 0
Thanked 0 times in 0 posts
Default Two orders stop Long & Short together

Please,

If i need to get a trade at a breakout (if price touch a Max or a Min) can I send both stop orders at the same bar?

EnterLongStop for Max

and

EnterShortStop for min

What will happen? I mean, both orders will be alive until price touches one, or not? Do I must to cancel one it's not touched?....

I did a search but I didn't find anything similar, but I'm sure there are examples of this kind of trading...

Thanks a lot
joanNT is offline  
Reply With Quote
Old 04-06-2010, 12:53 PM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

joanNT, with default order handling on (not the new NT7 unmanaged approach) you would run into 'ignored' orders due the 'under the hood' order handling rules -

http://www.ninjatrader-support.com/H...verview36.html (bottom section here)

Best is to work with TraceOrders = true in the Initialize() and then open the output window as you work on / debug the strategy.

You would need to monitor price and only send one needed order then while canceling the unneeded leg of the bracket.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 04-07-2010, 03:19 AM   #3
joanNT
Senior Member
 
Join Date: Feb 2010
Posts: 128
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Bertrand,

with the new unmanaged orders in NT7, can I send a cancel order "CancelOrder(IOrder order)" and an entry opposite stop order simultaneously?

I mean If I've an:

long = EnterLongStop(1, true, DefaultQuantity, max_range, "TryUp");

then at next barupdate:

CancelOrder(long);
short = EnterShortStop(1, true, DefaultQuantity, min_range, "TryDown");

I must say that if I send the cancel order, price will be far enough not to permit a previous filling order.

is this possible? or it can't be simultaneously and I must cancel first and when agreed send the short stop order.

Thanks again.
joanNT is offline  
Reply With Quote
Old 04-07-2010, 05:03 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

joanNT, with the new unmanaged approach you could place the full entry bracket (long and short simultaneous) and then cancel as needed, reason being there're no order handling rules anymore preventing you placing the orders in this scenario. As this is unmanaged you would need to keep track of IOrder references yourself to access those later.
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
Long and Short ZendoZafu SuperDOM and other Order Entry Windows 1 07-10-2009 08:38 AM
short/long stop limits dave1992 Miscellaneous Support 1 05-26-2009 06:05 AM
Long & Short murfinp Strategy Development 1 05-13-2009 08:56 AM
Long & Short Stop Order PHOLAN Automated Trading 3 09-23-2008 08:18 AM
Long & short combined in 1 strategy dtf139 Automated Trading 5 01-08-2008 08:23 PM


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