-- 添加交易统计字段
-- 用于记录策略类型和持仓持续时间

ALTER TABLE `trades`
ADD COLUMN IF NOT EXISTS `strategy_type` VARCHAR(50) COMMENT '策略类型: trend_following, mean_reversion' AFTER `exit_reason`,
ADD COLUMN IF NOT EXISTS `duration_minutes` INT COMMENT '持仓持续时间（分钟）' AFTER `strategy_type`;

-- 添加索引以便统计查询
ALTER TABLE `trades`
ADD INDEX IF NOT EXISTS `idx_strategy_type` (`strategy_type`),
ADD INDEX IF NOT EXISTS `idx_exit_reason` (`exit_reason`);
