![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM 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: Mar 2008
Posts: 205
Thanks: 0
Thanked 1 time in 1 post
|
Hi all. My strategy is working well only last night I realized a glitch in my setup. I have two ways to exit a trade- the first is a 16 tick stop loss and then if price crosses a MA it exits the position. The idea is that often when a trade opportunity arises it is close to the MA exit line. I watched the trade progress and it stopped out at 9 ticks when it crossed the MA but would have gone on to be a highly profitable trade if it had kept the 16 tick stop loss.
Is there a way of setting it so that the MA exit is not triggered to exit in the initial stages? Thanks raycam |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
raycam, I think you can work with the 'Unrealized (Open) PnL' for this, just use the MA trail only when profit is higher than amount X
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Mar 2008
Posts: 205
Thanks: 0
Thanked 1 time in 1 post
|
Thanks mate- I will give it a go!
raycam |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Mar 2008
Posts: 205
Thanks: 0
Thanked 1 time in 1 post
|
Having trouble with this.
In my set 3 of conditions and actions I have the following... "Position.MarketPosition==MarketPosition.Short CrossAbove(Close,SMA(32),1)" When I click add and select "Unrealized PnL" Currency >= Numeric value of 100 I end up with this... "Position.GetProfitLoss(Close(0), PerformanceUnitCurrency)>=100" Is that how it is supposed to look so that when a trade is entered it will rely on my set stop loss until profitable to $100- at which point the SMA comes into play. Hope this makes sense. My head spins when I venture away from the wizard. And even in the wizard things are blurry. THX raycam |
|
|
|
|
|
#5 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
That is the correct listing for Unrealized PnL.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Going from a Stop Loss to a Trailing Stop within a strategy | Sidhartha | Strategy Development | 28 | 03-24-2009 03:11 PM |
| Stop loss with Strategy Wizard | ptolar | Strategy Development | 2 | 01-13-2009 10:32 AM |
| Strategy stop loss | junkone | Strategy Development | 6 | 12-11-2008 10:32 AM |
| Stop loss strategy question | alanack | General Programming | 5 | 04-25-2008 09:55 AM |
| Strategy Cancels Stop Loss when Exiting??? | wayneFH | Strategy Development | 5 | 04-07-2008 10:03 AM |