hikyuu2/hikyuu_pywrap/_MarketInfo.cpp

50 lines
1.8 KiB
C++
Raw Normal View History

2015-01-07 01:26:14 +08:00
/*
* _MarketInfo.cpp
*
* Created on: 2012-9-27
* Author: fasiondog
*/
#include <boost/python.hpp>
#include <hikyuu/serialization/MarketInfo_serialization.h>
#include "pickle_support.h"
using namespace boost::python;
using namespace hku;
void export_MarketInfo() {
2020-07-08 00:18:51 +08:00
class_<MarketInfo>("MarketInfo", "市场信息记录", init<>())
2020-10-31 00:07:18 +08:00
.def(init<const string&, const string&, const string&, const string&, const Datetime&,
TimeDelta, TimeDelta, TimeDelta, TimeDelta>())
2020-07-08 00:18:51 +08:00
//.def(self_ns::str(self))
.def("__str__", &MarketInfo::toString)
.add_property("market",
make_function(&MarketInfo::market, return_value_policy<copy_const_reference>()),
"市场标识沪市“SH”, 深市“SZ”")
.add_property("name",
make_function(&MarketInfo::name, return_value_policy<copy_const_reference>()),
"市场全称")
.add_property(
"description",
make_function(&MarketInfo::description, return_value_policy<copy_const_reference>()),
"描述说明")
.add_property("code",
make_function(&MarketInfo::code, return_value_policy<copy_const_reference>()),
"该市场对应的主要指数代码,用于获取交易日历")
2020-07-12 20:46:34 +08:00
.add_property("last_datetime", &MarketInfo::lastDate, "该市场K线数据最后交易日期")
2020-10-31 00:07:18 +08:00
.add_property("open_time1", &MarketInfo::openTime1, "开市时间1")
.add_property("close_time1", &MarketInfo::closeTime1, "闭市时间1")
.add_property("open_time2", &MarketInfo::openTime2, "开市时间2")
.add_property("close_time2", &MarketInfo::closeTime2, "闭市时间2")
2020-07-08 00:18:51 +08:00
2015-01-07 01:26:14 +08:00
#if HKU_PYTHON_SUPPORT_PICKLE
2020-07-08 00:18:51 +08:00
.def_pickle(normal_pickle_suite<MarketInfo>())
2015-01-07 01:26:14 +08:00
#endif
2020-07-08 00:18:51 +08:00
;
2015-01-07 01:26:14 +08:00
}