I'm trying to write a Strategy using Managed entries and exist. I'm able to successfully enter the market, set an initial stop, and then modify the stop when a certain number of ticks is hit. However, when I try to establish three discrete limit orders as profit targets for the various contracts in the entry order, NinjaTrader ignores them. In the Strategy Performance window, there is no record of any of these limit orders being established. I didn't think I needed to create a discrete entry for each quantity of contracts I'm managing. Is that correct? Below, please find the offending code.
Thanks!
protected override void OnBarUpdate()
{
if( BarsInProgress == 0 )
{
// A sell is indicated
EnterShort( 0, 5, "JamboStrategy Short Entry");
if( IsFirstTickOfBar &&
Position.MarketPosition == MarketPosition.Flat &&
ind.JamboIndicatorUp.IsValidDataPoint(0) )
{
EnterLong( 0, 5, "JamboStrategy Long Entry");
SetStopLoss( "JamboStrategy Long Entry", CalculationMode.Ticks, 100, false);
}
// When in a position, establish
if( Position.MarketPosition == MarketPosition.Short )
{
ExitShortLimit( 1, Position.AveragePrice - 10*TickSize, "JamboStrategy Short Exit 2", "JamboStrategy Short Entry");
ExitShortLimit( 1, Position.AveragePrice - 15*TickSize, "JamboStrategy Short Exit 3", "JamboStrategy Short Entry");
if( Position.MarketPosition == MarketPosition.Long )
{
ExitLongLimit( 1, Position.AveragePrice + 10*TickSize, "JamboStrategy Long Exit 2", "JamboStrategy Long Entry");
ExitLongLimit( 1, Position.AveragePrice + 15*TickSize, "JamboStrategy Long Exit 3", "JamboStrategy Long Entry");
// Once we've entered a position, adjust stops when the first target is touched.
if( Position.MarketPosition == MarketPosition.Short &&
(Position.AveragePrice - 7*TickSize).ApproxCompare( Close[0] ) >= 0)
{
SetStopLoss( "JamboStrategy Short Entry", CalculationMode.Price, Position.AveragePrice -1*TickSize, false );
}
if( Position.MarketPosition == MarketPosition.Long &&
(Position.AveragePrice + 7*TickSize).ApproxCompare( Close[0] ) <= 0)
{
SetStopLoss( "JamboStrategy Long Entry", CalculationMode.Price, Position.AveragePrice +1*TickSize, false );
}
}
}

Comment