Hello for some reason no matter what i do stoploss is not working and same is the case with daily max loss
Calculate = Calculate.OnEachTick;
IsOverlay = true;
}
else if (State == State.Configure)
{
TraceOrders = true;
SetStopLoss("LongEntry", CalculationMode.Currency, 40, false);
SetStopLoss("ShortEntry", CalculationMode.Currency, 40, false);
// Optional:
// SetProfitTarget("LongEntry", CalculationMode.Ticks, 20);
// SetProfitTarget("ShortEntry", CalculationMode.Ticks, 20);
}
}
protected override void OnBarUpdate()
{
if (CurrentBar < 60) return;
if (Bars.IsFirstBarOfSession && IsFirstTickOfBar)
{
dailyLockoutTriggered = false;
Print("π New session started.");
}
double cumProfit = SystemPerformance.AllTrades.CumProfit;
Print("π Daily CumProfit = " + Math.Round(cumProfit, 2));
if (cumProfit < dailyLossThreshold)
{
dailyLockoutTriggered = true;
Print("π¨ Daily loss limit breached.");
}
I want to be able to close order if loss = 40$ and also stop trading for the day if total loss is = or > than 100.
Is anyone able to help pls.
sai