hikyuu2/hikyuu_cpp/hikyuu/indicator/crt/INTPART.h

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

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