PDA

View Full Version : SetProfitTarget("", CalculationMode.Ticks, Tp_ticks);


duck_CA
02-18-2009, 01:33 PM
how could i use a profit target of ?
SMA(18)[0];

NinjaTrader_Josh
02-19-2009, 07:09 AM
duck_CA,

You would have to place such a profit target inside OnBarUpdate().

SetProfitTarget("", CalculationMode.Price, SMA(18)[0]);

duck_CA
02-19-2009, 12:24 PM
i am trying to set the exit of position to SMA(18)[0] which is neither a profit target or stop loss...just a hard rule

NinjaTrader_Josh
02-19-2009, 02:26 PM
Please use ExitLongLimit(SMA(18)[0]) instead then.

duck_CA
02-19-2009, 02:59 PM
trying to add a 20tick stop or exit when trade goes against

NinjaTrader_Josh
02-20-2009, 07:11 AM
With CalculateOnBarClose = false
if (Close[0] <= Position.AvgPrice - 20 * TickSize)
{
ExitLong();
}