Skip to content

Commit

Permalink
KQuery的recoverType可设定
Browse files Browse the repository at this point in the history
  • Loading branch information
fasiondog committed Jan 25, 2022
1 parent a240375 commit 72ac855
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions hikyuu_cpp/hikyuu/KQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ class HKU_API KQuery {
return m_recoverType;
}

/** 设置复权类型 */
void recoverType(RecoverType recoverType) {
m_recoverType = recoverType;
}

/** 获取queryType名称,用于显示输出 */
static string getQueryTypeName(QueryType);

Expand Down
6 changes: 5 additions & 1 deletion hikyuu_pywrap/_KQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
using namespace boost::python;
using namespace hku;

KQuery::RecoverType (KQuery::*get_recoverType)() const = &KQuery::recoverType;
void (KQuery::*set_recoverType)(KQuery::RecoverType recoverType) = &KQuery::recoverType;

void export_KQuery() {
scope in_Query =
class_<KQuery>("Query", "K线数据查询条件", init<>())
Expand All @@ -31,7 +34,8 @@ void export_KQuery() {
"结束日期,当按索引查询方式创建时无效,为 constant.null_datetime")
.add_property("query_type", &KQuery::queryType, "查询方式 Query.QueryType")
.add_property("ktype", &KQuery::kType, "查询的K线类型 Query.KType")
.add_property("recover_type", &KQuery::recoverType, "查询的复权类型 Query.RecoverType")
.add_property("recover_type", get_recoverType, set_recoverType,
"查询的复权类型 Query.RecoverType")

#if HKU_PYTHON_SUPPORT_PICKLE
.def_pickle(normal_pickle_suite<KQuery>())
Expand Down

0 comments on commit 72ac855

Please sign in to comment.