When I switch the contracts to 1, the SL is now at 1 and the TP is 1. Set 1 - NT8.jpg
Let me show you the code where the Protective settings are
I feel like this code it making the TP stay at 1 and not 2 contracts.
// StopLoss & ProfitTarget
protected override void OnExecutionUpdate( Cbi.Execution e, string executionId, double price, int quantity,
Cbi.MarketPosition marketPosition, string orderId, DateTime time )
{
if( UseProtectiveStops )
{
if( e.IsEntryStrategy )
{
if( e.Order.OrderAction == OrderAction.Buy )
{
// Set stop loss
double stopOrderPrice = e.Order.AverageFillPrice - StopLoss * TickSize;
ExitLongStopMarket( 0, true, 3, stopOrderPrice, "Stop loss", e.Order.FromEntrySignal );
// Set profit target 1
double profitTarget = e.Order.AverageFillPrice + ProfitTarget * TickSize;;
ExitLongLimit( 0, true, 1, profitTarget, "Profit target", e.Order.FromEntrySignal );
}
if( e.Order.OrderAction == OrderAction.SellShort )
{
// Set stop loss
double stopOrderPrice = e.Order.AverageFillPrice + StopLoss * TickSize;
ExitShortStopMarket( 0, true, 3, stopOrderPrice, "Stop loss", e.Order.FromEntrySignal );
// Set profit target 1
double profitTarget = e.Order.AverageFillPrice - ProfitTarget * TickSize;;
ExitShortLimit( 0, true, 1, profitTarget, "Profit target", e.Order.FromEntrySignal );
}
}
}

Comment