i have a script giving me signals CalculateOnBarClose = true, however, within my script i have a trailing stop like that
// TRAILING STOP
if (Position.MarketPosition == MarketPosition.Long && High[0] >= targetOrder.LimitPrice - 2*TickSize)
{
// Checks to see if our Stop Order has been submitted already
if (stopOrderLong != null && stopOrderLong.StopPrice < Position.AvgPrice)
{
// Modifies stop-loss to breakeven
stopOrderLong = ExitLongStop(0, true, stopOrderLong.Quantity, Position.AvgPrice+2*TickSize, "Trailing Stop div haussiere 1", "divergence haussiere 1");
}
}
My problem is that to move the stopOrderLong, the script wait the close of [0], how is it possible to move the stopOrderLong in live, without waiting the end of the bar ?
Thx
Thomas
Comment