hikyuu2/hikyuu_cpp/hikyuu/indicator/crt/CEILING.h
2019-11-10 23:31:41 +08:00

39 lines
734 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.

/*
* CEILING.h
*
* Copyright (c) 2019 hikyuu.org
*
* Created on: 2019-4-15
* Author: fasiondog
*/
#pragma once
#ifndef INDICATOR_CRT_CEIL_H_
#define INDICATOR_CRT_CEIL_H_
#include "CVAL.h"
namespace hku {
/**
* 向上舍入 (向数值增大方向舍入)
* 用法CEILING(A)返回沿A数值增大方向最接近的整数
* 例如CEILING(12.3)求得13CEILING(-3.5)求得-3
* @ingroup Indicator
*/
Indicator HKU_API CEILING();
Indicator CEILING(price_t);
Indicator CEILING(const Indicator& ind);
inline Indicator CEILING(const Indicator& ind) {
return CEILING()(ind);
}
inline Indicator CEILING(price_t val) {
return CEILING(CVAL(val));
}
} // namespace hku
#endif /* INDICATOR_CRT_CEIL_H_ */