From 4884ebffeed775d63dbf7bb7d0ece8182f10c344 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Fri, 26 Dec 2025 18:19:46 +0800
Subject: [PATCH] fix(okxNewPrice): 解决交易订单为空时的空指针异常
---
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MACDResult.java | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MACDResult.java b/src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MACDResult.java
new file mode 100644
index 0000000..0ab00ae
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MACDResult.java
@@ -0,0 +1,47 @@
+/**
+ * MACD计算结果类
+ * <p>
+ * 用于封装MACD指标计算的结果数据,包括完整的MACD数据序列和数据的起始索引信息,
+ * 方便策略模块获取和使用MACD计算结果。
+ */
+package com.xcong.excoin.modules.okxNewPrice.indicator.macdAndMatrategy;
+
+import java.util.List;
+
+/**
+ * MACD计算结果封装类
+ */
+public class MACDResult {
+ /** MACD完整数据序列,包含每个价格点对应的DIF、DEA和MACD柱状图值 */
+ private List<PriceData> macdData;
+
+ /** 在原始价格序列中的起始索引,表示MACD数据的计算起点 */
+ private int startIndex;
+
+ /**
+ * 构造函数,创建MACD计算结果对象
+ *
+ * @param result 计算得到的MACD数据序列
+ * @param startIdx 数据在原始价格序列中的起始索引
+ */
+ public MACDResult(List<PriceData> result, int startIdx) {
+ this.macdData = result;
+ this.startIndex = startIdx;
+ }
+
+ /**
+ * 获取MACD数据序列
+ * @return MACD数据序列
+ */
+ public List<PriceData> getMacdData() {
+ return macdData;
+ }
+
+ /**
+ * 获取起始索引
+ * @return 起始索引值
+ */
+ public int getStartIndex() {
+ return startIndex;
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.1