| | |
| | | /** 止盈挂单模式:off=关闭 / concentrated=集中止盈 / dispersed=分散止盈,默认 off */ |
| | | private String placeExcessTakeProfit; |
| | | /** 自定义止损开关:true=启用自定义止损触发价,false=使用默认阶梯止损。null=未设置(默认false) */ |
| | | private Boolean customStopLossEnabled; |
| | | private Boolean dualStopLossEnabled; |
| | | /** 多仓自定义止损触发价(价格跌至该值触发平多),null=未设置 */ |
| | | private BigDecimal longCustomStopLossPrice; |
| | | private BigDecimal longStopLossPrice; |
| | | /** 空仓自定义止损触发价(价格涨至该值触发平空),null=未设置 */ |
| | | private BigDecimal shortCustomStopLossPrice; |
| | | private BigDecimal shortStopLossPrice; |
| | | /** 止盈成交触发对向加仓开关:true=启用,false=禁用。null=未设置(默认false) */ |
| | | private Boolean tpTriggerOppositeAddEnabled; |
| | | /** 对向加仓挂单数量:止盈成交后在对向挂出的开仓张数,0=不启用 */ |
| | | private Integer tpTriggerOppositeAddQuantity; |
| | | /** 单格止盈张数:基础仓位止盈挂单时每个网格挂的止盈张数,0=不启用 */ |
| | | private Integer baseTakeProfitPerGrid; |
| | | /** 止盈网格数量:基础仓位止盈挂单的网格数量,0=不启用 */ |
| | | private Integer baseTakeProfitGridCount; |
| | | |
| | | /** |
| | | * 从 GateConfig 构建 DTO(不暴露 apiSecret)。 |
| | |
| | | .maxPositionPerSide(config.getMaxPositionPerSide()) |
| | | .addPositionStartThreshold(config.getAddPositionStartThreshold()) |
| | | .placeExcessTakeProfit(config.getPlaceExcessTakeProfit()) |
| | | .customStopLossEnabled(config.isCustomStopLossEnabled()) |
| | | .longCustomStopLossPrice(config.getLongCustomStopLossPrice()) |
| | | .shortCustomStopLossPrice(config.getShortCustomStopLossPrice()) |
| | | .dualStopLossEnabled(config.isDualStopLossEnabled()) |
| | | .longStopLossPrice(config.getLongStopLossPrice()) |
| | | .shortStopLossPrice(config.getShortStopLossPrice()) |
| | | .tpTriggerOppositeAddEnabled(config.isTpTriggerOppositeAddEnabled()) |
| | | .tpTriggerOppositeAddQuantity(config.getTpTriggerOppositeAddQuantity()) |
| | | .baseTakeProfitPerGrid(config.getBaseTakeProfitPerGrid()) |
| | | .baseTakeProfitGridCount(config.getBaseTakeProfitGridCount()) |
| | | .build(); |
| | | } |
| | | |
| | |
| | | m.put("maxPositionPerSide", maxPositionPerSide); |
| | | m.put("addPositionStartThreshold", addPositionStartThreshold); |
| | | m.put("placeExcessTakeProfit", placeExcessTakeProfit); |
| | | m.put("customStopLossEnabled", customStopLossEnabled); |
| | | m.put("longCustomStopLossPrice", longCustomStopLossPrice); |
| | | m.put("shortCustomStopLossPrice", shortCustomStopLossPrice); |
| | | m.put("dualStopLossEnabled", dualStopLossEnabled); |
| | | m.put("longStopLossPrice", longStopLossPrice); |
| | | m.put("shortStopLossPrice", shortStopLossPrice); |
| | | m.put("tpTriggerOppositeAddEnabled", tpTriggerOppositeAddEnabled); |
| | | m.put("tpTriggerOppositeAddQuantity", tpTriggerOppositeAddQuantity); |
| | | m.put("baseTakeProfitPerGrid", baseTakeProfitPerGrid); |
| | | m.put("baseTakeProfitGridCount", baseTakeProfitGridCount); |
| | | return m; |
| | | } |
| | | |
| | |
| | | .maxPositionPerSide(0) |
| | | .addPositionStartThreshold(1) |
| | | .placeExcessTakeProfit("off") |
| | | .customStopLossEnabled(false) |
| | | .longCustomStopLossPrice(null) |
| | | .shortCustomStopLossPrice(null) |
| | | .dualStopLossEnabled(false) |
| | | .longStopLossPrice(null) |
| | | .shortStopLossPrice(null) |
| | | .tpTriggerOppositeAddEnabled(false) |
| | | .tpTriggerOppositeAddQuantity(0) |
| | | .baseTakeProfitPerGrid(0) |
| | | .baseTakeProfitGridCount(0) |
| | | .build(); |
| | | } |
| | | } |