i would like to move my setstoploss like a trailing stop... but it is not working, here my code, can you help to return my setstoploss dynamic ? the stop loss is not moving
if (here my buying condition)
{
EnterLongLimit(1, Close[0], "divergence haussiere 1");
SetStopLoss("divergence haussiere 1", CalculationMode.Price, Low[1] - 1*TickSize, false);
SetProfitTarget ("divergence haussiere 1", CalculationMode.Ticks, 200*ATR(atr)[0]);
}
if (Position.MarketPosition == MarketPosition.Long && High[0] >= (Position.AvgPrice + 200*ATR(atr)[0] - 2*TickSize))
{
// Modifies stop-loss to breakeven + 2TickSize
ExitLongStop(0, true, 1, Position.AvgPrice+2*TickSize, "Trailing Stop div haussiere 1", "divergence haussiere 1");
}

Comment