mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-05 05:17:47 +08:00
34 lines
532 B
C++
34 lines
532 B
C++
/*
|
|
* SGN.h
|
|
*
|
|
* Created on: 2019年4月1日
|
|
* Author: fasiondog
|
|
*/
|
|
|
|
#ifndef INDICATOR_CRT_SGN_H_
|
|
#define INDICATOR_CRT_SGN_H_
|
|
|
|
#include "CVAL.h"
|
|
|
|
namespace hku {
|
|
|
|
/**
|
|
* 求符号值, SGN(X),当 X>0, X=0, X<0分别返回 1, 0, -1。
|
|
* @ingroup Indicator
|
|
*/
|
|
Indicator HKU_API SGN();
|
|
Indicator SGN(price_t);
|
|
Indicator SGN(const Indicator& ind);
|
|
|
|
inline Indicator SGN(const Indicator& ind) {
|
|
return SGN()(ind);
|
|
}
|
|
|
|
inline Indicator SGN(price_t val) {
|
|
return SGN(CVAL(val));
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* INDICATOR_CRT_SGN_H_ */
|