View Full Version : dollar profit target
rally7
10-10-2007, 06:28 AM
Hi,
I am interested in using specific dollar targets for exiting trades. Is there a way to link the PnL with a exit strategy? For example, lets say I am short 5 ES and my PnL reaches $500.00. NT would then send a close position order. Is this possible?
Thank you
NinjaTrader_Ray
10-10-2007, 07:01 AM
Yes this is possible, you would need to monitor Position.GetProfitLoss() (http://www.ninjatrader-support.com/HelpGuideV6/GetProfitLoss.html) and then send a market order to exit.
jlm0@infionline.net
10-30-2007, 09:13 AM
I would like to know how to do this too.
Could code be shown please?
NinjaTrader_Ray
10-30-2007, 09:38 AM
You could try something like:
if (Position.MarketPosition == MarketPosition.Long && Position.GetProfitLoss(Close[0], PerformanceUnit.Currency) > 500)
ExitLong();
jlm0@infionline.net
10-30-2007, 09:47 AM
Thanks Ray,
Looks good to me.
Jim
jlm0@infionline.net
10-31-2007, 11:03 AM
Is there any way fpr this to be based on Realized P&L for a given time period, and not the Unrealized P&L?
Thanks,
Jim
NinjaTrader_Ray
10-31-2007, 11:45 AM
Not currently. NT 6.5 will have some more features related to strategy performance.