![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Oct 2008
Posts: 54
Thanks: 0
Thanked 0 times in 0 posts
|
Suppose I wanted to define a TARGET on a long trade activated by CONDITION A and a different target if the long trade was activated by CONDITION B.
How do I differentiate which target (or stop) to have NJ use? |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
|
Hi CRCatNinja, you would then simply adjust your Stop / Target values depending on which entry condition got you into the trade. Here's the link to a reference sample explaining how to achieve this - http://www.ninjatrader-support2.com/...ead.php?t=3222
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Oct 2007
Location: Southy Florida
Posts: 263
Thanks: 16
Thanked 1 time in 1 post
|
Can you set up different profit targets like this?
SetProfitTarget("Long 1a", CalculationMode.Ticks, 10); SetProfitTarget("Long 1b", CalculationMode.Ticks, 20); |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
|
Hi edgeliner, yes this should work.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Oct 2008
Posts: 54
Thanks: 0
Thanked 0 times in 0 posts
|
Thank you all!!!
|
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Oct 2007
Location: Southy Florida
Posts: 263
Thanks: 16
Thanked 1 time in 1 post
|
Is there a correct way to code the following?
if ((Position.MarketPosition > Position.AvgPrice + 5 * TickSize) Then "Do something" Thanks! |
|
|
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
|
Hi, not sure what you are trying to code - Position.MarketPosition will return Long, Short or Flat depending on the current positioning - http://www.ninjatrader-support.com/H...tPosition.html
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Submitting stoploss order how to set parameter Stops&Targetsubmission | clint2008 | ATM Strategies (Discretionary Trading) | 5 | 01-20-2009 07:13 AM |
| 'Stops & Targets' missing from the Condition Builder? | Elliott Wave | Strategy Development | 3 | 06-15-2008 07:44 PM |
| Setting stops and Target orders | trader333 | ATM Strategies (Discretionary Trading) | 1 | 08-29-2007 07:37 AM |
| Using NTOrderStatus for Stops/Target | MrMilesIL | Automated Trading | 18 | 05-29-2006 12:46 PM |
| Adjusting targets & stops | Zardoz | Automated Trading | 5 | 04-24-2006 12:06 PM |