diff --git a/vnpy/api/xtp/vnxtp.pyd b/vnpy/api/xtp/vnxtp.pyd index d57d9351..daeddc00 100644 Binary files a/vnpy/api/xtp/vnxtp.pyd and b/vnpy/api/xtp/vnxtp.pyd differ diff --git a/vnpy/api/xtp/vnxtp.pyi b/vnpy/api/xtp/vnxtp.pyi index d3e4a8da..80668a54 100644 --- a/vnpy/api/xtp/vnxtp.pyi +++ b/vnpy/api/xtp/vnxtp.pyi @@ -320,6 +320,7 @@ class XTPQueryAssetRsp(): captial_asset: float force_freeze_amount: float preferred_amount: float + repay_stock_aval_banlance: float unknown: List[int] @@ -494,6 +495,124 @@ class XTPQueryOptionAuctionInfoRsp(): unknown: List[int] +class XTPCrdCashRepayRsp(): + + + xtp_id: int + request_amount: float + cash_repay_amount: float + + +class XTPCrdCashRepayDebtInterestFeeRsp(): + + + xtp_id: int + request_amount: float + cash_repay_amount: float + debt_compact_id: str + unknow: str + + +class XTPCrdCashRepayInfo(): + + + xtp_id: int + status: XTP_CRD_CR_STATUS + request_amount: float + cash_repay_amount: float + position_effect: int + error_info: XTPRspInfoStruct + + +class XTPCrdDebtInfo(): + + + debt_type: int + debt_id: str + position_id: int + order_xtp_id: int + debt_status: int + market: XTP_MARKET_TYPE + ticker: str + order_date: int + end_date: int + orig_end_date: int + is_extended: bool + remain_amt: float + remain_qty: int + remain_principal: float + due_right_qty: int + unknown: List[int] + + +class XTPCrdFundInfo(): + + + maintenance_ratio: float + all_asset: float + all_debt: float + line_of_credit: float + guaranty: float + position_amount: float + + +class XTPClientQueryCrdDebtStockReq(): + + + market: XTP_MARKET_TYPE + ticker: str + + +class XTPCrdDebtStockInfo(): + + + market: XTP_MARKET_TYPE + ticker: str + remain_quantity: int + order_withhold_quantity: int + + +class XTPClientQueryCrdPositionStockReq(): + + + market: XTP_MARKET_TYPE + ticker: str + + +class XTPClientQueryCrdPositionStkInfo(): + + + market: XTP_MARKET_TYPE + ticker: str + limit_qty: int + yesterday_qty: int + left_qty: int + frozen_qty: int + + +class XTPClientQueryCrdSurplusStkReqInfo(): + + + market: XTP_MARKET_TYPE + ticker: str + + +class XTPClientQueryCrdSurplusStkRspInfo(): + + + market: XTP_MARKET_TYPE + ticker: str + transferable_quantity: int + transferred_quantity: int + + +class XTPClientCrdExtendDebtInfo(): + + + xtp_id: int + debt_id: str + + class XTPFundTransferReq(): @@ -596,6 +715,8 @@ class XTP_ACCOUNT_TYPE(Enum): class XTP_FUND_TRANSFER_TYPE(Enum): XTP_FUND_TRANSFER_OUT: XTP_FUND_TRANSFER_TYPE XTP_FUND_TRANSFER_IN: XTP_FUND_TRANSFER_TYPE + XTP_FUND_INTER_TRANSFER_OUT: XTP_FUND_TRANSFER_TYPE + XTP_FUND_INTER_TRANSFER_IN: XTP_FUND_TRANSFER_TYPE XTP_FUND_TRANSFER_UNKNOWN: XTP_FUND_TRANSFER_TYPE class XTP_FUND_OPER_STATUS(Enum): XTP_FUND_OPER_PROCESSING: XTP_FUND_OPER_STATUS @@ -622,6 +743,10 @@ class XTP_POSITION_DIRECTION_TYPE(Enum): XTP_POSITION_DIRECTION_LONG: XTP_POSITION_DIRECTION_TYPE XTP_POSITION_DIRECTION_SHORT: XTP_POSITION_DIRECTION_TYPE XTP_POSITION_DIRECTION_COVERED: XTP_POSITION_DIRECTION_TYPE +class XTP_CRD_CR_STATUS(Enum): + XTP_CRD_CR_INIT: XTP_CRD_CR_STATUS + XTP_CRD_CR_SUCCESS: XTP_CRD_CR_STATUS + XTP_CRD_CR_FAILED: XTP_CRD_CR_STATUS class XTP_MARKETDATA_TYPE(Enum): XTP_MARKETDATA_ACTUAL: XTP_MARKETDATA_TYPE XTP_MARKETDATA_OPTION: XTP_MARKETDATA_TYPE @@ -648,6 +773,7 @@ XTP_TBT_TYPE = XTP_TBT_TYPE XTP_OPT_CALL_OR_PUT_TYPE = XTP_OPT_CALL_OR_PUT_TYPE XTP_OPT_EXERCISE_TYPE_TYPE = XTP_OPT_EXERCISE_TYPE_TYPE XTP_POSITION_DIRECTION_TYPE = XTP_POSITION_DIRECTION_TYPE +XTP_CRD_CR_STATUS = XTP_CRD_CR_STATUS TXTPTradeTypeType = int TXTPOrderTypeType = int XTPRI = XTPRspInfoStruct @@ -662,6 +788,15 @@ XTPQueryTradeRsp = XTPTradeReport XTPFundTransferLog = XTPFundTransferNotice XTPQueryETFBaseRsp = XTPQueryETFBaseRsp XTPQueryETFComponentReq = XTPQueryETFComponentReq +XTPCrdDebtInfo = XTPCrdDebtInfo +XTPCrdFundInfo = XTPCrdFundInfo +XTPClientQueryCrdDebtStockReq = XTPClientQueryCrdDebtStockReq +XTPCrdDebtStockInfo = XTPCrdDebtStockInfo +XTPClientQueryCrdPositionStockReq = XTPClientQueryCrdPositionStockReq +XTPClientQueryCrdPositionStkInfo = XTPClientQueryCrdPositionStkInfo +XTPClientQueryCrdSurplusStkReqInfo = XTPClientQueryCrdSurplusStkReqInfo +XTPClientQueryCrdSurplusStkRspInfo = XTPClientQueryCrdSurplusStkRspInfo +XTPClientCrdExtendDebtInfo = XTPClientCrdExtendDebtInfo XTPFundTransferAck = XTPFundTransferNotice XTP_VERSION_LEN: int XTP_TRADING_DAY_LEN: int @@ -672,6 +807,7 @@ XTP_ORDER_EXCH_LEN: int XTP_EXEC_ID_LEN: int XTP_BRANCH_PBU_LEN: int XTP_ACCOUNT_NAME_LEN: int +XTP_CREDIT_DEBT_ID_LEN: int XTP_SIDE_BUY: int XTP_SIDE_SELL: int XTP_SIDE_PURCHASE: int @@ -684,8 +820,10 @@ XTP_SIDE_MARGIN_TRADE: int XTP_SIDE_SHORT_SELL: int XTP_SIDE_REPAY_MARGIN: int XTP_SIDE_REPAY_STOCK: int -XTP_SIDE_CASH_REPAY_MARGIN: int XTP_SIDE_STOCK_REPAY_STOCK: int +XTP_SIDE_SURSTK_TRANS: int +XTP_SIDE_GRTSTK_TRANSIN: int +XTP_SIDE_GRTSTK_TRANSOUT: int XTP_SIDE_UNKNOWN: int XTP_POSITION_EFFECT_INIT: int XTP_POSITION_EFFECT_OPEN: int @@ -695,10 +833,15 @@ XTP_POSITION_EFFECT_CLOSETODAY: int XTP_POSITION_EFFECT_CLOSEYESTERDAY: int XTP_POSITION_EFFECT_FORCEOFF: int XTP_POSITION_EFFECT_LOCALFORCECLOSE: int +XTP_POSITION_EFFECT_CREDIT_FORCE_COVER: int +XTP_POSITION_EFFECT_CREDIT_FORCE_CLEAR: int +XTP_POSITION_EFFECT_CREDIT_FORCE_DEBT: int +XTP_POSITION_EFFECT_CREDIT_FORCE_UNCOND: int XTP_POSITION_EFFECT_UNKNOWN: int XTP_TRDT_COMMON: int XTP_TRDT_CASH: int XTP_TRDT_PRIMARY: int +XTP_TRDT_CROSS_MKT_CASH: int XTP_ORDT_Normal: int XTP_ORDT_DeriveFromQuote: int XTP_ORDT_DeriveFromCombination: int diff --git a/vnpy/api/xtp/vnxtp/generated_files/generated_functions.h b/vnpy/api/xtp/vnxtp/generated_files/generated_functions.h index 13120854..dd7069db 100644 --- a/vnpy/api/xtp/vnxtp/generated_files/generated_functions.h +++ b/vnpy/api/xtp/vnxtp/generated_files/generated_functions.h @@ -49,6 +49,18 @@ void generate_class_XTPQueryIPOTickerRsp(pybind11::object & parent); void generate_class_XTPQueryIPOQuotaRsp(pybind11::object & parent); void generate_class_XTPQueryOptionAuctionInfoReq(pybind11::object & parent); void generate_class_XTPQueryOptionAuctionInfoRsp(pybind11::object & parent); +void generate_class_XTPCrdCashRepayRsp(pybind11::object & parent); +void generate_class_XTPCrdCashRepayDebtInterestFeeRsp(pybind11::object & parent); +void generate_class_XTPCrdCashRepayInfo(pybind11::object & parent); +void generate_class_XTPCrdDebtInfo(pybind11::object & parent); +void generate_class_XTPCrdFundInfo(pybind11::object & parent); +void generate_class_XTPClientQueryCrdDebtStockReq(pybind11::object & parent); +void generate_class_XTPCrdDebtStockInfo(pybind11::object & parent); +void generate_class_XTPClientQueryCrdPositionStockReq(pybind11::object & parent); +void generate_class_XTPClientQueryCrdPositionStkInfo(pybind11::object & parent); +void generate_class_XTPClientQueryCrdSurplusStkReqInfo(pybind11::object & parent); +void generate_class_XTPClientQueryCrdSurplusStkRspInfo(pybind11::object & parent); +void generate_class_XTPClientCrdExtendDebtInfo(pybind11::object & parent); void generate_class_XTPFundTransferReq(pybind11::object & parent); void generate_enum_XTP_LOG_LEVEL(pybind11::object & parent); void generate_enum_XTP_PROTOCOL_TYPE(pybind11::object & parent); @@ -70,6 +82,7 @@ void generate_enum_XTP_TBT_TYPE(pybind11::object & parent); void generate_enum_XTP_OPT_CALL_OR_PUT_TYPE(pybind11::object & parent); void generate_enum_XTP_OPT_EXERCISE_TYPE_TYPE(pybind11::object & parent); void generate_enum_XTP_POSITION_DIRECTION_TYPE(pybind11::object & parent); +void generate_enum_XTP_CRD_CR_STATUS(pybind11::object & parent); void generate_enum_XTP_MARKETDATA_TYPE(pybind11::object & parent); void generate_caster_(pybind11::object & parent); diff --git a/vnpy/api/xtp/vnxtp/generated_files/generated_functions_0.cpp b/vnpy/api/xtp/vnxtp/generated_files/generated_functions_0.cpp index 1abe46a2..485f7e3c 100644 --- a/vnpy/api/xtp/vnxtp/generated_files/generated_functions_0.cpp +++ b/vnpy/api/xtp/vnxtp/generated_files/generated_functions_0.cpp @@ -49,6 +49,18 @@ void generate_vnxtp(pybind11::module & parent) generate_class_XTPQueryIPOQuotaRsp(parent); generate_class_XTPQueryOptionAuctionInfoReq(parent); generate_class_XTPQueryOptionAuctionInfoRsp(parent); + generate_class_XTPCrdCashRepayRsp(parent); + generate_class_XTPCrdCashRepayDebtInterestFeeRsp(parent); + generate_class_XTPCrdCashRepayInfo(parent); + generate_class_XTPCrdDebtInfo(parent); + generate_class_XTPCrdFundInfo(parent); + generate_class_XTPClientQueryCrdDebtStockReq(parent); + generate_class_XTPCrdDebtStockInfo(parent); + generate_class_XTPClientQueryCrdPositionStockReq(parent); + generate_class_XTPClientQueryCrdPositionStkInfo(parent); + generate_class_XTPClientQueryCrdSurplusStkReqInfo(parent); + generate_class_XTPClientQueryCrdSurplusStkRspInfo(parent); + generate_class_XTPClientCrdExtendDebtInfo(parent); generate_class_XTPFundTransferReq(parent); generate_enum_XTP_LOG_LEVEL(parent); generate_enum_XTP_PROTOCOL_TYPE(parent); @@ -70,6 +82,7 @@ void generate_vnxtp(pybind11::module & parent) generate_enum_XTP_OPT_CALL_OR_PUT_TYPE(parent); generate_enum_XTP_OPT_EXERCISE_TYPE_TYPE(parent); generate_enum_XTP_POSITION_DIRECTION_TYPE(parent); + generate_enum_XTP_CRD_CR_STATUS(parent); generate_enum_XTP_MARKETDATA_TYPE(parent); parent.attr("XTP_VERSION_LEN") = XTP_VERSION_LEN; parent.attr("XTP_TRADING_DAY_LEN") = XTP_TRADING_DAY_LEN; @@ -80,6 +93,7 @@ void generate_vnxtp(pybind11::module & parent) parent.attr("XTP_EXEC_ID_LEN") = XTP_EXEC_ID_LEN; parent.attr("XTP_BRANCH_PBU_LEN") = XTP_BRANCH_PBU_LEN; parent.attr("XTP_ACCOUNT_NAME_LEN") = XTP_ACCOUNT_NAME_LEN; + parent.attr("XTP_CREDIT_DEBT_ID_LEN") = XTP_CREDIT_DEBT_ID_LEN; parent.attr("XTP_SIDE_BUY") = XTP_SIDE_BUY; parent.attr("XTP_SIDE_SELL") = XTP_SIDE_SELL; parent.attr("XTP_SIDE_PURCHASE") = XTP_SIDE_PURCHASE; @@ -92,8 +106,10 @@ void generate_vnxtp(pybind11::module & parent) parent.attr("XTP_SIDE_SHORT_SELL") = XTP_SIDE_SHORT_SELL; parent.attr("XTP_SIDE_REPAY_MARGIN") = XTP_SIDE_REPAY_MARGIN; parent.attr("XTP_SIDE_REPAY_STOCK") = XTP_SIDE_REPAY_STOCK; - parent.attr("XTP_SIDE_CASH_REPAY_MARGIN") = XTP_SIDE_CASH_REPAY_MARGIN; parent.attr("XTP_SIDE_STOCK_REPAY_STOCK") = XTP_SIDE_STOCK_REPAY_STOCK; + parent.attr("XTP_SIDE_SURSTK_TRANS") = XTP_SIDE_SURSTK_TRANS; + parent.attr("XTP_SIDE_GRTSTK_TRANSIN") = XTP_SIDE_GRTSTK_TRANSIN; + parent.attr("XTP_SIDE_GRTSTK_TRANSOUT") = XTP_SIDE_GRTSTK_TRANSOUT; parent.attr("XTP_SIDE_UNKNOWN") = XTP_SIDE_UNKNOWN; parent.attr("XTP_POSITION_EFFECT_INIT") = XTP_POSITION_EFFECT_INIT; parent.attr("XTP_POSITION_EFFECT_OPEN") = XTP_POSITION_EFFECT_OPEN; @@ -103,10 +119,15 @@ void generate_vnxtp(pybind11::module & parent) parent.attr("XTP_POSITION_EFFECT_CLOSEYESTERDAY") = XTP_POSITION_EFFECT_CLOSEYESTERDAY; parent.attr("XTP_POSITION_EFFECT_FORCEOFF") = XTP_POSITION_EFFECT_FORCEOFF; parent.attr("XTP_POSITION_EFFECT_LOCALFORCECLOSE") = XTP_POSITION_EFFECT_LOCALFORCECLOSE; + parent.attr("XTP_POSITION_EFFECT_CREDIT_FORCE_COVER") = XTP_POSITION_EFFECT_CREDIT_FORCE_COVER; + parent.attr("XTP_POSITION_EFFECT_CREDIT_FORCE_CLEAR") = XTP_POSITION_EFFECT_CREDIT_FORCE_CLEAR; + parent.attr("XTP_POSITION_EFFECT_CREDIT_FORCE_DEBT") = XTP_POSITION_EFFECT_CREDIT_FORCE_DEBT; + parent.attr("XTP_POSITION_EFFECT_CREDIT_FORCE_UNCOND") = XTP_POSITION_EFFECT_CREDIT_FORCE_UNCOND; parent.attr("XTP_POSITION_EFFECT_UNKNOWN") = XTP_POSITION_EFFECT_UNKNOWN; parent.attr("XTP_TRDT_COMMON") = XTP_TRDT_COMMON; parent.attr("XTP_TRDT_CASH") = XTP_TRDT_CASH; parent.attr("XTP_TRDT_PRIMARY") = XTP_TRDT_PRIMARY; + parent.attr("XTP_TRDT_CROSS_MKT_CASH") = XTP_TRDT_CROSS_MKT_CASH; parent.attr("XTP_ORDT_Normal") = XTP_ORDT_Normal; parent.attr("XTP_ORDT_DeriveFromQuote") = XTP_ORDT_DeriveFromQuote; parent.attr("XTP_ORDT_DeriveFromCombination") = XTP_ORDT_DeriveFromCombination; @@ -127,6 +148,15 @@ void generate_vnxtp(pybind11::module & parent) module_vnxtp::cross.record_assign(parent, "XTPFundTransferLog", "XTPFundTransferLog", "::XTPFundTransferNotice"); module_vnxtp::cross.record_assign(parent, "XTPQueryETFBaseRsp", "XTPQueryETFBaseRsp", "::XTPQueryETFBaseRsp"); module_vnxtp::cross.record_assign(parent, "XTPQueryETFComponentReq", "XTPQueryETFComponentReq", "::XTPQueryETFComponentReq"); + module_vnxtp::cross.record_assign(parent, "XTPCrdDebtInfo", "XTPCrdDebtInfo", "::XTPCrdDebtInfo"); + module_vnxtp::cross.record_assign(parent, "XTPCrdFundInfo", "XTPCrdFundInfo", "::XTPCrdFundInfo"); + module_vnxtp::cross.record_assign(parent, "XTPClientQueryCrdDebtStockReq", "XTPClientQueryCrdDebtStockReq", "::XTPClientQueryCrdDebtStockReq"); + module_vnxtp::cross.record_assign(parent, "XTPCrdDebtStockInfo", "XTPCrdDebtStockInfo", "::XTPCrdDebtStockInfo"); + module_vnxtp::cross.record_assign(parent, "XTPClientQueryCrdPositionStockReq", "XTPClientQueryCrdPositionStockReq", "::XTPClientQueryCrdPositionStockReq"); + module_vnxtp::cross.record_assign(parent, "XTPClientQueryCrdPositionStkInfo", "XTPClientQueryCrdPositionStkInfo", "::XTPClientQueryCrdPositionStkInfo"); + module_vnxtp::cross.record_assign(parent, "XTPClientQueryCrdSurplusStkReqInfo", "XTPClientQueryCrdSurplusStkReqInfo", "::XTPClientQueryCrdSurplusStkReqInfo"); + module_vnxtp::cross.record_assign(parent, "XTPClientQueryCrdSurplusStkRspInfo", "XTPClientQueryCrdSurplusStkRspInfo", "::XTPClientQueryCrdSurplusStkRspInfo"); + module_vnxtp::cross.record_assign(parent, "XTPClientCrdExtendDebtInfo", "XTPClientCrdExtendDebtInfo", "::XTPClientCrdExtendDebtInfo"); module_vnxtp::cross.record_assign(parent, "XTPFundTransferAck", "XTPFundTransferAck", "::XTPFundTransferNotice"); generate_caster_(parent); } @@ -338,6 +368,94 @@ void generate_class_XTP_API_TraderSpi(pybind11::object & parent) pybind11::return_value_policy::reference, pybind11::call_guard() ); + c.def("OnCreditCashRepay", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderSpi::OnCreditCashRepay + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("OnQueryCreditCashRepayInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderSpi::OnQueryCreditCashRepayInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("OnQueryCreditFundInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderSpi::OnQueryCreditFundInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("OnQueryCreditDebtInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderSpi::OnQueryCreditDebtInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("OnQueryCreditTickerDebtInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderSpi::OnQueryCreditTickerDebtInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("OnQueryCreditAssetDebtInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderSpi::OnQueryCreditAssetDebtInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("OnQueryCreditTickerAssignInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderSpi::OnQueryCreditTickerAssignInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("OnQueryCreditExcessStock", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderSpi::OnQueryCreditExcessStock + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTP::API::TraderSpi, c); module_vnxtp::objects.emplace("XTP::API::TraderSpi", c); } @@ -680,6 +798,94 @@ void generate_class_XTP_API_TraderApi(pybind11::object & parent) pybind11::return_value_policy::reference, pybind11::call_guard() ); + c.def("CreditCashRepay", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderApi::CreditCashRepay + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("QueryCreditCashRepayInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderApi::QueryCreditCashRepayInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("QueryCreditFundInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderApi::QueryCreditFundInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("QueryCreditDebtInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderApi::QueryCreditDebtInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("QueryCreditTickerDebtInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderApi::QueryCreditTickerDebtInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("QueryCreditAssetDebtInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderApi::QueryCreditAssetDebtInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("QueryCreditTickerAssignInfo", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderApi::QueryCreditTickerAssignInfo + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); + c.def("QueryCreditExcessStock", + autocxxpy::apply_function_transform< + autocxxpy::function_constant< + &XTP::API::TraderApi::QueryCreditExcessStock + >, + brigand::list< + > + >::value, + pybind11::return_value_policy::reference, + pybind11::call_guard() + ); AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTP::API::TraderApi, c); module_vnxtp::objects.emplace("XTP::API::TraderApi", c); } diff --git a/vnpy/api/xtp/vnxtp/generated_files/generated_functions_2.cpp b/vnpy/api/xtp/vnxtp/generated_files/generated_functions_2.cpp index ca09f299..c7228c09 100644 --- a/vnpy/api/xtp/vnxtp/generated_files/generated_functions_2.cpp +++ b/vnpy/api/xtp/vnxtp/generated_files/generated_functions_2.cpp @@ -378,6 +378,7 @@ void generate_class_XTPQueryAssetRsp(pybind11::object & parent) c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPQueryAssetRsp, "captial_asset", captial_asset); c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPQueryAssetRsp, "force_freeze_amount", force_freeze_amount); c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPQueryAssetRsp, "preferred_amount", preferred_amount); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPQueryAssetRsp, "repay_stock_aval_banlance", repay_stock_aval_banlance); c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPQueryAssetRsp, "unknown", unknown); AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPQueryAssetRsp, c); module_vnxtp::objects.emplace("XTPQueryAssetRsp", c); @@ -592,105 +593,27 @@ void generate_class_XTPQueryOptionAuctionInfoRsp(pybind11::object & parent) AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPQueryOptionAuctionInfoRsp, c); module_vnxtp::objects.emplace("XTPQueryOptionAuctionInfoRsp", c); } -void generate_class_XTPFundTransferReq(pybind11::object & parent) +void generate_class_XTPCrdCashRepayRsp(pybind11::object & parent) { - pybind11::class_ c(parent, "XTPFundTransferReq"); - if constexpr (std::is_default_constructible_v) + pybind11::class_ c(parent, "XTPCrdCashRepayRsp"); + if constexpr (std::is_default_constructible_v) c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPFundTransferReq, "serial_id", serial_id); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPFundTransferReq, "fund_account", fund_account); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPFundTransferReq, "password", password); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPFundTransferReq, "amount", amount); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPFundTransferReq, "transfer_type", transfer_type); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPFundTransferReq, c); - module_vnxtp::objects.emplace("XTPFundTransferReq", c); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayRsp, "xtp_id", xtp_id); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayRsp, "request_amount", request_amount); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayRsp, "cash_repay_amount", cash_repay_amount); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPCrdCashRepayRsp, c); + module_vnxtp::objects.emplace("XTPCrdCashRepayRsp", c); } -void generate_enum_XTP_LOG_LEVEL(pybind11::object & parent) +void generate_class_XTPCrdCashRepayDebtInterestFeeRsp(pybind11::object & parent) { - pybind11::enum_ e(parent, "XTP_LOG_LEVEL", pybind11::arithmetic()); - e.value("XTP_LOG_LEVEL_FATAL", XTP_LOG_LEVEL::XTP_LOG_LEVEL_FATAL); - e.value("XTP_LOG_LEVEL_ERROR", XTP_LOG_LEVEL::XTP_LOG_LEVEL_ERROR); - e.value("XTP_LOG_LEVEL_WARNING", XTP_LOG_LEVEL::XTP_LOG_LEVEL_WARNING); - e.value("XTP_LOG_LEVEL_INFO", XTP_LOG_LEVEL::XTP_LOG_LEVEL_INFO); - e.value("XTP_LOG_LEVEL_DEBUG", XTP_LOG_LEVEL::XTP_LOG_LEVEL_DEBUG); - e.value("XTP_LOG_LEVEL_TRACE", XTP_LOG_LEVEL::XTP_LOG_LEVEL_TRACE); - e.export_values(); - module_vnxtp::objects.emplace("XTP_LOG_LEVEL", e); -} -void generate_enum_XTP_PROTOCOL_TYPE(pybind11::object & parent) -{ - pybind11::enum_ e(parent, "XTP_PROTOCOL_TYPE", pybind11::arithmetic()); - e.value("XTP_PROTOCOL_TCP", XTP_PROTOCOL_TYPE::XTP_PROTOCOL_TCP); - e.value("XTP_PROTOCOL_UDP", XTP_PROTOCOL_TYPE::XTP_PROTOCOL_UDP); - e.export_values(); - module_vnxtp::objects.emplace("XTP_PROTOCOL_TYPE", e); -} -void generate_enum_XTP_EXCHANGE_TYPE(pybind11::object & parent) -{ - pybind11::enum_ e(parent, "XTP_EXCHANGE_TYPE", pybind11::arithmetic()); - e.value("XTP_EXCHANGE_SH", XTP_EXCHANGE_TYPE::XTP_EXCHANGE_SH); - e.value("XTP_EXCHANGE_SZ", XTP_EXCHANGE_TYPE::XTP_EXCHANGE_SZ); - e.value("XTP_EXCHANGE_UNKNOWN", XTP_EXCHANGE_TYPE::XTP_EXCHANGE_UNKNOWN); - e.export_values(); - module_vnxtp::objects.emplace("XTP_EXCHANGE_TYPE", e); -} -void generate_enum_XTP_MARKET_TYPE(pybind11::object & parent) -{ - pybind11::enum_ e(parent, "XTP_MARKET_TYPE", pybind11::arithmetic()); - e.value("XTP_MKT_INIT", XTP_MARKET_TYPE::XTP_MKT_INIT); - e.value("XTP_MKT_SZ_A", XTP_MARKET_TYPE::XTP_MKT_SZ_A); - e.value("XTP_MKT_SH_A", XTP_MARKET_TYPE::XTP_MKT_SH_A); - e.value("XTP_MKT_UNKNOWN", XTP_MARKET_TYPE::XTP_MKT_UNKNOWN); - e.export_values(); - module_vnxtp::objects.emplace("XTP_MARKET_TYPE", e); -} -void generate_enum_XTP_PRICE_TYPE(pybind11::object & parent) -{ - pybind11::enum_ e(parent, "XTP_PRICE_TYPE", pybind11::arithmetic()); - e.value("XTP_PRICE_LIMIT", XTP_PRICE_TYPE::XTP_PRICE_LIMIT); - e.value("XTP_PRICE_BEST_OR_CANCEL", XTP_PRICE_TYPE::XTP_PRICE_BEST_OR_CANCEL); - e.value("XTP_PRICE_BEST5_OR_LIMIT", XTP_PRICE_TYPE::XTP_PRICE_BEST5_OR_LIMIT); - e.value("XTP_PRICE_BEST5_OR_CANCEL", XTP_PRICE_TYPE::XTP_PRICE_BEST5_OR_CANCEL); - e.value("XTP_PRICE_ALL_OR_CANCEL", XTP_PRICE_TYPE::XTP_PRICE_ALL_OR_CANCEL); - e.value("XTP_PRICE_FORWARD_BEST", XTP_PRICE_TYPE::XTP_PRICE_FORWARD_BEST); - e.value("XTP_PRICE_REVERSE_BEST_LIMIT", XTP_PRICE_TYPE::XTP_PRICE_REVERSE_BEST_LIMIT); - e.value("XTP_PRICE_LIMIT_OR_CANCEL", XTP_PRICE_TYPE::XTP_PRICE_LIMIT_OR_CANCEL); - e.value("XTP_PRICE_TYPE_UNKNOWN", XTP_PRICE_TYPE::XTP_PRICE_TYPE_UNKNOWN); - e.export_values(); - module_vnxtp::objects.emplace("XTP_PRICE_TYPE", e); -} -void generate_enum_XTP_ORDER_ACTION_STATUS_TYPE(pybind11::object & parent) -{ - pybind11::enum_ e(parent, "XTP_ORDER_ACTION_STATUS_TYPE", pybind11::arithmetic()); - e.value("XTP_ORDER_ACTION_STATUS_SUBMITTED", XTP_ORDER_ACTION_STATUS_TYPE::XTP_ORDER_ACTION_STATUS_SUBMITTED); - e.value("XTP_ORDER_ACTION_STATUS_ACCEPTED", XTP_ORDER_ACTION_STATUS_TYPE::XTP_ORDER_ACTION_STATUS_ACCEPTED); - e.value("XTP_ORDER_ACTION_STATUS_REJECTED", XTP_ORDER_ACTION_STATUS_TYPE::XTP_ORDER_ACTION_STATUS_REJECTED); - e.export_values(); - module_vnxtp::objects.emplace("XTP_ORDER_ACTION_STATUS_TYPE", e); -} -void generate_enum_XTP_ORDER_STATUS_TYPE(pybind11::object & parent) -{ - pybind11::enum_ e(parent, "XTP_ORDER_STATUS_TYPE", pybind11::arithmetic()); - e.value("XTP_ORDER_STATUS_INIT", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_INIT); - e.value("XTP_ORDER_STATUS_ALLTRADED", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_ALLTRADED); - e.value("XTP_ORDER_STATUS_PARTTRADEDQUEUEING", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_PARTTRADEDQUEUEING); - e.value("XTP_ORDER_STATUS_PARTTRADEDNOTQUEUEING", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_PARTTRADEDNOTQUEUEING); - e.value("XTP_ORDER_STATUS_NOTRADEQUEUEING", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_NOTRADEQUEUEING); - e.value("XTP_ORDER_STATUS_CANCELED", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_CANCELED); - e.value("XTP_ORDER_STATUS_REJECTED", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_REJECTED); - e.value("XTP_ORDER_STATUS_UNKNOWN", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_UNKNOWN); - e.export_values(); - module_vnxtp::objects.emplace("XTP_ORDER_STATUS_TYPE", e); -} -void generate_enum_XTP_ORDER_SUBMIT_STATUS_TYPE(pybind11::object & parent) -{ - pybind11::enum_ e(parent, "XTP_ORDER_SUBMIT_STATUS_TYPE", pybind11::arithmetic()); - e.value("XTP_ORDER_SUBMIT_STATUS_INSERT_SUBMITTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_INSERT_SUBMITTED); - e.value("XTP_ORDER_SUBMIT_STATUS_INSERT_ACCEPTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_INSERT_ACCEPTED); - e.value("XTP_ORDER_SUBMIT_STATUS_INSERT_REJECTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_INSERT_REJECTED); - e.value("XTP_ORDER_SUBMIT_STATUS_CANCEL_SUBMITTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_CANCEL_SUBMITTED); - e.value("XTP_ORDER_SUBMIT_STATUS_CANCEL_REJECTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_CANCEL_REJECTED); - e.value("XTP_ORDER_SUBMIT_STATUS_CANCEL_ACCEPTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_CANCEL_ACCEPTED); - e.export_values(); - module_vnxtp::objects.emplace("XTP_ORDER_SUBMIT_STATUS_TYPE", e); + pybind11::class_ c(parent, "XTPCrdCashRepayDebtInterestFeeRsp"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayDebtInterestFeeRsp, "xtp_id", xtp_id); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayDebtInterestFeeRsp, "request_amount", request_amount); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayDebtInterestFeeRsp, "cash_repay_amount", cash_repay_amount); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayDebtInterestFeeRsp, "debt_compact_id", debt_compact_id); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayDebtInterestFeeRsp, "unknow", unknow); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPCrdCashRepayDebtInterestFeeRsp, c); + module_vnxtp::objects.emplace("XTPCrdCashRepayDebtInterestFeeRsp", c); } diff --git a/vnpy/api/xtp/vnxtp/generated_files/generated_functions_3.cpp b/vnpy/api/xtp/vnxtp/generated_files/generated_functions_3.cpp index 0d14f6b5..92531d50 100644 --- a/vnpy/api/xtp/vnxtp/generated_files/generated_functions_3.cpp +++ b/vnpy/api/xtp/vnxtp/generated_files/generated_functions_3.cpp @@ -11,6 +11,238 @@ #include "xtp_quote_api.h" +void generate_class_XTPCrdCashRepayInfo(pybind11::object & parent) +{ + pybind11::class_ c(parent, "XTPCrdCashRepayInfo"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayInfo, "xtp_id", xtp_id); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayInfo, "status", status); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayInfo, "request_amount", request_amount); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayInfo, "cash_repay_amount", cash_repay_amount); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayInfo, "position_effect", position_effect); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdCashRepayInfo, "error_info", error_info); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPCrdCashRepayInfo, c); + module_vnxtp::objects.emplace("XTPCrdCashRepayInfo", c); +} +void generate_class_XTPCrdDebtInfo(pybind11::object & parent) +{ + pybind11::class_ c(parent, "XTPCrdDebtInfo"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "debt_type", debt_type); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "debt_id", debt_id); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "position_id", position_id); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "order_xtp_id", order_xtp_id); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "debt_status", debt_status); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "market", market); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "ticker", ticker); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "order_date", order_date); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "end_date", end_date); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "orig_end_date", orig_end_date); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "is_extended", is_extended); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "remain_amt", remain_amt); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "remain_qty", remain_qty); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "remain_principal", remain_principal); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "due_right_qty", due_right_qty); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtInfo, "unknown", unknown); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPCrdDebtInfo, c); + module_vnxtp::objects.emplace("XTPCrdDebtInfo", c); +} +void generate_class_XTPCrdFundInfo(pybind11::object & parent) +{ + pybind11::class_ c(parent, "XTPCrdFundInfo"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdFundInfo, "maintenance_ratio", maintenance_ratio); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdFundInfo, "all_asset", all_asset); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdFundInfo, "all_debt", all_debt); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdFundInfo, "line_of_credit", line_of_credit); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdFundInfo, "guaranty", guaranty); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdFundInfo, "position_amount", position_amount); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPCrdFundInfo, c); + module_vnxtp::objects.emplace("XTPCrdFundInfo", c); +} +void generate_class_XTPClientQueryCrdDebtStockReq(pybind11::object & parent) +{ + pybind11::class_ c(parent, "XTPClientQueryCrdDebtStockReq"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdDebtStockReq, "market", market); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdDebtStockReq, "ticker", ticker); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPClientQueryCrdDebtStockReq, c); + module_vnxtp::objects.emplace("XTPClientQueryCrdDebtStockReq", c); +} +void generate_class_XTPCrdDebtStockInfo(pybind11::object & parent) +{ + pybind11::class_ c(parent, "XTPCrdDebtStockInfo"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtStockInfo, "market", market); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtStockInfo, "ticker", ticker); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtStockInfo, "remain_quantity", remain_quantity); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPCrdDebtStockInfo, "order_withhold_quantity", order_withhold_quantity); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPCrdDebtStockInfo, c); + module_vnxtp::objects.emplace("XTPCrdDebtStockInfo", c); +} +void generate_class_XTPClientQueryCrdPositionStockReq(pybind11::object & parent) +{ + pybind11::class_ c(parent, "XTPClientQueryCrdPositionStockReq"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdPositionStockReq, "market", market); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdPositionStockReq, "ticker", ticker); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPClientQueryCrdPositionStockReq, c); + module_vnxtp::objects.emplace("XTPClientQueryCrdPositionStockReq", c); +} +void generate_class_XTPClientQueryCrdPositionStkInfo(pybind11::object & parent) +{ + pybind11::class_ c(parent, "XTPClientQueryCrdPositionStkInfo"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdPositionStkInfo, "market", market); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdPositionStkInfo, "ticker", ticker); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdPositionStkInfo, "limit_qty", limit_qty); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdPositionStkInfo, "yesterday_qty", yesterday_qty); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdPositionStkInfo, "left_qty", left_qty); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdPositionStkInfo, "frozen_qty", frozen_qty); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPClientQueryCrdPositionStkInfo, c); + module_vnxtp::objects.emplace("XTPClientQueryCrdPositionStkInfo", c); +} +void generate_class_XTPClientQueryCrdSurplusStkReqInfo(pybind11::object & parent) +{ + pybind11::class_ c(parent, "XTPClientQueryCrdSurplusStkReqInfo"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdSurplusStkReqInfo, "market", market); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdSurplusStkReqInfo, "ticker", ticker); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPClientQueryCrdSurplusStkReqInfo, c); + module_vnxtp::objects.emplace("XTPClientQueryCrdSurplusStkReqInfo", c); +} +void generate_class_XTPClientQueryCrdSurplusStkRspInfo(pybind11::object & parent) +{ + pybind11::class_ c(parent, "XTPClientQueryCrdSurplusStkRspInfo"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdSurplusStkRspInfo, "market", market); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdSurplusStkRspInfo, "ticker", ticker); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdSurplusStkRspInfo, "transferable_quantity", transferable_quantity); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientQueryCrdSurplusStkRspInfo, "transferred_quantity", transferred_quantity); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPClientQueryCrdSurplusStkRspInfo, c); + module_vnxtp::objects.emplace("XTPClientQueryCrdSurplusStkRspInfo", c); +} +void generate_class_XTPClientCrdExtendDebtInfo(pybind11::object & parent) +{ + pybind11::class_ c(parent, "XTPClientCrdExtendDebtInfo"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientCrdExtendDebtInfo, "xtp_id", xtp_id); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPClientCrdExtendDebtInfo, "debt_id", debt_id); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPClientCrdExtendDebtInfo, c); + module_vnxtp::objects.emplace("XTPClientCrdExtendDebtInfo", c); +} +void generate_class_XTPFundTransferReq(pybind11::object & parent) +{ + pybind11::class_ c(parent, "XTPFundTransferReq"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPFundTransferReq, "serial_id", serial_id); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPFundTransferReq, "fund_account", fund_account); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPFundTransferReq, "password", password); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPFundTransferReq, "amount", amount); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnxtp, XTPFundTransferReq, "transfer_type", transfer_type); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnxtp, XTPFundTransferReq, c); + module_vnxtp::objects.emplace("XTPFundTransferReq", c); +} +void generate_enum_XTP_LOG_LEVEL(pybind11::object & parent) +{ + pybind11::enum_ e(parent, "XTP_LOG_LEVEL", pybind11::arithmetic()); + e.value("XTP_LOG_LEVEL_FATAL", XTP_LOG_LEVEL::XTP_LOG_LEVEL_FATAL); + e.value("XTP_LOG_LEVEL_ERROR", XTP_LOG_LEVEL::XTP_LOG_LEVEL_ERROR); + e.value("XTP_LOG_LEVEL_WARNING", XTP_LOG_LEVEL::XTP_LOG_LEVEL_WARNING); + e.value("XTP_LOG_LEVEL_INFO", XTP_LOG_LEVEL::XTP_LOG_LEVEL_INFO); + e.value("XTP_LOG_LEVEL_DEBUG", XTP_LOG_LEVEL::XTP_LOG_LEVEL_DEBUG); + e.value("XTP_LOG_LEVEL_TRACE", XTP_LOG_LEVEL::XTP_LOG_LEVEL_TRACE); + e.export_values(); + module_vnxtp::objects.emplace("XTP_LOG_LEVEL", e); +} +void generate_enum_XTP_PROTOCOL_TYPE(pybind11::object & parent) +{ + pybind11::enum_ e(parent, "XTP_PROTOCOL_TYPE", pybind11::arithmetic()); + e.value("XTP_PROTOCOL_TCP", XTP_PROTOCOL_TYPE::XTP_PROTOCOL_TCP); + e.value("XTP_PROTOCOL_UDP", XTP_PROTOCOL_TYPE::XTP_PROTOCOL_UDP); + e.export_values(); + module_vnxtp::objects.emplace("XTP_PROTOCOL_TYPE", e); +} +void generate_enum_XTP_EXCHANGE_TYPE(pybind11::object & parent) +{ + pybind11::enum_ e(parent, "XTP_EXCHANGE_TYPE", pybind11::arithmetic()); + e.value("XTP_EXCHANGE_SH", XTP_EXCHANGE_TYPE::XTP_EXCHANGE_SH); + e.value("XTP_EXCHANGE_SZ", XTP_EXCHANGE_TYPE::XTP_EXCHANGE_SZ); + e.value("XTP_EXCHANGE_UNKNOWN", XTP_EXCHANGE_TYPE::XTP_EXCHANGE_UNKNOWN); + e.export_values(); + module_vnxtp::objects.emplace("XTP_EXCHANGE_TYPE", e); +} +void generate_enum_XTP_MARKET_TYPE(pybind11::object & parent) +{ + pybind11::enum_ e(parent, "XTP_MARKET_TYPE", pybind11::arithmetic()); + e.value("XTP_MKT_INIT", XTP_MARKET_TYPE::XTP_MKT_INIT); + e.value("XTP_MKT_SZ_A", XTP_MARKET_TYPE::XTP_MKT_SZ_A); + e.value("XTP_MKT_SH_A", XTP_MARKET_TYPE::XTP_MKT_SH_A); + e.value("XTP_MKT_UNKNOWN", XTP_MARKET_TYPE::XTP_MKT_UNKNOWN); + e.export_values(); + module_vnxtp::objects.emplace("XTP_MARKET_TYPE", e); +} +void generate_enum_XTP_PRICE_TYPE(pybind11::object & parent) +{ + pybind11::enum_ e(parent, "XTP_PRICE_TYPE", pybind11::arithmetic()); + e.value("XTP_PRICE_LIMIT", XTP_PRICE_TYPE::XTP_PRICE_LIMIT); + e.value("XTP_PRICE_BEST_OR_CANCEL", XTP_PRICE_TYPE::XTP_PRICE_BEST_OR_CANCEL); + e.value("XTP_PRICE_BEST5_OR_LIMIT", XTP_PRICE_TYPE::XTP_PRICE_BEST5_OR_LIMIT); + e.value("XTP_PRICE_BEST5_OR_CANCEL", XTP_PRICE_TYPE::XTP_PRICE_BEST5_OR_CANCEL); + e.value("XTP_PRICE_ALL_OR_CANCEL", XTP_PRICE_TYPE::XTP_PRICE_ALL_OR_CANCEL); + e.value("XTP_PRICE_FORWARD_BEST", XTP_PRICE_TYPE::XTP_PRICE_FORWARD_BEST); + e.value("XTP_PRICE_REVERSE_BEST_LIMIT", XTP_PRICE_TYPE::XTP_PRICE_REVERSE_BEST_LIMIT); + e.value("XTP_PRICE_LIMIT_OR_CANCEL", XTP_PRICE_TYPE::XTP_PRICE_LIMIT_OR_CANCEL); + e.value("XTP_PRICE_TYPE_UNKNOWN", XTP_PRICE_TYPE::XTP_PRICE_TYPE_UNKNOWN); + e.export_values(); + module_vnxtp::objects.emplace("XTP_PRICE_TYPE", e); +} +void generate_enum_XTP_ORDER_ACTION_STATUS_TYPE(pybind11::object & parent) +{ + pybind11::enum_ e(parent, "XTP_ORDER_ACTION_STATUS_TYPE", pybind11::arithmetic()); + e.value("XTP_ORDER_ACTION_STATUS_SUBMITTED", XTP_ORDER_ACTION_STATUS_TYPE::XTP_ORDER_ACTION_STATUS_SUBMITTED); + e.value("XTP_ORDER_ACTION_STATUS_ACCEPTED", XTP_ORDER_ACTION_STATUS_TYPE::XTP_ORDER_ACTION_STATUS_ACCEPTED); + e.value("XTP_ORDER_ACTION_STATUS_REJECTED", XTP_ORDER_ACTION_STATUS_TYPE::XTP_ORDER_ACTION_STATUS_REJECTED); + e.export_values(); + module_vnxtp::objects.emplace("XTP_ORDER_ACTION_STATUS_TYPE", e); +} +void generate_enum_XTP_ORDER_STATUS_TYPE(pybind11::object & parent) +{ + pybind11::enum_ e(parent, "XTP_ORDER_STATUS_TYPE", pybind11::arithmetic()); + e.value("XTP_ORDER_STATUS_INIT", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_INIT); + e.value("XTP_ORDER_STATUS_ALLTRADED", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_ALLTRADED); + e.value("XTP_ORDER_STATUS_PARTTRADEDQUEUEING", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_PARTTRADEDQUEUEING); + e.value("XTP_ORDER_STATUS_PARTTRADEDNOTQUEUEING", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_PARTTRADEDNOTQUEUEING); + e.value("XTP_ORDER_STATUS_NOTRADEQUEUEING", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_NOTRADEQUEUEING); + e.value("XTP_ORDER_STATUS_CANCELED", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_CANCELED); + e.value("XTP_ORDER_STATUS_REJECTED", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_REJECTED); + e.value("XTP_ORDER_STATUS_UNKNOWN", XTP_ORDER_STATUS_TYPE::XTP_ORDER_STATUS_UNKNOWN); + e.export_values(); + module_vnxtp::objects.emplace("XTP_ORDER_STATUS_TYPE", e); +} +void generate_enum_XTP_ORDER_SUBMIT_STATUS_TYPE(pybind11::object & parent) +{ + pybind11::enum_ e(parent, "XTP_ORDER_SUBMIT_STATUS_TYPE", pybind11::arithmetic()); + e.value("XTP_ORDER_SUBMIT_STATUS_INSERT_SUBMITTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_INSERT_SUBMITTED); + e.value("XTP_ORDER_SUBMIT_STATUS_INSERT_ACCEPTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_INSERT_ACCEPTED); + e.value("XTP_ORDER_SUBMIT_STATUS_INSERT_REJECTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_INSERT_REJECTED); + e.value("XTP_ORDER_SUBMIT_STATUS_CANCEL_SUBMITTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_CANCEL_SUBMITTED); + e.value("XTP_ORDER_SUBMIT_STATUS_CANCEL_REJECTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_CANCEL_REJECTED); + e.value("XTP_ORDER_SUBMIT_STATUS_CANCEL_ACCEPTED", XTP_ORDER_SUBMIT_STATUS_TYPE::XTP_ORDER_SUBMIT_STATUS_CANCEL_ACCEPTED); + e.export_values(); + module_vnxtp::objects.emplace("XTP_ORDER_SUBMIT_STATUS_TYPE", e); +} void generate_enum_XTP_TE_RESUME_TYPE(pybind11::object & parent) { pybind11::enum_ e(parent, "XTP_TE_RESUME_TYPE", pybind11::arithmetic()); @@ -81,6 +313,8 @@ void generate_enum_XTP_FUND_TRANSFER_TYPE(pybind11::object & parent) pybind11::enum_ e(parent, "XTP_FUND_TRANSFER_TYPE", pybind11::arithmetic()); e.value("XTP_FUND_TRANSFER_OUT", XTP_FUND_TRANSFER_TYPE::XTP_FUND_TRANSFER_OUT); e.value("XTP_FUND_TRANSFER_IN", XTP_FUND_TRANSFER_TYPE::XTP_FUND_TRANSFER_IN); + e.value("XTP_FUND_INTER_TRANSFER_OUT", XTP_FUND_TRANSFER_TYPE::XTP_FUND_INTER_TRANSFER_OUT); + e.value("XTP_FUND_INTER_TRANSFER_IN", XTP_FUND_TRANSFER_TYPE::XTP_FUND_INTER_TRANSFER_IN); e.value("XTP_FUND_TRANSFER_UNKNOWN", XTP_FUND_TRANSFER_TYPE::XTP_FUND_TRANSFER_UNKNOWN); e.export_values(); module_vnxtp::objects.emplace("XTP_FUND_TRANSFER_TYPE", e); @@ -140,6 +374,15 @@ void generate_enum_XTP_POSITION_DIRECTION_TYPE(pybind11::object & parent) e.export_values(); module_vnxtp::objects.emplace("XTP_POSITION_DIRECTION_TYPE", e); } +void generate_enum_XTP_CRD_CR_STATUS(pybind11::object & parent) +{ + pybind11::enum_ e(parent, "XTP_CRD_CR_STATUS", pybind11::arithmetic()); + e.value("XTP_CRD_CR_INIT", XTP_CRD_CR_STATUS::XTP_CRD_CR_INIT); + e.value("XTP_CRD_CR_SUCCESS", XTP_CRD_CR_STATUS::XTP_CRD_CR_SUCCESS); + e.value("XTP_CRD_CR_FAILED", XTP_CRD_CR_STATUS::XTP_CRD_CR_FAILED); + e.export_values(); + module_vnxtp::objects.emplace("XTP_CRD_CR_STATUS", e); +} void generate_enum_XTP_MARKETDATA_TYPE(pybind11::object & parent) { pybind11::enum_ e(parent, "XTP_MARKETDATA_TYPE", pybind11::arithmetic()); @@ -184,6 +427,18 @@ void generate_caster_(pybind11::object & parent) autocxxpy::caster::try_generate(c, "toXTPQueryIPOQuotaRsp)"); autocxxpy::caster::try_generate(c, "toXTPQueryOptionAuctionInfoReq)"); autocxxpy::caster::try_generate(c, "toXTPQueryOptionAuctionInfoRsp)"); + autocxxpy::caster::try_generate(c, "toXTPCrdCashRepayRsp)"); + autocxxpy::caster::try_generate(c, "toXTPCrdCashRepayDebtInterestFeeRsp)"); + autocxxpy::caster::try_generate(c, "toXTPCrdCashRepayInfo)"); + autocxxpy::caster::try_generate(c, "toXTPCrdDebtInfo)"); + autocxxpy::caster::try_generate(c, "toXTPCrdFundInfo)"); + autocxxpy::caster::try_generate(c, "toXTPClientQueryCrdDebtStockReq)"); + autocxxpy::caster::try_generate(c, "toXTPCrdDebtStockInfo)"); + autocxxpy::caster::try_generate(c, "toXTPClientQueryCrdPositionStockReq)"); + autocxxpy::caster::try_generate(c, "toXTPClientQueryCrdPositionStkInfo)"); + autocxxpy::caster::try_generate(c, "toXTPClientQueryCrdSurplusStkReqInfo)"); + autocxxpy::caster::try_generate(c, "toXTPClientQueryCrdSurplusStkRspInfo)"); + autocxxpy::caster::try_generate(c, "toXTPClientCrdExtendDebtInfo)"); autocxxpy::caster::try_generate(c, "toXTPFundTransferReq)"); autocxxpy::caster::try_generate(c, "toXTPVersionType)"); autocxxpy::caster::try_generate(c, "toXTP_LOG_LEVEL)"); @@ -208,6 +463,7 @@ void generate_caster_(pybind11::object & parent) autocxxpy::caster::try_generate(c, "toXTP_OPT_CALL_OR_PUT_TYPE)"); autocxxpy::caster::try_generate(c, "toXTP_OPT_EXERCISE_TYPE_TYPE)"); autocxxpy::caster::try_generate(c, "toXTP_POSITION_DIRECTION_TYPE)"); + autocxxpy::caster::try_generate(c, "toXTP_CRD_CR_STATUS)"); autocxxpy::caster::try_generate(c, "toTXTPTradeTypeType)"); autocxxpy::caster::try_generate(c, "toTXTPOrderTypeType)"); autocxxpy::caster::try_generate(c, "toXTPRI)"); @@ -222,5 +478,14 @@ void generate_caster_(pybind11::object & parent) autocxxpy::caster::try_generate(c, "toXTPFundTransferLog)"); autocxxpy::caster::try_generate(c, "toXTPQueryETFBaseRsp)"); autocxxpy::caster::try_generate(c, "toXTPQueryETFComponentReq)"); + autocxxpy::caster::try_generate(c, "toXTPCrdDebtInfo)"); + autocxxpy::caster::try_generate(c, "toXTPCrdFundInfo)"); + autocxxpy::caster::try_generate(c, "toXTPClientQueryCrdDebtStockReq)"); + autocxxpy::caster::try_generate(c, "toXTPCrdDebtStockInfo)"); + autocxxpy::caster::try_generate(c, "toXTPClientQueryCrdPositionStockReq)"); + autocxxpy::caster::try_generate(c, "toXTPClientQueryCrdPositionStkInfo)"); + autocxxpy::caster::try_generate(c, "toXTPClientQueryCrdSurplusStkReqInfo)"); + autocxxpy::caster::try_generate(c, "toXTPClientQueryCrdSurplusStkRspInfo)"); + autocxxpy::caster::try_generate(c, "toXTPClientCrdExtendDebtInfo)"); autocxxpy::caster::try_generate(c, "toXTPFundTransferAck)"); } diff --git a/vnpy/api/xtp/vnxtp/generated_files/wrappers.hpp b/vnpy/api/xtp/vnxtp/generated_files/wrappers.hpp index 2b6b93d5..6066d2f3 100644 --- a/vnpy/api/xtp/vnxtp/generated_files/wrappers.hpp +++ b/vnpy/api/xtp/vnxtp/generated_files/wrappers.hpp @@ -115,6 +115,54 @@ public: this,"OnQueryOptionAuctionInfo",option_info,error_info,request_id,is_last,session_id ); } + void OnCreditCashRepay(XTPCrdCashRepayRsp * cash_repay_info,XTPRI * error_info,uint64_t session_id) override + { + return autocxxpy::callback_wrapper<&XTP::API::TraderSpi::OnCreditCashRepay>::call( + this,"OnCreditCashRepay",cash_repay_info,error_info,session_id + ); + } + void OnQueryCreditCashRepayInfo(XTPCrdCashRepayInfo * cash_repay_info,XTPRI * error_info,int request_id,bool is_last,uint64_t session_id) override + { + return autocxxpy::callback_wrapper<&XTP::API::TraderSpi::OnQueryCreditCashRepayInfo>::call( + this,"OnQueryCreditCashRepayInfo",cash_repay_info,error_info,request_id,is_last,session_id + ); + } + void OnQueryCreditFundInfo(XTPCrdFundInfo * fund_info,XTPRI * error_info,int request_id,uint64_t session_id) override + { + return autocxxpy::callback_wrapper<&XTP::API::TraderSpi::OnQueryCreditFundInfo>::call( + this,"OnQueryCreditFundInfo",fund_info,error_info,request_id,session_id + ); + } + void OnQueryCreditDebtInfo(XTPCrdDebtInfo * debt_info,XTPRI * error_info,int request_id,bool is_last,uint64_t session_id) override + { + return autocxxpy::callback_wrapper<&XTP::API::TraderSpi::OnQueryCreditDebtInfo>::call( + this,"OnQueryCreditDebtInfo",debt_info,error_info,request_id,is_last,session_id + ); + } + void OnQueryCreditTickerDebtInfo(XTPCrdDebtStockInfo * debt_info,XTPRI * error_info,int request_id,bool is_last,uint64_t session_id) override + { + return autocxxpy::callback_wrapper<&XTP::API::TraderSpi::OnQueryCreditTickerDebtInfo>::call( + this,"OnQueryCreditTickerDebtInfo",debt_info,error_info,request_id,is_last,session_id + ); + } + void OnQueryCreditAssetDebtInfo(double remain_amount,XTPRI * error_info,int request_id,uint64_t session_id) override + { + return autocxxpy::callback_wrapper<&XTP::API::TraderSpi::OnQueryCreditAssetDebtInfo>::call( + this,"OnQueryCreditAssetDebtInfo",remain_amount,error_info,request_id,session_id + ); + } + void OnQueryCreditTickerAssignInfo(XTPClientQueryCrdPositionStkInfo * assign_info,XTPRI * error_info,int request_id,bool is_last,uint64_t session_id) override + { + return autocxxpy::callback_wrapper<&XTP::API::TraderSpi::OnQueryCreditTickerAssignInfo>::call( + this,"OnQueryCreditTickerAssignInfo",assign_info,error_info,request_id,is_last,session_id + ); + } + void OnQueryCreditExcessStock(XTPClientQueryCrdSurplusStkRspInfo * stock_info,XTPRI * error_info,int request_id,uint64_t session_id) override + { + return autocxxpy::callback_wrapper<&XTP::API::TraderSpi::OnQueryCreditExcessStock>::call( + this,"OnQueryCreditExcessStock",stock_info,error_info,request_id,session_id + ); + } }; diff --git a/vnpy/api/xtp/vnxtp/include/xoms_api_fund_struct.h b/vnpy/api/xtp/vnxtp/include/xoms_api_fund_struct.h index 7b0168a1..68bb97ff 100644 --- a/vnpy/api/xtp/vnxtp/include/xoms_api_fund_struct.h +++ b/vnpy/api/xtp/vnxtp/include/xoms_api_fund_struct.h @@ -12,6 +12,7 @@ #pragma pack(8) +/// 用户资金账户的密码字符串长度 #define XTP_ACCOUNT_PASSWORD_LEN 64 ///////////////////////////////////////////////////////////////////////// diff --git a/vnpy/api/xtp/vnxtp/include/xoms_api_struct.h b/vnpy/api/xtp/vnxtp/include/xoms_api_struct.h index 9519634c..aa8daabf 100644 --- a/vnpy/api/xtp/vnxtp/include/xoms_api_struct.h +++ b/vnpy/api/xtp/vnxtp/include/xoms_api_struct.h @@ -8,6 +8,7 @@ #include "xtp_api_data_type.h" #include "stddef.h" +#include "xtp_api_struct_common.h" #pragma pack(8) @@ -32,6 +33,7 @@ struct XTPOrderInsertInfo ///报单价格 XTP_PRICE_TYPE price_type; union{ + ///32位字段,用来兼容老版本api,用户无需关心 uint32_t u32; struct { ///买卖方向 @@ -81,6 +83,7 @@ struct XTPOrderInfo ///报单价格条件 XTP_PRICE_TYPE price_type; union{ + ///32位字段,用来兼容老版本api,用户无需关心 uint32_t u32; struct { ///买卖方向 @@ -142,13 +145,14 @@ struct XTPTradeReport int64_t trade_time; ///成交金额,此次成交的总金额 = price*quantity double trade_amount; - ///成交序号 --回报记录号,每个交易所唯一,report_index+market字段可以组成唯一标识表示成交回报 + ///成交序号 --回报记录号,对于单个账户来说,每个交易所唯一,report_index+market字段可以组成唯一标识表示成交回报,对于多账户来说,不唯一 uint64_t report_index; ///报单编号 --交易所单号,上交所为空,深交所有此字段 char order_exch_id[XTP_ORDER_EXCH_LEN]; ///成交类型 --成交回报中的执行类型 TXTPTradeTypeType trade_type; union{ + ///32位字段,用来兼容老版本api,用户无需关心 uint32_t u32; struct { ///买卖方向 @@ -219,53 +223,59 @@ typedef struct XTPTradeReport XTPQueryTradeRsp; ////////////////////////////////////////////////////////////////////////// struct XTPQueryAssetRsp { - ///总资产(=可用资金 + 证券资产(目前为0)+ 预扣的资金) + ///总资产(现货账户/期权账户参考公式:总资产 = 可用资金 + 证券资产(目前为0)+ 预扣的资金),(信用账户参考公式:总资产 = 可用资金 + 融券卖出所得资金余额 + 证券资产+ 预扣的资金) double total_asset; ///可用资金 double buying_power; ///证券资产(保留字段,目前为0) double security_asset; - ///累计买入成交证券占用资金 + ///累计买入成交证券占用资金(仅限现货账户/期权账户,信用账户暂不可用) double fund_buy_amount; - ///累计买入成交交易费用 + ///累计买入成交交易费用(仅限现货账户/期权账户,信用账户暂不可用) double fund_buy_fee; - ///累计卖出成交证券所得资金 + ///累计卖出成交证券所得资金(仅限现货账户/期权账户,信用账户暂不可用) double fund_sell_amount; - ///累计卖出成交交易费用 + ///累计卖出成交交易费用(仅限现货账户/期权账户,信用账户暂不可用) double fund_sell_fee; - ///XTP系统预扣的资金(包括购买卖股票时预扣的交易资金+预扣手续费) + ///XTP系统预扣的资金(包括买卖股票时预扣的交易资金+预扣手续费) double withholding_amount; ///账户类型 XTP_ACCOUNT_TYPE account_type; - ///冻结的保证金 + ///冻结的保证金(仅限期权账户) double frozen_margin; - ///行权冻结资金 + ///行权冻结资金(仅限期权账户) double frozen_exec_cash; - ///行权费用 + ///行权费用(仅限期权账户) double frozen_exec_fee; - ///垫付资金 + ///垫付资金(仅限期权账户) double pay_later; - ///预垫付资金 + ///预垫付资金(仅限期权账户) double preadva_pay; - ///昨日余额 + ///昨日余额(仅限期权账户) double orig_banlance; - ///当前余额 + ///当前余额(仅限期权账户) double banlance; - ///当天出入金 + ///当天出入金(仅限期权账户) double deposit_withdraw; - ///当日交易资金轧差 + ///当日交易资金轧差(仅限期权账户) double trade_netting; - ///资金资产 + ///资金资产(仅限期权账户) double captial_asset; - ///强锁资金 + ///强锁资金(仅限期权账户) double force_freeze_amount; - ///可取资金 + ///可取资金(仅限期权账户) double preferred_amount; + // 信用业务新增字段开始(数量1) + ///融券卖出所得资金余额(仅限信用账户,只能用于买券还券) + double repay_stock_aval_banlance; + + // 信用业务新增字段结束(数量1) + ///(保留字段) - uint64_t unknown[43 - 12]; + uint64_t unknown[43 - 12 - 1]; }; @@ -538,6 +548,151 @@ struct XTPQueryOptionAuctionInfoRsp { }; +////////////////////////////////////////////////////////////////////////// +///融资融券直接还款响应信息 +////////////////////////////////////////////////////////////////////////// +struct XTPCrdCashRepayRsp +{ + int64_t xtp_id; ///< 直接还款操作的XTPID + double request_amount; ///< 直接还款的申请金额 + double cash_repay_amount; ///< 实际还款使用金额 +}; + +////////////////////////////////////////////////////////////////////////// +///融资融券现金还息费响应信息 +////////////////////////////////////////////////////////////////////////// +struct XTPCrdCashRepayDebtInterestFeeRsp +{ + int64_t xtp_id; ///< 直接还款操作的XTPID + double request_amount; ///< 直接还款的申请金额 + double cash_repay_amount; ///< 实际还款使用金额 + char debt_compact_id[XTP_CREDIT_DEBT_ID_LEN]; ///< 指定的负债合约编号 + char unknow[32]; ///< 保留字段 +}; + +////////////////////////////////////////////////////////////////////////// +///单条融资融券直接还款记录信息 +////////////////////////////////////////////////////////////////////////// +struct XTPCrdCashRepayInfo +{ + int64_t xtp_id; ///< 直接还款操作的XTPID + XTP_CRD_CR_STATUS status; ///< 直接还款处理状态 + double request_amount; ///< 直接还款的申请金额 + double cash_repay_amount; ///< 实际还款使用金额 + XTP_POSITION_EFFECT_TYPE position_effect; ///< 强平标志 + XTPRI error_info; ///< 直接还款发生错误时的错误信息 +}; + +////////////////////////////////////////////////////////////////////////// +///单条融资融券负债记录信息 +////////////////////////////////////////////////////////////////////////// +typedef struct XTPCrdDebtInfo +{ + int32_t debt_type; ///< 负债合约类型 + char debt_id[33]; ///< 负债合约编号 + int64_t position_id; ///< 负债对应两融头寸编号 + uint64_t order_xtp_id; ///< 生成负债的订单编号,非当日负债无此项 + int32_t debt_status; ///< 负债合约状态 + XTP_MARKET_TYPE market; ///< 市场 + char ticker[XTP_TICKER_LEN]; ///< 证券代码 + uint64_t order_date; ///< 委托日期 + uint64_t end_date; ///< 负债截止日期 + uint64_t orig_end_date; ///< 负债原始截止日期 + bool is_extended; ///< 当日是否接收到展期请求 + double remain_amt; ///< 未偿还金额 + int64_t remain_qty; ///< 未偿还融券数量 + double remain_principal; ///< 未偿还本金金额 + int64_t due_right_qty; ///< 应偿还权益数量 + int64_t unknown[2]; ///< 保留字段 +}XTPCrdDebtInfo; + +////////////////////////////////////////////////////////////////////////// +///融资融券特有帐户数据 +////////////////////////////////////////////////////////////////////////// +typedef struct XTPCrdFundInfo +{ + double maintenance_ratio; ///< 维持担保品比例 + double all_asset; ///< 总资产 + double all_debt; ///< 总负债 + double line_of_credit; ///< 两融授信额度 + double guaranty; ///< 两融保证金可用数 + double position_amount; ///< 融资头寸可用金额,内部接口,正式版本需要删除 +}XTPCrdFundInfo; + +////////////////////////////////////////////////////////////////////////// +///融资融券指定证券上的负债未还数量请求结构体 +////////////////////////////////////////////////////////////////////////// +typedef struct XTPClientQueryCrdDebtStockReq +{ + XTP_MARKET_TYPE market; ///< 市场 + char ticker[XTP_TICKER_LEN]; ///< 证券代码 +}XTPClientQueryCrdDebtStockReq; + +////////////////////////////////////////////////////////////////////////// +///融资融券指定证券上的负债未还信息 +////////////////////////////////////////////////////////////////////////// +typedef struct XTPCrdDebtStockInfo +{ + XTP_MARKET_TYPE market; ///< 市场 + char ticker[XTP_TICKER_LEN]; ///< 证券代码 + int64_t remain_quantity; ///< 负债未还数量 + int64_t order_withhold_quantity; ///< 挂单未成还券数量 +}XTPCrdDebtStockInfo; + +////////////////////////////////////////////////////////////////////////// +///融券头寸证券查询请求结构体 +////////////////////////////////////////////////////////////////////////// +typedef struct XTPClientQueryCrdPositionStockReq +{ + XTP_MARKET_TYPE market; ///< 证券市场 + char ticker[XTP_TICKER_LEN]; ///< 证券代码 +}XTPClientQueryCrdPositionStockReq; + +////////////////////////////////////////////////////////////////////////// +///融券头寸证券信息 +////////////////////////////////////////////////////////////////////////// +typedef struct XTPClientQueryCrdPositionStkInfo +{ + XTP_MARKET_TYPE market; ///< 证券市场 + char ticker[XTP_TICKER_LEN]; ///< 证券代码 + int64_t limit_qty; ///< 融券限量 + int64_t yesterday_qty; ///< 昨日日融券数量 + int64_t left_qty; ///< 剩余可融券数量 + int64_t frozen_qty; ///< 冻结融券数量 +}XTPClientQueryCrdPositionStkInfo; + + +////////////////////////////////////////////////////////////////////////// +/// 信用业务余券查询请求结构体 +////////////////////////////////////////////////////////////////////////// +typedef struct XTPClientQueryCrdSurplusStkReqInfo +{ + XTP_MARKET_TYPE market; ///< 证券市场 + char ticker[XTP_TICKER_LEN]; ///< 证券代码 +}XTPClientQueryCrdSurplusStkReqInfo; + +////////////////////////////////////////////////////////////////////////// +///信用业务余券信息 +////////////////////////////////////////////////////////////////////////// +typedef struct XTPClientQueryCrdSurplusStkRspInfo +{ + XTP_MARKET_TYPE market; ///< 证券市场 + char ticker[XTP_TICKER_LEN]; ///< 证券代码 + int64_t transferable_quantity; ///< 可划转数量 + int64_t transferred_quantity; ///< 已划转数量 +}XTPClientQueryCrdSurplusStkRspInfo; + + +////////////////////////////////////////////////////////////////////////// +/// 信用业务负债展期信息 +////////////////////////////////////////////////////////////////////////// + +typedef struct XTPClientCrdExtendDebtInfo +{ + uint64_t xtp_id; ///< 订单编号 + char debt_id[XTP_CREDIT_DEBT_ID_LEN]; ///< 待展期负债合约编号 +}XTPClientCrdExtendDebtInfo; + #pragma pack() #endif //_XOMS_API_STRUCT_H_ diff --git a/vnpy/api/xtp/vnxtp/include/xquote_api_struct.h b/vnpy/api/xtp/vnxtp/include/xquote_api_struct.h index 0ccfec45..af2e9e4d 100644 --- a/vnpy/api/xtp/vnxtp/include/xquote_api_struct.h +++ b/vnpy/api/xtp/vnxtp/include/xquote_api_struct.h @@ -89,7 +89,7 @@ struct XTPMarketDataStockExData { int64_t r2; }; -// 期权额外数据 +/// 期权额外数据 struct XTPMarketDataOptionExData { ///波段性中断参考价(SH) double auction_price; @@ -99,6 +99,9 @@ struct XTPMarketDataOptionExData { int64_t last_enquiry_time; }; +///////////////////////////////////////////////////////////////////////// +///@brief XTP_MARKETDATA_TYPE是行情快照数据类型 +///////////////////////////////////////////////////////////////////////// enum XTP_MARKETDATA_TYPE { XTP_MARKETDATA_ACTUAL = 0, // 现货(股票/基金/债券等) XTP_MARKETDATA_OPTION = 1, // 期权 diff --git a/vnpy/api/xtp/vnxtp/include/xtp_api_data_type.h b/vnpy/api/xtp/vnxtp/include/xtp_api_data_type.h index 406d1e73..c6745bd9 100644 --- a/vnpy/api/xtp/vnxtp/include/xtp_api_data_type.h +++ b/vnpy/api/xtp/vnxtp/include/xtp_api_data_type.h @@ -28,6 +28,8 @@ typedef char XTPVersionType[XTP_VERSION_LEN]; #define XTP_BRANCH_PBU_LEN 7 /// 用户资金账户的字符串长度 #define XTP_ACCOUNT_NAME_LEN 16 +/// 信用业务合约负债编号长度 +#define XTP_CREDIT_DEBT_ID_LEN 33 ///////////////////////////////////////////////////////////////////////// ///@brief XTP_LOG_LEVEL是日志输出级别类型 @@ -121,12 +123,19 @@ typedef uint8_t XTP_SIDE_TYPE; #define XTP_SIDE_REPAY_MARGIN 23 /// 买券还券 #define XTP_SIDE_REPAY_STOCK 24 -/// 现金还款 -#define XTP_SIDE_CASH_REPAY_MARGIN 25 +/// 现金还款(不放在普通订单协议,另加请求和查询协议) +//#define XTP_SIDE_CASH_REPAY_MARGIN 25 /// 现券还券 #define XTP_SIDE_STOCK_REPAY_STOCK 26 +/// 余券划转 +#define XTP_SIDE_SURSTK_TRANS 27 +/// 担保品转入 +#define XTP_SIDE_GRTSTK_TRANSIN 28 +/// 担保品转出 +#define XTP_SIDE_GRTSTK_TRANSOUT 29 + ///未知或者无效买卖方向 -#define XTP_SIDE_UNKNOWN 27 +#define XTP_SIDE_UNKNOWN 30 @@ -151,8 +160,16 @@ typedef uint8_t XTP_POSITION_EFFECT_TYPE; #define XTP_POSITION_EFFECT_FORCEOFF 6 /// 本地强平 #define XTP_POSITION_EFFECT_LOCALFORCECLOSE 7 +/// 信用业务追保强平 +#define XTP_POSITION_EFFECT_CREDIT_FORCE_COVER 8 +/// 信用业务清偿强平 +#define XTP_POSITION_EFFECT_CREDIT_FORCE_CLEAR 9 +/// 信用业务合约到期强平 +#define XTP_POSITION_EFFECT_CREDIT_FORCE_DEBT 10 +/// 信用业务无条件强平 +#define XTP_POSITION_EFFECT_CREDIT_FORCE_UNCOND 11 /// 未知的开平标识类型 -#define XTP_POSITION_EFFECT_UNKNOWN 8 +#define XTP_POSITION_EFFECT_UNKNOWN 12 ///////////////////////////////////////////////////////////////////////// @@ -276,6 +293,8 @@ typedef enum XTP_FUND_TRANSFER_TYPE { XTP_FUND_TRANSFER_OUT = 0, ///<转出 从XTP转出到柜台 XTP_FUND_TRANSFER_IN, ///<转入 从柜台转入XTP + XTP_FUND_INTER_TRANSFER_OUT, ///<跨节点转出 从本XTP节点1,转出到对端XTP节点2,XTP服务器之间划拨,只能跨账户用户使用 + XTP_FUND_INTER_TRANSFER_IN, ///<跨节点转入 从对端XTP节点2,转入到本XTP节点1,XTP服务器之间划拨,只能跨账户用户使用 XTP_FUND_TRANSFER_UNKNOWN ///<未知类型 }XTP_FUND_TRANSFER_TYPE; @@ -283,7 +302,7 @@ typedef enum XTP_FUND_TRANSFER_TYPE ///@brief XTP_FUND_OPER_STATUS柜台资金操作结果 ///////////////////////////////////////////////////////////////////////// typedef enum XTP_FUND_OPER_STATUS { - XTP_FUND_OPER_PROCESSING = 0, ///Any: ... + def OnCreditCashRepay(self, cash_repay_info: XTPCrdCashRepayRsp, error_info: XTPRspInfoStruct, session_id: int)->Any: + ... + def OnQueryCreditCashRepayInfo(self, cash_repay_info: XTPCrdCashRepayInfo, error_info: XTPRspInfoStruct, request_id: int, is_last: bool, session_id: int)->Any: + ... + def OnQueryCreditFundInfo(self, fund_info: XTPCrdFundInfo, error_info: XTPRspInfoStruct, request_id: int, session_id: int)->Any: + ... + def OnQueryCreditDebtInfo(self, debt_info: XTPCrdDebtInfo, error_info: XTPRspInfoStruct, request_id: int, is_last: bool, session_id: int)->Any: + ... + def OnQueryCreditTickerDebtInfo(self, debt_info: XTPCrdDebtStockInfo, error_info: XTPRspInfoStruct, request_id: int, is_last: bool, session_id: int)->Any: + ... + def OnQueryCreditAssetDebtInfo(self, remain_amount: float, error_info: XTPRspInfoStruct, request_id: int, session_id: int)->Any: + ... + def OnQueryCreditTickerAssignInfo(self, assign_info: XTPClientQueryCrdPositionStkInfo, error_info: XTPRspInfoStruct, request_id: int, is_last: bool, session_id: int)->Any: + ... + def OnQueryCreditExcessStock(self, stock_info: XTPClientQueryCrdSurplusStkRspInfo, error_info: XTPRspInfoStruct, request_id: int, session_id: int)->Any: + ... class TraderApi(): @@ -127,6 +143,22 @@ class TraderApi(): ... def QueryOptionAuctionInfo(self, query_param: XTPQueryOptionAuctionInfoReq, session_id: int, request_id: int)->int: ... + def CreditCashRepay(self, amount: float, session_id: int)->int: + ... + def QueryCreditCashRepayInfo(self, session_id: int, request_id: int)->int: + ... + def QueryCreditFundInfo(self, session_id: int, request_id: int)->int: + ... + def QueryCreditDebtInfo(self, session_id: int, request_id: int)->int: + ... + def QueryCreditTickerDebtInfo(self, query_param: XTPClientQueryCrdDebtStockReq, session_id: int, request_id: int)->int: + ... + def QueryCreditAssetDebtInfo(self, session_id: int, request_id: int)->int: + ... + def QueryCreditTickerAssignInfo(self, query_param: XTPClientQueryCrdPositionStockReq, session_id: int, request_id: int)->int: + ... + def QueryCreditExcessStock(self, query_param: XTPClientQueryCrdSurplusStkReqInfo, session_id: int, request_id: int)->int: + ... class QuoteSpi(): diff --git a/vnpy/api/xtp/xtpquoteapi.dll b/vnpy/api/xtp/xtpquoteapi.dll index b2fb4ddb..eb397ca4 100644 Binary files a/vnpy/api/xtp/xtpquoteapi.dll and b/vnpy/api/xtp/xtpquoteapi.dll differ diff --git a/vnpy/api/xtp/xtptraderapi.dll b/vnpy/api/xtp/xtptraderapi.dll index 750f6be7..22b2e08a 100644 Binary files a/vnpy/api/xtp/xtptraderapi.dll and b/vnpy/api/xtp/xtptraderapi.dll differ