| | |
| | | .maxPositionPerSide(dto.getMaxPositionPerSide()) |
| | | .addPositionStartThreshold(dto.getAddPositionStartThreshold() >= 0 ? dto.getAddPositionStartThreshold() : 1) |
| | | .placeExcessTakeProfit(normalizeTakeProfitMode(dto.getPlaceExcessTakeProfit())) |
| | | .dualStopLossEnabled(nvl(dto.getDualStopLossEnabled(), false)) |
| | | .longStopLossPrice(dto.getLongStopLossPrice()) |
| | | .shortStopLossPrice(dto.getShortStopLossPrice()) |
| | | .tpTriggerOppositeAddEnabled(nvl(dto.getTpTriggerOppositeAddEnabled(), false)) |
| | | .tpTriggerOppositeAddQuantity(dto.getTpTriggerOppositeAddQuantity() != null && dto.getTpTriggerOppositeAddQuantity() > 0 ? dto.getTpTriggerOppositeAddQuantity() : 0) |
| | | .baseTakeProfitPerGrid(dto.getBaseTakeProfitPerGrid() != null && dto.getBaseTakeProfitPerGrid() > 0 ? dto.getBaseTakeProfitPerGrid() : 0) |
| | | .baseTakeProfitGridCount(dto.getBaseTakeProfitGridCount() != null && dto.getBaseTakeProfitGridCount() > 0 ? dto.getBaseTakeProfitGridCount() : 0) |
| | | .build(); |
| | | } |
| | | |
| | |
| | | return GateConfig.EXCESS_TP_OFF; |
| | | } |
| | | switch (raw.trim()) { |
| | | case "off": |
| | | return GateConfig.EXCESS_TP_OFF; |
| | | case "true": |
| | | case "concentrated": |
| | | return GateConfig.EXCESS_TP_CONCENTRATED; |