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

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

/*
* BARSLAST.h
*
* Copyright (c) 2019 hikyuu.org
*
* Created on: 2019-5-4
* Author: fasiondog
*/
#ifndef INDICATOR_CRT_BARSLAST_H_
#define INDICATOR_CRT_BARSLAST_H_
#include "CVAL.h"
namespace hku {
/**
* 上一次条件成立位置, 上一次条件成立到当前的周期数。
* @details
* <pre>
* 用法BARSLAST(X): 上一次 X 不为 0 到现在的天数。
* 例如BARSLAST(CLOSE/REF(CLOSE,1)>=1.1) 表示上一个涨停板到当前的周期数。
* </pre>
* @ingroup Indicator
*/
Indicator HKU_API BARSLAST();
Indicator BARSLAST(price_t);
Indicator BARSLAST(const Indicator& ind);
inline Indicator BARSLAST(const Indicator& ind) {
return BARSLAST()(ind);
}
inline Indicator BARSLAST(price_t val) {
return BARSLAST(CVAL(val));
}
}
#endif /* INDICATOR_CRT_BARSLAST_H_ */