![]() |
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 |
|
Junior Member
Join Date: Mar 2010
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
|
I have visited the Advanced Order Handling section and I understand that SetStopLoss and SetTrailStop cannot be used concurrently for the same position, however I was wondering if there is workaround.
http://www.ninjatrader-support.com/H...dOrderHandling This is what I am looking to do: /***** Pseudocode below *** double profitTarget = 8; // Ticks double stopLoss = 8 // Ticks Lets say I buy S&P Eminis for a 1000 I would like to immediately put out a stopOrder for 1000 - 8 ticks = 998 I believe I can do this in OnExecution( ) SetStopLoss However when my PNL = 1000 + (profitTarget )8 ticks = 1002, I would want to cancel the StopLoss Order and generate a Trailing Stop Loss (trailing stop loss order by 8 ticks) I do not want to start trailing right away because, the i want to allow 8 ticks of downside in the beginning and only after the simulated profit target is reached, I want to start trailing. Given the fact that there are no references returned for stoploss orders, how do i cancel the stop loss order and send a trailing |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
|
ariliveitup, welcome to our forums - I would suggest you check into this sample below, as it deals with setting a static initial stop loss and then adjusting the set stop to provided the trailing functionality, all with using SetStopLoss only -
http://www.ninjatrader-support2.com/...ead.php?t=3222
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simulate Partial fill ... with ease. | ltemme | Automated Trading | 4 | 08-16-2008 10:04 AM |
| How to SetStopLoss and SetTrailStop | cassb | Strategy Development | 14 | 08-03-2008 09:19 PM |
| SetStopLoss() & SetTrailStop() Concurrent Use | whitmark | Strategy Development | 8 | 11-14-2007 09:05 AM |
| SetTrailStop & SetStopLoss question | woodside | Strategy Development | 1 | 11-06-2007 03:41 PM |
| simulate stock trade | sunnyrain | ATM Strategies (Discretionary Trading) | 5 | 10-11-2007 12:12 PM |