![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Apr 2009
Posts: 27
Thanks: 0
Thanked 0 times in 0 posts
|
I am working on code in which I enter the market all-in and exit the market by scaling out. I have reviewed previous posts and have incorporated entering with multiple order each using a unique id. I also use SetProfitTarget and SetStopLoss to manage the exits. Works fine.
I am looking for a way to determine when my first target is reached via SetProfitTarget (1st lot id) and then move my stop for the second lot dynamically based on other indicators (not just a trailing stop using ticks). I have also reviewed OnExecution() but cannot find a way. I could add code that checks the current price against the 1st lot target but I was hoping for a more accurate/less cumbersome method. Are there methods or properties exposed to handle this? Thanks |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Yes, you would have to work with IOrder objects to track when your first target reports filled - http://www.ninjatrader-support.com/H...V6/IOrder.html
You can also review this sample for more details - http://www.ninjatrader-support2.com/...ead.php?t=7499
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Auto Posting of Trades to mIRC | pinebilly | Suggestions And Feedback | 2 | 04-13-2009 02:05 PM |
| Detecting double entry... | ninjaq | Strategy Development | 1 | 04-06-2009 04:33 PM |
| detecting backtest or real time simulation | dave1992 | Strategy Analyzer | 9 | 11-22-2008 06:09 AM |
| How to call an ATM when detecting signals ? | jed77 | Strategy Development | 2 | 03-28-2008 01:23 AM |
| mIRC trade posting with Ninja | guy | Miscellaneous Support | 7 | 10-11-2005 01:36 PM |