hikyuu2/hikyuu_cpp/hikyuu/indicator/crt/ROUNDUP.h
2019-04-15 00:58:41 +08:00

36 lines
663 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.

/*
* ROUNDUP.h
*
* Copyright (c) 2019 hikyuu.org
*
* Created on: 2019-4-14
* Author: fasiondog
*/
#ifndef INDICATOR_CRT_ROUNDUP_H_
#define INDICATOR_CRT_ROUNDUP_H_
#include "CVAL.h"
namespace hku {
/**
* 向上截取如10.1截取后为11
* @ingroup Indicator
*/
Indicator HKU_API ROUNDUP(int ndigits = 2);
Indicator ROUNDUP(price_t, int ndigits = 2);
Indicator ROUNDUP(const Indicator& ind, int ndigits = 2);
inline Indicator ROUNDUP(const Indicator& ind, int n) {
return ROUNDUP(n)(ind);
}
inline Indicator ROUNDUP(price_t val, int n) {
return ROUNDUP(CVAL(val), n);
}
} /* namespace */
#endif /* INDICATOR_CRT_ROUNDUP_H_ */