hikyuu2/hikyuu_cpp/hikyuu/indicator/crt/POW.h
2019-04-14 11:17:47 +08:00

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

/*
* POW.h
*
* Copyright (c) 2019 hikyuu.org
*
* Created on: 2019-4-2
* Author: fasiondog
*/
#ifndef INDICATOR_CRT_POW_H_
#define INDICATOR_CRT_POW_H_
#include "CVAL.h"
namespace hku {
/**
* 乘幂
* @details
* <pre>
* 用法POW(A,B)返回A的B次幂
* 例如POW(CLOSE,3)求得收盘价的3次方
* </pre>
* @ingroup Indicator
*/
Indicator HKU_API POW(int n);
Indicator POW(price_t, int n);
Indicator POW(const Indicator& ind, int n);
inline Indicator POW(const Indicator& ind, int n) {
return POW(n)(ind);
}
inline Indicator POW(price_t val, int n) {
return POW(CVAL(val), n);
}
} /* namespace */
#endif /* INDICATOR_CRT_POW_H_ */