![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Nov 2006
Location: Ferrara, , Italy
Posts: 138
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|