| | |
| | | private final BigDecimal maxLoss; |
| | | /** 下单数量(合约张数) */ |
| | | private final String quantity; |
| | | /** 基底开仓张数(初始化时多空各开的张数,如 "10") */ |
| | | private final String baseQuantity; |
| | | /** 预期收益(USDT),unrealisedPnl + available > 初始本金 + 此值时重置 */ |
| | | private final BigDecimal expectedProfit; |
| | | /** 是否为生产环境 */ |
| | | private final boolean isProduction; |
| | | /** 补仓最大重试次数 */ |
| | |
| | | this.overallTp = builder.overallTp; |
| | | this.maxLoss = builder.maxLoss; |
| | | this.quantity = builder.quantity; |
| | | this.baseQuantity = builder.baseQuantity; |
| | | this.expectedProfit = builder.expectedProfit; |
| | | this.isProduction = builder.isProduction; |
| | | this.reopenMaxRetries = builder.reopenMaxRetries; |
| | | this.gridQueueSize = builder.gridQueueSize; |
| | |
| | | public BigDecimal getMaxLoss() { return maxLoss; } |
| | | /** @return 每次下单的张数(如 "1" 表示 1 张合约) */ |
| | | public String getQuantity() { return quantity; } |
| | | /** @return 基底开仓张数(初始化时多空各开的张数,如 "10") */ |
| | | public String getBaseQuantity() { return baseQuantity; } |
| | | /** @return 预期收益(USDT),unrealisedPnl + available > 初始本金 + 此值时重置 */ |
| | | public BigDecimal getExpectedProfit() { return expectedProfit; } |
| | | /** @return 网格价格队列的容量上限(超出时截断尾部) */ |
| | | public int getGridQueueSize() { return gridQueueSize; } |
| | | |
| | |
| | | private BigDecimal maxLoss = new BigDecimal("7.5"); |
| | | /** 每次下单张数,默认 "1" */ |
| | | private String quantity = "1"; |
| | | /** 基底开仓张数,默认 "10"(初始化时多空各开10张) */ |
| | | private String baseQuantity = "10"; |
| | | /** 预期收益(USDT),默认 0.5 */ |
| | | private BigDecimal expectedProfit = new BigDecimal("0.5"); |
| | | /** 是否为生产环境,默认 false(测试网) */ |
| | | private boolean isProduction = false; |
| | | /** 补仓最大重试次数,默认 3 */ |
| | |
| | | public Builder maxLoss(BigDecimal maxLoss) { this.maxLoss = maxLoss; return this; } |
| | | /** 设置每次下单张数 */ |
| | | public Builder quantity(String quantity) { this.quantity = quantity; return this; } |
| | | /** 设置基底开仓张数 */ |
| | | public Builder baseQuantity(String baseQuantity) { this.baseQuantity = baseQuantity; return this; } |
| | | /** 设置预期收益(USDT) */ |
| | | public Builder expectedProfit(BigDecimal expectedProfit) { this.expectedProfit = expectedProfit; return this; } |
| | | /** 设置环境(true=实盘生产网 / false=模拟盘测试网) */ |
| | | public Builder isProduction(boolean isProduction) { this.isProduction = isProduction; return this; } |
| | | /** 设置补仓最大重试次数 */ |