why the following stoploss code never get executed ? they are placed under OnBarUpdate method within strategy.
could this due to the entry order was either manually placed or placed by another strategy?
which means that SetStopLoss and SetProfitTarget work only for same strategy entry order ?
if (PositionsAccount[0].MarketPosition == MarketPosition.Flat)
{
SetStopLoss(CalculationMode.Ticks, 40);
}
// If an position is open, allow for stop loss and target modification to $50
else (PositionsAccount[0].MarketPosition == MarketPosition.Long)
{
SetStopLoss(CalculationMode.Currency, 50);
SetProfitTarget(CalculationMode.Currency, 50);
}

Comment