package com.xcong.excoin.modules.station.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.xcong.excoin.common.system.base.BaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; /** * 策略实时状态表(apiKeyMd5 维度,UPSERT) */ @Data @EqualsAndHashCode(callSuper = true) @TableName("strategy_status") public class StrategyStatus extends BaseEntity { /** apiKey 的 MD5 */ private String apiKeyMd5; /** 实例别名(Station 端自定义显示名) */ private String aliasName; /** 合约名称 */ private String contract; /** 策略状态:ACTIVE / STOPPED / WAITING_KLINE */ private String state; /** 杠杆倍数 */ private String leverage; /** 网格间距比例 */ private String gridRate; /** 预期收益(USDT) */ private String expectedProfit; /** 最大亏损(USDT) */ private String maxLoss; /** 基底开仓张数 */ private String baseQuantity; /** 每次下单张数 */ private String quantity; /** 最大持仓张数(单方向),0=不限制 */ private Integer maxPositionSize; /** 止损阶梯次数,0=禁用 */ private Integer stopLossCount; /** 止盈网格跨度 */ private Integer takeProfitGridSpan; /** 止损统计方式 */ private String stopLossCountMode; /** 加仓间隔 */ private Integer addPositionInterval; /** 加仓数量 */ private Integer addPositionQuantity; /** 单边最大仓位 */ private Integer maxPositionPerSide; /** 加仓启动阈值 */ private Integer addPositionStartThreshold; /** 止盈挂单模式:off=关闭 / concentrated=集中止盈 / dispersed=分散止盈 */ private String placeExcessTakeProfit; /** 价格驱动开关 */ private Boolean priceDriveEnabled; /** 双开止损触发开关:true=按多空止损触发价初始化双向止损单,false=沿用现有逻辑 */ private Boolean dualStopLossEnabled; /** 多头止损触发价 */ private String longStopLossPrice; /** 空头止损触发价 */ private String shortStopLossPrice; /** 止盈成交触发对向加仓开关 */ private Boolean tpTriggerOppositeAddEnabled; /** 对向加仓挂单数量 */ private Integer tpTriggerOppositeAddQuantity; /** 单格止盈张数(基础仓位止盈:每个网格挂的止盈张数,支持小数) */ private String baseTakeProfitPerGrid; /** 止盈网格数量(基础仓位止盈:挂止盈的网格数量) */ private Integer baseTakeProfitGridCount; /** 当前轮次 */ private Integer currentRound; /** 总轮数上限 */ private Integer totalRounds; /** 多头累计止损次数 */ private Integer accumulatedLongLoss; /** 空头累计止损次数 */ private Integer accumulatedShortLoss; /** 累计已实现盈亏 */ private String cumulativePnl; /** 未实现盈亏 */ private String unrealizedPnl; /** 初始本金 */ private String principal; }