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 > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 05-28-2007, 11:39 AM   #1
oriondesign
Junior Member
 
Join Date: May 2007
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default Need help automating trailing stop strategy

I have had success using the trailing stop system in the DOM, where you can set an initial stop loss value, and then set a trailing stop to "kick in" when a certain profit target is reached (allowing you to tighten and then trail your stop).

I can't seem to figure out how to duplicate this in NinjaScript. The SetTrailStop() command only allows me to set a trailing value, not a target at which this will kick in.

How can I create, for example, the following:

Trading ES
Initial stop loss: 8 ticks
After profit target of 5 ticks achieved, tighten and trail stop by 3 ticks

Any help would be appreciated. Thanks!
oriondesign is offline  
Reply With Quote
Old 05-28-2007, 01:50 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

The SetTrailStop() method does not allow for this.

You would have to program your own logic to do this by monitoring the PnL and once you have hit 5 ticks in profit, modify the price of your stop loss order.

You would need to use the method ExitLongStop() or ExitShortStop().
NinjaTrader_Ray 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
Switching from stop to trailing MrBaffalo Strategy Development 1 02-02-2007 03:33 AM
Can't get trailing stop Savage1701 Automated Trading 1 04-07-2006 08:03 AM
help with trailing stop feature dave898 ATM Strategies (Discretionary Trading) 2 03-29-2006 10:17 AM
Widening Trailing Stop JohnnyB Miscellaneous Support 2 06-29-2005 01:07 AM
Trailing Stop Question underground Miscellaneous Support 3 06-06-2005 07:11 AM


All times are GMT -6. The time now is 10:03 AM.