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

75 lines
2.8 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.

/*
* _build_in.cpp
*
* Created on: 2013-2-14
* Author: fasiondog
*/
#include <hikyuu/trade_manage/build_in.h>
#include "../pybind_utils.h"
using namespace hku;
namespace py = pybind11;
void export_build_in(py::module& m) {
m.def(
"crtTM", crtTM, py::arg("date") = Datetime(199001010000LL), py::arg("init_cash") = 100000,
py::arg("cost_func") = TC_Zero(), py::arg("name") = "SYS",
R"(crtTM([date = Datetime(199001010000), init_cash = 100000, cost_func = TC_Zero(), name = "SYS"])
使
:param Datetime date:
:param float init_cash:
:param TradeCost cost_func:
:param string name:
:rtype: TradeManager)");
m.def("TC_TestStub", TC_TestStub, "仅用于测试");
m.def(
"TC_FixedA", TC_FixedA, py::arg("commission") = 0.0018, py::arg("lowest_commission") = 5.0,
py::arg("stamptax") = 0.001, py::arg("transferfee") = 0.001,
py::arg("lowest_transferfee") = 1.0,
R"(TC_FixedA([commission=0.0018, lowestCommission=5.0, stamptax=0.001, transferfee=0.001, lowestTransferfee=1.0])
201581A股交易成本算法
:param float commission:
:param float lowestCommission:
:param float stamptax:
:param float transferfee:
:param float lowestTransferfee:
:return: :py:class:`TradeCostBase` )");
m.def(
"TC_FixedA2015", TC_FixedA2015, py::arg("commission") = 0.0018,
py::arg("lowest_commission") = 5.0, py::arg("stamptax") = 0.001,
py::arg("transferfee") = 0.00002,
R"(TC_FixedA2015([commission=0.0018, lowestCommission=5.0, stamptax=0.001, transferfee=0.00002])
2015810.02
:param float commission:
:param float lowestCommission:
:param float stamptax:
:param float transferfee:
:return: :py:class:`TradeCostBase` )");
m.def(
"TC_FixedA2017", TC_FixedA2017, py::arg("commission") = 0.0018,
py::arg("lowest_commission") = 5.0, py::arg("stamptax") = 0.001,
py::arg("transferfee") = 0.00002,
R"(TC_FixedA2015([commission=0.0018, lowestCommission=5.0, stamptax=0.001, transferfee=0.00002])
2017110.02
:param float commission:
:param float lowestCommission:
:param float stamptax:
:param float transferfee:
:return: :py:class:`TradeCostBase` )");
m.def("TC_Zero", TC_Zero, "零交易成本算法");
}