Daily risk guard

Daily risk guard is an alert that checks every 1 minute, can fire every time its condition is met and waits 4 hours between alerts.

account and history

daily-risk-guard.abx
1alert "Daily risk guard"
2check: every 1m
3repeat: every time
4cooldown: 4h
5
6when history.today.pnl < -(2% of account.balance) or account.margin_level < 150%:
7notify "Daily P&L {history.today.pnl:$0.00}, margin level {account.margin_level:0}%"
Watch it run · EURUSD · 1h bars

Sample data. Not a result. The real AlgoBarsX engine ran this exact script on made-up bars, and this replays what it drew and did. It shows no profit or loss, and it says nothing about how the script would do in a real market.

Replay of this script on 150 sample bars: 0 alerts sent.

What this script says

Daily risk guard is an alert that checks every 1 minute, can fire every time its condition is met and waits 4 hours between alerts.

When today's closed profit or loss is below minus 2% of the account balance or the margin level is below 150%, it sends the notification "Daily P&L {history.today.pnl:$0.00}, margin level {account.margin_level:0}%".

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account