| name | checkRiskLimits |
| description | Verify if a trading plan complies with user-defined risk limits such as position size and stop-loss levels. |
checkRiskLimits
描述
检查交易是否超出用户定义的风险限制。
输入模式
interface CheckRiskLimitsInput {
tradingPlan: TradingPlan;
userPortfolio: UserPortfolio;
userPreference: UserPreference;
}
输出模式
interface CheckRiskLimitsOutput {
passed: boolean;
checks: {
positionSizeCheck: {
passed: boolean;
actual: number;
limit: number;
};
stopLossCheck: {
passed: boolean;
stopLossPercent: number;
maxStopLossPercent: number;
};
dailyLossCheck: {
passed: boolean;
potentialLoss: number;
dailyLimit: number;
};
concentrationCheck: {
passed: boolean;
newConcentration: number;
maxConcentration: number;
};
};
errors: string[];
}
错误代码
INVALID_INPUT: 输入参数无效
RISK_CHECK_ERROR: 风险限制检查失败