I hope someone can help, when I'm running my code, my long/short entries are working but my slop loss isn't working? Am I doing anything wrong?
My order are limit orders, and I know when to place my stoploss target, but it just isnt working?
thanks
protected override void Initialize()
{
SetProfitTarget(CalculationMode.Ticks, myInput0);
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (condition)
{
EnterLongLimit(DefaultQuantity, 12, "long");
}
if (condition)
{
EnterLongLimit(DefaultQuantity, 14, "short");
}
//if (Position.MarketPosition == MarketPosition.Long)
{
ExitLongStopLimit(14, upperStopLoss);
}
//if (Position.MarketPosition == MarketPosition.Short)
{
ExitShortStopLimit(16, lowerStopLoss);
}
}

Comment