hikyuu2/hikyuu_cpp/hikyuu/indicator/crt/BARSSINCE.h
2019-05-04 21:53:10 +08:00

41 lines
789 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.

/*
* BARSSINCE.h
*
* Copyright (c) 2019 hikyuu.org
*
* Created on: 2019-5-4
* Author: fasiondog
*/
#ifndef INDICATOR_CRT_BARSSINCE_H_
#define INDICATOR_CRT_BARSSINCE_H_
#include "CVAL.h"
namespace hku {
/**
* 第一个条件成立位置到当前的周期数。
* @details
* <pre>
* 用法BARSSINCE(X):第一次X不为0到现在的天数。
* 例如BARSSINCE(HIGH>10)表示股价超过10元时到当前的周期数
* </pre>
* @ingroup Indicator
*/
Indicator HKU_API BARSSINCE();
Indicator BARSSINCE(price_t);
Indicator BARSSINCE(const Indicator& ind);
inline Indicator BARSSINCE(const Indicator& ind) {
return BARSSINCE()(ind);
}
inline Indicator BARSSINCE(price_t val) {
return BARSSINCE(CVAL(val));
}
}
#endif /* INDICATOR_CRT_BARSSINCE_H_ */