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 02-02-2007, 03:27 AM   #1
MrBaffalo
Senior Member
 
Join Date: Nov 2006
Location: Ferrara, , Italy
Posts: 138
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Hi Guys,

Happy friday I'm looking at order management and I would like to code something useful to switch an order from stop order to trailing, any suggestion about it?



Thanks in advance

Marce
MrBaffalo is offline  
Reply With Quote
Old 02-02-2007, 03:33 AM   #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
Post imported post

You can't switch between SetStopLoss() and SetTrailingStop() but you could simulate your trailing stop using the SetStopLoss() method.

See the following post for code sample of how to dynamically change the price within OnBarUpdate() of the SetStopLoss() method.

http://ninjatrader.mywowbb.com/forum20/1521.html

Let me know if this does not make sense.

Ray
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


All times are GMT -6. The time now is 11:09 PM.