| | |
| | | private final BigDecimal marginRatioLimit; |
| | | /** 合约乘数(单张合约代表的基础资产数量,如 BTC_USDT=0.001, ETH_USDT=0.01) */ |
| | | private final BigDecimal contractMultiplier; |
| | | /** 价格精度(交易所价格的最小小数位数,如 XAU_USDT=1 表示 0.1 精度,ETH_USDT=2 表示 0.01 精度) */ |
| | | private final int priceScale; |
| | | /** 未实现盈亏计价模式:最新价 / 标记价格 */ |
| | | private final PnLPriceMode unrealizedPnlPriceMode; |
| | | /** 网格绝对步长(shortBaseEntryPrice × gridRate),运行时由队列生成逻辑设置 */ |
| | |
| | | this.gridQueueSize = builder.gridQueueSize; |
| | | this.marginRatioLimit = builder.marginRatioLimit; |
| | | this.contractMultiplier = builder.contractMultiplier; |
| | | this.priceScale = builder.priceScale; |
| | | this.unrealizedPnlPriceMode = builder.unrealizedPnlPriceMode; |
| | | } |
| | | |
| | |
| | | |
| | | /** @return 合约乘数(单张合约代表的基础资产数量,如 ETH_USDT=0.01) */ |
| | | public BigDecimal getContractMultiplier() { return contractMultiplier; } |
| | | /** @return 价格精度(交易所价格的小数位数,如 1=0.1精度,2=0.01精度),用于价格四舍五入 */ |
| | | public int getPriceScale() { return priceScale; } |
| | | /** @return 未实现盈亏计价模式:LAST_PRICE(最新成交价)/ MARK_PRICE(标记价格) */ |
| | | public PnLPriceMode getUnrealizedPnlPriceMode() { return unrealizedPnlPriceMode; } |
| | | |
| | |
| | | private BigDecimal marginRatioLimit = new BigDecimal("0.2"); |
| | | /** 合约乘数,默认 0.001 */ |
| | | private BigDecimal contractMultiplier = new BigDecimal("0.001"); |
| | | /** 价格精度(交易所价格的小数位数),默认 1(0.1 精度) */ |
| | | private int priceScale = 1; |
| | | /** 未实现盈亏计价模式,默认 LAST_PRICE(最新成交价) */ |
| | | private PnLPriceMode unrealizedPnlPriceMode = PnLPriceMode.LAST_PRICE; |
| | | |
| | |
| | | public Builder reopenMaxRetries(int reopenMaxRetries) { this.reopenMaxRetries = reopenMaxRetries; return this; } |
| | | /** 设置合约乘数(单张合约代表的基础资产数量) */ |
| | | public Builder contractMultiplier(BigDecimal contractMultiplier) { this.contractMultiplier = contractMultiplier; return this; } |
| | | /** 设置价格精度(交易所价格的小数位数,如 1=0.1精度,2=0.01精度) */ |
| | | public Builder priceScale(int priceScale) { this.priceScale = priceScale; return this; } |
| | | /** 设置未实现盈亏计价模式 */ |
| | | public Builder unrealizedPnlPriceMode(PnLPriceMode mode) { this.unrealizedPnlPriceMode = mode; return this; } |
| | | |