hikyuu2/hikyuu_pywrap/trade_manage/_CostRecord.cpp
2023-12-27 02:51:33 +08:00

39 lines
1.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* _CostRecord.cpp
*
* Created on: 2013-2-13
* Author: fasiondog
*/
#include <hikyuu/trade_manage/CostRecord.h>
#include "../pybind_utils.h"
namespace py = pybind11;
using namespace hku;
void export_CostRecord(py::module& m) {
py::class_<CostRecord>(m, "CostRecord", R"(成本记录
= + + +
struct直接使用
)")
.def(py::init<>())
.def(py::init<price_t, price_t, price_t, price_t, price_t>(), py::arg("commission"),
py::arg("stamptax"), py::arg("transferfee"), py::arg("others"), py::arg("total"))
.def("__str__", to_py_str<CostRecord>)
.def("__repr__", to_py_str<CostRecord>)
.def_readwrite("commission", &CostRecord::commission, "佣金")
.def_readwrite("stamptax", &CostRecord::stamptax, "印花税")
.def_readwrite("transferfee", &CostRecord::transferfee, "过户费")
.def_readwrite("others", &CostRecord::others, "其他费用")
.def_readwrite("total", &CostRecord::total,
"总成本(float)= 佣金 + 印花税 + 过户费 + 其它费用")
.def(py::self == py::self)
DEF_PICKLE(CostRecord);
}