hikyuu2/hikyuu_cpp/hikyuu/indicator/crt/SUMBARS.h
2019-05-05 01:44:21 +08:00

36 lines
733 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.

/*
* SUMBARS.h
*
* Copyright (c) 2019 hikyuu.org
*
* Created on: 2019-5-4
* Author: fasiondog
*/
#ifndef INDICATOR_CRT_SUMBARS_H_
#define INDICATOR_CRT_SUMBARS_H_
#include "CVAL.h"
namespace hku {
/**
* 累加到指定周期数, 向前累加到指定值到现在的周期数
* @details
* <pre>
* 用法SUMBARS(X,A):将X向前累加直到大于等于A,返回这个区间的周期数
* 例如SUMBARS(VOL,CAPITAL)求完全换手到现在的周期数
* </pre>
* @ingroup Indicator
*/
Indicator HKU_API SUMBARS(double a);
Indicator SUMBARS(const Indicator& ind, double a);
inline Indicator SUMBARS(const Indicator& ind, double a) {
return SUMBARS(a)(ind);
}
}
#endif /* INDICATOR_CRT_SUMBARS_H_ */