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

43 lines
945 B
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.

/*
* COUNT.h
*
* Created on: 2019-3-25
* Author: fasiondog
*/
#ifndef COUNT_H_
#define COUNT_H_
#include "../Indicator.h"
namespace hku {
/**
* 统计总数 统计满足条件的周期数。
* @details
* <pre>
* 用法COUNT(X,N),统计N周期中满足X条件的周期数,若N=0则从第一个有效值开始。
* 例如COUNT(CLOSE>OPEN,20)表示统计20周期内收阳的周期数
* </pre>
* @param n 周期数
* @ingroup Indicator
*/
Indicator HKU_API COUNT(int n=20);
/**
* 统计总数 统计满足条件的周期数。
* @details
* <pre>
* 用法COUNT(X,N),统计N周期中满足X条件的周期数,若N=0则从第一个有效值开始。
* 例如COUNT(CLOSE>OPEN,20)表示统计20周期内收阳的周期数
* </pre>
* @param ind 待统计指标
* @param n 周期数
* @ingroup Indicator
*/
Indicator HKU_API COUNT(const Indicator& ind, int n = 20);
} /* namespace */
#endif /* CVAL_H_ */