I am trying to create a simple stop loss code. But for some reason I am not able to see the modified stop loss.
My initial stop loss is 6 point above VMA (Variable moving average), but if the price moves 10 points favorably I want to move the stop loss to Position Avg Price. For some reason I see the initial stop loss on the chart but not the modified one even though the price has moved more than 10 points.
if (Position.MarketPosition == MarketPosition.Short)
SetStopLoss(CalculationMode.Ticks, (Instrument.MasterInstrument.Round2TickSize(VMA(vm a1,vma1vol)[0]+ 24*TickSize)));
else if (Close[0] < Position.AvgPrice - 40 * TickSize)
SetStopLoss(CalculationMode.Price, Position.AvgPrice);
Can you please guide me?
Many Thanks.
Comment