| | |
| | | private final String contract; |
| | | private final String leverage; |
| | | private final String marginMode; |
| | | private final String posMode; |
| | | private final BigDecimal gridRate; |
| | | private final BigDecimal overallTp; |
| | | private final BigDecimal maxLoss; |
| | |
| | | this.contract = builder.contract; |
| | | this.leverage = builder.leverage; |
| | | this.marginMode = builder.marginMode; |
| | | this.posMode = builder.posMode; |
| | | this.gridRate = builder.gridRate; |
| | | this.overallTp = builder.overallTp; |
| | | this.maxLoss = builder.maxLoss; |
| | |
| | | : "wss://wspap.okx.com:8443/ws/v5/private"; |
| | | } |
| | | |
| | | // ==================== REST 地址 ==================== |
| | | |
| | | public String getRestBaseUrl() { |
| | | return isProduction |
| | | ? "https://www.okx.com" |
| | | : "https://www.okx.cab"; |
| | | } |
| | | |
| | | // ==================== 认证信息 ==================== |
| | | |
| | | public String getApiKey() { return apiKey; } |
| | |
| | | // ==================== 持仓配置 ==================== |
| | | |
| | | public String getMarginMode() { return marginMode; } |
| | | public String getPosMode() { return posMode; } |
| | | |
| | | // ==================== 策略参数 ==================== |
| | | |
| | |
| | | private String contract = "BTC-USDT-SWAP"; |
| | | private String leverage = "100"; |
| | | private String marginMode = "cross"; |
| | | private String posMode = "long_short_mode"; |
| | | private BigDecimal gridRate = new BigDecimal("0.0035"); |
| | | private BigDecimal overallTp = new BigDecimal("5"); |
| | | private BigDecimal maxLoss = new BigDecimal("15"); |
| | |
| | | public Builder contract(String contract) { this.contract = contract; return this; } |
| | | public Builder leverage(String leverage) { this.leverage = leverage; return this; } |
| | | public Builder marginMode(String marginMode) { this.marginMode = marginMode; return this; } |
| | | public Builder posMode(String posMode) { this.posMode = posMode; return this; } |
| | | public Builder gridRate(BigDecimal gridRate) { this.gridRate = gridRate; return this; } |
| | | public Builder overallTp(BigDecimal overallTp) { this.overallTp = overallTp; return this; } |
| | | public Builder maxLoss(BigDecimal maxLoss) { this.maxLoss = maxLoss; return this; } |