-
Notifications
You must be signed in to change notification settings - Fork 557
/
_FundsRecord.cpp
33 lines (28 loc) · 1.21 KB
/
_FundsRecord.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* _FundsRecord.cpp
*
* Created on: 2013-5-2
* Author: fasiondog
*/
#include <boost/python.hpp>
#include <hikyuu/trade_manage/FundsRecord.h>
#include "../pickle_support.h"
using namespace boost::python;
using namespace hku;
void export_FundsRecord() {
class_<FundsRecord>("FundsRecord", "当前资产情况记录", init<>())
.def(self_ns::str(self))
.def(self_ns::repr(self))
.def_readwrite("cash", &FundsRecord::cash, "当前现金(float)")
.def_readwrite("market_value", &FundsRecord::market_value, "当前多头市值(float)")
.def_readwrite("short_market_value", &FundsRecord::short_market_value,
"当前空头仓位市值(float)")
.def_readwrite("base_cash", &FundsRecord::base_cash, "当前投入本金(float)")
.def_readwrite("base_asset", &FundsRecord::base_asset, "当前投入的资产价值(float)")
.def_readwrite("borrow_cash", &FundsRecord::borrow_cash, "当前借入的资金(float),即负债")
.def_readwrite("borrow_asset", &FundsRecord::borrow_asset, "当前借入证券资产价值(float)")
#if HKU_PYTHON_SUPPORT_PICKLE
.def_pickle(normal_pickle_suite<FundsRecord>())
#endif
;
}