I would like to move stop loss to breakeven +1 tick my strategy compile well but shows error when working because "can not place stop loss over the buying price."
Are the any place where I can see sample of such script, or anybody can tell me how to change below script ??
Rgds
Czarek
// If a short position is open, allow for stop loss modification to breakeven
else if (Position.MarketPosition == MarketPosition.Short)
{
// Once the price is lower than entry price-breakeven ticks, set stop loss to breakeven + 1 tick
if (Close[0]+ breakeven * TickSize < Position.AvgPrice)
{
SetStopLoss(CalculationMode.Price, Position.AvgPrice - 1 * TickSize);
}
// Once the price is lower than entry price-halfbreakeven ticks, set stop loss to breakeven + halfstop
if (Close[0] + breakevenhalf * TickSize < Position.AvgPrice)
{
SetStopLoss(CalculationMode.Price, Position.AvgPrice + halfstop * TickSize);
}
Comment