From adbdffdb3b80eed8c7110c0583f8ae2f216b7990 Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Mon, 13 Oct 2025 18:22:59 +0800
Subject: [PATCH] K线优化
---
trading-order-huobi/src/main/java/com.yami.trading.huobi/data/AdjustmentValueCache.java | 40 ++++++++++++++++++++++++----------------
1 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/trading-order-huobi/src/main/java/com.yami.trading.huobi/data/AdjustmentValueCache.java b/trading-order-huobi/src/main/java/com.yami.trading.huobi/data/AdjustmentValueCache.java
index 8ae745f..e72e26d 100644
--- a/trading-order-huobi/src/main/java/com.yami.trading.huobi/data/AdjustmentValueCache.java
+++ b/trading-order-huobi/src/main/java/com.yami.trading.huobi/data/AdjustmentValueCache.java
@@ -3,6 +3,7 @@
import com.yami.trading.huobi.data.model.AdjustmentValue;
import java.math.BigDecimal;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -32,29 +33,36 @@
- //计算已分配次数
- private static final Map<String, Integer> allocatedCount = new ConcurrentHashMap<>();
- //初始总值
- private static final Map<String, BigDecimal> totalValue = new ConcurrentHashMap<>();
- //更新累计值
- private static final Map<String, BigDecimal> accumulatedValue = new ConcurrentHashMap<>();
+
//初始次数
private static final Map<String, Integer> frequency = new ConcurrentHashMap<>();
- // 相应的getter方法
- public static Map<String, Integer> getAllocatedCount() {
- return allocatedCount;
- }
+ //存储预生成的随机分配值列表
+ private static final Map<String, List<BigDecimal>> preAllocationList = new ConcurrentHashMap<>();
- public static Map<String, BigDecimal> getTotalValue() {
- return totalValue;
- }
+ //记录当前分配到第几个值
+ private static final Map<String, Integer> currentAllocationIndex = new ConcurrentHashMap<>();
- public static Map<String, BigDecimal> getAccumulatedValue() {
- return accumulatedValue;
- }
+ //记录前一个值的波动方向
+ private static final Map<String, List<Boolean>> upDownTrend = new ConcurrentHashMap<>();
public static Map<String, Integer> getFrequency() {
return frequency;
}
+
+ public static Map<String, List<BigDecimal>> getPreAllocationList() {
+ return preAllocationList;
+ }
+
+
+ public static Map<String, Integer> getCurrentAllocationIndex() {
+ return currentAllocationIndex;
+ }
+
+ public static Map<String, List<Boolean>> getUpDownTrend() {
+ return upDownTrend;
+ }
+
+
+
}
--
Gitblit v1.9.3