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 > Strategy Development

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

Reply
 
Thread Tools Display Modes
Old 03-18-2011, 09:15 AM   #1
seeker579
Junior Member
 
Join Date: Mar 2011
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
Default General question about use of order entry/exit and SetStopLoss/SetTrailStop

Let me start by explaining what I am trying to do and then how I believe I can implement it. My strategy places an entry order at a given point. After market entry, I want to place a fixed stop loss order. If the market moves in my direction (say 10 ticks), I would like to change my fixed stop loss order to a trailing stop order. I would like to use the SetStopLoss() and SetTrailStop() methods, but as I read the documentation this cannot be done: “The SetStopLoss() method can NOT be used concurrently with the SetTrailStop() method for the same position, if both methods are called for the same position (fromEntrySignal) the SetStopLoss() will always take precedence. You can however, use both methods in the same strategy if they reference different signal names.” I do not want to use them concurrently, I would like to cancel the SetStopLoss() order and replace it will the SetTrailStop() orders. I believe that my only option is to let the strategy handle the needed orders. That is, place a fixed stop order that gets cancelled when the market condition calls for the SetTrailStop() method. Am I correct, or is there a better way?
seeker579 is offline  
Reply With Quote
Old 03-18-2011, 09:24 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
Default

Welcome to our forums here - what you intend to do is part of a reference sample we have published here -

http://www.ninjatrader.com/support/f...ead.php?t=3222
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 03-18-2011, 12:04 PM   #3
seeker579
Junior Member
 
Join Date: Mar 2011
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Bertrand. This makes it clear how to use the SetStopLoss() method.
seeker579 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
setstoploss - settrailstop tonynt Strategy Development 16 07-29-2011 01:02 PM
setStopLoss / setTrailStop andreneoh General Programming 5 11-05-2010 07:04 AM
SetStopLoss and SetTrailStop simulate together ariliveitup Strategy Development 1 03-11-2010 05:11 AM
How to SetStopLoss and SetTrailStop cassb Strategy Development 14 08-03-2008 09:19 PM
SetTrailStop & SetStopLoss question woodside Strategy Development 1 11-06-2007 03:41 PM


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