Files
NexQuant/rdagent/components/backtesting/protections/__init__.py
T
TPTBusiness cbe1c52e00 refactor: rename project from Predix to NexQuant
Rename all source files, scripts, tests, documentation, and configuration
from Predix/predix to NexQuant/nexquant across the entire codebase.
2026-05-09 17:48:22 +02:00

59 lines
1.5 KiB
Python

"""
Trading Protection System for NexQuant.
Prevents excessive losses by automatically pausing trading
when risk thresholds are exceeded.
Usage:
from rdagent.components.backtesting.protections import (
ProtectionManager,
MaxDrawdownProtection,
CooldownProtection,
StoplossGuardProtection,
LowPerformanceProtection,
)
manager = ProtectionManager()
manager.create_default_protections()
result = manager.check_all(
returns=[0.01, -0.02, 0.015],
timestamps=[...],
current_equity=98000,
peak_equity=100000
)
if result.should_block:
print(f"Trading blocked: {result.reason}")
"""
from .base import (
BaseProtection,
ProtectionConfig,
ProtectionResult,
ProtectionType,
ProtectionScope,
)
from .max_drawdown import MaxDrawdownProtection, MaxDrawdownConfig
from .cooldown import CooldownProtection, CooldownConfig
from .stoploss_guard import StoplossGuardProtection, StoplossGuardConfig
from .low_performance import LowPerformanceProtection, LowPerformanceConfig
from .protection_manager import ProtectionManager
__all__ = [
"BaseProtection",
"ProtectionConfig",
"ProtectionResult",
"ProtectionType",
"ProtectionScope",
"MaxDrawdownProtection",
"MaxDrawdownConfig",
"CooldownProtection",
"CooldownConfig",
"StoplossGuardProtection",
"StoplossGuardConfig",
"LowPerformanceProtection",
"LowPerformanceConfig",
"ProtectionManager",
]