TIME-BASED MONITOR & AUTO-CLOSE

Max Trade Duration

Enforce maximum holding time per position. No more "holding and hoping."

How It Works

PipsGuard tracks how long each position has been open. When a trade exceeds your configured maximum duration, it's automatically closed or you're notified. This prevents "holding and hoping" — where traders refuse to close losing positions because "it might come back."

The timer starts from the moment the position opens. A warning is sent when the trade reaches the configured warning threshold, giving you time to manage the exit manually before the auto-close kicks in.

Configuration

Parameter Default Description
max_duration_hours 24 Maximum time a position can stay open (hours)
action close_position Action on breach: close_position or notify
warning_percent 80% Warn at this percentage of max duration
grace_period_minutes 5 Extra minutes before force-close after max duration
exempt_symbols [] Symbols excluded from duration limits
apply_to_profitable_only false Only close profitable trades (take profit enforcement)

When This Rule Fires

Monitor: PipsGuard continuously checks the age of each open position. When a trade reaches warning_percent of max_duration_hours, a warning notification is sent.
Auto-close: When the trade exceeds max_duration_hours plus the grace_period_minutes, the configured action is taken — either auto-close or notification.

Best For

Scalpers who should be in and out quickly Traders who hold losing positions for days Anyone who needs hard limits on trade duration

Pro Tips

  • For scalping strategies, set max_duration_hours to 1–4 hours; for day trading, 8–12 hours; for swing trading, 48–72 hours or use exempt symbols.
  • Enable apply_to_profitable_only to use this as a "take profit" enforcer — forcing you to book profits on winners instead of letting them reverse.
  • Combined with stop losses, this creates automatic trade management.
Configure This Rule

Enable Max Trade Duration in your dashboard.