hikyuu2/hikyuu_cpp/hikyuu/indicator/crt/MACD.h

50 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* MACD.h
*
* Created on: 2013-4-11
* Author: fasiondog
*/
#ifndef MACD_H_
#define MACD_H_
#include "../Indicator.h"
namespace hku {
/**
* MACD平滑异同移动平均线
* @param n1 短期EMA时间窗默认12
* @param n2 长期EMA时间窗默认26
* @param n3 短期EMA-长期EMAEMA平滑时间窗默认9
* @return
* <pre>
* MACD BAR MACD直柱即MACD快线MACD慢线
* DIFF: 快线,即短期EMA-长期EMA
* DEA: 慢线即快线的n3周期EMA平滑
* </pre>
* @ingroup Indicator
*/
Indicator HKU_API MACD(int n1 = 12, int n2 = 26, int n3 = 9);
/**
* MACD平滑异同移动平均线
* @param data 待计算数据
* @param n1 短期EMA时间窗默认12
* @param n2 长期EMA时间窗默认26
* @param n3 短期EMA-长期EMAEMA平滑时间窗默认9
* @return
* <pre>
* MACD BAR MACD直柱即MACD快线MACD慢线
* DIFF: 快线,即短期EMA-长期EMA
* DEA: 慢线即快线的n3周期EMA平滑
* </pre>
* @ingroup Indicator
*/
Indicator HKU_API MACD(const Indicator& data,
int n1 = 12, int n2 = 26, int n3 = 9);
} /* namespace */
#endif /* MACD_H_ */