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 08-21-2010, 03:40 AM   #1
Baruch
Senior Member
 
Join Date: Mar 2009
Posts: 440
Thanks: 0
Thanked 24 times in 15 posts
Default Problem with ExitStop order

Hello to NT support,
I work in NT6.5. I work allot with Exit orders, but now I encountered a problem.
My strategy runs on 15 Min chart with 1 Min granularity. When I enter a position (lets say Long) I issue a stop loss order:
stopOrder = ExitLongStop(1, true, EnteredQuantity, SLPrice, "Stop", EntryName);

After some time if target or stop were not hit I change the stop to trailing stop. I have 3 variants. Two work but the one I need doesn't.
1. stopOrder = ExitLongStop(1, true, EnteredQuantity, PTPrice, "Stop", EntryName);
This works.
2. stopOrder = ExitLongStop(1, true, EnteredQuantity, PTPrice, "TStop", EntryName);
This doesn't work. In debugger I see that this order is in working state, but then the strategy executes the initial stop order and cancels this order. I noticed that the new ("TStop") order got new token.
3. stopOrder = ExitLongStop(PTPrice, "TStop", EntryName); Works!

Whats the problem?

Regards,
Baruch

p.s.
I have TraceOrder = true. I don't see anything in trace file. The log is also clean.
Baruch is offline  
Reply With Quote
Old 08-21-2010, 10:58 AM   #2
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

Baruch, if you are trying to switch from a regular stop to a trailing stop, please try canceling the regular stop order and then submitting a new IOrder object for the trailing stop.
NinjaTrader_Austin 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
Stop order problem maninjapan General Programming 6 10-19-2009 09:33 AM
Same order is getting fired twice. order state and handling problem Rocket130713 Automated Trading 19 09-22-2008 06:58 AM
limit order problem inaamalvi General Programming 3 06-03-2008 11:58 AM
order entry problem miked11 Charting 3 05-19-2008 08:32 AM
Order Entry Problem Mike Winfrey Strategy Development 7 12-09-2007 06:31 PM


All times are GMT -6. The time now is 08:46 PM.