| | |
| | | private final BigDecimal marginRatioLimit; |
| | | /** 合约乘数(单张合约代表的基础资产数量,如 BTC_USDT=0.001, ETH_USDT=0.01) */ |
| | | private final BigDecimal contractMultiplier; |
| | | /** 价格精度(根据合约乘数自动计算的小数位数,如 0.001 → 3,0.01 → 2) */ |
| | | private final int pricePrecision; |
| | | /** 未实现盈亏计价模式:最新价 / 标记价格 */ |
| | | private final PnLPriceMode unrealizedPnlPriceMode; |
| | | /** 网格绝对步长(shortBaseEntryPrice × gridRate),运行时由队列生成逻辑设置 */ |
| | |
| | | this.gridQueueSize = builder.gridQueueSize; |
| | | this.marginRatioLimit = builder.marginRatioLimit; |
| | | this.contractMultiplier = builder.contractMultiplier; |
| | | this.pricePrecision = builder.contractMultiplier.stripTrailingZeros().scale(); |
| | | this.unrealizedPnlPriceMode = builder.unrealizedPnlPriceMode; |
| | | } |
| | | |
| | |
| | | |
| | | /** @return 合约乘数(单张合约代表的基础资产数量,如 ETH_USDT=0.01) */ |
| | | public BigDecimal getContractMultiplier() { return contractMultiplier; } |
| | | /** @return 价格精度(根据合约乘数自动计算的小数位数,如 0.001→3,0.01→2),用于价格四舍五入 */ |
| | | public int getPricePrecision() { return pricePrecision; } |
| | | /** @return 未实现盈亏计价模式:LAST_PRICE(最新成交价)/ MARK_PRICE(标记价格) */ |
| | | public PnLPriceMode getUnrealizedPnlPriceMode() { return unrealizedPnlPriceMode; } |
| | | |