![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Member
Join Date: Dec 2008
Location: Kansas City
Posts: 90
Thanks: 0
Thanked 2 times in 2 posts
|
Upon entering a long position, I set an ExitLongStop order through the OnExecution method. Once a certain profit level is reached, I am trying to modify that ExitLongStop order (basically my own trailing stop logic).
When I reach that profit level I send another ExitLongStop command with a new Entry Signal, i.e. Original Stop Order (placed in OnExecution): StopOrder1 = ExitLongStop(1, true, execution.Order.Filled, Position.AvgPrice - StopTarget1, "Original Stop Loss", "Buy"); After profit level reached, modify stop order (placed through OnBarUpdate): StopOrder1 = ExitLongStop(1,true,StopOrder1.Quantity, Position.AvgPrice, "Breakeven", "Buy"); I'm using a new 'string signalName' for the same 'StopOrder1'. This is creating an additional ExitLongStop order leaving the "Original Stop Loss" order still in tact (and then 2 stop loss orders outstanding for the same position). I would think since I said 'StopOrder1' again, it would have just modified the stop order, not create a new one (Like SetStopLoss works). Do I have to manually cancel the 1st ExitLongStop order when I send the second ExitLongStop order statement, or is there a way to modify the 1st order while changing the signalName so I can visually see the stop was adjusted? Thanks, kc
Last edited by kcsystemtrader; 03-15-2009 at 01:12 PM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Hi kc, this should be possible by simply using the same signal names as in your first stop order, then you would modify the already placed one.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Member
Join Date: Dec 2008
Location: Kansas City
Posts: 90
Thanks: 0
Thanked 2 times in 2 posts
|
Quote:
kc |
|
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Glad you got this resolved.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to modify an order from a strategy? | maxpi | Strategy Development | 8 | 07-14-2010 07:32 AM |
| ExitLongStop and ExitShortStop instead of SetStopLoss | stefy | Strategy Development | 1 | 12-17-2008 12:25 PM |
| Bug in TIF Day ExitLongStop Orders | heech | Strategy Development | 8 | 12-10-2008 10:51 AM |
| ExitLongStop not executed! | sammano | Strategy Development | 5 | 11-23-2008 01:08 PM |
| ExitLongStop, ExitLongLimit and OCO | bigtrade5 | Strategy Development | 27 | 05-16-2008 04:58 AM |