hikyuu2/hikyuu_pywrap/_MarketInfo.cpp

45 lines
1.4 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<>())
.def(init<const string&, const string&, const string&, const string&, const Datetime&>())
//.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>()),
"该市场对应的主要指数代码,用于获取交易日历")
.add_property("last_date", &MarketInfo::lastDate, "该市场K线数据最后交易日期")
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
}