I'm trying to go breakeven on runners after i hit the take profit on partial contracts , but for some reason SL is not reset to new price. Code below. i hope someone can assist me.
if (Position.MarketPosition == MarketPosition.Short && Close[0] < shorttakeprice)
{
shortstopprice = Position.AveragePrice;//NEW PRICE
SetStopLoss(CalculationMode.Price, shortstopprice);//set to breakeven on remaining positions
}
if (Position.MarketPosition == MarketPosition.Flat)
{
SetStopLoss(CalculationMode.Price, Close[0]-20);
}
if (SellCondition == true)
{
shorttakeprice = Close[0] - tps;
shortstopprice = Close[0]+sls;
SetProfitTarget("Short Set1", CalculationMode.Price, shorttakeprice);
SetStopLoss(CalculationMode.Price, shortstopprice); // Original set to 14875
EnterShort(PositionSize-1, "Short Set1");
EnterShort("Short Set2");
}
i tried to set SL with "Short Set2" as well . see below, i wanted the "Short Set2" to close at 14733.
Comment