I am submitting a Long Position using the below code. The SetProfitTarget is giving the following error:
16/09/2024 10:22:32 pm,Order,SimLiveStaging Order '2a089083ec814d9ab67a769e83944fb9' can't be submitted: Not enough excess margin. affected Order: Buy 1 Market
double stopLossLevel = Close[0] - (atrMultiplier * atrValue); double takeProfitLevel = Close[0] + (riskRewardRatio * (Close[0] - stopLossLevel)); //SetStopLoss(CalculationMode.Price, stopLossLevel); SetProfitTarget(@"EnterLong" + CurrentBar,CalculationMode.Price, takeProfitLevel); SetStopLoss(@"EnterLong" + CurrentBar,CalculationMode.Ticks, StopLoss_Ticks,false); EnterLong(0,1, @"EnterLong"+CurrentBar);

Comment