Home Using MTContext Setting up equity protection guardrails

Setting up equity protection guardrails

Last updated on Jul 22, 2026

A stop loss protects one trade. An equity guard protects your whole account. MTContext lets you set a server-side circuit breaker that watches your equity and steps in if you're having a bad day — "Set an equity guard that closes everything if I'm down 3% today."

What the equity guard does

Ask your AI to set a guard and it calls set_equity_guard. You choose:

  • max_daily_loss_percent — how far below the day's starting equity you're willing to fall.
  • max_total_drawdown_percent (optional) — a floor below your initial equity, independent of the daily reset.
  • breach_action — what happens when the limit is hit:
    • close_all — close every open position, then block new live trades until the next daily reset.
    • block_new — stop new trades but leave open positions alone.
    • notify — just record an alert, taking no action.
  • reset_timezone (optional) — the timezone for the daily reset boundary, e.g. Europe/Prague. Defaults to UTC.

It runs server-side, not in your chat

This is the important part: the guard is enforced on MTContext's servers, not inside your AI client. It keeps evaluating on a roughly 30-second loop while your terminal is connected, whether or not your AI client is open. If your terminal happens to be disconnected at the moment a breach would occur, the new-trade block still applies, and a close_all executes as soon as the terminal reconnects.

Checking and removing it

  • "What's my equity guard status?"get_equity_guard_status shows the config, whether it's armed or breached, your day-start anchor, current equity, and the exact equity level that triggers it.
  • "Remove my equity guard."remove_equity_guard. If the guard is currently breached, removing it requires an explicit confirmation, so you can't silently switch off an active safety rail by accident.

There's one guard per license — setting a new one replaces the old.

A guardrail, not a substitute for stops

The equity guard is best-effort protection layered above your broker's own stop-out — it is not a replacement for putting stop losses on your trades. Think of it as the last line, not the only line.

What you need

The equity guard requires the trade capability (Pro tier and above), since it acts on your positions.

Next steps

See Understanding the dry_run safety model for how individual trades stay safe, and What MTContext can and can't do for the full boundary of control.

See plans at mtcontext.com — equity protection is included from the Pro tier up.