Skip to main content

Module adjuster_guardrails

Module adjuster_guardrails 

Source
Expand description

Guardrails for agent adjustment frequency and magnitude.

Prevents the AI agent from adjusting strategy parameters too often or too aggressively. Two independent checks are provided:

  1. Rate limiting – enforces a minimum interval between adjustments.
  2. Loss freeze – blocks all adjustments when daily losses exceed a configurable percentage of the daily loss limit.

A magnitude clamp function caps per-cycle deltas for stop-loss, take-profit, and position size relative to the current strategy parameters.

Structs§

AdjusterGuardrails
Configurable limits on how often and how much the agent can adjust strategy parameters in a single cycle.
GuardrailState
Mutable state tracked across adjustment cycles.

Enums§

GuardrailVerdict
Result of the pre-adjustment guardrail check.

Functions§

check_can_adjust
Check whether an adjustment is allowed right now.
clamp_adjustment
Clamp a StrategyAdjustment so that no single-cycle delta exceeds the configured magnitude limits.