Administrator
8 days ago 2968d8cf5bf5437728467e010e6f3292f495a9ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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;
    }
}