add get_kdate(str, Query); fixed RSI 缺失 inline

This commit is contained in:
fasiondog 2024-01-21 03:18:07 +08:00
parent 05116ffa33
commit a0c3155654
3 changed files with 5 additions and 3 deletions

View File

@ -13,6 +13,7 @@
#include "Stock.h"
#include "StockManager.h"
#include "utilities/Parameter.h"
#include "indicator/build_in.h"
#include "trade_manage/build_in.h"
#include "trade_sys/all.h"

View File

@ -19,7 +19,7 @@ namespace hku {
*
* @ingroup Indicator
*/
Indicator RSI(int n = 14) {
inline Indicator RSI(int n = 14) {
Indicator diff = REF(0) - REF(1);
Indicator u = IF(diff > 0, diff, 0);
Indicator d = IF(diff < 0, (-1) * diff, 0);
@ -34,11 +34,10 @@ Indicator RSI(int n = 14) {
return rsi;
}
Indicator RSI(const Indicator& data, int n) {
inline Indicator RSI(const Indicator& data, int n) {
return RSI(n)(data);
}
} // namespace hku
#endif /* INDICATOR_CRT_RSI_H_ */

View File

@ -111,6 +111,8 @@ PYBIND11_MODULE(core, m) {
int64_t null_int64 = Null<int64_t>();
Datetime null_date = Null<Datetime>();
m.def("get_kdata", py::overload_cast<const string&, const KQuery&>(getKData));
m.def("get_kdata",
py::overload_cast<const string&, int64_t, int64_t, KQuery::KType, KQuery::RecoverType>(
getKData),