mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-02 11:58:21 +08:00
31 lines
863 B
C++
31 lines
863 B
C++
/*
|
|
* _KRecord.cpp
|
|
*
|
|
* Created on: 2019-1-27
|
|
* Author: fasiondog
|
|
*/
|
|
|
|
#include <hikyuu/serialization/TimeLineRecord_serialization.h>
|
|
#include "pybind_utils.h"
|
|
|
|
using namespace hku;
|
|
namespace py = pybind11;
|
|
|
|
#if defined(_MSC_VER)
|
|
#pragma warning(disable : 4267)
|
|
#endif
|
|
|
|
void export_TimeLineReord(py::module& m) {
|
|
py::class_<TimeLineRecord>(m, "TimeLineRecord", "分时线记录,属性可读写")
|
|
.def(py::init<>())
|
|
.def(py::init<const Datetime&, price_t, price_t>())
|
|
.def("__str__", to_py_str<TimeLineRecord>)
|
|
.def("__repr__", to_py_str<TimeLineRecord>)
|
|
.def_readwrite("date", &TimeLineRecord::datetime, "日期时间")
|
|
.def_readwrite("price", &TimeLineRecord::price, "价格")
|
|
.def_readwrite("vol", &TimeLineRecord::vol, "成交量")
|
|
.def(py::self == py::self)
|
|
|
|
DEF_PICKLE(TimeLineRecord);
|
|
}
|