| | |
| | | private Integer tpTriggerOppositeAddQuantity; |
| | | /** 仓位止盈补仓开关:true=止盈触发时在对侧止损位挂同方向同张数开仓单,false=保持现有逻辑。null=未设置(默认false) */ |
| | | private Boolean tpPositionReplenishEnabled; |
| | | /** 单格止盈张数:基础仓位止盈挂单时每个网格挂的止盈张数,支持小数,0=不启用 */ |
| | | private BigDecimal baseTakeProfitPerGrid; |
| | | /** 止盈网格数量:基础仓位止盈挂单的网格数量,0=不启用 */ |
| | | private Integer baseTakeProfitGridCount; |
| | | /** 原始仓位止盈总数量:平均分配到对手盘止损位前的所有网格,余数挂最后一格,每格至少1张,0=不启用 */ |
| | | private Integer baseTakeProfitTotalQty; |
| | | |
| | | /** |
| | | * 从 GateConfig 构建 DTO(不暴露 apiSecret)。 |
| | |
| | | .tpTriggerOppositeAddEnabled(config.isTpTriggerOppositeAddEnabled()) |
| | | .tpTriggerOppositeAddQuantity(config.getTpTriggerOppositeAddQuantity()) |
| | | .tpPositionReplenishEnabled(config.isTpPositionReplenishEnabled()) |
| | | .baseTakeProfitPerGrid(config.getBaseTakeProfitPerGrid()) |
| | | .baseTakeProfitGridCount(config.getBaseTakeProfitGridCount()) |
| | | .baseTakeProfitTotalQty(config.getBaseTakeProfitTotalQty()) |
| | | .build(); |
| | | } |
| | | |
| | |
| | | m.put("tpTriggerOppositeAddEnabled", tpTriggerOppositeAddEnabled); |
| | | m.put("tpTriggerOppositeAddQuantity", tpTriggerOppositeAddQuantity); |
| | | m.put("tpPositionReplenishEnabled", tpPositionReplenishEnabled); |
| | | m.put("baseTakeProfitPerGrid", baseTakeProfitPerGrid); |
| | | m.put("baseTakeProfitGridCount", baseTakeProfitGridCount); |
| | | m.put("baseTakeProfitTotalQty", baseTakeProfitTotalQty); |
| | | return m; |
| | | } |
| | | |
| | |
| | | .tpTriggerOppositeAddEnabled(false) |
| | | .tpTriggerOppositeAddQuantity(0) |
| | | .tpPositionReplenishEnabled(false) |
| | | .baseTakeProfitPerGrid(BigDecimal.ZERO) |
| | | .baseTakeProfitGridCount(0) |
| | | .baseTakeProfitTotalQty(0) |
| | | .build(); |
| | | } |
| | | } |