mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-03 12:27:48 +08:00
TradeManagerBase补充冻结资金接口
This commit is contained in:
parent
2008640875
commit
8189538924
@ -322,6 +322,13 @@ public:
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前冻结现金
|
||||
*/
|
||||
virtual price_t currentFrozen() const {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期的现金
|
||||
* @note 如果不带日期参数,无法根据权息信息调整持仓
|
||||
|
@ -51,6 +51,10 @@ public:
|
||||
PYBIND11_OVERRIDE_NAME(price_t, TradeManagerBase, "current_cash", currentCash);
|
||||
}
|
||||
|
||||
price_t currentFrozen() const override {
|
||||
PYBIND11_OVERRIDE_NAME(price_t, TradeManagerBase, "current_frozen", currentFrozen);
|
||||
}
|
||||
|
||||
price_t cash(const Datetime& datetime, KQuery::KType ktype) override {
|
||||
PYBIND11_OVERLOAD(price_t, TradeManagerBase, cash, datetime, ktype);
|
||||
}
|
||||
@ -281,6 +285,10 @@ void export_TradeManager(py::module& m) {
|
||||
|
||||
默认情况下,TradeManager会在执行买入/卖出操作时,调用订单代理执行代理的买入/卖出动作,但这样在实盘操作时会存在问题。因为系统在计算信号指示时,需要回溯历史数据才能得到最新的信号,这样TradeManager会在历史时刻就执行买入/卖出操作,此时如果订单代理本身没有对发出买入/卖出指令的时刻进行控制,会导致代理发送错误的指令。此时,需要指定在某一个时刻之后,才允许指定订单代理的买入/卖出操作。属性 brokeLastDatetime 即用于指定该时刻。)")
|
||||
|
||||
.def("current_frozen", &TradeManagerBase::currentFrozen, R"(frozen(self)
|
||||
|
||||
获取当前冻结资金)")
|
||||
|
||||
.def("getParam", &TradeManagerBase::getParam<boost::any>, R"(get_param(self, name)
|
||||
|
||||
获取指定的参数
|
||||
|
Loading…
Reference in New Issue
Block a user