diff --git a/.gitignore b/.gitignore index 78b49ee..baf3ab0 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,7 @@ ipch/ *.opensdf *.sdf *.cachefile +*.opendb # Visual Studio profiler *.psess @@ -126,7 +127,7 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings +# TODO: Comment the next line if you want to checkin your web deploy settings # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj @@ -229,3 +230,13 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Linux objects +*.so +*.o + +# Misc files +*.userprefs + +# VSCode files +.vscode diff --git a/AllCppProjects.sln b/AllCppProjects.sln new file mode 100644 index 0000000..1014488 --- /dev/null +++ b/AllCppProjects.sln @@ -0,0 +1,414 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "apis", "apis", "{78740AE4-CA39-4892-B262-7FC77BF31E3A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CTP_Quote", "apis\CTP_Quote\CTP_Quote.vcxproj", "{919B914D-6840-453E-9201-8619E63AD0E1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CTP_Trade", "apis\CTP_Trade\CTP_Trade.vcxproj", "{9FBB0318-E21C-4B7C-A258-98E6A3860B35}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Kingstar_Quote", "apis\Kingstar_Quote\Kingstar_Quote.vcxproj", "{199071F1-5059-4883-BA49-6A9922A71ADD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Kingstar_Trade", "apis\Kingstar_Trade\Kingstar_Trade.vcxproj", "{70015722-8252-4944-AE20-16A88B583CEE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LTS_Query_v2", "apis\LTS_Query_v2\LTS_Query_v2.vcxproj", "{51D11C21-C4A7-4F07-9658-B8BA223684B8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LTS_Quote_v2", "apis\LTS_Quote_v2\LTS_Quote_v2.vcxproj", "{D4387736-0623-4442-A4AC-AF79239F9419}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LTS_Trade_v2", "apis\LTS_Trade_v2\LTS_Trade_v2.vcxproj", "{683AECBB-89EB-4692-99C5-A527853326D4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tdx_Trade", "apis\Tdx_Trade\Tdx_Trade.vcxproj", "{01D3F1DE-99B3-4D41-97C3-F4680CDB980B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TongShi_Quote", "apis\TongShi_Quote\TongShi_Quote.vcxproj", "{372C0D5E-ED93-4335-849C-65494AE8A17D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{463A606E-275B-4F7B-B46D-B5E0E0C9FBFF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "License", "common\License\License.vcxproj", "{D3231052-575C-4D58-BA38-2C01B10BF205}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Queue", "common\Queue\Queue.vcxproj", "{3A9173AA-92DB-49F9-88E3-09419C1D8E9F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{8B1A6E55-6AB5-4875-8EC0-97E86BF42714}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{EA89FD2A-C740-4401-84E8-3BFEB57B1D5A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FakeAPI", "tools\FakeAPI\FakeAPI.vcxproj", "{358586C9-A4B8-43E4-8376-59C68F0F6211}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CPP_TEST", "tests\CPP\CPP_TEST.vcxproj", "{C77ADBF7-E610-4E57-BE4D-C122FC5BE611}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "languages", "languages", "{DFA0F44C-82C0-4772-B71F-51D3DDE00F16}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XAPI_CPP", "languages\CPP\XAPI_CPP\XAPI_CPP.vcxproj", "{39599EFE-428F-408F-BF4F-BF462E37C5E8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CPP", "CPP", "{E883D8BF-3E2E-4899-B490-7346465B2555}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CPP", "CPP", "{A67F001E-0B1B-4BE2-90BB-243F8648B5EF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UFX_Trade", "apis\UFX_Trade\UFX_Trade.vcxproj", "{26C43947-9E7A-4B55-8A6D-A0F5222612AA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Wind_Quote", "apis\Wind_Quote\Wind_Quote.vcxproj", "{7B30B57A-6E59-482E-A8A8-5E2D978EA991}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sgit_Quote", "apis\Sgit_Quote\Sgit_Quote.vcxproj", "{62BD7F43-395B-4A1E-84AC-64135ECF371D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sgit_Trade", "apis\Sgit_Trade\Sgit_Trade.vcxproj", "{B8C6E4A3-3345-4C46-91B2-198EB9D292DB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CTP_SOPT_Trade", "apis\CTP_SOPT_Trade\CTP_SOPT_Trade.vcxproj", "{ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ATP_Quote", "apis\ATP_Quote\ATP_Quote.vcxproj", "{3F2DB224-C53A-4983-B77D-0629D3ABDD80}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ATP_Trade", "apis\ATP_Trade\ATP_Trade.vcxproj", "{6D0E7A00-CCBE-4103-80A7-42A980BF43E0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CTPZQ_Quote", "apis\CTPZQ_Quote\CTPZQ_Quote.vcxproj", "{891F3DF0-72F6-404A-AF4A-85F1A640AB82}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CTPZQ_Trade", "apis\CTPZQ_Trade\CTPZQ_Trade.vcxproj", "{5307B252-E992-4907-9C15-4BC5BD746F4C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Debug64|Win32 = Debug64|Win32 + Debug64|x64 = Debug64|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + Release64|Win32 = Release64|Win32 + Release64|x64 = Release64|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {919B914D-6840-453E-9201-8619E63AD0E1}.Debug|Win32.ActiveCfg = Debug|Win32 + {919B914D-6840-453E-9201-8619E63AD0E1}.Debug|Win32.Build.0 = Debug|Win32 + {919B914D-6840-453E-9201-8619E63AD0E1}.Debug|x64.ActiveCfg = Debug|Win32 + {919B914D-6840-453E-9201-8619E63AD0E1}.Debug64|Win32.ActiveCfg = Debug64|x64 + {919B914D-6840-453E-9201-8619E63AD0E1}.Debug64|x64.ActiveCfg = Debug64|x64 + {919B914D-6840-453E-9201-8619E63AD0E1}.Release|Win32.ActiveCfg = Release|Win32 + {919B914D-6840-453E-9201-8619E63AD0E1}.Release|Win32.Build.0 = Release|Win32 + {919B914D-6840-453E-9201-8619E63AD0E1}.Release|x64.ActiveCfg = Release|Win32 + {919B914D-6840-453E-9201-8619E63AD0E1}.Release64|Win32.ActiveCfg = Release64|x64 + {919B914D-6840-453E-9201-8619E63AD0E1}.Release64|x64.ActiveCfg = Release64|x64 + {919B914D-6840-453E-9201-8619E63AD0E1}.Release64|x64.Build.0 = Release64|x64 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug|Win32.ActiveCfg = Debug|Win32 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug|Win32.Build.0 = Debug|Win32 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug|x64.ActiveCfg = Debug|Win32 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug64|Win32.ActiveCfg = Debug64|x64 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug64|x64.ActiveCfg = Debug64|x64 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug64|x64.Build.0 = Debug64|x64 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release|Win32.ActiveCfg = Release|Win32 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release|Win32.Build.0 = Release|Win32 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release|x64.ActiveCfg = Release|Win32 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release64|Win32.ActiveCfg = Release64|x64 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release64|x64.ActiveCfg = Release64|x64 + {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release64|x64.Build.0 = Release64|x64 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug|Win32.ActiveCfg = Debug|Win32 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug|Win32.Build.0 = Debug|Win32 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug|x64.ActiveCfg = Debug|Win32 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug64|Win32.ActiveCfg = Debug|Win32 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug64|Win32.Build.0 = Debug|Win32 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug64|x64.ActiveCfg = Debug|Win32 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Release|Win32.ActiveCfg = Release|Win32 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Release|Win32.Build.0 = Release|Win32 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Release|x64.ActiveCfg = Release|Win32 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Release64|Win32.ActiveCfg = Release|Win32 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Release64|Win32.Build.0 = Release|Win32 + {199071F1-5059-4883-BA49-6A9922A71ADD}.Release64|x64.ActiveCfg = Release|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Debug|Win32.ActiveCfg = Debug|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Debug|Win32.Build.0 = Debug|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Debug|x64.ActiveCfg = Debug|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Debug64|Win32.ActiveCfg = Debug|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Debug64|Win32.Build.0 = Debug|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Debug64|x64.ActiveCfg = Debug|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Release|Win32.ActiveCfg = Release|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Release|Win32.Build.0 = Release|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Release|x64.ActiveCfg = Release|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Release64|Win32.ActiveCfg = Release|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Release64|Win32.Build.0 = Release|Win32 + {70015722-8252-4944-AE20-16A88B583CEE}.Release64|x64.ActiveCfg = Release|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug|Win32.ActiveCfg = Debug|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug|Win32.Build.0 = Debug|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug|x64.ActiveCfg = Debug|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug64|Win32.ActiveCfg = Debug|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug64|Win32.Build.0 = Debug|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug64|x64.ActiveCfg = Debug|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release|Win32.ActiveCfg = Release|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release|Win32.Build.0 = Release|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release|x64.ActiveCfg = Release|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release64|Win32.ActiveCfg = Release|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release64|Win32.Build.0 = Release|Win32 + {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release64|x64.ActiveCfg = Release|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Debug|Win32.ActiveCfg = Debug|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Debug|Win32.Build.0 = Debug|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Debug|x64.ActiveCfg = Debug|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Debug64|Win32.ActiveCfg = Debug|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Debug64|Win32.Build.0 = Debug|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Debug64|x64.ActiveCfg = Debug|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Release|Win32.ActiveCfg = Release|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Release|Win32.Build.0 = Release|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Release|x64.ActiveCfg = Release|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Release64|Win32.ActiveCfg = Release|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Release64|Win32.Build.0 = Release|Win32 + {D4387736-0623-4442-A4AC-AF79239F9419}.Release64|x64.ActiveCfg = Release|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Debug|Win32.ActiveCfg = Debug|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Debug|Win32.Build.0 = Debug|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Debug|x64.ActiveCfg = Debug|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Debug64|Win32.ActiveCfg = Debug|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Debug64|Win32.Build.0 = Debug|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Debug64|x64.ActiveCfg = Debug|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Release|Win32.ActiveCfg = Release|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Release|Win32.Build.0 = Release|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Release|x64.ActiveCfg = Release|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Release64|Win32.ActiveCfg = Release|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Release64|Win32.Build.0 = Release|Win32 + {683AECBB-89EB-4692-99C5-A527853326D4}.Release64|x64.ActiveCfg = Release|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug|Win32.ActiveCfg = Debug|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug|Win32.Build.0 = Debug|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug|x64.ActiveCfg = Debug|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug64|Win32.ActiveCfg = Debug|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug64|Win32.Build.0 = Debug|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug64|x64.ActiveCfg = Debug|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release|Win32.ActiveCfg = Release|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release|Win32.Build.0 = Release|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release|x64.ActiveCfg = Release|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release64|Win32.ActiveCfg = Release|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release64|Win32.Build.0 = Release|Win32 + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release64|x64.ActiveCfg = Release|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug|Win32.ActiveCfg = Debug|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug|Win32.Build.0 = Debug|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug|x64.ActiveCfg = Debug|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug64|Win32.ActiveCfg = Debug|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug64|Win32.Build.0 = Debug|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug64|x64.ActiveCfg = Debug|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release|Win32.ActiveCfg = Release|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release|Win32.Build.0 = Release|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release|x64.ActiveCfg = Release|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release64|Win32.ActiveCfg = Release|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release64|Win32.Build.0 = Release|Win32 + {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release64|x64.ActiveCfg = Release|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Debug|Win32.ActiveCfg = Debug|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Debug|Win32.Build.0 = Debug|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Debug|x64.ActiveCfg = Debug|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Debug64|Win32.ActiveCfg = Debug|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Debug64|Win32.Build.0 = Debug|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Debug64|x64.ActiveCfg = Debug|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Release|Win32.ActiveCfg = Release|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Release|Win32.Build.0 = Release|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Release|x64.ActiveCfg = Release|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Release64|Win32.ActiveCfg = Release|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Release64|Win32.Build.0 = Release|Win32 + {D3231052-575C-4D58-BA38-2C01B10BF205}.Release64|x64.ActiveCfg = Release|Win32 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug|Win32.ActiveCfg = Debug|Win32 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug|Win32.Build.0 = Debug|Win32 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug|x64.ActiveCfg = Debug|Win32 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug64|Win32.ActiveCfg = Debug64|x64 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug64|x64.ActiveCfg = Debug64|x64 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug64|x64.Build.0 = Debug64|x64 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release|Win32.ActiveCfg = Release|Win32 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release|Win32.Build.0 = Release|Win32 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release|x64.ActiveCfg = Release|Win32 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release64|Win32.ActiveCfg = Release64|x64 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release64|x64.ActiveCfg = Release64|x64 + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release64|x64.Build.0 = Release64|x64 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug|Win32.ActiveCfg = Debug|Win32 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug|Win32.Build.0 = Debug|Win32 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug|x64.ActiveCfg = Debug|Win32 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug64|Win32.ActiveCfg = Debug|Win32 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug64|Win32.Build.0 = Debug|Win32 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug64|x64.ActiveCfg = Debug|Win32 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release|Win32.ActiveCfg = Release|Win32 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release|Win32.Build.0 = Release|Win32 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release|x64.ActiveCfg = Release|Win32 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release64|Win32.ActiveCfg = Release64|Win32 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release64|Win32.Build.0 = Release64|Win32 + {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release64|x64.ActiveCfg = Release64|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug|Win32.ActiveCfg = Debug|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug|Win32.Build.0 = Debug|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug|x64.ActiveCfg = Debug|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug64|Win32.ActiveCfg = Debug|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug64|Win32.Build.0 = Debug|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug64|x64.ActiveCfg = Debug|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release|Win32.ActiveCfg = Release|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release|Win32.Build.0 = Release|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release|x64.ActiveCfg = Release|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release64|Win32.ActiveCfg = Release|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release64|Win32.Build.0 = Release|Win32 + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release64|x64.ActiveCfg = Release|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug|Win32.ActiveCfg = Debug|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug|Win32.Build.0 = Debug|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug|x64.ActiveCfg = Debug|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug64|Win32.ActiveCfg = Debug|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug64|Win32.Build.0 = Debug|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug64|x64.ActiveCfg = Debug|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug64|x64.Build.0 = Debug|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release|Win32.ActiveCfg = Release|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release|Win32.Build.0 = Release|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release|x64.ActiveCfg = Release|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release64|Win32.ActiveCfg = Release|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release64|Win32.Build.0 = Release|Win32 + {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release64|x64.ActiveCfg = Release|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Debug|Win32.ActiveCfg = Debug|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Debug|Win32.Build.0 = Debug|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Debug|x64.ActiveCfg = Debug|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Debug64|Win32.ActiveCfg = Debug|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Debug64|Win32.Build.0 = Debug|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Debug64|x64.ActiveCfg = Debug|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Release|Win32.ActiveCfg = Release|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Release|Win32.Build.0 = Release|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Release|x64.ActiveCfg = Release|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Release64|Win32.ActiveCfg = Release|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Release64|Win32.Build.0 = Release|Win32 + {26C43947-9E7A-4B55-8A6D-A0F5222612AA}.Release64|x64.ActiveCfg = Release|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Debug|Win32.ActiveCfg = Debug|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Debug|Win32.Build.0 = Debug|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Debug|x64.ActiveCfg = Debug|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Debug64|Win32.ActiveCfg = Debug|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Debug64|Win32.Build.0 = Debug|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Debug64|x64.ActiveCfg = Release|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Debug64|x64.Build.0 = Release|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Release|Win32.ActiveCfg = Release|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Release|Win32.Build.0 = Release|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Release|x64.ActiveCfg = Release|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Release64|Win32.ActiveCfg = Release|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Release64|Win32.Build.0 = Release|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Release64|x64.ActiveCfg = Release|Win32 + {7B30B57A-6E59-482E-A8A8-5E2D978EA991}.Release64|x64.Build.0 = Release|Win32 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Debug|Win32.ActiveCfg = Debug|Win32 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Debug|Win32.Build.0 = Debug|Win32 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Debug|x64.ActiveCfg = Debug|x64 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Debug|x64.Build.0 = Debug|x64 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Debug64|Win32.ActiveCfg = Debug|Win32 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Debug64|Win32.Build.0 = Debug|Win32 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Debug64|x64.ActiveCfg = Debug|x64 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Debug64|x64.Build.0 = Debug|x64 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Release|Win32.ActiveCfg = Release|Win32 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Release|Win32.Build.0 = Release|Win32 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Release|x64.ActiveCfg = Release|x64 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Release|x64.Build.0 = Release|x64 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Release64|Win32.ActiveCfg = Release|Win32 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Release64|Win32.Build.0 = Release|Win32 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Release64|x64.ActiveCfg = Release|x64 + {62BD7F43-395B-4A1E-84AC-64135ECF371D}.Release64|x64.Build.0 = Release|x64 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Debug|Win32.ActiveCfg = Debug|Win32 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Debug|Win32.Build.0 = Debug|Win32 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Debug|x64.ActiveCfg = Debug|x64 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Debug|x64.Build.0 = Debug|x64 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Debug64|Win32.ActiveCfg = Debug|Win32 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Debug64|Win32.Build.0 = Debug|Win32 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Debug64|x64.ActiveCfg = Debug|x64 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Debug64|x64.Build.0 = Debug|x64 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Release|Win32.ActiveCfg = Release|Win32 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Release|Win32.Build.0 = Release|Win32 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Release|x64.ActiveCfg = Release|x64 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Release|x64.Build.0 = Release|x64 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Release64|Win32.ActiveCfg = Release|Win32 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Release64|Win32.Build.0 = Release|Win32 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Release64|x64.ActiveCfg = Release|x64 + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB}.Release64|x64.Build.0 = Release|x64 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Debug|Win32.ActiveCfg = Debug|Win32 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Debug|Win32.Build.0 = Debug|Win32 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Debug|x64.ActiveCfg = Debug|x64 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Debug|x64.Build.0 = Debug|x64 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Debug64|Win32.ActiveCfg = Debug|Win32 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Debug64|Win32.Build.0 = Debug|Win32 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Debug64|x64.ActiveCfg = Debug|x64 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Release|Win32.ActiveCfg = Release|Win32 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Release|Win32.Build.0 = Release|Win32 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Release|x64.ActiveCfg = Release|x64 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Release|x64.Build.0 = Release|x64 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Release64|Win32.ActiveCfg = Release|Win32 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Release64|Win32.Build.0 = Release|Win32 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Release64|x64.ActiveCfg = Release|x64 + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A}.Release64|x64.Build.0 = Release|x64 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Debug|Win32.ActiveCfg = Debug|Win32 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Debug|Win32.Build.0 = Debug|Win32 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Debug|x64.ActiveCfg = Debug|x64 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Debug|x64.Build.0 = Debug|x64 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Debug64|Win32.ActiveCfg = Debug|Win32 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Debug64|Win32.Build.0 = Debug|Win32 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Debug64|x64.ActiveCfg = Debug|x64 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Debug64|x64.Build.0 = Debug|x64 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Release|Win32.ActiveCfg = Release|Win32 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Release|Win32.Build.0 = Release|Win32 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Release|x64.ActiveCfg = Release|x64 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Release|x64.Build.0 = Release|x64 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Release64|Win32.ActiveCfg = Release|Win32 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Release64|Win32.Build.0 = Release|Win32 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Release64|x64.ActiveCfg = Release|x64 + {3F2DB224-C53A-4983-B77D-0629D3ABDD80}.Release64|x64.Build.0 = Release|x64 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Debug|Win32.ActiveCfg = Debug|Win32 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Debug|Win32.Build.0 = Debug|Win32 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Debug|x64.ActiveCfg = Debug|x64 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Debug|x64.Build.0 = Debug|x64 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Debug64|Win32.ActiveCfg = Debug|Win32 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Debug64|Win32.Build.0 = Debug|Win32 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Debug64|x64.ActiveCfg = Debug|x64 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Debug64|x64.Build.0 = Debug|x64 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Release|Win32.ActiveCfg = Release|Win32 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Release|Win32.Build.0 = Release|Win32 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Release|x64.ActiveCfg = Release|x64 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Release|x64.Build.0 = Release|x64 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Release64|Win32.ActiveCfg = Release|Win32 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Release64|Win32.Build.0 = Release|Win32 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Release64|x64.ActiveCfg = Release|x64 + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0}.Release64|x64.Build.0 = Release|x64 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Debug|Win32.ActiveCfg = Debug|Win32 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Debug|Win32.Build.0 = Debug|Win32 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Debug|x64.ActiveCfg = Debug|x64 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Debug|x64.Build.0 = Debug|x64 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Debug64|Win32.ActiveCfg = Debug|Win32 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Debug64|Win32.Build.0 = Debug|Win32 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Debug64|x64.ActiveCfg = Debug|x64 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Debug64|x64.Build.0 = Debug|x64 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Release|Win32.ActiveCfg = Release|Win32 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Release|Win32.Build.0 = Release|Win32 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Release|x64.ActiveCfg = Release|x64 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Release|x64.Build.0 = Release|x64 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Release64|Win32.ActiveCfg = Release|Win32 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Release64|Win32.Build.0 = Release|Win32 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Release64|x64.ActiveCfg = Release|x64 + {891F3DF0-72F6-404A-AF4A-85F1A640AB82}.Release64|x64.Build.0 = Release|x64 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Debug|Win32.ActiveCfg = Debug|Win32 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Debug|Win32.Build.0 = Debug|Win32 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Debug|x64.ActiveCfg = Debug|x64 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Debug|x64.Build.0 = Debug|x64 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Debug64|Win32.ActiveCfg = Debug|Win32 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Debug64|Win32.Build.0 = Debug|Win32 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Debug64|x64.ActiveCfg = Debug|x64 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Debug64|x64.Build.0 = Debug|x64 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Release|Win32.ActiveCfg = Release|Win32 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Release|Win32.Build.0 = Release|Win32 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Release|x64.ActiveCfg = Release|x64 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Release|x64.Build.0 = Release|x64 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Release64|Win32.ActiveCfg = Release|Win32 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Release64|Win32.Build.0 = Release|Win32 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Release64|x64.ActiveCfg = Release|x64 + {5307B252-E992-4907-9C15-4BC5BD746F4C}.Release64|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {919B914D-6840-453E-9201-8619E63AD0E1} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {9FBB0318-E21C-4B7C-A258-98E6A3860B35} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {199071F1-5059-4883-BA49-6A9922A71ADD} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {70015722-8252-4944-AE20-16A88B583CEE} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {51D11C21-C4A7-4F07-9658-B8BA223684B8} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {D4387736-0623-4442-A4AC-AF79239F9419} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {683AECBB-89EB-4692-99C5-A527853326D4} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {01D3F1DE-99B3-4D41-97C3-F4680CDB980B} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {372C0D5E-ED93-4335-849C-65494AE8A17D} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {D3231052-575C-4D58-BA38-2C01B10BF205} = {463A606E-275B-4F7B-B46D-B5E0E0C9FBFF} + {3A9173AA-92DB-49F9-88E3-09419C1D8E9F} = {463A606E-275B-4F7B-B46D-B5E0E0C9FBFF} + {358586C9-A4B8-43E4-8376-59C68F0F6211} = {EA89FD2A-C740-4401-84E8-3BFEB57B1D5A} + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611} = {A67F001E-0B1B-4BE2-90BB-243F8648B5EF} + {39599EFE-428F-408F-BF4F-BF462E37C5E8} = {E883D8BF-3E2E-4899-B490-7346465B2555} + {E883D8BF-3E2E-4899-B490-7346465B2555} = {DFA0F44C-82C0-4772-B71F-51D3DDE00F16} + {A67F001E-0B1B-4BE2-90BB-243F8648B5EF} = {8B1A6E55-6AB5-4875-8EC0-97E86BF42714} + {26C43947-9E7A-4B55-8A6D-A0F5222612AA} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {7B30B57A-6E59-482E-A8A8-5E2D978EA991} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {62BD7F43-395B-4A1E-84AC-64135ECF371D} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {3F2DB224-C53A-4983-B77D-0629D3ABDD80} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {6D0E7A00-CCBE-4103-80A7-42A980BF43E0} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {891F3DF0-72F6-404A-AF4A-85F1A640AB82} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + {5307B252-E992-4907-9C15-4BC5BD746F4C} = {78740AE4-CA39-4892-B262-7FC77BF31E3A} + EndGlobalSection +EndGlobal diff --git a/CopyApiDll.bat b/CopyApiDll.bat new file mode 100644 index 0000000..5167290 --- /dev/null +++ b/CopyApiDll.bat @@ -0,0 +1,31 @@ +REM 32位调试版 +xcopy "include\Tdx\win32\*.*" "bin\Debug\x86\Tdx" /Y +xcopy "include\CTP\win32\*.dll" "bin\Debug\x86\CTP" /Y +xcopy "include\Kingstar\win32\*.*" "bin\Debug\x86\Kingstar" /Y +xcopy "include\LTS_v2\win32\*.dll" "bin\Debug\x86\LTS_v2" /Y +xcopy "include\UFX\win32\*.*" "bin\Debug\x86\UFX" /Y +xcopy "include\Wind\win32\*.dll" "bin\Debug\x86\Wind" /Y +xcopy "include\Sgit\win32\*.dll" "bin\Debug\x86\Sgit" /Y +xcopy "include\CTP_SOPT\win32\*.dll" "bin\Debug\x86\CTP_SOPT" /Y +xcopy "include\ATP\win32\*.dll" "bin\Debug\x86\ATP" /Y +xcopy "include\CTPZQ\win32\*.dll" "bin\Debug\x86\CTPZQ" /Y + +REM 32位发布版 +xcopy "include\Tdx\win32\*.*" "bin\Release\x86\Tdx" /Y +xcopy "include\CTP\win32\*.dll" "bin\Release\x86\CTP" /Y +xcopy "include\Kingstar\win32\*.*" "bin\Release\x86\Kingstar" /Y +xcopy "include\LTS_v2\win32\*.dll" "bin\Release\x86\LTS_v2" /Y +xcopy "include\UFX\win32\*.*" "bin\Release\x86\UFX" /Y +xcopy "include\Wind\win32\*.dll" "bin\Release\x86\Wind" /Y +xcopy "include\Sgit\win32\*.dll" "bin\Release\x86\Sgit" /Y +xcopy "include\CTP_SOPT\win32\*.dll" "bin\Release\x86\CTP_SOPT" /Y +xcopy "include\ATP\win32\*.dll" "bin\Release\x86\ATP" /Y +xcopy "include\CTPZQ\win32\*.dll" "bin\Release\x86\CTPZQ" /Y + +REM 64位调试版 +xcopy "include\CTP\win64\*.dll" "bin\Debug64\x64\CTP" /Y + +REM 64位发布版 +xcopy "include\CTP\win64\*.dll" "bin\Release64\x64\CTP" /Y + +pause \ No newline at end of file diff --git a/FakeAPI/instruments.dat b/FakeAPI/instruments.dat deleted file mode 100644 index f74a262..0000000 Binary files a/FakeAPI/instruments.dat and /dev/null differ diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..7a4ba3e --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1 @@ +BSD License \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2518b24 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +all: + $(MAKE) -C common/Queue all + $(MAKE) -C apis/CTP all + $(MAKE) -C tests/CPP all + +clean: + $(MAKE) -C common/Queue clean + $(MAKE) -C apis/CTP clean + $(MAKE) -C tests/CPP clean + diff --git a/Makefile.global b/Makefile.global new file mode 100644 index 0000000..c15f865 --- /dev/null +++ b/Makefile.global @@ -0,0 +1,11 @@ +CXX=clang++ +IFLAGS=-I../../ -I../../include/ -I../ -I./ +CFLAGS=$(IFLAGS)-std=c++11 -O3 -fPIC -pthread -Bsymbol + +all: $(ALL) + +%.o: %.cpp + $(CXX) $(CFLAGS) -c $^ -o $@ + +clean: + rm -rf *.so *.o $(DEPS) diff --git a/QuantBox_CTP_Quote/QuantBox_CTP_Quote.vcxproj b/QuantBox_CTP_Quote/QuantBox_CTP_Quote.vcxproj deleted file mode 100644 index 4cf345a..0000000 --- a/QuantBox_CTP_Quote/QuantBox_CTP_Quote.vcxproj +++ /dev/null @@ -1,274 +0,0 @@ - - - - - Debug64 - Win32 - - - Debug64 - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {919B914D-6840-453E-9201-8619E63AD0E1} - Win32Proj - QuantBox_CTP_Quote - - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - false - v120 - true - Unicode - - - DynamicLibrary - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - - - - true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\CTP\x86 - - - true - - - true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\CTP - - - true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\CTP\x64 - - - false - - - false - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - Cdecl - ..\include\ZeroMQ\libzmq\include;..\include\ZeroMQ\czmq\include;%(AdditionalIncludeDirectories) - - - Windows - true - ..\include\ApiHeader.def - - - xcopy "$(TargetPath)" "$(SolutionDir)XAPI\CTP\x86\" /Y -xcopy "$(SolutionDir)include\CTP\win32\*.dll" "$(SolutionDir)XAPI\CTP\x86\" /Y - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - ..\include\ApiHeader.def - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - ..\include\ApiHeader.def - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - ..\include\ApiHeader.def - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTBOX_CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - ..\include\ApiHeader.def - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTBOX_CTP_QUOTE_EXPORTS;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - QuantBox_CTP_Quote.def - - - - - - - - - - - - - - - - - Use - Use - Use - Use - - - - false - false - false - false - Use - Use - Use - Use - false - false - - - - - - - Use - Use - Use - Use - - - Use - Use - Use - Use - - - Create - Create - Create - Create - Create - Create - - - - - - \ No newline at end of file diff --git a/QuantBox_CTP_Trade/QuantBox_CTP_Trade.vcxproj b/QuantBox_CTP_Trade/QuantBox_CTP_Trade.vcxproj deleted file mode 100644 index fa3fed2..0000000 --- a/QuantBox_CTP_Trade/QuantBox_CTP_Trade.vcxproj +++ /dev/null @@ -1,277 +0,0 @@ - - - - - Debug64 - Win32 - - - Debug64 - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {9FBB0318-E21C-4B7C-A258-98E6A3860B35} - Win32Proj - QuantBox_CTP_Trade - - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - false - v120 - true - Unicode - - - DynamicLibrary - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - - - - true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\CTP\x86 - - - true - - - true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\CTP - - - true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\CTP\x64 - - - false - - - false - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - ..\include\ApiHeader.def - - - xcopy "$(TargetPath)" "$(SolutionDir)XAPI\CTP\x86\" /Y -xcopy "$(SolutionDir)include\CTP\win32\*.dll" "$(SolutionDir)XAPI\CTP\x86\" /Y - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - ..\include\ApiHeader.def - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - ..\include\ApiHeader.def - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - ..\include\ApiHeader.def - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - ..\include\ApiHeader.def - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTBOX_CTP_TRADE_EXPORTS;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - QuantBox_CTP_Trade.def - - - - - - - - - - - - - - - - - Use - Use - Use - Use - - - false - false - false - false - Use - Use - Use - Use - false - false - - - - - - - Use - Use - Use - Use - - - Create - Create - Create - Create - Create - Create - - - Use - Use - Use - Use - - - Use - Use - Use - Use - - - - - - \ No newline at end of file diff --git a/QuantBox_LTS_Query_v2/QueryApi.cpp b/QuantBox_LTS_Query_v2/QueryApi.cpp deleted file mode 100644 index f4f70b5..0000000 --- a/QuantBox_LTS_Query_v2/QueryApi.cpp +++ /dev/null @@ -1,1186 +0,0 @@ -#include "stdafx.h" -#include "QueryApi.h" - -#include "../include/QueueEnum.h" -#include "../include/QueueHeader.h" - -#include "../include/ApiHeader.h" -#include "../include/ApiStruct.h" - -#include "../include/toolkit.h" - -#include "../QuantBox_Queue/MsgQueue.h" - -// õ뽻ͬһת -#include "../QuantBox_LTS_Trade_v2/TypeConvert.h" - -#include -#include - -void* __stdcall Query_Q(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - // ڲãüǷΪ - CQueryApi* pApi = (CQueryApi*)pApi2; - pApi->QueryInThread(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - return nullptr; -} - -void CQueryApi::QueryInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - int iRet = 0; - switch (type) - { - case E_Init: - iRet = _Init(); - break; - case E_ReqUserLoginField: - iRet = _ReqUserLogin(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_QryTradingAccountField: - iRet = _ReqQryTradingAccount(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_QryInvestorPositionField: - iRet = _ReqQryInvestorPosition(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_QryInstrumentField: - iRet = _ReqQryInstrument(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_QryInvestorField: - iRet = _ReqQryInvestor(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_QryOrderField: - iRet = _ReqQryOrder(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_QryTradeField: - iRet = _ReqQryTrade(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_AuthRandCodeField: - iRet = _ReqFetchAuthRandCode(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - default: - break; - } - - if (0 == iRet) - { - //سɹӵѷͳ - m_nSleep = 1; - } - else - { - m_msgQueue_Query->Input_Copy(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - //ʧܣ4ݽʱ1s - m_nSleep *= 4; - m_nSleep %= 1023; - } - this_thread::sleep_for(chrono::milliseconds(m_nSleep)); -} - -void CQueryApi::Register(void* pCallback, void* pClass) -{ - m_pClass = pClass; - if (m_msgQueue == nullptr) - return; - - m_msgQueue_Query->Register((void*)Query_Q, this); - m_msgQueue->Register(pCallback, this); - if (pCallback) - { - m_msgQueue_Query->StartThread(); - m_msgQueue->StartThread(); - } - else - { - m_msgQueue_Query->StopThread(); - m_msgQueue->StopThread(); - } -} - -CQueryApi::CQueryApi(void) -{ - m_pApi = nullptr; - m_lRequestID = 0; - m_nSleep = 1; - - // ԼάϢ - m_msgQueue = new CMsgQueue(); - m_msgQueue_Query = new CMsgQueue(); - - m_msgQueue_Query->Register((void*)Query_Q, this); - m_msgQueue_Query->StartThread(); -} - - -CQueryApi::~CQueryApi(void) -{ - Disconnect(); -} - -bool CQueryApi::IsErrorRspInfo(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - bool bRet = ((pRspInfo) && (pRspInfo->ErrorID != 0)); - if (bRet) - { - ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); - - pField->RawErrorID = pRspInfo->ErrorID; - strcpy(pField->Text, pRspInfo->ErrorMsg); - - m_msgQueue->Input_NoCopy(ResponeType::OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); - } - return bRet; -} - -bool CQueryApi::IsErrorRspInfo(CSecurityFtdcRspInfoField *pRspInfo) -{ - bool bRet = ((pRspInfo) && (pRspInfo->ErrorID != 0)); - - return bRet; -} - -void CQueryApi::Connect(const string& szPath, - ServerInfoField* pServerInfo, - UserInfoField* pUserInfo) -{ - m_szPath = szPath; - memcpy(&m_ServerInfo, pServerInfo, sizeof(ServerInfoField)); - memcpy(&m_UserInfo, pUserInfo, sizeof(UserInfoField)); - - m_msgQueue_Query->Input_NoCopy(RequestType::E_Init, m_msgQueue_Query, this, 0, 0, - nullptr, 0, nullptr, 0, nullptr, 0); -} - -int CQueryApi::_Init() -{ - char *pszPath = new char[m_szPath.length() + 1024]; - srand((unsigned int)time(nullptr)); - sprintf(pszPath, "%s/%s/%s/Td/%d/", m_szPath.c_str(), m_ServerInfo.BrokerID, m_UserInfo.UserID, rand()); - makedirs(pszPath); - - m_pApi = CSecurityFtdcQueryApi::CreateFtdcQueryApi(pszPath); - delete[] pszPath; - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); - - if (m_pApi) - { - m_pApi->RegisterSpi(this); - - //ӵַ - size_t len = strlen(m_ServerInfo.Address) + 1; - char* buf = new char[len]; - strncpy(buf, m_ServerInfo.Address, len); - - char* token = strtok(buf, _QUANTBOX_SEPS_); - while (token) - { - if (strlen(token)>0) - { - m_pApi->RegisterFront(token); - } - token = strtok(nullptr, _QUANTBOX_SEPS_); - } - delete[] buf; - - //if (m_ServerInfo.PublicTopicResumeTypeSubscribePublicTopic((SECURITY_TE_RESUME_TYPE)m_ServerInfo.PublicTopicResumeType); - //if (m_ServerInfo.PrivateTopicResumeTypeSubscribePrivateTopic((SECURITY_TE_RESUME_TYPE)m_ServerInfo.PrivateTopicResumeType); - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); - //ʼ - m_pApi->Init(); - } - - return 0; -} - -void CQueryApi::Disconnect() -{ - if (m_msgQueue_Query) - { - m_msgQueue_Query->StopThread(); - m_msgQueue_Query->Register(nullptr, nullptr); - m_msgQueue_Query->Clear(); - delete m_msgQueue_Query; - m_msgQueue_Query = nullptr; - } - - if (m_pApi) - { - m_pApi->RegisterSpi(nullptr); - m_pApi->Release(); - m_pApi = nullptr; - - // ȫֻһ - m_msgQueue->Clear(); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); - // - m_msgQueue->Process(); - } - - if (m_msgQueue) - { - m_msgQueue->StopThread(); - m_msgQueue->Register(nullptr, nullptr); - m_msgQueue->Clear(); - delete m_msgQueue; - m_msgQueue = nullptr; - } - - m_lRequestID = 0;//߳ѾֹͣûбҪԭӲ - - Clear(); -} - -void CQueryApi::Clear() -{ - for (unordered_map::iterator it = m_id_platform_order.begin(); it != m_id_platform_order.end(); ++it) - delete it->second; - m_id_platform_order.clear(); - - for (unordered_map::iterator it = m_id_api_order.begin(); it != m_id_api_order.end(); ++it) - delete it->second; - m_id_api_order.clear(); - - //for (unordered_map::iterator it = m_id_platform_quote.begin(); it != m_id_platform_quote.end(); ++it) - // delete it->second; - //m_id_platform_quote.clear(); - - //for (unordered_map::iterator it = m_id_api_quote.begin(); it != m_id_api_quote.end(); ++it) - // delete it->second; - //m_id_api_quote.clear(); - - for (unordered_map::iterator it = m_id_platform_position.begin(); it != m_id_platform_position.end(); ++it) - delete it->second; - m_id_platform_position.clear(); -} - -void CQueryApi::OnFrontConnected() -{ - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); - - //ReqUserLogin(); - ReqFetchAuthRandCode(); -} - -void CQueryApi::OnFrontDisconnected(int nReason) -{ - RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); - - //ʧܷصϢƴӶɣҪΪͳһ - pField->RawErrorID = nReason; - GetOnFrontDisconnectedMsg(nReason, pField->Text); - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); -} - -void CQueryApi::ReqFetchAuthRandCode() -{ - CSecurityFtdcAuthRandCodeField* pBody = (CSecurityFtdcAuthRandCodeField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcAuthRandCodeField)); - - strncpy(pBody->RandCode, "", sizeof(TSecurityFtdcAuthCodeType)); - - m_msgQueue_Query->Input_NoCopy(RequestType::E_AuthRandCodeField, m_msgQueue_Query, this, 0, 0, - pBody, sizeof(CSecurityFtdcAuthRandCodeField), nullptr, 0, nullptr, 0); -} - -int CQueryApi::_ReqFetchAuthRandCode(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorizing, 0, nullptr, 0, nullptr, 0, nullptr, 0); - return m_pApi->ReqFetchAuthRandCode((CSecurityFtdcAuthRandCodeField*)ptr1, ++m_lRequestID); -} - -void CQueryApi::OnRspFetchAuthRandCode(CSecurityFtdcAuthRandCodeField *pAuthRandCode, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); - - if (!IsErrorRspInfo(pRspInfo) - && pAuthRandCode) - { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorized, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); - - ReqUserLogin(pAuthRandCode->RandCode); - } - else - { - pField->RawErrorID = pRspInfo->ErrorID; - strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); - } -} - -void CQueryApi::ReqUserLogin(TSecurityFtdcAuthCodeType RandCode) -{ - CSecurityFtdcReqUserLoginField* pBody = (CSecurityFtdcReqUserLoginField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcReqUserLoginField)); - - strncpy(pBody->BrokerID, m_ServerInfo.BrokerID, sizeof(TSecurityFtdcBrokerIDType)); - strncpy(pBody->UserID, m_UserInfo.UserID, sizeof(TSecurityFtdcInvestorIDType)); - strncpy(pBody->Password, m_UserInfo.Password, sizeof(TSecurityFtdcPasswordType)); - strncpy(pBody->UserProductInfo, m_ServerInfo.UserProductInfo, sizeof(TSecurityFtdcProductInfoType)); - strncpy(pBody->AuthCode, m_ServerInfo.AuthCode, sizeof(TSecurityFtdcAuthCodeType)); - strncpy(pBody->RandCode, RandCode, sizeof(TSecurityFtdcAuthCodeType)); - - m_msgQueue_Query->Input_NoCopy(RequestType::E_ReqUserLoginField, m_msgQueue_Query, this, 0, 0, - pBody, sizeof(CSecurityFtdcReqUserLoginField), nullptr, 0, nullptr, 0); -} - -int CQueryApi::_ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); - return m_pApi->ReqUserLogin((CSecurityFtdcReqUserLoginField*)ptr1, ++m_lRequestID); -} - -void CQueryApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); - - if (!IsErrorRspInfo(pRspInfo) - &&pRspUserLogin) - { - pField->TradingDay = GetDate(pRspUserLogin->TradingDay); - pField->LoginTime = GetTime(pRspUserLogin->LoginTime); - - sprintf(pField->SessionID, "%d:%d", pRspUserLogin->FrontID, pRspUserLogin->SessionID); - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); - - // µ¼Ϣܻõ - memcpy(&m_RspUserLogin,pRspUserLogin,sizeof(CSecurityFtdcRspUserLoginField)); - m_nMaxOrderRef = atol(pRspUserLogin->MaxOrderRef); - // ԼʱID1ʼܴ0ʼ - m_nMaxOrderRef = m_nMaxOrderRef>1 ? m_nMaxOrderRef : 1; - //ReqSettlementInfoConfirm(); - ReqQryInvestor(); - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); - - if (m_ServerInfo.PrivateTopicResumeType > ResumeType::ResumeType_Restart - && (m_ServerInfo.PrivateTopicResumeTypeRawErrorID = pRspInfo->ErrorID; - strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); - } -} - -//int CQueryApi::ReqOrderInsert( -// OrderField* pOrder, -// int count, -// OrderIDType* pInOut) -//{ -// int OrderRef = -1; -// if (nullptr == m_pApi) -// return -1; -// -// CSecurityFtdcInputOrderField body = {0}; -// -// strncpy(body.BrokerID, m_RspUserLogin.BrokerID, sizeof(TSecurityFtdcBrokerIDType)); -// strncpy(body.InvestorID, m_RspUserLogin.UserID, sizeof(TSecurityFtdcInvestorIDType)); -// -// body.MinVolume = 1; -// body.ForceCloseReason = SECURITY_FTDC_FCC_NotForceClose; -// body.IsAutoSuspend = 0; -// body.UserForceClose = 0; -// //body.IsSwapOrder = 0; -// -// //Լ -// strncpy(body.InstrumentID, pOrder->InstrumentID, sizeof(TSecurityFtdcInstrumentIDType)); -// strncpy(body.ExchangeID, pOrder->ExchangeID, sizeof(TSecurityFtdcExchangeIDType)); -// // -// body.Direction = OrderSide_2_TSecurityFtdcDirectionType(pOrder->Side); -// //ƽ -// body.CombOffsetFlag[0] = OpenCloseType_2_TSecurityFtdcOffsetFlagType(pOrder->OpenClose); -// //Ͷ -// body.CombHedgeFlag[0] = HedgeFlagType_2_TSecurityFtdcHedgeFlagType(pOrder->HedgeFlag); -// // -// body.VolumeTotalOriginal = (int)pOrder->Qty; -// -// // õһļ۸񣬻ļ۸أ -// //body.LimitPrice = pOrder1->Price; -// sprintf(body.LimitPrice, "%f", pOrder->Price); -// body.StopPrice = pOrder->StopPx; -// -// // ԵڶдеڶΪǽ -// if (count>1) -// { -// body.CombOffsetFlag[1] = OpenCloseType_2_TSecurityFtdcOffsetFlagType(pOrder[1].OpenClose); -// body.CombHedgeFlag[1] = HedgeFlagType_2_TSecurityFtdcHedgeFlagType(pOrder[1].HedgeFlag); -// // Ʋֻ¹ܣûʵ -// //body.IsSwapOrder = (body.CombOffsetFlag[0] != body.CombOffsetFlag[1]); -// } -// -// //۸ -// //body.OrderPriceType = OrderType_2_TSecurityFtdcOrderPriceTypeType(pOrder1->Type); -// -// // м޼ -// switch (pOrder->Type) -// { -// case Market: -// case Stop: -// case MarketOnClose: -// case TrailingStop: -// body.OrderPriceType = SECURITY_FTDC_OPT_BestPrice; -// body.TimeCondition = SECURITY_FTDC_TC_IOC; -// break; -// case Limit: -// case StopLimit: -// case TrailingStopLimit: -// default: -// body.OrderPriceType = SECURITY_FTDC_OPT_LimitPrice; -// body.TimeCondition = SECURITY_FTDC_TC_GFD; -// break; -// } -// -// // IOCFOK -// switch (pOrder->TimeInForce) -// { -// case IOC: -// body.TimeCondition = SECURITY_FTDC_TC_IOC; -// body.VolumeCondition = SECURITY_FTDC_VC_AV; -// break; -// case FOK: -// body.TimeCondition = SECURITY_FTDC_TC_IOC; -// body.VolumeCondition = SECURITY_FTDC_VC_CV; -// //body.MinVolume = body.VolumeTotalOriginal; // ط -// break; -// default: -// body.VolumeCondition = SECURITY_FTDC_VC_AV; -// break; -// } -// -// // -// switch (pOrder->Type) -// { -// case Stop: -// case TrailingStop: -// case StopLimit: -// case TrailingStopLimit: -// // ûвԣ -// body.ContingentCondition = SECURITY_FTDC_CC_Immediately; -// break; -// default: -// body.ContingentCondition = SECURITY_FTDC_CC_Immediately; -// break; -// } -// -// int nRet = 0; -// { -// //ܱ̫죬m_nMaxOrderRefûиıύ -// lock_guard cl(m_csOrderRef); -// -// if (OrderRef < 0) -// { -// nRet = m_nMaxOrderRef; -// ++m_nMaxOrderRef; -// } -// else -// { -// nRet = OrderRef; -// } -// sprintf(body.OrderRef, "%d", nRet); -// -// //浽Уֱӷ -// int n = m_pApi->ReqOrderInsert(&body, ++m_lRequestID); -// if (n < 0) -// { -// nRet = n; -// sprintf(m_orderInsert_Id, "%d", nRet); -// } -// else -// { -// sprintf(m_orderInsert_Id, "%d:%d:%d", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, nRet); -// -// OrderField* pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); -// memcpy(pField, pOrder, sizeof(OrderField)); -// strcpy(pField->ID, m_orderInsert_Id); -// m_id_platform_order.insert(pair(m_orderInsert_Id, pField)); -// } -// strncpy((char*)pInOut, m_orderInsert_Id, sizeof(OrderIDType)); -// } -// -// return nRet; -//} - -//void CQueryApi::OnRspOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -//{ -// OrderIDType orderId = { 0 }; -// if (pInputOrder) -// { -// sprintf(orderId, "%d:%d:%s", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, pInputOrder->OrderRef); -// } -// else -// { -// IsErrorRspInfo(pRspInfo, nRequestID, bIsLast); -// } -// -// unordered_map::iterator it = m_id_platform_order.find(orderId); -// if (it == m_id_platform_order.end()) -// { -// // ûҵӦʾ -// //assert(false); -// } -// else -// { -// // ҵˣҪ״̬ -// // ʹϴε״̬ -// OrderField* pField = it->second; -// strcpy(pField->ID, orderId); -// pField->ExecType = ExecType::ExecRejected; -// pField->Status = OrderStatus::Rejected; -// pField->ErrorID = pRspInfo->ErrorID; -// strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(ErrorMsgType)); -// m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); -// } -//} - -//void CQueryApi::OnErrRtnOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo) -//{ -// OrderIDType orderId = { 0 }; -// if (pInputOrder) -// { -// sprintf(orderId, "%d:%d:%s", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, pInputOrder->OrderRef); -// } -// else -// { -// IsErrorRspInfo(pRspInfo, 0, true); -// } -// -// unordered_map::iterator it = m_id_platform_order.find(orderId); -// if (it == m_id_platform_order.end()) -// { -// // ûҵӦʾ -// //assert(false); -// // LTSڿʼʱҲյ˻رﰡ -// } -// else -// { -// // ҵˣҪ״̬ -// // ʹϴε״̬ -// OrderField* pField = it->second; -// strcpy(pField->ID, orderId); -// pField->ExecType = ExecType::ExecRejected; -// pField->Status = OrderStatus::Rejected; -// pField->ErrorID = pRspInfo->ErrorID; -// strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(ErrorMsgType)); -// m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); -// } -//} -// -//void CQueryApi::OnRtnTrade(CSecurityFtdcTradeField *pTrade) -//{ -// OnTrade(pTrade,false); -//} - -//int CQueryApi::ReqOrderAction(OrderIDType* szIds, int count, OrderIDType* pOutput) -//{ -// unordered_map::iterator it = m_id_api_order.find(szIds[0]); -// if (it == m_id_api_order.end()) -// { -// sprintf((char*)pOutput, "%d", -100); -// return -100; -// } -// else -// { -// // ҵ˶ -// return ReqOrderAction(it->second, count, pOutput); -// } -//} - -//int CQueryApi::ReqOrderAction(CSecurityFtdcOrderField *pOrder, int count, OrderIDType* pOutput) -//{ -// if (nullptr == m_pApi) -// return 0; -// -// CSecurityFtdcInputOrderActionField body = {0}; -// -// ///͹˾ -// strncpy(body.BrokerID, pOrder->BrokerID,sizeof(TSecurityFtdcBrokerIDType)); -// ///Ͷߴ -// strncpy(body.InvestorID, pOrder->InvestorID,sizeof(TSecurityFtdcInvestorIDType)); -// /// -// strncpy(body.OrderRef, pOrder->OrderRef,sizeof(TSecurityFtdcOrderRefType)); -// ///ǰñ -// body.FrontID = pOrder->FrontID; -// ///Ự -// body.SessionID = pOrder->SessionID; -// /// -// strncpy(body.ExchangeID,pOrder->ExchangeID,sizeof(TSecurityFtdcExchangeIDType)); -// /// -// //strncpy(body.OrderSysID,pOrder->OrderSysID,sizeof(TSecurityFtdcOrderSysIDType)); -// ///־ -// body.ActionFlag = SECURITY_FTDC_AF_Delete; -// ///Լ -// strncpy(body.InstrumentID, pOrder->InstrumentID,sizeof(TSecurityFtdcInstrumentIDType)); -// -// int nRet = m_pApi->ReqOrderAction(&body, ++m_lRequestID); -// if (nRet < 0) -// { -// sprintf(m_orderAction_Id, "%d", nRet); -// } -// else -// { -// memset(m_orderAction_Id, 0, sizeof(OrderIDType)); -// } -// strncpy((char*)pOutput, m_orderAction_Id, sizeof(OrderIDType)); -// -// return nRet; -//} - -//void CQueryApi::OnRspOrderAction(CSecurityFtdcInputOrderActionField *pInputOrderAction, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -//{ -// OrderIDType orderId = { 0 }; -// if (pInputOrderAction) -// { -// sprintf(orderId, "%d:%d:%s", pInputOrderAction->FrontID, pInputOrderAction->SessionID, pInputOrderAction->OrderRef); -// } -// else -// { -// IsErrorRspInfo(pRspInfo, nRequestID, bIsLast); -// } -// -// unordered_map::iterator it = m_id_platform_order.find(orderId); -// if (it == m_id_platform_order.end()) -// { -// // ûҵӦʾ -// //assert(false); -// } -// else -// { -// // ҵˣҪ״̬ -// // ʹϴε״̬ -// OrderField* pField = it->second; -// pField->ExecType = ExecType::ExecCancelReject; -// pField->ErrorID = pRspInfo->ErrorID; -// strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(ErrorMsgType)); -// m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); -// } -//} - -//void CQueryApi::OnErrRtnOrderAction(CSecurityFtdcOrderActionField *pOrderAction, CSecurityFtdcRspInfoField *pRspInfo) -//{ -// OrderIDType orderId = { 0 }; -// if (pOrderAction) -// { -// sprintf(orderId, "%d:%d:%s", pOrderAction->FrontID, pOrderAction->SessionID, pOrderAction->OrderRef); -// } -// else -// { -// IsErrorRspInfo(pRspInfo, 0, true); -// } -// -// unordered_map::iterator it = m_id_platform_order.find(orderId); -// if (it == m_id_platform_order.end()) -// { -// // ûҵӦʾ -// //assert(false); -// } -// else -// { -// // ҵˣҪ״̬ -// // ʹϴε״̬ -// OrderField* pField = it->second; -// pField->ExecType = ExecType::ExecCancelReject; -// pField->ErrorID = pRspInfo->ErrorID; -// strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(ErrorMsgType)); -// m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); -// } -//} - -//void CQueryApi::OnRtnOrder(CSecurityFtdcOrderField *pOrder) -//{ -// OnOrder(pOrder,false); -//} - -void CQueryApi::ReqQryTradingAccount() -{ - CSecurityFtdcQryTradingAccountField* pBody = (CSecurityFtdcQryTradingAccountField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcQryTradingAccountField)); - - strcpy(pBody->BrokerID, m_RspUserLogin.BrokerID); - strcpy(pBody->InvestorID, m_RspUserLogin.UserID); - - m_msgQueue_Query->Input_NoCopy(RequestType::E_QryTradingAccountField, m_msgQueue_Query, this, 0, 0, - pBody, sizeof(CSecurityFtdcQryTradingAccountField), nullptr, 0, nullptr, 0); -} - -int CQueryApi::_ReqQryTradingAccount(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - return m_pApi->ReqQryTradingAccount((CSecurityFtdcQryTradingAccountField*)ptr1, ++m_lRequestID); -} - -void CQueryApi::OnRspQryTradingAccount(CSecurityFtdcTradingAccountField *pTradingAccount, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - if (!IsErrorRspInfo(pRspInfo, nRequestID, bIsLast)) - { - if (pTradingAccount) - { - AccountField* pField = (AccountField*)m_msgQueue->new_block(sizeof(AccountField)); - - strcpy(pField->AccountID, pTradingAccount->AccountID); - pField->PreBalance = pTradingAccount->PreBalance; - pField->CurrMargin = pTradingAccount->CurrMargin; - //pField->CloseProfit = pTradingAccount->CloseProfit; - //pField->PositionProfit = pTradingAccount->PositionProfit; - pField->Balance = pTradingAccount->Balance; - pField->Available = pTradingAccount->Available; - pField->Deposit = pTradingAccount->Deposit; - pField->Withdraw = pTradingAccount->Withdraw; - pField->FrozenTransferFee = pTradingAccount->FrozenTransferFee; - pField->FrozenStampTax = pTradingAccount->FrozenStampTax; - pField->FrozenCommission = pTradingAccount->FrozenCommission; - pField->FrozenCash = pTradingAccount->FrozenCash; - pField->TransferFee = pTradingAccount->TransferFee; - pField->StampTax = pTradingAccount->StampTax; - pField->Commission = pTradingAccount->Commission; - pField->CashIn = pTradingAccount->CashIn; - - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryTradingAccount, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(AccountField), nullptr, 0, nullptr, 0); - } - else - { - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryTradingAccount, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); - } - } -} - -void CQueryApi::ReqQryInvestorPosition(const string& szInstrumentId, const string& szExchange) -{ - CSecurityFtdcQryInvestorPositionField* pBody = (CSecurityFtdcQryInvestorPositionField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcQryInvestorPositionField)); - - strcpy(pBody->BrokerID, m_RspUserLogin.BrokerID); - strcpy(pBody->InvestorID, m_RspUserLogin.UserID); - strncpy(pBody->InstrumentID, szInstrumentId.c_str(), sizeof(TSecurityFtdcInstrumentIDType)); - - m_msgQueue_Query->Input_NoCopy(RequestType::E_QryInvestorPositionField, m_msgQueue_Query, this, 0, 0, - pBody, sizeof(CSecurityFtdcQryInvestorPositionField), nullptr, 0, nullptr, 0); -} - -int CQueryApi::_ReqQryInvestorPosition(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - return m_pApi->ReqQryInvestorPosition((CSecurityFtdcQryInvestorPositionField*)ptr1, ++m_lRequestID); -} - -// ծعֲNetҹൽLongУֱӴӳɽзֹ鵽Net -// пƽͶͶǿ -void CQueryApi::OnRspQryInvestorPosition(CSecurityFtdcInvestorPositionField *pInvestorPosition, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - if (!IsErrorRspInfo(pRspInfo, nRequestID, bIsLast)) - { - if (pInvestorPosition) - { - PositionIDType positionId = { 0 }; - sprintf(positionId, "%s:%s:%d:%d", - pInvestorPosition->InstrumentID, pInvestorPosition->ExchangeID, - TSecurityFtdcPosiDirectionType_2_PositionSide(pInvestorPosition->PosiDirection), TSecurityFtdcHedgeFlagType_2_HedgeFlagType(pInvestorPosition->HedgeFlag)); - - PositionField* pField = nullptr; - unordered_map::iterator it = m_id_platform_position.find(positionId); - if (it == m_id_platform_position.end()) - { - pField = (PositionField*)m_msgQueue->new_block(sizeof(PositionField)); - - sprintf(pField->Symbol, "%s.%s", pInvestorPosition->InstrumentID, pInvestorPosition->ExchangeID); - strcpy(pField->InstrumentID, pInvestorPosition->InstrumentID); - strcpy(pField->ExchangeID, pInvestorPosition->ExchangeID); - pField->Side = TSecurityFtdcPosiDirectionType_2_PositionSide(pInvestorPosition->PosiDirection); - pField->HedgeFlag = TSecurityFtdcHedgeFlagType_2_HedgeFlagType(pInvestorPosition->HedgeFlag); - - m_id_platform_position.insert(pair(positionId, pField)); - } - else - { - pField = it->second; - } - - pField->Position = pInvestorPosition->Position; - pField->TodayPosition = pInvestorPosition->TodayPosition; - pField->HistoryPosition = pInvestorPosition->YdPosition; - - // ռȫٱ֪ͨһ - if (bIsLast) - { - int cnt = 0; - int count = m_id_platform_position.size(); - for (unordered_map::iterator iter = m_id_platform_position.begin(); iter != m_id_platform_position.end(); iter++) - { - ++cnt; - m_msgQueue->Input_Copy(ResponeType::OnRspQryInvestorPosition, m_msgQueue, m_pClass, cnt == count, 0, iter->second, sizeof(PositionField), nullptr, 0, nullptr, 0); - } - } - } - } -} - -void CQueryApi::ReqQryInstrument(const string& szInstrumentId, const string& szExchange) -{ - CSecurityFtdcQryInstrumentField* pBody = (CSecurityFtdcQryInstrumentField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcQryInstrumentField)); - - strncpy(pBody->InstrumentID, szInstrumentId.c_str(), sizeof(TSecurityFtdcInstrumentIDType)); - strncpy(pBody->ExchangeID, szExchange.c_str(), sizeof(TSecurityFtdcExchangeIDType)); - - m_msgQueue_Query->Input_NoCopy(RequestType::E_QryInstrumentField, m_msgQueue_Query, this, 0, 0, - pBody, sizeof(CSecurityFtdcQryInstrumentField), nullptr, 0, nullptr, 0); -} - -int CQueryApi::_ReqQryInstrument(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - return m_pApi->ReqQryInstrument((CSecurityFtdcQryInstrumentField*)ptr1, ++m_lRequestID); -} - -void CQueryApi::OnRspQryInstrument(CSecurityFtdcInstrumentField *pInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - if (!IsErrorRspInfo(pRspInfo, nRequestID, bIsLast)) - { - if (pInstrument) - { - InstrumentField* pField = (InstrumentField*)m_msgQueue->new_block(sizeof(InstrumentField)); - - strncpy(pField->InstrumentID, pInstrument->InstrumentID, sizeof(InstrumentIDType)); - strncpy(pField->ExchangeID, pInstrument->ExchangeID, sizeof(ExchangeIDType)); - - sprintf(pField->Symbol,"%s.%s",pInstrument->InstrumentID,pInstrument->ExchangeID); - sprintf(pField->InstrumentName, "%s(%s)", pInstrument->ExchangeInstID, pInstrument->InstrumentName); - strncpy(pField->ProductID, pInstrument->ProductID, sizeof(InstrumentIDType)); - - //strncpy(pField->InstrumentName, pInstrument->InstrumentName, sizeof(InstrumentNameType)); - pField->Type = CSecurityFtdcInstrumentField_2_InstrumentType(pInstrument); - pField->VolumeMultiple = pInstrument->VolumeMultiple; - pField->PriceTick = CSecurityFtdcInstrumentField_2_PriceTick(pInstrument); - pField->ExpireDate = GetDate(pInstrument->ExpireDate); - pField->OptionsType = CSecurityFtdcInstrumentField_2_PutCall(pInstrument); - pField->StrikePrice = pInstrument->ExecPrice; - - - // Ȩı - if (strlen(pInstrument->InstrumentID) == 8) - { - strncpy(pField->UnderlyingInstrID, pInstrument->ExchangeInstID, 6); - sprintf(&pField->UnderlyingInstrID[6], ".%s", pInstrument->ExchangeID); - } - - - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InstrumentField), nullptr, 0, nullptr, 0); - } - else - { - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); - } - } -} -// -//void CTraderApi::ReqQryInstrumentCommissionRate(const string& szInstrumentId) -//{ -// if (nullptr == m_pApi) -// return; -// -// SRequest* pRequest = MakeRequestBuf(E_QryInstrumentCommissionRateField); -// if (nullptr == pRequest) -// return; -// -// CSecurityFtdcQryInstrumentCommissionRateField& body = pRequest->QryInstrumentCommissionRateField; -// -// strncpy(body.BrokerID, m_RspUserLogin.BrokerID,sizeof(TSecurityFtdcBrokerIDType)); -// strncpy(body.InvestorID, m_RspUserLogin.UserID,sizeof(TSecurityFtdcInvestorIDType)); -// strncpy(body.InstrumentID,szInstrumentId.c_str(),sizeof(TSecurityFtdcInstrumentIDType)); -// -// AddToSendQueue(pRequest); -//} -// -//void CTraderApi::OnRspQryInstrumentCommissionRate(CSecurityFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -//{ -// //if(m_msgQueue) -// // m_msgQueue->Input_OnRspQryInstrumentCommissionRate(this,pInstrumentCommissionRate,pRspInfo,nRequestID,bIsLast); -// -// if (bIsLast) -// ReleaseRequestMapBuf(nRequestID); -//} - -void CQueryApi::OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - IsErrorRspInfo(pRspInfo, nRequestID, bIsLast); -} - -void CQueryApi::ReqQryOrder() -{ - CSecurityFtdcQryOrderField* pBody = (CSecurityFtdcQryOrderField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcQryOrderField)); - - strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID, sizeof(TSecurityFtdcBrokerIDType)); - strncpy(pBody->InvestorID, m_RspUserLogin.UserID, sizeof(TSecurityFtdcInvestorIDType)); - - m_msgQueue_Query->Input_NoCopy(RequestType::E_QryOrderField, m_msgQueue_Query, this, 0, 0, - pBody, sizeof(CSecurityFtdcQryOrderField), nullptr, 0, nullptr, 0); -} - -int CQueryApi::_ReqQryOrder(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - return m_pApi->ReqQryOrder((CSecurityFtdcQryOrderField*)ptr1, ++m_lRequestID); -} - -void CQueryApi::OnOrder(CSecurityFtdcOrderField *pOrder, bool bFromQry) -{ - if (nullptr == pOrder) - return; - - OrderIDType orderId = { 0 }; - sprintf(orderId, "%d:%d:%s", pOrder->FrontID, pOrder->SessionID, pOrder->OrderRef); - OrderIDType orderSydId = { 0 }; - - { - // ԭʼϢڳ - - unordered_map::iterator it = m_id_api_order.find(orderId); - if (it == m_id_api_order.end()) - { - // Ҳ˶ʾµ - CSecurityFtdcOrderField* pField = new CSecurityFtdcOrderField(); - memcpy(pField, pOrder, sizeof(CSecurityFtdcOrderField)); - m_id_api_order.insert(pair(orderId, pField)); - } - else - { - // ҵ˶ - // ҪٸƱһε״ֻ̬Ҫһεڳɣ£ñȽ - CSecurityFtdcOrderField* pField = it->second; - memcpy(pField, pOrder, sizeof(CSecurityFtdcOrderField)); - } - - // SysIDڶɽر붩 - sprintf(orderSydId, "%s:%s", pOrder->ExchangeID, pOrder->OrderSysID); - m_sysId_orderId.insert(pair(orderSydId, orderId)); - } - - { - // APIĶתԼĽṹ - - OrderField* pField = nullptr; - unordered_map::iterator it = m_id_platform_order.find(orderId); - if (it == m_id_platform_order.end()) - { - // ʱϢûУҲӦĵӣҪOrderĻָ - pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); - - strcpy(pField->ID, orderId); - strcpy(pField->InstrumentID, pOrder->InstrumentID); - strcpy(pField->ExchangeID, pOrder->ExchangeID); - pField->HedgeFlag = TSecurityFtdcHedgeFlagType_2_HedgeFlagType(pOrder->CombHedgeFlag[0]); - pField->Side = TSecurityFtdcDirectionType_2_OrderSide(pOrder->Direction); - pField->Price = atof(pOrder->LimitPrice); - pField->StopPx = pOrder->StopPrice; - strncpy(pField->Text, pOrder->StatusMsg, sizeof(Char256Type)); - pField->OpenClose = TSecurityFtdcOffsetFlagType_2_OpenCloseType(pOrder->CombOffsetFlag[0]); - pField->Status = CSecurityFtdcOrderField_2_OrderStatus(pOrder); - pField->Qty = pOrder->VolumeTotalOriginal; - pField->Type = CSecurityFtdcOrderField_2_OrderType(pOrder); - pField->TimeInForce = CSecurityFtdcOrderField_2_TimeInForce(pOrder); - pField->ExecType = ExecType::ExecType_New; - strcpy(pField->OrderID, pOrder->OrderSysID); - - - // ӵmapУߵĶȡʧʱ֪ͨ - m_id_platform_order.insert(pair(orderId, pField)); - } - else - { - pField = it->second; - strcpy(pField->ID, orderId); - pField->LeavesQty = pOrder->VolumeTotal; - pField->Price = atof(pOrder->LimitPrice); - pField->Status = CSecurityFtdcOrderField_2_OrderStatus(pOrder); - pField->ExecType = CSecurityFtdcOrderField_2_ExecType(pOrder); - strcpy(pField->OrderID, pOrder->OrderSysID); - strncpy(pField->Text, pOrder->StatusMsg, sizeof(Char256Type)); - } - - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); - } -} - -void CQueryApi::OnRspQryOrder(CSecurityFtdcOrderField *pOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - if (!IsErrorRspInfo(pRspInfo, nRequestID, bIsLast)) - { - OnOrder(pOrder, true); - } -} - -void CQueryApi::ReqQryTrade() -{ - CSecurityFtdcQryTradeField* pBody = (CSecurityFtdcQryTradeField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcQryTradeField)); - - strcpy(pBody->BrokerID, m_RspUserLogin.BrokerID); - strcpy(pBody->InvestorID, m_RspUserLogin.UserID); - - m_msgQueue_Query->Input_NoCopy(RequestType::E_QryTradeField, m_msgQueue_Query, this, 0, 0, - pBody, sizeof(CSecurityFtdcQryTradeField), nullptr, 0, nullptr, 0); -} - -int CQueryApi::_ReqQryTrade(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - return m_pApi->ReqQryTrade((CSecurityFtdcQryTradeField*)ptr1, ++m_lRequestID); -} - -void CQueryApi::OnTrade(CSecurityFtdcTradeField *pTrade, bool bFromQry) -{ - if (nullptr == pTrade) - return; - - TradeField* pField = (TradeField*)m_msgQueue->new_block(sizeof(TradeField)); - - strcpy(pField->InstrumentID, pTrade->InstrumentID); - strcpy(pField->ExchangeID, pTrade->ExchangeID); - pField->Side = TSecurityFtdcDirectionType_2_OrderSide(pTrade->Direction); - pField->Qty = pTrade->Volume; - pField->Price = atof(pTrade->Price); - pField->OpenClose = TSecurityFtdcOffsetFlagType_2_OpenCloseType(pTrade->OffsetFlag); - pField->HedgeFlag = TSecurityFtdcHedgeFlagType_2_HedgeFlagType(pTrade->HedgeFlag); - pField->Commission = 0;//TODOԺҪ - pField->Time = GetTime(pTrade->TradeTime); - strcpy(pField->TradeID, pTrade->TradeID); - - OrderIDType orderSysId = { 0 }; - sprintf(orderSysId, "%s:%s", pTrade->ExchangeID, pTrade->OrderSysID); - unordered_map::iterator it = m_sysId_orderId.find(orderSysId); - if (it == m_sysId_orderId.end()) - { - // ˳ɽҲӦı - //assert(false); - } - else - { - // ҵӦı - strcpy(pField->ID, it->second.c_str()); - - m_msgQueue->Input_Copy(ResponeType::OnRtnTrade, m_msgQueue, m_pClass, 0, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); - - unordered_map::iterator it2 = m_id_platform_order.find(it->second); - if (it2 == m_id_platform_order.end()) - { - // ˳ɽҲӦı - //assert(false); - } - else - { - // ¶״̬ - // ǷҪ֪ͨӿ - } - - OnTrade(pField, bFromQry); - } -} - -void CQueryApi::OnTrade(TradeField *pTrade, bool bFromQry) -{ - PositionIDType positionId = { 0 }; - sprintf(positionId, "%s:%s:%d:%d", - pTrade->InstrumentID, pTrade->ExchangeID, TradeField_2_PositionSide(pTrade), pTrade->HedgeFlag); - - PositionField* pField = nullptr; - unordered_map::iterator it = m_id_platform_position.find(positionId); - if (it == m_id_platform_position.end()) - { - pField = (PositionField*)m_msgQueue->new_block(sizeof(PositionField)); - - sprintf(pField->Symbol, "%s.%s", pTrade->InstrumentID, pTrade->ExchangeID); - strcpy(pField->InstrumentID, pTrade->InstrumentID); - strcpy(pField->ExchangeID, pTrade->ExchangeID); - pField->Side = TradeField_2_PositionSide(pTrade); - pField->HedgeFlag = TSecurityFtdcHedgeFlagType_2_HedgeFlagType(pTrade->HedgeFlag); - - m_id_platform_position.insert(pair(positionId, pField)); - } - else - { - pField = it->second; - } - - if (pTrade->Side == OrderSide::OrderSide_Buy) - { - pField->Position += pTrade->Qty; - pField->TodayPosition += pTrade->Qty; - } - else - { - pField->Position -= pTrade->Qty; - if (pTrade->OpenClose == OpenCloseType::OpenCloseType_CloseToday) - { - pField->TodayPosition -= pTrade->Qty; - } - else - { - pField->HistoryPosition -= pTrade->Qty; - // ıɸӽ쿪ʼ - if (pField->HistoryPosition<0) - { - pField->TodayPosition += pField->HistoryPosition; - pField->HistoryPosition = 0; - } - } - - // ֱ²ѯ - if (pField->Position < 0 || pField->TodayPosition < 0 || pField->HistoryPosition < 0) - { - ReqQryInvestorPosition("", ""); - return; - } - } - - m_msgQueue->Input_Copy(ResponeType::OnRspQryInvestorPosition, m_msgQueue, m_pClass, false, 0, pField, sizeof(PositionField), nullptr, 0, nullptr, 0); -} - -void CQueryApi::OnRspQryTrade(CSecurityFtdcTradeField *pTrade, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - if (!IsErrorRspInfo(pRspInfo, nRequestID, bIsLast)) - { - OnTrade(pTrade,true); - } -} - -void CQueryApi::ReqQryInvestor() -{ - CSecurityFtdcQryInvestorField* pBody = (CSecurityFtdcQryInvestorField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcQryInvestorField)); - - strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID, sizeof(TSecurityFtdcBrokerIDType)); - strncpy(pBody->InvestorID, m_RspUserLogin.UserID, sizeof(TSecurityFtdcInvestorIDType)); - - m_msgQueue_Query->Input_NoCopy(RequestType::E_QryInvestorField, m_msgQueue_Query, this, 0, 0, - pBody, sizeof(CSecurityFtdcQryInvestorField), nullptr, 0, nullptr, 0); -} - -int CQueryApi::_ReqQryInvestor(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - return m_pApi->ReqQryInvestor((CSecurityFtdcQryInvestorField*)ptr1, ++m_lRequestID); -} - -void CQueryApi::OnRspQryInvestor(CSecurityFtdcInvestorField *pInvestor, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - if (!IsErrorRspInfo(pRspInfo, nRequestID, bIsLast)) - { - if (pInvestor) - { - memcpy(&m_Investor, pInvestor, sizeof(CSecurityFtdcInvestorField)); - - InvestorField* pField = (InvestorField*)m_msgQueue->new_block(sizeof(InvestorField)); - - strcpy(pField->BrokerID, pInvestor->BrokerID); - strcpy(pField->InvestorID, pInvestor->InvestorID); - strcpy(pField->InvestorName, pInvestor->InvestorName); - strcpy(pField->IdentifiedCardNo, pInvestor->IdentifiedCardNo); - pField->IdentifiedCardType = TSecurityFtdcIdCardTypeType_2_IdCardType(pInvestor->IdentifiedCardType); - - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInvestor, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InvestorField), nullptr, 0, nullptr, 0); - } - else - { - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInvestor, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); - } - } -} diff --git a/QuantBox_LTS_Query_v2/main.cpp b/QuantBox_LTS_Query_v2/main.cpp deleted file mode 100644 index a10d50f..0000000 --- a/QuantBox_LTS_Query_v2/main.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include "stdafx.h" -#include "../include/ApiHeader.h" -#include "../include/QueueEnum.h" -#include "QueryApi.h" - -inline CQueryApi* GetApi(void* pApi) -{ - return static_cast(pApi); -} - -void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - RequestType rt = (RequestType)type; - switch (rt) - { - case GetApiType: - return (void*)(ApiType::ApiType_Query | ApiType::ApiType_Instrument); - case GetApiVersion: - return (void*)"0.1.0.20151116"; - case GetApiName: - return (void*)"LTS2"; - case Create: - return new CQueryApi(); - default: - break; - } - - if (pApi1 == nullptr) - { - return nullptr; - } - - CQueryApi* pApi = GetApi(pApi1); - - switch (rt) - { - case Release: - delete pApi; - return nullptr; - case Register: - pApi->Register(ptr1, ptr2); - break; - case Connect: - pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); - break; - case Disconnect: - pApi->Disconnect(); - break; - case ReqQryInstrument: - pApi->ReqQryInstrument((const char*)ptr1, (const char*)ptr2); - break; - case ReqQryTradingAccount: - pApi->ReqQryTradingAccount(); - break; - case ReqQryInvestorPosition: - pApi->ReqQryInvestorPosition((const char*)ptr1, (const char*)ptr2); - break; - //case ReqQrySettlementInfo: - // pApi->ReqQrySettlementInfo((const char*)ptr1); - // break; - //case ReqOrderInsert: - // return (void*)pApi->ReqOrderInsert((OrderField*)ptr1, size1, (OrderIDType*)ptr2); - // //case ReqQuoteInsert: - // // return (void*)pApi->ReqQuoteInsert((int)double1, (OrderField*)ptr1, (OrderField*)ptr2); - //case ReqOrderAction: - // return (void*)pApi->ReqOrderAction((OrderIDType*)ptr1, size1, (OrderIDType*)ptr2); - // break; - default: - break; - } - - return pApi1; -} diff --git a/QuantBox_Queue/MsgQueue.cpp b/QuantBox_Queue/MsgQueue.cpp deleted file mode 100644 index 50df4a4..0000000 --- a/QuantBox_Queue/MsgQueue.cpp +++ /dev/null @@ -1,115 +0,0 @@ -#include "stdafx.h" -#include "MsgQueue.h" - -CMsgQueue::CMsgQueue()//:m_queue(1024) -{ - m_hThread = nullptr; - m_bRunning = false; - m_bDirectOutput = false; - - //回调函数地址指针 - m_fnOnRespone = nullptr; -} - -void CMsgQueue::Clear() -{ - ResponeItem* pItem = nullptr; - //清空队列 - while (m_queue.try_dequeue(pItem)) - { - if (pItem->bNeedDelete) - { - delete[] pItem->ptr1; - delete[] pItem->ptr2; - delete[] pItem->ptr3; - } - delete pItem; - } -} - -bool CMsgQueue::Process() -{ - ResponeItem* pItem = nullptr; - if (m_queue.try_dequeue(pItem)) - { - Output(pItem); - if (pItem->bNeedDelete) - { - // 删除的是数组,目前是自己模块创建的自己删 - delete[] pItem->ptr1; - delete[] pItem->ptr2; - delete[] pItem->ptr3; - } - delete pItem; - return true; - } - return false; -} - -void CMsgQueue::Output(ResponeItem* pItem) -{ - try - { - if (m_fnOnRespone) - (*m_fnOnRespone)(pItem->type, pItem->pApi1, pItem->pApi2, pItem->double1, pItem->double2, pItem->ptr1, pItem->size1, pItem->ptr2, pItem->size2, pItem->ptr3, pItem->size3); - } - catch (...) - { - m_fnOnRespone = nullptr; - } -} - -void CMsgQueue::StartThread() -{ - if(nullptr == m_hThread) - { - m_bRunning = true; - m_hThread = new thread(ProcessThread,this); - } -} - -void CMsgQueue::StopThread() -{ - m_bRunning = false; - this_thread::sleep_for(chrono::milliseconds(1)); - m_cv.notify_all(); - this_thread::sleep_for(chrono::milliseconds(1)); - lock_guard cl(m_mtx_del); - if(m_hThread) - { - //m_cv.notify_all(); - m_hThread->join(); - delete m_hThread; - m_hThread = nullptr; - } -} - - -void CMsgQueue::RunInThread() -{ - while (m_bRunning) - { - if (Process()) - { - } - else - { - // 空闲时等1ms,如果立即有事件过来就晚了1ms - //this_thread::sleep_for(chrono::milliseconds(1)); - - // 空闲时过来等1ms,没等到就回去再试 - // 如过正好等到了,就立即去试,应当会快一点吧? - unique_lock lck(m_mtx); - m_cv.wait_for(lck, std::chrono::seconds(1), [this]{return m_bRunning == false; }); - } - } - - // 清理线程 - m_hThread = nullptr; - m_bRunning = false; -} - -ConfigInfoField* CMsgQueue::Config(ConfigInfoField* pConfigInfo) -{ - return nullptr; -} diff --git a/QuantBox_Tdx_Trade/Struct.h b/QuantBox_Tdx_Trade/Struct.h deleted file mode 100644 index 4124838..0000000 --- a/QuantBox_Tdx_Trade/Struct.h +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -/* -120_ͻ|134_|121_ʽʺ|125_ʺ|123_ɶ|110_ίзʽ|1207 -_ʼ|1227_|101_|5250_ͻȺ|5251_ͻӪҵ|5252_Ӳк -|5253_CPUID|5254_ýױʶ|5255_Ự|5256_ͻ| -=============== -143_ίʱ|123_ɶ|140_֤ȯ|141_֤ȯ|130_־|131_־|10 -0_|145_ίм۸|144_ί|153_ɽ۸|152_ɽ|162_|14 -6_ίб|194_۷ʽ|147_״̬˵|161_ʽ|1213_Ϣ| -*/ -//#define REQUEST_DRWT 1102 // ί - -/* -120_ͻ|134_|121_ʽʺ|125_ʺ|123_ɶ|110_ίзʽ|126_ -ʼ|127_ֹ|1207_ʼ|140_֤ȯ|1227_|5250_ͻȺ|5251_ -Ӫҵ|5252_Ӳк|5253_CPUID|5254_ýױʶ|5255_Ự|5256_ͻ| - -=============== -142_ί|123_ɶ|140_֤ȯ|141_֤ȯ|130_־|131_־|10 -0_|145_ίм۸|144_ί|153_ɽ۸|152_ɽ|162_|14 -6_ίб|194_۷ʽ|161_ʽ|1213_Ϣ| -*/ -//#define REQUEST_LSWT 1104 // ʷί - -struct WTLB_STRUCT -{ - int WTRQ; // 142_ί - int WTSJ; // 143_ίʱ - char GDDM[32]; // 123_ɶ - char ZQDM[32]; // 140_֤ȯ - char ZQMC[32]; // 141_֤ȯ - int MMBZ; // 130_־ - int WTLB; // 131_ί - int JYSDM; // 100_ - double WTJG; // 145_ίм۸ - int WTSL; // 144_ί - double CJJG; // 153_ɽ۸ - int CDSL; // 162_ - char WTBH[32]; // 146_ίб - int BJFS; // 194_۷ʽ - double DJZJ; // 161_ʽ -}; - - -/* -120_ͻ|134_|121_ʽʺ|125_ʺ|123_ɶ|110_ίзʽ|1207 -_ʼ|155_ɽ|101_|5250_ͻȺ|5251_ͻӪҵ|5252_Ӳ -к|5253_CPUID|5254_ýױʶ|5255_Ự|5256_ͻ| -=============== -151_ɽʱ|123_ɶ|140_֤ȯ|141_֤ȯ|130_־|131_־|15 -3_ɽ۸|152_ɽ|303_|155_ɽ|167_־|146_ίб|1213 -_Ϣ| -*/ -//#define REQUEST_DRCJ 1108 // ճɽ -/* -120_ͻ|134_|121_ʽʺ|125_ʺ|123_ɶ|110_ίзʽ|126_ -ʼ|127_ֹ|1207_ʼ|140_֤ȯ|101_|5250_ͻȺ|52 -51_ͻӪҵ|5252_Ӳк|5253_CPUID|5254_ýױʶ|5255_Ự|5256_ͻ -| -=============== -150_ɽ|151_ɽʱ|123_ɶ|140_֤ȯ|141_֤ȯ|130_־|13 -1_־|153_ɽ۸|152_ɽ|303_|304_ʣ|206_Ӷ|210_ӡ -˰|207_|208_ɽ|155_ɽ|146_ίб|1213_Ϣ| -*/ -//#define REQUEST_LSCJ 1110 // ʷɽ - -struct CJLB_STRUCT -{ - int CJRQ; // 150_ɽ - int CJSJ; // 151_ɽʱ - char GDDM[32]; // 123_ɶ - char ZQDM[32]; // 140_֤ȯ - char ZQMC[32]; // 141_֤ȯ - int MMBZ; // 130_־ - int WTLB; // 131_ί - double CJJG; // 153_ɽ۸ - int CJSL; // 152_ɽ - double FSJE; // 303_ - double SYJE; // 304_ʣ - double YJ; // 206_Ӷ - double YHS; // 210_ӡ˰ - double GHF; // 207_ - double CJF; // 208_ɽ - char CJBH[32]; // 155_ɽ - char WTBH[32]; // 146_ίб -}; \ No newline at end of file diff --git a/QuantBox_Tdx_Trade/TraderApi.cpp b/QuantBox_Tdx_Trade/TraderApi.cpp deleted file mode 100644 index 0bcd833..0000000 --- a/QuantBox_Tdx_Trade/TraderApi.cpp +++ /dev/null @@ -1,1420 +0,0 @@ -#include "stdafx.h" -#include "TraderApi.h" - -#include "../include/QueueEnum.h" -#include "../include/QueueHeader.h" - -#include "../include/ApiHeader.h" -#include "../include/ApiStruct.h" - -#include "../include/ApiProcess.h" -#include "../include/toolkit.h" - -#include "../QuantBox_Queue/MsgQueue.h" - -#include "TypeConvert.h" - -#include "../include/Tdx/tdx_function.h" - -#include -#include - - -void* __stdcall Query(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - // 由内部调用,不用检查是否为空 - CTraderApi* pApi = (CTraderApi*)pApi2; - pApi->QueryInThread(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - return nullptr; -} - -void CTraderApi::QueryInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - int iRet = 0; - switch (type) - { - case E_Init: - iRet = _Init(); - break; - case E_ReqUserLoginField: - iRet = _ReqUserLogin(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_InputOrderField: - iRet = _ReqOrderInsert(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_InputOrderActionField: - iRet = _ReqOrderAction(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_QryDepthMarketDataField: - iRet = _Subscribe(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - - case QueryType::ReqQryOrder : - iRet = _ReqQryOrder(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case QueryType::ReqQryTrade: - iRet = _ReqQryTrade(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case QueryType::ReqQryInvestor: - iRet = _ReqQryInvestor(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case QueryType::ReqQryTradingAccount: - iRet = _ReqQryTradingAccount(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case QueryType::ReqQryInvestorPosition: - iRet = _ReqQryInvestorPosition(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - - default: - break; - } - - if (0 == iRet) - { - //返回成功,填加到已发送池 - m_nSleep = 1; - } - else - { - m_msgQueue_Query->Input_Copy(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - //失败,按4的幂进行延时,但不超过1s - m_nSleep *= 4; - m_nSleep %= 1023; - } - this_thread::sleep_for(chrono::milliseconds(m_nSleep)); -} - -void* __stdcall Test(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - // 由内部调用,不用检查是否为空 - CTraderApi* pApi = (CTraderApi*)pApi2; - pApi->TestInThread(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - return nullptr; -} - -void CTraderApi::TestInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - int iRet = 0; - bool bQryOrder = false; - bool bQryTrade = false; - //bool bQryInvestor = false; - - time_t _now = time(nullptr); - - // 想在整点时查询一下,因为整点时交易所和柜台变状态的可能性比较大这样 - - if (_now > m_QueryOrderTime) - { - bQryOrder = true; - } - else - { - - } - - if (_now > m_QueryTradeTime) - { - bQryTrade = true; - } - else - { - - } - - //if (_now > m_QueryGDLBTime) - //{ - // bQryInvestor = true; - //} - //else - //{ - - //} - - //if (bQryInvestor) - //{ - // double _queryTime = QUERY_TIME_MAX * 60; - // m_QueryGDLBTime = time(nullptr) + _queryTime; - // OutputQueryTime(m_QueryGDLBTime, _queryTime, "QueryInvestor"); - - // ReqQryInvestor(); - //} - - if (bQryOrder) - { - double _queryTime = QUERY_TIME_MAX; - m_QueryOrderTime = time(nullptr) + _queryTime; - OutputQueryTime(m_QueryOrderTime, _queryTime, "QueryOrder"); - - ReqQryOrder(); - } - - if (bQryTrade) - { - double _queryTime = QUERY_TIME_MAX; - m_QueryTradeTime = time(nullptr) + _queryTime; - OutputQueryTime(m_QueryTradeTime, _queryTime, "QueryTrade"); - - ReqQryTrade(); - } - - this_thread::sleep_for(chrono::milliseconds(1000)); - m_msgQueue_Test->Input_Copy(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); -} - -void CTraderApi::OutputQueryTime(time_t t, double db, const char* szSource) -{ - LogField* pField = (LogField*)m_msgQueue->new_block(sizeof(LogField)); - - sprintf(pField->Message, "Source:%s,Add:%d,Time:%s", szSource,(int)db, ctime(&t)); - - // 去了最后的回车 - int len = strlen(pField->Message); - pField->Message[len - 1] = 0; - - m_msgQueue->Input_NoCopy(ResponeType::OnLog, m_msgQueue, m_pClass, true, 0, pField, sizeof(LogField), nullptr, 0, nullptr, 0); -} - - -int CTraderApi::_Init() -{ - if (m_pApi == nullptr) - { - m_pApi = CTdxApi::CreateApi(m_ServerInfo.ExtInfoChar128); - } - - Error_STRUCT* pErr = nullptr; - - m_pApi->LoadScript(m_ServerInfo.Address, true, false); - m_pApi->Init(m_ServerInfo.ExtInfoChar128, &pErr); - - if (pErr) - { - RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); - - pField->RawErrorID = pErr->ErrCode; - strcpy(pField->Text, pErr->ErrInfo); - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); - } - else - { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); - - ReqUserLogin(); - } - - DeleteError(pErr); - - return 0; -} - -void CTraderApi::ReqUserLogin() -{ - if (m_UserInfo_Pos >= m_UserInfo_Count) - return; - - //STTraderLogin* pBody = (STTraderLogin*)m_msgQueue_Query->new_block(sizeof(STTraderLogin)); - - //strncpy(pBody->cust_no, m_pUserInfos[m_UserInfo_Pos].UserID, sizeof(TCustNoType)); - //strncpy(pBody->cust_pwd, m_pUserInfos[m_UserInfo_Pos].Password, sizeof(TCustPwdType)); - - m_msgQueue_Query->Input_NoCopy(RequestType::E_ReqUserLoginField, m_msgQueue_Query, this, 0, 0, - nullptr, 0, nullptr, 0, nullptr, 0); -} - -int CTraderApi::_ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - char** ppResults = nullptr; - Error_STRUCT* pErr = nullptr; - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); - - m_pClient = m_pApi->Login(m_UserInfo.UserID, m_UserInfo.Password, m_UserInfo.ExtInfoChar64, &ppResults, &pErr); - - if (m_pClient) - { - // 有授权信息要输出 - RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); - if (pErr) - { - pField->RawErrorID = pErr->ErrCode; - strcpy(pField->Text, pErr->ErrInfo); - } - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(pField), nullptr, 0, nullptr, 0); - - // 以后支持多账号时这地方要改 - m_pApi->SetClient(m_pClient); - m_pApi->SetAccount(m_UserInfo.UserID); - - // 查询股东列表,华泰证券可能一开始查会返回非知请求[1122] - GDLB_STRUCT** ppRS = nullptr; - CharTable2Login(ppResults, &ppRS); - - int count = GetCountStructs((void**)ppRS); - - if (count>0) - { - for (int i = 0; i < count; ++i) - { - InvestorField* pField = (InvestorField*)m_msgQueue->new_block(sizeof(InvestorField)); - - GDLB_2_InvestorField(ppRS[i], pField); - - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInvestor, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(InvestorField), nullptr, 0, nullptr, 0); - } - } - else - { - // 查通达信仿真实验室账号不直接返回股东列表,需要主动查询 - ReqQryInvestor(); - } - - // 启动定时查询功能使用 - m_msgQueue_Test->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue_Test, this, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); - - - // 登录下一个账号 - //++m_UserInfo_Pos; - //ReqUserLogin(); - } - else - { - if (pErr) - { - RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); - - pField->RawErrorID = pErr->ErrCode; - strcpy(pField->Text, pErr->ErrInfo); - - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); - } - } - - DeleteError(pErr); - DeleteTableBody(ppResults); - - return 0; -} - -void CTraderApi::ReqQuery(QueryType type, ReqQueryField* pQuery) -{ - m_msgQueue_Query->Input_Copy(type, m_msgQueue_Query, this, 0, 0, - pQuery, sizeof(ReqQueryField), nullptr, 0, nullptr, 0); -} - -void CTraderApi::ReqQryInvestor() -{ - m_msgQueue_Query->Input_NoCopy(QueryType::ReqQryInvestor, m_msgQueue_Query, this, 0, 0, - nullptr, 0, nullptr, 0, nullptr, 0); -} - -int CTraderApi::_ReqQryInvestor(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - if (m_pApi == nullptr) - return 0; - - FieldInfo_STRUCT** ppFieldInfos = nullptr; - char** ppResults = nullptr; - Error_STRUCT* pErr = nullptr; - - m_pApi->ReqQueryData(REQUEST_GDLB, &ppFieldInfos, &ppResults, &pErr); - - if (IsErrorRspInfo("ReqQryInvestor", pErr)) - { - //int _queryTime = QUERY_TIME_MIN; - //m_QueryGDLBTime = time(nullptr) + _queryTime; - //OutputQueryTime(m_QueryGDLBTime, _queryTime, "NextQueryInvestor_ReqQryInvestor"); - - DeleteTableBody(ppResults); - DeleteError(pErr); - - return 0; - } - - GDLB_STRUCT** ppRS = nullptr; - CharTable2GDLB(ppFieldInfos, ppResults, &ppRS); - - int count = GetCountStructs((void**)ppRS); - - for (int i = 0; i < count; ++i) - { - InvestorField* pField = (InvestorField*)m_msgQueue->new_block(sizeof(InvestorField)); - - GDLB_2_InvestorField(ppRS[i], pField); - - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInvestor, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(InvestorField), nullptr, 0, nullptr, 0); - } - - DeleteTableBody(ppResults); - DeleteError(pErr); - - return 0; -} - -CTraderApi::CTraderApi(void) -{ - m_pIDGenerator = nullptr; - m_pApi = nullptr; - m_pClient = nullptr; - m_lRequestID = 0; - m_nSleep = 1; - //m_FirstTradeID[0] = 0; - m_TradeListReverse = false; - m_LastIsMerge = false; - - // 自己维护两个消息队列 - m_msgQueue = new CMsgQueue(); - m_msgQueue_Query = new CMsgQueue(); - m_msgQueue_Test = new CMsgQueue(); - - m_msgQueue_Query->Register(Query,this); - m_msgQueue_Query->StartThread(); - - m_msgQueue_Test->Register(Test, this); - m_msgQueue_Test->StartThread(); -} - - -CTraderApi::~CTraderApi(void) -{ - Disconnect(); -} - -void CTraderApi::Register(void* pCallback, void* pClass) -{ - m_pClass = pClass; - if (m_msgQueue == nullptr) - return; - - m_msgQueue_Query->Register(Query,this); - m_msgQueue_Test->Register(Test, this); - m_msgQueue->Register(pCallback,this); - if (pCallback) - { - m_msgQueue_Query->StartThread(); - m_msgQueue->StartThread(); - m_msgQueue_Test->StartThread(); - } - else - { - m_msgQueue_Query->StopThread(); - m_msgQueue->StopThread(); - m_msgQueue_Test->StopThread(); - } -} - -bool CTraderApi::IsErrorRspInfo(const char* szSource, Error_STRUCT *pRspInfo) -{ - bool bRet = ((pRspInfo) && (pRspInfo->ErrType != 0)); - if (bRet) - { - ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); - - pField->RawErrorID = pRspInfo->ErrCode; - strcpy(pField->Text, pRspInfo->ErrInfo); - strcpy(pField->Source, szSource); - - m_msgQueue->Input_NoCopy(ResponeType::OnRtnError, m_msgQueue, m_pClass, true, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); - } - return bRet; -} - -void CTraderApi::Connect(const string& szPath, - ServerInfoField* pServerInfo, - UserInfoField* pUserInfo, - int count) -{ - m_szPath = szPath; - memcpy(&m_ServerInfo, pServerInfo, sizeof(ServerInfoField)); - memcpy(&m_UserInfo, pUserInfo, sizeof(UserInfoField)); - - m_pUserInfos = (UserInfoField*)(new char[sizeof(UserInfoField)*count]); - memcpy(m_pUserInfos, pUserInfo, sizeof(UserInfoField)*count); - - m_UserInfo_Pos = 0; - m_UserInfo_Count = count; - - m_pIDGenerator = new CIDGenerator(); - m_pIDGenerator->SetPrefix(m_UserInfo.UserID); - - m_msgQueue_Query->Input_NoCopy(E_Init, m_msgQueue_Query, this, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); -} - -void CTraderApi::Disconnect() -{ - if (m_msgQueue_Query) - { - m_msgQueue_Query->StopThread(); - m_msgQueue_Query->Register(nullptr,nullptr); - m_msgQueue_Query->Clear(); - delete m_msgQueue_Query; - m_msgQueue_Query = nullptr; - } - - if (m_msgQueue_Test) - { - m_msgQueue_Test->StopThread(); - m_msgQueue_Test->Register(nullptr, nullptr); - m_msgQueue_Test->Clear(); - delete m_msgQueue_Test; - m_msgQueue_Test = nullptr; - } - - if(m_pApi) - { - // 还没有登出 - m_pApi->Logout(m_pClient); - m_pClient = nullptr; - m_pApi->Exit(); - - m_pApi->Release(); - m_pApi = nullptr; - - // 全清理,只留最后一个 - if (m_msgQueue) - { - m_msgQueue->Clear(); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); - // 主动触发 - m_msgQueue->Process(); - } - } - - if (m_msgQueue) - { - m_msgQueue->StopThread(); - m_msgQueue->Register(nullptr,nullptr); - m_msgQueue->Clear(); - delete m_msgQueue; - m_msgQueue = nullptr; - } - - if (m_pIDGenerator) - { - delete m_pIDGenerator; - m_pIDGenerator = nullptr; - } -} - -int CTraderApi::ReqOrderInsert( - OrderField* pOrder, - int count, - OrderIDType* pInOut) -{ - memset(pInOut, 0, sizeof(OrderIDType)*count); - - if (count < 1) - return 0; - - OrderField** ppOrders = new OrderField*[count]; - - // 生成本地ID,供上层进行定位使用 - for (int i = 0; i < count; ++i) - { - OrderField* pNewOrder = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); - memcpy(pNewOrder, pOrder, sizeof(OrderField)); - - strcpy(pInOut[i], m_pIDGenerator->GetIDString()); - strcpy(pNewOrder[i].LocalID, pInOut[i]); - ppOrders[i] = pNewOrder; - - // 注意这里保存了最开始发单的结构体的备份 - m_id_platform_order.insert(pair(pNewOrder->LocalID, pNewOrder)); - } - - m_msgQueue_Query->Input_Copy(RequestType::E_InputOrderField, m_msgQueue_Query, this, 0, 0, - ppOrders, sizeof(OrderField*)*count, nullptr, 0, nullptr, 0); - - delete[] ppOrders; - - return 0; -} - -int CTraderApi::_ReqOrderInsert(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - if (m_pApi == nullptr) - return 0; - - // 得到报单指针列表 - OrderField** ppOrders = (OrderField**)ptr1; - int count = (int)size1 / sizeof(OrderField*); - - Order_STRUCT** ppTdxOrders = new Order_STRUCT*[count]; - for (int i = 0; i < count; ++i) - { - ppTdxOrders[i] = (Order_STRUCT*)m_msgQueue->new_block(sizeof(Order_STRUCT)); - OrderField_2_Order_STRUCT(ppOrders[i], ppTdxOrders[i]); - } - - FieldInfo_STRUCT** ppFieldInfos = nullptr; - char** ppResults = nullptr; - Error_STRUCT** ppErrs = nullptr; - - // 注意:pTdxOrders在这里被修改了,需要使用修改后的东西 - int n = m_pApi->SendMultiOrders(ppTdxOrders, count, &ppFieldInfos, &ppResults, &ppErrs); - - // 标记批量下单是否有发成功过单的 - bool bSuccess = false; - // 将结果立即取出来 - for (int i = 0; i < count;++i) - { - m_id_api_order.insert(pair(ppOrders[i]->LocalID, ppTdxOrders[i])); - // 处理错误 - if (ppErrs && ppErrs[i]) - { - ppOrders[i]->RawErrorID = ppErrs[i]->ErrCode; - strcpy(ppOrders[i]->Text, ppErrs[i]->ErrInfo); - } - - // 处理结果 - if (ppResults && ppResults[i*COL_EACH_ROW + 0]) - { - bSuccess = true; - // 写上柜台的ID,以后将基于此进行定位 - strcpy(ppOrders[i]->ID, ppResults[i*COL_EACH_ROW + 0]); - - m_id_api_order.erase(ppOrders[i]->LocalID); - m_id_api_order.insert(pair(ppOrders[i]->ID, ppTdxOrders[i])); - - m_id_platform_order.erase(ppOrders[i]->LocalID); - m_id_platform_order.insert(pair(ppOrders[i]->ID, ppOrders[i])); - } - - // 现在有两个结构体,需要进行操作了 - // 1.通知下单的结果 - // 2.记录下单 - - OrderField* pField = ppOrders[i]; - if (pField->RawErrorID != 0) - { - pField->ExecType = ExecType::ExecType_Rejected; - pField->Status = OrderStatus::OrderStatus_Rejected; - } - else - { - pField->ExecType = ExecType::ExecType_New; - pField->Status = OrderStatus::OrderStatus_New; - } - - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); - } - - // 测试用,不能写这,太快了,要等一下 - //ReqQryTrade(); - - // 复制完了,可以删了以前东西 - delete[] ppTdxOrders; - - DeleteTableBody(ppResults, count); - DeleteErrors(ppErrs, count); - - if (bSuccess) - { - // 有挂单的,需要进行查询了 - - double _queryTime = QUERY_TIME_MIN; - - m_QueryOrderTime = time(nullptr) + _queryTime; - OutputQueryTime(m_QueryOrderTime, _queryTime, "NextQueryOrder_Send"); - } - - return 0; -} - -int CTraderApi::ReqOrderAction(OrderIDType* szId, int count, OrderIDType* pOutput) -{ - memset(pOutput, 0, sizeof(OrderIDType)*count); - - OrderField** ppOrders = new OrderField*[count]; - Order_STRUCT** ppTdxOrders = new Order_STRUCT*[count]; - - for (int i = 0; i < count; ++i) - { - ppOrders[i] = nullptr; - ppTdxOrders[i] = nullptr; - - { - unordered_map::iterator it = m_id_platform_order.find(szId[i]); - if (it != m_id_platform_order.end()) - ppOrders[i] = it->second; - } - - { - unordered_map::iterator it = m_id_api_order.find(szId[i]); - if (it != m_id_api_order.end()) - ppTdxOrders[i] = it->second; - } - } - - m_msgQueue_Query->Input_Copy(RequestType::E_InputOrderActionField, m_msgQueue_Query, this, 0, 0, - ppOrders, sizeof(OrderField*)*count, ppTdxOrders, sizeof(Order_STRUCT*)*count, nullptr, 0); - - delete[] ppOrders; - delete[] ppTdxOrders; - - return 0; -} - -int CTraderApi::_ReqOrderAction(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - int count = (int)size1 / sizeof(OrderField*); - // 通过ID找到原始结构,用于撤单 - // 通过ID找到通用结构,用于接收回报 - OrderField** ppOrders = (OrderField**)ptr1; - Order_STRUCT** ppTdxOrders = (Order_STRUCT**)ptr2; - - FieldInfo_STRUCT** ppFieldInfos = nullptr; - char** ppResults = nullptr; - Error_STRUCT** ppErrs = nullptr; - - int n = m_pApi->CancelMultiOrders(ppTdxOrders, count, &ppFieldInfos, &ppResults, &ppErrs); - - bool bSuccess = false; - // 将结果立即取出来 - for (int i = 0; i < count; ++i) - { - if (ppErrs) - { - if (ppErrs[i]) - { - ppOrders[i]->RawErrorID = ppErrs[i]->ErrCode; - strcpy(ppOrders[i]->Text, ppErrs[i]->ErrInfo); - - ppOrders[i]->ExecType = ExecType::ExecType_CancelReject; - // 注意报单状态问题 - } - else - { - bSuccess = true; - - // 会不会出现撤单时,当时不知道是否成功撤单,查询才得知没有撤成功? - //ppOrders[i]->ExecType = ExecType::ExecCancelled; - //ppOrders[i]->Status = OrderStatus::Cancelled; - continue; - } - } - // 撤单成功时,返回的东西还是null,所以这里使用错误信息来进行区分 - - //if (ppResults) - //{ - // if (ppResults[i*COL_EACH_ROW + 0]) - // { - // } - //} - - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, ppOrders[i], sizeof(OrderField), nullptr, 0, nullptr, 0); - } - - DeleteTableBody(ppResults, count); - DeleteErrors(ppErrs, count); - - if (bSuccess) - { - // 需要进行查询了 - double _queryTime = QUERY_TIME_MIN; - - m_QueryOrderTime = time(nullptr) + _queryTime; - OutputQueryTime(m_QueryOrderTime, _queryTime, "NextQueryOrder_Cancel"); - } - - return 0; -} - -void CTraderApi::ReqQryOrder() -{ - m_msgQueue_Query->Input_NoCopy(QueryType::ReqQryOrder, m_msgQueue_Query, this, 0, 0, - nullptr, 0, nullptr, 0, nullptr, 0); -} - -int CTraderApi::_ReqQryOrder(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - FieldInfo_STRUCT** ppFieldInfos = nullptr; - char** ppResults = nullptr; - Error_STRUCT* pErr = nullptr; - - m_pApi->ReqQueryData(REQUEST_DRWT, &ppFieldInfos, &ppResults, &pErr); - // 测试用,事后要删除 - //m_pApi->ReqQueryData(REQUEST_LSWT, &ppFieldInfos, &ppResults, &pErr, "20150801", "20151031"); - - if (IsErrorRspInfo("ReqQryOrder", pErr)) - { - double _queryTime = 0.5 * QUERY_TIME_MAX + QUERY_TIME_MIN; - m_QueryOrderTime = time(nullptr) + _queryTime; - //OutputQueryTime(m_QueryOrderTime, _queryTime, "NextQueryOrder_QueryOrder_Error"); - - DeleteTableBody(ppResults); - DeleteError(pErr); - - return 0; - } - - WTLB_STRUCT** ppRS = nullptr; - CharTable2WTLB(ppFieldInfos, ppResults, &ppRS); - - // 操作前清空,按说之前已经清空过一次了 - m_NewOrderList.clear(); - - // 有未完成的,标记为true - bool IsDone = true; - // 有未申报的,标记为true - bool IsNotSent = false; - // 有更新的 - bool IsUpdated = false; - - if (ppRS) - { - int i = 0; - while (ppRS[i]) - { - // 将撤单委托过滤 - if (ppRS[i]->MMBZ_ != MMBZ_Cancel) - { - // 需要将它输入到一个地方用于计算 - OrderField* pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); - - WTLB_2_OrderField_0(ppRS[i], pField); - m_NewOrderList.push_back(pField); - - if (!ZTSM_IsDone(ppRS[i]->ZTSM_)) - { - IsDone = false; - } - if (ZTSM_IsNotSent(ppRS[i]->ZTSM_)) - { - IsNotSent = true; - } - } - ++i; - } - } - - // 委托列表 - // 1.新增的都需要输出 - // 2.老的看是否有变化 - ++m_OrderNotUpdateCount; - - int i = 0; - list::iterator it2 = m_OldOrderList.begin(); - for (list::iterator it = m_NewOrderList.begin(); it != m_NewOrderList.end(); ++it) - { - OrderField* pField = *it; - - bool bUpdate = false; - if (i >= m_OldOrderList.size()) - { - bUpdate = true; - } - else - { - // 相同位置的部分 - OrderField* pOldField = *it2; - if (pOldField->LeavesQty != pField->LeavesQty || pOldField->Status != pField->Status) - { - bUpdate = true; - } - } - - if (bUpdate) - { - IsUpdated = true; - m_OrderNotUpdateCount = 0; - - // 如果能找到下单时的委托,就修改后发出来 - unordered_map::iterator it = m_id_platform_order.find(pField->ID); - if (it != m_id_platform_order.end()) - { - OrderField* pField_ = it->second; - pField_->Date = pField->Date; - pField_->Time = pField->Time; - pField_->CumQty = pField->CumQty; - pField_->LeavesQty = pField->LeavesQty; - pField_->AvgPx = pField->AvgPx; - pField_->Status = pField->Status; - pField_->ExecType = pField->ExecType; - strcpy(pField_->Text, pField->Text); - - pField = pField_; - } - - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); - } - - // 前一个可能为空,移动到下一个时需要注意 - if (it2 != m_OldOrderList.end()) - { - ++it2; - } - - ++i; - } - - // 将老数据清理,防止内存泄漏 - for (list::iterator it = m_OldOrderList.begin(); it != m_OldOrderList.end(); ++it) - { - OrderField* pField = *it; - m_msgQueue->delete_block(pField); - } - - // 做交换 - m_OldOrderList.clear(); - m_OldOrderList = m_NewOrderList; - m_NewOrderList.clear(); - - DeleteTableBody(ppResults); - DeleteError(pErr); - - double _queryTime = 0; - if (!IsDone) - { - if (!IsUpdated) - { - // 没有更新,是否要慢点查 - _queryTime = 0.5 * QUERY_TIME_MAX + QUERY_TIME_MIN; - } - - // 有没有完成的,需要定时查询 - if (IsNotSent) - { - // 有没申报的,是否没在交易时间?慢点查 - _queryTime = 0.5 * QUERY_TIME_MAX + QUERY_TIME_MIN; - } - else - { - // 可能是交易时间了,是否需要考虑 - _queryTime = 2 * QUERY_TIME_MIN; - // 可能有些挂单一天都不会成交,挂在这一直导致查太多,加一下查询计数 - if (m_OrderNotUpdateCount>=3) - { - _queryTime = 0.5 * QUERY_TIME_MAX + QUERY_TIME_MIN; - } - } - } - else - { - // 全完成了,可以不查或慢查 - _queryTime = 5 * QUERY_TIME_MAX; - } - - m_QueryOrderTime = time(nullptr) + _queryTime; - OutputQueryTime(m_QueryOrderTime, _queryTime, "NextQueryOrder_QueryOrder"); - - // 决定成交查询间隔 - if (IsUpdated) - { - // 委托可能是撤单,也有可能是成交了,赶紧查一下 - _queryTime = 0; - m_QueryTradeTime = time(nullptr) + _queryTime; - OutputQueryTime(m_QueryTradeTime, _queryTime, "NextQueryTrade_QueryOrder"); - } - else - { - // 委托没有变化,那成交就没有必要查那么快了 - _queryTime = 5 * QUERY_TIME_MAX; - m_QueryTradeTime = time(nullptr) + _queryTime; - OutputQueryTime(m_QueryTradeTime, _queryTime, "NextQueryTrade_QueryOrder"); - } - - - return 0; -} - -void CTraderApi::ReqQryTrade() -{ - m_msgQueue_Query->Input_NoCopy(QueryType::ReqQryTrade, m_msgQueue_Query, this, 0, 0, - nullptr, 0, nullptr, 0, nullptr, 0); -} - -////////////////////////////////////////////////////////////////////////// -double GetTradeListQty(list &tradeList,int count) -{ - double Qty = 0; - int i = 0; - for (list::iterator it = tradeList.begin(); it != tradeList.end(); ++it) - { - ++i; - if (i>count) - { - break; - } - - TradeField* pField = *it; - Qty += pField->Qty; - } - return Qty; -} - -void TradeList2TradeMap(list &tradeList, unordered_map &tradeMap) -{ - // 只在这个函数中new和delete应当没有问题 - for (unordered_map::iterator it = tradeMap.begin(); it != tradeMap.end(); ++it) - { - TradeField* pNewField = it->second; - delete[] pNewField; - } - tradeMap.clear(); - - // 将多个合约拼接成 - for (list::iterator it = tradeList.begin(); it != tradeList.end(); ++it) - { - TradeField* pField = *it; - unordered_map::iterator it2 = tradeMap.find(pField->ID); - if (it2 == tradeMap.end()) - { - TradeField* pNewField = new TradeField; - memcpy(pNewField, pField, sizeof(TradeField)); - tradeMap[pField->ID] = pNewField; - } - else - { - TradeField* pNewField = it2->second; - pNewField->Price = pField->Price; - pNewField->Qty += pField->Qty; - } - } -} - -void CTraderApi::CompareTradeMapAndEmit(unordered_map &oldMap, unordered_map &newMap) -{ - for (unordered_map::iterator it = newMap.begin(); it != newMap.end(); ++it) - { - TradeField* pNewField = it->second; - unordered_map::iterator it2 = oldMap.find(pNewField->ID); - if (it2 == oldMap.end()) - { - // 没找到,是新单 - m_msgQueue->Input_Copy(ResponeType::OnRtnTrade, m_msgQueue, m_pClass, 0, 0, pNewField, sizeof(TradeField), nullptr, 0, nullptr, 0); - } - else - { - TradeField* pOldField = it2->second; - int Qty = pNewField->Qty - pOldField->Qty; - if (Qty>0) - { - // 有变化的单 - TradeField* pField = new TradeField; - memcpy(pField, pNewField, sizeof(TradeField)); - pField->Qty = Qty; - m_msgQueue->Input_Copy(ResponeType::OnRtnTrade, m_msgQueue, m_pClass, 0, 0, pNewField, sizeof(TradeField), nullptr, 0, nullptr, 0); - delete[] pField; - } - } - } -} - -void CTraderApi::CompareTradeListAndEmit(list &oldList, list &newList) -{ - int i = 0; - list::iterator it2 = oldList.begin(); - for (list::iterator it = newList.begin(); it != newList.end(); ++it) - { - TradeField* pField = *it; - - bool bUpdate = false; - if (i >= oldList.size()) - { - bUpdate = true; - } - //else - //{ - // // 相同位置的部分 - // TradeField* pOldField = *it2; - // if (pOldField->Qty != pField->Qty) - // { - // bUpdate = true; - // } - //} - - if (bUpdate) - { - m_msgQueue->Input_Copy(ResponeType::OnRtnTrade, m_msgQueue, m_pClass, 0, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); - } - - // 前一个可能为空,移动到下一个时需要注意 - if (it2 != oldList.end()) - { - ++it2; - } - - ++i; - } -} -////////////////////////////////////////////////////////////////////////// - -int CTraderApi::_ReqQryTrade(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - FieldInfo_STRUCT** ppFieldInfos = nullptr; - char** ppResults = nullptr; - Error_STRUCT* pErr = nullptr; - - m_pApi->ReqQueryData(REQUEST_DRCJ, &ppFieldInfos, &ppResults, &pErr); - - if (IsErrorRspInfo("ReqQryTrade", pErr)) - { - double _queryTime = 0.5 * QUERY_TIME_MAX + QUERY_TIME_MIN; - m_QueryTradeTime = time(nullptr) + _queryTime; - - DeleteTableBody(ppResults); - DeleteError(pErr); - - return 0; - } - - CJLB_STRUCT** ppRS = nullptr; - CharTable2CJLB(ppFieldInfos, ppResults, &ppRS); - - // 操作前清空,按说之前已经清空过一次了 - m_NewTradeList.clear(); - - if (ppRS) - { - // 利用成交编号的大小来判断正反序 - if (!m_TradeListReverse) - { - int count = GetCountStructs((void**)ppRS); - if (count>1) - { - // 转成数字的比较,是否会有非数字的情况出现? - long CJBH0 = atol(ppRS[0]->CJBH); - long CJBH1 = atol(ppRS[count - 1]->CJBH); - if (CJBH0>CJBH1) - { - m_TradeListReverse = true; - } - } - } - - int i = 0; - while (ppRS[i]) - { - TradeField* pField = (TradeField*)m_msgQueue->new_block(sizeof(TradeField)); - - CJLB_2_TradeField(ppRS[i], pField); - - if (m_TradeListReverse) - { - // 华泰查出来的表后生成的排第一,所以要处理一下 - m_NewTradeList.push_front(pField); - } - else - { - m_NewTradeList.push_back(pField); - } - - ++i; - } - } - - // 新查出来的反而少了,华泰有合并成交的情况,这种如何处理? - // 对同ID的需要累加,有发现累加不对应的,应当处理 - // 同样条数的,也有可能其中的有变化,如何处理? - bool bTryMerge = false; - int OldTradeListCount = m_OldTradeList.size(); - int NewTradeListCount = m_NewTradeList.size(); - - if (NewTradeListCount < OldTradeListCount) - { - // 行数变少了,应当是合并了 - bTryMerge = true; - } - else if (OldTradeListCount == 0) - { - // 如果上一次的为空,不管这次查出来的是合并还是没有合并,都没有关系,当成没合并处理即可 - } - else if (NewTradeListCount == OldTradeListCount) - { - // 行数不变,但有可能是其中的一条部分成交的更新,所以检查一下 - - double OldQty = GetTradeListQty(m_OldTradeList, m_OldTradeList.size()); - double NewQty = GetTradeListQty(m_NewTradeList, m_NewTradeList.size()); - if (NewQty != OldQty) - { - // 同样长度成交量发生了变化,可能是合并的列表其中一个新成交了 - bTryMerge = true; - } - } - else - { - // 行数变多了,只要其中上次的部分有变化就需要检查一下 - double OldQty = GetTradeListQty(m_OldTradeList, m_OldTradeList.size()); - double NewQty = GetTradeListQty(m_NewTradeList, m_NewTradeList.size()); - if (NewQty != OldQty) - { - bTryMerge = true; - } - } - - - - if (bTryMerge) - { - // 合并列表的处理方法 - // 如果上次是合并,这次就没有必要再生成一次了 - if (m_OldTradeMap.size() == 0 || !m_LastIsMerge) - { - for (unordered_map::iterator it = m_OldTradeMap.begin(); it != m_OldTradeMap.end(); ++it) - { - TradeField* pField = it->second; - delete[] pField; - } - m_OldTradeMap.clear(); - - TradeList2TradeMap(m_OldTradeList, m_OldTradeMap); - } - TradeList2TradeMap(m_NewTradeList, m_NewTradeMap); - CompareTradeMapAndEmit(m_OldTradeMap, m_NewTradeMap); - - // 交换 - for (unordered_map::iterator it = m_OldTradeMap.begin(); it != m_OldTradeMap.end(); ++it) - { - TradeField* pField = it->second; - delete[] pField; - } - m_OldTradeMap.clear(); - m_OldTradeMap = m_NewTradeMap; - m_NewTradeMap.clear(); - m_LastIsMerge = true; - } - else - { - // 普通的处理方法 - CompareTradeListAndEmit(m_OldTradeList, m_NewTradeList); - m_LastIsMerge = false; - } - - // 将老数据清理,防止内存泄漏 - for (list::iterator it = m_OldTradeList.begin(); it != m_OldTradeList.end(); ++it) - { - TradeField* pField = *it; - m_msgQueue->delete_block(pField); - } - - // 做交换 - m_OldTradeList.clear(); - m_OldTradeList = m_NewTradeList; - m_NewTradeList.clear(); - - DeleteTableBody(ppResults); - DeleteError(pErr); - - return 0; -} - -//void CTraderApi::ReqQryInstrument(const string& szInstrumentId, const string& szExchange) -//{ -// -//} - -//void CTraderApi::ReqQryTradingAccount() -//{ -// m_msgQueue_Query->Input_NoCopy(QueryType::ReqQryTrade, m_msgQueue_Query, this, 0, 0, -// nullptr, 0, nullptr, 0, nullptr, 0); -//} - -int CTraderApi::_ReqQryTradingAccount(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - if (m_pApi == nullptr) - return 0; - - FieldInfo_STRUCT** ppFieldInfos = nullptr; - char** ppResults = nullptr; - Error_STRUCT* pErr = nullptr; - - m_pApi->ReqQueryData(REQUEST_ZJYE, &ppFieldInfos, &ppResults, &pErr); - - if (IsErrorRspInfo("ReqQryTradingAccount", pErr)) - { - DeleteTableBody(ppResults); - DeleteError(pErr); - - return 0; - } - - ZJYE_STRUCT** ppRS = nullptr; - CharTable2ZJYE(ppFieldInfos, ppResults, &ppRS); - - int count = GetCountStructs((void**)ppRS); - for (int i = 0; i < count; ++i) - { - AccountField* pField = (AccountField*)m_msgQueue->new_block(sizeof(AccountField)); - - ZJYE_2_AccountField(ppRS[i], pField); - - // 可能资金账号查不出来,手工填上 - if (strlen(pField->AccountID) <= 0) - { - // 多账户会有问题 - strcpy(pField->AccountID, m_pApi->GetAccount()); - } - - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryTradingAccount, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(AccountField), nullptr, 0, nullptr, 0); - } - - DeleteTableBody(ppResults); - DeleteError(pErr); - - return 0; -} - -//void CTraderApi::ReqQryInvestorPosition() -//{ -// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryInvestorPositionField, m_msgQueue_Query, this, 0, 0, -// nullptr, 0, nullptr, 0, nullptr, 0); -//} - -int CTraderApi::_ReqQryInvestorPosition(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - if (m_pApi == nullptr) - return 0; - - FieldInfo_STRUCT** ppFieldInfos = nullptr; - char** ppResults = nullptr; - Error_STRUCT* pErr = nullptr; - - m_pApi->ReqQueryData(REQUEST_GFLB, &ppFieldInfos, &ppResults, &pErr); - - if (IsErrorRspInfo("ReqQryInvestorPosition", pErr)) - { - DeleteTableBody(ppResults); - DeleteError(pErr); - - return 0; - } - - GFLB_STRUCT** ppRS = nullptr; - CharTable2GFLB(ppFieldInfos, ppResults, &ppRS); - - int count = GetCountStructs((void**)ppRS); - for (int i = 0; i < count; ++i) - { - PositionField* pField = (PositionField*)m_msgQueue->new_block(sizeof(PositionField)); - - // 应当处理一下,可能一个账号对应的有多个,如信用账户 - GFLB_2_PositionField(ppRS[i], pField); - - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInvestorPosition, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(PositionField), nullptr, 0, nullptr, 0); - } - - DeleteTableBody(ppResults); - DeleteError(pErr); - - return 0; -} - -void CTraderApi::Subscribe(const string& szInstrumentIDs, const string& szExchangeID) -{ - char buf[64] = { 0 }; - strcpy(buf, szInstrumentIDs.c_str()); - - m_msgQueue_Query->Input_Copy(RequestType::E_QryDepthMarketDataField, m_msgQueue_Query, this, 0, 0, - buf, sizeof(buf), nullptr, 0, nullptr, 0); -} - -int CTraderApi::_Subscribe(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - if (m_pApi == nullptr) - return 0; - - FieldInfo_STRUCT** ppFieldInfos = nullptr; - char** ppResults = nullptr; - Error_STRUCT* pErr = nullptr; - - m_pApi->ReqQueryData(REQUEST_HQ, &ppFieldInfos, &ppResults, &pErr, "", "", (char*)ptr1); - - if (IsErrorRspInfo("Subscribe", pErr)) - { - DeleteTableBody(ppResults); - DeleteError(pErr); - - return 0; - } - - HQ_STRUCT** ppRS = nullptr; - CharTable2HQ(ppFieldInfos, ppResults, &ppRS); - - int count = GetCountStructs((void**)ppRS); - - for (int i = 0; i < count; ++i) - { - DepthMarketDataNField* pField = (DepthMarketDataNField*)m_msgQueue->new_block(sizeof(DepthMarketDataNField)+sizeof(DepthField)* 10); - - HQ_STRUCT* pDepthMarketData = ppRS[i]; - - strcpy(pField->InstrumentID, pDepthMarketData->ZQDM); - //pField->Exchange = JYSDM_2_ExchangeType(pDepthMarketData->JYSDM); - - sprintf(pField->Symbol, "%s.%s", pField->InstrumentID, ""); - - // 交易时间 - GetExchangeTime(time(nullptr), &pField->TradingDay, &pField->ActionDay, &pField->UpdateTime); - - - pField->LastPrice = pDepthMarketData->DQJ_; - //pField->Volume = 0; - //pField->Turnover = pDepthMarketData->Turnover; - //pField->OpenInterest = pDepthMarketData->OpenInterest; - //pField->AveragePrice = pDepthMarketData->AveragePrice; - pField->UpperLimitPrice = pDepthMarketData->ZTJG_; - pField->LowerLimitPrice = pDepthMarketData->DTJG_; - - pField->PreClosePrice = pDepthMarketData->ZSJ_; - pField->OpenPrice = pDepthMarketData->JKJ_; - - InitBidAsk(pField); - - do - { - if (pDepthMarketData->BidSize1_ == 0) - break; - AddBid(pField, pDepthMarketData->BidPrice1_, pDepthMarketData->BidSize1_, 0); - - if (pDepthMarketData->BidSize2_ == 0) - break; - AddBid(pField, pDepthMarketData->BidPrice2_, pDepthMarketData->BidSize2_, 0); - - if (pDepthMarketData->BidSize3_ == 0) - break; - AddBid(pField, pDepthMarketData->BidPrice3_, pDepthMarketData->BidSize3_, 0); - - if (pDepthMarketData->BidSize4_ == 0) - break; - AddBid(pField, pDepthMarketData->BidPrice4_, pDepthMarketData->BidSize4_, 0); - - if (pDepthMarketData->BidSize5_ == 0) - break; - AddBid(pField, pDepthMarketData->BidPrice5_, pDepthMarketData->BidSize5_, 0); - } while (false); - - do - { - if (pDepthMarketData->AskSize1_ == 0) - break; - AddAsk(pField, pDepthMarketData->AskPrice1_, pDepthMarketData->AskSize1_, 0); - - if (pDepthMarketData->AskSize2_ == 0) - break; - AddAsk(pField, pDepthMarketData->AskPrice2_, pDepthMarketData->AskSize2_, 0); - - if (pDepthMarketData->AskSize3_ == 0) - break; - AddAsk(pField, pDepthMarketData->AskPrice3_, pDepthMarketData->AskSize3_, 0); - - if (pDepthMarketData->AskSize4_ == 0) - break; - AddAsk(pField, pDepthMarketData->AskPrice4_, pDepthMarketData->AskSize4_, 0); - - if (pDepthMarketData->AskSize5_ == 0) - break; - AddAsk(pField, pDepthMarketData->AskPrice5_, pDepthMarketData->AskSize5_, 0); - } while (false); - - m_msgQueue->Input_NoCopy(ResponeType::OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); - } - - DeleteTableBody(ppResults); - DeleteError(pErr); - - return 0; -} \ No newline at end of file diff --git a/QuantBox_Tdx_Trade/TraderApi.h b/QuantBox_Tdx_Trade/TraderApi.h deleted file mode 100644 index 80b84e8..0000000 --- a/QuantBox_Tdx_Trade/TraderApi.h +++ /dev/null @@ -1,264 +0,0 @@ -#pragma once - -#include "../include/Tdx/TdxApi.h" -#include "../include/ApiStruct.h" -#include "../include/IDGenerator.h" -#include "../include/QueueEnum.h" - -#ifdef _WIN64 -#pragma comment(lib, "../include/Tdx/win64/TdxApi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x64.lib") -#else -#pragma comment(lib, "../include/Tdx/win32/TdxApi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x86.lib") -#endif - - -#include -#include -#include -#include -#include -#include -#include -#include - -#define QUERY_TIME_MIN (3) -#define QUERY_TIME_MAX (60) - -using namespace std; - -class CMsgQueue; - -class CTraderApi -{ - //请求数据包类型 - enum RequestType - { - E_Init = 100, - E_ReqUserLoginField, - E_QryInvestorField, - E_InputOrderField, - E_InputOrderActionField, - E_QryOrderField, - E_QryTradeField, - E_QryTradingAccountField, - E_QryInvestorPositionField, - - E_QryDepthMarketDataField, - - - E_SettlementInfoConfirmField, - E_QryInstrumentField, - E_InputQuoteField, - E_InputQuoteActionField, - E_ParkedOrderField, - E_QryInvestorPositionDetailField, - E_QryInstrumentCommissionRateField, - E_QryInstrumentMarginRateField, - E_QrySettlementInfoField, - E_QryQuoteField, - }; - -public: - //static CTraderApi * pThis; - - CTraderApi(void); - virtual ~CTraderApi(void); - - void Register(void* pCallback, void* pClass); - - void Connect(const string& szPath, - ServerInfoField* pServerInfo, - UserInfoField* pUserInfo, - int count); - void Disconnect(); - - int ReqOrderInsert( - OrderField* pOrder, - int count, - OrderIDType* pInOut); - - //char* ReqParkedOrderInsert(int OrderRef, - // OrderField* pOrder1, - // OrderField* pOrder2); - - int ReqOrderAction(OrderIDType* szId, int count, OrderIDType* pOutput); - int ReqOrderAction(Order_STRUCT *pOrder, int count, OrderIDType* pOutput); - - //char* ReqQuoteInsert( - // int QuoteRef, - // QuoteField* pQuote); - - //int ReqQuoteAction(CThostFtdcQuoteField *pQuote); - ////int ReqQuoteAction(const string& szId); - - void ReqQuery(QueryType type, ReqQueryField* pQuery); - - //void ReqQryTradingAccount(); - //void ReqQryInvestorPosition(); - //void ReqQryInvestorPositionDetail(const string& szInstrumentId); - //void ReqQryInstrument(const string& szInstrumentId, const string& szExchange); - //void ReqQryInstrumentCommissionRate(const string& szInstrumentId); - ////void ReqQryInstrumentMarginRate(const string& szInstrumentId,TThostFtdcHedgeFlagType HedgeFlag = THOST_FTDC_HF_Speculation); - //void ReqQryDepthMarketData(const string& szInstrumentId); - //void ReqQrySettlementInfo(const string& szTradingDay); - - void ReqQryOrder(); - void ReqQryTrade(); - //void ReqQryQuote(); - - void ReqQryInvestor(); - - void Subscribe(const string& szInstrumentIDs, const string& szExchangeID); - -private: - //static void __stdcall OnReadPushData(ETX_APP_FUNCNO FuncNO, void* pEtxPushData); - //void _OnReadPushData(ETX_APP_FUNCNO FuncNO, void* pEtxPushData); - - friend void* __stdcall Query(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - virtual void QueryInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - - friend void* __stdcall Test(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - virtual void TestInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - - int _Init(); - - //登录请求 - void ReqUserLogin(); - int _ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - - int _ReqQryInvestor(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - - - int _ReqQryOrder(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - int _ReqQryTrade(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - - int _ReqOrderInsert(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - int _ReqOrderAction(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - - int _ReqQryTradingAccount(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - int _ReqQryInvestorPosition(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - - - int _Subscribe(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - - - //检查是否出错 - //bool IsErrorRspInfo(Error_STRUCT *pRspInfo, int nRequestID, bool bIsLast);//向消息队列输出信息 - bool IsErrorRspInfo(const char* szSource, Error_STRUCT *pRspInfo);//不输出信息 - void OutputQueryTime(time_t t, double db,const char* szSource); - - ////连接 - //virtual void OnFrontConnected(); - //virtual void OnFrontDisconnected(int nReason); - - ////认证 - //virtual void OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ////下单 - //virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo); - - ////撤单 - //virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo); - - ////报单回报 - //virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnRtnOrder(CThostFtdcOrderField *pOrder); - - ////成交回报 - //virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnRtnTrade(CThostFtdcTradeField *pTrade); - - ////报价录入 - //virtual void OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo); - //virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnRtnQuote(CThostFtdcQuoteField *pQuote); - - ////报价撤单 - //virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo); - - ////仓位 - //virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; - - ////资金 - //virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ////合约、手续费 - //virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ////查询行情响应 - //virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ////请求查询投资者结算结果响应 - //virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ////其它 - //virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus); -private: - void CompareTradeMapAndEmit(unordered_map &oldMap, unordered_map &newMap); - void CompareTradeListAndEmit(list &oldList, list &newList); - -private: - atomic m_lRequestID; //请求ID,得保持自增 - - OrderIDType m_orderInsert_Id; - - mutex m_csOrderRef; - int m_nMaxOrderRef; //报单引用,用于区分报单,保持自增 - - CTdxApi* m_pApi; //交易API - void* m_pClient; - - - string m_szPath; //生成配置文件的路径 - ServerInfoField m_ServerInfo; - UserInfoField m_UserInfo; - - int m_nSleep; - - unordered_map m_id_platform_order; - unordered_map m_id_api_order; - - unordered_map m_cust_acc_no; - - CMsgQueue* m_msgQueue; //消息队列指针 - CMsgQueue* m_msgQueue_Query; //发送消息队列指针 - CMsgQueue* m_msgQueue_Order; //报单消息队列指针 - CMsgQueue* m_msgQueue_Test; //测试用 - - UserInfoField* m_pUserInfos; - int m_UserInfo_Pos; - int m_UserInfo_Count; - - void* m_pClass; - - CIDGenerator* m_pIDGenerator; - - list m_OldTradeList; - list m_NewTradeList; - unordered_map m_NewTradeMap; - unordered_map m_OldTradeMap; - - - list m_OldOrderList; - list m_NewOrderList; - - time_t m_QueryTradeTime; - time_t m_QueryOrderTime; - int m_OrderNotUpdateCount; - bool m_TradeListReverse; - bool m_LastIsMerge; -}; - diff --git a/QuantBox_Tdx_Trade/TypeConvert.cpp b/QuantBox_Tdx_Trade/TypeConvert.cpp deleted file mode 100644 index 17cf766..0000000 --- a/QuantBox_Tdx_Trade/TypeConvert.cpp +++ /dev/null @@ -1,239 +0,0 @@ -#include "stdafx.h" -#include "TypeConvert.h" -#include "../include/Tdx/tdx_enum.h" - -OrderType WTFS_2_OrderType(int In) -{ - switch (In) - { - case WTFS_Limit: - return OrderType::OrderType_Limit; - default: - return OrderType::OrderType_Market; - } -} - -TimeInForce WTFS_2_TimeInForce(int In) -{ - switch (In) - { - case WTFS_Limit: - case WTFS_Best_Reverse: - case WTFS_Best_Forward: - return TimeInForce::TimeInForce_Day; - case WTFS_IOC: - case WTFS_Five_IOC: - return TimeInForce::TimeInForce_IOC; - case WTFS_FOK: - return TimeInForce::TimeInForce_FOK; - case WTFS_Five_Limit: - return TimeInForce::TimeInForce_Day; - default: - return TimeInForce::TimeInForce_Day; - } -} - -OrderStatus ZTSM_2_OrderStatus(int In) -{ - switch (In) - { - case ZTSM_NotSent: - return OrderStatus::OrderStatus_PendingNew; - case ZTSM_New: - return OrderStatus::OrderStatus_New; - case ZTSM_Illegal: - return OrderStatus::OrderStatus_Rejected; - case ZTSM_AllFilled: - return OrderStatus::OrderStatus_Filled; - case ZTSM_AllCancelled: - return OrderStatus::OrderStatus_Cancelled; - case ZTSM_PartiallyFilled: - return OrderStatus::OrderStatus_PartiallyFilled; - default: - return OrderStatus::OrderStatus_NotSent; - } -} - -ExecType ZTSM_2_ExecType(int In) -{ - switch (In) - { - case ZTSM_NotSent: - return ExecType::ExecType_New; - case ZTSM_New: - return ExecType::ExecType_New; - case ZTSM_Illegal: - return ExecType::ExecType_Rejected; - case ZTSM_AllFilled: - case ZTSM_PartiallyFilled: - return ExecType::ExecType_Trade; - case ZTSM_AllCancelled: - case ZTSM_PartiallyCancelled: - return ExecType::ExecType_Cancelled; - - return ExecType::ExecType_Trade; - default: - return ExecType::ExecType_New; - } -} - -bool ZTSM_IsDone(int In) -{ - switch (In) - { - case ZTSM_Illegal: - case ZTSM_AllFilled: - case ZTSM_AllCancelled: - case ZTSM_PartiallyCancelled: - return true; - } - return false; -} - -bool ZTSM_IsNotSent(int In) -{ - switch (In) - { - case ZTSM_NotSent: - return true; - } - return false; -} - -// 将买卖方式转成买卖方向 -OrderSide MMBZ_2_OrderSide(int In) -{ - switch (In) - { - case MMBZ_Buy_Limit: - return OrderSide::OrderSide_Buy; - case MMBZ_Sell_Limit: - return OrderSide::OrderSide_Sell; - default: - break; - } - return OrderSide::OrderSide_Buy; -} - -void CJLB_2_TradeField(CJLB_STRUCT* pIn, TradeField* pOut) -{ - strcpy(pOut->ID, pIn->WTBH); - strcpy(pOut->InstrumentID, pIn->ZQDM); - pOut->Price = pIn->CJJG_; - pOut->Qty = pIn->CJSL_; - pOut->Date = pIn->CJRQ_; - pOut->Time = pIn->CJSJ_; - pOut->Side = MMBZ_2_OrderSide(pIn->MMBZ_); - - strcpy(pOut->TradeID, pIn->CJBH); - - pOut->Commission = pIn->YJ_ + pIn->YHS_ + pIn->GHF_ + pIn->CJF_; - - pOut->OpenClose = pOut->Side == OrderSide::OrderSide_Buy ? OpenCloseType::OpenCloseType_Open : OpenCloseType::OpenCloseType_Close; - pOut->HedgeFlag = HedgeFlagType::HedgeFlagType_Speculation; - -} - -void WTLB_2_OrderField_0(WTLB_STRUCT* pIn, OrderField* pOut) -{ - strcpy(pOut->ID, pIn->WTBH); - strcpy(pOut->InstrumentID, pIn->ZQDM); - pOut->Price = pIn->WTJG_; - pOut->Qty = pIn->WTSL_; - pOut->Date = pIn->WTRQ_; - pOut->Time = pIn->WTSJ_; - pOut->Side = MMBZ_2_OrderSide(pIn->MMBZ_); - - pOut->Type = WTFS_2_OrderType(pIn->BJFS_); - pOut->TimeInForce = WTFS_2_TimeInForce(pIn->BJFS_); - - pOut->Status = ZTSM_2_OrderStatus(pIn->ZTSM_); - pOut->ExecType = ZTSM_2_ExecType(pIn->ZTSM_); - - pOut->OpenClose = pOut->Side == OrderSide::OrderSide_Buy ? OpenCloseType::OpenCloseType_Open : OpenCloseType::OpenCloseType_Close; - pOut->HedgeFlag = HedgeFlagType::HedgeFlagType_Speculation; - - strcpy(pOut->AccountID, pIn->GDDM); - - pOut->AvgPx = pIn->CJJG_; - pOut->CumQty = pIn->CJSL_; - pOut->LeavesQty = pIn->WTSL_ - pIn->CJSL_ - pIn->CDSL_; - - strcpy(pOut->Text, pIn->ZTSM); -} - -int OrderType_2_WTFS(OrderType In) -{ - switch (In) - { - case OrderType_Market: - case OrderType_Stop: - case OrderType_MarketOnClose: - case OrderType_TrailingStop: - return WTFS_Five_IOC;// 只推荐使用五档模拟市价 - case OrderType_Limit: - case OrderType_StopLimit: - case OrderType_TrailingStopLimit: - return WTFS_Limit; - case OrderType_Pegged: - default: - return WTFS_Limit; - } -} - - -void OrderField_2_Order_STRUCT(OrderField* pIn, Order_STRUCT* pOut) -{ - strcpy(pOut->ZQDM, pIn->InstrumentID); - pOut->Price = pIn->Price; - pOut->Qty = pIn->Qty; - pOut->WTFS = OrderType_2_WTFS(pIn->Type); - pOut->RZRQBS = RZRQBS_NO; - - // 这个地方后期要再改,因为没有处理基金等情况 - switch (pIn->Type) - { - case OrderType::OrderType_Market: - if (pIn->Side == OrderSide::OrderSide_Buy) - pOut->MMBZ = MMBZ_Buy_Market; - else - pOut->MMBZ = MMBZ_Sell_Market; - break; - case OrderType::OrderType_Limit: - if (pIn->Side == OrderSide::OrderSide_Buy) - pOut->MMBZ = MMBZ_Buy_Limit; - else - pOut->MMBZ = MMBZ_Sell_Limit; - break; - } -} - -void GDLB_2_InvestorField(GDLB_STRUCT* pIn, InvestorField* pOut) -{ - strcpy(pOut->InvestorID, pIn->GDDM); - strcpy(pOut->InvestorName, pIn->GDMC); -} - -void ZJYE_2_AccountField(ZJYE_STRUCT* pIn, AccountField* pOut) -{ - strcpy(pOut->AccountID, pIn->ZJZH); - //pIn->BZ; - pOut->Available = pIn->KYZJ_; - - // 还有很多不知道如何对应,有可能需要扩展XAPI部分 - pOut->Balance = pIn->ZZC_; - -} - -void GFLB_2_PositionField(GFLB_STRUCT* pIn, PositionField* pOut) -{ - pOut->Side = PositionSide::PositionSide_Long; - pOut->Position = pIn->ZQSL_; - pOut->TodayPosition = pIn->DJSL_; - pOut->HistoryPosition = pIn->KMSL_; - pOut->HedgeFlag = HedgeFlagType::HedgeFlagType_Speculation; - strcpy(pOut->InstrumentID, pIn->ZQDM); - strcpy(pOut->Symbol, pIn->ZQDM); - - // 还有一些信息没有 -} \ No newline at end of file diff --git a/QuantBox_Tdx_Trade/TypeConvert.h b/QuantBox_Tdx_Trade/TypeConvert.h deleted file mode 100644 index 86a7d6f..0000000 --- a/QuantBox_Tdx_Trade/TypeConvert.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "../include/ApiStruct.h" - -#include "../include/Tdx/tdx_struct.h" - -// 两种情况: -// 1.完全重建 -// 2.部分重建 -bool ZTSM_IsDone(int In); -bool ZTSM_IsNotSent(int In); - -void GDLB_2_InvestorField(GDLB_STRUCT* pIn, InvestorField* pOut); -void ZJYE_2_AccountField(ZJYE_STRUCT* pIn, AccountField* pOut); -void GFLB_2_PositionField(GFLB_STRUCT* pIn, PositionField* pOut); - -void CJLB_2_TradeField(CJLB_STRUCT* pIn, TradeField* pOut); - -// -void WTLB_2_OrderField_0(WTLB_STRUCT* pIn, OrderField* pOut); -//void WTLB_2_OrderField_1(WTLB_STRUCT* pIn, OrderField* pOut); - -void OrderField_2_Order_STRUCT(OrderField* pIn, Order_STRUCT* pOut); diff --git a/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.h b/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.h deleted file mode 100644 index 20f961c..0000000 --- a/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.h +++ /dev/null @@ -1,26 +0,0 @@ -// QuantBox_TongShi_Quote.h : main header file for the QuantBox_TongShi_Quote DLL -// - -#pragma once - -#ifndef __AFXWIN_H__ - #error "include 'stdafx.h' before including this file for PCH" -#endif - -#include "resource.h" // main symbols - -// CQuantBox_TongShi_QuoteApp -// See QuantBox_TongShi_Quote.cpp for the implementation of this class -// - -class CQuantBox_TongShi_QuoteApp : public CWinApp -{ -public: - CQuantBox_TongShi_QuoteApp(); - -// Overrides -public: - virtual BOOL InitInstance(); - - DECLARE_MESSAGE_MAP() -}; diff --git a/QuantBox_XAPI/XApiC.cpp b/QuantBox_XAPI/XApiC.cpp deleted file mode 100644 index 36e632a..0000000 --- a/QuantBox_XAPI/XApiC.cpp +++ /dev/null @@ -1,217 +0,0 @@ -#include "stdafx.h" - -#include -#include -#include "../include/XApiC.h" -#include "../include/QueueHeader.h" -#include "../include/QueueEnum.h" - -#if defined WINDOWS || WIN32 -#include -#else -#include -#include -#endif - - -void* X_LoadLib(char* libPath) -{ - if (libPath == nullptr) - return nullptr; - -#if defined WINDOWS || WIN32 - return LoadLibraryExA(libPath, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH); -#else - return dlopen(libPath, RTLD_NOW); -#endif -} - -char* X_GetLastError() -{ -#if defined WINDOWS || WIN32 - char szBuf[256] = {0}; - LPVOID lpMsgBuf; - DWORD dw = GetLastError(); - FormatMessageA( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - dw, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPSTR)&lpMsgBuf, - 0, NULL); - return (char*)lpMsgBuf; -#else - extern int errno; - errno = 0; - return dlerror(); -#endif -} - -void* X_GetFunction(void* lib,char* ProcName) -{ - if (lib == nullptr) - return nullptr; -#if defined WINDOWS || WIN32 - return GetProcAddress((HMODULE)lib, ProcName); -#else - return (dlsym(lib, ProcName)); -#endif -} - -void X_FreeLib(void* lib) -{ - if (lib == nullptr) - return; - -#if defined WINDOWS || WIN32 - FreeLibrary((HMODULE)lib); -#else - dlclose(lib); -#endif -} - -ApiType X_GetApiType(void* pFun) -{ - if (pFun == nullptr) - return ApiType::ApiType_Nono; - - void* p = ((fnOnRespone)pFun)(RequestType::GetApiType, nullptr, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); - - return (ApiType)(char)(long long)(p); -} - -char* X_GetApiVersion(void* pFun) -{ - if (pFun == nullptr) - return nullptr; - - return (char*)((fnOnRespone)pFun)(RequestType::GetApiVersion, nullptr, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); -} - -char* X_GetApiName(void* pFun) -{ - if (pFun == nullptr) - return nullptr; - - return (char*)((fnOnRespone)pFun)(RequestType::GetApiName, nullptr, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); -} - -void* X_Create(void* pFun) -{ - if (pFun == nullptr) - return nullptr; - - return ((fnOnRespone)pFun)(RequestType::Create, nullptr, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); -} - -void X_Register(void* pFun, void* pApi, void* pCallback, void* pClass) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(RequestType::Register, pApi, nullptr, 0, 0, pCallback, 0, pClass, 0, nullptr, 0); -} - -void X_Connect(void* pFun, void* pApi, char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(RequestType::Connect, pApi, nullptr, 0, 0, pServerInfo, 0, pUserInfo, count, szPath, 0); -} - -void X_Disconnect(void* pFun, void* pApi) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(RequestType::Disconnect, pApi, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); -} - -void X_Subscribe(void* pFun, void* pApi, char* szInstrument, char* szExchange) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(RequestType::Subscribe, pApi, nullptr, 0, 0, szInstrument, 0, szExchange, 0, nullptr, 0); -} - -void X_Unsubscribe(void* pFun, void* pApi, char* szInstrument, char* szExchange) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(RequestType::Unsubscribe, pApi, nullptr, 0, 0, szInstrument, 0, szExchange, 0, nullptr, 0); -} - -void X_SubscribeQuote(void* pFun, void* pApi, char* szInstrument, char* szExchange) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(RequestType::SubscribeQuote, pApi, nullptr, 0, 0, szInstrument, 0, szExchange, 0, nullptr, 0); -} - -void X_UnsubscribeQuote(void* pFun, void* pApi, char* szInstrument, char* szExchange) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(RequestType::UnsubscribeQuote, pApi, nullptr, 0, 0, szInstrument, 0, szExchange, 0, nullptr, 0); -} - -void X_ReqQryInstrument(void* pFun, void* pApi, char* szInstrument, char* szExchange) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(QueryType::ReqQryInstrument, pApi, nullptr, 0, 0, szInstrument, 0, szExchange, 0, nullptr, 0); -} - -void X_ReqQryInvestorPosition(void* pFun, void* pApi, char* szInstrument, char* szExchange) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(QueryType::ReqQryInvestorPosition, pApi, nullptr, 0, 0, szInstrument, 0, szExchange, 0, nullptr, 0); -} - -void X_ReqQryTradingAccount(void* pFun, void* pApi) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(QueryType::ReqQryTradingAccount, pApi, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); -} - -void X_SendOrder(void* pFun, void* pApi, OrderField* pOrder, OrderIDType* pInOut, int count) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(RequestType::ReqOrderInsert, pApi, nullptr, 0, 0, pOrder, count, pInOut, 0, nullptr, 0); -} - -void X_CancelOrder(void* pFun, void* pApi, OrderIDType* pIn, OrderIDType* pOut, int count) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(RequestType::ReqOrderAction, pApi, nullptr, 0, 0, pIn, count, pOut, 0, nullptr, 0); -} - -void X_SendQuote(void* pFun, void* pApi, QuoteField* pQuote, OrderIDType* pAskOut, OrderIDType* pBidOut, int count) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(RequestType::ReqQuoteInsert, pApi, nullptr, 0, 0, pQuote, count, pAskOut, 0, pBidOut, 0); -} - -void X_CancelQuote(void* pFun, void* pApi, OrderIDType* pIn, OrderIDType* pOut, int count) -{ - if (pFun == nullptr || pApi == nullptr) - return; - - ((fnOnRespone)pFun)(RequestType::ReqQuoteAction, pApi, nullptr, 0, 0, pIn, count, pOut, 0, nullptr, 0); -} diff --git a/QuantBox_XAPI/XApiCpp.cpp b/QuantBox_XAPI/XApiCpp.cpp deleted file mode 100644 index d69c6ce..0000000 --- a/QuantBox_XAPI/XApiCpp.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "stdafx.h" -#include "../include/XApiCpp.h" - -#include "XApiImpl.h" - -CXApi::CXApi() -{ -} - -CXApi* CXApi::CreateApi(char* libPath) -{ - return new CXApiImpl(libPath); -} diff --git a/QuantBox_XAPI/XApiImpl.cpp b/QuantBox_XAPI/XApiImpl.cpp deleted file mode 100644 index a3a9126..0000000 --- a/QuantBox_XAPI/XApiImpl.cpp +++ /dev/null @@ -1,195 +0,0 @@ -#include "stdafx.h" -#include -#include -#include "XApiImpl.h" - -#include "../include/QueueEnum.h" -#include "../include/XApiC.h" - -void* __stdcall CXApiImpl::OnRespone(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - if (pApi2 == nullptr) - return nullptr; - - CXApiImpl* pThisClass = (CXApiImpl*)pApi2; - return pThisClass->_OnRespone(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); -} - -void* CXApiImpl::_OnRespone(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - if (nullptr == m_pSpi) - return nullptr; - - ResponeType rt = (ResponeType)type; - switch (rt) - { - case OnConnectionStatus: - m_pSpi->OnConnectionStatus(this, (ConnectionStatus)(char)double1, (RspUserLoginField*)ptr1, size1); - break; - case OnRtnError: - m_pSpi->OnRtnError(this, (ErrorField*)ptr1); - break; - case OnRtnDepthMarketData: - m_pSpi->OnRtnDepthMarketDataN(this, (DepthMarketDataNField*)ptr1); - break; - case OnRspQryInstrument: - m_pSpi->OnRspQryInstrument(this, (InstrumentField*)ptr1, size1, double1 != 0); - break; - case OnRspQryTradingAccount: - m_pSpi->OnRspQryTradingAccount(this, (AccountField*)ptr1, size1, double1 != 0); - break; - case OnRspQryInvestorPosition: - m_pSpi->OnRspQryInvestorPosition(this, (PositionField*)ptr1, size1, double1 != 0); - break; - case OnRspQrySettlementInfo: - m_pSpi->OnRspQrySettlementInfo(this, (SettlementInfoField*)ptr1, size1, double1 != 0); - break; - - case OnRtnOrder: - m_pSpi->OnRtnOrder(this, (OrderField*)ptr1); - break; - case OnRtnTrade: - m_pSpi->OnRtnTrade(this, (TradeField*)ptr1); - break; - - case OnRtnQuote: - m_pSpi->OnRtnQuote(this, (QuoteField*)ptr1); - break; - case OnRtnQuoteRequest: - m_pSpi->OnRtnQuoteRequest(this, (QuoteRequestField*)ptr1); - break; - - case OnRspQryHistoricalTicks: - m_pSpi->OnRspQryHistoricalTicks(this, (TickField*)ptr1, size1, (HistoricalDataRequestField*)ptr2, size2, double1 != 0); - break; - case OnRspQryHistoricalBars: - m_pSpi->OnRspQryHistoricalBars(this, (BarField*)ptr1, size1, (HistoricalDataRequestField*)ptr2, size2, double1 != 0); - break; - - case OnRspQryInvestor: - m_pSpi->OnRspQryInvestor(this, (InvestorField*)ptr1, size1, double1 != 0); - break; - case OnFilterSubscribe: - return (void*)m_pSpi->OnFilterSubscribe(this, (ExchangeType)(char)double1, (int)size1, (int)size1, (int)size3, (char*)ptr1); - default: - break; - } - return nullptr; -} - -CXApiImpl::CXApiImpl(char* libPath) :CXApi() -{ - m_pLib = nullptr; - m_pFun = nullptr; - m_pApi = nullptr; - m_pSpi = nullptr; - - strncpy(m_LibPath, libPath, sizeof(m_LibPath)); -} - - -CXApiImpl::~CXApiImpl() -{ - Disconnect(); -} - -ApiType CXApiImpl::GetApiType() -{ - return X_GetApiType(m_pFun); -} - -char* CXApiImpl::GetApiVersion() -{ - return X_GetApiVersion(m_pFun); -} - -char* CXApiImpl::GetApiName() -{ - return X_GetApiName(m_pFun); -} - -void CXApiImpl::RegisterSpi(CXSpi *pSpi) -{ - m_pSpi = pSpi; -} - -bool CXApiImpl::Init() -{ - m_pLib = X_LoadLib(m_LibPath); - if (m_pLib) - { - m_pFun = X_GetFunction(m_pLib); - if (m_pFun) - { - return true; - } - } - return false; -} - -char* CXApiImpl::GetLastError() -{ - return X_GetLastError(); -} - -void CXApiImpl::Connect(char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count) -{ - m_pApi = X_Create(m_pFun); - X_Register(m_pFun, m_pApi, (void*)OnRespone, this); - X_Connect(m_pFun, m_pApi, szPath, pServerInfo, pUserInfo, count); -} - -void CXApiImpl::Disconnect() -{ - X_Disconnect(m_pFun, m_pApi); - X_FreeLib(m_pLib); - - m_pLib = nullptr; - m_pFun = nullptr; - m_pApi = nullptr; - m_pSpi = nullptr; -} - -void CXApiImpl::Subscribe(char* szInstrument, char* szExchange) -{ - X_Subscribe(m_pFun, m_pApi, szInstrument, szExchange); -} - -void CXApiImpl::Unsubscribe(char* szInstrument, char* szExchange) -{ - X_Unsubscribe(m_pFun, m_pApi, szInstrument, szExchange); -} - -void CXApiImpl::ReqQryInstrument(char* szInstrument, char* szExchange) -{ - X_ReqQryInstrument(m_pFun, m_pApi, szInstrument, szExchange); -} - -void CXApiImpl::ReqQryInvestorPosition(char* szInstrument, char* szExchange) -{ - X_ReqQryInvestorPosition(m_pFun, m_pApi, szInstrument, szExchange); -} - -void CXApiImpl::ReqQryTradingAccount() -{ - X_ReqQryTradingAccount(m_pFun, m_pApi); -} - -void CXApiImpl::SendOrder(OrderField* pOrder, OrderIDType* pInOut, int count) -{ - X_SendOrder(m_pFun, m_pApi, pOrder, pInOut, count); -} - -void CXApiImpl::CancelOrder(OrderIDType* pIn, OrderIDType* pOut, int count) -{ - X_CancelOrder(m_pFun, m_pApi, pIn, pOut, count); -} - -void CXApiImpl::SendQuote(QuoteField* pQuote, OrderIDType* pAskOut, OrderIDType* pBidOut, int count) -{ - X_SendQuote(m_pFun, m_pApi, pQuote, pAskOut, pBidOut, count); -} -void CXApiImpl::CancelQuote(OrderIDType* pIn, OrderIDType* pOut, int count) -{ - X_CancelQuote(m_pFun, m_pApi, pIn, pOut, count); -} diff --git a/QuantBox_XAPI/XApiImpl.h b/QuantBox_XAPI/XApiImpl.h deleted file mode 100644 index fb73253..0000000 --- a/QuantBox_XAPI/XApiImpl.h +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once -#include "../include/XApiCpp.h" - -#include "../include/QueueHeader.h" - -class CXApiImpl : - public CXApi -{ -public: - CXApiImpl(char* libPath); - ~CXApiImpl(); - - virtual ApiType GetApiType(); - virtual char* GetApiVersion(); - virtual char* GetApiName(); - - virtual bool Init(); - virtual char* GetLastError(); - virtual void RegisterSpi(CXSpi *pSpi); - - virtual void Connect(char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count); - virtual void Disconnect(); - - virtual void Subscribe(char* szInstrument, char* szExchange); - virtual void Unsubscribe(char* szInstrument, char* szExchange); - - virtual void ReqQryInstrument(char* szInstrument, char* szExchange); - virtual void ReqQryInvestorPosition(char* szInstrument, char* szExchange); - virtual void ReqQryTradingAccount(); - - virtual void SendOrder(OrderField* pOrder, OrderIDType* pInOut, int count); - virtual void CancelOrder(OrderIDType* pIn, OrderIDType* pOut, int count); - - virtual void SendQuote(QuoteField* pQuote, OrderIDType* pAskOut, OrderIDType* pBidOut, int count); - virtual void CancelQuote(OrderIDType* pIn, OrderIDType* pOut, int count); -public: - static void* __stdcall OnRespone(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); -private: - void* _OnRespone(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - - void* m_pLib; - void* m_pFun; - void* m_pApi; - - CXSpi *m_pSpi; - char m_LibPath[1024]; -}; - diff --git a/QuantBox_XAPI_CSharp_Linux.sln b/QuantBox_XAPI_CSharp_Linux.sln deleted file mode 100644 index 99b6baf..0000000 --- a/QuantBox_XAPI_CSharp_Linux.sln +++ /dev/null @@ -1,75 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuantBox.XAPI_Linux", "csharp\QuantBox.XAPI\QuantBox.XAPI_Linux.csproj", "{6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Win32.ActiveCfg = Debug|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Win32.Build.0 = Debug|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Any CPU.Build.0 = Release|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Win32.ActiveCfg = Release|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Win32.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - Policies = $0 - $0.DotNetNamingPolicy = $1 - $1.DirectoryNamespaceAssociation = None - $1.ResourceNamePolicy = FileFormatDefault - $0.TextStylePolicy = $2 - $2.FileWidth = 120 - $2.TabsToSpaces = False - $2.inheritsSet = VisualStudio - $2.inheritsScope = text/plain - $2.scope = text/x-csharp - $0.CSharpFormattingPolicy = $3 - $3.IndentSwitchBody = True - $3.IndentBlocksInsideExpressions = True - $3.AnonymousMethodBraceStyle = NextLine - $3.PropertyBraceStyle = NextLine - $3.PropertyGetBraceStyle = NextLine - $3.PropertySetBraceStyle = NextLine - $3.EventBraceStyle = NextLine - $3.EventAddBraceStyle = NextLine - $3.EventRemoveBraceStyle = NextLine - $3.StatementBraceStyle = NextLine - $3.ElseNewLinePlacement = NewLine - $3.CatchNewLinePlacement = NewLine - $3.FinallyNewLinePlacement = NewLine - $3.WhileNewLinePlacement = DoNotCare - $3.ArrayInitializerWrapping = DoNotChange - $3.ArrayInitializerBraceStyle = NextLine - $3.BeforeMethodDeclarationParentheses = False - $3.BeforeMethodCallParentheses = False - $3.BeforeConstructorDeclarationParentheses = False - $3.NewLineBeforeConstructorInitializerColon = NewLine - $3.NewLineAfterConstructorInitializerColon = SameLine - $3.BeforeDelegateDeclarationParentheses = False - $3.NewParentheses = False - $3.SpacesBeforeBrackets = False - $3.inheritsSet = Mono - $3.inheritsScope = text/x-csharp - $3.scope = text/x-csharp - outputpath = bin - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/QuantBox_XAPI_C_Linux.workspace b/QuantBox_XAPI_C_Linux.workspace deleted file mode 100644 index 08b248c..0000000 --- a/QuantBox_XAPI_C_Linux.workspace +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/QuantBox_XAPI_Windows.sln b/QuantBox_XAPI_Windows.sln deleted file mode 100644 index c4d5dd1..0000000 --- a/QuantBox_XAPI_Windows.sln +++ /dev/null @@ -1,643 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_CTP_Quote", "QuantBox_CTP_Quote\QuantBox_CTP_Quote.vcxproj", "{919B914D-6840-453E-9201-8619E63AD0E1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_CTP_Trade", "QuantBox_CTP_Trade\QuantBox_CTP_Trade.vcxproj", "{9FBB0318-E21C-4B7C-A258-98E6A3860B35}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_LTS_Quote", "QuantBox_LTS_Quote\QuantBox_LTS_Quote.vcxproj", "{9767FE88-A225-4DC9-8B2F-D31707A4D4DB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_LTS_Trade", "QuantBox_LTS_Trade\QuantBox_LTS_Trade.vcxproj", "{B8978578-B853-46E3-A71B-3466FC1DE98C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_LTS_Level2", "QuantBox_LTS_Level2\QuantBox_LTS_Level2.vcxproj", "{97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_XSpeed_Quote", "QuantBox_XSpeed_Quote\QuantBox_XSpeed_Quote.vcxproj", "{80822F4A-0209-4358-A5B7-161DF7FADD8B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_XSpeed_Trade", "QuantBox_XSpeed_Trade\QuantBox_XSpeed_Trade.vcxproj", "{FE203F36-AD1F-421F-992A-EAD8D5A5458D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_DFITC_Level2", "QuantBox_DFITC_Level2\QuantBox_DFITC_Level2.vcxproj", "{45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_Femas_Quote", "QuantBox_Femas_Quote\QuantBox_Femas_Quote.vcxproj", "{47D9FF39-1450-45B7-A9B4-CA28F984EC87}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_Femas_Trade", "QuantBox_Femas_Trade\QuantBox_Femas_Trade.vcxproj", "{7E440983-F893-4E8D-B0E9-D9B02746B494}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_KingstarGold", "QuantBox_KingstarGold\QuantBox_KingstarGold.vcxproj", "{C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_Esunny_HistoricalData", "QuantBox_Esunny_HistoricalData\QuantBox_Esunny_HistoricalData.vcxproj", "{9FC06F89-5E4C-4962-ABB3-47D9805AA08D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_XSpeedStock_Quote", "QuantBox_XSpeedStock_Quote\QuantBox_XSpeedStock_Quote.vcxproj", "{9FD206D1-CD58-402B-B6A0-0A0BD568EB40}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_XSpeedStock_Trade", "QuantBox_XSpeedStock_Trade\QuantBox_XSpeedStock_Trade.vcxproj", "{643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_Kingstar_Quote", "QuantBox_Kingstar_Quote\QuantBox_Kingstar_Quote.vcxproj", "{199071F1-5059-4883-BA49-6A9922A71ADD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_Kingstar_Trade", "QuantBox_Kingstar_Trade\QuantBox_Kingstar_Trade.vcxproj", "{70015722-8252-4944-AE20-16A88B583CEE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_KingstarStock_Trade", "QuantBox_KingstarStock_Trade\QuantBox_KingstarStock_Trade.vcxproj", "{52BD46A7-5433-4583-A9C7-E35BC5CCC63B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_Queue", "QuantBox_Queue\QuantBox_Queue.vcxproj", "{3A9173AA-92DB-49F9-88E3-09419C1D8E9F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_ZeroMQ_Quote", "QuantBox_ZeroMQ_Quote\QuantBox_ZeroMQ_Quote.vcxproj", "{66FF43DF-8075-421D-A338-C651E9F02692}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_TongShi_Quote", "QuantBox_TongShi_Quote\QuantBox_TongShi_Quote.vcxproj", "{372C0D5E-ED93-4335-849C-65494AE8A17D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "csharp", "csharp", "{5CAA3396-61F9-4079-8A0A-59AD9D3B1219}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp", "cpp", "{C47DF7F6-0F37-48E3-B510-3E021EBE6BF5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuantBox.XAPI", "csharp\QuantBox.XAPI\QuantBox.XAPI.csproj", "{6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_XAPI", "QuantBox_XAPI\QuantBox_XAPI.vcxproj", "{39599EFE-428F-408F-BF4F-BF462E37C5E8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_XAPI_TEST", "QuantBox_XAPI_TEST\QuantBox_XAPI_TEST.vcxproj", "{C77ADBF7-E610-4E57-BE4D-C122FC5BE611}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_LTS_Quote_v2", "QuantBox_LTS_Quote_v2\QuantBox_LTS_Quote_v2.vcxproj", "{D4387736-0623-4442-A4AC-AF79239F9419}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_LTS_Trade_v2", "QuantBox_LTS_Trade_v2\QuantBox_LTS_Trade_v2.vcxproj", "{683AECBB-89EB-4692-99C5-A527853326D4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_Tdx_Trade", "QuantBox_Tdx_Trade\QuantBox_Tdx_Trade.vcxproj", "{01D3F1DE-99B3-4D41-97C3-F4680CDB980B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuantBox_LTS_Query_v2", "QuantBox_LTS_Query_v2\QuantBox_LTS_Query_v2.vcxproj", "{51D11C21-C4A7-4F07-9658-B8BA223684B8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FakeAPI", "FakeAPI\FakeAPI.vcxproj", "{358586C9-A4B8-43E4-8376-59C68F0F6211}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Debug64|Any CPU = Debug64|Any CPU - Debug64|Mixed Platforms = Debug64|Mixed Platforms - Debug64|Win32 = Debug64|Win32 - Debug64|x64 = Debug64|x64 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug|Win32.ActiveCfg = Debug|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug|Win32.Build.0 = Debug|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug|x64.ActiveCfg = Debug|x64 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug|x64.Build.0 = Debug|x64 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug64|Win32.Build.0 = Debug64|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug64|x64.ActiveCfg = Debug64|x64 - {919B914D-6840-453E-9201-8619E63AD0E1}.Debug64|x64.Build.0 = Debug64|x64 - {919B914D-6840-453E-9201-8619E63AD0E1}.Release|Any CPU.ActiveCfg = Release|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Release|Mixed Platforms.Build.0 = Release|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Release|Win32.ActiveCfg = Release|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Release|Win32.Build.0 = Release|Win32 - {919B914D-6840-453E-9201-8619E63AD0E1}.Release|x64.ActiveCfg = Release|x64 - {919B914D-6840-453E-9201-8619E63AD0E1}.Release|x64.Build.0 = Release|x64 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug|Win32.ActiveCfg = Debug|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug|Win32.Build.0 = Debug|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug|x64.ActiveCfg = Debug|x64 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug|x64.Build.0 = Debug|x64 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug64|Win32.Build.0 = Debug64|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug64|x64.ActiveCfg = Debug64|x64 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Debug64|x64.Build.0 = Debug64|x64 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release|Any CPU.ActiveCfg = Release|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release|Mixed Platforms.Build.0 = Release|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release|Win32.ActiveCfg = Release|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release|Win32.Build.0 = Release|Win32 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release|x64.ActiveCfg = Release|x64 - {9FBB0318-E21C-4B7C-A258-98E6A3860B35}.Release|x64.Build.0 = Release|x64 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug|Win32.ActiveCfg = Debug|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug|Win32.Build.0 = Debug|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug|x64.ActiveCfg = Debug|x64 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug|x64.Build.0 = Debug|x64 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug64|Win32.Build.0 = Debug64|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug64|x64.ActiveCfg = Debug64|x64 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Debug64|x64.Build.0 = Debug64|x64 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Release|Any CPU.ActiveCfg = Release|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Release|Mixed Platforms.Build.0 = Release|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Release|Win32.ActiveCfg = Release|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Release|Win32.Build.0 = Release|Win32 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Release|x64.ActiveCfg = Release|x64 - {9767FE88-A225-4DC9-8B2F-D31707A4D4DB}.Release|x64.Build.0 = Release|x64 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug|Win32.ActiveCfg = Debug|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug|Win32.Build.0 = Debug|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug|x64.ActiveCfg = Debug|x64 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug|x64.Build.0 = Debug|x64 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug64|Win32.Build.0 = Debug64|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug64|x64.ActiveCfg = Debug64|x64 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Debug64|x64.Build.0 = Debug64|x64 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Release|Any CPU.ActiveCfg = Release|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Release|Mixed Platforms.Build.0 = Release|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Release|Win32.ActiveCfg = Release|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Release|Win32.Build.0 = Release|Win32 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Release|x64.ActiveCfg = Release|x64 - {B8978578-B853-46E3-A71B-3466FC1DE98C}.Release|x64.Build.0 = Release|x64 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug|Win32.ActiveCfg = Debug|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug|Win32.Build.0 = Debug|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug|x64.ActiveCfg = Debug|x64 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug|x64.Build.0 = Debug|x64 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug64|Win32.Build.0 = Debug64|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug64|x64.ActiveCfg = Debug64|x64 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Debug64|x64.Build.0 = Debug64|x64 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Release|Any CPU.ActiveCfg = Release|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Release|Mixed Platforms.Build.0 = Release|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Release|Win32.ActiveCfg = Release|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Release|Win32.Build.0 = Release|Win32 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Release|x64.ActiveCfg = Release|x64 - {97BFCA85-4C15-4CCD-A6D0-2FEB91FD6ECD}.Release|x64.Build.0 = Release|x64 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug|Win32.ActiveCfg = Debug|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug|Win32.Build.0 = Debug|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug|x64.ActiveCfg = Debug|x64 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug|x64.Build.0 = Debug|x64 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug64|Win32.Build.0 = Debug64|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug64|x64.ActiveCfg = Debug64|x64 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Debug64|x64.Build.0 = Debug64|x64 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Release|Any CPU.ActiveCfg = Release|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Release|Mixed Platforms.Build.0 = Release|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Release|Win32.ActiveCfg = Release|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Release|Win32.Build.0 = Release|Win32 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Release|x64.ActiveCfg = Release|x64 - {80822F4A-0209-4358-A5B7-161DF7FADD8B}.Release|x64.Build.0 = Release|x64 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug|Win32.ActiveCfg = Debug|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug|Win32.Build.0 = Debug|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug|x64.ActiveCfg = Debug|x64 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug|x64.Build.0 = Debug|x64 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug64|Win32.Build.0 = Debug64|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug64|x64.ActiveCfg = Debug64|x64 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Debug64|x64.Build.0 = Debug64|x64 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Release|Any CPU.ActiveCfg = Release|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Release|Mixed Platforms.Build.0 = Release|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Release|Win32.ActiveCfg = Release|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Release|Win32.Build.0 = Release|Win32 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Release|x64.ActiveCfg = Release|x64 - {FE203F36-AD1F-421F-992A-EAD8D5A5458D}.Release|x64.Build.0 = Release|x64 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug|Win32.ActiveCfg = Debug|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug|Win32.Build.0 = Debug|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug|x64.ActiveCfg = Debug|x64 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug|x64.Build.0 = Debug|x64 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug64|Win32.Build.0 = Debug64|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug64|x64.ActiveCfg = Debug64|x64 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Debug64|x64.Build.0 = Debug64|x64 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Release|Any CPU.ActiveCfg = Release|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Release|Mixed Platforms.Build.0 = Release|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Release|Win32.ActiveCfg = Release|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Release|Win32.Build.0 = Release|Win32 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Release|x64.ActiveCfg = Release|x64 - {45A6ED8B-135F-4B18-B6A9-D4229E6D2AF9}.Release|x64.Build.0 = Release|x64 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug|Win32.ActiveCfg = Debug|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug|Win32.Build.0 = Debug|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug|x64.ActiveCfg = Debug|x64 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug|x64.Build.0 = Debug|x64 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug64|Win32.Build.0 = Debug64|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug64|x64.ActiveCfg = Debug64|x64 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Debug64|x64.Build.0 = Debug64|x64 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Release|Any CPU.ActiveCfg = Release|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Release|Mixed Platforms.Build.0 = Release|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Release|Win32.ActiveCfg = Release|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Release|Win32.Build.0 = Release|Win32 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Release|x64.ActiveCfg = Release|x64 - {47D9FF39-1450-45B7-A9B4-CA28F984EC87}.Release|x64.Build.0 = Release|x64 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug|Win32.ActiveCfg = Debug|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug|Win32.Build.0 = Debug|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug|x64.ActiveCfg = Debug|x64 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug|x64.Build.0 = Debug|x64 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug64|Win32.Build.0 = Debug64|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug64|x64.ActiveCfg = Debug64|x64 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Debug64|x64.Build.0 = Debug64|x64 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Release|Any CPU.ActiveCfg = Release|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Release|Mixed Platforms.Build.0 = Release|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Release|Win32.ActiveCfg = Release|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Release|Win32.Build.0 = Release|Win32 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Release|x64.ActiveCfg = Release|x64 - {7E440983-F893-4E8D-B0E9-D9B02746B494}.Release|x64.Build.0 = Release|x64 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug|Win32.ActiveCfg = Debug|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug|Win32.Build.0 = Debug|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug|x64.ActiveCfg = Debug|x64 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug|x64.Build.0 = Debug|x64 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug64|Win32.Build.0 = Debug64|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug64|x64.ActiveCfg = Debug64|x64 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Debug64|x64.Build.0 = Debug64|x64 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Release|Any CPU.ActiveCfg = Release|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Release|Mixed Platforms.Build.0 = Release|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Release|Win32.ActiveCfg = Release|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Release|Win32.Build.0 = Release|Win32 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Release|x64.ActiveCfg = Release|x64 - {C8F7594A-F33D-445C-8ADB-5D4BAB5BD95B}.Release|x64.Build.0 = Release|x64 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug|Win32.ActiveCfg = Debug|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug|Win32.Build.0 = Debug|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug|x64.ActiveCfg = Debug|x64 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug|x64.Build.0 = Debug|x64 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug64|Win32.Build.0 = Debug64|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug64|x64.ActiveCfg = Debug64|x64 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Debug64|x64.Build.0 = Debug64|x64 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Release|Any CPU.ActiveCfg = Release|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Release|Mixed Platforms.Build.0 = Release|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Release|Win32.ActiveCfg = Release|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Release|Win32.Build.0 = Release|Win32 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Release|x64.ActiveCfg = Release|x64 - {9FC06F89-5E4C-4962-ABB3-47D9805AA08D}.Release|x64.Build.0 = Release|x64 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug|Win32.ActiveCfg = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug|Win32.Build.0 = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug|x64.ActiveCfg = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug64|Win32.ActiveCfg = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug64|Win32.Build.0 = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Debug64|x64.ActiveCfg = Debug|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Release|Any CPU.ActiveCfg = Release|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Release|Mixed Platforms.Build.0 = Release|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Release|Win32.ActiveCfg = Release|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Release|Win32.Build.0 = Release|Win32 - {9FD206D1-CD58-402B-B6A0-0A0BD568EB40}.Release|x64.ActiveCfg = Release|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug|Win32.ActiveCfg = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug|Win32.Build.0 = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug|x64.ActiveCfg = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug64|Win32.ActiveCfg = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug64|Win32.Build.0 = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Debug64|x64.ActiveCfg = Debug|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Release|Any CPU.ActiveCfg = Release|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Release|Mixed Platforms.Build.0 = Release|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Release|Win32.ActiveCfg = Release|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Release|Win32.Build.0 = Release|Win32 - {643E1AC7-594D-4A9C-936D-CC7C7B5D2AE0}.Release|x64.ActiveCfg = Release|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug|Win32.ActiveCfg = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug|Win32.Build.0 = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug|x64.ActiveCfg = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug64|Win32.ActiveCfg = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug64|Win32.Build.0 = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Debug64|x64.ActiveCfg = Debug|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Release|Any CPU.ActiveCfg = Release|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Release|Mixed Platforms.Build.0 = Release|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Release|Win32.ActiveCfg = Release|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Release|Win32.Build.0 = Release|Win32 - {199071F1-5059-4883-BA49-6A9922A71ADD}.Release|x64.ActiveCfg = Release|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug|Win32.ActiveCfg = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug|Win32.Build.0 = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug|x64.ActiveCfg = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug64|Win32.ActiveCfg = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug64|Win32.Build.0 = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Debug64|x64.ActiveCfg = Debug|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Release|Any CPU.ActiveCfg = Release|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Release|Mixed Platforms.Build.0 = Release|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Release|Win32.ActiveCfg = Release|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Release|Win32.Build.0 = Release|Win32 - {70015722-8252-4944-AE20-16A88B583CEE}.Release|x64.ActiveCfg = Release|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug|Win32.ActiveCfg = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug|Win32.Build.0 = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug|x64.ActiveCfg = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug64|Win32.ActiveCfg = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug64|Win32.Build.0 = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Debug64|x64.ActiveCfg = Debug|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Release|Any CPU.ActiveCfg = Release|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Release|Mixed Platforms.Build.0 = Release|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Release|Win32.ActiveCfg = Release|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Release|Win32.Build.0 = Release|Win32 - {52BD46A7-5433-4583-A9C7-E35BC5CCC63B}.Release|x64.ActiveCfg = Release|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug|Win32.ActiveCfg = Debug|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug|Win32.Build.0 = Debug|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug|x64.ActiveCfg = Debug|x64 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug|x64.Build.0 = Debug|x64 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug64|Win32.Build.0 = Debug64|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug64|x64.ActiveCfg = Debug64|x64 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Debug64|x64.Build.0 = Debug64|x64 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release|Any CPU.ActiveCfg = Release|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release|Mixed Platforms.Build.0 = Release|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release|Win32.ActiveCfg = Release|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release|Win32.Build.0 = Release|Win32 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release|x64.ActiveCfg = Release|x64 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F}.Release|x64.Build.0 = Release|x64 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug|Win32.ActiveCfg = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug|Win32.Build.0 = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug|x64.ActiveCfg = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug64|Win32.ActiveCfg = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug64|Win32.Build.0 = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Debug64|x64.ActiveCfg = Debug|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Release|Any CPU.ActiveCfg = Release|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Release|Mixed Platforms.Build.0 = Release|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Release|Win32.ActiveCfg = Release|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Release|Win32.Build.0 = Release|Win32 - {66FF43DF-8075-421D-A338-C651E9F02692}.Release|x64.ActiveCfg = Release|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug|Win32.ActiveCfg = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug|Win32.Build.0 = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug|x64.ActiveCfg = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug64|Win32.ActiveCfg = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug64|Win32.Build.0 = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Debug64|x64.ActiveCfg = Debug|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release|Any CPU.ActiveCfg = Release|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release|Mixed Platforms.Build.0 = Release|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release|Win32.ActiveCfg = Release|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release|Win32.Build.0 = Release|Win32 - {372C0D5E-ED93-4335-849C-65494AE8A17D}.Release|x64.ActiveCfg = Release|Win32 - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Win32.ActiveCfg = Debug|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|x64.ActiveCfg = Debug|x64 - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|x64.Build.0 = Debug|x64 - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug64|Any CPU.ActiveCfg = Debug64|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug64|Any CPU.Build.0 = Debug64|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug64|Mixed Platforms.Build.0 = Debug64|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug64|Win32.ActiveCfg = Debug64|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug64|x64.ActiveCfg = Debug64|x64 - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug64|x64.Build.0 = Debug64|x64 - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Any CPU.Build.0 = Release|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Win32.ActiveCfg = Release|Any CPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|x64.ActiveCfg = Release|x64 - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|x64.Build.0 = Release|x64 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug|Win32.Build.0 = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug|x64.ActiveCfg = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug64|Win32.ActiveCfg = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug64|Win32.Build.0 = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Debug64|x64.ActiveCfg = Debug|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release|Any CPU.ActiveCfg = Release|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release|Mixed Platforms.Build.0 = Release|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release|Win32.ActiveCfg = Release|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release|Win32.Build.0 = Release|Win32 - {39599EFE-428F-408F-BF4F-BF462E37C5E8}.Release|x64.ActiveCfg = Release|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug|Win32.ActiveCfg = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug|Win32.Build.0 = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug|x64.ActiveCfg = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug64|Win32.ActiveCfg = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug64|Win32.Build.0 = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Debug64|x64.ActiveCfg = Debug|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release|Any CPU.ActiveCfg = Release|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release|Mixed Platforms.Build.0 = Release|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release|Win32.ActiveCfg = Release|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release|Win32.Build.0 = Release|Win32 - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611}.Release|x64.ActiveCfg = Release|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug|Win32.ActiveCfg = Debug|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug|Win32.Build.0 = Debug|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug|x64.ActiveCfg = Debug|x64 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug|x64.Build.0 = Debug|x64 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug64|Win32.Build.0 = Debug64|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug64|x64.ActiveCfg = Debug64|x64 - {D4387736-0623-4442-A4AC-AF79239F9419}.Debug64|x64.Build.0 = Debug64|x64 - {D4387736-0623-4442-A4AC-AF79239F9419}.Release|Any CPU.ActiveCfg = Release|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Release|Mixed Platforms.Build.0 = Release|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Release|Win32.ActiveCfg = Release|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Release|Win32.Build.0 = Release|Win32 - {D4387736-0623-4442-A4AC-AF79239F9419}.Release|x64.ActiveCfg = Release|x64 - {D4387736-0623-4442-A4AC-AF79239F9419}.Release|x64.Build.0 = Release|x64 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug|Win32.ActiveCfg = Debug|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug|Win32.Build.0 = Debug|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug|x64.ActiveCfg = Debug|x64 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug|x64.Build.0 = Debug|x64 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug64|Any CPU.ActiveCfg = Debug64|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug64|Mixed Platforms.ActiveCfg = Debug64|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug64|Mixed Platforms.Build.0 = Debug64|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug64|Win32.ActiveCfg = Debug64|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug64|Win32.Build.0 = Debug64|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug64|x64.ActiveCfg = Debug64|x64 - {683AECBB-89EB-4692-99C5-A527853326D4}.Debug64|x64.Build.0 = Debug64|x64 - {683AECBB-89EB-4692-99C5-A527853326D4}.Release|Any CPU.ActiveCfg = Release|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Release|Mixed Platforms.Build.0 = Release|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Release|Win32.ActiveCfg = Release|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Release|Win32.Build.0 = Release|Win32 - {683AECBB-89EB-4692-99C5-A527853326D4}.Release|x64.ActiveCfg = Release|x64 - {683AECBB-89EB-4692-99C5-A527853326D4}.Release|x64.Build.0 = Release|x64 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug|Win32.ActiveCfg = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug|Win32.Build.0 = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug|x64.ActiveCfg = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug64|Win32.ActiveCfg = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug64|Win32.Build.0 = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Debug64|x64.ActiveCfg = Debug|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release|Any CPU.ActiveCfg = Release|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release|Mixed Platforms.Build.0 = Release|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release|Win32.ActiveCfg = Release|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release|Win32.Build.0 = Release|Win32 - {01D3F1DE-99B3-4D41-97C3-F4680CDB980B}.Release|x64.ActiveCfg = Release|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug|Win32.ActiveCfg = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug|Win32.Build.0 = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug|x64.ActiveCfg = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug64|Win32.ActiveCfg = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug64|Win32.Build.0 = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Debug64|x64.ActiveCfg = Debug|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release|Any CPU.ActiveCfg = Release|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release|Mixed Platforms.Build.0 = Release|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release|Win32.ActiveCfg = Release|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release|Win32.Build.0 = Release|Win32 - {51D11C21-C4A7-4F07-9658-B8BA223684B8}.Release|x64.ActiveCfg = Release|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug|Win32.ActiveCfg = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug|Win32.Build.0 = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug|x64.ActiveCfg = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug64|Any CPU.ActiveCfg = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug64|Mixed Platforms.ActiveCfg = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug64|Mixed Platforms.Build.0 = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug64|Win32.ActiveCfg = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug64|Win32.Build.0 = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Debug64|x64.ActiveCfg = Debug|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release|Any CPU.ActiveCfg = Release|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release|Mixed Platforms.Build.0 = Release|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release|Win32.ActiveCfg = Release|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release|Win32.Build.0 = Release|Win32 - {358586C9-A4B8-43E4-8376-59C68F0F6211}.Release|x64.ActiveCfg = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB} = {5CAA3396-61F9-4079-8A0A-59AD9D3B1219} - {39599EFE-428F-408F-BF4F-BF462E37C5E8} = {C47DF7F6-0F37-48E3-B510-3E021EBE6BF5} - {C77ADBF7-E610-4E57-BE4D-C122FC5BE611} = {C47DF7F6-0F37-48E3-B510-3E021EBE6BF5} - EndGlobalSection -EndGlobal diff --git a/README.linux b/README.linux new file mode 100644 index 0000000..e6ca8ee --- /dev/null +++ b/README.linux @@ -0,0 +1,4 @@ +1. modify conf.sh according to your setting +2. source ~/.conf.sh +3. make clean && make +4. run CPP_TEST diff --git a/README.md b/README.md index 9f12bf7..408f82d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -# QuantBox_XAPI 统一行情交易接口 +# XAPI统一行情交易接口 + +## 交流QQ群 +XAPI统一行情交易接口 377319643
+XAPI标准委员会 142703128(需邀请,用于高手进行标准的制定) ##介绍 现在市场上的交易与行情API太多,对每家都接特别麻烦,如果能统一用一套API接入就好了。
@@ -10,40 +14,49 @@ 实现统一的结构体必然会有些API的特殊字段没法照顾到;调用方式统一则有些功能将不会实现,而有些功能需要几个请求,或本机模拟的方法来实现;加载方式以前C#层是用的P/Invoke,现在改用LoadLibraryEx/dlopen来实现。 -## 如何使用C#版 -编译QuantBox.XAPI,有两种输出方式 - -1. 生成QuantBox.XAPI.dll,设置输出类型为类库,可以在其它项目中引用 -2. 生成QuantBox.XAPI.exe,设置输出类型为控制台程序,将运行项目中的Program.cs文件,是API的使用示例 - -### 在Windows .Net项目中使用 -1. 使用Visual Studio 2013打开QuantBox\_XAPI\_Windows.sln进行编译,会生成 -> **QuantBox\.XAPI\.dll**:C#接口,由它进行C接口的加载
-> **QuantBox\_Queue.dll**:C接口,消息队列,行情与交易的数据先进入队列然后,由内部的线程进行触发
-> **QuantBox\_CTP\_Quote.dll**:C接口,调用CTP的行情API
-> **QuantBox\_CTP\_Trade.dll**:C接口,调用CTP的交易API
-> 其它如XSpeed/LTS等行情与交易接口 - -### 在Linux Mono项目中使用 -1. 使用Mono Develop打开QuantBox\_XAPI\_CSharp\_Linux.sln进行编译,会生成 -> **QuantBox\.XAPI\.dll**:C#接口,由它进行C接口的加载 - -2. 使用Code::Blocks打开QuantBox\_XAPI\_C\_Linux.workspace进行编译,注意得使用Clang编译器,会生成 -> **libQuantBox\_Queue.so**:C接口,消息队列,行情与交易的数据先进入队列然后,由内部的线程进行触发
-> **libQuantBox\_CTP\_Quote.so**:C接口,调用CTP的行情API
-> **libQuantBox\_CTP\_Trade.so**:C接口,调用CTP的交易API
-> 其它如XSpeed/LTS等行情与交易接口 - -3. 将所有生成的lib*.so文件cp命令复制到/usr/lib下 - -4. 将CTP的两个文件\*.so前面加lib复制到/usr/lib下 - -## 如何使用C++版 -直接参考QuantBox_XAPI_TEST项目即可,简单的行情订阅,下单撤单 - -## 如何使用C版 -参考QuantBox_XAPI这个项目中的CXApi与CXSpi是如何实现的 +##目录结构 +1. **apis**:各种行情交易API的XAPI封装代码 +2. **bin**:各项目的编译输出路径 +3. **common**:一些通用库 +4. **include**:各种头文件,或API的接口 +5. **lib**:各种库文件 +6. **languages**:各种语言的XAPI封装 +7. **tests**:测试代码 +8. **tools**:一些小工具。如FakeAPI用来获取CTP/LTS客户端授权码,请看项目中的READEME.md + +## 编译XAPI +1. 打开AllCppProjects.sln +2. common\Queue是每个API封装都依赖它的处理消息队列的库,有64位和32位版。所以在部署时可以放在System32或SysWOW64下。或放在客户端程序的exe同目录下,或放在每个API封装库的同目录下。 +3. apis\CTP_Quote等一类的项目,是对应的API的封装。编译好后还需要将API官方的库复制到同目录,你可以直接运行CopyApiDll.bat将依赖的dll复制到bin对应的目录下 +4. 有些项目需要使用到一些授权库的功能common\License,比如说apis\CTP_Trade,直接编译你会发现编译不过,这是因用到的第三方的库文件太大,我在提交代码时提交的是zip。你需要先解压include/cryptopp.zip和lib/cryptlib.zip。你也可在项目属性中去掉**ENABLE\_LICENSE**,这样授权功能模块将不参与编译。具体的方式是,哪个项目编译的时候,报关于randpool.h的错误,就在哪个项目的属性Configuration Properties -> C/C++ -> Preprossor中找到**ENABLE\_LICENSE**,然后去掉它。 + +## 编译各种语言封装 +### C/C++版 +languages\CPP\XAPI\_CPP,直接编译即可。会生成XAPI_CPP.dll,内置了C和C++两种调用方式。tests\CPP中提供了C++版接口的调用示例。所要用到的头文件是include/XApiCpp.h,它的调用的机制模仿了CTP,使用CXApi和CXSpi.
+如想使用C版接口,可参考CXApi与CXSpi是如何实现的,直接使用include/XApiC.h头文件 + +### C/C++ Linux版 +1. 使用Code::Blocks打开*.workspace进行编译,注意得使用Clang编译器,会生成so文件 +2. 将所有生成的lib*.so文件cp命令复制到/usr/lib下 +3. 将CTP的两个文件\*.so前面加lib复制到/usr/lib下 + +### C#版 +languages\CSharp\XAPI\_CSharp.sln +
编译后会生成XAPI\_CSharp.dll,这个项目支持COM功能,所以在编译时会进行COM注册。这个注册需要VS以管理员权限运行。如果你不想使用COM功能,也不想切换到管理员进行注册,可以在项目属性页中的Build->Register for COM interop前的勾去了。 +
+编译XAPI_CSharp,有两种输出方式 + +1. 生成XAPI_CSharp.dll,设置输出类型为类库,可以在其它项目中引用 +2. 生成XAPI_CSharp.exe,设置输出类型为控制台程序,将运行项目中的Program.cs文件,是API的使用示例 + +### MATLAB版 +实际上是调用的C#版的库,细节请参考languages\MATLAB下的readme.md + +### COM版 +其实也是用的C#版的库,注册好后直接到tests\COM下运行示例即可 + +## 部署 +bin/Debug/x86下会编译一些库,运行CopyApiDll.bat复制一些API官方的库进来,然后再运行clearBin.bat将编译时的一些多余文件清理。在目标机器或客户端下新建XAPI文件夹,将x86文件夹复制到此。注意Queue\_x86.dll一定要放在合适的位置,实在搞不清就放在与CTP\_Quote\_x86.dll这些库在同一个目录下。 ## 如何开发新的接口 1. 模仿已经提供的几个项目即可 - diff --git a/apis/CTP/Makefile b/apis/CTP/Makefile new file mode 100644 index 0000000..e3cd3cc --- /dev/null +++ b/apis/CTP/Makefile @@ -0,0 +1,13 @@ +ALL=libQuantBox_CTP_Quote.so libQuantBox_CTP_Trade.so +include ../../Makefile.global + +DEPS=../../include/toolkit.o \ + ../../include/ApiProcess.o + +LFLAGS=-Wl,-rpath,\$$ORIGIN -ldl -L../../include/CTP/linux64 -L../../common/Queue -lQueue + +libQuantBox_CTP_Quote.so: Quote/main.cpp Quote/MdUserApi.cpp TypeConvert.cpp $(DEPS) + $(CXX) --shared $(IFLAGS) $(LFLAGS) $(CFLAGS) -lthostmduserapi -I../CTP_Quote -o $@ $^ +libQuantBox_CTP_Trade.so: Trade/main.cpp Trade/TraderApi.cpp TypeConvert.cpp $(DEPS) + $(CXX) --shared $(IFLAGS) $(LFLAGS) $(CFLAGS) -lthosttraderapi -I../CTP_Trade -o $@ $^ + diff --git a/QuantBox_CTP_Quote/MdUserApi.cpp b/apis/CTP/Quote/MdUserApi.cpp similarity index 50% rename from QuantBox_CTP_Quote/MdUserApi.cpp rename to apis/CTP/Quote/MdUserApi.cpp index dbe8738..b2171c4 100644 --- a/QuantBox_CTP_Quote/MdUserApi.cpp +++ b/apis/CTP/Quote/MdUserApi.cpp @@ -1,17 +1,17 @@ #include "stdafx.h" #include "MdUserApi.h" -#include "../include/QueueEnum.h" +#include "../../include/QueueEnum.h" -#include "../include/ApiHeader.h" -#include "../include/ApiStruct.h" +#include "../../include/ApiHeader.h" +#include "../../include/ApiStruct.h" -#include "../include/toolkit.h" -#include "../include/ApiProcess.h" -#include "../QuantBox_CTP_Trade/TypeConvert.h" +#include "../../include/toolkit.h" +#include "../../include/ApiProcess.h" +#include "../TypeConvert.h" -#include "../QuantBox_Queue/MsgQueue.h" +#include "../../common/Queue/MsgQueue.h" #ifdef _REMOTE -#include "../QuantBox_Queue/RemoteQueue.h" +#include "../../Queue/RemoteQueue.h" #endif #include @@ -45,11 +45,13 @@ CMdUserApi::CMdUserApi(void) //m_msgQueue->m_bDirectOutput = true; m_remoteQueue = nullptr; + + //m_delete = false; } CMdUserApi::~CMdUserApi(void) { - Disconnect(); + _Disconnect(false); } void CMdUserApi::QueryInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) @@ -60,11 +62,23 @@ void CMdUserApi::QueryInThread(char type, void* pApi1, void* pApi2, double doubl case E_Init: iRet = _Init(); break; - case E_ReqUserLoginField: - iRet = _ReqUserLogin(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - default: - break; + case E_Disconnect: + _Disconnect(true); + // 不再循环 + return; + + } + + if (m_pApi) + { + switch (type) + { + case E_ReqUserLoginField: + iRet = _ReqUserLogin(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + default: + break; + } } if (0 == iRet) @@ -82,14 +96,14 @@ void CMdUserApi::QueryInThread(char type, void* pApi1, void* pApi2, double doubl this_thread::sleep_for(chrono::milliseconds(m_nSleep)); } -void CMdUserApi::Register(void* pCallback,void* pClass) +void CMdUserApi::Register(void* pCallback, void* pClass) { m_pClass = pClass; if (m_msgQueue == nullptr) return; - m_msgQueue_Query->Register((void*)Query,this); - m_msgQueue->Register(pCallback,this); + m_msgQueue_Query->Register((void*)Query, this); + m_msgQueue->Register(pCallback, this); if (pCallback) { m_msgQueue_Query->StartThread(); @@ -110,7 +124,7 @@ ConfigInfoField* CMdUserApi::Config(ConfigInfoField* pConfigInfo) bool CMdUserApi::IsErrorRspInfo(const char* szSource, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { bool bRet = ((pRspInfo) && (pRspInfo->ErrorID != 0)); - if(bRet) + if (bRet) { ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); @@ -118,7 +132,7 @@ bool CMdUserApi::IsErrorRspInfo(const char* szSource, CThostFtdcRspInfoField *pR strcpy(pField->Text, pRspInfo->ErrorMsg); strcpy(pField->Source, szSource); - m_msgQueue->Input_NoCopy(ResponeType::OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); } return bRet; } @@ -159,10 +173,55 @@ int CMdUserApi::_Init() sprintf(pszPath, "%s/%s/%s/Md/%d/", m_szPath.c_str(), m_ServerInfo.BrokerID, m_UserInfo.UserID, rand()); makedirs(pszPath); + // 本来想使用chdir的方法解决Kingstar的证书问题,测试多次发现还是读取的exe目录下 + // 打算使用文件复制的方法来实现, + // 1.先检查证书是否存在,存在就跳过 + // 2.复制,用完要删 +#ifdef KS_COPYFILE + lock_guard cl(m_csMapInstrumentIDs); + + char szExePath[MAX_PATH] = { 0 }; + GetExePath(szExePath); + char szDllPath[MAX_PATH] = { 0 }; + GetDllPathByFunctionName("XRequest", szDllPath); + + char szExistingFileName[MAX_PATH] = { 0 }; + char szNewFileName[MAX_PATH] = { 0 }; + GetNewPathInSameDirectory(szDllPath, KS_LKC_FILENAME, KS_LKC_EXT, szExistingFileName); + GetNewPathInSameDirectory(szExePath, KS_LKC_FILENAME, KS_LKC_EXT, szNewFileName); + + bool bRet = CopyFileA(szExistingFileName, szNewFileName, false); + + if (!bRet) + { + char szBuf[256] = { 0 }; + LPVOID lpMsgBuf; + DWORD dw = GetLastError(); + FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + dw, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&lpMsgBuf, + 0, NULL); + + LogField* pField = (LogField*)m_msgQueue->new_block(sizeof(LogField)); + + sprintf(pField->Message, "CopyFile:%s", lpMsgBuf); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnLog, m_msgQueue, m_pClass, true, 0, pField, sizeof(LogField), nullptr, 0, nullptr, 0); + } +#endif // KS_COPYFILE + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); + +#ifdef CreateFtdcMdApi_argc_3 m_pApi = CThostFtdcMdApi::CreateFtdcMdApi(pszPath, m_ServerInfo.IsUsingUdp, m_ServerInfo.IsMulticast); - delete[] pszPath; +#else + m_pApi = CThostFtdcMdApi::CreateFtdcMdApi(pszPath, m_ServerInfo.IsUsingUdp); +#endif // CreateFtdcMdApi_argc_3 - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); + delete[] pszPath; if (m_pApi) { @@ -176,7 +235,7 @@ int CMdUserApi::_Init() char* token = strtok(buf, _QUANTBOX_SEPS_); while (token) { - if (strlen(token)>0) + if (strlen(token) > 0) { m_pApi->RegisterFront(token); } @@ -186,8 +245,24 @@ int CMdUserApi::_Init() //初始化连接 m_pApi->Init(); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); } + else + { + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + + pField->RawErrorID = 0; + strncpy(pField->Text, "(Api==null)", sizeof(Char256Type)); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } + +#ifdef KS_COPYFILE + if (bRet) + { + DeleteFileA(szNewFileName); + } +#endif // KS_COPYFILE return 0; } @@ -206,31 +281,54 @@ void CMdUserApi::ReqUserLogin() int CMdUserApi::_ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); return m_pApi->ReqUserLogin((CThostFtdcReqUserLoginField*)ptr1, ++m_lRequestID); } void CMdUserApi::Disconnect() { + _Disconnect(false); +} + +void CMdUserApi::_DisconnectInThread() +{ + m_msgQueue_Query->Input_NoCopy(RequestType::E_Disconnect, m_msgQueue_Query, this, 0, 0, + nullptr, 0, nullptr, 0, nullptr, 0); +} + +void CMdUserApi::_Disconnect(bool IsInQueue) +{ + //if (m_delete) + // return; + + //m_delete = true; + // 清理查询队列 - if (m_msgQueue_Query) + if (IsInQueue) { - m_msgQueue_Query->StopThread(); - m_msgQueue_Query->Register(nullptr,nullptr); - m_msgQueue_Query->Clear(); - delete m_msgQueue_Query; - m_msgQueue_Query = nullptr; + + } + else + { + if (m_msgQueue_Query) + { + m_msgQueue_Query->StopThread(); + m_msgQueue_Query->Register(nullptr, nullptr); + m_msgQueue_Query->Clear(); + delete m_msgQueue_Query; + m_msgQueue_Query = nullptr; + } } - if(m_pApi) + if (m_pApi) { - m_pApi->RegisterSpi(NULL); + m_pApi->RegisterSpi(nullptr); m_pApi->Release(); - m_pApi = NULL; + m_pApi = nullptr; // 全清理,只留最后一个 m_msgQueue->Clear(); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); // 主动触发 m_msgQueue->Process(); } @@ -239,7 +337,7 @@ void CMdUserApi::Disconnect() if (m_msgQueue) { m_msgQueue->StopThread(); - m_msgQueue->Register(nullptr,nullptr); + m_msgQueue->Register(nullptr, nullptr); m_msgQueue->Clear(); delete m_msgQueue; m_msgQueue = nullptr; @@ -257,9 +355,9 @@ void CMdUserApi::Disconnect() } -void CMdUserApi::Subscribe(const string& szInstrumentIDs, const string& szExchageID) +void CMdUserApi::Subscribe(const string& szInstrumentIDs, const string& szExchangeID) { - if(nullptr == m_pApi) + if (nullptr == m_pApi) return; vector vct; @@ -268,98 +366,29 @@ void CMdUserApi::Subscribe(const string& szInstrumentIDs, const string& szExchag lock_guard cl(m_csMapInstrumentIDs); char* pBuf = GetSetFromString(szInstrumentIDs.c_str(), _QUANTBOX_SEPS_, vct, st, 1, m_setInstrumentIDs); - if(vct.size()>0) + if (vct.size() > 0) { //转成字符串数组 char** pArray = new char*[vct.size()]; - for (size_t j = 0; jSubscribeMarketData(pArray,(int)vct.size()); +#ifdef SubscribeMarketData_argc_2 + m_pApi->SubscribeMarketData(pArray, (int)vct.size()); +#else + m_pApi->SubscribeMarketData(pArray, (int)vct.size(), (char*)szExchangeID.c_str()); +#endif // SubscribeMarketData_argc_2 - delete[] pArray; - } - delete[] pBuf; -} - -void CMdUserApi::Subscribe(const set& instrumentIDs, const string& szExchageID) -{ - if(nullptr == m_pApi) - return; - - string szInstrumentIDs; - for(set::iterator i=instrumentIDs.begin();i!=instrumentIDs.end();++i) - { - szInstrumentIDs.append(*i); - szInstrumentIDs.append(";"); - } - - if (szInstrumentIDs.length()>1) - { - Subscribe(szInstrumentIDs, szExchageID); - } -} - -void CMdUserApi::Unsubscribe(const string& szInstrumentIDs, const string& szExchageID) -{ - if(nullptr == m_pApi) - return; - - vector vct; - set st; - - lock_guard cl(m_csMapInstrumentIDs); - char* pBuf = GetSetFromString(szInstrumentIDs.c_str(), _QUANTBOX_SEPS_, vct, st, -1, m_setInstrumentIDs); - - if(vct.size()>0) - { - //转成字符串数组 - char** pArray = new char*[vct.size()]; - for (size_t j = 0; jUnSubscribeMarketData(pArray,(int)vct.size()); - - delete[] pArray; - } - delete[] pBuf; -} - -void CMdUserApi::SubscribeQuote(const string& szInstrumentIDs, const string& szExchageID) -{ - if (nullptr == m_pApi) - return; - - vector vct; - set st; - - lock_guard cl(m_csMapQuoteInstrumentIDs); - char* pBuf = GetSetFromString(szInstrumentIDs.c_str(), _QUANTBOX_SEPS_, vct, st, 1, m_setQuoteInstrumentIDs); - - if (vct.size()>0) - { - //转成字符串数组 - char** pArray = new char*[vct.size()]; - for (size_t j = 0; jSubscribeForQuoteRsp(pArray, (int)vct.size()); delete[] pArray; } delete[] pBuf; } -void CMdUserApi::SubscribeQuote(const set& instrumentIDs, const string& szExchageID) +void CMdUserApi::Subscribe(const set& instrumentIDs, const string& szExchangeID) { if (nullptr == m_pApi) return; @@ -371,13 +400,13 @@ void CMdUserApi::SubscribeQuote(const set& instrumentIDs, const string& szInstrumentIDs.append(";"); } - if (szInstrumentIDs.length()>1) + if (szInstrumentIDs.length() > 1) { - SubscribeQuote(szInstrumentIDs, szExchageID); + Subscribe(szInstrumentIDs, szExchangeID); } } -void CMdUserApi::UnsubscribeQuote(const string& szInstrumentIDs, const string& szExchageID) +void CMdUserApi::Unsubscribe(const string& szInstrumentIDs, const string& szExchangeID) { if (nullptr == m_pApi) return; @@ -385,29 +414,35 @@ void CMdUserApi::UnsubscribeQuote(const string& szInstrumentIDs, const string& s vector vct; set st; - lock_guard cl(m_csMapQuoteInstrumentIDs); - char* pBuf = GetSetFromString(szInstrumentIDs.c_str(), _QUANTBOX_SEPS_, vct, st, -1, m_setQuoteInstrumentIDs); + lock_guard cl(m_csMapInstrumentIDs); + char* pBuf = GetSetFromString(szInstrumentIDs.c_str(), _QUANTBOX_SEPS_, vct, st, -1, m_setInstrumentIDs); - if (vct.size()>0) + if (vct.size() > 0) { //转成字符串数组 char** pArray = new char*[vct.size()]; - for (size_t j = 0; jUnSubscribeForQuoteRsp(pArray, (int)vct.size()); +#ifdef SubscribeMarketData_argc_2 + m_pApi->UnSubscribeMarketData(pArray, (int)vct.size()); +#else + m_pApi->UnSubscribeMarketData(pArray, (int)vct.size(), (char*)szExchangeID.c_str()); +#endif // SubscribeMarketData_argc_2 delete[] pArray; } delete[] pBuf; } + + void CMdUserApi::OnFrontConnected() { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); //连接成功后自动请求登录 ReqUserLogin(); @@ -420,7 +455,10 @@ void CMdUserApi::OnFrontDisconnected(int nReason) pField->RawErrorID = nReason; GetOnFrontDisconnectedMsg(nReason, pField->Text); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + + // 断开连接 + _DisconnectInThread(); } void CMdUserApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) @@ -428,32 +466,39 @@ void CMdUserApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CTho RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); if (!IsErrorRspInfo(pRspInfo) - &&pRspUserLogin) + && pRspUserLogin) { +#ifdef HAS_TradingDay_UserLogin pField->TradingDay = GetDate(pRspUserLogin->TradingDay); +#endif // HAS_TradingDay_UserLogin pField->LoginTime = GetTime(pRspUserLogin->LoginTime); m_TradingDay = pField->TradingDay; sprintf(pField->SessionID, "%d:%d", pRspUserLogin->FrontID, pRspUserLogin->SessionID); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); //有可能断线了,本处是断线重连后重新订阅 set mapOld = m_setInstrumentIDs;//记下上次订阅的合约 //Unsubscribe(mapOld);//由于已经断线了,没有必要再取消订阅 - Subscribe(mapOld,"");//订阅 + Subscribe(mapOld, "");//订阅 //有可能断线了,本处是断线重连后重新订阅 mapOld = m_setQuoteInstrumentIDs;//记下上次订阅的合约 +#ifdef HAS_Quote SubscribeQuote(mapOld, "");//订阅 +#endif // HAS_Quote } else { pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + + // 断开连接 + _DisconnectInThread(); } } @@ -465,8 +510,8 @@ void CMdUserApi::OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bo void CMdUserApi::OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { //在模拟平台可能这个函数不会触发,所以要自己维护一张已经订阅的合约列表 - if(!IsErrorRspInfo("OnRspSubMarketData",pRspInfo,nRequestID,bIsLast) - &&pSpecificInstrument) + if (!IsErrorRspInfo("OnRspSubMarketData", pRspInfo, nRequestID, bIsLast) + && pSpecificInstrument) { lock_guard cl(m_csMapInstrumentIDs); @@ -477,8 +522,8 @@ void CMdUserApi::OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecific void CMdUserApi::OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { //模拟平台可能这个函数不会触发 - if(!IsErrorRspInfo("OnRspUnSubMarketData",pRspInfo,nRequestID,bIsLast) - &&pSpecificInstrument) + if (!IsErrorRspInfo("OnRspUnSubMarketData", pRspInfo, nRequestID, bIsLast) + && pSpecificInstrument) { lock_guard cl(m_csMapInstrumentIDs); @@ -494,127 +539,205 @@ void CMdUserApi::OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMark // // 测试平台穿越速度,用完后需要注释掉 // WriteLog("CTP:OnRtnDepthMarketData:%s %f %s.%03d", pDepthMarketData->InstrumentID, pDepthMarketData->LastPrice, pDepthMarketData->UpdateTime, pDepthMarketData->UpdateMillisec); - DepthMarketDataNField* pField = (DepthMarketDataNField*)m_msgQueue->new_block(sizeof(DepthMarketDataNField)+sizeof(DepthField)* 10); + DepthMarketDataNField* pField = (DepthMarketDataNField*)m_msgQueue->new_block(sizeof(DepthMarketDataNField) + sizeof(DepthField) * 10); - strcpy(pField->InstrumentID, pDepthMarketData->InstrumentID); - pField->Exchange = TThostFtdcExchangeIDType_2_ExchangeType(pDepthMarketData->ExchangeID); + strcpy(pField->InstrumentID, pDepthMarketData->InstrumentID); + strcpy(pField->ExchangeID, pDepthMarketData->ExchangeID); + pField->Exchange = TThostFtdcExchangeIDType_2_ExchangeType(pDepthMarketData->ExchangeID); - sprintf(pField->Symbol, "%s.%s", pField->InstrumentID, pDepthMarketData->ExchangeID); + sprintf(pField->Symbol, "%s.%s", pField->InstrumentID, pDepthMarketData->ExchangeID); - // 交易时间 - switch (pField->Exchange) - { - case ExchangeType::ExchangeType_DCE: - GetExchangeTime_DCE(pDepthMarketData->TradingDay, pDepthMarketData->ActionDay, pDepthMarketData->UpdateTime - , &pField->TradingDay, &pField->ActionDay, &pField->UpdateTime, &pField->UpdateMillisec); + // 交易时间 + switch (pField->Exchange) + { + case ExchangeType::ExchangeType_DCE: + GetExchangeTime_DCE(pDepthMarketData->TradingDay, pDepthMarketData->ActionDay, pDepthMarketData->UpdateTime + , &pField->TradingDay, &pField->ActionDay, &pField->UpdateTime, &pField->UpdateMillisec); + break; + case ExchangeType::ExchangeType_CZCE: + GetExchangeTime_CZCE(m_TradingDay, pDepthMarketData->TradingDay, pDepthMarketData->ActionDay, pDepthMarketData->UpdateTime + , &pField->TradingDay, &pField->ActionDay, &pField->UpdateTime, &pField->UpdateMillisec); + break; + case ExchangeType::ExchangeType_Undefined: + GetExchangeTime_Undefined(m_TradingDay, pDepthMarketData->TradingDay, pDepthMarketData->ActionDay, pDepthMarketData->UpdateTime + , &pField->TradingDay, &pField->ActionDay, &pField->UpdateTime, &pField->UpdateMillisec); + break; + default: + GetExchangeTime(pDepthMarketData->TradingDay, pDepthMarketData->ActionDay, pDepthMarketData->UpdateTime + , &pField->TradingDay, &pField->ActionDay, &pField->UpdateTime, &pField->UpdateMillisec); + break; + } + + pField->UpdateMillisec = pDepthMarketData->UpdateMillisec; + + pField->LastPrice = pDepthMarketData->LastPrice == DBL_MAX ? 0 : pDepthMarketData->LastPrice; + pField->Volume = pDepthMarketData->Volume; + pField->Turnover = pDepthMarketData->Turnover; + pField->OpenInterest = pDepthMarketData->OpenInterest; + pField->AveragePrice = pDepthMarketData->AveragePrice; + + if (pDepthMarketData->OpenPrice != DBL_MAX) + { + pField->OpenPrice = pDepthMarketData->OpenPrice; + pField->HighestPrice = pDepthMarketData->HighestPrice; + pField->LowestPrice = pDepthMarketData->LowestPrice; + } + else + { + pField->OpenPrice = 0; + pField->HighestPrice = 0; + pField->LowestPrice = 0; + } + pField->SettlementPrice = pDepthMarketData->SettlementPrice != DBL_MAX ? pDepthMarketData->SettlementPrice : 0; + + pField->UpperLimitPrice = pDepthMarketData->UpperLimitPrice; + pField->LowerLimitPrice = pDepthMarketData->LowerLimitPrice; + pField->PreClosePrice = pDepthMarketData->PreClosePrice; + pField->PreSettlementPrice = pDepthMarketData->PreSettlementPrice; + pField->PreOpenInterest = pDepthMarketData->PreOpenInterest; + + InitBidAsk(pField); + + do + { + if (pDepthMarketData->BidVolume1 == 0) break; - case ExchangeType::ExchangeType_CZCE: - GetExchangeTime_CZCE(m_TradingDay, pDepthMarketData->TradingDay, pDepthMarketData->ActionDay, pDepthMarketData->UpdateTime - , &pField->TradingDay, &pField->ActionDay, &pField->UpdateTime, &pField->UpdateMillisec); + AddBid(pField, pDepthMarketData->BidPrice1, pDepthMarketData->BidVolume1, 0); + + if (pDepthMarketData->BidVolume2 == 0) break; - case ExchangeType::ExchangeType_Undefined: - GetExchangeTime_Undefined(m_TradingDay, pDepthMarketData->TradingDay, pDepthMarketData->ActionDay, pDepthMarketData->UpdateTime - , &pField->TradingDay, &pField->ActionDay, &pField->UpdateTime, &pField->UpdateMillisec); + AddBid(pField, pDepthMarketData->BidPrice2, pDepthMarketData->BidVolume2, 0); + + if (pDepthMarketData->BidVolume3 == 0) break; - default: - GetExchangeTime(pDepthMarketData->TradingDay, pDepthMarketData->ActionDay, pDepthMarketData->UpdateTime - , &pField->TradingDay, &pField->ActionDay, &pField->UpdateTime, &pField->UpdateMillisec); + AddBid(pField, pDepthMarketData->BidPrice3, pDepthMarketData->BidVolume3, 0); + + if (pDepthMarketData->BidVolume4 == 0) break; - } + AddBid(pField, pDepthMarketData->BidPrice4, pDepthMarketData->BidVolume4, 0); - pField->UpdateMillisec = pDepthMarketData->UpdateMillisec; + if (pDepthMarketData->BidVolume5 == 0) + break; + AddBid(pField, pDepthMarketData->BidPrice5, pDepthMarketData->BidVolume5, 0); + } while (false); - pField->LastPrice = pDepthMarketData->LastPrice == DBL_MAX ? 0 : pDepthMarketData->LastPrice; - pField->Volume = pDepthMarketData->Volume; - pField->Turnover = pDepthMarketData->Turnover; - pField->OpenInterest = pDepthMarketData->OpenInterest; - pField->AveragePrice = pDepthMarketData->AveragePrice; + do + { + if (pDepthMarketData->AskVolume1 == 0) + break; + AddAsk(pField, pDepthMarketData->AskPrice1, pDepthMarketData->AskVolume1, 0); - if (pDepthMarketData->OpenPrice != DBL_MAX) - { - pField->OpenPrice = pDepthMarketData->OpenPrice; - pField->HighestPrice = pDepthMarketData->HighestPrice; - pField->LowestPrice = pDepthMarketData->LowestPrice; - } - else - { - pField->OpenPrice = 0; - pField->HighestPrice = 0; - pField->LowestPrice = 0; - } - pField->SettlementPrice = pDepthMarketData->SettlementPrice != DBL_MAX ? pDepthMarketData->SettlementPrice : 0; + if (pDepthMarketData->AskVolume2 == 0) + break; + AddAsk(pField, pDepthMarketData->AskPrice2, pDepthMarketData->AskVolume2, 0); - pField->UpperLimitPrice = pDepthMarketData->UpperLimitPrice; - pField->LowerLimitPrice = pDepthMarketData->LowerLimitPrice; - pField->PreClosePrice = pDepthMarketData->PreClosePrice; - pField->PreSettlementPrice = pDepthMarketData->PreSettlementPrice; - pField->PreOpenInterest = pDepthMarketData->PreOpenInterest; + if (pDepthMarketData->AskVolume3 == 0) + break; + AddAsk(pField, pDepthMarketData->AskPrice3, pDepthMarketData->AskVolume3, 0); - InitBidAsk(pField); + if (pDepthMarketData->AskVolume4 == 0) + break; + AddAsk(pField, pDepthMarketData->AskPrice4, pDepthMarketData->AskVolume4, 0); - do - { - if (pDepthMarketData->BidVolume1 == 0) - break; - AddBid(pField, pDepthMarketData->BidPrice1, pDepthMarketData->BidVolume1, 0); + if (pDepthMarketData->AskVolume5 == 0) + break; + AddAsk(pField, pDepthMarketData->AskPrice5, pDepthMarketData->AskVolume5, 0); + } while (false); + + // 这两个队列先头循序不要搞混,有删除功能的语句要放在后面 + // 如果放前面,会导致远程收到乱码 +#ifdef _REMOTE + if (m_remoteQueue) + { + m_remoteQueue->Input_Copy(ResponseType::ResponseType_OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); + } +#endif + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); + // 要关注一下其内的 +//} +} - if (pDepthMarketData->BidVolume2 == 0) - break; - AddBid(pField, pDepthMarketData->BidPrice2, pDepthMarketData->BidVolume2, 0); +#ifdef HAS_Quote - if (pDepthMarketData->BidVolume3 == 0) - break; - AddBid(pField, pDepthMarketData->BidPrice3, pDepthMarketData->BidVolume3, 0); +void CMdUserApi::SubscribeQuote(const string& szInstrumentIDs, const string& szExchangeID) +{ + if (nullptr == m_pApi) + return; - if (pDepthMarketData->BidVolume4 == 0) - break; - AddBid(pField, pDepthMarketData->BidPrice4, pDepthMarketData->BidVolume4, 0); + vector vct; + set st; - if (pDepthMarketData->BidVolume5 == 0) - break; - AddBid(pField, pDepthMarketData->BidPrice5, pDepthMarketData->BidVolume5, 0); - } while (false); + lock_guard cl(m_csMapQuoteInstrumentIDs); + char* pBuf = GetSetFromString(szInstrumentIDs.c_str(), _QUANTBOX_SEPS_, vct, st, 1, m_setQuoteInstrumentIDs); - do + if (vct.size() > 0) + { + //转成字符串数组 + char** pArray = new char*[vct.size()]; + for (size_t j = 0; j < vct.size(); ++j) { - if (pDepthMarketData->AskVolume1 == 0) - break; - AddAsk(pField, pDepthMarketData->AskPrice1, pDepthMarketData->AskVolume1, 0); + pArray[j] = vct[j]; + } - if (pDepthMarketData->AskVolume2 == 0) - break; - AddAsk(pField, pDepthMarketData->AskPrice2, pDepthMarketData->AskVolume2, 0); + //订阅 + m_pApi->SubscribeForQuoteRsp(pArray, (int)vct.size()); - if (pDepthMarketData->AskVolume3 == 0) - break; - AddAsk(pField, pDepthMarketData->AskPrice3, pDepthMarketData->AskVolume3, 0); + delete[] pArray; + } + delete[] pBuf; +} - if (pDepthMarketData->AskVolume4 == 0) - break; - AddAsk(pField, pDepthMarketData->AskPrice4, pDepthMarketData->AskVolume4, 0); +void CMdUserApi::SubscribeQuote(const set& instrumentIDs, const string& szExchangeID) +{ + if (nullptr == m_pApi) + return; - if (pDepthMarketData->AskVolume5 == 0) - break; - AddAsk(pField, pDepthMarketData->AskPrice5, pDepthMarketData->AskVolume5, 0); - } while (false); + string szInstrumentIDs; + for (set::iterator i = instrumentIDs.begin(); i != instrumentIDs.end(); ++i) + { + szInstrumentIDs.append(*i); + szInstrumentIDs.append(";"); + } - // 这两个队列先头循序不要搞混,有删除功能的语句要放在后面 - // 如果放前面,会导致远程收到乱码 -#ifdef _REMOTE - if (m_remoteQueue) + if (szInstrumentIDs.length() > 1) + { + SubscribeQuote(szInstrumentIDs, szExchangeID); + } +} + +void CMdUserApi::UnsubscribeQuote(const string& szInstrumentIDs, const string& szExchangeID) +{ + if (nullptr == m_pApi) + return; + + vector vct; + set st; + + lock_guard cl(m_csMapQuoteInstrumentIDs); + char* pBuf = GetSetFromString(szInstrumentIDs.c_str(), _QUANTBOX_SEPS_, vct, st, -1, m_setQuoteInstrumentIDs); + + if (vct.size() > 0) + { + //转成字符串数组 + char** pArray = new char*[vct.size()]; + for (size_t j = 0; j < vct.size(); ++j) { - m_remoteQueue->Input_Copy(ResponeType::OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); + pArray[j] = vct[j]; } -#endif - m_msgQueue->Input_NoCopy(ResponeType::OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); - // 要关注一下其内的 - //} + //订阅 + m_pApi->UnSubscribeForQuoteRsp(pArray, (int)vct.size()); + + delete[] pArray; + } + delete[] pBuf; } + void CMdUserApi::OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { - if (!IsErrorRspInfo("OnRspSubForQuoteRsp",pRspInfo, nRequestID, bIsLast) + if (!IsErrorRspInfo("OnRspSubForQuoteRsp", pRspInfo, nRequestID, bIsLast) && pSpecificInstrument) { lock_guard cl(m_csMapQuoteInstrumentIDs); @@ -625,7 +748,7 @@ void CMdUserApi::OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecifi void CMdUserApi::OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { - if (!IsErrorRspInfo("OnRspUnSubForQuoteRsp",pRspInfo, nRequestID, bIsLast) + if (!IsErrorRspInfo("OnRspUnSubForQuoteRsp", pRspInfo, nRequestID, bIsLast) && pSpecificInstrument) { lock_guard cl(m_csMapQuoteInstrumentIDs); @@ -647,5 +770,8 @@ void CMdUserApi::OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) sprintf(pField->Symbol, "%s.%s", pField->InstrumentID, pField->ExchangeID); strcpy(pField->QuoteID, pForQuoteRsp->ForQuoteSysID); - m_msgQueue->Input_NoCopy(ResponeType::OnRtnQuoteRequest, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteRequestField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnQuoteRequest, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteRequestField), nullptr, 0, nullptr, 0); } +#endif // HAS_Quote + + diff --git a/QuantBox_CTP_Quote/MdUserApi.h b/apis/CTP/Quote/MdUserApi.h similarity index 74% rename from QuantBox_CTP_Quote/MdUserApi.h rename to apis/CTP/Quote/MdUserApi.h index f3be004..5ee1d1f 100644 --- a/QuantBox_CTP_Quote/MdUserApi.h +++ b/apis/CTP/Quote/MdUserApi.h @@ -1,16 +1,9 @@ -#pragma once +#pragma once -#include "../include/ApiStruct.h" -#include "../include/CTP/ThostFtdcMdApi.h" +#include "../../include/ApiStruct.h" - -#ifdef _WIN64 -#pragma comment(lib, "../include/CTP/win64/thostmduserapi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x64.lib") -#else -#pragma comment(lib, "../include/CTP/win32/thostmduserapi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x86.lib") -#endif +// 由于这个Include.h需要使用每个项目自己的文件,所以需要在VC++ Directories->Include Directories中添加一个"./" +#include "Include.h" #include #include @@ -27,6 +20,7 @@ class CMdUserApi : enum RequestType { E_Init, + E_Disconnect, E_ReqUserLoginField, }; @@ -44,23 +38,28 @@ class CMdUserApi : void Disconnect(); void Subscribe(const string& szInstrumentIDs, const string& szExchangeID); - void Unsubscribe(const string& szInstrumentIDs, const string& szExchageID); + void Unsubscribe(const string& szInstrumentIDs, const string& szExchangeID); - void SubscribeQuote(const string& szInstrumentIDs, const string& szExchageID); - void UnsubscribeQuote(const string& szInstrumentIDs, const string& szExchageID); +#ifdef HAS_Quote + void SubscribeQuote(const string& szInstrumentIDs, const string& szExchangeID); + void UnsubscribeQuote(const string& szInstrumentIDs, const string& szExchangeID); +#endif // HAS_Quote private: friend void* __stdcall Query(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); void QueryInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); int _Init(); - //¼ + void _Disconnect(bool IsInQueue); + void _DisconnectInThread(); + + //登录请求 void ReqUserLogin(); int _ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - // + //订阅行情 void Subscribe(const set& instrumentIDs, const string& szExchangeID); - void SubscribeQuote(const set& instrumentIDs, const string& szExchageID); + void SubscribeQuote(const set& instrumentIDs, const string& szExchangeID); virtual void OnFrontConnected(); virtual void OnFrontDisconnected(int nReason); @@ -71,30 +70,33 @@ class CMdUserApi : virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData); + //检查是否出错 + bool IsErrorRspInfo(const char* szSource, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);//将出错消息送到消息队列 + bool IsErrorRspInfo(CThostFtdcRspInfoField *pRspInfo);//不送出错消息 + +#ifdef HAS_Quote virtual void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp); - - //Ƿ - bool IsErrorRspInfo(const char* szSource, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);//Ϣ͵Ϣ - bool IsErrorRspInfo(CThostFtdcRspInfoField *pRspInfo);//ͳϢ +#endif // HAS_Quote private: + //bool m_delete; mutex m_csMapInstrumentIDs; mutex m_csMapQuoteInstrumentIDs; - atomic m_lRequestID; //IDÿǰ + atomic m_lRequestID; //请求ID,每次请求前自增 - set m_setInstrumentIDs; //ڶĵĺԼ - set m_setQuoteInstrumentIDs; //ڶĵĺԼ - CThostFtdcMdApi* m_pApi; //API + set m_setInstrumentIDs; //正在订阅的合约 + set m_setQuoteInstrumentIDs; //正在订阅的合约 + CThostFtdcMdApi* m_pApi; //行情API - string m_szPath; //ļ· + string m_szPath; //生成配置文件的路径 ServerInfoField m_ServerInfo; UserInfoField m_UserInfo; int m_nSleep; - CMsgQueue* m_msgQueue; //Ϣָ + CMsgQueue* m_msgQueue; //消息队列指针 CMsgQueue* m_msgQueue_Query; void* m_pClass; diff --git a/QuantBox_CTP_Quote/main.cpp b/apis/CTP/Quote/main.cpp similarity index 66% rename from QuantBox_CTP_Quote/main.cpp rename to apis/CTP/Quote/main.cpp index 80628cf..8a641d1 100644 --- a/QuantBox_CTP_Quote/main.cpp +++ b/apis/CTP/Quote/main.cpp @@ -1,9 +1,11 @@ #include "stdafx.h" -#include "../include/ApiHeader.h" +#include "../../include/ApiHeader.h" +#include "../../include/QueueEnum.h" -#include "../include/QueueEnum.h" #include "MdUserApi.h" +#include "Include.h" + inline CMdUserApi* GetApi(void* pApi) { return static_cast(pApi); @@ -14,13 +16,13 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do RequestType rt = (RequestType)type; switch (rt) { - case GetApiType: + case RequestType_GetApiTypes: return (void*)(ApiType::ApiType_MarketData | ApiType::ApiType_QuoteRequest); - case GetApiVersion: - return (void*)"0.2.0.20150226"; - case GetApiName: - return (void*)"CTP"; - case Create: + case RequestType_GetApiVersion: + return (void*)API_VERSION; + case RequestType_GetApiName: + return (void*)API_NAME; + case RequestType_Create: return new CMdUserApi(); default: break; @@ -35,32 +37,36 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do switch (rt) { - case Release: + case RequestType_Release: delete pApi; return 0; - case Register: + case RequestType_Register: pApi->Register(ptr1,ptr2); break; - case Config: + case RequestType_Config: return (void*)pApi->Config((ConfigInfoField*)ptr1); - case Connect: + case RequestType_Connect: pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2,size2); break; - case Disconnect: + case RequestType_Disconnect: pApi->Disconnect(); break; - case Subscribe: + case RequestType_Subscribe: pApi->Subscribe((const char*)ptr1, (const char*)ptr2); break; - case Unsubscribe: + case RequestType_Unsubscribe: pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); break; - case SubscribeQuote: + +#if HAS_Quote + case RequestType_SubscribeQuote: pApi->SubscribeQuote((const char*)ptr1, (const char*)ptr2); break; - case UnsubscribeQuote: + case RequestType_UnsubscribeQuote: pApi->UnsubscribeQuote((const char*)ptr1, (const char*)ptr2); break; +#endif // HAS_Quote + default: break; } diff --git a/apis/CTP/README.md b/apis/CTP/README.md new file mode 100644 index 0000000..48ecfe3 --- /dev/null +++ b/apis/CTP/README.md @@ -0,0 +1,8 @@ +# CTP兼容统一封装 + +##介绍 +Kingstar\UFT\XSpeed都有CTP兼容的接口,所以将公共部分写一起,应当以后要移植就更快了 + +##操作 +每个项目有自己特殊的Inluce.h,然后再设置Include目录即可 + diff --git a/QuantBox_CTP_Trade/TraderApi.cpp b/apis/CTP/Trade/TraderApi.cpp similarity index 62% rename from QuantBox_CTP_Trade/TraderApi.cpp rename to apis/CTP/Trade/TraderApi.cpp index 12355c7..2b40664 100644 --- a/QuantBox_CTP_Trade/TraderApi.cpp +++ b/apis/CTP/Trade/TraderApi.cpp @@ -1,21 +1,31 @@ #include "stdafx.h" #include "TraderApi.h" -#include "../include/QueueEnum.h" -#include "../include/QueueHeader.h" +#include "../../include/QueueEnum.h" +#include "../../include/QueueHeader.h" -#include "../include/ApiHeader.h" -#include "../include/ApiStruct.h" +#include "../../include/ApiHeader.h" +#include "../../include/ApiStruct.h" -#include "../include/toolkit.h" +#include "../../include/toolkit.h" + +#include "../../common/Queue/MsgQueue.h" + +#include "../CTP/TypeConvert.h" -#include "../QuantBox_Queue/MsgQueue.h" -#include "TypeConvert.h" #include #include #include +#if defined(_MSC_VER) || defined(_WIN32) +#include +#endif + +#ifdef ENABLE_LICENSE +#include "../../common/License/License.h" +#endif + void* __stdcall Query(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { @@ -33,42 +43,62 @@ void CTraderApi::QueryInThread(char type, void* pApi1, void* pApi2, double doubl case E_Init: iRet = _Init(); break; - case E_ReqAuthenticateField: - iRet = _ReqAuthenticate(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_ReqUserLoginField: - iRet = _ReqUserLogin(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_SettlementInfoConfirmField: - iRet = _ReqSettlementInfoConfirm(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; + case E_Disconnect: + _Disconnect(true); + // 不再循环 + return; + } - case QueryType::ReqQryTradingAccount: - iRet = _ReqQryTradingAccount(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case QueryType::ReqQryInvestorPosition : - iRet = _ReqQryInvestorPosition(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case QueryType::ReqQryInstrument : - iRet = _ReqQryInstrument(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case QueryType::ReqQryInvestor : - iRet = _ReqQryInvestor(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case QueryType::ReqQryOrder : - iRet = _ReqQryOrder(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case QueryType::ReqQryTrade: - iRet = _ReqQryTrade(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case QueryType::ReqQryQuote: - iRet = _ReqQryQuote(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case QueryType::ReqQrySettlementInfo: - iRet = _ReqQrySettlementInfo(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - default: - break; + if (m_pApi) + { + switch (type) + { + case E_ReqAuthenticateField: + iRet = _ReqAuthenticate(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case E_ReqUserLoginField: + iRet = _ReqUserLogin(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case E_UserLogoutField: + iRet = _ReqUserLogout(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryTradingAccount: + iRet = _ReqQryTradingAccount(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryInvestorPosition: + iRet = _ReqQryInvestorPosition(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryInstrument: + iRet = _ReqQryInstrument(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryInvestor: + iRet = _ReqQryInvestor(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryOrder: + iRet = _ReqQryOrder(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryTrade: + iRet = _ReqQryTrade(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + +#ifdef HAS_Quote + case QueryType::QueryType_ReqQryQuote: + iRet = _ReqQryQuote(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; +#endif // HAS_Quote + +#ifdef HAS_Settlement + case E_SettlementInfoConfirmField: + iRet = _ReqSettlementInfoConfirm(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQrySettlementInfo: + iRet = _ReqQrySettlementInfo(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; +#endif // HAS_Settlement + + default: + break; + } } if (0 == iRet) @@ -92,8 +122,8 @@ void CTraderApi::Register(void* pCallback, void* pClass) if (m_msgQueue == nullptr) return; - m_msgQueue_Query->Register((void*)Query,this); - m_msgQueue->Register(pCallback,this); + m_msgQueue_Query->Register((void*)Query, this); + m_msgQueue->Register(pCallback, this); if (pCallback) { m_msgQueue_Query->StartThread(); @@ -116,14 +146,38 @@ CTraderApi::CTraderApi(void) m_msgQueue = new CMsgQueue(); m_msgQueue_Query = new CMsgQueue(); - m_msgQueue_Query->Register((void*)Query,this); + m_msgQueue_Query->Register((void*)Query, this); m_msgQueue_Query->StartThread(); + +#ifdef ENABLE_LICENSE + // 为了这个加密库,居然把编译选项由/MDd改成了/MTd,以后一定要想办法改回去 + m_pLicense = new CLicense(); + + char szPath[MAX_PATH] = { 0 }; + m_pLicense->GetDllPathByFunctionName("XRequest", szPath); + m_pLicense->SetLicensePath(szPath); + // 这里选的是从文件中加载公钥,可以写死到资源或代码中,这样用户就没有那么容易自己生成公私钥对替换了 + m_pLicense->SetPublicKeyString(DLL_PUBLIC_KEY); + + string signatureString = m_pLicense->LoadStringFromFile(m_pLicense->m_SignaturePath); + m_pLicense->SetSignatureString(signatureString.c_str()); +#endif + + //m_delete = false; } CTraderApi::~CTraderApi(void) { - Disconnect(); + _Disconnect(false); + +#ifdef ENABLE_LICENSE + if (m_pLicense == nullptr) + { + delete m_pLicense; + m_pLicense = nullptr; + } +#endif } bool CTraderApi::IsErrorRspInfo(const char* szSource, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) @@ -137,7 +191,7 @@ bool CTraderApi::IsErrorRspInfo(const char* szSource, CThostFtdcRspInfoField *pR strcpy(pField->Text, pRspInfo->ErrorMsg); strcpy(pField->Source, szSource); - m_msgQueue->Input_NoCopy(ResponeType::OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); } return bRet; } @@ -164,16 +218,107 @@ void CTraderApi::Connect(const string& szPath, int CTraderApi::_Init() { +#ifdef ENABLE_LICENSE + int err = m_pLicense->LoadIni(); + if (err != 0) + { + // 没有授权文件 + m_pLicense->CreateDefault(); + m_pLicense->AddUser(m_UserInfo.UserID, "*"); + err = m_pLicense->SaveIni(); + } + + if (err == 0) + { + err = m_pLicense->GetErrorCodeForMachineID(); + } + + if (err == 0) + { + err = m_pLicense->GetErrorCodeByAccount(m_UserInfo.UserID); + } + + if (err == 0) + { + err = m_pLicense->GetErrorCodeForSign(); + } + + if (err == 0) + { + err = m_pLicense->GetErrorCodeForExpireDate(); + } + + if (err != 0) + { + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + + pField->RawErrorID = err; + strncpy(pField->Text, m_pLicense->GetErrorInfo(), sizeof(Char256Type)); + + // >0的错误表示不严重,可以继续 + if (err > 0) + { + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } + else if (err < 0) + { + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + return 0; + } + } +#endif + char *pszPath = new char[m_szPath.length() + 1024]; srand((unsigned int)time(nullptr)); sprintf(pszPath, "%s/%s/%s/Td/%d/", m_szPath.c_str(), m_ServerInfo.BrokerID, m_UserInfo.UserID, rand()); makedirs(pszPath); + + // 本来想使用chdir的方法解决Kingstar的证书问题,测试多次发现还是读取的exe目录下 + // 打算使用文件复制的方法来实现, + // 1.先检查证书是否存在,存在就跳过 + // 2.复制,用完要删 +#ifdef KS_COPYFILE + lock_guard cl(m_csOrderRef); + + char szExePath[MAX_PATH] = { 0 }; + GetExePath(szExePath); + char szDllPath[MAX_PATH] = { 0 }; + GetDllPathByFunctionName("XRequest", szDllPath); + + char szExistingFileName[MAX_PATH] = { 0 }; + char szNewFileName[MAX_PATH] = { 0 }; + GetNewPathInSameDirectory(szDllPath, KS_LKC_FILENAME, KS_LKC_EXT, szExistingFileName); + GetNewPathInSameDirectory(szExePath, KS_LKC_FILENAME, KS_LKC_EXT, szNewFileName); + + bool bRet = CopyFileA(szExistingFileName, szNewFileName, false); + + if (!bRet) + { + char szBuf[256] = { 0 }; + LPVOID lpMsgBuf; + DWORD dw = GetLastError(); + FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + dw, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&lpMsgBuf, + 0, NULL); + + LogField* pField = (LogField*)m_msgQueue->new_block(sizeof(LogField)); + + sprintf(pField->Message, "CopyFile:%s", lpMsgBuf); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnLog, m_msgQueue, m_pClass, true, 0, pField, sizeof(LogField), nullptr, 0, nullptr, 0); + } +#endif // KS_COPYFILE + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_pApi = CThostFtdcTraderApi::CreateFtdcTraderApi(pszPath); delete[] pszPath; - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); - if (m_pApi) { m_pApi->RegisterSpi(this); @@ -186,7 +331,7 @@ int CTraderApi::_Init() char* token = strtok(buf, _QUANTBOX_SEPS_); while (token) { - if (strlen(token)>0) + if (strlen(token) > 0) { m_pApi->RegisterFront(token); } @@ -203,7 +348,7 @@ int CTraderApi::_Init() { m_pApi->SubscribePublicTopic(THOST_TERT_QUICK); } - + if (m_ServerInfo.PrivateTopicResumeType < ResumeType::ResumeType_Undefined) { m_pApi->SubscribePrivateTopic((THOST_TE_RESUME_TYPE)m_ServerInfo.PrivateTopicResumeType); @@ -215,19 +360,35 @@ int CTraderApi::_Init() //初始化连接 m_pApi->Init(); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } + else + { + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + + pField->RawErrorID = 0; + strncpy(pField->Text, "(Api==null)", sizeof(Char256Type)); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } + +#ifdef KS_COPYFILE + if (bRet) + { + DeleteFileA(szNewFileName); } +#endif // KS_COPYFILE return 0; } void CTraderApi::OnFrontConnected() { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); //连接成功后自动请求认证或登录 - if (strlen(m_ServerInfo.AuthCode)>0 - && strlen(m_ServerInfo.UserProductInfo)>0) + if (strlen(m_ServerInfo.AuthCode) > 0 + && strlen(m_ServerInfo.UserProductInfo) > 0) { //填了认证码就先认证 ReqAuthenticate(); @@ -246,7 +407,10 @@ void CTraderApi::OnFrontDisconnected(int nReason) pField->RawErrorID = nReason; GetOnFrontDisconnectedMsg(nReason, pField->Text); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + + // 收到登录失败后并没有销毁API,飞鼠只能登录一个用户,所以导致飞鼠登录失败 + _DisconnectInThread(); } void CTraderApi::ReqAuthenticate() @@ -264,7 +428,7 @@ void CTraderApi::ReqAuthenticate() int CTraderApi::_ReqAuthenticate(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorizing, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorizing, 0, nullptr, 0, nullptr, 0, nullptr, 0); return m_pApi->ReqAuthenticate((CThostFtdcReqAuthenticateField*)ptr1, ++m_lRequestID); } @@ -273,7 +437,7 @@ void CTraderApi::OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthentic if (!IsErrorRspInfo(pRspInfo) && pRspAuthenticateField) { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorized, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorized, 0, nullptr, 0, nullptr, 0, nullptr, 0); ReqUserLogin(); } @@ -284,7 +448,7 @@ void CTraderApi::OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthentic pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } } @@ -303,10 +467,34 @@ void CTraderApi::ReqUserLogin() int CTraderApi::_ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); return m_pApi->ReqUserLogin((CThostFtdcReqUserLoginField*)ptr1, ++m_lRequestID); } +void CTraderApi::ReqUserLogout() +{ + CThostFtdcUserLogoutField* pBody = (CThostFtdcUserLogoutField*)m_msgQueue_Query->new_block(sizeof(CThostFtdcUserLogoutField)); + + strncpy(pBody->BrokerID, m_ServerInfo.BrokerID, sizeof(TThostFtdcBrokerIDType)); + strncpy(pBody->UserID, m_UserInfo.UserID, sizeof(TThostFtdcInvestorIDType)); + + if (m_msgQueue_Query) + { + m_msgQueue_Query->Input_NoCopy(RequestType::E_UserLogoutField, m_msgQueue_Query, this, 0, 0, + pBody, sizeof(CThostFtdcReqUserLoginField), nullptr, 0, nullptr, 0); + } +} + +int CTraderApi::_ReqUserLogout(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + if (m_pApi) + { + return m_pApi->ReqUserLogout((CThostFtdcUserLogoutField*)ptr1, ++m_lRequestID); + } + return 0; +} + + void CTraderApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); @@ -314,22 +502,56 @@ void CTraderApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CTho if (!IsErrorRspInfo(pRspInfo) && pRspUserLogin) { +#ifdef HAS_TradingDay_UserLogin pField->TradingDay = GetDate(pRspUserLogin->TradingDay); +#endif // HAS_TradingDay_UserLogin pField->LoginTime = GetTime(pRspUserLogin->LoginTime); sprintf(pField->SessionID, "%d:%d", pRspUserLogin->FrontID, pRspUserLogin->SessionID); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); // 记下登录信息,可能会用到 memcpy(&m_RspUserLogin, pRspUserLogin, sizeof(CThostFtdcRspUserLoginField)); + + // 飞鼠是报单引用是长字符串 +#ifdef USE_LONG_ORDER_REF m_nMaxOrderRef = atol(pRspUserLogin->MaxOrderRef); +#else + m_nMaxOrderRef = atol(pRspUserLogin->MaxOrderRef); +#endif // 自己发单时ID从1开始,不能从0开始 - m_nMaxOrderRef = m_nMaxOrderRef>1 ? m_nMaxOrderRef : 1; + //m_nMaxOrderRef = m_nMaxOrderRef>1 ? m_nMaxOrderRef : 1; + + // 飞鼠接口,这个数返回的是上次退出时最大编号,所以将要使用的得+1 + // 而其它接口是这次可以使用的报单编号,所以出于使用考虑,直接+1 + m_nMaxOrderRef += 1; + + // 结算单确认,CTP必须确认才能下单 +#ifdef HAS_Settlement ReqSettlementInfoConfirm(); +#else + QueryOrderTrade(false); +#endif // HAS_Settlement + + + +#ifdef IS_SGIT_API + // 飞鼠返回的资金太多了,关闭掉 + m_pApi->IsReviveNtyCapital(FALSE); +#ifdef ENABLE_LICENSE + // 飞鼠由于目前没办法查投资者列表,无法根据姓名来判断授权,所以只能提前设置为可用 + m_pLicense->SetSendOrderFlag(true); +#endif + +#else + // 查询投资查,授权认证时使 + // 飞鼠使用此功能需要服务器升级 ReqQueryField body = { 0 }; - ReqQuery(QueryType::ReqQryInvestor, &body); + ReqQuery(QueryType::QueryType_ReqQryInvestor, &body); +#endif + //TEST:测完要删 //body.DateStart = 20151111; @@ -340,10 +562,26 @@ void CTraderApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CTho pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + + // 收到登录失败后并没有销毁API,飞鼠一次只能登录一个用户,所以导致飞鼠用户失败 + _DisconnectInThread(); + } +} + +void CTraderApi::QueryOrderTrade(bool bForceQuery) +{ + if (bForceQuery || + (m_ServerInfo.PrivateTopicResumeType > ResumeType::ResumeType_Restart + && (m_ServerInfo.PrivateTopicResumeType < ResumeType::ResumeType_Undefined))) + { + ReqQueryField body = { 0 }; + ReqQuery(QueryType::QueryType_ReqQryOrder, &body); + ReqQuery(QueryType::QueryType_ReqQryQuote, &body); } } +#ifdef HAS_Settlement void CTraderApi::ReqSettlementInfoConfirm() { CThostFtdcSettlementInfoConfirmField* pBody = (CThostFtdcSettlementInfoConfirmField*)m_msgQueue_Query->new_block(sizeof(CThostFtdcSettlementInfoConfirmField)); @@ -357,7 +595,7 @@ void CTraderApi::ReqSettlementInfoConfirm() int CTraderApi::_ReqSettlementInfoConfirm(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Confirming, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Confirming, 0, nullptr, 0, nullptr, 0, nullptr, 0); return m_pApi->ReqSettlementInfoConfirm((CThostFtdcSettlementInfoConfirmField*)ptr1, ++m_lRequestID); } @@ -366,20 +604,11 @@ void CTraderApi::OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField if (!IsErrorRspInfo(pRspInfo) && pSettlementInfoConfirm) { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Confirmed, 0, nullptr, 0, nullptr, 0, nullptr, 0); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); - - if (m_ServerInfo.PrivateTopicResumeType > ResumeType::ResumeType_Restart - && (m_ServerInfo.PrivateTopicResumeTypeInput_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Confirmed, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); - ReqQueryField body = { 0 }; - ReqQuery(QueryType::ReqQryOrder, &body); - ReqQuery(QueryType::ReqQryQuote, &body); - } + // 结算单确认完成,后查询委托与成交 + QueryOrderTrade(false); } else { @@ -388,30 +617,63 @@ void CTraderApi::OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } } +#endif // HAS_Settlement + + void CTraderApi::Disconnect() { - if (m_msgQueue_Query) + _Disconnect(false); +} + +void CTraderApi::_DisconnectInThread() +{ + m_msgQueue_Query->Input_NoCopy(RequestType::E_Disconnect, m_msgQueue_Query, this, 0, 0, + nullptr, 0, nullptr, 0, nullptr, 0); +} + +void CTraderApi::_Disconnect(bool IsInQueue) +{ + //if (m_delete) + // return; + + //m_delete = true; + + // 由于飞鼠一次只能登录一个账号,以前的方法连接可能没有断开,这里只能主动退出,其它的程序就不管了 +#ifdef IS_SGIT_API + ReqUserLogout(); + Sleep(1000); +#endif + + if (IsInQueue) { - m_msgQueue_Query->StopThread(); - m_msgQueue_Query->Register(nullptr,nullptr); - m_msgQueue_Query->Clear(); - delete m_msgQueue_Query; - m_msgQueue_Query = nullptr; + + } + else + { + if (m_msgQueue_Query) + { + m_msgQueue_Query->StopThread(); + m_msgQueue_Query->Register(nullptr, nullptr); + m_msgQueue_Query->Clear(); + delete m_msgQueue_Query; + m_msgQueue_Query = nullptr; + } } - if(m_pApi) + if (m_pApi) { + // 为何感觉飞鼠没有登出成功,还在运行? m_pApi->RegisterSpi(nullptr); m_pApi->Release(); m_pApi = nullptr; // 全清理,只留最后一个 m_msgQueue->Clear(); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); // 主动触发 m_msgQueue->Process(); } @@ -419,7 +681,7 @@ void CTraderApi::Disconnect() if (m_msgQueue) { m_msgQueue->StopThread(); - m_msgQueue->Register(nullptr,nullptr); + m_msgQueue->Register(nullptr, nullptr); m_msgQueue->Clear(); delete m_msgQueue; m_msgQueue = nullptr; @@ -440,6 +702,15 @@ void CTraderApi::Clear() delete it->second; m_id_api_order.clear(); + for (unordered_map::iterator it = m_id_platform_position.begin(); it != m_id_platform_position.end(); ++it) + delete it->second; + m_id_platform_position.clear(); + + for (unordered_map::iterator it = m_id_api_position.begin(); it != m_id_api_position.end(); ++it) + delete it->second; + m_id_api_position.clear(); + +#ifdef HAS_Quote for (unordered_map::iterator it = m_id_platform_quote.begin(); it != m_id_platform_quote.end(); ++it) delete it->second; m_id_platform_quote.clear(); @@ -447,26 +718,29 @@ void CTraderApi::Clear() for (unordered_map::iterator it = m_id_api_quote.begin(); it != m_id_api_quote.end(); ++it) delete it->second; m_id_api_quote.clear(); +#endif // HAS_Quote - for (unordered_map::iterator it = m_id_platform_position.begin(); it != m_id_platform_position.end(); ++it) - delete it->second; - m_id_platform_position.clear(); } -int CTraderApi::ReqOrderInsert( +char* CTraderApi::ReqOrderInsert( OrderField* pOrder, int count, - OrderIDType* pInOut) + char* pszLocalIDBuf) { int OrderRef = -1; if (nullptr == m_pApi) - return -1; + return nullptr; - CThostFtdcInputOrderField body = {0}; + CThostFtdcInputOrderField body = { 0 }; strncpy(body.BrokerID, m_RspUserLogin.BrokerID, sizeof(TThostFtdcBrokerIDType)); strncpy(body.InvestorID, m_RspUserLogin.UserID, sizeof(TThostFtdcInvestorIDType)); +#ifdef IS_SGIT_API + // 为飞鼠加的,否则报席位不符 + strncpy(body.UserID, m_RspUserLogin.UserID, sizeof(TThostFtdcUserIDType)); +#endif + body.MinVolume = 1; body.ForceCloseReason = THOST_FTDC_FCC_NotForceClose; body.IsAutoSuspend = 0; @@ -475,7 +749,10 @@ int CTraderApi::ReqOrderInsert( //合约 strncpy(body.InstrumentID, pOrder->InstrumentID, sizeof(TThostFtdcInstrumentIDType)); +#ifdef HAS_ExchangeID_Order strncpy(body.ExchangeID, pOrder->ExchangeID, sizeof(TThostFtdcExchangeIDType)); +#endif // HAS_ExchangeID_Order + //买卖 body.Direction = OrderSide_2_TThostFtdcDirectionType(pOrder->Side); //开平 @@ -490,7 +767,7 @@ int CTraderApi::ReqOrderInsert( body.StopPrice = pOrder->StopPx; // 针对第二个进行处理,如果有第二个参数,认为是交易所套利单 - if (count>1) + if (count > 1) { body.CombOffsetFlag[1] = OpenCloseType_2_TThostFtdcOffsetFlagType(pOrder[1].OpenClose); body.CombHedgeFlag[1] = HedgeFlagType_2_TThostFtdcHedgeFlagType(pOrder[1].HedgeFlag); @@ -565,9 +842,38 @@ int CTraderApi::ReqOrderInsert( nRet = OrderRef; } sprintf(body.OrderRef, "%d", nRet); +#ifdef USE_LONG_ORDER_REF + sprintf(body.OrderRef, "%012lld", nRet); +#endif // 测试平台穿越速度,用完后需要注释掉 //WriteLog("CTP:ReqOrderInsert:%s %d", body.InstrumentID, nRet); +#ifdef ENABLE_LICENSE + int err = m_pLicense->GetErrorCodeForSendOrder(); + if (err < 0) + { + sprintf(m_orderInsert_Id, "%d", -5); + + OrderField* pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); + memcpy(pField, pOrder, sizeof(OrderField)); + strcpy(pField->ID, m_orderInsert_Id); + strcpy(pField->LocalID, pField->ID); + m_id_platform_order.insert(pair(pField->LocalID, pField)); + + pField->RawErrorID = err; + strncpy(pField->Text, m_pLicense->GetErrorInfo(), sizeof(Char256Type)); + + pField->Status = OrderStatus::OrderStatus_Rejected; + pField->ExecType = ExecType::ExecType_Rejected; + + strncpy((char*)pszLocalIDBuf, m_orderInsert_Id, sizeof(OrderIDType)); + + // 这个问题的关键是先到队列还是先返回 + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + + return pszLocalIDBuf; + } +#endif //不保存到队列,而是直接发送 @@ -581,49 +887,57 @@ int CTraderApi::ReqOrderInsert( { // 用于各种情况下找到原订单,用于进行响应的通知 sprintf(m_orderInsert_Id, "%d:%d:%d", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, nRet); +#ifdef USE_LONG_ORDER_REF + sprintf(m_orderInsert_Id, "%d:%d:%012lld", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, nRet); +#endif OrderField* pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); memcpy(pField, pOrder, sizeof(OrderField)); strcpy(pField->ID, m_orderInsert_Id); strcpy(pField->LocalID, pField->ID); - m_id_platform_order.insert(pair(m_orderInsert_Id, pField)); + m_id_platform_order.insert(pair(pField->LocalID, pField)); } - strncpy((char*)pInOut, m_orderInsert_Id, sizeof(OrderIDType)); + strncpy((char*)pszLocalIDBuf, m_orderInsert_Id, sizeof(OrderIDType)); } - return nRet; + return pszLocalIDBuf; } void CTraderApi::OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { OrderIDType orderId = { 0 }; + // 飞鼠报单成功也会走此路,所以需要处理一下,即只有发现有错误信息时才报出去 + if (pInputOrder) { sprintf(orderId, "%d:%d:%s", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, pInputOrder->OrderRef); } else { - IsErrorRspInfo("OnRspOrderInsert", pRspInfo, nRequestID, bIsLast); + // IsErrorRspInfo("OnRspOrderInsert", pRspInfo, nRequestID, bIsLast); } - unordered_map::iterator it = m_id_platform_order.find(orderId); - if (it == m_id_platform_order.end()) + if (IsErrorRspInfo(pRspInfo)) { - // 没找到?不应当,这表示出错了 - //assert(false); - } - else - { - // 找到了,要更新状态 - // 得使用上次的状态 - OrderField* pField = it->second; - pField->ExecType = ExecType::ExecType_Rejected; - pField->Status = OrderStatus::OrderStatus_Rejected; - pField->RawErrorID = pRspInfo->ErrorID; - strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + unordered_map::iterator it = m_id_platform_order.find(orderId); + if (it == m_id_platform_order.end()) + { + // 没找到?不应当,这表示出错了 + //assert(false); + } + else + { + // 找到了,要更新状态 + // 得使用上次的状态 + OrderField* pField = it->second; + pField->ExecType = ExecType::ExecType_Rejected; + pField->Status = OrderStatus::OrderStatus_Rejected; + pField->RawErrorID = pRspInfo->ErrorID; + strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + } } } @@ -655,7 +969,7 @@ void CTraderApi::OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CTh pField->Status = OrderStatus::OrderStatus_Rejected; pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } @@ -664,19 +978,20 @@ void CTraderApi::OnRtnTrade(CThostFtdcTradeField *pTrade) OnTrade(pTrade, 0, true); } -int CTraderApi::ReqOrderAction(OrderIDType* szIds, int count, OrderIDType* pOutput) +char* CTraderApi::ReqOrderAction(OrderIDType* szIds, int count, char* pzsRtn) { unordered_map::iterator it = m_id_api_order.find(szIds[0]); if (it == m_id_api_order.end()) { - sprintf((char*)pOutput, "%d", -100); - return -100; + sprintf(pzsRtn, "%d", -100); } else { // 找到了订单 - return ReqOrderAction(it->second, count, pOutput); + return ReqOrderAction(it->second, count, pzsRtn); } + + return pzsRtn; } int CTraderApi::ReqOrderAction(OrderField *pOrder, int count, OrderIDType* pOutput) @@ -721,31 +1036,31 @@ int CTraderApi::ReqOrderAction(OrderField *pOrder, int count, OrderIDType* pOutp return 0; } -int CTraderApi::ReqOrderAction(CThostFtdcOrderField *pOrder, int count, OrderIDType* pOutput) +char* CTraderApi::ReqOrderAction(CThostFtdcOrderField *pOrder, int count, char* pzsRtn) { if (nullptr == m_pApi) return 0; - CThostFtdcInputOrderActionField body = {0}; + CThostFtdcInputOrderActionField body = { 0 }; ///经纪公司代码 - strncpy(body.BrokerID, pOrder->BrokerID,sizeof(TThostFtdcBrokerIDType)); + strncpy(body.BrokerID, pOrder->BrokerID, sizeof(TThostFtdcBrokerIDType)); ///投资者代码 - strncpy(body.InvestorID, pOrder->InvestorID,sizeof(TThostFtdcInvestorIDType)); + strncpy(body.InvestorID, pOrder->InvestorID, sizeof(TThostFtdcInvestorIDType)); ///报单引用 - strncpy(body.OrderRef, pOrder->OrderRef,sizeof(TThostFtdcOrderRefType)); + strncpy(body.OrderRef, pOrder->OrderRef, sizeof(TThostFtdcOrderRefType)); ///前置编号 body.FrontID = pOrder->FrontID; ///会话编号 body.SessionID = pOrder->SessionID; ///交易所代码 - strncpy(body.ExchangeID,pOrder->ExchangeID,sizeof(TThostFtdcExchangeIDType)); + strncpy(body.ExchangeID, pOrder->ExchangeID, sizeof(TThostFtdcExchangeIDType)); ///报单编号 - strncpy(body.OrderSysID,pOrder->OrderSysID,sizeof(TThostFtdcOrderSysIDType)); + strncpy(body.OrderSysID, pOrder->OrderSysID, sizeof(TThostFtdcOrderSysIDType)); ///操作标志 body.ActionFlag = THOST_FTDC_AF_Delete; ///合约代码 - strncpy(body.InstrumentID, pOrder->InstrumentID,sizeof(TThostFtdcInstrumentIDType)); + strncpy(body.InstrumentID, pOrder->InstrumentID, sizeof(TThostFtdcInstrumentIDType)); int nRet = m_pApi->ReqOrderAction(&body, ++m_lRequestID); if (nRet < 0) @@ -756,10 +1071,9 @@ int CTraderApi::ReqOrderAction(CThostFtdcOrderField *pOrder, int count, OrderIDT { memset(m_orderAction_Id, 0, sizeof(OrderIDType)); } - strncpy((char*)pOutput, m_orderAction_Id, sizeof(OrderIDType)); - + strncpy(pzsRtn, m_orderAction_Id, sizeof(OrderIDType)); - return nRet; + return pzsRtn; } void CTraderApi::OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) @@ -771,26 +1085,29 @@ void CTraderApi::OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAc } else { - IsErrorRspInfo("OnRspOrderAction", pRspInfo, nRequestID, bIsLast); + //IsErrorRspInfo("OnRspOrderAction", pRspInfo, nRequestID, bIsLast); } - unordered_map::iterator it = m_id_platform_order.find(orderId); - if (it == m_id_platform_order.end()) - { - // 没找到?不应当,这表示出错了 - //assert(false); - } - else + if (IsErrorRspInfo(pRspInfo)) { - // 找到了,要更新状态 - // 得使用上次的状态 - OrderField* pField = it->second; - strcpy(pField->ID, orderId); - strcpy(pField->LocalID, pField->ID); - pField->ExecType = ExecType::ExecType_CancelReject; - pField->RawErrorID = pRspInfo->ErrorID; - strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + unordered_map::iterator it = m_id_platform_order.find(orderId); + if (it == m_id_platform_order.end()) + { + // 没找到?不应当,这表示出错了 + //assert(false); + } + else + { + // 找到了,要更新状态 + // 得使用上次的状态 + OrderField* pField = it->second; + strcpy(pField->ID, orderId); + strcpy(pField->LocalID, pField->ID); + pField->ExecType = ExecType::ExecType_CancelReject; + pField->RawErrorID = pRspInfo->ErrorID; + strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + } } } @@ -822,7 +1139,7 @@ void CTraderApi::OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, C pField->ExecType = ExecType::ExecType_CancelReject; pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } @@ -831,838 +1148,1006 @@ void CTraderApi::OnRtnOrder(CThostFtdcOrderField *pOrder) OnOrder(pOrder, 0, true); } -char* CTraderApi::ReqQuoteInsert( - QuoteField* pQuote, - OrderIDType* pAskRef, - OrderIDType* pBidRef) -{ - int QuoteRef = -1; - if (nullptr == m_pApi) - return nullptr; - CThostFtdcInputQuoteField body = {0}; +int CTraderApi::_ReqQryTradingAccount(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + CThostFtdcQryTradingAccountField body = { 0 }; strcpy(body.BrokerID, m_RspUserLogin.BrokerID); strcpy(body.InvestorID, m_RspUserLogin.UserID); - //合约,目前只从订单1中取 - strncpy(body.InstrumentID, pQuote->InstrumentID, sizeof(TThostFtdcInstrumentIDType)); - strncpy(body.ExchangeID, pQuote->ExchangeID, sizeof(TThostFtdcExchangeIDType)); - //开平 - body.AskOffsetFlag = OpenCloseType_2_TThostFtdcOffsetFlagType(pQuote->AskOpenClose); - body.BidOffsetFlag = OpenCloseType_2_TThostFtdcOffsetFlagType(pQuote->BidOpenClose); - //投保 - body.AskHedgeFlag = HedgeFlagType_2_TThostFtdcHedgeFlagType(pQuote->AskHedgeFlag); - body.BidHedgeFlag = HedgeFlagType_2_TThostFtdcHedgeFlagType(pQuote->BidHedgeFlag); - - //价格 - body.AskPrice = pQuote->AskPrice; - body.BidPrice = pQuote->BidPrice; - - //数量 - body.AskVolume = (int)pQuote->AskQty; - body.BidVolume = (int)pQuote->BidQty; - - strncpy(body.ForQuoteSysID, pQuote->QuoteReqID, sizeof(TThostFtdcOrderSysIDType)); + return m_pApi->ReqQryTradingAccount(&body, ++m_lRequestID); +} - int nRet = 0; +void CTraderApi::OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + if (!IsErrorRspInfo("OnRspQryTradingAccount", pRspInfo, nRequestID, bIsLast)) { - //可能报单太快,m_nMaxOrderRef还没有改变就提交了 - lock_guard cl(m_csOrderRef); - - if (QuoteRef < 0) + if (pTradingAccount) { - nRet = m_nMaxOrderRef; - sprintf(body.QuoteRef, "%d", m_nMaxOrderRef); - sprintf(body.AskOrderRef, "%d", m_nMaxOrderRef); - sprintf(body.BidOrderRef, "%d", ++m_nMaxOrderRef); - ++m_nMaxOrderRef; + AccountField* pField = (AccountField*)m_msgQueue->new_block(sizeof(AccountField)); + + strcpy(pField->AccountID, pTradingAccount->AccountID); + pField->CurrMargin = pTradingAccount->CurrMargin; + pField->Commission = pTradingAccount->Commission; + pField->Available = pTradingAccount->Available; + pField->Deposit = pTradingAccount->Deposit; + pField->Withdraw = pTradingAccount->Withdraw; + pField->WithdrawQuota = pTradingAccount->WithdrawQuota; + +#ifdef HAS_Account_Future + pField->PreBalance = pTradingAccount->PreBalance; + pField->CloseProfit = pTradingAccount->CloseProfit; + pField->PositionProfit = pTradingAccount->PositionProfit; + pField->Balance = pTradingAccount->Balance; +#endif + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryTradingAccount, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(AccountField), nullptr, 0, nullptr, 0); } else { - nRet = QuoteRef; - sprintf(body.QuoteRef, "%d", QuoteRef); - sprintf(body.AskOrderRef, "%d", QuoteRef); - sprintf(body.BidOrderRef, "%d", ++QuoteRef); - ++QuoteRef; + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryTradingAccount, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); } + } +} - //不保存到队列,而是直接发送 - int n = m_pApi->ReqQuoteInsert(&body, ++m_lRequestID); - if (n < 0) + +int CTraderApi::_ReqQryInvestorPosition(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + ReqQueryField* pQuery = (ReqQueryField*)ptr1; + + CThostFtdcQryInvestorPositionField body = { 0 }; + + strncpy(body.BrokerID, m_RspUserLogin.BrokerID, sizeof(TThostFtdcBrokerIDType)); + strncpy(body.InvestorID, m_RspUserLogin.UserID, sizeof(TThostFtdcInvestorIDType)); + strncpy(body.InstrumentID, pQuery->InstrumentID, sizeof(TThostFtdcInstrumentIDType)); + + return m_pApi->ReqQryInvestorPosition(&body, ++m_lRequestID); +} + +void CTraderApi::GetPositionID(CThostFtdcInvestorPositionField *pInvestorPosition, PositionIDType positionId) +{ + +#ifdef HAS_ExchangeID_Position + //PositionIDType positionId = { 0 }; + sprintf(positionId, "%s:%s:%d:%d:%c", + pInvestorPosition->ExchangeID, + pInvestorPosition->InstrumentID, + TThostFtdcPosiDirectionType_2_PositionSide(pInvestorPosition->PosiDirection), + TThostFtdcHedgeFlagType_2_HedgeFlagType(pInvestorPosition->HedgeFlag), + pInvestorPosition->PositionDate); +#else + //PositionIDType positionId = { 0 }; + sprintf(positionId, "%s:%s:%d:%d:%c", + "", + pInvestorPosition->InstrumentID, + TThostFtdcPosiDirectionType_2_PositionSide(pInvestorPosition->PosiDirection), + TThostFtdcHedgeFlagType_2_HedgeFlagType(pInvestorPosition->HedgeFlag), + pInvestorPosition->PositionDate); + +#endif // HAS_ExchangeID +} + +void CTraderApi::GetPositionID2(CThostFtdcInvestorPositionField *pInvestorPosition, PositionIDType positionId) +{ +#ifdef HAS_ExchangeID_Position + //PositionIDType positionId = { 0 }; + sprintf(positionId, "%s:%s:%d:%d", + pInvestorPosition->ExchangeID, + pInvestorPosition->InstrumentID, + TThostFtdcPosiDirectionType_2_PositionSide(pInvestorPosition->PosiDirection), + TThostFtdcHedgeFlagType_2_HedgeFlagType(pInvestorPosition->HedgeFlag)); +#else + //PositionIDType positionId = { 0 }; + sprintf(positionId, "%s:%s:%d:%d", + "", + pInvestorPosition->InstrumentID, + TThostFtdcPosiDirectionType_2_PositionSide(pInvestorPosition->PosiDirection), + TThostFtdcHedgeFlagType_2_HedgeFlagType(pInvestorPosition->HedgeFlag)); + +#endif // HAS_ExchangeID +} + +// 如果是请求查询,就将数据全部返回 +// 如果是后期的成交回报,就只返回更新的记录 +// 对于中金所,同时有今昨两天的持仓时,只返回今天的两条多空数据 +// 对于上期所,目前没条件测,当成是也只有两条 +void CTraderApi::OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + if (!IsErrorRspInfo("OnRspQryInvestorPosition", pRspInfo, nRequestID, bIsLast)) + { + // 如果没有持仓,返回空的数据 + if (nullptr == pInvestorPosition) { - nRet = n; - return nullptr; + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryInvestorPosition, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + return; } - else + + // 得到持仓ID + PositionIDType positionId = { 0 }; + GetPositionID(pInvestorPosition, positionId); + + // 先将原始的持仓都记录下来 { - sprintf(m_orderInsert_Id, "%d:%d:%d", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, nRet); + unordered_map::iterator it = m_id_api_position.find(positionId); + if (it == m_id_api_position.end()) + { + // 找不到此订单,表示是新单 + CThostFtdcInvestorPositionField* pField = (CThostFtdcInvestorPositionField*)m_msgQueue->new_block(sizeof(CThostFtdcInvestorPositionField)); + memcpy(pField, pInvestorPosition, sizeof(CThostFtdcInvestorPositionField)); + m_id_api_position.insert(pair(positionId, pField)); + } + else + { + // 找到了订单 + // 需要再复制保存最后一次的状态,还是只要第一次的用于撤单即可?记下,这样最后好比较 + CThostFtdcInvestorPositionField* pField = it->second; + memcpy(pField, pInvestorPosition, sizeof(CThostFtdcInvestorPositionField)); + } + } - QuoteField* pField = (QuoteField*)m_msgQueue->new_block(sizeof(QuoteField)); - memcpy(pField, pQuote, sizeof(QuoteField)); - strcpy(pField->ID, m_orderInsert_Id); - strcpy(pField->LocalID, pField->ID); - strcpy(pField->AskID, m_orderInsert_Id); - sprintf(pField->BidID, "%d:%d:%d", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, nRet + 1); + // 等最后一条记录,开始遍历列表,将所有持仓整理后推送出去 + // 为何要这样做?因为今昨是两条记录,但我记在一个里面 + if (!bIsLast) + return; - m_id_platform_quote.insert(pair(m_orderInsert_Id, pField)); + // 清理一下否则可能加错 + for (unordered_map::iterator it = m_id_platform_position.begin(); it != m_id_platform_position.end(); ++it) + delete it->second; + m_id_platform_position.clear(); + + // 遍历原始的持仓,生成自己的结构体 + for (unordered_map::iterator iter = m_id_api_position.begin(); iter != m_id_api_position.end(); iter++) + { + CThostFtdcInvestorPositionField* pField2 = iter->second; + + // 得到持仓ID + PositionIDType positionId2 = { 0 }; + GetPositionID2(pField2, positionId2); + + // 没到找,创建 + // 找到了,求和,修改 + PositionField* pField = nullptr; + unordered_map::iterator it = m_id_platform_position.find(positionId2); + if (it == m_id_platform_position.end()) + { + pField = (PositionField*)m_msgQueue->new_block(sizeof(PositionField)); + + strcpy(pField->ID, positionId2); + + strcpy(pField->InstrumentID, pField2->InstrumentID); +#ifdef HAS_ExchangeID_Position + strcpy(pField->ExchangeID, pField2->ExchangeID); +#endif // HAS_ExchangeID + sprintf(pField->Symbol, "%s.%s", pField->InstrumentID, pField->ExchangeID); + strcpy(pField->AccountID, pField2->InvestorID); + + pField->Side = TThostFtdcPosiDirectionType_2_PositionSide(pField2->PosiDirection); + pField->HedgeFlag = TThostFtdcHedgeFlagType_2_HedgeFlagType(pField2->HedgeFlag); + + m_id_platform_position.insert(pair(positionId2, pField)); + + pField->Position = pField2->Position; + pField->TodayPosition = pField2->TodayPosition; + pField->HistoryPosition = pField2->YdPosition; + } + else + { + pField = it->second; + + pField->Position += pField2->Position; + pField->TodayPosition += pField2->TodayPosition; + pField->HistoryPosition += pField2->YdPosition; + } + + // 飞鼠的定义与CTP有所不同 +#ifdef IS_SGIT_API + double tmp = pField->Position; + pField->Position = pField->TodayPosition; + pField->TodayPosition = tmp; + pField->HistoryPosition = pField->HistoryPosition; +#else + pField->HistoryPosition = pField->Position - pField->TodayPosition; +#endif + } + + // 将持仓通知出来 + { + int cnt = 0; + size_t count = m_id_platform_position.size(); + for (unordered_map::iterator iter = m_id_platform_position.begin(); iter != m_id_platform_position.end(); iter++) + { + ++cnt; + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryInvestorPosition, m_msgQueue, m_pClass, cnt == count, 0, iter->second, sizeof(PositionField), nullptr, 0, nullptr, 0); + } } } +} - return m_orderInsert_Id; +void CTraderApi::ReqQuery(QueryType type, ReqQueryField* pQuery) +{ + m_msgQueue_Query->Input_Copy(type, m_msgQueue_Query, this, 0, 0, + pQuery, sizeof(ReqQueryField), nullptr, 0, nullptr, 0); } -void CTraderApi::OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +int CTraderApi::_ReqQryInstrument(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { - OrderIDType quoteId = { 0 }; + ReqQueryField* pQuery = (ReqQueryField*)ptr1; - if (pInputQuote) - { - sprintf(quoteId, "%d:%d:%s", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, pInputQuote->QuoteRef); - } - else - { - IsErrorRspInfo("OnRspQuoteInsert", pRspInfo, nRequestID, bIsLast); - } + CThostFtdcQryInstrumentField body = { 0 }; + strncpy(body.InstrumentID, pQuery->InstrumentID, sizeof(TThostFtdcInstrumentIDType)); + strncpy(body.ExchangeID, pQuery->ExchangeID, sizeof(TThostFtdcExchangeIDType)); - unordered_map::iterator it = m_id_platform_quote.find(quoteId); - if (it == m_id_platform_quote.end()) - { - // 没找到?不应当,这表示出错了 - //assert(false); - } - else - { - // 找到了,要更新状态 - // 得使用上次的状态 - QuoteField* pField = it->second; - pField->ExecType = ExecType::ExecType_Rejected; - pField->Status = OrderStatus::OrderStatus_Rejected; - pField->RawErrorID = pRspInfo->ErrorID; - strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); - } + return m_pApi->ReqQryInstrument(&body, ++m_lRequestID); } -void CTraderApi::OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) +void CTraderApi::OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { - OrderIDType quoteId = { 0 }; - - if (pInputQuote) - { - sprintf(quoteId, "%d:%d:%s", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, pInputQuote->QuoteRef); - } - else + if (!IsErrorRspInfo("OnRspQryInstrument", pRspInfo, nRequestID, bIsLast)) { - IsErrorRspInfo("",pRspInfo, 0, true); - } + if (pInstrument) + { + InstrumentField* pField = (InstrumentField*)m_msgQueue->new_block(sizeof(InstrumentField)); - unordered_map::iterator it = m_id_platform_quote.find(quoteId); - if (it == m_id_platform_quote.end()) - { - // 没找到?不应当,这表示出错了 - //assert(false); - } - else - { - // 找到了,要更新状态 - // 得使用上次的状态 - QuoteField* pField = it->second; - pField->ExecType = ExecType::ExecType_Rejected; - pField->Status = OrderStatus::OrderStatus_Rejected; - pField->RawErrorID = pRspInfo->ErrorID; - strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); + strncpy(pField->InstrumentID, pInstrument->InstrumentID, sizeof(InstrumentIDType)); + strncpy(pField->ExchangeID, pInstrument->ExchangeID, sizeof(ExchangeIDType)); + + strncpy(pField->Symbol, pInstrument->InstrumentID, sizeof(SymbolType)); + strncpy(pField->ProductID, pInstrument->ProductID, sizeof(InstrumentIDType)); + + strncpy(pField->InstrumentName, pInstrument->InstrumentName, sizeof(InstrumentNameType)); + pField->Type = CThostFtdcInstrumentField_2_InstrumentType(pInstrument); + pField->VolumeMultiple = pInstrument->VolumeMultiple; + pField->PriceTick = pInstrument->PriceTick; + pField->ExpireDate = GetDate(pInstrument->ExpireDate); + pField->OptionsType = TThostFtdcOptionsTypeType_2_PutCall(pInstrument->OptionsType); + pField->StrikePrice = (pInstrument->StrikePrice < DBL_EPSILON || pInstrument->StrikePrice == DBL_MAX) ? 0 : pInstrument->StrikePrice; + strcpy(pField->UnderlyingInstrID, pInstrument->UnderlyingInstrID); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InstrumentField), nullptr, 0, nullptr, 0); + } + else + { + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } } } -void CTraderApi::OnRtnQuote(CThostFtdcQuoteField *pQuote) +//void CTraderApi::ReqQryInstrumentCommissionRate(const string& szInstrumentId) +//{ +// CThostFtdcQryInstrumentCommissionRateField body = {0}; +// +// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID,sizeof(TThostFtdcBrokerIDType)); +// strncpy(pBody->InvestorID, m_RspUserLogin.UserID,sizeof(TThostFtdcInvestorIDType)); +// strncpy(pBody->InstrumentID,szInstrumentId.c_str(),sizeof(TThostFtdcInstrumentIDType)); +//} +// +//void CTraderApi::OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +//{ +// +//} + +//void CTraderApi::ReqQryInstrumentMarginRate(const string& szInstrumentId,TThostFtdcHedgeFlagType HedgeFlag) +//{ +// CThostFtdcQryInstrumentMarginRateField body = {0}; +// +// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID,sizeof(TThostFtdcBrokerIDType)); +// strncpy(pBody->InvestorID, m_RspUserLogin.UserID,sizeof(TThostFtdcInvestorIDType)); +// strncpy(pBody->InstrumentID,szInstrumentId.c_str(),sizeof(TThostFtdcInstrumentIDType)); +// pBody->HedgeFlag = HedgeFlag; +// +// //AddToSendQueue(pRequest); +//} + +//void CTraderApi::OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +//{ +// +//} +// + +#ifdef HAS_Settlement +int CTraderApi::_ReqQrySettlementInfo(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { - OnQuote(pQuote, 0, true); + ReqQueryField* pQuery = (ReqQueryField*)ptr1; + + CThostFtdcQrySettlementInfoField body = { 0 }; + strncpy(body.BrokerID, m_RspUserLogin.BrokerID, sizeof(TThostFtdcBrokerIDType)); + strncpy(body.InvestorID, m_RspUserLogin.UserID, sizeof(TThostFtdcInvestorIDType)); + sprintf(body.TradingDay, "%d", pQuery->DateStart); + + return m_pApi->ReqQrySettlementInfo(&body, ++m_lRequestID); } -int CTraderApi::ReqQuoteAction(const string& szId,OrderIDType* pOutput) +vector vct_SettlementInfo; + +void CTraderApi::OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { - unordered_map::iterator it = m_id_api_quote.find(szId); - if (it == m_id_api_quote.end()) - { - sprintf((char*)pOutput, "%d", -100); - return -100; - } - else + if (!IsErrorRspInfo("OnRspQrySettlementInfo", pRspInfo, nRequestID, bIsLast)) { - // 找到了订单 - ReqQuoteAction(it->second,pOutput); + if (pSettlementInfo) + { + CThostFtdcSettlementInfoField* pField = new CThostFtdcSettlementInfoField; + memcpy(pField, pSettlementInfo, sizeof(CThostFtdcSettlementInfoField)); + vct_SettlementInfo.push_back(pField); + + if (bIsLast) + { + int len = 0; + for (vector::iterator it = vct_SettlementInfo.begin(); it != vct_SettlementInfo.end(); ++it) + { + CThostFtdcSettlementInfoField* p = *it; + len += sizeof(p->Content); + } + + SettlementInfoField* pField = (SettlementInfoField*)m_msgQueue->new_block(sizeof(SettlementInfoField) + len); + pField->TradingDay = atoi(pSettlementInfo->TradingDay); + pField->Size = sizeof(SettlementInfoField) + len; + char* pContent = (((char*)pField) + sizeof(SettlementInfoField)); + memset(pContent, 0, len); + for (vector::iterator it = vct_SettlementInfo.begin(); it != vct_SettlementInfo.end(); ++it) + { + CThostFtdcSettlementInfoField* p = *it; + strcat(pContent, p->Content); + } + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQrySettlementInfo, m_msgQueue, this, bIsLast, 0, pField, pField->Size, nullptr, 0, nullptr, 0); + + // 需要将结算单清理 + for (vector::iterator it = vct_SettlementInfo.begin(); it != vct_SettlementInfo.end(); ++it) + { + CThostFtdcSettlementInfoField* p = *it; + delete[] p; + } + vct_SettlementInfo.clear(); + } + } + else + { + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQrySettlementInfo, m_msgQueue, this, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } } - return 0; } +#endif -int CTraderApi::ReqQuoteAction(CThostFtdcQuoteField *pQuote, OrderIDType* pOutput) -{ - if (nullptr == m_pApi) - return 0; - CThostFtdcInputQuoteActionField body = {0}; - ///经纪公司代码 - strcpy(body.BrokerID, pQuote->BrokerID); - ///投资者代码 - strcpy(body.InvestorID, pQuote->InvestorID); - ///报单引用 - strcpy(body.QuoteRef, pQuote->QuoteRef); - ///前置编号 - body.FrontID = pQuote->FrontID; - ///会话编号 - body.SessionID = pQuote->SessionID; - ///交易所代码 - strcpy(body.ExchangeID, pQuote->ExchangeID); - ///报单编号 - strcpy(body.QuoteSysID, pQuote->QuoteSysID); - ///操作标志 - body.ActionFlag = THOST_FTDC_AF_Delete; - ///合约代码 - strcpy(body.InstrumentID, pQuote->InstrumentID); +void CTraderApi::OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + IsErrorRspInfo("OnRspError", pRspInfo, nRequestID, bIsLast); +} - int nRet = m_pApi->ReqQuoteAction(&body, ++m_lRequestID); - if (nRet < 0) - { - sprintf(m_orderAction_Id, "%d", nRet); - } - else - { - memset(m_orderAction_Id, 0, sizeof(OrderIDType)); - } - strncpy((char*)pOutput, m_orderAction_Id, sizeof(OrderIDType)); +int CTraderApi::_ReqQryOrder(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + CThostFtdcQryOrderField body = { 0 }; - return nRet; + strcpy(body.BrokerID, m_RspUserLogin.BrokerID); + strcpy(body.InvestorID, m_RspUserLogin.UserID); + + return m_pApi->ReqQryOrder(&body, ++m_lRequestID); } -void CTraderApi::OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +void CTraderApi::OnOrder(CThostFtdcOrderField *pOrder, int nRequestID, bool bIsLast) { - OrderIDType quoteId = { 0 }; - if (pInputQuoteAction) - { - sprintf(quoteId, "%d:%d:%s", pInputQuoteAction->FrontID, pInputQuoteAction->SessionID, pInputQuoteAction->QuoteRef); - } - else + if (nullptr == pOrder) { - IsErrorRspInfo("OnRspQuoteAction", pRspInfo, nRequestID, bIsLast); + // 如果是请求报单而当日无报单,也需要回调告知 bIsLast = true + if (nRequestID != 0) + { + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryOrder, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } + return; } - unordered_map::iterator it = m_id_platform_quote.find(quoteId); - if (it == m_id_platform_quote.end()) - { - // 没找到?不应当,这表示出错了 - //assert(false); - } - else + OrderIDType orderId = { 0 }; + sprintf(orderId, "%d:%d:%s", pOrder->FrontID, pOrder->SessionID, pOrder->OrderRef); + OrderIDType orderSydId = { 0 }; + { - // 找到了,要更新状态 - // 得使用上次的状态 - QuoteField* pField = it->second; - strcpy(pField->ID, quoteId); - strcpy(pField->LocalID, pField->ID); - //sprintf(pField->AskID, "%d:%d:%s", pInputQuoteAction->FrontID, pInputQuoteAction->SessionID, pInputQuoteAction->); - //sprintf(pField->BidID, "%d:%d:%s", pInputQuoteAction->FrontID, pInputQuoteAction->SessionID, pInputQuoteAction->QuoteRef); - pField->ExecType = ExecType::ExecType_CancelReject; - pField->RawErrorID = pRspInfo->ErrorID; - strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); - } -} + // 保存原始订单信息,用于撤单 -void CTraderApi::OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) -{ - OrderIDType quoteId = { 0 }; + unordered_map::iterator it = m_id_api_order.find(orderId); + if (it == m_id_api_order.end()) + { + // 找不到此订单,表示是新单 + CThostFtdcOrderField* pField = (CThostFtdcOrderField*)m_msgQueue->new_block(sizeof(CThostFtdcOrderField)); + memcpy(pField, pOrder, sizeof(CThostFtdcOrderField)); + m_id_api_order.insert(pair(orderId, pField)); + } + else + { + // 找到了订单 + // 需要再复制保存最后一次的状态,还是只要第一次的用于撤单即可?记下,这样最后好比较 + CThostFtdcOrderField* pField = it->second; + memcpy(pField, pOrder, sizeof(CThostFtdcOrderField)); + } - if (pQuoteAction) - { - sprintf(quoteId, "%d:%d:%s", pQuoteAction->FrontID, pQuoteAction->SessionID, pQuoteAction->QuoteRef); + // 保存SysID用于定义成交回报与订单 + sprintf(orderSydId, "%s:%s:%s", pOrder->ExchangeID, pOrder->InstrumentID, pOrder->OrderSysID); + m_sysId_orderId.insert(pair(orderSydId, orderId)); } - else + { - IsErrorRspInfo("OnRspQuoteAction",pRspInfo, 0, true); - } + // 从API的订单转换成自己的结构体 + if (nRequestID == 0) + { + OrderField* pField = nullptr; + unordered_map::iterator it = m_id_platform_order.find(orderId); + if (it == m_id_platform_order.end()) + { + pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); + + // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 + CThostFtdcOrderField_2_OrderField_0(orderId, pOrder, pField); + pField->Time = GetTime(pOrder->InsertTime); + + // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 + m_id_platform_order.insert(pair(orderId, pField)); + } + else + { + pField = it->second; + strcpy(pField->ID, orderId); + strcpy(pField->LocalID, pField->ID); + pField->LeavesQty = pOrder->VolumeTotal; + pField->Price = pOrder->LimitPrice; + pField->Status = CThostFtdcOrderField_2_OrderStatus(pOrder); + pField->ExecType = CThostFtdcOrderField_2_ExecType(pOrder); + strcpy(pField->OrderID, pOrder->OrderSysID); + strncpy(pField->Text, pOrder->StatusMsg, sizeof(Char256Type)); + //pField->Time = GetTime(pOrder->InsertTime); + } + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + } + else + { + OrderField* pField = nullptr; + pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); + + // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 + CThostFtdcOrderField_2_OrderField_0(orderId, pOrder, pField); + pField->Time = GetTime(pOrder->InsertTime); + + // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 + //m_id_platform_order.insert(pair(orderId, pField)); - unordered_map::iterator it = m_id_platform_quote.find(quoteId); - if (it == m_id_platform_quote.end()) - { - // 没找到?不应当,这表示出错了 - //assert(false); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryOrder, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + + m_msgQueue->delete_block(pField); + } } - else +} + +void CTraderApi::OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + if (!IsErrorRspInfo("OnRspQryOrder", pRspInfo, nRequestID, bIsLast)) { - // 找到了,要更新状态 - // 得使用上次的状态 - QuoteField* pField = it->second; - strcpy(pField->ID, quoteId); - strcpy(pField->LocalID, pField->ID); - pField->ExecType = ExecType::ExecType_CancelReject; - pField->RawErrorID = pRspInfo->ErrorID; - strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); + OnOrder(pOrder, nRequestID, bIsLast); } } -//void CTraderApi::ReqQryTradingAccount() +//void CTraderApi::ReqQryTrade() //{ -// CThostFtdcQryTradingAccountField* pBody = (CThostFtdcQryTradingAccountField*)m_msgQueue_Query->new_block(sizeof(CThostFtdcQryTradingAccountField)); +// CThostFtdcQryTradeField* pBody = (CThostFtdcQryTradeField*)m_msgQueue_Query->new_block(sizeof(CThostFtdcQryTradeField)); // -// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID,sizeof(TThostFtdcBrokerIDType)); -// strncpy(pBody->InvestorID, m_RspUserLogin.UserID,sizeof(TThostFtdcInvestorIDType)); +// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID, sizeof(TThostFtdcBrokerIDType)); +// strncpy(pBody->InvestorID, m_RspUserLogin.UserID, sizeof(TThostFtdcInvestorIDType)); // -// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryTradingAccountField, m_msgQueue_Query, this, 0, 0, -// pBody, sizeof(CThostFtdcQryTradingAccountField), nullptr, 0, nullptr, 0); +// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryTradeField, m_msgQueue_Query, this, 0, 0, +// pBody, sizeof(CThostFtdcQryTradeField), nullptr, 0, nullptr, 0); //} -int CTraderApi::_ReqQryTradingAccount(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +int CTraderApi::_ReqQryTrade(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { - CThostFtdcQryTradingAccountField body = { 0 }; + CThostFtdcQryTradeField body = { 0 }; strcpy(body.BrokerID, m_RspUserLogin.BrokerID); strcpy(body.InvestorID, m_RspUserLogin.UserID); - return m_pApi->ReqQryTradingAccount(&body, ++m_lRequestID); + return m_pApi->ReqQryTrade(&body, ++m_lRequestID); } -void CTraderApi::OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +void CTraderApi::OnTrade(CThostFtdcTradeField *pTrade, int nRequestID, bool bIsLast) { - if (!IsErrorRspInfo("OnRspQryTradingAccount",pRspInfo, nRequestID, bIsLast)) + if (nullptr == pTrade) { - if (pTradingAccount) - { - AccountField* pField = (AccountField*)m_msgQueue->new_block(sizeof(AccountField)); - - strcpy(pField->AccountID, pTradingAccount->AccountID); - pField->PreBalance = pTradingAccount->PreBalance; - pField->CurrMargin = pTradingAccount->CurrMargin; - pField->Commission = pTradingAccount->Commission; - pField->CloseProfit = pTradingAccount->CloseProfit; - pField->PositionProfit = pTradingAccount->PositionProfit; - pField->Balance = pTradingAccount->Balance; - pField->Available = pTradingAccount->Available; - - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryTradingAccount, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(AccountField), nullptr, 0, nullptr, 0); - } - else + if (nRequestID != 0) { - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryTradingAccount, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryTrade, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); } + return; } -} - -//void CTraderApi::ReqQryInvestorPosition(const string& szInstrumentId, const string& szExchange) -//{ -// CThostFtdcQryInvestorPositionField* pBody = (CThostFtdcQryInvestorPositionField*)m_msgQueue_Query->new_block(sizeof(CThostFtdcQryInvestorPositionField)); -// -// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID,sizeof(TThostFtdcBrokerIDType)); -// strncpy(pBody->InvestorID, m_RspUserLogin.UserID,sizeof(TThostFtdcInvestorIDType)); -// strncpy(pBody->InstrumentID,szInstrumentId.c_str(),sizeof(TThostFtdcInstrumentIDType)); -// -// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryInvestorPositionField, m_msgQueue_Query, this, 0, 0, -// pBody, sizeof(CThostFtdcQryInvestorPositionField), nullptr, 0, nullptr, 0); -//} - -int CTraderApi::_ReqQryInvestorPosition(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - ReqQueryField* pQuery = (ReqQueryField*)ptr1; - - CThostFtdcQryInvestorPositionField body = { 0 }; - - strncpy(body.BrokerID, m_RspUserLogin.BrokerID, sizeof(TThostFtdcBrokerIDType)); - strncpy(body.InvestorID, m_RspUserLogin.UserID, sizeof(TThostFtdcInvestorIDType)); - strncpy(body.InstrumentID, pQuery->InstrumentID, sizeof(TThostFtdcInstrumentIDType)); - return m_pApi->ReqQryInvestorPosition(&body, ++m_lRequestID); -} + TradeField* pField = (TradeField*)m_msgQueue->new_block(sizeof(TradeField)); + strcpy(pField->InstrumentID, pTrade->InstrumentID); + strcpy(pField->ExchangeID, pTrade->ExchangeID); + strcpy(pField->AccountID, pTrade->InvestorID); + pField->Side = TThostFtdcDirectionType_2_OrderSide(pTrade->Direction); + pField->Qty = pTrade->Volume; + pField->Price = pTrade->Price; + pField->OpenClose = TThostFtdcOffsetFlagType_2_OpenCloseType(pTrade->OffsetFlag); + pField->HedgeFlag = TThostFtdcHedgeFlagType_2_HedgeFlagType(pTrade->HedgeFlag); + pField->Commission = 0;//TODO收续费以后要计算出来 + pField->Time = GetTime(pTrade->TradeTime); + strcpy(pField->TradeID, pTrade->TradeID); -// 如果是请求查询,就将数据全部返回 -// 如果是后期的成交回报,就只返回更新的记录 -// 对于中金所,同时有今昨两天的持仓时,只返回今天的两条多空数据 -// 对于上期所,目前没条件测,当成是也只有两条 -void CTraderApi::OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - if (!IsErrorRspInfo("OnRspQryInvestorPosition", pRspInfo, nRequestID, bIsLast)) + if (nRequestID == 0) { - if (pInvestorPosition) + OrderIDType orderSysId = { 0 }; + sprintf(orderSysId, "%s:%s:%s", pTrade->ExchangeID, pTrade->InstrumentID, pTrade->OrderSysID); + unordered_map::iterator it = m_sysId_orderId.find(orderSysId); + if (it == m_sysId_orderId.end()) { - PositionIDType positionId = { 0 }; - sprintf(positionId, "%s:%s:%d:%c", - pInvestorPosition->ExchangeID, - pInvestorPosition->InstrumentID, - TThostFtdcPosiDirectionType_2_PositionSide(pInvestorPosition->PosiDirection), - pInvestorPosition->HedgeFlag); - - PositionField* pField = nullptr; - unordered_map::iterator it = m_id_platform_position.find(positionId); - if (it == m_id_platform_position.end()) - { - pField = (PositionField*)m_msgQueue->new_block(sizeof(PositionField)); + // 此成交找不到对应的报单 + //assert(false); + } + else + { + // 找到对应的报单 + strcpy(pField->ID, it->second.c_str()); - //sprintf(pField->Symbol, "%s.%s", pInvestorPosition->InstrumentID, pInvestorPosition->ExchangeID); - strcpy(pField->Symbol, pInvestorPosition->InstrumentID); - strcpy(pField->InstrumentID, pInvestorPosition->InstrumentID); - strcpy(pField->ExchangeID, pInvestorPosition->ExchangeID); - pField->Side = TThostFtdcPosiDirectionType_2_PositionSide(pInvestorPosition->PosiDirection); - pField->HedgeFlag = TThostFtdcHedgeFlagType_2_HedgeFlagType(pInvestorPosition->HedgeFlag); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnTrade, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); - m_id_platform_position.insert(pair(positionId, pField)); + unordered_map::iterator it2 = m_id_platform_order.find(it->second); + if (it2 == m_id_platform_order.end()) + { + // 此成交找不到对应的报单 + //assert(false); } else { - pField = it->second; + // 更新订单的状态 + // 是否要通知接口 } - pField->Position = pInvestorPosition->Position; - pField->TodayPosition = pInvestorPosition->TodayPosition; - pField->HistoryPosition = pInvestorPosition->Position - pInvestorPosition->TodayPosition; - - // 等数据收集全了再遍历通知一次,为何要这样做?因为今昨是两条记录,但我记在一个里面 - if (bIsLast) - { - int cnt = 0; - size_t count = m_id_platform_position.size(); - for (unordered_map::iterator iter = m_id_platform_position.begin(); iter != m_id_platform_position.end(); iter++) - { - ++cnt; - m_msgQueue->Input_Copy(ResponeType::OnRspQryInvestorPosition, m_msgQueue, m_pClass, cnt == count, 0, iter->second, sizeof(PositionField), nullptr, 0, nullptr, 0); - } - } - //XRespone(ResponeType::OnRspQryInvestorPosition, m_msgQueue, this, bIsLast, 0, pField, sizeof(PositionField), nullptr, 0, nullptr, 0); - } - else - { - m_msgQueue->Input_Copy(ResponeType::OnRspQryInvestorPosition, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + // 实时根据本地持仓进行计算 + //OnTrade(pField); } } -} + else + { + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryTrade, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); + } -void CTraderApi::ReqQuery(QueryType type, ReqQueryField* pQuery) -{ - m_msgQueue_Query->Input_Copy(type, m_msgQueue_Query, this, 0, 0, - pQuery, sizeof(ReqQueryField), nullptr, 0, nullptr, 0); + // 清理内存 + m_msgQueue->delete_block(pField); } -//void CTraderApi::ReqQryInstrument(ReqQueryField* pQuery) -//{ -// CThostFtdcQryInstrumentField* pBody = (CThostFtdcQryInstrumentField*)m_msgQueue_Query->new_block(sizeof(CThostFtdcQryInstrumentField)); -// -// //strncpy(pBody->InstrumentID,szInstrumentId.c_str(),sizeof(TThostFtdcInstrumentIDType)); -// //strncpy(pBody->ExchangeID, szExchange.c_str(), sizeof(TThostFtdcExchangeIDType)); -// -// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryInstrumentField, m_msgQueue_Query, this, 0, 0, -// pBody, sizeof(CThostFtdcQryInstrumentField), nullptr, 0, nullptr, 0); -//} - -int CTraderApi::_ReqQryInstrument(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +void CTraderApi::OnTrade(TradeField *pTrade) { - ReqQueryField* pQuery = (ReqQueryField*)ptr1; - - CThostFtdcQryInstrumentField body = {0}; - strncpy(body.InstrumentID, pQuery->InstrumentID, sizeof(TThostFtdcInstrumentIDType)); - strncpy(body.ExchangeID, pQuery->ExchangeID, sizeof(TThostFtdcExchangeIDType)); - - return m_pApi->ReqQryInstrument(&body, ++m_lRequestID); -} + PositionIDType positionId = { 0 }; + sprintf(positionId, "%s:%s:%d:%d", + pTrade->ExchangeID, pTrade->InstrumentID, TradeField_2_PositionSide(pTrade), pTrade->HedgeFlag); -void CTraderApi::OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - if (!IsErrorRspInfo("OnRspQryInstrument", pRspInfo, nRequestID, bIsLast)) + PositionField* pField = nullptr; + unordered_map::iterator it = m_id_platform_position.find(positionId); + if (it == m_id_platform_position.end()) { - if (pInstrument) - { - InstrumentField* pField = (InstrumentField*)m_msgQueue->new_block(sizeof(InstrumentField)); - - strncpy(pField->InstrumentID, pInstrument->InstrumentID, sizeof(InstrumentIDType)); - strncpy(pField->ExchangeID, pInstrument->ExchangeID, sizeof(ExchangeIDType)); + pField = (PositionField*)m_msgQueue->new_block(sizeof(PositionField)); - strncpy(pField->Symbol, pInstrument->InstrumentID, sizeof(SymbolType)); - strncpy(pField->ProductID, pInstrument->ProductID, sizeof(InstrumentIDType)); + strcpy(pField->Symbol, pTrade->InstrumentID); + strcpy(pField->InstrumentID, pTrade->InstrumentID); + strcpy(pField->ExchangeID, pTrade->ExchangeID); + strcpy(pField->AccountID, pTrade->AccountID); + pField->Side = TradeField_2_PositionSide(pTrade); + pField->HedgeFlag = pTrade->HedgeFlag; - strncpy(pField->InstrumentName, pInstrument->InstrumentName, sizeof(InstrumentNameType)); - pField->Type = CThostFtdcInstrumentField_2_InstrumentType(pInstrument); - pField->VolumeMultiple = pInstrument->VolumeMultiple; - pField->PriceTick = pInstrument->PriceTick; - pField->ExpireDate = GetDate(pInstrument->ExpireDate); - pField->OptionsType = TThostFtdcOptionsTypeType_2_PutCall(pInstrument->OptionsType); - pField->StrikePrice = (pInstrument->StrikePrice < DBL_EPSILON || pInstrument->StrikePrice == DBL_MAX) ? 0 : pInstrument->StrikePrice; - strcpy(pField->UnderlyingInstrID, pInstrument->UnderlyingInstrID); + m_id_platform_position.insert(pair(positionId, pField)); + } + else + { + pField = it->second; + } - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InstrumentField), nullptr, 0, nullptr, 0); + if (pTrade->OpenClose == OpenCloseType::OpenCloseType_Open) + { + pField->Position += pTrade->Qty; + pField->TodayPosition += pTrade->Qty; + } + else + { + pField->Position -= pTrade->Qty; + if (pTrade->OpenClose == OpenCloseType::OpenCloseType_CloseToday) + { + pField->TodayPosition -= pTrade->Qty; } else { - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + pField->HistoryPosition -= pTrade->Qty; + // 如果昨天的被减成负数,从今天开始继续减 + if (pField->HistoryPosition < 0) + { + pField->TodayPosition += pField->HistoryPosition; + pField->HistoryPosition = 0; + } + } + + // 计算错误,直接重新查询 + if (pField->Position < 0 || pField->TodayPosition < 0 || pField->HistoryPosition < 0) + { + //ReqQryInvestorPosition("", ""); + ReqQueryField body = { 0 }; + ReqQuery(QueryType::QueryType_ReqQryInvestorPosition, &body); + return; } } + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryInvestorPosition, m_msgQueue, m_pClass, false, 0, pField, sizeof(PositionField), nullptr, 0, nullptr, 0); } -//void CTraderApi::ReqQryInstrumentCommissionRate(const string& szInstrumentId) -//{ -// CThostFtdcQryInstrumentCommissionRateField body = {0}; -// -// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID,sizeof(TThostFtdcBrokerIDType)); -// strncpy(pBody->InvestorID, m_RspUserLogin.UserID,sizeof(TThostFtdcInvestorIDType)); -// strncpy(pBody->InstrumentID,szInstrumentId.c_str(),sizeof(TThostFtdcInstrumentIDType)); -//} -// -//void CTraderApi::OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -//{ -// -//} +void CTraderApi::OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + if (!IsErrorRspInfo("OnRspQryTrade", pRspInfo, nRequestID, bIsLast)) + { + OnTrade(pTrade, nRequestID, bIsLast); + } +} -//void CTraderApi::ReqQryInstrumentMarginRate(const string& szInstrumentId,TThostFtdcHedgeFlagType HedgeFlag) +//void CTraderApi::ReqQryQuote() //{ -// CThostFtdcQryInstrumentMarginRateField body = {0}; +// CThostFtdcQryQuoteField* pBody = (CThostFtdcQryQuoteField*)m_msgQueue_Query->new_block(sizeof(CThostFtdcQryQuoteField)); // -// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID,sizeof(TThostFtdcBrokerIDType)); -// strncpy(pBody->InvestorID, m_RspUserLogin.UserID,sizeof(TThostFtdcInvestorIDType)); -// strncpy(pBody->InstrumentID,szInstrumentId.c_str(),sizeof(TThostFtdcInstrumentIDType)); -// pBody->HedgeFlag = HedgeFlag; +// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID, sizeof(TThostFtdcBrokerIDType)); +// strncpy(pBody->InvestorID, m_RspUserLogin.UserID, sizeof(TThostFtdcInvestorIDType)); // -// //AddToSendQueue(pRequest); +// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryQuoteField, m_msgQueue_Query, this, 0, 0, +// pBody, sizeof(CThostFtdcQryQuoteField), nullptr, 0, nullptr, 0); //} -//void CTraderApi::OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -//{ -// -//} -// +#ifdef HAS_InstrumentStatus +void CTraderApi::OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) +{ +} +#endif // HAS_InstrumentStatus -int CTraderApi::_ReqQrySettlementInfo(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +int CTraderApi::_ReqQryInvestor(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { - ReqQueryField* pQuery = (ReqQueryField*)ptr1; + CThostFtdcQryInvestorField body = { 0 }; - CThostFtdcQrySettlementInfoField body = { 0 }; - strncpy(body.BrokerID, m_RspUserLogin.BrokerID, sizeof(TThostFtdcBrokerIDType)); - strncpy(body.InvestorID, m_RspUserLogin.UserID, sizeof(TThostFtdcInvestorIDType)); - sprintf_s(body.TradingDay, "%d", pQuery->DateStart); + strcpy(body.BrokerID, m_RspUserLogin.BrokerID); + strcpy(body.InvestorID, m_RspUserLogin.UserID); - return m_pApi->ReqQrySettlementInfo(&body, ++m_lRequestID); + return m_pApi->ReqQryInvestor(&body, ++m_lRequestID); } -vector vct_SettlementInfo; - -void CTraderApi::OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +void CTraderApi::OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { - if (!IsErrorRspInfo("OnRspQrySettlementInfo", pRspInfo, nRequestID, bIsLast)) + if (!IsErrorRspInfo("OnRspQryInvestor", pRspInfo, nRequestID, bIsLast)) { - if (pSettlementInfo) + if (pInvestor) { - CThostFtdcSettlementInfoField* pField = new CThostFtdcSettlementInfoField; - memcpy(pField, pSettlementInfo, sizeof(CThostFtdcSettlementInfoField)); - vct_SettlementInfo.push_back(pField); + memcpy(&m_Investor, pInvestor, sizeof(CThostFtdcInvestorField)); - if (bIsLast) - { - int len = 0; - for (vector::iterator it = vct_SettlementInfo.begin(); it != vct_SettlementInfo.end(); ++it) - { - CThostFtdcSettlementInfoField* p = *it; - len += sizeof(p->Content); - } + InvestorField* pField = (InvestorField*)m_msgQueue->new_block(sizeof(InvestorField)); - SettlementInfoField* pField = (SettlementInfoField*)m_msgQueue->new_block(sizeof(SettlementInfoField)+len); - pField->TradingDay = atoi(pSettlementInfo->TradingDay); - pField->Size = sizeof(SettlementInfoField)+len; - char* pContent = (((char*)pField) + sizeof(SettlementInfoField)); - memset(pContent, 0, len); - for (vector::iterator it = vct_SettlementInfo.begin(); it != vct_SettlementInfo.end(); ++it) - { - CThostFtdcSettlementInfoField* p = *it; - strcat(pContent, p->Content); - } - m_msgQueue->Input_NoCopy(ResponeType::OnRspQrySettlementInfo, m_msgQueue, this, bIsLast, 0, pField, pField->Size, nullptr, 0, nullptr, 0); + strcpy(pField->BrokerID, pInvestor->BrokerID); + strcpy(pField->InvestorID, pInvestor->InvestorID); + strcpy(pField->InvestorName, pInvestor->InvestorName); + strcpy(pField->IdentifiedCardNo, pInvestor->IdentifiedCardNo); + pField->IdentifiedCardType = TThostFtdcIdCardTypeType_2_IdCardType(pInvestor->IdentifiedCardType); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInvestor, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InvestorField), nullptr, 0, nullptr, 0); + +#ifdef ENABLE_LICENSE + // 这里不使用pInvestor->InvestorID,因为有可能股东代码与登录账号不一样 + if (m_pLicense->HasSaved()) + { + m_pLicense->AddUser(m_UserInfo.UserID, pField->InvestorName); + m_pLicense->SaveIni(); } - //SettlementInfoField field = { 0 }; - //strncpy(field.TradingDay, pSettlementInfo->TradingDay, sizeof(TThostFtdcDateType)); - //strncpy(field.Content, pSettlementInfo->Content, sizeof(TThostFtdcContentType)); - //m_msgQueue->Input_Copy(ResponeType::OnRspQrySettlementInfo, m_msgQueue, this, bIsLast, 0, &field, sizeof(SettlementInfoField), nullptr, 0, nullptr, 0); + m_pLicense->SetSendOrderFlag(true); + int err = m_pLicense->GetErrorCodeByNameThenAccount(pField->InvestorName, m_UserInfo.UserID); + if (err < 0) + { + m_pLicense->SetSendOrderFlag(false); + + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + pField->RawErrorID = err; + strncpy(pField->Text, m_pLicense->GetErrorInfo(), sizeof(Char256Type)); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + + //IsErrorRspInfo("") + } +#endif } else { - m_msgQueue->Input_NoCopy(ResponeType::OnRspQrySettlementInfo, m_msgQueue, this, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInvestor, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); } } } -void CTraderApi::OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +#ifdef HAS_Quote +char* CTraderApi::ReqQuoteInsert( + QuoteField* pQuote, + OrderIDType* pAskRef, + OrderIDType* pBidRef) { - IsErrorRspInfo("OnRspError", pRspInfo, nRequestID, bIsLast); -} - -//void CTraderApi::ReqQryOrder() -//{ -// CThostFtdcQryOrderField* pBody = (CThostFtdcQryOrderField*)m_msgQueue_Query->new_block(sizeof(CThostFtdcQryOrderField)); -// -// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID, sizeof(TThostFtdcBrokerIDType)); -// strncpy(pBody->InvestorID, m_RspUserLogin.UserID, sizeof(TThostFtdcInvestorIDType)); -// -// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryOrderField, m_msgQueue_Query, this, 0, 0, -// pBody, sizeof(CThostFtdcQryOrderField), nullptr, 0, nullptr, 0); -//} + int QuoteRef = -1; + if (nullptr == m_pApi) + return nullptr; -int CTraderApi::_ReqQryOrder(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - CThostFtdcQryOrderField body = { 0 }; + CThostFtdcInputQuoteField body = { 0 }; strcpy(body.BrokerID, m_RspUserLogin.BrokerID); strcpy(body.InvestorID, m_RspUserLogin.UserID); - return m_pApi->ReqQryOrder(&body, ++m_lRequestID); -} + //合约,目前只从订单1中取 + strncpy(body.InstrumentID, pQuote->InstrumentID, sizeof(TThostFtdcInstrumentIDType)); -void CTraderApi::OnOrder(CThostFtdcOrderField *pOrder, int nRequestID, bool bIsLast) -{ - if (nullptr == pOrder) - return; +#ifdef HAS_ExchangeID_Quote + strncpy(body.ExchangeID, pQuote->ExchangeID, sizeof(TThostFtdcExchangeIDType)); +#endif // HAS_ExchangeID + + //开平 + body.AskOffsetFlag = OpenCloseType_2_TThostFtdcOffsetFlagType(pQuote->AskOpenClose); + body.BidOffsetFlag = OpenCloseType_2_TThostFtdcOffsetFlagType(pQuote->BidOpenClose); + //投保 + body.AskHedgeFlag = HedgeFlagType_2_TThostFtdcHedgeFlagType(pQuote->AskHedgeFlag); + body.BidHedgeFlag = HedgeFlagType_2_TThostFtdcHedgeFlagType(pQuote->BidHedgeFlag); + + //价格 + body.AskPrice = pQuote->AskPrice; + body.BidPrice = pQuote->BidPrice; + + //数量 + body.AskVolume = (int)pQuote->AskQty; + body.BidVolume = (int)pQuote->BidQty; +#ifdef HAS_ExchangeID_Quote_ForQuoteSysID + strncpy(body.ForQuoteSysID, pQuote->QuoteReqID, sizeof(TThostFtdcOrderSysIDType)); +#endif // HAS_ExchangeID_Quote_ForQuoteSysID - OrderIDType orderId = { 0 }; - sprintf(orderId, "%d:%d:%s", pOrder->FrontID, pOrder->SessionID, pOrder->OrderRef); - OrderIDType orderSydId = { 0 }; + + int nRet = 0; { - // 保存原始订单信息,用于撤单 + //可能报单太快,m_nMaxOrderRef还没有改变就提交了 + lock_guard cl(m_csOrderRef); - unordered_map::iterator it = m_id_api_order.find(orderId); - if (it == m_id_api_order.end()) + if (QuoteRef < 0) { - // 找不到此订单,表示是新单 - CThostFtdcOrderField* pField = new CThostFtdcOrderField(); - memcpy(pField, pOrder, sizeof(CThostFtdcOrderField)); - m_id_api_order.insert(pair(orderId, pField)); + nRet = m_nMaxOrderRef; + sprintf(body.QuoteRef, "%d", m_nMaxOrderRef); + sprintf(body.AskOrderRef, "%d", m_nMaxOrderRef); + sprintf(body.BidOrderRef, "%d", ++m_nMaxOrderRef); + ++m_nMaxOrderRef; } else { - // 找到了订单 - // 需要再复制保存最后一次的状态,还是只要第一次的用于撤单即可?记下,这样最后好比较 - CThostFtdcOrderField* pField = it->second; - memcpy(pField, pOrder, sizeof(CThostFtdcOrderField)); + nRet = QuoteRef; + sprintf(body.QuoteRef, "%d", QuoteRef); + sprintf(body.AskOrderRef, "%d", QuoteRef); + sprintf(body.BidOrderRef, "%d", ++QuoteRef); + ++QuoteRef; } - // 保存SysID用于定义成交回报与订单 - sprintf(orderSydId, "%s:%s:%s", pOrder->ExchangeID, pOrder->InstrumentID, pOrder->OrderSysID); - m_sysId_orderId.insert(pair(orderSydId, orderId)); + //不保存到队列,而是直接发送 + int n = m_pApi->ReqQuoteInsert(&body, ++m_lRequestID); + if (n < 0) + { + nRet = n; + return nullptr; + } + else + { + sprintf(m_orderInsert_Id, "%d:%d:%d", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, nRet); + + QuoteField* pField = (QuoteField*)m_msgQueue->new_block(sizeof(QuoteField)); + memcpy(pField, pQuote, sizeof(QuoteField)); + strcpy(pField->ID, m_orderInsert_Id); + strcpy(pField->LocalID, pField->ID); + strcpy(pField->AskID, m_orderInsert_Id); + sprintf(pField->BidID, "%d:%d:%d", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, nRet + 1); + + m_id_platform_quote.insert(pair(m_orderInsert_Id, pField)); + } } - { - // 从API的订单转换成自己的结构体 - if (nRequestID == 0) - { - OrderField* pField = nullptr; - unordered_map::iterator it = m_id_platform_order.find(orderId); - if (it == m_id_platform_order.end()) - { - pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); + return m_orderInsert_Id; +} - // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 - CThostFtdcOrderField_2_OrderField_0(orderId, pOrder, pField); +void CTraderApi::OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + OrderIDType quoteId = { 0 }; - // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 - m_id_platform_order.insert(pair(orderId, pField)); - } - else - { - pField = it->second; - strcpy(pField->ID, orderId); - strcpy(pField->LocalID, pField->ID); - pField->LeavesQty = pOrder->VolumeTotal; - pField->Price = pOrder->LimitPrice; - pField->Status = CThostFtdcOrderField_2_OrderStatus(pOrder); - pField->ExecType = CThostFtdcOrderField_2_ExecType(pOrder); - strcpy(pField->OrderID, pOrder->OrderSysID); - strncpy(pField->Text, pOrder->StatusMsg, sizeof(Char256Type)); - } + if (pInputQuote) + { + sprintf(quoteId, "%d:%d:%s", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, pInputQuote->QuoteRef); + } + else + { + IsErrorRspInfo("OnRspQuoteInsert", pRspInfo, nRequestID, bIsLast); + } - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); - } - else - { - OrderField* pField = nullptr; - pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); + unordered_map::iterator it = m_id_platform_quote.find(quoteId); + if (it == m_id_platform_quote.end()) + { + // 没找到?不应当,这表示出错了 + //assert(false); + } + else + { + // 找到了,要更新状态 + // 得使用上次的状态 + QuoteField* pField = it->second; + pField->ExecType = ExecType::ExecType_Rejected; + pField->Status = OrderStatus::OrderStatus_Rejected; + pField->RawErrorID = pRspInfo->ErrorID; + strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); + } +} - // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 - CThostFtdcOrderField_2_OrderField_0(orderId, pOrder, pField); +void CTraderApi::OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) +{ + OrderIDType quoteId = { 0 }; - // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 - //m_id_platform_order.insert(pair(orderId, pField)); + if (pInputQuote) + { + sprintf(quoteId, "%d:%d:%s", m_RspUserLogin.FrontID, m_RspUserLogin.SessionID, pInputQuote->QuoteRef); + } + else + { + IsErrorRspInfo("", pRspInfo, 0, true); + } + + unordered_map::iterator it = m_id_platform_quote.find(quoteId); + if (it == m_id_platform_quote.end()) + { + // 没找到?不应当,这表示出错了 + //assert(false); + } + else + { + // 找到了,要更新状态 + // 得使用上次的状态 + QuoteField* pField = it->second; + pField->ExecType = ExecType::ExecType_Rejected; + pField->Status = OrderStatus::OrderStatus_Rejected; + pField->RawErrorID = pRspInfo->ErrorID; + strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); + } +} - m_msgQueue->Input_Copy(ResponeType::OnRspQryOrder, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); +void CTraderApi::OnRtnQuote(CThostFtdcQuoteField *pQuote) +{ + OnQuote(pQuote, 0, true); +} - m_msgQueue->delete_block(pField); - } +int CTraderApi::ReqQuoteAction(const string& szId, OrderIDType* pOutput) +{ + unordered_map::iterator it = m_id_api_quote.find(szId); + if (it == m_id_api_quote.end()) + { + sprintf((char*)pOutput, "%d", -100); + return -100; + } + else + { + // 找到了订单 + ReqQuoteAction(it->second, pOutput); } + return 0; } -void CTraderApi::OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +int CTraderApi::ReqQuoteAction(CThostFtdcQuoteField *pQuote, OrderIDType* pOutput) { - if (!IsErrorRspInfo("OnRspQryOrder", pRspInfo, nRequestID, bIsLast)) - { - OnOrder(pOrder, nRequestID, bIsLast); - } -} + if (nullptr == m_pApi) + return 0; -//void CTraderApi::ReqQryTrade() -//{ -// CThostFtdcQryTradeField* pBody = (CThostFtdcQryTradeField*)m_msgQueue_Query->new_block(sizeof(CThostFtdcQryTradeField)); -// -// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID, sizeof(TThostFtdcBrokerIDType)); -// strncpy(pBody->InvestorID, m_RspUserLogin.UserID, sizeof(TThostFtdcInvestorIDType)); -// -// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryTradeField, m_msgQueue_Query, this, 0, 0, -// pBody, sizeof(CThostFtdcQryTradeField), nullptr, 0, nullptr, 0); -//} + CThostFtdcInputQuoteActionField body = { 0 }; -int CTraderApi::_ReqQryTrade(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - CThostFtdcQryTradeField body = { 0 }; + ///经纪公司代码 + strcpy(body.BrokerID, pQuote->BrokerID); + ///投资者代码 + strcpy(body.InvestorID, pQuote->InvestorID); + ///报单引用 + strcpy(body.QuoteRef, pQuote->QuoteRef); + ///前置编号 + body.FrontID = pQuote->FrontID; + ///会话编号 + body.SessionID = pQuote->SessionID; + ///交易所代码 + strcpy(body.ExchangeID, pQuote->ExchangeID); + ///报单编号 + strcpy(body.QuoteSysID, pQuote->QuoteSysID); + ///操作标志 + body.ActionFlag = THOST_FTDC_AF_Delete; + ///合约代码 + strcpy(body.InstrumentID, pQuote->InstrumentID); - strcpy(body.BrokerID, m_RspUserLogin.BrokerID); - strcpy(body.InvestorID, m_RspUserLogin.UserID); + int nRet = m_pApi->ReqQuoteAction(&body, ++m_lRequestID); + if (nRet < 0) + { + sprintf(m_orderAction_Id, "%d", nRet); + } + else + { + memset(m_orderAction_Id, 0, sizeof(OrderIDType)); + } + strncpy((char*)pOutput, m_orderAction_Id, sizeof(OrderIDType)); - return m_pApi->ReqQryTrade(&body, ++m_lRequestID); + return nRet; } -void CTraderApi::OnTrade(CThostFtdcTradeField *pTrade, int nRequestID, bool bIsLast) +void CTraderApi::OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { - if (nullptr == pTrade) - return; - - TradeField* pField = (TradeField*)m_msgQueue->new_block(sizeof(TradeField)); - strcpy(pField->InstrumentID, pTrade->InstrumentID); - strcpy(pField->ExchangeID, pTrade->ExchangeID); - pField->Side = TThostFtdcDirectionType_2_OrderSide(pTrade->Direction); - pField->Qty = pTrade->Volume; - pField->Price = pTrade->Price; - pField->OpenClose = TThostFtdcOffsetFlagType_2_OpenCloseType(pTrade->OffsetFlag); - pField->HedgeFlag = TThostFtdcHedgeFlagType_2_HedgeFlagType(pTrade->HedgeFlag); - pField->Commission = 0;//TODO收续费以后要计算出来 - pField->Time = GetTime(pTrade->TradeTime); - strcpy(pField->TradeID, pTrade->TradeID); - - if (nRequestID == 0) + OrderIDType quoteId = { 0 }; + if (pInputQuoteAction) { - OrderIDType orderSysId = { 0 }; - sprintf(orderSysId, "%s:%s:%s", pTrade->ExchangeID, pTrade->InstrumentID, pTrade->OrderSysID); - unordered_map::iterator it = m_sysId_orderId.find(orderSysId); - if (it == m_sysId_orderId.end()) - { - // 此成交找不到对应的报单 - //assert(false); - } - else - { - // 找到对应的报单 - strcpy(pField->ID, it->second.c_str()); - - m_msgQueue->Input_Copy(ResponeType::OnRtnTrade, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); - - unordered_map::iterator it2 = m_id_platform_order.find(it->second); - if (it2 == m_id_platform_order.end()) - { - // 此成交找不到对应的报单 - //assert(false); - } - else - { - // 更新订单的状态 - // 是否要通知接口 - } - - OnTrade(pField); - } + sprintf(quoteId, "%d:%d:%s", pInputQuoteAction->FrontID, pInputQuoteAction->SessionID, pInputQuoteAction->QuoteRef); } else { - m_msgQueue->Input_Copy(ResponeType::OnRspQryOrder, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); + IsErrorRspInfo("OnRspQuoteAction", pRspInfo, nRequestID, bIsLast); } - // 清理内存 - m_msgQueue->delete_block(pField); + unordered_map::iterator it = m_id_platform_quote.find(quoteId); + if (it == m_id_platform_quote.end()) + { + // 没找到?不应当,这表示出错了 + //assert(false); + } + else + { + // 找到了,要更新状态 + // 得使用上次的状态 + QuoteField* pField = it->second; + strcpy(pField->ID, quoteId); + strcpy(pField->LocalID, pField->ID); + //sprintf(pField->AskID, "%d:%d:%s", pInputQuoteAction->FrontID, pInputQuoteAction->SessionID, pInputQuoteAction->); + //sprintf(pField->BidID, "%d:%d:%s", pInputQuoteAction->FrontID, pInputQuoteAction->SessionID, pInputQuoteAction->QuoteRef); + pField->ExecType = ExecType::ExecType_CancelReject; + pField->RawErrorID = pRspInfo->ErrorID; + strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); + } } -void CTraderApi::OnTrade(TradeField *pTrade) +void CTraderApi::OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) { - PositionIDType positionId = { 0 }; - sprintf(positionId, "%s:%s:%d:%c", - pTrade->ExchangeID, pTrade->InstrumentID, TradeField_2_PositionSide(pTrade), pTrade->HedgeFlag); + OrderIDType quoteId = { 0 }; - PositionField* pField = nullptr; - unordered_map::iterator it = m_id_platform_position.find(positionId); - if (it == m_id_platform_position.end()) + if (pQuoteAction) { - pField = (PositionField*)m_msgQueue->new_block(sizeof(PositionField)); - - strcpy(pField->Symbol, pTrade->InstrumentID); - strcpy(pField->InstrumentID, pTrade->InstrumentID); - strcpy(pField->ExchangeID, pTrade->ExchangeID); - pField->Side = TradeField_2_PositionSide(pTrade); - pField->HedgeFlag = TThostFtdcHedgeFlagType_2_HedgeFlagType(pTrade->HedgeFlag); - - m_id_platform_position.insert(pair(positionId, pField)); + sprintf(quoteId, "%d:%d:%s", pQuoteAction->FrontID, pQuoteAction->SessionID, pQuoteAction->QuoteRef); } else { - pField = it->second; + IsErrorRspInfo("OnRspQuoteAction", pRspInfo, 0, true); } - if (pTrade->OpenClose == OpenCloseType::OpenCloseType_Open) + unordered_map::iterator it = m_id_platform_quote.find(quoteId); + if (it == m_id_platform_quote.end()) { - pField->Position += pTrade->Qty; - pField->TodayPosition += pTrade->Qty; + // 没找到?不应当,这表示出错了 + //assert(false); } else { - pField->Position -= pTrade->Qty; - if (pTrade->OpenClose == OpenCloseType::OpenCloseType_CloseToday) - { - pField->TodayPosition -= pTrade->Qty; - } - else - { - pField->HistoryPosition -= pTrade->Qty; - // 如果昨天的被减成负数,从今天开始继续减 - if (pField->HistoryPosition<0) - { - pField->TodayPosition += pField->HistoryPosition; - pField->HistoryPosition = 0; - } - } - - // 计算错误,直接重新查询 - if (pField->Position < 0 || pField->TodayPosition < 0 || pField->HistoryPosition < 0) - { - //ReqQryInvestorPosition("", ""); - ReqQueryField body = { 0 }; - ReqQuery(QueryType::ReqQryInvestorPosition, &body); - return; - } + // 找到了,要更新状态 + // 得使用上次的状态 + QuoteField* pField = it->second; + strcpy(pField->ID, quoteId); + strcpy(pField->LocalID, pField->ID); + pField->ExecType = ExecType::ExecType_CancelReject; + pField->RawErrorID = pRspInfo->ErrorID; + strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); } - - m_msgQueue->Input_Copy(ResponeType::OnRspQryInvestorPosition, m_msgQueue, m_pClass, false, 0, pField, sizeof(PositionField), nullptr, 0, nullptr, 0); } -void CTraderApi::OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +void CTraderApi::OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) { - if (!IsErrorRspInfo("OnRspQryTrade", pRspInfo, nRequestID, bIsLast)) + if (!IsErrorRspInfo("OnRspQryQuote", pRspInfo, nRequestID, bIsLast)) { - OnTrade(pTrade, nRequestID, bIsLast); + OnQuote(pQuote, nRequestID, bIsLast); } } -//void CTraderApi::ReqQryQuote() -//{ -// CThostFtdcQryQuoteField* pBody = (CThostFtdcQryQuoteField*)m_msgQueue_Query->new_block(sizeof(CThostFtdcQryQuoteField)); -// -// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID, sizeof(TThostFtdcBrokerIDType)); -// strncpy(pBody->InvestorID, m_RspUserLogin.UserID, sizeof(TThostFtdcInvestorIDType)); -// -// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryQuoteField, m_msgQueue_Query, this, 0, 0, -// pBody, sizeof(CThostFtdcQryQuoteField), nullptr, 0, nullptr, 0); -//} - int CTraderApi::_ReqQryQuote(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { CThostFtdcQryQuoteField body = { 0 }; @@ -1676,7 +2161,13 @@ int CTraderApi::_ReqQryQuote(char type, void* pApi1, void* pApi2, double double1 void CTraderApi::OnQuote(CThostFtdcQuoteField *pQuote, int nRequestID, bool bIsLast) { if (nullptr == pQuote) + { + if (nRequestID != 0) + { + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryQuote, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } return; + } OrderIDType quoteId = { 0 }; sprintf(quoteId, "%d:%d:%s", pQuote->FrontID, pQuote->SessionID, pQuote->QuoteRef); @@ -1722,6 +2213,7 @@ void CTraderApi::OnQuote(CThostFtdcQuoteField *pQuote, int nRequestID, bool bIsL strcpy(pField->InstrumentID, pQuote->InstrumentID); strcpy(pField->ExchangeID, pQuote->ExchangeID); + strcpy(pField->AccountID, pQuote->InvestorID); pField->AskQty = pQuote->AskVolume; pField->AskPrice = pQuote->AskPrice; @@ -1763,7 +2255,7 @@ void CTraderApi::OnQuote(CThostFtdcQuoteField *pQuote, int nRequestID, bool bIsL strncpy(pField->Text, pQuote->StatusMsg, sizeof(Char256Type)); } - m_msgQueue->Input_Copy(ResponeType::OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); } else { @@ -1776,6 +2268,7 @@ void CTraderApi::OnQuote(CThostFtdcQuoteField *pQuote, int nRequestID, bool bIsL strcpy(pField->InstrumentID, pQuote->InstrumentID); strcpy(pField->ExchangeID, pQuote->ExchangeID); + strcpy(pField->AccountID, pQuote->InvestorID); pField->AskQty = pQuote->AskVolume; pField->AskPrice = pQuote->AskPrice; @@ -1803,68 +2296,11 @@ void CTraderApi::OnQuote(CThostFtdcQuoteField *pQuote, int nRequestID, bool bIsL // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 //m_id_platform_quote.insert(pair(quoteId, pField)); - m_msgQueue->Input_Copy(ResponeType::OnRspQryQuote, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryQuote, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); m_msgQueue->delete_block(pField); } } } } - -void CTraderApi::OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - if (!IsErrorRspInfo("OnRspQryQuote", pRspInfo, nRequestID, bIsLast)) - { - OnQuote(pQuote, nRequestID, bIsLast); - } -} - -void CTraderApi::OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) -{ -} - -//void CTraderApi::ReqQryInvestor() -//{ -// CThostFtdcQryInvestorField* pBody = (CThostFtdcQryInvestorField*)m_msgQueue_Query->new_block(sizeof(CThostFtdcQryInvestorField)); -// -// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID, sizeof(TThostFtdcBrokerIDType)); -// strncpy(pBody->InvestorID, m_RspUserLogin.UserID, sizeof(TThostFtdcInvestorIDType)); -// -// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryInvestorField, m_msgQueue_Query, this, 0, 0, -// pBody, sizeof(CThostFtdcQryInvestorField), nullptr, 0, nullptr, 0); -//} - -int CTraderApi::_ReqQryInvestor(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) -{ - CThostFtdcQryInvestorField body = { 0 }; - - strcpy(body.BrokerID, m_RspUserLogin.BrokerID); - strcpy(body.InvestorID, m_RspUserLogin.UserID); - - return m_pApi->ReqQryInvestor(&body, ++m_lRequestID); -} - -void CTraderApi::OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - if (!IsErrorRspInfo("OnRspQryInvestor", pRspInfo, nRequestID, bIsLast)) - { - if (pInvestor) - { - memcpy(&m_Investor, pInvestor, sizeof(CThostFtdcInvestorField)); - - InvestorField* pField = (InvestorField*)m_msgQueue->new_block(sizeof(InvestorField)); - - strcpy(pField->BrokerID, pInvestor->BrokerID); - strcpy(pField->InvestorID, pInvestor->InvestorID); - strcpy(pField->InvestorName, pInvestor->InvestorName); - strcpy(pField->IdentifiedCardNo, pInvestor->IdentifiedCardNo); - pField->IdentifiedCardType = TThostFtdcIdCardTypeType_2_IdCardType(pInvestor->IdentifiedCardType); - - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInvestor, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InvestorField), nullptr, 0, nullptr, 0); - } - else - { - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInvestor, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); - } - } -} +#endif // HAS_Quote \ No newline at end of file diff --git a/QuantBox_CTP_Trade/TraderApi.h b/apis/CTP/Trade/TraderApi.h similarity index 79% rename from QuantBox_CTP_Trade/TraderApi.h rename to apis/CTP/Trade/TraderApi.h index 83cf596..e6a9bf4 100644 --- a/QuantBox_CTP_Trade/TraderApi.h +++ b/apis/CTP/Trade/TraderApi.h @@ -1,16 +1,11 @@ -#pragma once - -#include "../include/CTP/ThostFtdcTraderApi.h" -#include "../include/ApiStruct.h" -#include "../include/QueueEnum.h" - -#ifdef _WIN64 -#pragma comment(lib, "../include/CTP/win64/thosttraderapi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x64.lib") -#else -#pragma comment(lib, "../include/CTP/win32/thosttraderapi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x86.lib") -#endif +#pragma once + +#include "../../include/ApiStruct.h" +#include "../../include/QueueEnum.h" +// 由于这个Include.h需要使用每个项目自己的文件,所以需要在VC++ Directories->Include Directories中添加一个"./" +#include "Include.h" + + #include @@ -26,15 +21,22 @@ using namespace std; class CMsgQueue; +#ifdef ENABLE_LICENSE +class CLicense; +#endif + + class CTraderApi : public CThostFtdcTraderSpi { - //ݰ + //请求数据包类型 enum RequestType { E_Init = 100, + E_Disconnect, E_ReqAuthenticateField, E_ReqUserLoginField, + E_UserLogoutField, E_SettlementInfoConfirmField, E_QryInvestorField, @@ -70,19 +72,20 @@ class CTraderApi : int count); void Disconnect(); - int ReqOrderInsert( + char* ReqOrderInsert( OrderField* pOrder, int count, - OrderIDType* pInOut); + char* pszLocalIDBuf); char* ReqParkedOrderInsert(int OrderRef, OrderField* pOrder1, OrderField* pOrder2); - int ReqOrderAction(OrderIDType* szIds, int count, OrderIDType* pOutput); + char* ReqOrderAction(OrderIDType* szIds, int count, char* pzsRtn); int ReqOrderAction(OrderField *pOrder, int count, OrderIDType* pOutput); - int ReqOrderAction(CThostFtdcOrderField *pOrder, int count, OrderIDType* pOutput); + char* ReqOrderAction(CThostFtdcOrderField *pOrder, int count, char* pzsRtn); +#ifdef HAS_Quote char* ReqQuoteInsert( QuoteField* pQuote, OrderIDType* pAskRef, @@ -90,6 +93,7 @@ class CTraderApi : int ReqQuoteAction(CThostFtdcQuoteField *pQuote, OrderIDType* pOutput); int ReqQuoteAction(const string& szId, OrderIDType* pOutput); +#endif // HAS_Quote //void ReqQryTradingAccount(); //void ReqQryInvestorPosition(const string& szInstrumentId, const string& szExchange); @@ -114,6 +118,8 @@ class CTraderApi : void Clear(); int _Init(); + void _Disconnect(bool IsInQueue); + void _DisconnectInThread(); void ReqAuthenticate(); int _ReqAuthenticate(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); @@ -121,101 +127,130 @@ class CTraderApi : void ReqUserLogin(); int _ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + void ReqUserLogout(); + int _ReqUserLogout(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + +#ifdef HAS_Settlement void ReqSettlementInfoConfirm(); int _ReqSettlementInfoConfirm(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + int _ReqQrySettlementInfo(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); +#endif // HAS_Settlement + int _ReqQryInstrument(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); int _ReqQryTradingAccount(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); int _ReqQryInvestorPosition(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); int _ReqQryInvestor(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - int _ReqQrySettlementInfo(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - + int _ReqQryOrder(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); int _ReqQryTrade(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - int _ReqQryQuote(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - + void OnOrder(CThostFtdcOrderField *pOrder, int nRequestID, bool bIsLast); void OnTrade(CThostFtdcTradeField *pTrade, int nRequestID, bool bIsLast); - void OnQuote(CThostFtdcQuoteField *pQuote, int nRequestID, bool bIsLast); + void OnTrade(TradeField *pTrade); - //Ƿ - bool IsErrorRspInfo(const char* szSource, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);//ϢϢ - bool IsErrorRspInfo(CThostFtdcRspInfoField *pRspInfo);//Ϣ + //检查是否出错 + bool IsErrorRspInfo(const char* szSource, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);//向消息队列输出信息 + bool IsErrorRspInfo(CThostFtdcRspInfoField *pRspInfo);//不输出信息 - // + //连接 virtual void OnFrontConnected(); virtual void OnFrontDisconnected(int nReason); - //֤ + //认证 virtual void OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //µ + //下单 virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo); - // + //撤单 virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo); - //ر + //报单回报 virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnRtnOrder(CThostFtdcOrderField *pOrder); - //ɽر + //成交回报 virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnRtnTrade(CThostFtdcTradeField *pTrade); - //¼ +#ifdef HAS_Quote + int _ReqQryQuote(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + void OnQuote(CThostFtdcQuoteField *pQuote, int nRequestID, bool bIsLast); + + //报价录入 virtual void OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo); virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnRtnQuote(CThostFtdcQuoteField *pQuote); - //۳ + //报价撤单 virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); virtual void OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo); - //λ +#endif // HAS_Quote + +#ifdef HAS_Settlement + virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + //请求查询投资者结算结果响应 + virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + +#endif // HAS_Settlement + + + //仓位 virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //ʽ + //资金 virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //Լ + //合约、手续费 virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); //virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); //virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //ѯӦ + //查询行情响应 //virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - //ѯͶ߽Ӧ - virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - // + + //其它 virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); +#ifdef HAS_InstrumentStatus virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus); +#endif // HAS_InstrumentStatus + + + + // 今昨分开 + void GetPositionID(CThostFtdcInvestorPositionField *pInvestorPosition, PositionIDType positionId); + // 今昨一起 + void GetPositionID2(CThostFtdcInvestorPositionField *pInvestorPosition, PositionIDType positionId); + + void QueryOrderTrade(bool bForceQuery); private: - atomic m_lRequestID; //ID,ñ + //bool m_delete; + atomic m_lRequestID; //请求ID,得保持自增 - CThostFtdcRspUserLoginField m_RspUserLogin; //صĵ¼ɹӦĿǰôڳԱб + CThostFtdcRspUserLoginField m_RspUserLogin; //返回的登录成功响应,目前利用此内成员进行报单所属区分 CThostFtdcInvestorField m_Investor; OrderIDType m_orderInsert_Id; OrderIDType m_orderAction_Id; mutex m_csOrderRef; - int m_nMaxOrderRef; //ãֱ + int m_nMaxOrderRef; //报单引用,用于区分报单,保持自增 - CThostFtdcTraderApi* m_pApi; //API + CThostFtdcTraderApi* m_pApi; //交易API - string m_szPath; //ļ· + string m_szPath; //生成配置文件的路径 ServerInfoField m_ServerInfo; UserInfoField m_UserInfo; int m_nSleep; @@ -224,14 +259,21 @@ class CTraderApi : unordered_map m_id_api_order; unordered_map m_sysId_orderId; +#ifdef HAS_Quote unordered_map m_id_platform_quote; unordered_map m_id_api_quote; unordered_map m_sysId_quoteId; +#endif // HAS_Quote unordered_map m_id_platform_position; + unordered_map m_id_api_position; - CMsgQueue* m_msgQueue; //Ϣָ + CMsgQueue* m_msgQueue; //消息队列指针 CMsgQueue* m_msgQueue_Query; void* m_pClass; + +#ifdef ENABLE_LICENSE + CLicense* m_pLicense; +#endif }; diff --git a/QuantBox_CTP_Trade/main.cpp b/apis/CTP/Trade/main.cpp similarity index 57% rename from QuantBox_CTP_Trade/main.cpp rename to apis/CTP/Trade/main.cpp index a0f23ca..e9b8097 100644 --- a/QuantBox_CTP_Trade/main.cpp +++ b/apis/CTP/Trade/main.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../include/ApiHeader.h" -#include "../include/QueueEnum.h" +#include "../../include/ApiHeader.h" +#include "../../include/QueueEnum.h" #include "TraderApi.h" inline CTraderApi* GetApi(void* pApi) @@ -13,13 +13,13 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do RequestType rt = (RequestType)type; switch (rt) { - case GetApiType: + case RequestType_GetApiTypes: return (void*)(ApiType::ApiType_Trade | ApiType::ApiType_Instrument | ApiType::ApiType_Query); - case GetApiVersion: - return (void*)"0.4.0.20151124"; - case GetApiName: - return (void*)"CTP"; - case Create: + case RequestType_GetApiVersion: + return (void*)API_VERSION; + case RequestType_GetApiName: + return (void*)API_NAME; + case RequestType_Create: return new CTraderApi(); default: break; @@ -34,39 +34,37 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do switch (rt) { - case Release: + case RequestType_Release: delete pApi; return nullptr; - case Register: + case RequestType_Register: pApi->Register(ptr1, ptr2); break; - case Connect: + case RequestType_Connect: pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2,size2); break; - case Disconnect: + case RequestType_Disconnect: pApi->Disconnect(); break; - case ReqQryInstrument: - case ReqQryInvestorPosition: - case ReqQryTradingAccount: - case ReqQrySettlementInfo: + case QueryType_ReqQryInstrument: + case QueryType_ReqQryInvestorPosition: + case QueryType_ReqQryTradingAccount: + case QueryType_ReqQrySettlementInfo: + case QueryType_ReqQryTrade: + case QueryType_ReqQryOrder: pApi->ReqQuery((QueryType)type, (ReqQueryField*)ptr1); break; - case ReqOrderInsert: - if (double2 == 0) - { - return (void*)pApi->ReqOrderInsert((OrderField*)ptr1, size1, (OrderIDType*)ptr2); - } - //else - //{ - // return pApi->ReqParkedOrderInsert((int)double1, (OrderField*)ptr1, (OrderField*)ptr2); - //} - case ReqQuoteInsert: + case RequestType_ReqOrderInsert: + return (void*)pApi->ReqOrderInsert((OrderField*)ptr1, size1, (char*)ptr2); + case RequestType_ReqOrderAction: + return (void*)pApi->ReqOrderAction((OrderIDType*)ptr1, size1, (char*)ptr2); +#ifdef HAS_Quote + case RequestType_ReqQuoteInsert: return pApi->ReqQuoteInsert((QuoteField*)ptr1, (OrderIDType*)ptr2, (OrderIDType*)ptr3); - case ReqOrderAction: - return (void*)pApi->ReqOrderAction((OrderIDType*)ptr1, size1, (OrderIDType*)ptr2); - case ReqQuoteAction: + case RequestType_ReqQuoteAction: return (void*)pApi->ReqQuoteAction((const char*)ptr1, (OrderIDType*)ptr2); +#endif // HAS_Quote + default: break; } diff --git a/QuantBox_CTP_Trade/TypeConvert.cpp b/apis/CTP/TypeConvert.cpp similarity index 97% rename from QuantBox_CTP_Trade/TypeConvert.cpp rename to apis/CTP/TypeConvert.cpp index 31a8e94..0d29e1c 100644 --- a/QuantBox_CTP_Trade/TypeConvert.cpp +++ b/apis/CTP/TypeConvert.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "TypeConvert.h" - +#include #include @@ -56,6 +56,7 @@ OpenCloseType TThostFtdcOffsetFlagType_2_OpenCloseType(TThostFtdcOffsetFlagType case THOST_FTDC_OF_CloseToday: return OpenCloseType::OpenCloseType_CloseToday; case THOST_FTDC_OF_Close: + case THOST_FTDC_OF_CloseYesterday: return OpenCloseType::OpenCloseType_Close; case THOST_FTDC_OF_Open: default: @@ -179,58 +180,6 @@ ExecType CThostFtdcOrderField_2_ExecType(CThostFtdcOrderField* pIn) } } -OrderStatus CThostFtdcQuoteField_2_OrderStatus(CThostFtdcQuoteField* pIn) -{ - switch (pIn->QuoteStatus) - { - case THOST_FTDC_OST_Canceled: - if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertRejected) - return OrderStatus::OrderStatus_Rejected; - return OrderStatus::OrderStatus_Cancelled; - case THOST_FTDC_OST_Unknown: - // 如果是撤单,也有可能出现这一条,如何过滤? - if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertSubmitted) - return OrderStatus::OrderStatus_New; - case THOST_FTDC_OST_Touched: - if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertRejected) - return OrderStatus::OrderStatus_Rejected; - default: - // 这个地方要改 - - //if (pIn->VolumeTotal == 0) - // return OrderStatus::Filled; - //else if (pIn->VolumeTotal == pIn->VolumeTotalOriginal) - return OrderStatus::OrderStatus_New; - //else - // return OrderStatus::PartiallyFilled; - } -} - -ExecType CThostFtdcQuoteField_2_ExecType(CThostFtdcQuoteField* pIn) -{ - switch (pIn->QuoteStatus) - { - case THOST_FTDC_OST_Canceled: - if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertRejected) - return ExecType::ExecType_Rejected; - return ExecType::ExecType_Cancelled; - case THOST_FTDC_OST_Unknown: - // 如果是撤单,也有可能出现这一条,如何过滤? - if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertSubmitted) - return ExecType::ExecType_New; - case THOST_FTDC_OST_AllTraded: - case THOST_FTDC_OST_PartTradedQueueing: - return ExecType::ExecType_Trade; - case THOST_FTDC_OST_Touched: - if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertRejected) - return ExecType::ExecType_Rejected; - default: - return ExecType::ExecType_New; - } -} - - - OrderType CThostFtdcOrderField_2_OrderType(CThostFtdcOrderField* pIn) { switch (pIn->OrderPriceType) @@ -336,6 +285,7 @@ void CThostFtdcOrderField_2_OrderField_0(OrderIDType OrderID,CThostFtdcOrderFiel strcpy(pOut->LocalID, pOut->ID); strcpy(pOut->InstrumentID, pIn->InstrumentID); strcpy(pOut->ExchangeID, pIn->ExchangeID); + strcpy(pOut->AccountID, pIn->InvestorID); pOut->HedgeFlag = TThostFtdcHedgeFlagType_2_HedgeFlagType(pIn->CombHedgeFlag[0]); pOut->Side = TThostFtdcDirectionType_2_OrderSide(pIn->Direction); pOut->Price = pIn->LimitPrice; @@ -351,4 +301,57 @@ void CThostFtdcOrderField_2_OrderField_0(OrderIDType OrderID,CThostFtdcOrderFiel pOut->ExecType = CThostFtdcOrderField_2_ExecType(pIn); strcpy(pOut->OrderID, pIn->OrderSysID); strncpy(pOut->Text, pIn->StatusMsg, sizeof(Char256Type)); -} \ No newline at end of file +} + +#ifdef HAS_Quote +OrderStatus CThostFtdcQuoteField_2_OrderStatus(CThostFtdcQuoteField* pIn) +{ + switch (pIn->QuoteStatus) + { + case THOST_FTDC_OST_Canceled: + if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertRejected) + return OrderStatus::OrderStatus_Rejected; + return OrderStatus::OrderStatus_Cancelled; + case THOST_FTDC_OST_Unknown: + // 如果是撤单,也有可能出现这一条,如何过滤? + if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertSubmitted) + return OrderStatus::OrderStatus_New; + case THOST_FTDC_OST_Touched: + if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertRejected) + return OrderStatus::OrderStatus_Rejected; + default: + // 这个地方要改 + + //if (pIn->VolumeTotal == 0) + // return OrderStatus::OrderStatus_Filled; + //else if (pIn->VolumeTotal == pIn->VolumeTotalOriginal) + return OrderStatus::OrderStatus_New; + //else + // return OrderStatus::OrderStatus_PartiallyFilled; + } +} + +ExecType CThostFtdcQuoteField_2_ExecType(CThostFtdcQuoteField* pIn) +{ + switch (pIn->QuoteStatus) + { + case THOST_FTDC_OST_Canceled: + if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertRejected) + return ExecType::ExecType_Rejected; + return ExecType::ExecType_Cancelled; + case THOST_FTDC_OST_Unknown: + // 如果是撤单,也有可能出现这一条,如何过滤? + if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertSubmitted) + return ExecType::ExecType_New; + case THOST_FTDC_OST_AllTraded: + case THOST_FTDC_OST_PartTradedQueueing: + return ExecType::ExecType_Trade; + case THOST_FTDC_OST_Touched: + if (pIn->OrderSubmitStatus == THOST_FTDC_OSS_InsertRejected) + return ExecType::ExecType_Rejected; + default: + return ExecType::ExecType_New; + } +} +#endif // HAS_Quote + diff --git a/QuantBox_CTP_Trade/TypeConvert.h b/apis/CTP/TypeConvert.h similarity index 88% rename from QuantBox_CTP_Trade/TypeConvert.h rename to apis/CTP/TypeConvert.h index be39fec..7eb6e9d 100644 --- a/QuantBox_CTP_Trade/TypeConvert.h +++ b/apis/CTP/TypeConvert.h @@ -1,9 +1,9 @@ #pragma once -#include "../include/CTP/ThostFtdcUserApiDataType.h" -#include "../include/CTP/ThostFtdcUserApiStruct.h" -#include "../include/ApiStruct.h" +#include "../../include/ApiStruct.h" +// Include.hҪʹÿĿԼļҪVC++ Directories->Include Directoriesһ"./" +#include "Include.h" PutCall TThostFtdcOptionsTypeType_2_PutCall(TThostFtdcOptionsTypeType In); @@ -26,8 +26,7 @@ TimeInForce CThostFtdcOrderField_2_TimeInForce(CThostFtdcOrderField* pIn); OrderStatus CThostFtdcOrderField_2_OrderStatus(CThostFtdcOrderField* pIn); ExecType CThostFtdcOrderField_2_ExecType(CThostFtdcOrderField* pIn); -OrderStatus CThostFtdcQuoteField_2_OrderStatus(CThostFtdcQuoteField* pIn); -ExecType CThostFtdcQuoteField_2_ExecType(CThostFtdcQuoteField* pIn); + InstrumentType CThostFtdcInstrumentField_2_InstrumentType(CThostFtdcInstrumentField* pIn); @@ -36,3 +35,10 @@ IdCardType TThostFtdcIdCardTypeType_2_IdCardType(TThostFtdcIdCardTypeType In); ExchangeType TThostFtdcExchangeIDType_2_ExchangeType(TThostFtdcExchangeIDType In); void CThostFtdcOrderField_2_OrderField_0(OrderIDType OrderID, CThostFtdcOrderField* pIn, OrderField* pOut); + + +#ifdef HAS_Quote +OrderStatus CThostFtdcQuoteField_2_OrderStatus(CThostFtdcQuoteField* pIn); +ExecType CThostFtdcQuoteField_2_ExecType(CThostFtdcQuoteField* pIn); +#endif // HAS_Quote + diff --git a/FakeAPI/dllmain.cpp b/apis/CTP/dllmain.cpp similarity index 100% rename from FakeAPI/dllmain.cpp rename to apis/CTP/dllmain.cpp diff --git a/apis/CTP/include_pub.h b/apis/CTP/include_pub.h new file mode 100644 index 0000000..c1f8532 --- /dev/null +++ b/apis/CTP/include_pub.h @@ -0,0 +1,25 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +// 条件编译 + +// 使用长报单引用,飞鼠的12位前需要补0 +#define USE_LONG_ORDER_REF 1 +// 是否有做市商报价功能 +#define HAS_Quote 1 +#define HAS_Account_Future 1 +#define HAS_InstrumentStatus 1 +#define HAS_Settlement 1 +#define HAS_TradingDay_UserLogin 1 +#define CreateFtdcMdApi_argc_3 1 +#define SubscribeMarketData_argc_2 1 + +#define HAS_ExchangeID_Position 1 +#define HAS_ExchangeID_Order 1 +#define HAS_ExchangeID_Quote 1 +#define HAS_ExchangeID_Quote_ForQuoteSysID 1 + diff --git a/apis/CTPZQ_Quote/CTPZQ_Quote.cpp b/apis/CTPZQ_Quote/CTPZQ_Quote.cpp new file mode 100644 index 0000000..8609b7e --- /dev/null +++ b/apis/CTPZQ_Quote/CTPZQ_Quote.cpp @@ -0,0 +1,6 @@ +// CTPZQ_Quote.cpp : Defines the exported functions for the DLL application. +// + +#include "stdafx.h" + + diff --git a/apis/CTPZQ_Quote/CTPZQ_Quote.vcxproj b/apis/CTPZQ_Quote/CTPZQ_Quote.vcxproj new file mode 100644 index 0000000..bea13de --- /dev/null +++ b/apis/CTPZQ_Quote/CTPZQ_Quote.vcxproj @@ -0,0 +1,190 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {891F3DF0-72F6-404A-AF4A-85F1A640AB82} + Win32Proj + CTPZQ_Quote + 8.1 + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTPZQ + $(ProjectName)_$(PlatformTarget) + ./;$(IncludePath) + + + true + + + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;CTPZQ_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + ../../include/ApiHeader.def + + + + + + + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;CTPZQ_QUOTE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CTPZQ_QUOTE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_WINDOWS;_USRDLL;CTPZQ_QUOTE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + + + + + + + \ No newline at end of file diff --git a/apis/CTPZQ_Quote/CTPZQ_Quote.vcxproj.filters b/apis/CTPZQ_Quote/CTPZQ_Quote.vcxproj.filters new file mode 100644 index 0000000..9a96790 --- /dev/null +++ b/apis/CTPZQ_Quote/CTPZQ_Quote.vcxproj.filters @@ -0,0 +1,69 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/apis/CTPZQ_Quote/Include.h b/apis/CTPZQ_Quote/Include.h new file mode 100644 index 0000000..40fb551 --- /dev/null +++ b/apis/CTPZQ_Quote/Include.h @@ -0,0 +1,42 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#define API_VERSION "0.1.0.20170921" +#define API_NAME "CTPZQ" +#define DLL_PUBLIC_KEY "" + +// 由于CTPZQ与CTP各种类型定义不一样,所以重新定义一下 +#include "Redefine.h" + +#include "../../include/CTPZQ/ZQThostFtdcUserApiDataType.h" +#include "../../include/CTPZQ/ZQThostFtdcUserApiStruct.h" +#include "../../include/CTPZQ/ZQThostFtdcMdApi.h" + +#ifdef _WIN64 + #pragma comment(lib, "../../include/CTPZQ/win64/zqthostmdapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif +#else + #pragma comment(lib, "../../include/CTPZQ/win32/zqthostmdapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif +#endif + + +// 条件编译 +#include "../CTP/include_pub.h" + +#undef HAS_TradingDay_UserLogin +#undef HAS_Quote +#undef CreateFtdcMdApi_argc_3 +#undef SubscribeMarketData_argc_2 \ No newline at end of file diff --git a/QuantBox_Tdx_Trade/ReadMe.txt b/apis/CTPZQ_Quote/ReadMe.txt similarity index 84% rename from QuantBox_Tdx_Trade/ReadMe.txt rename to apis/CTPZQ_Quote/ReadMe.txt index f89d1b6..26775c1 100644 --- a/QuantBox_Tdx_Trade/ReadMe.txt +++ b/apis/CTPZQ_Quote/ReadMe.txt @@ -1,27 +1,27 @@ ======================================================================== - DYNAMIC LINK LIBRARY : QuantBox_Tdx_Trade Project Overview + DYNAMIC LINK LIBRARY : CTPZQ_Quote Project Overview ======================================================================== -AppWizard has created this QuantBox_Tdx_Trade DLL for you. +AppWizard has created this CTPZQ_Quote DLL for you. This file contains a summary of what you will find in each of the files that -make up your QuantBox_Tdx_Trade application. +make up your CTPZQ_Quote application. -QuantBox_Tdx_Trade.vcxproj +CTPZQ_Quote.vcxproj This is the main project file for VC++ projects generated using an Application Wizard. It contains information about the version of Visual C++ that generated the file, and information about the platforms, configurations, and project features selected with the Application Wizard. -QuantBox_Tdx_Trade.vcxproj.filters +CTPZQ_Quote.vcxproj.filters This is the filters file for VC++ projects generated using an Application Wizard. It contains information about the association between the files in your project and the filters. This association is used in the IDE to show grouping of files with similar extensions under a specific node (for e.g. ".cpp" files are associated with the "Source Files" filter). -QuantBox_Tdx_Trade.cpp +CTPZQ_Quote.cpp This is the main DLL source file. When created, this DLL does not export any symbols. As a result, it @@ -37,7 +37,7 @@ Other standard files: StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file - named QuantBox_Tdx_Trade.pch and a precompiled types file named StdAfx.obj. + named CTPZQ_Quote.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: diff --git a/apis/CTPZQ_Quote/Redefine.h b/apis/CTPZQ_Quote/Redefine.h new file mode 100644 index 0000000..822433c --- /dev/null +++ b/apis/CTPZQ_Quote/Redefine.h @@ -0,0 +1,116 @@ +#pragma once + +// +#define TThostFtdcOptionsTypeType TZQThostFtdcOptionsTypeType +#define TThostFtdcExchangeIDType TZQThostFtdcExchangeIDType +#define TThostFtdcDirectionType TZQThostFtdcDirectionType +#define TThostFtdcPosiDirectionType TZQThostFtdcPosiDirectionType +#define TThostFtdcOffsetFlagType TZQThostFtdcOffsetFlagType +#define TThostFtdcIdCardTypeType TZQThostFtdcIdCardTypeType +#define TThostFtdcBrokerIDType TZQThostFtdcBrokerIDType +#define TThostFtdcInvestorIDType TZQThostFtdcInvestorIDType +#define TThostFtdcPasswordType TZQThostFtdcPasswordType +#define TThostFtdcHedgeFlagType TZQThostFtdcHedgeFlagType +#define TThostFtdcOrderPriceTypeType TZQThostFtdcOrderPriceTypeType +#define TThostFtdcOrderSysIDType TZQThostFtdcOrderSysIDType +#define TThostFtdcInstrumentIDType TZQThostFtdcInstrumentIDType +#define TThostFtdcProductInfoType TZQThostFtdcProductInfoType +#define TThostFtdcAuthCodeType TZQThostFtdcAuthCodeType +#define TThostFtdcOrderRefType TZQThostFtdcOrderRefType + +// ṹ +#define CThostFtdcRspInfoField CZQThostFtdcRspInfoField +#define CThostFtdcOrderField CZQThostFtdcOrderField +#define CThostFtdcTradeField CZQThostFtdcTradeField +#define CThostFtdcInstrumentField CZQThostFtdcInstrumentField +#define CThostFtdcRspUserLoginField CZQThostFtdcRspUserLoginField +#define CThostFtdcReqUserLoginField CZQThostFtdcReqUserLoginField +#define CThostFtdcUserLogoutField CZQThostFtdcUserLogoutField +#define CThostFtdcDepthMarketDataField CZQThostFtdcDepthMarketDataField +#define CThostFtdcSpecificInstrumentField CZQThostFtdcSpecificInstrumentField +#define CThostFtdcInvestorPositionField CZQThostFtdcInvestorPositionField +#define CThostFtdcInputOrderField CZQThostFtdcInputOrderField +#define CThostFtdcInputOrderActionField CZQThostFtdcInputOrderActionField +#define CThostFtdcOrderActionField CZQThostFtdcOrderActionField +#define CThostFtdcRspAuthenticateField CZQThostFtdcRspAuthenticateField +#define CThostFtdcInvestorField CZQThostFtdcInvestorField +#define CThostFtdcQryInstrumentField CZQThostFtdcQryInstrumentField +#define CThostFtdcReqAuthenticateField CZQThostFtdcReqAuthenticateField +#define CThostFtdcTradingAccountField CZQThostFtdcTradingAccountField +#define CThostFtdcQryOrderField CZQThostFtdcQryOrderField +#define CThostFtdcQryTradeField CZQThostFtdcQryTradeField +#define CThostFtdcQryInvestorField CZQThostFtdcQryInvestorField +#define CThostFtdcQryInvestorPositionField CZQThostFtdcQryInvestorPositionField +#define CThostFtdcQryTradingAccountField CZQThostFtdcQryTradingAccountField + + +// +#define CThostFtdcMdApi CZQThostFtdcMdApi +#define CThostFtdcMdSpi CZQThostFtdcMdSpi +#define CThostFtdcTraderApi CZQThostFtdcTraderApi +#define CThostFtdcTraderSpi CZQThostFtdcTraderSpi + +// öֵ +#define THOST_FTDC_CP_CallOptions ZQTHOST_FTDC_CP_CallOptions + +#define THOST_FTDC_HF_Arbitrage ZQTHOST_FTDC_HF_Arbitrage +#define THOST_FTDC_HF_Hedge ZQTHOST_FTDC_HF_Hedge +#define THOST_FTDC_HF_Speculation ZQTHOST_FTDC_HF_Speculation + +#define THOST_FTDC_OF_CloseToday ZQTHOST_FTDC_OF_CloseToday +#define THOST_FTDC_OF_Close ZQTHOST_FTDC_OF_Close +#define THOST_FTDC_OF_CloseYesterday ZQTHOST_FTDC_OF_CloseYesterday +#define THOST_FTDC_OF_Open ZQTHOST_FTDC_OF_Open + +#define THOST_FTDC_D_Sell ZQTHOST_FTDC_D_Sell +#define THOST_FTDC_D_Buy ZQTHOST_FTDC_D_Buy + +#define THOST_FTDC_PD_Short ZQTHOST_FTDC_PD_Short + +#define THOST_FTDC_OPT_AnyPrice ZQTHOST_FTDC_OPT_AnyPrice +#define THOST_FTDC_OPT_LimitPrice ZQTHOST_FTDC_OPT_LimitPrice + +#define THOST_FTDC_OST_Unknown ZQTHOST_FTDC_OST_Unknown +#define THOST_FTDC_OST_Canceled ZQTHOST_FTDC_OST_Canceled +#define THOST_FTDC_OST_AllTraded ZQTHOST_FTDC_OST_AllTraded +#define THOST_FTDC_OST_PartTradedQueueing ZQTHOST_FTDC_OST_PartTradedQueueing + +#define THOST_FTDC_OSS_InsertRejected ZQTHOST_FTDC_OSS_InsertRejected +#define THOST_FTDC_OSS_InsertSubmitted ZQTHOST_FTDC_OSS_InsertSubmitted + +#define THOST_FTDC_TC_GFD ZQTHOST_FTDC_TC_GFD +#define THOST_FTDC_TC_IOC ZQTHOST_FTDC_TC_IOC + +#define THOST_FTDC_VC_AV ZQTHOST_FTDC_VC_AV +#define THOST_FTDC_VC_CV ZQTHOST_FTDC_VC_CV + +#define THOST_FTDC_CC_Immediately ZQTHOST_FTDC_CC_Immediately + +#define THOST_FTDC_AF_Delete ZQTHOST_FTDC_AF_Delete + +#define THOST_FTDC_FCC_NotForceClose ZQTHOST_FTDC_FCC_NotForceClose + +#define THOST_FTDC_PC_Futures ZQTHOST_FTDC_PC_Futures +#define THOST_FTDC_PC_Options ZQTHOST_FTDC_PC_Options +#define THOST_FTDC_PC_Combination ZQTHOST_FTDC_PC_Combination +#define THOST_FTDC_PC_EFP ZQTHOST_FTDC_PC_EFP +#define THOST_FTDC_PC_SpotOption ZQTHOST_FTDC_PC_SpotOption + +#define THOST_FTDC_ICT_EID ZQTHOST_FTDC_ICT_EID +#define THOST_FTDC_ICT_IDCard ZQTHOST_FTDC_ICT_IDCard +#define THOST_FTDC_ICT_Passport ZQTHOST_FTDC_ICT_Passport +#define THOST_FTDC_ICT_LicenseNo ZQTHOST_FTDC_ICT_LicenseNo +#define THOST_FTDC_ICT_TaxNo ZQTHOST_FTDC_ICT_TaxNo +#define THOST_FTDC_ICT_DrivingLicense ZQTHOST_FTDC_ICT_DrivingLicense +#define THOST_FTDC_ICT_SocialID ZQTHOST_FTDC_ICT_SocialID +#define THOST_FTDC_ICT_LocalID ZQTHOST_FTDC_ICT_LocalID +#define THOST_FTDC_ICT_OtherCard ZQTHOST_FTDC_ICT_OtherCard + +#define THOST_TE_RESUME_TYPE ZQTHOST_TE_RESUME_TYPE +#define THOST_TERT_QUICK ZQTHOST_TERT_QUICK + +// ûжĽṹ +#define CThostFtdcQuoteField CZQThostFtdcQuoteField +#define CThostFtdcForQuoteRspField CZQThostFtdcForQuoteRspField +#define CThostFtdcSettlementInfoConfirmField CZQThostFtdcSettlementInfoConfirmField +#define CThostFtdcInputQuoteActionField CZQThostFtdcInputQuoteActionField \ No newline at end of file diff --git a/QuantBox_CTP_Quote/dllmain.cpp b/apis/CTPZQ_Quote/dllmain.cpp similarity index 100% rename from QuantBox_CTP_Quote/dllmain.cpp rename to apis/CTPZQ_Quote/dllmain.cpp diff --git a/QuantBox_Tdx_Trade/stdafx.cpp b/apis/CTPZQ_Quote/stdafx.cpp similarity index 80% rename from QuantBox_Tdx_Trade/stdafx.cpp rename to apis/CTPZQ_Quote/stdafx.cpp index 06ec8f9..290b7ed 100644 --- a/QuantBox_Tdx_Trade/stdafx.cpp +++ b/apis/CTPZQ_Quote/stdafx.cpp @@ -1,5 +1,5 @@ // stdafx.cpp : source file that includes just the standard includes -// QuantBox_Tdx_Trade.pch will be the pre-compiled header +// CTPZQ_Quote.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" diff --git a/FakeAPI/stdafx.h b/apis/CTPZQ_Quote/stdafx.h similarity index 100% rename from FakeAPI/stdafx.h rename to apis/CTPZQ_Quote/stdafx.h diff --git a/FakeAPI/targetver.h b/apis/CTPZQ_Quote/targetver.h similarity index 100% rename from FakeAPI/targetver.h rename to apis/CTPZQ_Quote/targetver.h diff --git a/apis/CTPZQ_Trade/CTPZQ_Trade.cpp b/apis/CTPZQ_Trade/CTPZQ_Trade.cpp new file mode 100644 index 0000000..221c185 --- /dev/null +++ b/apis/CTPZQ_Trade/CTPZQ_Trade.cpp @@ -0,0 +1,6 @@ +// CTPZQ_Trade.cpp : Defines the exported functions for the DLL application. +// + +#include "stdafx.h" + + diff --git a/QuantBox_LTS_Quote_v2/QuantBox_LTS_Quote_v2.vcxproj b/apis/CTPZQ_Trade/CTPZQ_Trade.vcxproj similarity index 56% rename from QuantBox_LTS_Quote_v2/QuantBox_LTS_Quote_v2.vcxproj rename to apis/CTPZQ_Trade/CTPZQ_Trade.vcxproj index ba3fb43..b214be2 100644 --- a/QuantBox_LTS_Quote_v2/QuantBox_LTS_Quote_v2.vcxproj +++ b/apis/CTPZQ_Trade/CTPZQ_Trade.vcxproj @@ -1,111 +1,83 @@  - + - - Debug64 - Win32 - - - Debug64 - x64 - Debug Win32 - - Debug - x64 - Release Win32 + + Debug + x64 + Release x64 - {D4387736-0623-4442-A4AC-AF79239F9419} + {5307B252-E992-4907-9C15-4BC5BD746F4C} Win32Proj - QuantBox_LTS_Quote + CTPZQ_Trade + 8.1 DynamicLibrary true - v120 + v140 Unicode - - DynamicLibrary - true - v120 - Unicode - - + DynamicLibrary - true - v120 + false + v140 + true Unicode - + DynamicLibrary true - v120 - Unicode - - - DynamicLibrary - false - v120 - true + v140 Unicode DynamicLibrary false - v120 + v140 true Unicode - - - - - + - + - + - + - + true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\LTS_v2\x86 + ./;$(IncludePath) + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTPZQ + $(ProjectName)_$(PlatformTarget) true - - true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\LTS - - - true - false @@ -117,59 +89,26 @@ Use Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_LTS_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CTPZQ_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true Windows true - ..\include\ApiHeader.def + ../../include/ApiHeader.def - - xcopy "$(TargetPath)" "$(SolutionDir)XAPI\LTS_v2\x86\" /Y -xcopy "$(SolutionDir)include\LTS_v2\win32\*.dll" "$(SolutionDir)XAPI\LTS_v2\x86\" /Y - Use Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_LTS_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - ..\include\ApiHeader.def - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_LTS_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _DEBUG;_WINDOWS;_USRDLL;CTPZQ_TRADE_EXPORTS;%(PreprocessorDefinitions) true Windows true - ..\include\ApiHeader.def - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_LTS_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - true - ..\include\ApiHeader.def @@ -179,15 +118,14 @@ xcopy "$(SolutionDir)include\LTS_v2\win32\*.dll" "$(SolutionDir)XAPI\LTS_v2\x86 MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTBOX_LTS_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CTPZQ_TRADE_EXPORTS;%(PreprocessorDefinitions) true Windows - true true true - ..\include\ApiHeader.def + true @@ -197,57 +135,51 @@ xcopy "$(SolutionDir)include\LTS_v2\win32\*.dll" "$(SolutionDir)XAPI\LTS_v2\x86 MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTBOX_LTS_QUOTE_EXPORTS;%(PreprocessorDefinitions) + NDEBUG;_WINDOWS;_USRDLL;CTPZQ_TRADE_EXPORTS;%(PreprocessorDefinitions) true Windows - true true true - QuantBox_LTS_Quote.def + true - - - + + + + + - - + + + + + false - false - false - false + false - - - - false - false + false - - Create Create - Create - Create Create Create diff --git a/apis/CTPZQ_Trade/CTPZQ_Trade.vcxproj.filters b/apis/CTPZQ_Trade/CTPZQ_Trade.vcxproj.filters new file mode 100644 index 0000000..4ea32d2 --- /dev/null +++ b/apis/CTPZQ_Trade/CTPZQ_Trade.vcxproj.filters @@ -0,0 +1,66 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/apis/CTPZQ_Trade/Include.h b/apis/CTPZQ_Trade/Include.h new file mode 100644 index 0000000..f3331fe --- /dev/null +++ b/apis/CTPZQ_Trade/Include.h @@ -0,0 +1,42 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#define API_VERSION "0.1.0.20170921" +#define API_NAME "CTPZQ" +#define DLL_PUBLIC_KEY "" + +// 由于CTPZQ与CTP各种类型定义不一样,所以重新定义一下 +#include "../CTPZQ_Quote/Redefine.h" + +#include "../../include/CTPZQ/ZQThostFtdcUserApiDataType.h" +#include "../../include/CTPZQ/ZQThostFtdcUserApiStruct.h" +#include "../../include/CTPZQ/ZQThostFtdcTraderApi.h" + +#ifdef _WIN64 + #pragma comment(lib, "../../include/CTPZQ/win64/zqthosttraderapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif +#else + #pragma comment(lib, "../../include/CTPZQ/win32/zqthosttraderapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif +#endif + +// 条件编译 +#include "../CTP/include_pub.h" + +#undef HAS_Quote +#undef HAS_Account_Future +#undef HAS_TradingDay_UserLogin +#undef HAS_InstrumentStatus +#undef HAS_Settlement \ No newline at end of file diff --git a/QuantBox_CTP_Quote/ReadMe.txt b/apis/CTPZQ_Trade/ReadMe.txt similarity index 84% rename from QuantBox_CTP_Quote/ReadMe.txt rename to apis/CTPZQ_Trade/ReadMe.txt index 5e8e1d9..c6e66ca 100644 --- a/QuantBox_CTP_Quote/ReadMe.txt +++ b/apis/CTPZQ_Trade/ReadMe.txt @@ -1,27 +1,27 @@ ======================================================================== - DYNAMIC LINK LIBRARY : QuantBox_CTP_Quote Project Overview + DYNAMIC LINK LIBRARY : CTPZQ_Trade Project Overview ======================================================================== -AppWizard has created this QuantBox_CTP_Quote DLL for you. +AppWizard has created this CTPZQ_Trade DLL for you. This file contains a summary of what you will find in each of the files that -make up your QuantBox_CTP_Quote application. +make up your CTPZQ_Trade application. -QuantBox_CTP_Quote.vcxproj +CTPZQ_Trade.vcxproj This is the main project file for VC++ projects generated using an Application Wizard. It contains information about the version of Visual C++ that generated the file, and information about the platforms, configurations, and project features selected with the Application Wizard. -QuantBox_CTP_Quote.vcxproj.filters +CTPZQ_Trade.vcxproj.filters This is the filters file for VC++ projects generated using an Application Wizard. It contains information about the association between the files in your project and the filters. This association is used in the IDE to show grouping of files with similar extensions under a specific node (for e.g. ".cpp" files are associated with the "Source Files" filter). -QuantBox_CTP_Quote.cpp +CTPZQ_Trade.cpp This is the main DLL source file. When created, this DLL does not export any symbols. As a result, it @@ -37,7 +37,7 @@ Other standard files: StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file - named QuantBox_CTP_Quote.pch and a precompiled types file named StdAfx.obj. + named CTPZQ_Trade.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: diff --git a/QuantBox_CTP_Trade/dllmain.cpp b/apis/CTPZQ_Trade/dllmain.cpp similarity index 100% rename from QuantBox_CTP_Trade/dllmain.cpp rename to apis/CTPZQ_Trade/dllmain.cpp diff --git a/QuantBox_XAPI_TEST/stdafx.cpp b/apis/CTPZQ_Trade/stdafx.cpp similarity index 80% rename from QuantBox_XAPI_TEST/stdafx.cpp rename to apis/CTPZQ_Trade/stdafx.cpp index 6f6a809..50224f7 100644 --- a/QuantBox_XAPI_TEST/stdafx.cpp +++ b/apis/CTPZQ_Trade/stdafx.cpp @@ -1,5 +1,5 @@ // stdafx.cpp : source file that includes just the standard includes -// QuantBox_XAPI_TEST.pch will be the pre-compiled header +// CTPZQ_Trade.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" diff --git a/QuantBox_LTS_Query_v2/stdafx.h b/apis/CTPZQ_Trade/stdafx.h similarity index 100% rename from QuantBox_LTS_Query_v2/stdafx.h rename to apis/CTPZQ_Trade/stdafx.h diff --git a/QuantBox_CTP_Quote/targetver.h b/apis/CTPZQ_Trade/targetver.h similarity index 100% rename from QuantBox_CTP_Quote/targetver.h rename to apis/CTPZQ_Trade/targetver.h diff --git a/QuantBox_CTP_Quote/QuantBox_CTP_Quote.cbp b/apis/CTP_Quote/CTP_Quote.cbp similarity index 100% rename from QuantBox_CTP_Quote/QuantBox_CTP_Quote.cbp rename to apis/CTP_Quote/CTP_Quote.cbp diff --git a/QuantBox_CTP_Quote/QuantBox_CTP_Quote.depend b/apis/CTP_Quote/CTP_Quote.depend similarity index 100% rename from QuantBox_CTP_Quote/QuantBox_CTP_Quote.depend rename to apis/CTP_Quote/CTP_Quote.depend diff --git a/apis/CTP_Quote/CTP_Quote.vcxproj b/apis/CTP_Quote/CTP_Quote.vcxproj new file mode 100644 index 0000000..f216d39 --- /dev/null +++ b/apis/CTP_Quote/CTP_Quote.vcxproj @@ -0,0 +1,193 @@ + + + + + Debug64 + x64 + + + Debug + Win32 + + + Release64 + x64 + + + Release + Win32 + + + + {919B914D-6840-453E-9201-8619E63AD0E1} + Win32Proj + CTP_Quote + 8.1 + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP + ./;$(IncludePath) + $(ProjectName)_$(PlatformTarget) + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP + ./;$(IncludePath) + $(ProjectName)_$(PlatformTarget) + + + false + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP + $(ProjectName)_$(PlatformTarget) + ./;$(IncludePath) + + + false + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP + $(ProjectName)_$(PlatformTarget) + ./;$(IncludePath) + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Cdecl + ..\include\ZeroMQ\libzmq\include;..\include\ZeroMQ\czmq\include;%(AdditionalIncludeDirectories) + + + Windows + true + ../../include/ApiHeader.def + + + + + + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + ../../include/ApiHeader.def + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + ../../include/ApiHeader.def + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + ../../include/ApiHeader.def + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/apis/CTP_Quote/CTP_Quote.vcxproj.filters b/apis/CTP_Quote/CTP_Quote.vcxproj.filters new file mode 100644 index 0000000..1863425 --- /dev/null +++ b/apis/CTP_Quote/CTP_Quote.vcxproj.filters @@ -0,0 +1,66 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/apis/CTP_Quote/Include.h b/apis/CTP_Quote/Include.h new file mode 100644 index 0000000..9b09a4f --- /dev/null +++ b/apis/CTP_Quote/Include.h @@ -0,0 +1,34 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#define API_VERSION "0.3.0.20151216" +#define API_NAME "CTP" +#define DLL_PUBLIC_KEY "" + +#include "../../include/CTP/ThostFtdcUserApiDataType.h" +#include "../../include/CTP/ThostFtdcUserApiStruct.h" +#include "../../include/CTP/ThostFtdcMdApi.h" + +#ifdef _WIN64 + #pragma comment(lib, "../../include/CTP/win64/thostmduserapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif +#else + #pragma comment(lib, "../../include/CTP/win32/thostmduserapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif +#endif + + +// +#include "../CTP/include_pub.h" \ No newline at end of file diff --git a/QuantBox_CTP_Trade/ReadMe.txt b/apis/CTP_Quote/ReadMe.txt similarity index 84% rename from QuantBox_CTP_Trade/ReadMe.txt rename to apis/CTP_Quote/ReadMe.txt index e05ea6a..5b54557 100644 --- a/QuantBox_CTP_Trade/ReadMe.txt +++ b/apis/CTP_Quote/ReadMe.txt @@ -1,27 +1,27 @@ ======================================================================== - DYNAMIC LINK LIBRARY : QuantBox_CTP_Trade Project Overview + DYNAMIC LINK LIBRARY : CTP_Quote Project Overview ======================================================================== -AppWizard has created this QuantBox_CTP_Trade DLL for you. +AppWizard has created this CTP_Quote DLL for you. This file contains a summary of what you will find in each of the files that -make up your QuantBox_CTP_Trade application. +make up your CTP_Quote application. -QuantBox_CTP_Trade.vcxproj +CTP_Quote.vcxproj This is the main project file for VC++ projects generated using an Application Wizard. It contains information about the version of Visual C++ that generated the file, and information about the platforms, configurations, and project features selected with the Application Wizard. -QuantBox_CTP_Trade.vcxproj.filters +CTP_Quote.vcxproj.filters This is the filters file for VC++ projects generated using an Application Wizard. It contains information about the association between the files in your project and the filters. This association is used in the IDE to show grouping of files with similar extensions under a specific node (for e.g. ".cpp" files are associated with the "Source Files" filter). -QuantBox_CTP_Trade.cpp +CTP_Quote.cpp This is the main DLL source file. When created, this DLL does not export any symbols. As a result, it @@ -37,7 +37,7 @@ Other standard files: StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file - named QuantBox_CTP_Trade.pch and a precompiled types file named StdAfx.obj. + named CTP_Quote.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: diff --git a/QuantBox_CTP_Quote/stdafx.cpp b/apis/CTP_Quote/stdafx.cpp similarity index 100% rename from QuantBox_CTP_Quote/stdafx.cpp rename to apis/CTP_Quote/stdafx.cpp diff --git a/QuantBox_CTP_Quote/stdafx.h b/apis/CTP_Quote/stdafx.h similarity index 100% rename from QuantBox_CTP_Quote/stdafx.h rename to apis/CTP_Quote/stdafx.h diff --git a/QuantBox_CTP_Trade/targetver.h b/apis/CTP_Quote/targetver.h similarity index 100% rename from QuantBox_CTP_Trade/targetver.h rename to apis/CTP_Quote/targetver.h diff --git a/apis/CTP_SOPT_Trade/CTP_SOPT_Trade.vcxproj b/apis/CTP_SOPT_Trade/CTP_SOPT_Trade.vcxproj new file mode 100644 index 0000000..6181db4 --- /dev/null +++ b/apis/CTP_SOPT_Trade/CTP_SOPT_Trade.vcxproj @@ -0,0 +1,192 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {ADCD2BDB-C723-4E9A-BFA4-2FC7EA10DC9A} + Win32Proj + CTP_SOPT_Trade + 8.1 + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP_SOPT + $(ProjectName)_$(PlatformTarget) + ./;../../include/cryptopp/;$(IncludePath) + + + true + + + false + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP_SOPT + $(ProjectName)_$(PlatformTarget) + ./;../../include/cryptopp/;$(IncludePath) + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;CTP_SOPT_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + ../../include/ApiHeader.def + + + + + Use + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;CTP_SOPT_TRADE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CTP_SOPT_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + ../../include/ApiHeader.def + + + + + Level3 + Use + MaxSpeed + true + true + NDEBUG;_WINDOWS;_USRDLL;CTP_SOPT_TRADE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + + + Create + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/apis/CTP_SOPT_Trade/CTP_SOPT_Trade.vcxproj.filters b/apis/CTP_SOPT_Trade/CTP_SOPT_Trade.vcxproj.filters new file mode 100644 index 0000000..a16956b --- /dev/null +++ b/apis/CTP_SOPT_Trade/CTP_SOPT_Trade.vcxproj.filters @@ -0,0 +1,60 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/apis/CTP_SOPT_Trade/Include.h b/apis/CTP_SOPT_Trade/Include.h new file mode 100644 index 0000000..7dff153 --- /dev/null +++ b/apis/CTP_SOPT_Trade/Include.h @@ -0,0 +1,34 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#define API_VERSION "0.1.0.20161126" +#define API_NAME "CTP_SOPT" +#define DLL_PUBLIC_KEY "0" + +#include "../../include/CTP_SOPT/ThostFtdcUserApiDataType.h" +#include "../../include/CTP_SOPT/ThostFtdcUserApiStruct.h" +#include "../../include/CTP_SOPT/ThostFtdcTraderApi.h" + +#ifdef _WIN64 + #pragma comment(lib, "../../include/CTP_SOPT/win64/thosttraderapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif +#else + #pragma comment(lib, "../../include/CTP_SOPT/win32/thosttraderapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif +#endif + + +// 条件编译 +#include "../CTP/include_pub.h" \ No newline at end of file diff --git a/QuantBox_Queue/ReadMe.txt b/apis/CTP_SOPT_Trade/ReadMe.txt similarity index 86% rename from QuantBox_Queue/ReadMe.txt rename to apis/CTP_SOPT_Trade/ReadMe.txt index f7d2719..30156c4 100644 --- a/QuantBox_Queue/ReadMe.txt +++ b/apis/CTP_SOPT_Trade/ReadMe.txt @@ -1,27 +1,27 @@ ======================================================================== - DYNAMIC LINK LIBRARY : QuantBox_Queue Project Overview + DYNAMIC LINK LIBRARY : CTP_SOPT_Trade Project Overview ======================================================================== -AppWizard has created this QuantBox_Queue DLL for you. +AppWizard has created this CTP_SOPT_Trade DLL for you. This file contains a summary of what you will find in each of the files that -make up your QuantBox_Queue application. +make up your CTP_SOPT_Trade application. -QuantBox_Queue.vcxproj +CTP_SOPT_Trade.vcxproj This is the main project file for VC++ projects generated using an Application Wizard. It contains information about the version of Visual C++ that generated the file, and information about the platforms, configurations, and project features selected with the Application Wizard. -QuantBox_Queue.vcxproj.filters +CTP_SOPT_Trade.vcxproj.filters This is the filters file for VC++ projects generated using an Application Wizard. It contains information about the association between the files in your project and the filters. This association is used in the IDE to show grouping of files with similar extensions under a specific node (for e.g. ".cpp" files are associated with the "Source Files" filter). -QuantBox_Queue.cpp +CTP_SOPT_Trade.cpp This is the main DLL source file. When created, this DLL does not export any symbols. As a result, it @@ -37,7 +37,7 @@ Other standard files: StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file - named QuantBox_Queue.pch and a precompiled types file named StdAfx.obj. + named CTP_SOPT_Trade.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: diff --git a/QuantBox_LTS_Query_v2/dllmain.cpp b/apis/CTP_SOPT_Trade/dllmain.cpp similarity index 100% rename from QuantBox_LTS_Query_v2/dllmain.cpp rename to apis/CTP_SOPT_Trade/dllmain.cpp diff --git a/apis/CTP_SOPT_Trade/stdafx.cpp b/apis/CTP_SOPT_Trade/stdafx.cpp new file mode 100644 index 0000000..83af722 --- /dev/null +++ b/apis/CTP_SOPT_Trade/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// CTP_SOPT_Trade.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/QuantBox_Tdx_Trade/stdafx.h b/apis/CTP_SOPT_Trade/stdafx.h similarity index 100% rename from QuantBox_Tdx_Trade/stdafx.h rename to apis/CTP_SOPT_Trade/stdafx.h diff --git a/QuantBox_LTS_Query_v2/targetver.h b/apis/CTP_SOPT_Trade/targetver.h similarity index 100% rename from QuantBox_LTS_Query_v2/targetver.h rename to apis/CTP_SOPT_Trade/targetver.h diff --git a/QuantBox_CTP_Trade/QuantBox_CTP_Trade.cbp b/apis/CTP_Trade/CTP_Trade.cbp similarity index 100% rename from QuantBox_CTP_Trade/QuantBox_CTP_Trade.cbp rename to apis/CTP_Trade/CTP_Trade.cbp diff --git a/apis/CTP_Trade/CTP_Trade.vcxproj b/apis/CTP_Trade/CTP_Trade.vcxproj new file mode 100644 index 0000000..d496821 --- /dev/null +++ b/apis/CTP_Trade/CTP_Trade.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug64 + x64 + + + Debug + Win32 + + + Release64 + x64 + + + Release + Win32 + + + + {9FBB0318-E21C-4B7C-A258-98E6A3860B35} + Win32Proj + CTP_Trade + 8.1 + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP + ./;../../include/cryptopp/;$(IncludePath) + $(ProjectName)_$(PlatformTarget) + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP + ./;$(IncludePath) + $(ProjectName)_$(PlatformTarget) + + + false + ./;../../include/cryptopp/;$(IncludePath) + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP + $(ProjectName)_$(PlatformTarget) + + + false + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP + $(ProjectName)_$(PlatformTarget) + ./;$(IncludePath) + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;_ENABLE_LICENSE;%(PreprocessorDefinitions) + true + MultiThreadedDebugDLL + + + Windows + true + ../../include/ApiHeader.def + + + + + + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + ../../include/ApiHeader.def + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;_ENABLE_LICENSE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + ../../include/ApiHeader.def + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CTP_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + ../../include/ApiHeader.def + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/QuantBox_CTP_Trade/QuantBox_CTP_Trade.vcxproj.filters b/apis/CTP_Trade/CTP_Trade.vcxproj.filters similarity index 68% rename from QuantBox_CTP_Trade/QuantBox_CTP_Trade.vcxproj.filters rename to apis/CTP_Trade/CTP_Trade.vcxproj.filters index 5895a9e..b487557 100644 --- a/QuantBox_CTP_Trade/QuantBox_CTP_Trade.vcxproj.filters +++ b/apis/CTP_Trade/CTP_Trade.vcxproj.filters @@ -27,39 +27,54 @@ Header Files - + + include + + + include + + Header Files - + Header Files - + Header Files - - include + + Header Files - - include + + Header Files + + + Header Files Source Files - + + Source Files + + + Source Files + + Source Files - + Source Files - + Source Files - + Source Files - + Source Files diff --git a/apis/CTP_Trade/Include.h b/apis/CTP_Trade/Include.h new file mode 100644 index 0000000..54f16be --- /dev/null +++ b/apis/CTP_Trade/Include.h @@ -0,0 +1,35 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#define API_VERSION "0.3.0.20151216" +#define API_NAME "CTP" +#define DLL_PUBLIC_KEY "30819D300D06092A864886F70D010101050003818B0030818702818100A5411C1BAC072723B8EC84F609B88DF913308C6B38D2F304B4285AA290686888D05D731793AD30342E8917ACC57AF8DA4976877AC1B701A664EDEB668B14027F5ED4A96A61DA00AB0208E3E7DD4C8249E88B7A3BA511C7C082979B23AA1876ED2B7A77BB1A405D15B164E586431CD3ECFB3E448A193A41BA21C34A659196C353020111" + +#include "../../include/CTP/ThostFtdcUserApiDataType.h" +#include "../../include/CTP/ThostFtdcUserApiStruct.h" +#include "../../include/CTP/ThostFtdcTraderApi.h" + +#ifdef _WIN64 + #pragma comment(lib, "../../include/CTP/win64/thosttraderapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif +#else + #pragma comment(lib, "../../include/CTP/win32/thosttraderapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif +#endif + +// 条件编译 +#include "../CTP/include_pub.h" + +#undef HAS_ExchangeID_Position \ No newline at end of file diff --git a/apis/CTP_Trade/ReadMe.txt b/apis/CTP_Trade/ReadMe.txt new file mode 100644 index 0000000..918e658 --- /dev/null +++ b/apis/CTP_Trade/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : CTP_Trade Project Overview +======================================================================== + +AppWizard has created this CTP_Trade DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your CTP_Trade application. + + +CTP_Trade.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +CTP_Trade.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +CTP_Trade.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named CTP_Trade.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/QuantBox_CTP_Trade/stdafx.cpp b/apis/CTP_Trade/stdafx.cpp similarity index 100% rename from QuantBox_CTP_Trade/stdafx.cpp rename to apis/CTP_Trade/stdafx.cpp diff --git a/QuantBox_CTP_Trade/stdafx.h b/apis/CTP_Trade/stdafx.h similarity index 100% rename from QuantBox_CTP_Trade/stdafx.h rename to apis/CTP_Trade/stdafx.h diff --git a/QuantBox_LTS_Quote_v2/targetver.h b/apis/CTP_Trade/targetver.h similarity index 100% rename from QuantBox_LTS_Quote_v2/targetver.h rename to apis/CTP_Trade/targetver.h diff --git a/apis/Kingstar_Quote/Include.h b/apis/Kingstar_Quote/Include.h new file mode 100644 index 0000000..df083f2 --- /dev/null +++ b/apis/Kingstar_Quote/Include.h @@ -0,0 +1,41 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#define API_VERSION "0.3.0.20151216" +#define API_NAME "Kingstar" +#define DLL_PUBLIC_KEY "" + +#include "../../include/Kingstar/IncEx/KSUserApiDataTypeEx.h" +#include "../../include/Kingstar/IncEx/KSUserApiStructEx.h" +#include "../../include/Kingstar/inc/KSMarketDataAPI.h" + +using namespace KingstarAPI; + +#ifdef _WIN64 + #pragma comment(lib, "../../include/Kingstar/win64/KSMarketDataAPI.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif +#else + #pragma comment(lib, "../../include/Kingstar/win32/KSMarketDataAPI.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif +#endif + +// 为了解决金仕达授权问题而加的功能 +#define KS_LKC_FILENAME "KSInterB2C" +#define KS_LKC_EXT "lkc" + +#define KS_COPYFILE 1 + +// 条件编译 +#include "../CTP/include_pub.h" \ No newline at end of file diff --git a/apis/Kingstar_Quote/Kingstar_Quote.vcxproj b/apis/Kingstar_Quote/Kingstar_Quote.vcxproj new file mode 100644 index 0000000..8601d34 --- /dev/null +++ b/apis/Kingstar_Quote/Kingstar_Quote.vcxproj @@ -0,0 +1,117 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {199071F1-5059-4883-BA49-6A9922A71ADD} + Win32Proj + Kingstar_Quote + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\Kingstar + ./;$(IncludePath) + $(ProjectName)_$(PlatformTarget) + + + false + ..\..\bin\$(Configuration)\$(PlatformTarget)\Kingstar + $(ProjectName)_$(PlatformTarget) + ./;$(IncludePath) + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;KINGSTAR_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + ../../include/ApiHeader.def + + + + + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;KINGSTAR_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + ../../include/ApiHeader.def + + + + + + + + + + + + + + + + + + + + + + + Create + Create + + + + + + \ No newline at end of file diff --git a/apis/Kingstar_Quote/Kingstar_Quote.vcxproj.filters b/apis/Kingstar_Quote/Kingstar_Quote.vcxproj.filters new file mode 100644 index 0000000..2c637af --- /dev/null +++ b/apis/Kingstar_Quote/Kingstar_Quote.vcxproj.filters @@ -0,0 +1,66 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/apis/Kingstar_Quote/ReadMe.txt b/apis/Kingstar_Quote/ReadMe.txt new file mode 100644 index 0000000..262bfa1 --- /dev/null +++ b/apis/Kingstar_Quote/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : Kingstar_Quote Project Overview +======================================================================== + +AppWizard has created this Kingstar_Quote DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your Kingstar_Quote application. + + +Kingstar_Quote.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +Kingstar_Quote.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +Kingstar_Quote.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named Kingstar_Quote.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/apis/Kingstar_Quote/stdafx.cpp b/apis/Kingstar_Quote/stdafx.cpp new file mode 100644 index 0000000..fb7e65c --- /dev/null +++ b/apis/Kingstar_Quote/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// Kingstar_Quote.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/apis/Kingstar_Quote/stdafx.h b/apis/Kingstar_Quote/stdafx.h new file mode 100644 index 0000000..f3a0737 --- /dev/null +++ b/apis/Kingstar_Quote/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here diff --git a/QuantBox_LTS_Trade_v2/targetver.h b/apis/Kingstar_Quote/targetver.h similarity index 100% rename from QuantBox_LTS_Trade_v2/targetver.h rename to apis/Kingstar_Quote/targetver.h diff --git a/apis/Kingstar_Trade/Include.h b/apis/Kingstar_Trade/Include.h new file mode 100644 index 0000000..514f8a7 --- /dev/null +++ b/apis/Kingstar_Trade/Include.h @@ -0,0 +1,41 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#define API_VERSION "0.3.0.20151216" +#define API_NAME "Kingstar" +#define DLL_PUBLIC_KEY "" + +#include "../../include/Kingstar/IncEx/KSUserApiDataTypeEx.h" +#include "../../include/Kingstar/IncEx/KSUserApiStructEx.h" +#include "../../include/Kingstar/inc/KSTradeAPI.h" + +using namespace KingstarAPI; + +#ifdef _WIN64 + #pragma comment(lib, "../../include/Kingstar/win64/KSTradeAPI.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif +#else + #pragma comment(lib, "../../include/Kingstar/win32/KSTradeAPI.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif +#endif + +// 为了解决金仕达授权问题而加的功能 +#define KS_LKC_FILENAME "KSInterB2C" +#define KS_LKC_EXT "lkc" + +#define KS_COPYFILE 1 + +// 条件编译 +#include "../CTP/include_pub.h" \ No newline at end of file diff --git a/apis/Kingstar_Trade/Kingstar_Trade.vcxproj b/apis/Kingstar_Trade/Kingstar_Trade.vcxproj new file mode 100644 index 0000000..495e30e --- /dev/null +++ b/apis/Kingstar_Trade/Kingstar_Trade.vcxproj @@ -0,0 +1,116 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {70015722-8252-4944-AE20-16A88B583CEE} + Win32Proj + Kingstar_Trade + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\Kingstar + ./;$(IncludePath) + $(ProjectName)_$(PlatformTarget) + + + false + ./;$(IncludePath) + ..\..\bin\$(Configuration)\$(PlatformTarget)\Kingstar + $(ProjectName)_$(PlatformTarget) + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;KINGSTAR_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + ../../include/ApiHeader.def + + + + + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;KINGSTAR_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + ../../include/ApiHeader.def + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/apis/Kingstar_Trade/Kingstar_Trade.vcxproj.filters b/apis/Kingstar_Trade/Kingstar_Trade.vcxproj.filters new file mode 100644 index 0000000..54e8630 --- /dev/null +++ b/apis/Kingstar_Trade/Kingstar_Trade.vcxproj.filters @@ -0,0 +1,60 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/apis/Kingstar_Trade/ReadMe.txt b/apis/Kingstar_Trade/ReadMe.txt new file mode 100644 index 0000000..ad3554e --- /dev/null +++ b/apis/Kingstar_Trade/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : Kingstar_Trade Project Overview +======================================================================== + +AppWizard has created this Kingstar_Trade DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your Kingstar_Trade application. + + +Kingstar_Trade.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +Kingstar_Trade.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +Kingstar_Trade.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named Kingstar_Trade.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/apis/Kingstar_Trade/stdafx.cpp b/apis/Kingstar_Trade/stdafx.cpp new file mode 100644 index 0000000..d21ef9a --- /dev/null +++ b/apis/Kingstar_Trade/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// Kingstar_Trade.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/apis/Kingstar_Trade/stdafx.h b/apis/Kingstar_Trade/stdafx.h new file mode 100644 index 0000000..f3a0737 --- /dev/null +++ b/apis/Kingstar_Trade/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here diff --git a/QuantBox_Queue/targetver.h b/apis/Kingstar_Trade/targetver.h similarity index 100% rename from QuantBox_Queue/targetver.h rename to apis/Kingstar_Trade/targetver.h diff --git a/QuantBox_LTS_Query_v2/QuantBox_LTS_Query_v2.vcxproj b/apis/LTS_Query_v2/LTS_Query_v2.vcxproj similarity index 73% rename from QuantBox_LTS_Query_v2/QuantBox_LTS_Query_v2.vcxproj rename to apis/LTS_Query_v2/LTS_Query_v2.vcxproj index ffef572..c6e9de4 100644 --- a/QuantBox_LTS_Query_v2/QuantBox_LTS_Query_v2.vcxproj +++ b/apis/LTS_Query_v2/LTS_Query_v2.vcxproj @@ -13,19 +13,19 @@ {51D11C21-C4A7-4F07-9658-B8BA223684B8} Win32Proj - QuantBox_LTS_Query_v2 + LTS_Query_v2 DynamicLibrary true - v120 + v140 Unicode DynamicLibrary false - v120 + v140 true Unicode @@ -41,26 +41,30 @@ true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\LTS_v2\x86 + ..\..\bin\$(Configuration)\$(PlatformTarget)\LTS_v2 + $(ProjectName)_$(PlatformTarget) false + ..\..\bin\$(Configuration)\$(PlatformTarget)\LTS_v2 + $(ProjectName)_$(PlatformTarget) Use Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_LTS_QUERY_V2_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;LTS_QUERY_V2_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true Windows true - ..\include\ApiHeader.def + ../../include/ApiHeader.def - xcopy "$(TargetPath)" "$(SolutionDir)XAPI\LTS_v2\x86\" /Y + + @@ -70,7 +74,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTBOX_LTS_QUERY_V2_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;LTS_QUERY_V2_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -78,31 +82,25 @@ true true true + ../../include/ApiHeader.def - - - + + + - - - - - false - - - false - - - + + + + diff --git a/QuantBox_LTS_Query_v2/QuantBox_LTS_Query_v2.vcxproj.filters b/apis/LTS_Query_v2/LTS_Query_v2.vcxproj.filters similarity index 85% rename from QuantBox_LTS_Query_v2/QuantBox_LTS_Query_v2.vcxproj.filters rename to apis/LTS_Query_v2/LTS_Query_v2.vcxproj.filters index a2781ef..b0941ee 100644 --- a/QuantBox_LTS_Query_v2/QuantBox_LTS_Query_v2.vcxproj.filters +++ b/apis/LTS_Query_v2/LTS_Query_v2.vcxproj.filters @@ -27,13 +27,13 @@ Header Files - + Header Files - + Header Files - + Header Files @@ -50,13 +50,13 @@ Source Files - + Source Files - + Source Files - + Source Files diff --git a/apis/LTS_Query_v2/QueryApi.cpp b/apis/LTS_Query_v2/QueryApi.cpp new file mode 100644 index 0000000..974d7fc --- /dev/null +++ b/apis/LTS_Query_v2/QueryApi.cpp @@ -0,0 +1,869 @@ +#include "stdafx.h" +#include "QueryApi.h" + +#include "../../include/QueueEnum.h" +#include "../../include/QueueHeader.h" + +#include "../../include/ApiHeader.h" +#include "../../include/ApiStruct.h" + +#include "../../include/toolkit.h" + +#include "../../common/Queue/MsgQueue.h" + +// 这里用的是与交易同一个类型转换 +#include "../LTS_Trade_v2/TypeConvert.h" + +#include +#include + +void* __stdcall Query_Q(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + // 由内部调用,不用检查是否为空 + CQueryApi* pApi = (CQueryApi*)pApi2; + pApi->QueryInThread(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + return nullptr; +} + +void CQueryApi::QueryInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + int iRet = 0; + switch (type) + { + case E_Init: + iRet = _Init(); + break; + } + + if (m_pApi) + { + switch (type) + { + case E_ReqUserLoginField: + iRet = _ReqUserLogin(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryTradingAccount: + iRet = _ReqQryTradingAccount(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryInvestorPosition: + iRet = _ReqQryInvestorPosition(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryInstrument: + iRet = _ReqQryInstrument(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryInvestor: + iRet = _ReqQryInvestor(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryOrder: + iRet = _ReqQryOrder(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case QueryType::QueryType_ReqQryTrade: + iRet = _ReqQryTrade(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case E_AuthRandCodeField: + iRet = _ReqFetchAuthRandCode(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + default: + break; + } + } + + if (0 == iRet) + { + //返回成功,填加到已发送池 + m_nSleep = 1; + } + else + { + m_msgQueue_Query->Input_Copy(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + //失败,按4的幂进行延时,但不超过1s + m_nSleep *= 4; + m_nSleep %= 1023; + } + this_thread::sleep_for(chrono::milliseconds(m_nSleep)); +} + +void CQueryApi::Register(void* pCallback, void* pClass) +{ + m_pClass = pClass; + if (m_msgQueue == nullptr) + return; + + m_msgQueue_Query->Register((void*)Query_Q, this); + m_msgQueue->Register(pCallback, this); + if (pCallback) + { + m_msgQueue_Query->StartThread(); + m_msgQueue->StartThread(); + } + else + { + m_msgQueue_Query->StopThread(); + m_msgQueue->StopThread(); + } +} + +CQueryApi::CQueryApi(void) +{ + m_pApi = nullptr; + m_lRequestID = 0; + m_nSleep = 1; + + // 自己维护两个消息队列 + m_msgQueue = new CMsgQueue(); + m_msgQueue_Query = new CMsgQueue(); + + m_msgQueue_Query->Register((void*)Query_Q, this); + m_msgQueue_Query->StartThread(); +} + + +CQueryApi::~CQueryApi(void) +{ + Disconnect(); +} + +bool CQueryApi::IsErrorRspInfo(const char* szSource, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + bool bRet = ((pRspInfo) && (pRspInfo->ErrorID != 0)); + if (bRet) + { + ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); + + pField->RawErrorID = pRspInfo->ErrorID; + strcpy(pField->Text, pRspInfo->ErrorMsg); + strcpy(pField->Source, szSource); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + } + return bRet; +} + +bool CQueryApi::IsErrorRspInfo(CSecurityFtdcRspInfoField *pRspInfo) +{ + bool bRet = ((pRspInfo) && (pRspInfo->ErrorID != 0)); + + return bRet; +} + +void CQueryApi::Connect(const string& szPath, + ServerInfoField* pServerInfo, + UserInfoField* pUserInfo) +{ + m_szPath = szPath; + memcpy(&m_ServerInfo, pServerInfo, sizeof(ServerInfoField)); + memcpy(&m_UserInfo, pUserInfo, sizeof(UserInfoField)); + + m_msgQueue_Query->Input_NoCopy(RequestType::E_Init, m_msgQueue_Query, this, 0, 0, + nullptr, 0, nullptr, 0, nullptr, 0); +} + +int CQueryApi::_Init() +{ + char *pszPath = new char[m_szPath.length() + 1024]; + srand((unsigned int)time(nullptr)); + sprintf(pszPath, "%s/%s/%s/Qr/%d/", m_szPath.c_str(), m_ServerInfo.BrokerID, m_UserInfo.UserID, rand()); + makedirs(pszPath); + + m_pApi = CSecurityFtdcQueryApi::CreateFtdcQueryApi(pszPath); + delete[] pszPath; + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); + + if (m_pApi) + { + m_pApi->RegisterSpi(this); + + //添加地址 + size_t len = strlen(m_ServerInfo.Address) + 1; + char* buf = new char[len]; + strncpy(buf, m_ServerInfo.Address, len); + + char* token = strtok(buf, _QUANTBOX_SEPS_); + while (token) + { + if (strlen(token)>0) + { + m_pApi->RegisterFront(token); + } + token = strtok(nullptr, _QUANTBOX_SEPS_); + } + delete[] buf; + + //如果空着,反而是从头开始接收了,所以这里要特别处理一下 + //if (m_ServerInfo.PublicTopicResumeType < ResumeType::ResumeType_Undefined) + //{ + // m_pApi->SubscribePublicTopic((THOST_TE_RESUME_TYPE)m_ServerInfo.PublicTopicResumeType); + //} + //else + //{ + // m_pApi->SubscribePublicTopic(THOST_TERT_QUICK); + //} + + //if (m_ServerInfo.PrivateTopicResumeType < ResumeType::ResumeType_Undefined) + //{ + // m_pApi->SubscribePrivateTopic((THOST_TE_RESUME_TYPE)m_ServerInfo.PrivateTopicResumeType); + //} + //else + //{ + // m_pApi->SubscribePrivateTopic(THOST_TERT_QUICK); + //} + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); + //初始化连接 + m_pApi->Init(); + } + + return 0; +} + +void CQueryApi::Disconnect() +{ + if (m_msgQueue_Query) + { + m_msgQueue_Query->StopThread(); + m_msgQueue_Query->Register(nullptr, nullptr); + m_msgQueue_Query->Clear(); + delete m_msgQueue_Query; + m_msgQueue_Query = nullptr; + } + + if (m_pApi) + { + m_pApi->RegisterSpi(nullptr); + m_pApi->Release(); + m_pApi = nullptr; + + // 全清理,只留最后一个 + m_msgQueue->Clear(); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + // 主动触发 + m_msgQueue->Process(); + } + + if (m_msgQueue) + { + m_msgQueue->StopThread(); + m_msgQueue->Register(nullptr, nullptr); + m_msgQueue->Clear(); + delete m_msgQueue; + m_msgQueue = nullptr; + } + + m_lRequestID = 0;//由于线程已经停止,没有必要用原子操作了 + + Clear(); +} + +void CQueryApi::Clear() +{ + for (unordered_map::iterator it = m_id_platform_order.begin(); it != m_id_platform_order.end(); ++it) + delete it->second; + m_id_platform_order.clear(); + + for (unordered_map::iterator it = m_id_api_order.begin(); it != m_id_api_order.end(); ++it) + delete it->second; + m_id_api_order.clear(); + + //for (unordered_map::iterator it = m_id_platform_quote.begin(); it != m_id_platform_quote.end(); ++it) + // delete it->second; + //m_id_platform_quote.clear(); + + //for (unordered_map::iterator it = m_id_api_quote.begin(); it != m_id_api_quote.end(); ++it) + // delete it->second; + //m_id_api_quote.clear(); + + for (unordered_map::iterator it = m_id_platform_position.begin(); it != m_id_platform_position.end(); ++it) + delete it->second; + m_id_platform_position.clear(); +} + +void CQueryApi::OnFrontConnected() +{ + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + + //ReqUserLogin(); + ReqFetchAuthRandCode(); +} + +void CQueryApi::OnFrontDisconnected(int nReason) +{ + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + + //连接失败返回的信息是拼接而成,主要是为了统一输出 + pField->RawErrorID = nReason; + GetOnFrontDisconnectedMsg(nReason, pField->Text); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); +} + +void CQueryApi::ReqFetchAuthRandCode() +{ + CSecurityFtdcAuthRandCodeField* pBody = (CSecurityFtdcAuthRandCodeField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcAuthRandCodeField)); + + strncpy(pBody->RandCode, "", sizeof(TSecurityFtdcAuthCodeType)); + + m_msgQueue_Query->Input_NoCopy(RequestType::E_AuthRandCodeField, m_msgQueue_Query, this, 0, 0, + pBody, sizeof(CSecurityFtdcAuthRandCodeField), nullptr, 0, nullptr, 0); +} + +int CQueryApi::_ReqFetchAuthRandCode(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorizing, 0, nullptr, 0, nullptr, 0, nullptr, 0); + return m_pApi->ReqFetchAuthRandCode((CSecurityFtdcAuthRandCodeField*)ptr1, ++m_lRequestID); +} + +void CQueryApi::OnRspFetchAuthRandCode(CSecurityFtdcAuthRandCodeField *pAuthRandCode, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + + if (!IsErrorRspInfo(pRspInfo) + && pAuthRandCode) + { + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorized, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + + ReqUserLogin(pAuthRandCode->RandCode); + } + else + { + pField->RawErrorID = pRspInfo->ErrorID; + strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } +} + +void CQueryApi::ReqUserLogin(TSecurityFtdcAuthCodeType RandCode) +{ + CSecurityFtdcReqUserLoginField* pBody = (CSecurityFtdcReqUserLoginField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcReqUserLoginField)); + + strncpy(pBody->BrokerID, m_ServerInfo.BrokerID, sizeof(TSecurityFtdcBrokerIDType)); + strncpy(pBody->UserID, m_UserInfo.UserID, sizeof(TSecurityFtdcInvestorIDType)); + strncpy(pBody->Password, m_UserInfo.Password, sizeof(TSecurityFtdcPasswordType)); + strncpy(pBody->UserProductInfo, m_ServerInfo.UserProductInfo, sizeof(TSecurityFtdcProductInfoType)); + strncpy(pBody->AuthCode, m_ServerInfo.AuthCode, sizeof(TSecurityFtdcAuthCodeType)); + strncpy(pBody->RandCode, RandCode, sizeof(TSecurityFtdcAuthCodeType)); + + m_msgQueue_Query->Input_NoCopy(RequestType::E_ReqUserLoginField, m_msgQueue_Query, this, 0, 0, + pBody, sizeof(CSecurityFtdcReqUserLoginField), nullptr, 0, nullptr, 0); +} + +int CQueryApi::_ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); + return m_pApi->ReqUserLogin((CSecurityFtdcReqUserLoginField*)ptr1, ++m_lRequestID); +} + +void CQueryApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + + if (!IsErrorRspInfo(pRspInfo) + &&pRspUserLogin) + { + pField->TradingDay = GetDate(pRspUserLogin->TradingDay); + pField->LoginTime = GetTime(pRspUserLogin->LoginTime); + + sprintf(pField->SessionID, "%d:%d", pRspUserLogin->FrontID, pRspUserLogin->SessionID); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + + // 记下登录信息,可能会用到 + memcpy(&m_RspUserLogin,pRspUserLogin,sizeof(CSecurityFtdcRspUserLoginField)); + m_nMaxOrderRef = atol(pRspUserLogin->MaxOrderRef); + // 自己发单时ID从1开始,不能从0开始 + m_nMaxOrderRef = m_nMaxOrderRef>1 ? m_nMaxOrderRef : 1; + //ReqSettlementInfoConfirm(); + ReqQueryField body = { 0 }; + ReqQuery(QueryType::QueryType_ReqQryInvestor, &body); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); + + if (m_ServerInfo.PrivateTopicResumeType > ResumeType::ResumeType_Restart + && (m_ServerInfo.PrivateTopicResumeTypeRawErrorID = pRspInfo->ErrorID; + strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } +} + +void CQueryApi::ReqQuery(QueryType type, ReqQueryField* pQuery) +{ + m_msgQueue_Query->Input_Copy(type, m_msgQueue_Query, this, 0, 0, + pQuery, sizeof(ReqQueryField), nullptr, 0, nullptr, 0); +} + +int CQueryApi::_ReqQryTradingAccount(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + CSecurityFtdcQryTradingAccountField body = { 0 }; + + strcpy(body.BrokerID, m_RspUserLogin.BrokerID); + strcpy(body.InvestorID, m_RspUserLogin.UserID); + + return m_pApi->ReqQryTradingAccount(&body, ++m_lRequestID); +} + +void CQueryApi::OnRspQryTradingAccount(CSecurityFtdcTradingAccountField *pTradingAccount, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + if (!IsErrorRspInfo("OnRspQryTradingAccount", pRspInfo, nRequestID, bIsLast)) + { + if (pTradingAccount) + { + AccountField* pField = (AccountField*)m_msgQueue->new_block(sizeof(AccountField)); + + strcpy(pField->AccountID, pTradingAccount->AccountID); + pField->PreBalance = pTradingAccount->PreBalance; + pField->CurrMargin = pTradingAccount->CurrMargin; + //pField->CloseProfit = pTradingAccount->CloseProfit; + //pField->PositionProfit = pTradingAccount->PositionProfit; + pField->Balance = pTradingAccount->Balance; + pField->Available = pTradingAccount->Available; + pField->Deposit = pTradingAccount->Deposit; + pField->Withdraw = pTradingAccount->Withdraw; + pField->FrozenTransferFee = pTradingAccount->FrozenTransferFee; + pField->FrozenStampTax = pTradingAccount->FrozenStampTax; + pField->FrozenCommission = pTradingAccount->FrozenCommission; + pField->FrozenCash = pTradingAccount->FrozenCash; + pField->TransferFee = pTradingAccount->TransferFee; + pField->StampTax = pTradingAccount->StampTax; + pField->Commission = pTradingAccount->Commission; + pField->CashIn = pTradingAccount->CashIn; + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryTradingAccount, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(AccountField), nullptr, 0, nullptr, 0); + } + else + { + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryTradingAccount, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } + } +} + +int CQueryApi::_ReqQryInvestorPosition(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + ReqQueryField* pQuery = (ReqQueryField*)ptr1; + + CSecurityFtdcQryInvestorPositionField body = { 0 }; + + strncpy(body.BrokerID, m_RspUserLogin.BrokerID, sizeof(TSecurityFtdcBrokerIDType)); + strncpy(body.InvestorID, m_RspUserLogin.UserID, sizeof(TSecurityFtdcInvestorIDType)); + strncpy(body.InstrumentID, pQuery->InstrumentID, sizeof(TSecurityFtdcInstrumentIDType)); + + return m_pApi->ReqQryInvestorPosition(&body, ++m_lRequestID); +} + +// 国债逆回购,持仓是Net,我归类到了Long中,如果我直接从成交中分析出来的又归到了Net中 +// 所有开平和投保类型都是空 +void CQueryApi::OnRspQryInvestorPosition(CSecurityFtdcInvestorPositionField *pInvestorPosition, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + if (!IsErrorRspInfo("OnRspQryInvestorPosition", pRspInfo, nRequestID, bIsLast)) + { + if (pInvestorPosition) + { + PositionIDType positionId = { 0 }; + sprintf(positionId, "%s:%s:%d:%d", + pInvestorPosition->InstrumentID, pInvestorPosition->ExchangeID, + TSecurityFtdcPosiDirectionType_2_PositionSide(pInvestorPosition->PosiDirection), TSecurityFtdcHedgeFlagType_2_HedgeFlagType(pInvestorPosition->HedgeFlag)); + + PositionField* pField = nullptr; + unordered_map::iterator it = m_id_platform_position.find(positionId); + if (it == m_id_platform_position.end()) + { + pField = (PositionField*)m_msgQueue->new_block(sizeof(PositionField)); + // 添加 + strcpy(pField->ID, positionId); + + sprintf(pField->Symbol, "%s.%s", pInvestorPosition->InstrumentID, pInvestorPosition->ExchangeID); + strcpy(pField->InstrumentID, pInvestorPosition->InstrumentID); + strcpy(pField->ExchangeID, pInvestorPosition->ExchangeID); + strcpy(pField->AccountID, pInvestorPosition->AccountID); + pField->Side = TSecurityFtdcPosiDirectionType_2_PositionSide(pInvestorPosition->PosiDirection); + pField->HedgeFlag = TSecurityFtdcHedgeFlagType_2_HedgeFlagType(pInvestorPosition->HedgeFlag); + + m_id_platform_position.insert(pair(positionId, pField)); + } + else + { + pField = it->second; + } + + pField->Position = pInvestorPosition->Position; + pField->TodayPosition = pInvestorPosition->TodayPosition; + pField->HistoryPosition = pInvestorPosition->YdPosition; + + // 等数据收集全了再遍历通知一次 + if (bIsLast) + { + int cnt = 0; + int count = m_id_platform_position.size(); + for (unordered_map::iterator iter = m_id_platform_position.begin(); iter != m_id_platform_position.end(); iter++) + { + ++cnt; + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryInvestorPosition, m_msgQueue, m_pClass, cnt == count, 0, iter->second, sizeof(PositionField), nullptr, 0, nullptr, 0); + } + } + } + } +} + +int CQueryApi::_ReqQryInstrument(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + ReqQueryField* pQuery = (ReqQueryField*)ptr1; + + CSecurityFtdcQryInstrumentField body = { 0 }; + strncpy(body.InstrumentID, pQuery->InstrumentID, sizeof(TSecurityFtdcInstrumentIDType)); + strncpy(body.ExchangeID, pQuery->ExchangeID, sizeof(TSecurityFtdcExchangeIDType)); + + return m_pApi->ReqQryInstrument(&body, ++m_lRequestID); +} + +void CQueryApi::OnRspQryInstrument(CSecurityFtdcInstrumentField *pInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + if (!IsErrorRspInfo("OnRspQryInstrument", pRspInfo, nRequestID, bIsLast)) + { + if (pInstrument) + { + InstrumentField* pField = (InstrumentField*)m_msgQueue->new_block(sizeof(InstrumentField)); + + strncpy(pField->InstrumentID, pInstrument->InstrumentID, sizeof(InstrumentIDType)); + strncpy(pField->ExchangeID, pInstrument->ExchangeID, sizeof(ExchangeIDType)); + + sprintf(pField->Symbol,"%s.%s",pInstrument->InstrumentID,pInstrument->ExchangeID); + sprintf(pField->InstrumentName, "%s(%s)", pInstrument->ExchangeInstID, pInstrument->InstrumentName); + strncpy(pField->ProductID, pInstrument->ProductID, sizeof(InstrumentIDType)); + + //strncpy(pField->InstrumentName, pInstrument->InstrumentName, sizeof(InstrumentNameType)); + pField->Type = CSecurityFtdcInstrumentField_2_InstrumentType(pInstrument); + pField->VolumeMultiple = pInstrument->VolumeMultiple; + pField->PriceTick = CSecurityFtdcInstrumentField_2_PriceTick(pInstrument); + pField->ExpireDate = GetDate(pInstrument->ExpireDate); + pField->OptionsType = CSecurityFtdcInstrumentField_2_PutCall(pInstrument); + pField->StrikePrice = pInstrument->ExecPrice; + + + // 期权的标的物 + if (strlen(pInstrument->InstrumentID) == 8) + { + strncpy(pField->UnderlyingInstrID, pInstrument->ExchangeInstID, 6); + sprintf(&pField->UnderlyingInstrID[6], ".%s", pInstrument->ExchangeID); + } + + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InstrumentField), nullptr, 0, nullptr, 0); + } + else + { + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } + } +} + +void CQueryApi::OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + IsErrorRspInfo("OnRspError", pRspInfo, nRequestID, bIsLast); +} + +int CQueryApi::_ReqQryOrder(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + CSecurityFtdcQryOrderField body = { 0 }; + + strcpy(body.BrokerID, m_RspUserLogin.BrokerID); + strcpy(body.InvestorID, m_RspUserLogin.UserID); + + return m_pApi->ReqQryOrder(&body, ++m_lRequestID); +} + +void CQueryApi::OnOrder(CSecurityFtdcOrderField *pOrder, int nRequestID, bool bIsLast) +{ + if (nullptr == pOrder) + return; + + OrderIDType orderId = { 0 }; + sprintf(orderId, "%d:%d:%s", pOrder->FrontID, pOrder->SessionID, pOrder->OrderRef); + OrderIDType orderSydId = { 0 }; + + { + // 保存原始订单信息,用于撤单 + + unordered_map::iterator it = m_id_api_order.find(orderId); + if (it == m_id_api_order.end()) + { + // 找不到此订单,表示是新单 + CSecurityFtdcOrderField* pField = new CSecurityFtdcOrderField(); + memcpy(pField, pOrder, sizeof(CSecurityFtdcOrderField)); + m_id_api_order.insert(pair(orderId, pField)); + } + else + { + // 找到了订单 + // 需要再复制保存最后一次的状态,还是只要第一次的用于撤单即可?记下,这样最后好比较 + CSecurityFtdcOrderField* pField = it->second; + memcpy(pField, pOrder, sizeof(CSecurityFtdcOrderField)); + } + + // 保存SysID用于定义成交回报与订单 + sprintf(orderSydId, "%s:%s", pOrder->ExchangeID, pOrder->OrderSysID); + m_sysId_orderId.insert(pair(orderSydId, orderId)); + } + + { + // 从API的订单转换成自己的结构体 + if (nRequestID == 0) + { + OrderField* pField = nullptr; + unordered_map::iterator it = m_id_platform_order.find(orderId); + if (it == m_id_platform_order.end()) + { + // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 + pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); + + // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 + CSecurityFtdcOrderField_2_OrderField_0(orderId, pOrder, pField); + + + // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 + m_id_platform_order.insert(pair(orderId, pField)); + } + else + { + pField = it->second; + strcpy(pField->ID, orderId); + strcpy(pField->LocalID, pField->ID); + pField->LeavesQty = pOrder->VolumeTotal; + pField->Price = atof(pOrder->LimitPrice); + pField->Status = CSecurityFtdcOrderField_2_OrderStatus(pOrder); + pField->ExecType = CSecurityFtdcOrderField_2_ExecType(pOrder); + strcpy(pField->OrderID, pOrder->OrderSysID); + strncpy(pField->Text, pOrder->StatusMsg, sizeof(Char256Type)); + } + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + } + else + { + OrderField* pField = nullptr; + pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); + + // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 + CSecurityFtdcOrderField_2_OrderField_0(orderId, pOrder, pField); + + // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 + //m_id_platform_order.insert(pair(orderId, pField)); + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryOrder, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + + m_msgQueue->delete_block(pField); + } + + } +} + +void CQueryApi::OnRspQryOrder(CSecurityFtdcOrderField *pOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + if (!IsErrorRspInfo("OnRspQryOrder", pRspInfo, nRequestID, bIsLast)) + { + OnOrder(pOrder, nRequestID, bIsLast); + } +} + +//void CQueryApi::ReqQryTrade() +//{ +// CSecurityFtdcQryTradeField* pBody = (CSecurityFtdcQryTradeField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcQryTradeField)); +// +// strcpy(pBody->BrokerID, m_RspUserLogin.BrokerID); +// strcpy(pBody->InvestorID, m_RspUserLogin.UserID); +// +// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryTradeField, m_msgQueue_Query, this, 0, 0, +// pBody, sizeof(CSecurityFtdcQryTradeField), nullptr, 0, nullptr, 0); +//} + +int CQueryApi::_ReqQryTrade(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + CSecurityFtdcQryTradeField body = { 0 }; + + strcpy(body.BrokerID, m_RspUserLogin.BrokerID); + strcpy(body.InvestorID, m_RspUserLogin.UserID); + + return m_pApi->ReqQryTrade(&body, ++m_lRequestID); +} + +void CQueryApi::OnTrade(CSecurityFtdcTradeField *pTrade, int nRequestID, bool bIsLast) +{ + if (nullptr == pTrade) + return; + + TradeField* pField = (TradeField*)m_msgQueue->new_block(sizeof(TradeField)); + strcpy(pField->InstrumentID, pTrade->InstrumentID); + strcpy(pField->ExchangeID, pTrade->ExchangeID); + pField->Side = TSecurityFtdcDirectionType_2_OrderSide(pTrade->Direction); + pField->Qty = pTrade->Volume; + pField->Price = atof(pTrade->Price); + pField->OpenClose = TSecurityFtdcOffsetFlagType_2_OpenCloseType(pTrade->OffsetFlag); + pField->HedgeFlag = TSecurityFtdcHedgeFlagType_2_HedgeFlagType(pTrade->HedgeFlag); + pField->Commission = 0;//TODO收续费以后要计算出来 + pField->Time = GetTime(pTrade->TradeTime); + strcpy(pField->TradeID, pTrade->TradeID); + + if (nRequestID == 0) + { + OrderIDType orderSysId = { 0 }; + sprintf(orderSysId, "%s:%s", pTrade->ExchangeID, pTrade->OrderSysID); + unordered_map::iterator it = m_sysId_orderId.find(orderSysId); + if (it == m_sysId_orderId.end()) + { + // 此成交找不到对应的报单 + //assert(false); + } + else + { + // 找到对应的报单 + strcpy(pField->ID, it->second.c_str()); + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnTrade, m_msgQueue, m_pClass, 0, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); + + unordered_map::iterator it2 = m_id_platform_order.find(it->second); + if (it2 == m_id_platform_order.end()) + { + // 此成交找不到对应的报单 + //assert(false); + } + else + { + // 更新订单的状态 + // 是否要通知接口 + } + + OnTrade(pField); + } + } + else + { + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryTrade, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); + } + + // 清理内存 + m_msgQueue->delete_block(pField); +} + +void CQueryApi::OnTrade(TradeField *pTrade) +{ + PositionIDType positionId = { 0 }; + sprintf(positionId, "%s:%s:%d:%d", + pTrade->InstrumentID, pTrade->ExchangeID, TradeField_2_PositionSide(pTrade), pTrade->HedgeFlag); + + PositionField* pField = nullptr; + unordered_map::iterator it = m_id_platform_position.find(positionId); + if (it == m_id_platform_position.end()) + { + pField = (PositionField*)m_msgQueue->new_block(sizeof(PositionField)); + + sprintf(pField->Symbol, "%s.%s", pTrade->InstrumentID, pTrade->ExchangeID); + strcpy(pField->InstrumentID, pTrade->InstrumentID); + strcpy(pField->ExchangeID, pTrade->ExchangeID); + pField->Side = TradeField_2_PositionSide(pTrade); + pField->HedgeFlag = TSecurityFtdcHedgeFlagType_2_HedgeFlagType(pTrade->HedgeFlag); + + m_id_platform_position.insert(pair(positionId, pField)); + } + else + { + pField = it->second; + } + + if (pTrade->Side == OrderSide::OrderSide_Buy) + { + pField->Position += pTrade->Qty; + pField->TodayPosition += pTrade->Qty; + } + else + { + pField->Position -= pTrade->Qty; + if (pTrade->OpenClose == OpenCloseType::OpenCloseType_CloseToday) + { + pField->TodayPosition -= pTrade->Qty; + } + else + { + pField->HistoryPosition -= pTrade->Qty; + // 如果昨天的被减成负数,从今天开始继续减 + if (pField->HistoryPosition<0) + { + pField->TodayPosition += pField->HistoryPosition; + pField->HistoryPosition = 0; + } + } + + // 计算错误,直接重新查询 + if (pField->Position < 0 || pField->TodayPosition < 0 || pField->HistoryPosition < 0) + { + ReqQueryField body = { 0 }; + ReqQuery(QueryType::QueryType_ReqQryInvestorPosition, &body); + return; + } + } + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryInvestorPosition, m_msgQueue, m_pClass, false, 0, pField, sizeof(PositionField), nullptr, 0, nullptr, 0); +} + +void CQueryApi::OnRspQryTrade(CSecurityFtdcTradeField *pTrade, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + if (!IsErrorRspInfo("OnRspQryTrade", pRspInfo, nRequestID, bIsLast)) + { + OnTrade(pTrade, nRequestID, bIsLast); + } +} + +//void CQueryApi::ReqQryInvestor() +//{ +// CSecurityFtdcQryInvestorField* pBody = (CSecurityFtdcQryInvestorField*)m_msgQueue_Query->new_block(sizeof(CSecurityFtdcQryInvestorField)); +// +// strncpy(pBody->BrokerID, m_RspUserLogin.BrokerID, sizeof(TSecurityFtdcBrokerIDType)); +// strncpy(pBody->InvestorID, m_RspUserLogin.UserID, sizeof(TSecurityFtdcInvestorIDType)); +// +// m_msgQueue_Query->Input_NoCopy(RequestType::E_QryInvestorField, m_msgQueue_Query, this, 0, 0, +// pBody, sizeof(CSecurityFtdcQryInvestorField), nullptr, 0, nullptr, 0); +//} + +int CQueryApi::_ReqQryInvestor(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + CSecurityFtdcQryInvestorField body = { 0 }; + + strcpy(body.BrokerID, m_RspUserLogin.BrokerID); + strcpy(body.InvestorID, m_RspUserLogin.UserID); + + return m_pApi->ReqQryInvestor(&body, ++m_lRequestID); +} + +void CQueryApi::OnRspQryInvestor(CSecurityFtdcInvestorField *pInvestor, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + if (!IsErrorRspInfo("OnRspQryInvestor", pRspInfo, nRequestID, bIsLast)) + { + if (pInvestor) + { + memcpy(&m_Investor, pInvestor, sizeof(CSecurityFtdcInvestorField)); + + InvestorField* pField = (InvestorField*)m_msgQueue->new_block(sizeof(InvestorField)); + + strcpy(pField->BrokerID, pInvestor->BrokerID); + strcpy(pField->InvestorID, pInvestor->InvestorID); + strcpy(pField->InvestorName, pInvestor->InvestorName); + strcpy(pField->IdentifiedCardNo, pInvestor->IdentifiedCardNo); + pField->IdentifiedCardType = TSecurityFtdcIdCardTypeType_2_IdCardType(pInvestor->IdentifiedCardType); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInvestor, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InvestorField), nullptr, 0, nullptr, 0); + } + else + { + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInvestor, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } + } +} diff --git a/QuantBox_LTS_Query_v2/QueryApi.h b/apis/LTS_Query_v2/QueryApi.h similarity index 84% rename from QuantBox_LTS_Query_v2/QueryApi.h rename to apis/LTS_Query_v2/QueryApi.h index f71aca1..815fb0e 100644 --- a/QuantBox_LTS_Query_v2/QueryApi.h +++ b/apis/LTS_Query_v2/QueryApi.h @@ -1,14 +1,23 @@ #pragma once -#include "../include/LTS_v2/SecurityFtdcQueryApi.h" -#include "../include/ApiStruct.h" +#include "../../include/LTS_v2/SecurityFtdcQueryApi.h" +#include "../../include/ApiStruct.h" +#include "../../include/QueueEnum.h" #ifdef _WIN64 -#pragma comment(lib, "../include/LTS_v2/win64/securityqueryapi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x64.lib") + #pragma comment(lib, "../../include/LTS_v2/win64/securityqueryapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif #else -#pragma comment(lib, "../include/LTS_v2/win32/securityqueryapi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x86.lib") + #pragma comment(lib, "../../include/LTS_v2/win32/securityqueryapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif #endif #include @@ -30,7 +39,7 @@ class CQueryApi : //ݰ enum RequestType { - E_Init, + E_Init = 100, E_ReqAuthenticateField, E_ReqUserLoginField, @@ -83,19 +92,21 @@ class CQueryApi : //int ReqQuoteAction(CSecurityFtdcQuoteField *pQuote); //int ReqQuoteAction(const string& szId); - void ReqQryTradingAccount(); - void ReqQryInvestorPosition(const string& szInstrumentId, const string& szExchange); - void ReqQryInvestorPositionDetail(const string& szInstrumentId); - void ReqQryInstrument(const string& szInstrumentId, const string& szExchange); - void ReqQryInstrumentCommissionRate(const string& szInstrumentId); - void ReqQryInstrumentMarginRate(const string& szInstrumentId, TSecurityFtdcHedgeFlagType HedgeFlag = SECURITY_FTDC_HF_Speculation); - void ReqQryDepthMarketData(const string& szInstrumentId); - void ReqQrySettlementInfo(const string& szTradingDay); + void ReqQuery(QueryType type, ReqQueryField* pQuery); - void ReqQryOrder(); - void ReqQryTrade(); + //void ReqQryTradingAccount(); + //void ReqQryInvestorPosition(const string& szInstrumentId, const string& szExchange); + //void ReqQryInvestorPositionDetail(const string& szInstrumentId); + //void ReqQryInstrument(const string& szInstrumentId, const string& szExchange); + //void ReqQryInstrumentCommissionRate(const string& szInstrumentId); + //void ReqQryInstrumentMarginRate(const string& szInstrumentId, TSecurityFtdcHedgeFlagType HedgeFlag = SECURITY_FTDC_HF_Speculation); + //void ReqQryDepthMarketData(const string& szInstrumentId); + //void ReqQrySettlementInfo(const string& szTradingDay); - void ReqQryInvestor(); + //void ReqQryOrder(); + //void ReqQryTrade(); + + //void ReqQryInvestor(); private: friend void* __stdcall Query_Q(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); @@ -120,12 +131,13 @@ class CQueryApi : int _ReqQryTrade(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); //int _ReqQryQuote(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - void OnOrder(CSecurityFtdcOrderField *pOrder, bool bFromQry); - void OnTrade(CSecurityFtdcTradeField *pTrade, bool bFromQry); - void OnTrade(TradeField *pTrade, bool bFromQry); + void OnOrder(CSecurityFtdcOrderField *pOrder, int nRequestID, bool bIsLast); + void OnTrade(CSecurityFtdcTradeField *pTrade, int nRequestID, bool bIsLast); + + void OnTrade(TradeField *pTrade); //Ƿ - bool IsErrorRspInfo(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);//ϢϢ + bool IsErrorRspInfo(const char* szSource, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);//ϢϢ bool IsErrorRspInfo(CSecurityFtdcRspInfoField *pRspInfo);//Ϣ // diff --git a/QuantBox_LTS_Query_v2/ReadMe.txt b/apis/LTS_Query_v2/ReadMe.txt similarity index 100% rename from QuantBox_LTS_Query_v2/ReadMe.txt rename to apis/LTS_Query_v2/ReadMe.txt diff --git a/QuantBox_LTS_Query_v2/TraderApi.cpp b/apis/LTS_Query_v2/TraderApi.cpp similarity index 100% rename from QuantBox_LTS_Query_v2/TraderApi.cpp rename to apis/LTS_Query_v2/TraderApi.cpp diff --git a/QuantBox_LTS_Query_v2/TraderApi.h b/apis/LTS_Query_v2/TraderApi.h similarity index 100% rename from QuantBox_LTS_Query_v2/TraderApi.h rename to apis/LTS_Query_v2/TraderApi.h diff --git a/QuantBox_LTS_Quote_v2/dllmain.cpp b/apis/LTS_Query_v2/dllmain.cpp similarity index 100% rename from QuantBox_LTS_Quote_v2/dllmain.cpp rename to apis/LTS_Query_v2/dllmain.cpp diff --git a/apis/LTS_Query_v2/main.cpp b/apis/LTS_Query_v2/main.cpp new file mode 100644 index 0000000..c28f097 --- /dev/null +++ b/apis/LTS_Query_v2/main.cpp @@ -0,0 +1,62 @@ +#include "stdafx.h" +#include "../../include/ApiHeader.h" +#include "../../include/QueueEnum.h" +#include "QueryApi.h" + +inline CQueryApi* GetApi(void* pApi) +{ + return static_cast(pApi); +} + +void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + RequestType rt = (RequestType)type; + switch (rt) + { + case RequestType_GetApiTypes: + return (void*)(ApiType::ApiType_Query | ApiType::ApiType_Instrument); + case RequestType_GetApiVersion: + return (void*)"0.1.0.20151116"; + case RequestType_GetApiName: + return (void*)"LTS2"; + case RequestType_Create: + return new CQueryApi(); + default: + break; + } + + if (pApi1 == nullptr) + { + return nullptr; + } + + CQueryApi* pApi = GetApi(pApi1); + + switch (rt) + { + case RequestType_Release: + delete pApi; + return nullptr; + case RequestType_Register: + pApi->Register(ptr1, ptr2); + break; + case RequestType_Connect: + pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); + break; + case RequestType_Disconnect: + pApi->Disconnect(); + break; + case QueryType_ReqQryInstrument: + case QueryType_ReqQryInvestorPosition: + case QueryType_ReqQryTradingAccount: + case QueryType_ReqQrySettlementInfo: + case QueryType_ReqQryTrade: + case QueryType_ReqQryOrder: + pApi->ReqQuery((QueryType)type, (ReqQueryField*)ptr1); + break; + default: + break; + } + + return pApi1; +} diff --git a/QuantBox_LTS_Query_v2/stdafx.cpp b/apis/LTS_Query_v2/stdafx.cpp similarity index 100% rename from QuantBox_LTS_Query_v2/stdafx.cpp rename to apis/LTS_Query_v2/stdafx.cpp diff --git a/apis/LTS_Query_v2/stdafx.h b/apis/LTS_Query_v2/stdafx.h new file mode 100644 index 0000000..f3a0737 --- /dev/null +++ b/apis/LTS_Query_v2/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here diff --git a/QuantBox_Tdx_Trade/targetver.h b/apis/LTS_Query_v2/targetver.h similarity index 100% rename from QuantBox_Tdx_Trade/targetver.h rename to apis/LTS_Query_v2/targetver.h diff --git a/QuantBox_LTS_Quote_v2/QuantBox_LTS_Quote.cbp b/apis/LTS_Quote_v2/LTS_Quote.cbp similarity index 100% rename from QuantBox_LTS_Quote_v2/QuantBox_LTS_Quote.cbp rename to apis/LTS_Quote_v2/LTS_Quote.cbp diff --git a/apis/LTS_Quote_v2/LTS_Quote_v2.vcxproj b/apis/LTS_Quote_v2/LTS_Quote_v2.vcxproj new file mode 100644 index 0000000..5f63f73 --- /dev/null +++ b/apis/LTS_Quote_v2/LTS_Quote_v2.vcxproj @@ -0,0 +1,112 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {D4387736-0623-4442-A4AC-AF79239F9419} + Win32Proj + LTS_Quote + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\LTS_v2 + $(ProjectName)_$(PlatformTarget) + + + false + ..\..\bin\$(Configuration)\$(PlatformTarget)\LTS_v2 + $(ProjectName)_$(PlatformTarget) + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;LTS_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + ../../include/ApiHeader.def + + + + + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;LTS_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + ../../include/ApiHeader.def + + + + + + + + + + + + + + + + + + + + Create + Create + + + + + + \ No newline at end of file diff --git a/QuantBox_LTS_Quote_v2/QuantBox_LTS_Quote_v2.vcxproj.filters b/apis/LTS_Quote_v2/LTS_Quote_v2.vcxproj.filters similarity index 89% rename from QuantBox_LTS_Quote_v2/QuantBox_LTS_Quote_v2.vcxproj.filters rename to apis/LTS_Quote_v2/LTS_Quote_v2.vcxproj.filters index da44306..b2174a6 100644 --- a/QuantBox_LTS_Quote_v2/QuantBox_LTS_Quote_v2.vcxproj.filters +++ b/apis/LTS_Quote_v2/LTS_Quote_v2.vcxproj.filters @@ -27,10 +27,10 @@ Header Files - + Header Files - + Header Files @@ -47,10 +47,10 @@ Source Files - + Source Files - + Source Files diff --git a/QuantBox_LTS_Quote_v2/MdUserApi.cpp b/apis/LTS_Quote_v2/MdUserApi.cpp similarity index 83% rename from QuantBox_LTS_Quote_v2/MdUserApi.cpp rename to apis/LTS_Quote_v2/MdUserApi.cpp index 62ac75f..1da36bb 100644 --- a/QuantBox_LTS_Quote_v2/MdUserApi.cpp +++ b/apis/LTS_Quote_v2/MdUserApi.cpp @@ -1,17 +1,17 @@ #include "stdafx.h" #include "MdUserApi.h" -#include "../include/QueueEnum.h" -#include "../include/QueueHeader.h" +#include "../../include/QueueEnum.h" +#include "../../include/QueueHeader.h" -#include "../include/ApiHeader.h" -#include "../include/ApiStruct.h" +#include "../../include/ApiHeader.h" +#include "../../include/ApiStruct.h" -#include "../include/toolkit.h" -#include "../include/ApiProcess.h" +#include "../../include/toolkit.h" +#include "../../include/ApiProcess.h" -#include "../QuantBox_Queue/MsgQueue.h" +#include "../../common/Queue/MsgQueue.h" #ifdef _REMOTE -#include "../QuantBox_Queue/RemoteQueue.h" +#include "../../common/Queue/RemoteQueue.h" #endif #include @@ -123,7 +123,7 @@ bool CMdUserApi::IsErrorRspInfo(const char* szSource, CSecurityFtdcRspInfoField strcpy(pField->Text, pRspInfo->ErrorMsg); strcpy(pField->Source, szSource); - m_msgQueue->Input_NoCopy(ResponeType::OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); } return bRet; } @@ -166,7 +166,7 @@ int CMdUserApi::_Init() m_pApi = CSecurityFtdcMdApi::CreateFtdcMdApi(pszPath); delete[] pszPath; - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); if (m_pApi) { @@ -190,7 +190,7 @@ int CMdUserApi::_Init() //ʼ m_pApi->Init(); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); } return 0; @@ -210,7 +210,7 @@ void CMdUserApi::ReqUserLogin() int CMdUserApi::_ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); return m_pApi->ReqUserLogin((CSecurityFtdcReqUserLoginField*)ptr1, ++m_lRequestID); } @@ -234,7 +234,7 @@ void CMdUserApi::Disconnect() // ȫֻһ m_msgQueue->Clear(); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); // m_msgQueue->Process(); } @@ -261,7 +261,7 @@ void CMdUserApi::Disconnect() } -void CMdUserApi::Subscribe(const string& szInstrumentIDs, const string& szExchageID) +void CMdUserApi::Subscribe(const string& szInstrumentIDs, const string& szExchangeID) { if(nullptr == m_pApi) return; @@ -272,14 +272,14 @@ void CMdUserApi::Subscribe(const string& szInstrumentIDs, const string& szExchag lock_guard cl(m_csMapInstrumentIDs); set _setInstrumentIDs; - map >::iterator it = m_mapInstrumentIDs.find(szExchageID); + map >::iterator it = m_mapInstrumentIDs.find(szExchangeID); if (it != m_mapInstrumentIDs.end()) { _setInstrumentIDs = it->second; } char* pBuf = GetSetFromString(szInstrumentIDs.c_str(), _QUANTBOX_SEPS_, vct, st, 1, _setInstrumentIDs); - m_mapInstrumentIDs[szExchageID] = _setInstrumentIDs; + m_mapInstrumentIDs[szExchangeID] = _setInstrumentIDs; if(vct.size()>0) { @@ -291,14 +291,14 @@ void CMdUserApi::Subscribe(const string& szInstrumentIDs, const string& szExchag } // - m_pApi->SubscribeMarketData(pArray, (int)vct.size(), (char*)(szExchageID.c_str())); + m_pApi->SubscribeMarketData(pArray, (int)vct.size(), (char*)(szExchangeID.c_str())); delete[] pArray; } delete[] pBuf; } -void CMdUserApi::Subscribe(const set& instrumentIDs, const string& szExchageID) +void CMdUserApi::Subscribe(const set& instrumentIDs, const string& szExchangeID) { if(nullptr == m_pApi) return; @@ -312,11 +312,11 @@ void CMdUserApi::Subscribe(const set& instrumentIDs, const string& szExc if (szInstrumentIDs.length()>1) { - Subscribe(szInstrumentIDs, szExchageID); + Subscribe(szInstrumentIDs, szExchangeID); } } -void CMdUserApi::Unsubscribe(const string& szInstrumentIDs, const string& szExchageID) +void CMdUserApi::Unsubscribe(const string& szInstrumentIDs, const string& szExchangeID) { if(nullptr == m_pApi) return; @@ -327,14 +327,14 @@ void CMdUserApi::Unsubscribe(const string& szInstrumentIDs, const string& szExch lock_guard cl(m_csMapInstrumentIDs); set _setInstrumentIDs; - map >::iterator it = m_mapInstrumentIDs.find(szExchageID); + map >::iterator it = m_mapInstrumentIDs.find(szExchangeID); if (it != m_mapInstrumentIDs.end()) { _setInstrumentIDs = it->second; } char* pBuf = GetSetFromString(szInstrumentIDs.c_str(), _QUANTBOX_SEPS_, vct, st, -1, _setInstrumentIDs); - m_mapInstrumentIDs[szExchageID] = _setInstrumentIDs; + m_mapInstrumentIDs[szExchangeID] = _setInstrumentIDs; if(vct.size()>0) { @@ -346,7 +346,7 @@ void CMdUserApi::Unsubscribe(const string& szInstrumentIDs, const string& szExch } // - m_pApi->UnSubscribeMarketData(pArray, (int)vct.size(), (char*)(szExchageID.c_str())); + m_pApi->UnSubscribeMarketData(pArray, (int)vct.size(), (char*)(szExchangeID.c_str())); delete[] pArray; } @@ -355,7 +355,7 @@ void CMdUserApi::Unsubscribe(const string& szInstrumentIDs, const string& szExch void CMdUserApi::OnFrontConnected() { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); //ӳɹԶ¼ ReqUserLogin(); @@ -368,7 +368,7 @@ void CMdUserApi::OnFrontDisconnected(int nReason) pField->RawErrorID = nReason; GetOnFrontDisconnectedMsg(nReason, pField->Text); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } void CMdUserApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) @@ -385,8 +385,8 @@ void CMdUserApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, C sprintf(pField->SessionID, "%d:%d", pRspUserLogin->FrontID, pRspUserLogin->SessionID); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); //пܶˣǶ¶ map > mapOld = m_mapInstrumentIDs;//ϴζĵĺԼ @@ -408,7 +408,7 @@ void CMdUserApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, C pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } } @@ -463,6 +463,7 @@ void CMdUserApi::OnRtnDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthM strcpy(pField->InstrumentID, pDepthMarketData->InstrumentID); + strcpy(pField->ExchangeID, pDepthMarketData->ExchangeID); pField->Exchange = TSecurityFtdcExchangeIDType_2_ExchangeType(pDepthMarketData->ExchangeID); sprintf(pField->Symbol, "%s.%s", pField->InstrumentID, pDepthMarketData->ExchangeID); @@ -542,9 +543,9 @@ void CMdUserApi::OnRtnDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthM #ifdef _REMOTE if (m_remoteQueue) { - m_remoteQueue->Input_Copy(ResponeType::OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); + m_remoteQueue->Input_Copy(ResponseType::ResponseType_OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); } #endif - m_msgQueue->Input_NoCopy(ResponeType::OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); } diff --git a/QuantBox_LTS_Quote_v2/MdUserApi.h b/apis/LTS_Quote_v2/MdUserApi.h similarity index 85% rename from QuantBox_LTS_Quote_v2/MdUserApi.h rename to apis/LTS_Quote_v2/MdUserApi.h index 6452742..bb691ef 100644 --- a/QuantBox_LTS_Quote_v2/MdUserApi.h +++ b/apis/LTS_Quote_v2/MdUserApi.h @@ -1,14 +1,22 @@ #pragma once -#include "../include/ApiStruct.h" -#include "../include/LTS_v2/SecurityFtdcMdApi.h" +#include "../../include/ApiStruct.h" +#include "../../include/LTS_v2/SecurityFtdcMdApi.h" #ifdef _WIN64 -#pragma comment(lib, "../include/LTS_v2/win64/securitymduserapi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x64.lib") + #pragma comment(lib, "../../include/LTS_v2/win64/securitymduserapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif #else -#pragma comment(lib, "../include/LTS_v2/win32/securitymduserapi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x86.lib") + #pragma comment(lib, "../../include/LTS_v2/win32/securitymduserapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif #endif #include @@ -41,11 +49,11 @@ class CMdUserApi : UserInfoField* pUserInfo); void Disconnect(); - void Subscribe(const string& szInstrumentIDs, const string& szExchageID); - void Unsubscribe(const string& szInstrumentIDs, const string& szExchageID); + void Subscribe(const string& szInstrumentIDs, const string& szExchangeID); + void Unsubscribe(const string& szInstrumentIDs, const string& szExchangeID); - //void SubscribeQuote(const string& szInstrumentIDs, const string& szExchageID); - //void UnsubscribeQuote(const string& szInstrumentIDs, const string& szExchageID); + //void SubscribeQuote(const string& szInstrumentIDs, const string& szExchangeID); + //void UnsubscribeQuote(const string& szInstrumentIDs, const string& szExchangeID); private: friend void* __stdcall Query(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); @@ -57,8 +65,8 @@ class CMdUserApi : int _ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); // - void Subscribe(const set& instrumentIDs, const string& szExchageID); - //void SubscribeQuote(const set& instrumentIDs, const string& szExchageID); + void Subscribe(const set& instrumentIDs, const string& szExchangeID); + //void SubscribeQuote(const set& instrumentIDs, const string& szExchangeID); virtual void OnFrontConnected(); virtual void OnFrontDisconnected(int nReason); virtual void OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); diff --git a/QuantBox_LTS_Quote_v2/ReadMe.txt b/apis/LTS_Quote_v2/ReadMe.txt similarity index 100% rename from QuantBox_LTS_Quote_v2/ReadMe.txt rename to apis/LTS_Quote_v2/ReadMe.txt diff --git a/QuantBox_LTS_Trade_v2/dllmain.cpp b/apis/LTS_Quote_v2/dllmain.cpp similarity index 100% rename from QuantBox_LTS_Trade_v2/dllmain.cpp rename to apis/LTS_Quote_v2/dllmain.cpp diff --git a/QuantBox_LTS_Quote_v2/main.cpp b/apis/LTS_Quote_v2/main.cpp similarity index 76% rename from QuantBox_LTS_Quote_v2/main.cpp rename to apis/LTS_Quote_v2/main.cpp index 73c32e0..3a37946 100644 --- a/QuantBox_LTS_Quote_v2/main.cpp +++ b/apis/LTS_Quote_v2/main.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" -#include "../include/ApiHeader.h" - -#include "../include/QueueEnum.h" +#include "../../include/ApiHeader.h" +#include "../../include/QueueEnum.h" #include "MdUserApi.h" inline CMdUserApi* GetApi(void* pApi) @@ -14,13 +13,13 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do RequestType rt = (RequestType)type; switch (rt) { - case GetApiType: + case RequestType_GetApiTypes: return (void*)(ApiType::ApiType_MarketData); - case GetApiVersion: + case RequestType_GetApiVersion: return (void*)"0.1.0.20151112"; - case GetApiName: + case RequestType_GetApiName: return (void*)"LTS2"; - case Create: + case RequestType_Create: return new CMdUserApi(); default: break; @@ -34,22 +33,22 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do switch (rt) { - case Release: + case RequestType_Release: delete pApi; return nullptr; - case Register: + case RequestType_Register: pApi->Register(ptr1, ptr2); break; - case Connect: + case RequestType_Connect: pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); break; - case Disconnect: + case RequestType_Disconnect: pApi->Disconnect(); break; - case Subscribe: + case RequestType_Subscribe: pApi->Subscribe((const char*)ptr1, (const char*)ptr2); break; - case Unsubscribe: + case RequestType_Unsubscribe: pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); break; //case SubscribeQuote: diff --git a/QuantBox_LTS_Quote_v2/stdafx.cpp b/apis/LTS_Quote_v2/stdafx.cpp similarity index 100% rename from QuantBox_LTS_Quote_v2/stdafx.cpp rename to apis/LTS_Quote_v2/stdafx.cpp diff --git a/QuantBox_LTS_Quote_v2/stdafx.h b/apis/LTS_Quote_v2/stdafx.h similarity index 100% rename from QuantBox_LTS_Quote_v2/stdafx.h rename to apis/LTS_Quote_v2/stdafx.h diff --git a/QuantBox_TongShi_Quote/targetver.h b/apis/LTS_Quote_v2/targetver.h similarity index 100% rename from QuantBox_TongShi_Quote/targetver.h rename to apis/LTS_Quote_v2/targetver.h diff --git a/QuantBox_LTS_Trade_v2/QuantBox_LTS_Trade.cbp b/apis/LTS_Trade_v2/LTS_Trade.cbp similarity index 100% rename from QuantBox_LTS_Trade_v2/QuantBox_LTS_Trade.cbp rename to apis/LTS_Trade_v2/LTS_Trade.cbp diff --git a/apis/LTS_Trade_v2/LTS_Trade_v2.vcxproj b/apis/LTS_Trade_v2/LTS_Trade_v2.vcxproj new file mode 100644 index 0000000..40fdd4d --- /dev/null +++ b/apis/LTS_Trade_v2/LTS_Trade_v2.vcxproj @@ -0,0 +1,114 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {683AECBB-89EB-4692-99C5-A527853326D4} + Win32Proj + LTS_Trade + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\LTS_v2 + $(ProjectName)_$(PlatformTarget) + + + false + ..\..\bin\$(Configuration)\$(PlatformTarget)\LTS_v2 + $(ProjectName)_$(PlatformTarget) + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;LTS_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + ../../include/ApiHeader.def + + + + + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;LTS_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + ../../include/ApiHeader.def + + + + + + + + + + + + + + + + + + + + Create + Create + + + + + + + + \ No newline at end of file diff --git a/QuantBox_LTS_Trade_v2/QuantBox_LTS_Trade_v2.vcxproj.filters b/apis/LTS_Trade_v2/LTS_Trade_v2.vcxproj.filters similarity index 90% rename from QuantBox_LTS_Trade_v2/QuantBox_LTS_Trade_v2.vcxproj.filters rename to apis/LTS_Trade_v2/LTS_Trade_v2.vcxproj.filters index 65997a2..19a848d 100644 --- a/QuantBox_LTS_Trade_v2/QuantBox_LTS_Trade_v2.vcxproj.filters +++ b/apis/LTS_Trade_v2/LTS_Trade_v2.vcxproj.filters @@ -30,10 +30,10 @@ Header Files - + Header Files - + Header Files @@ -53,10 +53,10 @@ Source Files - + Source Files - + Source Files diff --git a/QuantBox_LTS_Trade_v2/ReadMe.txt b/apis/LTS_Trade_v2/ReadMe.txt similarity index 100% rename from QuantBox_LTS_Trade_v2/ReadMe.txt rename to apis/LTS_Trade_v2/ReadMe.txt diff --git a/QuantBox_LTS_Trade_v2/TraderApi.cpp b/apis/LTS_Trade_v2/TraderApi.cpp similarity index 74% rename from QuantBox_LTS_Trade_v2/TraderApi.cpp rename to apis/LTS_Trade_v2/TraderApi.cpp index 48a1676..e2105d2 100644 --- a/QuantBox_LTS_Trade_v2/TraderApi.cpp +++ b/apis/LTS_Trade_v2/TraderApi.cpp @@ -1,15 +1,15 @@ #include "stdafx.h" #include "TraderApi.h" -#include "../include/QueueEnum.h" -#include "../include/QueueHeader.h" +#include "../../include/QueueEnum.h" +#include "../../include/QueueHeader.h" -#include "../include/ApiHeader.h" -#include "../include/ApiStruct.h" +#include "../../include/ApiHeader.h" +#include "../../include/ApiStruct.h" -#include "../include/toolkit.h" +#include "../../include/toolkit.h" -#include "../QuantBox_Queue/MsgQueue.h" +#include "../../common/Queue/MsgQueue.h" #include "TypeConvert.h" @@ -32,32 +32,21 @@ void CTraderApi::QueryInThread(char type, void* pApi1, void* pApi2, double doubl case E_Init: iRet = _Init(); break; - case E_ReqUserLoginField: - iRet = _ReqUserLogin(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - case E_AuthRandCodeField: - iRet = _ReqFetchAuthRandCode(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - break; - //case E_QryTradingAccountField: - // iRet = _ReqQryTradingAccount(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - // break; - //case E_QryInvestorPositionField: - // iRet = _ReqQryInvestorPosition(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - // break; - //case E_QryInstrumentField: - // iRet = _ReqQryInstrument(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - // break; - //case E_QryInvestorField: - // iRet = _ReqQryInvestor(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - // break; - //case E_QryOrderField: - // iRet = _ReqQryOrder(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - // break; - //case E_QryTradeField: - // iRet = _ReqQryTrade(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); - // break; - default: - break; + } + + if (m_pApi) + { + switch (type) + { + case E_ReqUserLoginField: + iRet = _ReqUserLogin(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case E_AuthRandCodeField: + iRet = _ReqFetchAuthRandCode(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + default: + break; + } } if (0 == iRet) @@ -126,7 +115,7 @@ bool CTraderApi::IsErrorRspInfo(const char* szSource, CSecurityFtdcRspInfoField strcpy(pField->Text, pRspInfo->ErrorMsg); strcpy(pField->Source, szSource); - m_msgQueue->Input_NoCopy(ResponeType::OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); } return bRet; } @@ -160,7 +149,7 @@ int CTraderApi::_Init() m_pApi = CSecurityFtdcTraderApi::CreateFtdcTraderApi(pszPath); delete[] pszPath; - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); if (m_pApi) { @@ -187,7 +176,7 @@ int CTraderApi::_Init() if (m_ServerInfo.PrivateTopicResumeTypeSubscribePrivateTopic((SECURITY_TE_RESUME_TYPE)m_ServerInfo.PrivateTopicResumeType); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); //初始化连接 m_pApi->Init(); } @@ -214,7 +203,7 @@ void CTraderApi::Disconnect() // 全清理,只留最后一个 m_msgQueue->Clear(); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); // 主动触发 m_msgQueue->Process(); } @@ -258,7 +247,7 @@ void CTraderApi::Clear() void CTraderApi::OnFrontConnected() { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); //ReqUserLogin(); ReqFetchAuthRandCode(); @@ -272,7 +261,7 @@ void CTraderApi::OnFrontDisconnected(int nReason) pField->RawErrorID = nReason; GetOnFrontDisconnectedMsg(nReason, pField->Text); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } void CTraderApi::ReqFetchAuthRandCode() @@ -287,7 +276,7 @@ void CTraderApi::ReqFetchAuthRandCode() int CTraderApi::_ReqFetchAuthRandCode(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorizing, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorizing, 0, nullptr, 0, nullptr, 0, nullptr, 0); return m_pApi->ReqFetchAuthRandCode((CSecurityFtdcAuthRandCodeField*)ptr1, ++m_lRequestID); } @@ -298,7 +287,7 @@ void CTraderApi::OnRspFetchAuthRandCode(CSecurityFtdcAuthRandCodeField *pAuthRan if (!IsErrorRspInfo(pRspInfo) && pAuthRandCode) { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorized, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorized, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); ReqUserLogin(pAuthRandCode->RandCode); } @@ -307,7 +296,7 @@ void CTraderApi::OnRspFetchAuthRandCode(CSecurityFtdcAuthRandCodeField *pAuthRan pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } } @@ -328,7 +317,7 @@ void CTraderApi::ReqUserLogin(TSecurityFtdcAuthCodeType RandCode) int CTraderApi::_ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) { - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); return m_pApi->ReqUserLogin((CSecurityFtdcReqUserLoginField*)ptr1, ++m_lRequestID); } @@ -344,7 +333,7 @@ void CTraderApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, C sprintf(pField->SessionID, "%d:%d", pRspUserLogin->FrontID, pRspUserLogin->SessionID); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); // 记下登录信息,可能会用到 memcpy(&m_RspUserLogin,pRspUserLogin,sizeof(CSecurityFtdcRspUserLoginField)); @@ -354,7 +343,7 @@ void CTraderApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, C //ReqSettlementInfoConfirm(); //ReqQryInvestor(); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); if (m_ServerInfo.PrivateTopicResumeType > ResumeType::ResumeType_Restart && (m_ServerInfo.PrivateTopicResumeTypeRawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } } -int CTraderApi::ReqOrderInsert( +char* CTraderApi::ReqOrderInsert( OrderField* pOrder, int count, - OrderIDType* pInOut) + char* pszLocalIDBuf) { int OrderRef = -1; if (nullptr == m_pApi) - return -1; + return nullptr; CSecurityFtdcInputOrderField body = {0}; @@ -506,10 +495,10 @@ int CTraderApi::ReqOrderInsert( strcpy(pField->LocalID, pField->ID); m_id_platform_order.insert(pair(m_orderInsert_Id, pField)); } - strncpy((char*)pInOut, m_orderInsert_Id, sizeof(OrderIDType)); + strncpy(pszLocalIDBuf, m_orderInsert_Id, sizeof(OrderIDType)); } - return nRet; + return pszLocalIDBuf; } void CTraderApi::OnRspOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) @@ -541,7 +530,7 @@ void CTraderApi::OnRspOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSe pField->Status = OrderStatus::OrderStatus_Rejected; pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } @@ -575,34 +564,35 @@ void CTraderApi::OnErrRtnOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, pField->Status = OrderStatus::OrderStatus_Rejected; pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } void CTraderApi::OnRtnTrade(CSecurityFtdcTradeField *pTrade) { - OnTrade(pTrade,false); + OnTrade(pTrade, 0, true); } -int CTraderApi::ReqOrderAction(OrderIDType* szIds, int count, OrderIDType* pOutput) +char* CTraderApi::ReqOrderAction(OrderIDType* szIds, int count, char* pzsRtn) { unordered_map::iterator it = m_id_api_order.find(szIds[0]); if (it == m_id_api_order.end()) { - sprintf((char*)pOutput, "%d", -100); - return -100; + sprintf(pzsRtn, "%d", -100); } else { // 找到了订单 - return ReqOrderAction(it->second, count, pOutput); + return ReqOrderAction(it->second, count, pzsRtn); } + + return pzsRtn; } -int CTraderApi::ReqOrderAction(CSecurityFtdcOrderField *pOrder, int count, OrderIDType* pOutput) +char* CTraderApi::ReqOrderAction(CSecurityFtdcOrderField *pOrder, int count, char* pzsRtn) { if (nullptr == m_pApi) - return 0; + return nullptr; CSecurityFtdcInputOrderActionField body = {0}; @@ -634,9 +624,9 @@ int CTraderApi::ReqOrderAction(CSecurityFtdcOrderField *pOrder, int count, Order { memset(m_orderAction_Id, 0, sizeof(OrderIDType)); } - strncpy((char*)pOutput, m_orderAction_Id, sizeof(OrderIDType)); + strncpy(pzsRtn, m_orderAction_Id, sizeof(OrderIDType)); - return nRet; + return pzsRtn; } void CTraderApi::OnRspOrderAction(CSecurityFtdcInputOrderActionField *pInputOrderAction, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) @@ -665,7 +655,7 @@ void CTraderApi::OnRspOrderAction(CSecurityFtdcInputOrderActionField *pInputOrde pField->ExecType = ExecType::ExecType_CancelReject; pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } @@ -695,13 +685,13 @@ void CTraderApi::OnErrRtnOrderAction(CSecurityFtdcOrderActionField *pOrderAction pField->ExecType = ExecType::ExecType_CancelReject; pField->RawErrorID = pRspInfo->ErrorID; strncpy(pField->Text, pRspInfo->ErrorMsg, sizeof(Char256Type)); - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } void CTraderApi::OnRtnOrder(CSecurityFtdcOrderField *pOrder) { - OnOrder(pOrder,false); + OnOrder(pOrder, 0, true); } void CTraderApi::OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) @@ -709,7 +699,7 @@ void CTraderApi::OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, IsErrorRspInfo("OnRspError", pRspInfo, nRequestID, bIsLast); } -void CTraderApi::OnOrder(CSecurityFtdcOrderField *pOrder, bool bFromQry) +void CTraderApi::OnOrder(CSecurityFtdcOrderField *pOrder, int nRequestID, bool bIsLast) { if (nullptr == pOrder) return; @@ -744,59 +734,61 @@ void CTraderApi::OnOrder(CSecurityFtdcOrderField *pOrder, bool bFromQry) { // 从API的订单转换成自己的结构体 - - OrderField* pField = nullptr; - unordered_map::iterator it = m_id_platform_order.find(orderId); - if (it == m_id_platform_order.end()) + if (nRequestID == 0) { - // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 - pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); + OrderField* pField = nullptr; + unordered_map::iterator it = m_id_platform_order.find(orderId); + if (it == m_id_platform_order.end()) + { + // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 + pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); - strcpy(pField->ID, orderId); - strcpy(pField->LocalID, pField->ID); - strcpy(pField->InstrumentID, pOrder->InstrumentID); - strcpy(pField->ExchangeID, pOrder->ExchangeID); - pField->HedgeFlag = TSecurityFtdcHedgeFlagType_2_HedgeFlagType(pOrder->CombHedgeFlag[0]); - pField->Side = TSecurityFtdcDirectionType_2_OrderSide(pOrder->Direction); - pField->Price = atof(pOrder->LimitPrice); - pField->StopPx = pOrder->StopPrice; - strncpy(pField->Text, pOrder->StatusMsg, sizeof(Char256Type)); - pField->OpenClose = TSecurityFtdcOffsetFlagType_2_OpenCloseType(pOrder->CombOffsetFlag[0]); - pField->Status = CSecurityFtdcOrderField_2_OrderStatus(pOrder); - pField->Qty = pOrder->VolumeTotalOriginal; - pField->Type = CSecurityFtdcOrderField_2_OrderType(pOrder); - pField->TimeInForce = CSecurityFtdcOrderField_2_TimeInForce(pOrder); - pField->ExecType = ExecType::ExecType_New; - strcpy(pField->OrderID, pOrder->OrderSysID); + // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 + CSecurityFtdcOrderField_2_OrderField_0(orderId, pOrder, pField); - // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 - m_id_platform_order.insert(pair(orderId, pField)); + // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 + m_id_platform_order.insert(pair(orderId, pField)); + } + else + { + pField = it->second; + strcpy(pField->ID, orderId); + strcpy(pField->LocalID, pField->ID); + pField->LeavesQty = pOrder->VolumeTotal; + pField->Price = atof(pOrder->LimitPrice); + pField->Status = CSecurityFtdcOrderField_2_OrderStatus(pOrder); + pField->ExecType = CSecurityFtdcOrderField_2_ExecType(pOrder); + strcpy(pField->OrderID, pOrder->OrderSysID); + strncpy(pField->Text, pOrder->StatusMsg, sizeof(Char256Type)); + } + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } else { - pField = it->second; - strcpy(pField->ID, orderId); - strcpy(pField->LocalID, pField->ID); - pField->LeavesQty = pOrder->VolumeTotal; - pField->Price = atof(pOrder->LimitPrice); - pField->Status = CSecurityFtdcOrderField_2_OrderStatus(pOrder); - pField->ExecType = CSecurityFtdcOrderField_2_ExecType(pOrder); - strcpy(pField->OrderID, pOrder->OrderSysID); - strncpy(pField->Text, pOrder->StatusMsg, sizeof(Char256Type)); - } + OrderField* pField = nullptr; + pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 + CSecurityFtdcOrderField_2_OrderField_0(orderId, pOrder, pField); + + // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 + //m_id_platform_order.insert(pair(orderId, pField)); + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryOrder, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + + m_msgQueue->delete_block(pField); + } } } -void CTraderApi::OnTrade(CSecurityFtdcTradeField *pTrade, bool bFromQry) +void CTraderApi::OnTrade(CSecurityFtdcTradeField *pTrade, int nRequestID, bool bIsLast) { if (nullptr == pTrade) return; TradeField* pField = (TradeField*)m_msgQueue->new_block(sizeof(TradeField)); - strcpy(pField->InstrumentID, pTrade->InstrumentID); strcpy(pField->ExchangeID, pTrade->ExchangeID); pField->Side = TSecurityFtdcDirectionType_2_OrderSide(pTrade->Direction); @@ -808,39 +800,49 @@ void CTraderApi::OnTrade(CSecurityFtdcTradeField *pTrade, bool bFromQry) pField->Time = GetTime(pTrade->TradeTime); strcpy(pField->TradeID, pTrade->TradeID); - OrderIDType orderSysId = { 0 }; - sprintf(orderSysId, "%s:%s", pTrade->ExchangeID, pTrade->OrderSysID); - unordered_map::iterator it = m_sysId_orderId.find(orderSysId); - if (it == m_sysId_orderId.end()) + if (nRequestID == 0) { - // 此成交找不到对应的报单 - //assert(false); - } - else - { - // 找到对应的报单 - strcpy(pField->ID, it->second.c_str()); - - m_msgQueue->Input_Copy(ResponeType::OnRtnTrade, m_msgQueue, m_pClass, 0, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); - - unordered_map::iterator it2 = m_id_platform_order.find(it->second); - if (it2 == m_id_platform_order.end()) + OrderIDType orderSysId = { 0 }; + sprintf(orderSysId, "%s:%s", pTrade->ExchangeID, pTrade->OrderSysID); + unordered_map::iterator it = m_sysId_orderId.find(orderSysId); + if (it == m_sysId_orderId.end()) { // 此成交找不到对应的报单 //assert(false); } else { - // 更新订单的状态 - // 是否要通知接口 - } + // 找到对应的报单 + strcpy(pField->ID, it->second.c_str()); + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnTrade, m_msgQueue, m_pClass, 0, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); + + unordered_map::iterator it2 = m_id_platform_order.find(it->second); + if (it2 == m_id_platform_order.end()) + { + // 此成交找不到对应的报单 + //assert(false); + } + else + { + // 更新订单的状态 + // 是否要通知接口 + } - // 查询与交易分离,所以本地计算更新持仓的功能失效 - //OnTrade(pField, bFromQry); + // 本地更新持仓的功能失效 + //OnTrade(pField); + } + } + else + { + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryTrade, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); } + + // 清理内存 + m_msgQueue->delete_block(pField); } -void CTraderApi::OnTrade(TradeField *pTrade, bool bFromQry) +void CTraderApi::OnTrade(TradeField *pTrade) { PositionIDType positionId = { 0 }; sprintf(positionId, "%s:%s:%d:%d", @@ -896,5 +898,5 @@ void CTraderApi::OnTrade(TradeField *pTrade, bool bFromQry) //} } - m_msgQueue->Input_Copy(ResponeType::OnRspQryInvestorPosition, m_msgQueue, m_pClass, false, 0, pField, sizeof(PositionField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryInvestorPosition, m_msgQueue, m_pClass, false, 0, pField, sizeof(PositionField), nullptr, 0, nullptr, 0); } \ No newline at end of file diff --git a/QuantBox_LTS_Trade_v2/TraderApi.h b/apis/LTS_Trade_v2/TraderApi.h similarity index 91% rename from QuantBox_LTS_Trade_v2/TraderApi.h rename to apis/LTS_Trade_v2/TraderApi.h index 1b64f01..4740e3a 100644 --- a/QuantBox_LTS_Trade_v2/TraderApi.h +++ b/apis/LTS_Trade_v2/TraderApi.h @@ -1,14 +1,22 @@ #pragma once -#include "../include/LTS_v2/SecurityFtdcTraderApi.h" -#include "../include/ApiStruct.h" +#include "../../include/LTS_v2/SecurityFtdcTraderApi.h" +#include "../../include/ApiStruct.h" #ifdef _WIN64 -#pragma comment(lib, "../include/LTS_v2/win64/securitytraderapi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x64.lib") + #pragma comment(lib, "../../include/LTS_v2/win64/securitytraderapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif #else -#pragma comment(lib, "../include/LTS_v2/win32/securitytraderapi.lib") -#pragma comment(lib, "../lib/QuantBox_Queue_x86.lib") + #pragma comment(lib, "../../include/LTS_v2/win32/securitytraderapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif #endif #include @@ -30,7 +38,7 @@ class CTraderApi : //请求数据包类型 enum RequestType { - E_Init, + E_Init = 100, E_ReqAuthenticateField, E_ReqUserLoginField, @@ -67,13 +75,13 @@ class CTraderApi : UserInfoField* pUserInfo); void Disconnect(); - int ReqOrderInsert( + char* ReqOrderInsert( OrderField* pOrder, int count, - OrderIDType* pInOut); + char* pszLocalIDBuf); - int ReqOrderAction(OrderIDType* szIds, int count, OrderIDType* pOutput); - int ReqOrderAction(CSecurityFtdcOrderField *pOrder, int count, OrderIDType* pOutput); + char* ReqOrderAction(OrderIDType* szIds, int count, char* pzsRtn); + char* ReqOrderAction(CSecurityFtdcOrderField *pOrder, int count, char* pzsRtn); int ReqQuoteInsert( int QuoteRef, @@ -120,9 +128,9 @@ class CTraderApi : //int _ReqQryTrade(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); //int _ReqQryQuote(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); - void OnOrder(CSecurityFtdcOrderField *pOrder, bool bFromQry); - void OnTrade(CSecurityFtdcTradeField *pTrade, bool bFromQry); - void OnTrade(TradeField *pTrade, bool bFromQry); + void OnOrder(CSecurityFtdcOrderField *pOrder, int nRequestID, bool bIsLast); + void OnTrade(CSecurityFtdcTradeField *pTrade, int nRequestID, bool bIsLast); + void OnTrade(TradeField *pTrade); //检查是否出错 bool IsErrorRspInfo(const char* szSource, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);//向消息队列输出信息 diff --git a/QuantBox_LTS_Trade_v2/TypeConvert.cpp b/apis/LTS_Trade_v2/TypeConvert.cpp similarity index 86% rename from QuantBox_LTS_Trade_v2/TypeConvert.cpp rename to apis/LTS_Trade_v2/TypeConvert.cpp index 186afe9..81f5c02 100644 --- a/QuantBox_LTS_Trade_v2/TypeConvert.cpp +++ b/apis/LTS_Trade_v2/TypeConvert.cpp @@ -5,7 +5,7 @@ #include -#include "../include/ChinaStock.h" +#include "../../include/ChinaStock.h" /// OpenQuant FIXһЧ򵥣Ҫô /// һӵij״̬ģµֳɽȫɽ /// EmitAccept,EmitFill @@ -245,7 +245,7 @@ InstrumentType CSecurityFtdcInstrumentField_2_InstrumentType(CSecurityFtdcInstru } if (pIn->ExchangeID[1] == 'Z') { - return InstrumentID_2_InstrumentType_SZE(atoi(pIn->InstrumentID)); + return InstrumentID_2_InstrumentType_SZSE(atoi(pIn->InstrumentID)); } else { @@ -267,7 +267,7 @@ PriceType CSecurityFtdcInstrumentField_2_PriceTick(CSecurityFtdcInstrumentField* if (pIn->ExchangeID[1] == 'Z') { - return InstrumentID_2_PriceTick_SZE(atoi(pIn->InstrumentID)); + return InstrumentID_2_PriceTick_SZSE(atoi(pIn->InstrumentID)); } else { @@ -307,3 +307,26 @@ ExchangeType TSecurityFtdcExchangeIDType_2_ExchangeType(TSecurityFtdcExchangeIDT return ExchangeType::ExchangeType_Undefined; } } + +void CSecurityFtdcOrderField_2_OrderField_0(OrderIDType OrderID, CSecurityFtdcOrderField* pIn, OrderField* pOut) +{ + strcpy(pOut->ID, OrderID); + strcpy(pOut->LocalID, pOut->ID); + strcpy(pOut->InstrumentID, pIn->InstrumentID); + strcpy(pOut->ExchangeID, pIn->ExchangeID); + pOut->HedgeFlag = TSecurityFtdcHedgeFlagType_2_HedgeFlagType(pIn->CombHedgeFlag[0]); + pOut->Side = TSecurityFtdcDirectionType_2_OrderSide(pIn->Direction); + pOut->Price = atof(pIn->LimitPrice); + pOut->StopPx = pIn->StopPrice; + strncpy(pOut->Text, pIn->StatusMsg, sizeof(Char256Type)); + pOut->OpenClose = TSecurityFtdcOffsetFlagType_2_OpenCloseType(pIn->CombOffsetFlag[0]); + pOut->Status = CSecurityFtdcOrderField_2_OrderStatus(pIn); + pOut->Qty = pIn->VolumeTotalOriginal; + pOut->CumQty = pIn->VolumeTraded; + pOut->LeavesQty = pIn->VolumeTotal; + pOut->Type = CSecurityFtdcOrderField_2_OrderType(pIn); + pOut->TimeInForce = CSecurityFtdcOrderField_2_TimeInForce(pIn); + pOut->ExecType = CSecurityFtdcOrderField_2_ExecType(pIn); + strcpy(pOut->OrderID, pIn->OrderSysID); + strncpy(pOut->Text, pIn->StatusMsg, sizeof(Char256Type)); +} diff --git a/QuantBox_LTS_Trade_v2/TypeConvert.h b/apis/LTS_Trade_v2/TypeConvert.h similarity index 83% rename from QuantBox_LTS_Trade_v2/TypeConvert.h rename to apis/LTS_Trade_v2/TypeConvert.h index 107efaa..0b9664b 100644 --- a/QuantBox_LTS_Trade_v2/TypeConvert.h +++ b/apis/LTS_Trade_v2/TypeConvert.h @@ -1,8 +1,8 @@ #pragma once -#include "../include/LTS_v2/SecurityFtdcUserApiDataType.h" -#include "../include/LTS_v2/SecurityFtdcUserApiStruct.h" -#include "../include/ApiStruct.h" +#include "../../include/LTS_v2/SecurityFtdcUserApiDataType.h" +#include "../../include/LTS_v2/SecurityFtdcUserApiStruct.h" +#include "../../include/ApiStruct.h" HedgeFlagType TSecurityFtdcHedgeFlagType_2_HedgeFlagType(TSecurityFtdcHedgeFlagType In); @@ -29,4 +29,6 @@ PriceType CSecurityFtdcInstrumentField_2_PriceTick(CSecurityFtdcInstrumentField* IdCardType TSecurityFtdcIdCardTypeType_2_IdCardType(TSecurityFtdcIdCardTypeType In); -ExchangeType TSecurityFtdcExchangeIDType_2_ExchangeType(TSecurityFtdcExchangeIDType In); \ No newline at end of file +ExchangeType TSecurityFtdcExchangeIDType_2_ExchangeType(TSecurityFtdcExchangeIDType In); + +void CSecurityFtdcOrderField_2_OrderField_0(OrderIDType OrderID, CSecurityFtdcOrderField* pIn, OrderField* pOut); \ No newline at end of file diff --git a/QuantBox_Queue/dllmain.cpp b/apis/LTS_Trade_v2/dllmain.cpp similarity index 100% rename from QuantBox_Queue/dllmain.cpp rename to apis/LTS_Trade_v2/dllmain.cpp diff --git a/QuantBox_LTS_Trade_v2/main.cpp b/apis/LTS_Trade_v2/main.cpp similarity index 78% rename from QuantBox_LTS_Trade_v2/main.cpp rename to apis/LTS_Trade_v2/main.cpp index 18f21b4..b34cff6 100644 --- a/QuantBox_LTS_Trade_v2/main.cpp +++ b/apis/LTS_Trade_v2/main.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../include/ApiHeader.h" -#include "../include/QueueEnum.h" +#include "../../include/ApiHeader.h" +#include "../../include/QueueEnum.h" #include "TraderApi.h" inline CTraderApi* GetApi(void* pApi) @@ -13,13 +13,13 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do RequestType rt = (RequestType)type; switch (rt) { - case GetApiType: + case RequestType_GetApiTypes: return (void*)(ApiType::ApiType_Trade); - case GetApiVersion: + case RequestType_GetApiVersion: return (void*)"0.2.0.20151116"; - case GetApiName: + case RequestType_GetApiName: return (void*)"LTS2"; - case Create: + case RequestType_Create: return new CTraderApi(); default: break; @@ -34,16 +34,16 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do switch (rt) { - case Release: + case RequestType_Release: delete pApi; return nullptr; - case Register: + case RequestType_Register: pApi->Register(ptr1, ptr2); break; - case Connect: + case RequestType_Connect: pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2); break; - case Disconnect: + case RequestType_Disconnect: pApi->Disconnect(); break; //case ReqQryInstrument: @@ -58,12 +58,12 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do //case ReqQrySettlementInfo: // pApi->ReqQrySettlementInfo((const char*)ptr1); // break; - case ReqOrderInsert: - return (void*)pApi->ReqOrderInsert((OrderField*)ptr1, size1, (OrderIDType*)ptr2); + case RequestType_ReqOrderInsert: + return (void*)pApi->ReqOrderInsert((OrderField*)ptr1, size1, (char*)ptr2); //case ReqQuoteInsert: // return (void*)pApi->ReqQuoteInsert((int)double1, (OrderField*)ptr1, (OrderField*)ptr2); - case ReqOrderAction: - return (void*)pApi->ReqOrderAction((OrderIDType*)ptr1, size1, (OrderIDType*)ptr2); + case RequestType_ReqOrderAction: + return (void*)pApi->ReqOrderAction((OrderIDType*)ptr1, size1, (char*)ptr2); break; default: break; diff --git a/QuantBox_LTS_Trade_v2/stdafx.cpp b/apis/LTS_Trade_v2/stdafx.cpp similarity index 100% rename from QuantBox_LTS_Trade_v2/stdafx.cpp rename to apis/LTS_Trade_v2/stdafx.cpp diff --git a/QuantBox_LTS_Trade_v2/stdafx.h b/apis/LTS_Trade_v2/stdafx.h similarity index 100% rename from QuantBox_LTS_Trade_v2/stdafx.h rename to apis/LTS_Trade_v2/stdafx.h diff --git a/QuantBox_XAPI/targetver.h b/apis/LTS_Trade_v2/targetver.h similarity index 100% rename from QuantBox_XAPI/targetver.h rename to apis/LTS_Trade_v2/targetver.h diff --git a/apis/Sgit_Quote/Include.h b/apis/Sgit_Quote/Include.h new file mode 100644 index 0000000..643028a --- /dev/null +++ b/apis/Sgit_Quote/Include.h @@ -0,0 +1,36 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#define API_VERSION "0.1.0.20161121" +#define API_NAME "Sgit" +#define DLL_PUBLIC_KEY "" + + +#include "../../include/Sgit/SgitFtdcUserApiDataType.h" +#include "../../include/Sgit/SgitFtdcUserApiStruct.h" +#include "../../include/Sgit/SgitFtdcMdApi.h" + +using namespace fstech; + +#ifdef _WIN64 + #pragma comment(lib, "../../include/Sgit/win64/sgitquotapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif +#else + #pragma comment(lib, "../../include/Sgit/win32/sgitquotapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif +#endif + +// +#include "../CTP/include_pub.h" \ No newline at end of file diff --git a/apis/Sgit_Quote/ReadMe.txt b/apis/Sgit_Quote/ReadMe.txt new file mode 100644 index 0000000..f803108 --- /dev/null +++ b/apis/Sgit_Quote/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : Sgit_Quote Project Overview +======================================================================== + +AppWizard has created this Sgit_Quote DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your Sgit_Quote application. + + +Sgit_Quote.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +Sgit_Quote.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +Sgit_Quote.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named Sgit_Quote.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/apis/Sgit_Quote/Sgit_Quote.vcxproj b/apis/Sgit_Quote/Sgit_Quote.vcxproj new file mode 100644 index 0000000..23970e0 --- /dev/null +++ b/apis/Sgit_Quote/Sgit_Quote.vcxproj @@ -0,0 +1,194 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {62BD7F43-395B-4A1E-84AC-64135ECF371D} + Win32Proj + Sgit_Quote + 8.1 + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\Sgit + $(ProjectName)_$(PlatformTarget) + ./;$(IncludePath) + + + true + + + false + ./;$(IncludePath) + ..\..\bin\$(Configuration)\$(PlatformTarget)\Sgit + $(ProjectName)_$(PlatformTarget) + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;SGIT_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + ../../include/ApiHeader.def + + + + + Use + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;SGIT_QUOTE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;SGIT_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + ../../include/ApiHeader.def + + + + + Level3 + Use + MaxSpeed + true + true + NDEBUG;_WINDOWS;_USRDLL;SGIT_QUOTE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + + + Create + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/apis/Sgit_Quote/Sgit_Quote.vcxproj.filters b/apis/Sgit_Quote/Sgit_Quote.vcxproj.filters new file mode 100644 index 0000000..90f209c --- /dev/null +++ b/apis/Sgit_Quote/Sgit_Quote.vcxproj.filters @@ -0,0 +1,66 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/QuantBox_Tdx_Trade/dllmain.cpp b/apis/Sgit_Quote/dllmain.cpp similarity index 100% rename from QuantBox_Tdx_Trade/dllmain.cpp rename to apis/Sgit_Quote/dllmain.cpp diff --git a/apis/Sgit_Quote/stdafx.cpp b/apis/Sgit_Quote/stdafx.cpp new file mode 100644 index 0000000..94b7db6 --- /dev/null +++ b/apis/Sgit_Quote/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// Sgit_Quote.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/apis/Sgit_Quote/stdafx.h b/apis/Sgit_Quote/stdafx.h new file mode 100644 index 0000000..f3a0737 --- /dev/null +++ b/apis/Sgit_Quote/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here diff --git a/QuantBox_XAPI_TEST/targetver.h b/apis/Sgit_Quote/targetver.h similarity index 100% rename from QuantBox_XAPI_TEST/targetver.h rename to apis/Sgit_Quote/targetver.h diff --git a/apis/Sgit_Trade/Include.h b/apis/Sgit_Trade/Include.h new file mode 100644 index 0000000..5886040 --- /dev/null +++ b/apis/Sgit_Trade/Include.h @@ -0,0 +1,41 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#define API_VERSION "0.1.0.20161121" +#define API_NAME "Sgit" +#define DLL_PUBLIC_KEY "30819D300D06092A864886F70D010101050003818B0030818702818100DD88CBCCD46787C55F942428A33ED92F1F4BE6EEDFE382E1C8350451382E7E9774942C8B1B02E12A7D34B9832D21134361F51F400E372097F5CFB71F9655EDD8F6F29EBB35D94C7502C04849485389ABD1BCA977E098327435D62413ABC56637C0638C839A2496714BEE502064DACFF621E1B5E5DA101B3BE8879988E4E8D939020111" + +#include "../../include/Sgit/SgitFtdcUserApiDataType.h" +#include "../../include/Sgit/SgitFtdcUserApiStruct.h" +#include "../../include/Sgit/SgitFtdcTraderApi.h" + +using namespace fstech; + +#ifdef _WIN64 + #pragma comment(lib, "../../include/Sgit/win64/sgittradeapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif +#else + #pragma comment(lib, "../../include/Sgit/win32/sgittradeapi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif +#endif + +// 是否飞鼠API +#define IS_SGIT_API 1 + +// 条件编译 +#include "../CTP/include_pub.h" + +#undef HAS_ExchangeID_Position +#undef HAS_ExchangeID_Quote diff --git a/apis/Sgit_Trade/ReadMe.txt b/apis/Sgit_Trade/ReadMe.txt new file mode 100644 index 0000000..5058c23 --- /dev/null +++ b/apis/Sgit_Trade/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : Sgit_Trade Project Overview +======================================================================== + +AppWizard has created this Sgit_Trade DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your Sgit_Trade application. + + +Sgit_Trade.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +Sgit_Trade.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +Sgit_Trade.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named Sgit_Trade.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/apis/Sgit_Trade/Sgit_Trade.vcxproj b/apis/Sgit_Trade/Sgit_Trade.vcxproj new file mode 100644 index 0000000..5989d15 --- /dev/null +++ b/apis/Sgit_Trade/Sgit_Trade.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {B8C6E4A3-3345-4C46-91B2-198EB9D292DB} + Win32Proj + Sgit_Trade + 8.1 + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\Sgit + $(ProjectName)_$(PlatformTarget) + ./;../../include/cryptopp/;$(IncludePath) + + + true + + + false + ..\..\bin\$(Configuration)\$(PlatformTarget)\Sgit + $(ProjectName)_$(PlatformTarget) + ./;../../include/cryptopp/;$(IncludePath) + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;SGIT_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;ENABLE_LICENSE_;%(PreprocessorDefinitions) + true + + + Windows + true + ../../include/ApiHeader.def + + + + + Use + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;SGIT_TRADE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;SGIT_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;ENABLE_LICENSE;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + ../../include/ApiHeader.def + + + + + Level3 + Use + MaxSpeed + true + true + NDEBUG;_WINDOWS;_USRDLL;SGIT_TRADE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + + + Create + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/apis/Sgit_Trade/Sgit_Trade.vcxproj.filters b/apis/Sgit_Trade/Sgit_Trade.vcxproj.filters new file mode 100644 index 0000000..957604d --- /dev/null +++ b/apis/Sgit_Trade/Sgit_Trade.vcxproj.filters @@ -0,0 +1,72 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/QuantBox_XAPI/dllmain.cpp b/apis/Sgit_Trade/dllmain.cpp similarity index 100% rename from QuantBox_XAPI/dllmain.cpp rename to apis/Sgit_Trade/dllmain.cpp diff --git a/apis/Sgit_Trade/stdafx.cpp b/apis/Sgit_Trade/stdafx.cpp new file mode 100644 index 0000000..24d0859 --- /dev/null +++ b/apis/Sgit_Trade/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// Sgit_Trade.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/apis/Sgit_Trade/stdafx.h b/apis/Sgit_Trade/stdafx.h new file mode 100644 index 0000000..56b93a7 --- /dev/null +++ b/apis/Sgit_Trade/stdafx.h @@ -0,0 +1,21 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here +// BOOLEAN与asn.h中的冲突,不得不将asn.h中的改了,希望有人帮忙解决这个问题 +// 已经解决,移动到这就可以了 +#include +#include +#pragma comment(lib, "IPHLPAPI.lib") \ No newline at end of file diff --git a/apis/Sgit_Trade/targetver.h b/apis/Sgit_Trade/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/apis/Sgit_Trade/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/apis/Tdx_Trade/ReadMe.txt b/apis/Tdx_Trade/ReadMe.txt new file mode 100644 index 0000000..8fb6f65 --- /dev/null +++ b/apis/Tdx_Trade/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : Tdx_Trade Project Overview +======================================================================== + +AppWizard has created this Tdx_Trade DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your Tdx_Trade application. + + +Tdx_Trade.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +Tdx_Trade.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +Tdx_Trade.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named Tdx_Trade.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/apis/Tdx_Trade/SingleUser.cpp b/apis/Tdx_Trade/SingleUser.cpp new file mode 100644 index 0000000..0ba89c9 --- /dev/null +++ b/apis/Tdx_Trade/SingleUser.cpp @@ -0,0 +1,897 @@ +#include "stdafx.h" +#include "SingleUser.h" + +#include "../../common/Queue/MsgQueue.h" +#include "TypeConvert.h" +#include "TraderApi.h" + +#define QUERY_TIME_MIN (3) +#define QUERY_TIME_MAX (60) + +int Today(int day) +{ + time_t now = time(0); + now += day * 86400; + struct tm *ptmNow = localtime(&now); + + return (ptmNow->tm_year + 1900) * 10000 + + (ptmNow->tm_mon + 1) * 100 + + ptmNow->tm_mday; +} + +void CreateID(char* pOut, char* pDate, char*pZh, char* wtbh) +{ + if (pDate == nullptr || strlen(pDate) == 0) + { + sprintf(pOut, "%d:%s:%s", Today(0), pZh, wtbh); + } + else + { + sprintf(pOut, "%s:%s:%s", pDate, pZh, wtbh); + } +} + +// 解决创建与删除不在同一dll的问题 +void DeleteStructs(void*** pppStructs, CMsgQueue* pQueue) +{ + if (pppStructs == nullptr) + return; + + if (*pppStructs == nullptr) + return; + + void** ppStructs = *pppStructs; + + int i = 0; + while (ppStructs[i] != 0) + { + delete[] ppStructs[i]; + //pQueue->delete_block(ppStructs[i]); + ppStructs[i] = nullptr; + + ++i; + } + + delete[] ppStructs; + //pQueue->delete_block(ppStructs); + *pppStructs = nullptr; +} + +CSingleUser::CSingleUser(CTraderApi* pApi) +{ + m_pApi = pApi; + m_pClient = nullptr; + memset(m_UserID, 0, sizeof(m_UserID)); + + m_ConnectionStatus = ConnectionStatus::ConnectionStatus_Uninitialized; +} + + +CSingleUser::~CSingleUser() +{ +} + +void CSingleUser::OutputQueryTime(time_t t, double db, const char* szSource) +{ + LogField* pField = (LogField*)m_msgQueue->new_block(sizeof(LogField)); + + sprintf(pField->Message, "UserID:%s,Source:%s,Add:%d,Time:%s", m_UserID, szSource, (int)db, ctime(&t)); + + // 去了最后的回车 + int len = strlen(pField->Message); + pField->Message[len - 1] = 0; + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnLog, m_msgQueue, m_pClass, true, 0, pField, sizeof(LogField), nullptr, 0, nullptr, 0); +} + +void CSingleUser::CheckThenQueryOrder(time_t _now) +{ + if (m_ConnectionStatus != ConnectionStatus::ConnectionStatus_Done) + return; + + if (_now > m_QueryOrderTime) + { + double _queryTime = QUERY_TIME_MAX; + m_QueryOrderTime = time(nullptr) + _queryTime; + OutputQueryTime(m_QueryOrderTime, _queryTime, "QueryOrder"); + + ReqQryOrder(); + } +} + +void CSingleUser::CheckThenQueryTrade(time_t _now) +{ + if (m_ConnectionStatus != ConnectionStatus::ConnectionStatus_Done) + return; + + if (_now > m_QueryTradeTime) + { + double _queryTime = QUERY_TIME_MAX; + m_QueryTradeTime = time(nullptr) + _queryTime; + OutputQueryTime(m_QueryTradeTime, _queryTime, "QueryTrade"); + + ReqQryTrade(); + } +} + +void CSingleUser::ReqQryOrder() +{ + // 进行查询 + ReqQueryData_STRUCT query = { 0 }; + query.Client = m_pClient; + strcpy(query.KHH, m_UserID); + query.requestType = REQUEST_DRWT; + query.bAll = false; + m_pApi->ReqQuery(&query); +} + + +void CSingleUser::ReqQryTrade() +{ + // 进行查询 + ReqQueryData_STRUCT query = { 0 }; + query.Client = m_pClient; + strcpy(query.KHH, m_UserID); + query.requestType = REQUEST_DRCJ; + query.bAll = false; + m_pApi->ReqQuery(&query); +} + +int CSingleUser::OnResponse_ReqQryOrder(CTdxApi* pApi, RequestResponse_STRUCT* pRespone) +{ + ReqQueryData_STRUCT* pQuery = (ReqQueryData_STRUCT*)pRespone->pContent; + + if (pRespone->pErr) + { + ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); + + pField->RawErrorID = pRespone->pErr->ErrCode; + strcpy(pField->Text, pRespone->pErr->ErrInfo); + strcpy(pField->Source, "OnRespone_ReqQryOrder"); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, 0, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + } + + WTLB_STRUCT** ppRS = nullptr; + CharTable2WTLB(pRespone->ppFieldInfo, pRespone->ppResults, &ppRS, pRespone->Client, m_msgQueue); + + // 操作前清空,按说之前已经清空过一次了 + m_NewOrderList.clear(); + + // 有未完成的,标记为true + bool IsDone = true; + // 有未申报的,标记为true + bool IsNotSent = false; + // 有更新的 + bool IsUpdated = false; + + if (ppRS) + { + int i = 0; + while (ppRS[i]) + { + // 将撤单委托过滤 + if (ppRS[i]->MMBZ_ != MMBZ_Cancel && ppRS[i]->MMBZ_ != MMBZ_Buy_Cancel && ppRS[i]->MMBZ_ != MMBZ_Sell_Cancel) + { + // 需要将它输入到一个地方用于计算,这个是临时的,需要删除 + OrderField* pField = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); + + WTLB_2_OrderField_0(ppRS[i], pField); + CreateID(pField->ID, ppRS[i]->WTRQ, ppRS[i]->GDDM, ppRS[i]->WTBH); + pField->Date = ppRS[i]->WTRQ_ == 0 ? Today(0) : ppRS[i]->WTRQ_;//日期为0,重新赋值 + + m_NewOrderList.push_back(pField); + + if (!ZTSM_IsDone(ppRS[i]->ZTSM_)) + { + IsDone = false; + } + if (ZTSM_IsNotSent(ppRS[i]->ZTSM_)) + { + IsNotSent = true; + } + + // 需要将其保存起来,是只保存一次,还是每次都更新呢?个人认为只保存一次即可,反正是用来撤单的 + unordered_map::iterator it = m_pApi->m_id_api_order.find(pField->ID); + if (it == m_pApi->m_id_api_order.end()) + { + WTLB_STRUCT* pWTField = (WTLB_STRUCT*)m_msgQueue->new_block(sizeof(WTLB_STRUCT)); + memcpy(pWTField, ppRS[i], sizeof(WTLB_STRUCT)); + m_pApi->m_id_api_order.insert(pair(pField->ID, pWTField)); + } + else + { + // 如果已经存在,最好还是更新部分,要更新哪些地方呢?参考OnRespone_ReqOrderInsert部分,看哪些没有默认填写 + WTLB_STRUCT* pWTField = (WTLB_STRUCT*)it->second; + if (strlen(pWTField->ZQMC) == 0) + { + memcpy(pWTField, ppRS[i], sizeof(WTLB_STRUCT)); + } + } + } + ++i; + } + } + + // 委托列表 + // 1.新增的都需要输出 + // 2.老的看是否有变化 + ++m_OrderNotUpdateCount; + + int i = 0; + list::iterator it2 = m_OldOrderList.begin(); + for (list::iterator it = m_NewOrderList.begin(); it != m_NewOrderList.end(); ++it) + { + OrderField* pField = *it; + + bool bUpdate = false; + if (i >= m_OldOrderList.size()) + { + bUpdate = true; + } + else + { + // 相同位置的部分 + OrderField* pOldField = *it2; + if (pOldField->LeavesQty != pField->LeavesQty || pOldField->Status != pField->Status) + { + bUpdate = true; + } + } + + if (bUpdate) + { + IsUpdated = true; + m_OrderNotUpdateCount = 0; + + // 如果能找到下单时的委托,就修改后发出来 + unordered_map::iterator it = m_pApi->m_id_platform_order.find(pField->ID); + if (it == m_pApi->m_id_platform_order.end()) + { + // 因为上次生成的可能在后期删了,所以要复制一份 + OrderField* pField_ = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); + memcpy(pField_, pField, sizeof(OrderField)); + + m_pApi->m_id_platform_order.insert(pair(pField_->ID, pField_)); + } + else + { + OrderField* pField_ = it->second; + memcpy(pField_, pField, sizeof(OrderField)); + } + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + } + + // 前一个可能为空,移动到下一个时需要注意 + if (it2 != m_OldOrderList.end()) + { + ++it2; + } + + ++i; + } + + if (pQuery->bAll) + { + int i = 0; + int count = m_NewOrderList.size(); + for (list::iterator it = m_NewOrderList.begin(); it != m_NewOrderList.end(); ++it) + { + OrderField* pField = *it; + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryOrder, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + ++i; + } + } + + // 将老数据清理,防止内存泄漏 + for (list::iterator it = m_OldOrderList.begin(); it != m_OldOrderList.end(); ++it) + { + OrderField* pField = *it; + m_msgQueue->delete_block(pField); + } + + // 做交换 + m_OldOrderList.clear(); + m_OldOrderList = m_NewOrderList; + m_NewOrderList.clear(); + + double _queryTime = 0; + if (!IsDone) + { + if (!IsUpdated) + { + // 没有更新,是否要慢点查 + _queryTime = 0.5 * QUERY_TIME_MAX + QUERY_TIME_MIN; + } + + // 有没有完成的,需要定时查询 + if (IsNotSent) + { + // 有没申报的,是否没在交易时间?慢点查 + _queryTime = 0.5 * QUERY_TIME_MAX + QUERY_TIME_MIN; + } + else + { + // 可能是交易时间了,是否需要考虑 + _queryTime = 2 * QUERY_TIME_MIN; + // 可能有些挂单一天都不会成交,挂在这一直导致查太多,加一下查询计数 + if (m_OrderNotUpdateCount >= 3) + { + _queryTime = 0.5 * QUERY_TIME_MAX + QUERY_TIME_MIN; + } + } + } + else + { + // 全完成了,可以不查或慢查 + _queryTime = 5 * QUERY_TIME_MAX; + } + + m_QueryOrderTime = time(nullptr) + _queryTime; + OutputQueryTime(m_QueryOrderTime, _queryTime, "NextQueryOrder_QueryOrder"); + + // 决定成交查询间隔 + if (IsUpdated) + { + // 委托可能是撤单,也有可能是成交了,赶紧查一下 + _queryTime = 0; + m_QueryTradeTime = time(nullptr) + _queryTime; + OutputQueryTime(m_QueryTradeTime, _queryTime, "NextQueryTrade_QueryOrder"); + } + else + { + // 委托没有变化,那成交就没有必要查那么快了 + _queryTime = 5 * QUERY_TIME_MAX; + m_QueryTradeTime = time(nullptr) + _queryTime; + OutputQueryTime(m_QueryTradeTime, _queryTime, "NextQueryTrade_QueryOrder"); + } + + DeleteStructs((void***)&ppRS, m_msgQueue); + + return 0; +} + + +double GetTradeListQty(list &tradeList, int count) +{ + double Qty = 0; + int i = 0; + for (list::iterator it = tradeList.begin(); it != tradeList.end(); ++it) + { + ++i; + if (i > count) + { + break; + } + + TradeField* pField = *it; + Qty += pField->Qty; + } + return Qty; +} + +void TradeList2TradeMap(list &tradeList, unordered_map &tradeMap) +{ + // 只在这个函数中new和delete应当没有问题 + for (unordered_map::iterator it = tradeMap.begin(); it != tradeMap.end(); ++it) + { + TradeField* pNewField = it->second; + delete[] pNewField; + } + tradeMap.clear(); + + // 将多个合约拼接成 + for (list::iterator it = tradeList.begin(); it != tradeList.end(); ++it) + { + TradeField* pField = *it; + unordered_map::iterator it2 = tradeMap.find(pField->ID); + if (it2 == tradeMap.end()) + { + TradeField* pNewField = new TradeField; + memcpy(pNewField, pField, sizeof(TradeField)); + tradeMap[pField->ID] = pNewField; + } + else + { + TradeField* pNewField = it2->second; + pNewField->Price = pField->Price; + pNewField->Qty += pField->Qty; + } + } +} + +int CSingleUser::OnResponse_ReqQryTrade(CTdxApi* pApi, RequestResponse_STRUCT* pRespone) +{ + ReqQueryData_STRUCT* pQuery = (ReqQueryData_STRUCT*)pRespone->pContent; + + if (pRespone->pErr) + { + ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); + + pField->RawErrorID = pRespone->pErr->ErrCode; + strcpy(pField->Text, pRespone->pErr->ErrInfo); + strcpy(pField->Source, "OnRespone_ReqQryTrade"); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, 0, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + } + + CJLB_STRUCT** ppRS = nullptr; + CharTable2CJLB(pRespone->ppFieldInfo, pRespone->ppResults, &ppRS, pRespone->Client, m_msgQueue); + + // 操作前清空,按说之前已经清空过一次了 + m_NewTradeList.clear(); + + if (ppRS) + { + // 利用成交编号的大小来判断正反序 + if (!m_TradeListReverse) + { + int count = GetCountStructs((void**)ppRS); + if (count > 1) + { + // 转成数字的比较,是否会有非数字的情况出现? + long CJBH0 = atol(ppRS[0]->CJBH); + long CJBH1 = atol(ppRS[count - 1]->CJBH); + if (CJBH0 > CJBH1) + { + m_TradeListReverse = true; + } + } + } + + int i = 0; + while (ppRS[i]) + { + // 有部分券商,撤单也计成交了,真无语了,需要过滤 + if (ppRS[i]->CJSL_ <= 0) + { + ++i; + continue; + } + + TradeField* pField = (TradeField*)m_msgQueue->new_block(sizeof(TradeField)); + + CJLB_2_TradeField(ppRS[i], pField); + CreateID(pField->ID, ppRS[i]->CJRQ, ppRS[i]->GDDM, ppRS[i]->WTBH); + pField->Date = ppRS[i]->CJRQ_ == 0 ? Today(0) : ppRS[i]->CJRQ_;//日期为0,重新赋值 + + if (m_TradeListReverse) + { + // 华泰查出来的表后生成的排第一,所以要处理一下 + m_NewTradeList.push_front(pField); + } + else + { + m_NewTradeList.push_back(pField); + } + + ++i; + } + } + + // 新查出来的反而少了,华泰有合并成交的情况,这种如何处理? + // 对同ID的需要累加,有发现累加不对应的,应当处理 + // 同样条数的,也有可能其中的有变化,如何处理? + bool bTryMerge = false; + int OldTradeListCount = m_OldTradeList.size(); + int NewTradeListCount = m_NewTradeList.size(); + + if (NewTradeListCount < OldTradeListCount) + { + // 行数变少了,应当是合并了 + bTryMerge = true; + } + else if (OldTradeListCount == 0) + { + // 如果上一次的为空,不管这次查出来的是合并还是没有合并,都没有关系,当成没合并处理即可 + } + else if (NewTradeListCount == OldTradeListCount) + { + // 行数不变,但有可能是其中的一条部分成交的更新,所以检查一下 + + double OldQty = GetTradeListQty(m_OldTradeList, m_OldTradeList.size()); + double NewQty = GetTradeListQty(m_NewTradeList, m_NewTradeList.size()); + if (NewQty != OldQty) + { + // 同样长度成交量发生了变化,可能是合并的列表其中一个新成交了 + bTryMerge = true; + } + } + else + { + // 行数变多了,只要其中上次的部分有变化就需要检查一下 + double OldQty = GetTradeListQty(m_OldTradeList, m_OldTradeList.size()); + double NewQty = GetTradeListQty(m_NewTradeList, m_NewTradeList.size()); + if (NewQty != OldQty) + { + bTryMerge = true; + } + } + + if (bTryMerge) + { + // 合并列表的处理方法 + // 如果上次是合并,这次就没有必要再生成一次了 + if (m_OldTradeMap.size() == 0 || !m_LastIsMerge) + { + for (unordered_map::iterator it = m_OldTradeMap.begin(); it != m_OldTradeMap.end(); ++it) + { + TradeField* pField = it->second; + delete[] pField; + } + m_OldTradeMap.clear(); + + TradeList2TradeMap(m_OldTradeList, m_OldTradeMap); + } + TradeList2TradeMap(m_NewTradeList, m_NewTradeMap); + CompareTradeMapAndEmit(m_OldTradeMap, m_NewTradeMap); + + // 交换 + for (unordered_map::iterator it = m_OldTradeMap.begin(); it != m_OldTradeMap.end(); ++it) + { + TradeField* pField = it->second; + delete[] pField; + } + m_OldTradeMap.clear(); + m_OldTradeMap = m_NewTradeMap; + m_NewTradeMap.clear(); + m_LastIsMerge = true; + } + else + { + // 普通的处理方法 + CompareTradeListAndEmit(m_OldTradeList, m_NewTradeList); + m_LastIsMerge = false; + } + + if (pQuery->bAll) + { + int i = 0; + int count = m_NewTradeList.size(); + for (list::iterator it = m_NewTradeList.begin(); it != m_NewTradeList.end(); ++it) + { + TradeField* pField = *it; + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRspQryTrade, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); + ++i; + } + } + + // 将老数据清理,防止内存泄漏 + for (list::iterator it = m_OldTradeList.begin(); it != m_OldTradeList.end(); ++it) + { + TradeField* pField = *it; + m_msgQueue->delete_block(pField); + } + + // 做交换 + m_OldTradeList.clear(); + m_OldTradeList = m_NewTradeList; + m_NewTradeList.clear(); + + DeleteStructs((void***)&ppRS, m_msgQueue); + + return 0; +} + +void CSingleUser::CompareTradeMapAndEmit(unordered_map &oldMap, unordered_map &newMap) +{ + for (unordered_map::iterator it = newMap.begin(); it != newMap.end(); ++it) + { + TradeField* pNewField = it->second; + unordered_map::iterator it2 = oldMap.find(pNewField->ID); + if (it2 == oldMap.end()) + { + // 没找到,是新单 + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnTrade, m_msgQueue, m_pClass, 0, 0, pNewField, sizeof(TradeField), nullptr, 0, nullptr, 0); + } + else + { + TradeField* pOldField = it2->second; + int Qty = pNewField->Qty - pOldField->Qty; + if (Qty > 0) + { + // 有变化的单 + TradeField* pField = new TradeField; + memcpy(pField, pNewField, sizeof(TradeField)); + pField->Qty = Qty; + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnTrade, m_msgQueue, m_pClass, 0, 0, pNewField, sizeof(TradeField), nullptr, 0, nullptr, 0); + delete[] pField; + } + } + } +} + +void CSingleUser::CompareTradeListAndEmit(list &oldList, list &newList) +{ + int i = 0; + list::iterator it2 = oldList.begin(); + for (list::iterator it = newList.begin(); it != newList.end(); ++it) + { + TradeField* pField = *it; + + bool bUpdate = false; + if (i >= oldList.size()) + { + bUpdate = true; + } + //else + //{ + // // 相同位置的部分 + // TradeField* pOldField = *it2; + // if (pOldField->Qty != pField->Qty) + // { + // bUpdate = true; + // } + //} + + if (bUpdate) + { + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnTrade, m_msgQueue, m_pClass, 0, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); + } + + // 前一个可能为空,移动到下一个时需要注意 + if (it2 != oldList.end()) + { + ++it2; + } + + ++i; + } +} + + +int CSingleUser::OnResponse_ReqUserLogin(CTdxApi* pApi, RequestResponse_STRUCT* pRespone) +{ + if (pRespone->pErr) + { + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + + pField->RawErrorID = pRespone->pErr->ErrCode; + strcpy(pField->Text, pRespone->pErr->ErrInfo); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_ConnectionStatus = ConnectionStatus::ConnectionStatus_Disconnected; + m_pApi->RemoveUser((CSingleUser*)pRespone->pUserData_Public); + } + else + { + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_ConnectionStatus = ConnectionStatus::ConnectionStatus_Logined; + } + + // 查询股东列表,华泰证券可能一开始查会返回非知请求[1122] + GDLB_STRUCT** ppRS = nullptr; + char CPZH[32] = { 0 }; + CharTable2Login(pRespone->ppFieldInfo, pRespone->ppResults, &ppRS, pRespone->Client, nullptr, CPZH); + + int count = GetCountStructs((void**)ppRS); + + if (count > 0) + { + for (int i = 0; i < count; ++i) + { + InvestorField* pField = (InvestorField*)m_msgQueue->new_block(sizeof(InvestorField)); + + GDLB_2_InvestorField(ppRS[i], pField); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInvestor, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(InvestorField), nullptr, 0, nullptr, 0); + } + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_ConnectionStatus = ConnectionStatus::ConnectionStatus_Done; + } + + // 这是由TdxApi.dll创建的 + DeleteStructs((void***)&ppRS); + + return 0; +} + +int CSingleUser::OnResponse_ReqQryInvestor(CTdxApi* pApi, RequestResponse_STRUCT* pRespone) +{ + if (pRespone->pErr) + { + ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); + + pField->RawErrorID = pRespone->pErr->ErrCode; + strcpy(pField->Text, pRespone->pErr->ErrInfo); + strcpy(pField->Source, "OnRespone_ReqQryInvestor"); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, 0, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + } + + GDLB_STRUCT** ppRS = nullptr; + CharTable2GDLB(pRespone->ppFieldInfo, pRespone->ppResults, &ppRS, pRespone->Client); + + int count = GetCountStructs((void**)ppRS); + + if (count>0) + { + for (int i = 0; i < count; ++i) + { + InvestorField* pField = (InvestorField*)m_msgQueue->new_block(sizeof(InvestorField)); + + GDLB_2_InvestorField(ppRS[i], pField); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInvestor, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(InvestorField), nullptr, 0, nullptr, 0); + } + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } + + DeleteStructs((void***)&ppRS); + + return 0; +} + +int CSingleUser::OnResponse_ReqQryTradingAccount(CTdxApi* pApi, RequestResponse_STRUCT* pRespone) +{ + if (pRespone->pErr) + { + ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); + + pField->RawErrorID = pRespone->pErr->ErrCode; + strcpy(pField->Text, pRespone->pErr->ErrInfo); + strcpy(pField->Source, "OnRespone_ReqQryTradingAccount"); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, 0, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + } + + //if (pRespone->ppResults == nullptr) + //{ + + // return; + //} + + ZJYE_STRUCT** ppRS = nullptr; + CharTable2ZJYE(pRespone->ppFieldInfo, pRespone->ppResults, &ppRS, pRespone->Client, m_msgQueue); + + int count = GetCountStructs((void**)ppRS); + for (int i = 0; i < count; ++i) + { + AccountField* pField = (AccountField*)m_msgQueue->new_block(sizeof(AccountField)); + + ZJYE_2_AccountField(ppRS[i], pField); + + //// 可能资金账号查不出来,手工填上 + //if (strlen(pField->AccountID) <= 0) + //{ + // // 多账户会有问题 + // strcpy(pField->AccountID, m_pApi->GetAccount()); + //} + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryTradingAccount, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(AccountField), nullptr, 0, nullptr, 0); + } + + DeleteStructs((void***)&ppRS, m_msgQueue); + + return 0; +} + +int CSingleUser::OnResponse_ReqQryInvestorPosition(CTdxApi* pApi, RequestResponse_STRUCT* pRespone) +{ + if (pRespone->pErr) + { + ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); + + pField->RawErrorID = pRespone->pErr->ErrCode; + strcpy(pField->Text, pRespone->pErr->ErrInfo); + strcpy(pField->Source, "OnRespone_ReqQryInvestorPosition"); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, 0, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + } + + GFLB_STRUCT** ppRS = nullptr; + CharTable2GFLB(pRespone->ppFieldInfo, pRespone->ppResults, &ppRS, pRespone->Client, m_msgQueue); + + int count = GetCountStructs((void**)ppRS); + for (int i = 0; i < count; ++i) + { + PositionField* pField = (PositionField*)m_msgQueue->new_block(sizeof(PositionField)); + + // 应当处理一下,可能一个账号对应的有多个,如信用账户 + GFLB_2_PositionField(ppRS[i], pField); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInvestorPosition, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(PositionField), nullptr, 0, nullptr, 0); + } + + DeleteStructs((void***)&ppRS, m_msgQueue); + + return 0; +} + +int CSingleUser::OnResponse_ReqOrderInsert(CTdxApi* pApi, RequestResponse_STRUCT* pRespone) +{ + Order_STRUCT* pTdxOrder = (Order_STRUCT*)pRespone->pContent; + OrderField* pOrder = (OrderField*)pRespone->pUserData_Public2; + + WTLB_STRUCT* pWTOrders = (WTLB_STRUCT*)m_msgQueue->new_block(sizeof(WTLB_STRUCT)); + strcpy(pWTOrders->ZJZH, pTdxOrder->ZJZH); + strcpy(pWTOrders->ZHLB, pTdxOrder->ZHLB_); + strcpy(pWTOrders->ZQDM, pTdxOrder->ZQDM); + strcpy(pWTOrders->GDDM, pTdxOrder->GDDM); + strcpy(pWTOrders->WTBH, pTdxOrder->WTBH); + strcpy(pWTOrders->JYSDM, pTdxOrder->ZHLB_);// FIXME:交易所代码有什么办法搞到吗? + + pWTOrders->Client = m_pClient; + + m_pApi->m_id_api_order.insert(pair(pOrder->LocalID, pWTOrders)); + // 处理错误 + if (pRespone->pErr) + { + pOrder->RawErrorID = pRespone->pErr->ErrCode; + strcpy(pOrder->Text, pRespone->pErr->ErrInfo); + } + + // 处理结果 + if (pRespone->ppResults&&pRespone->ppResults[0 * COL_EACH_ROW + 0]) + { + // 写上柜台的ID,以后将基于此进行定位 + strcpy(pOrder->OrderID, pRespone->ppResults[0 * COL_EACH_ROW + 0]);//订单号 + strcpy(pWTOrders->WTBH, pOrder->OrderID); + CreateID(pOrder->ID, nullptr, pTdxOrder->GDDM, pOrder->OrderID); + + + m_pApi->m_id_api_order.erase(pOrder->LocalID); + m_pApi->m_id_api_order.insert(pair(pOrder->ID, pWTOrders)); + + m_pApi->m_id_platform_order.erase(pOrder->LocalID); + m_pApi->m_id_platform_order.insert(pair(pOrder->ID, pOrder)); + + // 有挂单的,需要进行查询了 + + double _queryTime = QUERY_TIME_MIN; + m_QueryOrderTime = time(nullptr) + _queryTime; + OutputQueryTime(m_QueryOrderTime, _queryTime, "NextQueryOrder_Send"); + } + + // 现在有两个结构体,需要进行操作了 + // 1.通知下单的结果 + // 2.记录下单 + + OrderField* pField = pOrder; + if (pField->RawErrorID != 0) + { + pField->ExecType = ExecType::ExecType_Rejected; + pField->Status = OrderStatus::OrderStatus_Rejected; + } + else + { + pField->ExecType = ExecType::ExecType_New; + pField->Status = OrderStatus::OrderStatus_New; + } + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + + return 0; +} + +int CSingleUser::OnResponse_ReqOrderAction(CTdxApi* pApi, RequestResponse_STRUCT* pRespone) +{ + WTLB_STRUCT* pTdxOrder = (WTLB_STRUCT*)pRespone->pContent; + OrderField* pOrder = (OrderField*)pRespone->pUserData_Public2; + + if (pRespone->pErr) + { + pOrder->RawErrorID = pRespone->pErr->ErrCode; + strcpy(pOrder->Text, pRespone->pErr->ErrInfo); + + pOrder->ExecType = ExecType::ExecType_CancelReject; + // 注意报单状态问题,交给报单查询来处理 + } + else + { + double _queryTime = QUERY_TIME_MIN; + m_QueryOrderTime = time(nullptr) + _queryTime; + OutputQueryTime(m_QueryOrderTime, _queryTime, "NextQueryOrder_Cancel"); + + // 会不会出现撤单时,当时不知道是否成功撤单,查询才得知没有撤成功? + //ppOrders[i]->ExecType = ExecType::ExecCancelled; + //ppOrders[i]->Status = OrderStatus::Cancelled; + } + + m_msgQueue->Input_Copy(ResponseType::ResponseType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pOrder, sizeof(OrderField), nullptr, 0, nullptr, 0); + + return 0; +} \ No newline at end of file diff --git a/apis/Tdx_Trade/SingleUser.h b/apis/Tdx_Trade/SingleUser.h new file mode 100644 index 0000000..ab13410 --- /dev/null +++ b/apis/Tdx_Trade/SingleUser.h @@ -0,0 +1,75 @@ +#pragma once + +#include "../../include/Tdx/TdxApi.h" +#include "../../include/ApiStruct.h" + +#include +#include +#include + +using namespace std; + +class CMsgQueue; +class CTraderApi; + +////////////////////////////////////////////////////////////////////////// +// 只是用来维护单账号的信息用 +class CSingleUser +{ +public: + CSingleUser(CTraderApi* pApi); + ~CSingleUser(); + + void CheckThenQueryOrder(time_t _now); + void CheckThenQueryTrade(time_t _now); + + void OutputQueryTime(time_t t, double db, const char* szSource); + + void ReqQryOrder(); + void ReqQryTrade(); + + int OnResponse_ReqQryOrder(CTdxApi* pApi, RequestResponse_STRUCT* pRespone); + int OnResponse_ReqQryTrade(CTdxApi* pApi, RequestResponse_STRUCT* pRespone); + + int OnResponse_ReqUserLogin(CTdxApi* pApi, RequestResponse_STRUCT* pRespone); + int OnResponse_ReqQryInvestor(CTdxApi* pApi, RequestResponse_STRUCT* pRespone); + int OnResponse_ReqQryTradingAccount(CTdxApi* pApi, RequestResponse_STRUCT* pRespone); + int OnResponse_ReqQryInvestorPosition(CTdxApi* pApi, RequestResponse_STRUCT* pRespone); + + int OnResponse_ReqOrderInsert(CTdxApi* pApi, RequestResponse_STRUCT* pRespone); + int OnResponse_ReqOrderAction(CTdxApi* pApi, RequestResponse_STRUCT* pRespone); + +private: + void CompareTradeMapAndEmit(unordered_map &oldMap, unordered_map &newMap); + void CompareTradeListAndEmit(list &oldList, list &newList); + +private: + CTraderApi* m_pApi; + + + //unordered_map m_id_platform_order; + //unordered_map m_id_api_order; + + list m_OldTradeList; + list m_NewTradeList; + unordered_map m_NewTradeMap; + unordered_map m_OldTradeMap; + + + list m_OldOrderList; + list m_NewOrderList; + + int m_OrderNotUpdateCount; + bool m_TradeListReverse; + bool m_LastIsMerge; + +public: + time_t m_QueryTradeTime; + time_t m_QueryOrderTime; + void* m_pClient; + void* m_pClass; + CMsgQueue* m_msgQueue; + char m_UserID[64]; + ConnectionStatus m_ConnectionStatus; +}; + diff --git a/QuantBox_Tdx_Trade/QuantBox_Tdx_Trade.vcxproj b/apis/Tdx_Trade/Tdx_Trade.vcxproj similarity index 69% rename from QuantBox_Tdx_Trade/QuantBox_Tdx_Trade.vcxproj rename to apis/Tdx_Trade/Tdx_Trade.vcxproj index 5fe1cfe..9820c58 100644 --- a/QuantBox_Tdx_Trade/QuantBox_Tdx_Trade.vcxproj +++ b/apis/Tdx_Trade/Tdx_Trade.vcxproj @@ -13,19 +13,20 @@ {01D3F1DE-99B3-4D41-97C3-F4680CDB980B} Win32Proj - QuantBox_Tdx_Trade + Tdx_Trade + 8.1 DynamicLibrary true - v120 + v140 Unicode DynamicLibrary false - v120 + v140 true Unicode @@ -41,30 +42,30 @@ true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\Tdx\x86 + ..\..\bin\$(Configuration)\$(PlatformTarget)\Tdx + $(ProjectName)_$(PlatformTarget) false + ..\..\bin\$(Configuration)\$(PlatformTarget)\Tdx + $(ProjectName)_$(PlatformTarget) Use Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_TDX_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;TDX_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true Windows true - ..\include\ApiHeader.def + ../../include/ApiHeader.def - xcopy "$(TargetPath)" "$(SolutionDir)XAPI\Tdx\x86\" /Y -xcopy "$(SolutionDir)include\Tdx\win32\*.dll" "$(SolutionDir)XAPI\Tdx\x86\" /Y -xcopy "$(SolutionDir)include\Tdx\win32\*.exe" "$(SolutionDir)XAPI\Tdx\x86\" /Y -xcopy "$(SolutionDir)include\Tdx\win32\*.ini" "$(SolutionDir)XAPI\Tdx\x86\" /Y -xcopy "$(SolutionDir)include\Tdx\win32\*.doc" "$(SolutionDir)XAPI\Tdx\x86\" /Y + + @@ -74,7 +75,7 @@ xcopy "$(SolutionDir)include\Tdx\win32\*.doc" "$(SolutionDir)XAPI\Tdx\x86\" /Y< MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTBOX_TDX_TRADE_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;TDX_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -82,34 +83,29 @@ xcopy "$(SolutionDir)include\Tdx\win32\*.doc" "$(SolutionDir)XAPI\Tdx\x86\" /Y< true true true + ../../include/ApiHeader.def - - - + + + + - - - - - - false - - - false - - - + + + + + Create Create diff --git a/QuantBox_Tdx_Trade/QuantBox_Tdx_Trade.vcxproj.filters b/apis/Tdx_Trade/Tdx_Trade.vcxproj.filters similarity index 82% rename from QuantBox_Tdx_Trade/QuantBox_Tdx_Trade.vcxproj.filters rename to apis/Tdx_Trade/Tdx_Trade.vcxproj.filters index c094e00..711d229 100644 --- a/QuantBox_Tdx_Trade/QuantBox_Tdx_Trade.vcxproj.filters +++ b/apis/Tdx_Trade/Tdx_Trade.vcxproj.filters @@ -27,19 +27,19 @@ Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files @@ -56,16 +56,19 @@ Source Files - + + Source Files + + Source Files - + Source Files - + Source Files - + Source Files diff --git a/apis/Tdx_Trade/TraderApi.cpp b/apis/Tdx_Trade/TraderApi.cpp new file mode 100644 index 0000000..85fc224 --- /dev/null +++ b/apis/Tdx_Trade/TraderApi.cpp @@ -0,0 +1,807 @@ +#include "stdafx.h" +#include "TraderApi.h" + +#include "../../include/QueueEnum.h" +#include "../../include/QueueHeader.h" + +#include "../../include/ApiHeader.h" +#include "../../include/ApiStruct.h" + +#include "../../include/ApiProcess.h" +#include "../../include/toolkit.h" + +#include "../../common/Queue/MsgQueue.h" + +#include "TypeConvert.h" + +#include "../../include/Tdx/tdx_function.h" + +#include +#include + + +void* __stdcall Query(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + // 由内部调用,不用检查是否为空 + CTraderApi* pApi = (CTraderApi*)pApi2; + pApi->QueryInThread(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + return nullptr; +} + +void CTraderApi::QueryInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + int iRet = 0; + switch (type) + { + case E_Init: + iRet = _Init(); + break; + case E_Disconnect: + _Disconnect(true); + // 不再循环 + return; + } + + if (m_pApi) + { + switch (type) + { + case E_ReqUserLoginField: + iRet = _ReqUserLogin(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case E_InputOrderField: + iRet = _ReqOrderInsert(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case E_InputOrderActionField: + iRet = _ReqOrderAction(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + case E_QryDepthMarketDataField: + iRet = _Subscribe(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + + //case QueryType::ReqQryOrder : + //case QueryType::ReqQryTrade: + //case QueryType::ReqQryInvestor: + //case QueryType::ReqQryTradingAccount: + //case QueryType::ReqQryInvestorPosition: + case E_ReqQueryData_STRUCT: + iRet = _ReqQuery(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + break; + + default: + break; + } + } + + if (0 == iRet) + { + //返回成功,填加到已发送池 + m_nSleep = 1; + } + else + { + m_msgQueue_Query->Input_Copy(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + //失败,按4的幂进行延时,但不超过1s + m_nSleep *= 4; + m_nSleep %= 1023; + } + + // 将时定时查询功能放在查询队列中,这样退出就不会出问题了 + // 由于队列中一直没有东西,所以不会再来触发这个循环,需要隔一定的时间向队列中放一个,最好放在最后 + TestInThread(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + if (m_msgQueue_Query->Size() == 0) + { + m_msgQueue_Query->Input_Copy(E_Heartbeat, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + m_nSleep = 32; + } + + this_thread::sleep_for(chrono::milliseconds(m_nSleep)); +} + +//void* __stdcall Test(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +//{ +// // 由内部调用,不用检查是否为空 +// CTraderApi* pApi = (CTraderApi*)pApi2; +// pApi->TestInThread(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); +// return nullptr; +//} + +void CTraderApi::TestInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + time_t _now = time(nullptr); + + for (unordered_map::iterator it = m_Client_User_Map.begin(); it != m_Client_User_Map.end(); ++it) + { + CSingleUser* pUser = it->second; + pUser->CheckThenQueryOrder(_now); + pUser->CheckThenQueryTrade(_now); + } +} + +void CTraderApi::OnResponse(CTdxApi* pApi, RequestResponse_STRUCT* pRespone) +{ + if (pRespone == nullptr) + return; + + CSingleUser* pUser = (CSingleUser*)pRespone->pUserData_Public; + if (pUser == nullptr) + { + // 这个地方主要是因为Login时立即发送了登录结果出来,这个地方如果改一下也许会好一些 + unordered_map::iterator it = m_Client_User_Map.find(pRespone->Client); + if (it == m_Client_User_Map.end()) + { + pUser = m_pDefaultUser; + } + else + { + pUser = it->second; + } + pRespone->pUserData_Public = pUser; + } + + switch (pRespone->requestType) + { + case 0: + pUser->OnResponse_ReqUserLogin(pApi, pRespone); + break; + case REQUEST_WT: + case REQUEST_ETF_SGSH: + case REQUEST_ZGHS: + case REQUEST_WT_QQ: + pUser->OnResponse_ReqOrderInsert(pApi, pRespone); + break; + case REQUEST_CD: + pUser->OnResponse_ReqOrderAction(pApi, pRespone); + break; + case REQUEST_HQ: + OnResponse_Subscribe(pApi, pRespone); + break; + case REQUEST_GDLB: + pUser->OnResponse_ReqQryInvestor(pApi, pRespone); + break; + case REQUEST_DRWT: + pUser->OnResponse_ReqQryOrder(pApi, pRespone); + break; + case REQUEST_DRCJ: + pUser->OnResponse_ReqQryTrade(pApi, pRespone); + break; + case REQUEST_ZJYE: + pUser->OnResponse_ReqQryTradingAccount(pApi, pRespone); + break; + case REQUEST_GFLB: + pUser->OnResponse_ReqQryInvestorPosition(pApi, pRespone); + break; + default: + break; + } +} + +int CTraderApi::_Init() +{ + if (m_pApi == nullptr) + { + m_pApi = CTdxApi::CreateApi(); + m_pApi->RegisterSpi(this); + } + + Error_STRUCT* pErr = nullptr; + + m_pApi->LoadScript(m_ServerInfo.Address, true, false); + m_pApi->Init(m_ServerInfo.ExtInfoChar128, &pErr); + + if (pErr) + { + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + + pField->RawErrorID = pErr->ErrCode; + strcpy(pField->Text, pErr->ErrInfo); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } + else + { + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); + + ReqUserLogin(); + } + + DeleteError(pErr); + + return 0; +} + +void CTraderApi::ReqUserLogin() +{ + if (m_UserInfo_Pos >= m_UserInfo_Count) + return; + + m_msgQueue_Query->Input_NoCopy(RequestType::E_ReqUserLoginField, m_msgQueue_Query, this, 0, 0, + nullptr, 0, nullptr, 0, nullptr, 0); +} + +int CTraderApi::_ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + Error_STRUCT* pErr = nullptr; + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); + + CSingleUser* pUser = new CSingleUser(this); + pUser->m_pClass = m_pClass; + pUser->m_msgQueue = m_msgQueue; + strcpy(pUser->m_UserID, m_UserInfo.UserID); + m_UserID_User_Map.insert(pair(m_UserInfo.UserID, pUser)); + + if (m_pDefaultUser == nullptr) + { + m_pDefaultUser = pUser; + } + + void* pClient = m_pApi->Login(m_UserInfo.UserID, m_UserInfo.Password, m_UserInfo.ExtInfoChar64, &pErr); + pUser->m_pClient = pClient; + m_Client_User_Map.insert(pair(pClient, pUser)); + + if (pClient) + { + // 有授权信息要输出 + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + if (pErr) + { + pField->RawErrorID = pErr->ErrCode; + strcpy(pField->Text, pErr->ErrInfo); + } + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(pField), nullptr, 0, nullptr, 0); + + + // 登录下一个账号 + //++m_UserInfo_Pos; + //ReqUserLogin(); + } + else + { + if (pErr) + { + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + + pField->RawErrorID = pErr->ErrCode; + strcpy(pField->Text, pErr->ErrInfo); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } + } + + DeleteError(pErr); + + return 0; +} + +void CTraderApi::RemoveUser(CSingleUser* pUser) +{ + m_UserID_User_Map.erase(pUser->m_UserID); + m_Client_User_Map.erase(pUser->m_pClient); +} + +void CTraderApi::ReqQuery(QueryType type, ReqQueryField* pQuery) +{ + ReqQueryData_STRUCT query = { 0 }; + strcpy(query.KHH, pQuery->ClientID); + strcpy(query.ZJZH, pQuery->ClientID);//通达信模拟上这样写是否会出问题 + strcpy(query.GDDM, pQuery->AccountID); + strcpy(query.ZQDM, pQuery->InstrumentID); + sprintf_s(query.KSRQ,"%d",pQuery->DateStart); + sprintf_s(query.ZZRQ, "%d", pQuery->DateEnd); + query.bAll = pQuery->Int32ID == -1; + + //printf("===%d,%d", pQuery->Int32ID, query.bAll); + + switch (type) + { + case QueryType_ReqQryInstrument: + break; + case QueryType_ReqQryTradingAccount: + query.requestType = REQUEST_ZJYE; + break; + case QueryType_ReqQryInvestorPosition: + query.requestType = REQUEST_GFLB; + break; + case QueryType::QueryType_ReqQryOrder: + query.requestType = REQUEST_DRWT; + break; + case QueryType::QueryType_ReqQryTrade: + query.requestType = REQUEST_DRCJ; + break; + case QueryType_ReqQryQuote: + break; + case QueryType_ReqQryInstrumentCommissionRate: + break; + case QueryType_ReqQryInstrumentMarginRate: + break; + case QueryType_ReqQrySettlementInfo: + break; + case QueryType_ReqQryInvestor: + query.requestType = REQUEST_GDLB; + break; + case QueryType_ReqQryHistoricalTicks: + break; + case QueryType_ReqQryHistoricalBars: + break; + default: + break; + } + + ReqQuery(&query); + + return; +} + +void CTraderApi::ReqQuery(ReqQueryData_STRUCT* pQuery) +{ + // 直接转发请求,不进行处理 + m_msgQueue_Query->Input_Copy(E_ReqQueryData_STRUCT, m_msgQueue_Query, this, 0, 0, + pQuery, sizeof(ReqQueryData_STRUCT), nullptr, 0, nullptr, 0); + + return; +} + + +int CTraderApi::_ReqQuery(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + if (m_pApi == nullptr) + return 0; + + ReqQueryData_STRUCT* pQuery = (ReqQueryData_STRUCT*)ptr1; + + CSingleUser* pUser = Fill_UserID_Client(pQuery->KHH, &pQuery->Client); + RequestResponse_STRUCT* pRequest = m_pApi->MakeQueryData(pQuery); + pRequest->Client = pQuery->Client; + pRequest->pUserData_Public = pUser; + strcpy(pRequest->khh,pQuery->KHH); + + m_pApi->SendRequest(pRequest); + + return 0; +} + + + +CTraderApi::CTraderApi(void) +{ + // 弹出这个只是为了在Python这类的平台中调试,以后可能要关闭 + //AllocConsole(); + //freopen("CON", "r", stdin); + //freopen("CON", "w", stdout); + //freopen("CON", "w", stderr); + //::DeleteMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE, MF_BYCOMMAND); + //printf("===**********************==="); + + m_pIDGenerator = nullptr; + m_pApi = nullptr; + m_lRequestID = 0; + m_nSleep = 1; + + // 自己维护两个消息队列 + m_msgQueue = new CMsgQueue(); + m_msgQueue_Query = new CMsgQueue(); + + m_msgQueue_Query->Register(Query,this); + m_msgQueue_Query->StartThread(); + + m_pDefaultUser = nullptr; +} + + +CTraderApi::~CTraderApi(void) +{ + _Disconnect(false); +} + +void CTraderApi::Register(void* pCallback, void* pClass) +{ + m_pClass = pClass; + if (m_msgQueue == nullptr) + return; + + m_msgQueue_Query->Register(Query,this); + m_msgQueue->Register(pCallback,this); + if (pCallback) + { + m_msgQueue_Query->StartThread(); + m_msgQueue->StartThread(); + } + else + { + m_msgQueue_Query->StopThread(); + m_msgQueue->StopThread(); + } +} + +bool CTraderApi::IsErrorRspInfo(const char* szSource, Error_STRUCT *pRspInfo) +{ + bool bRet = ((pRspInfo) && (pRspInfo->ErrType != 0)); + if (bRet) + { + ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); + + pField->RawErrorID = pRspInfo->ErrCode; + strcpy(pField->Text, pRspInfo->ErrInfo); + strcpy(pField->Source, szSource); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, true, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + } + return bRet; +} + +void CTraderApi::Connect(const string& szPath, + ServerInfoField* pServerInfo, + UserInfoField* pUserInfo, + int count) +{ + m_szPath = szPath; + memcpy(&m_ServerInfo, pServerInfo, sizeof(ServerInfoField)); + memcpy(&m_UserInfo, pUserInfo, sizeof(UserInfoField)); + + m_pUserInfos = (UserInfoField*)(new char[sizeof(UserInfoField)*count]); + memcpy(m_pUserInfos, pUserInfo, sizeof(UserInfoField)*count); + + m_UserInfo_Pos = 0; + m_UserInfo_Count = count; + + m_pIDGenerator = new CIDGenerator(); + m_pIDGenerator->SetPrefix(m_UserInfo.UserID); + + m_msgQueue_Query->Input_NoCopy(E_Init, m_msgQueue_Query, this, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); +} + +void CTraderApi::Disconnect() +{ + _Disconnect(false); +} + +void CTraderApi::_DisconnectInThread() +{ + m_msgQueue_Query->Input_NoCopy(RequestType::E_Disconnect, m_msgQueue_Query, this, 0, 0, + nullptr, 0, nullptr, 0, nullptr, 0); +} + +void CTraderApi::_Disconnect(bool IsInQueue) +{ + if (IsInQueue) + { + + } + else + { + if (m_msgQueue_Query) + { + m_msgQueue_Query->StopThread(); + m_msgQueue_Query->Register(nullptr, nullptr); + m_msgQueue_Query->Clear(); + delete m_msgQueue_Query; + m_msgQueue_Query = nullptr; + } + } + + if(m_pApi) + { + // 还没有登出 + m_pApi->Exit(); + + m_pApi->Release(); + m_pApi = nullptr; + + // 全清理,只留最后一个 + if (m_msgQueue) + { + m_msgQueue->Clear(); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + // 主动触发 + m_msgQueue->Process(); + } + } + + if (m_msgQueue) + { + m_msgQueue->StopThread(); + m_msgQueue->Register(nullptr,nullptr); + m_msgQueue->Clear(); + delete m_msgQueue; + m_msgQueue = nullptr; + } + + if (m_pIDGenerator) + { + delete m_pIDGenerator; + m_pIDGenerator = nullptr; + } +} + +char* CTraderApi::ReqOrderInsert( + OrderField* pOrder, + int count, + char* pszLocalIDBuf) +{ + memset(pszLocalIDBuf, 0, sizeof(OrderIDType)*count); + + if (count < 1) + return 0; + + OrderField** ppOrders = new OrderField*[count]; + + // 生成本地ID,供上层进行定位使用 + for (int i = 0; i < count; ++i) + { + OrderField* pNewOrder = (OrderField*)m_msgQueue->new_block(sizeof(OrderField)); + memcpy(pNewOrder, &pOrder[i], sizeof(OrderField)); + + strcpy(pNewOrder->LocalID, m_pIDGenerator->GetIDString()); + strcpy(pNewOrder->ID, pNewOrder->LocalID); + strcat(pszLocalIDBuf, pNewOrder->LocalID); + + if (i (pNewOrder->LocalID, pNewOrder)); + } + + m_msgQueue_Query->Input_Copy(RequestType::E_InputOrderField, m_msgQueue_Query, this, 0, 0, + ppOrders, sizeof(OrderField*)*count, nullptr, 0, nullptr, 0); + + delete[] ppOrders; + + return pszLocalIDBuf; +} + +int CTraderApi::_ReqOrderInsert(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + if (m_pApi == nullptr) + return 0; + + // 得到报单指针列表 + OrderField** ppOrders = (OrderField**)ptr1; + int count = (int)size1 / sizeof(OrderField*); + + for (int i = 0; i < count; ++i) + { + Order_STRUCT order = { 0 }; + OrderField_2_Order_STRUCT(ppOrders[i], &order); + + // 主要是账号定位问题 + CSingleUser* pUser = Fill_UserID_Client(order.KHH, &order.Client); + + RequestResponse_STRUCT* pRequest = m_pApi->MakeOrder(&order); + pRequest->pUserData_Public = pUser; + pRequest->pUserData_Public2 = ppOrders[i]; + m_pApi->SendRequest(pRequest); + } + + return 0; +} + +char* CTraderApi::ReqOrderAction(OrderIDType* szId, int count, char* pzsRtn) +{ + memset(pzsRtn, 0, sizeof(OrderIDType)*count); + + OrderField** ppOrders = new OrderField*[count]; + WTLB_STRUCT** ppTdxOrders = new WTLB_STRUCT*[count]; + + for (int i = 0; i < count; ++i) + { + ppOrders[i] = nullptr; + ppTdxOrders[i] = nullptr; + + { + unordered_map::iterator it = m_id_platform_order.find(szId[i]); + if (it != m_id_platform_order.end()) + ppOrders[i] = it->second; + else + { + OrderField* pField = new OrderField(); + ppOrders[i] = pField; + strcpy(pField->ID, szId[i]); + strcpy(pField->Symbol, "*.*"); + strcpy(pField->InstrumentID, "*"); + strcpy(pField->ExchangeID, "*"); + } + } + + { + unordered_map::iterator it = m_id_api_order.find(szId[i]); + if (it != m_id_api_order.end()) + ppTdxOrders[i] = it->second; + else + { + // 找不到对应的ID,需要处理地,不然会报错 + } + } + + if (i < count - 1) + { + strcat(pzsRtn, ";"); + } + } + + m_msgQueue_Query->Input_Copy(RequestType::E_InputOrderActionField, m_msgQueue_Query, this, 0, 0, + ppOrders, sizeof(OrderField*)*count, ppTdxOrders, sizeof(WTLB_STRUCT*)*count, nullptr, 0); + + delete[] ppOrders; + delete[] ppTdxOrders; + + return pzsRtn; +} + +int CTraderApi::_ReqOrderAction(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + if (m_pApi == nullptr) + return 0; + + int count = (int)size1 / sizeof(OrderField*); + // 通过ID找到原始结构,用于撤单 + // 通过ID找到通用结构,用于接收回报 + // 这里传过来的的是已经被复制过的内容 + OrderField** ppOrders = (OrderField**)ptr1; + WTLB_STRUCT** ppTdxOrders = (WTLB_STRUCT**)ptr2; + + for (int i = 0; i < count; ++i) + { + if (ppTdxOrders[i] == nullptr) + continue; + + CSingleUser* pUser = Fill_UserID_Client(ppTdxOrders[i]->KHH, &ppTdxOrders[i]->Client); + + RequestResponse_STRUCT* pRequest = m_pApi->MakeCancelOrder(ppTdxOrders[i]); + pRequest->pUserData_Public = pUser; + pRequest->pUserData_Public2 = ppOrders[i]; + m_pApi->SendRequest(pRequest); + } + + return 0; +} + +void CTraderApi::Subscribe(const string& szInstrumentIDs, const string& szExchangeID) +{ + m_msgQueue_Query->Input_Copy(RequestType::E_QryDepthMarketDataField, m_msgQueue_Query, this, 0, 0, + (void*)szInstrumentIDs.c_str(), szInstrumentIDs.length() + 1, (void*)szExchangeID.c_str(), szExchangeID.length() + 1, nullptr, 0); +} + +int CTraderApi::_Subscribe(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + if (m_pApi == nullptr) + return 0; + + ReqQueryData_STRUCT query = { 0 }; + + strcpy(query.ZQDM, (char*)ptr1); + query.requestType = REQUEST_HQ; + CSingleUser* pUser = Fill_UserID_Client(query.KHH, &query.Client); + RequestResponse_STRUCT* pRequest = m_pApi->MakeQueryData(&query); + pRequest->pUserData_Public = pUser; + m_pApi->SendRequest(pRequest); + + return 0; +} + +int CTraderApi::OnResponse_Subscribe(CTdxApi* pApi, RequestResponse_STRUCT* pRespone) +{ + HQ_STRUCT** ppRS = nullptr; + CharTable2HQ(pRespone->ppFieldInfo, pRespone->ppResults, &ppRS, pRespone->Client); + + int count = GetCountStructs((void**)ppRS); + + for (int i = 0; i < count; ++i) + { + DepthMarketDataNField* pField = (DepthMarketDataNField*)m_msgQueue->new_block(sizeof(DepthMarketDataNField)+sizeof(DepthField)* 10); + + HQ_STRUCT* pDepthMarketData = ppRS[i]; + + strcpy(pField->InstrumentID, pDepthMarketData->ZQDM); + //pField->Exchange = JYSDM_2_ExchangeType(pDepthMarketData->JYSDM); + + sprintf(pField->Symbol, "%s.%s", pField->InstrumentID, ""); + + // 交易时间 + GetExchangeTime(time(nullptr), &pField->TradingDay, &pField->ActionDay, &pField->UpdateTime); + + + pField->LastPrice = pDepthMarketData->DQJ_; + //pField->Volume = 0; + //pField->Turnover = pDepthMarketData->Turnover; + //pField->OpenInterest = pDepthMarketData->OpenInterest; + //pField->AveragePrice = pDepthMarketData->AveragePrice; + pField->UpperLimitPrice = pDepthMarketData->ZTJG_; + pField->LowerLimitPrice = pDepthMarketData->DTJG_; + + pField->PreClosePrice = pDepthMarketData->ZSJ_; + pField->OpenPrice = pDepthMarketData->JKJ_; + + InitBidAsk(pField); + + do + { + if (pDepthMarketData->BidSize1_ == 0) + break; + AddBid(pField, pDepthMarketData->BidPrice1_, pDepthMarketData->BidSize1_, 0); + + if (pDepthMarketData->BidSize2_ == 0) + break; + AddBid(pField, pDepthMarketData->BidPrice2_, pDepthMarketData->BidSize2_, 0); + + if (pDepthMarketData->BidSize3_ == 0) + break; + AddBid(pField, pDepthMarketData->BidPrice3_, pDepthMarketData->BidSize3_, 0); + + if (pDepthMarketData->BidSize4_ == 0) + break; + AddBid(pField, pDepthMarketData->BidPrice4_, pDepthMarketData->BidSize4_, 0); + + if (pDepthMarketData->BidSize5_ == 0) + break; + AddBid(pField, pDepthMarketData->BidPrice5_, pDepthMarketData->BidSize5_, 0); + } while (false); + + do + { + if (pDepthMarketData->AskSize1_ == 0) + break; + AddAsk(pField, pDepthMarketData->AskPrice1_, pDepthMarketData->AskSize1_, 0); + + if (pDepthMarketData->AskSize2_ == 0) + break; + AddAsk(pField, pDepthMarketData->AskPrice2_, pDepthMarketData->AskSize2_, 0); + + if (pDepthMarketData->AskSize3_ == 0) + break; + AddAsk(pField, pDepthMarketData->AskPrice3_, pDepthMarketData->AskSize3_, 0); + + if (pDepthMarketData->AskSize4_ == 0) + break; + AddAsk(pField, pDepthMarketData->AskPrice4_, pDepthMarketData->AskSize4_, 0); + + if (pDepthMarketData->AskSize5_ == 0) + break; + AddAsk(pField, pDepthMarketData->AskPrice5_, pDepthMarketData->AskSize5_, 0); + } while (false); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); + } + + return 0; +} + + +CSingleUser* CTraderApi::Fill_UserID_Client(char* khh, void** Client) +{ + CSingleUser* pUser = nullptr; + if (*Client) + { + unordered_map::iterator it = m_Client_User_Map.find(*Client); + if (it == m_Client_User_Map.end()) + { + pUser = m_pDefaultUser; + } + else + { + pUser = it->second; + } + strcpy(khh, pUser->m_UserID); + } + else + { + unordered_map::iterator it = m_UserID_User_Map.find(khh); + if (it == m_UserID_User_Map.end()) + { + pUser = m_pDefaultUser; + } + else + { + pUser = it->second; + } + *Client = pUser->m_pClient; + } + + return pUser; +} diff --git a/apis/Tdx_Trade/TraderApi.h b/apis/Tdx_Trade/TraderApi.h new file mode 100644 index 0000000..b46f97f --- /dev/null +++ b/apis/Tdx_Trade/TraderApi.h @@ -0,0 +1,194 @@ +#pragma once + +#include "../../include/Tdx/TdxApi.h" +#include "../../include/ApiStruct.h" +#include "../../include/IDGenerator.h" +#include "../../include/QueueEnum.h" + +#ifdef _WIN64 + #pragma comment(lib, "../../include/Tdx/win64/TdxApi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif +#else + #pragma comment(lib, "../../include/Tdx/win32/TdxApi.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif +#endif + +#include "SingleUser.h" + +#include +#include +#include +#include +#include +#include +#include +#include + + + +using namespace std; + +class CMsgQueue; + +/* +多账号支持的问题 +1.由于不同账号查询的时间间隔需要不一样,所以这个交给子对象处理 +2.撤单时只根据一个撤单的ID,所以要在主对象中维护可撤表 +3.股东、股份、资金由于只是回报,并不存储,所以可以写在主对象中,也可以写在子对象中,但有可能以后要维护,还是写在子对象中吧 +4.行情查询,建议直接都通过主连接又快又好 + +*/ +class CTraderApi:public CTdxSpi +{ + //请求数据包类型 + enum RequestType + { + E_Init = 100, + E_Disconnect, + E_ReqUserLoginField, + E_QryInvestorField, + E_InputOrderField, + E_InputOrderActionField, + E_QryOrderField, + E_QryTradeField, + E_QryTradingAccountField, + E_QryInvestorPositionField, + + E_QryDepthMarketDataField, + + + E_SettlementInfoConfirmField, + E_QryInstrumentField, + E_InputQuoteField, + E_InputQuoteActionField, + E_ParkedOrderField, + E_QryInvestorPositionDetailField, + E_QryInstrumentCommissionRateField, + E_QryInstrumentMarginRateField, + E_QrySettlementInfoField, + E_QryQuoteField, + + E_ReqQueryData_STRUCT, + E_Heartbeat, + }; + +public: + //static CTraderApi * pThis; + + CTraderApi(void); + virtual ~CTraderApi(void); + + void Register(void* pCallback, void* pClass); + + void Connect(const string& szPath, + ServerInfoField* pServerInfo, + UserInfoField* pUserInfo, + int count); + void Disconnect(); + + char* ReqOrderInsert( + OrderField* pOrder, + int count, + char* pszLocalIDBuf); + + char* ReqOrderAction(OrderIDType* szId, int count, char* pzsRtn); + + + void ReqQuery(QueryType type, ReqQueryField* pQuery); + void ReqQuery(ReqQueryData_STRUCT* pQuery); + + //void ReqQryOrder(); + //void ReqQryTrade(); + + void Subscribe(const string& szInstrumentIDs, const string& szExchangeID); + + void RemoveUser(CSingleUser* pUser); + +private: + virtual void OnResponse(CTdxApi* pApi, RequestResponse_STRUCT* pRespone); + + friend void* __stdcall Query(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + virtual void QueryInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + + //friend void* __stdcall Test(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + virtual void TestInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + + int _Init(); + int _ReqQuery(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + void _Disconnect(bool IsInQueue); + void _DisconnectInThread(); + + //登录请求 + void ReqUserLogin(); + int _ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + + int _ReqQryInvestor(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + + /*int _ReqQryOrder(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + int _ReqQryTrade(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3);*/ + + int _ReqOrderInsert(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + int _ReqOrderAction(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + + /*int _ReqQryTradingAccount(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + int _ReqQryInvestorPosition(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3);*/ + + int _Subscribe(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + int OnResponse_Subscribe(CTdxApi* pApi, RequestResponse_STRUCT* pRespone); + + + //检查是否出错 + //bool IsErrorRspInfo(Error_STRUCT *pRspInfo, int nRequestID, bool bIsLast);//向消息队列输出信息 + bool IsErrorRspInfo(const char* szSource, Error_STRUCT *pRspInfo);//不输出信息 + //void OutputQueryTime(time_t t, double db,const char* szSource); + + CSingleUser* Fill_UserID_Client(char* khh, void** Client); + +public: + unordered_map m_id_platform_order; + unordered_map m_id_api_order; + +private: + atomic m_lRequestID; //请求ID,得保持自增 + + OrderIDType m_orderInsert_Id; + + mutex m_csOrderRef; + int m_nMaxOrderRef; //报单引用,用于区分报单,保持自增 + + CTdxApi* m_pApi; //交易API + + + string m_szPath; //生成配置文件的路径 + ServerInfoField m_ServerInfo; + UserInfoField m_UserInfo; + + int m_nSleep; + + + + + CMsgQueue* m_msgQueue; //消息队列指针 + CMsgQueue* m_msgQueue_Query; //测试用 + + UserInfoField* m_pUserInfos; + int m_UserInfo_Pos; + int m_UserInfo_Count; + + void* m_pClass; + + CIDGenerator* m_pIDGenerator; + + unordered_map m_Client_User_Map; + unordered_map m_UserID_User_Map; + + CSingleUser* m_pDefaultUser; +}; \ No newline at end of file diff --git a/apis/Tdx_Trade/TypeConvert.cpp b/apis/Tdx_Trade/TypeConvert.cpp new file mode 100644 index 0000000..0bfa382 --- /dev/null +++ b/apis/Tdx_Trade/TypeConvert.cpp @@ -0,0 +1,1107 @@ +#include "stdafx.h" + +#include +#include +#include + +#include "TypeConvert.h" +#include "../../include/Tdx/tdx_enum.h" +#include "../../include/Tdx/tdx_field.h" +#include "../../include/Tdx/tdx_function.h" + +#include "../../include/toolkit.h" + +#include "../../common/Queue/MsgQueue.h" + +////////////////////////////////////////////////////////////////////////// +int ZTSM_str_2_int(char* pIn) +{ + char* pCheng = strstr(pIn, "成"); + char* pChe = strstr(pIn, "撤"); + char* pBu = strstr(pIn, "部"); + + if (pChe) + { + if (pBu) + { + return ZTSM_PartiallyCancelled; + } + return ZTSM_AllCancelled; + } + else if (pCheng) + { + if (pBu) + { + return ZTSM_PartiallyFilled; + } + return ZTSM_AllFilled; + } + + char* pF1 = strstr(pIn, "废"); + char* pF2 = strstr(pIn, "非"); + + if (pF1 || pF2) + { + return ZTSM_Illegal; + } + + char* pDeng = strstr(pIn, "等"); + if (pDeng) + { + return ZTSM_WaitingForReport; + } + + //char* pQ = strstr(pIn, "全"); + //char* pY = strstr(pIn, "已"); + //char* pBao = strstr(pIn, "报"); + + return ZTSM_New; +} + +// 报价方式转,这是根据字符串的特点进行分类 +// TODO:报价方式还有申购,等待后期处理 +int BJFS_str_2_int(char* pIn) +{ + char* pX1 = strstr(pIn, "限"); + + if (pX1 == pIn) + { + // 第一个字是限价 + return WTFS_Limit; + } + else + { + char* pMM = strstr(pIn, "买卖"); + if (pMM) + { + // 华泰返回买卖是表示限价 + return WTFS_Limit; + } + char* pC = strstr(pIn, "撤"); + if (pC) + { + char* p5 = strstr(pIn, "五"); + if (p5) + { + return WTFS_Five_IOC; + } + char* pQ = strstr(pIn, "全"); + if (pQ) + { + return WTFS_FOK; + } + return WTFS_IOC; // 剩 + } + else + { + char* pZ = strstr(pIn, "转"); + if (pZ) + { + return WTFS_Five_Limit; + } + char* pD = strstr(pIn, "对"); + if (pD) + { + return WTFS_Best_Reverse; + } + char* pB = strstr(pIn, "本"); + if (pB) + { + return WTFS_Best_Forward; + } + char* pH = strstr(pIn, "回"); // 回购 + if (pH) + { + return WTFS_Limit; + } + } + + return WTFS_Limit; + } +} + + +///发现不管你下的什么单,只要是特殊的单,买卖标志都是3,所以需要另行处理 +int WTLB_str_2_int(char* pIn) +{ + char* pChe = strstr(pIn, "撤"); + char* pBuy = strstr(pIn, "买"); + if (pBuy) + { + if (pChe) + { + return WTLB_Buy_Cancel; + } + return WTLB_Buy; + } + char* pSell = strstr(pIn, "卖"); + if (pSell) + { + if (pChe) + { + return WTLB_Sell_Cancel; + } + return WTLB_Sell; + } + + + char* pETF = strstr(pIn, "ETF"); + char* pShen = strstr(pIn, "申"); + if (pShen) + { + if (pETF) + { + return WTLB_ETFCreation; + } + return WTLB_LOFCreation; + } + char* pShu = strstr(pIn, "赎"); + if (pShu) + { + if (pETF) + { + return WTLB_ETFRedemption; + } + return WTLB_LOFRedemption; + } + + char* pHe = strstr(pIn, "合"); + if (pHe) + { + return WTLB_Merge; + } + char* pChai = strstr(pIn, "拆"); + if (pChai) + { + return WTLB_Split; + } + + return WTLB_Buy; +} + +////////////////////////////////////////////////////////////////////////// + +void CharTable2WTLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, WTLB_STRUCT*** pppResults, void* Client, CMsgQueue* pQueue) +{ + *pppResults = nullptr; + if (ppTable == nullptr) + return; + + int count = GetRowCountTableBody(ppTable); + if (count <= 0) + return; + + WTLB_STRUCT** ppResults = new WTLB_STRUCT*[count + 1](); + ppResults[count] = nullptr; + *pppResults = ppResults; + + int col_147 = GetIndexByFieldID(ppFieldInfos, FIELD_ZTSM); + + for (int i = 0; i < count; ++i) + { + ppResults[i] = new WTLB_STRUCT(); + + int j = 0; + FieldInfo_STRUCT* pRow = ppFieldInfos[j]; + while (pRow != 0) + { + char* t = ppTable[i * COL_EACH_ROW + j]; + switch (pRow->FieldID) + { + case FIELD_WTRQ: + strcpy_s(ppResults[i]->WTRQ, t); + break; + case FIELD_WTSJ: + strcpy_s(ppResults[i]->WTSJ, t); + break; + case FIELD_GDDM: + strcpy_s(ppResults[i]->GDDM, t); + break; + case FIELD_ZQDM: + strcpy_s(ppResults[i]->ZQDM, t); + break; + case FIELD_ZQMC: + strcpy_s(ppResults[i]->ZQMC, t); + break; + case FIELD_MMBZ: + strcpy_s(ppResults[i]->MMBZ, t); + break; + case FIELD_WTLB: + strcpy_s(ppResults[i]->WTLB, t); + break; + case FIELD_JYSDM: + strcpy_s(ppResults[i]->JYSDM, t); + break; + case FIELD_WTJG: + strcpy_s(ppResults[i]->WTJG, t); + break; + case FIELD_WTSL: + strcpy_s(ppResults[i]->WTSL, t); + break; + case FIELD_CJJG: + strcpy_s(ppResults[i]->CJJG, t); + break; + case FIELD_CJSL: + strcpy_s(ppResults[i]->CJSL, t); + break; + case FIELD_CDSL: + strcpy_s(ppResults[i]->CDSL, t); + break; + case FIELD_WTBH: + strcpy_s(ppResults[i]->WTBH, t); + break; + case FIELD_BJFS: + strcpy_s(ppResults[i]->BJFS, t); + break; + case FIELD_ZTSM: + strcpy_s(ppResults[i]->ZTSM, t); + break; + case FIELD_DJZJ: + strcpy_s(ppResults[i]->DJZJ, t); + break; + case FIELD_BLXX: + strcpy_s(ppResults[i]->BLXX, t); + break; + case FIELD_WTFS: + strcpy_s(ppResults[i]->WTFS, t); + break; + case FIELD_ZJZH: + strcpy_s(ppResults[i]->ZJZH, t); + break; + case FIELD_ZHLB: + strcpy_s(ppResults[i]->ZHLB, t); + break; + } + ++j; + pRow = ppFieldInfos[j]; + } + + ppResults[i]->WTRQ_ = atoi(ppResults[i]->WTRQ); + ppResults[i]->MMBZ_ = atoi(ppResults[i]->MMBZ); + ppResults[i]->JYSDM_ = atoi(ppResults[i]->JYSDM); + ppResults[i]->WTJG_ = atof(ppResults[i]->WTJG); + ppResults[i]->WTSL_ = atoi(ppResults[i]->WTSL); + ppResults[i]->CJJG_ = atof(ppResults[i]->CJJG); + ppResults[i]->CJSL_ = atoi(ppResults[i]->CJSL); + ppResults[i]->DJZJ_ = atof(ppResults[i]->DJZJ); + ppResults[i]->WTFS_ = atof(ppResults[i]->WTFS); + ppResults[i]->ZHLB_ = atoi(ppResults[i]->ZHLB); + + // 可能没有,怎么办?那就只好不用它了 + ppResults[i]->CDSL_ = atoi(ppResults[i]->CDSL); + + if (strstr(ppResults[i]->WTSJ, ":")) + { + int HH = 0, mm = 0, ss = 0; + GetUpdateTime_HH_mm_ss(ppResults[i]->WTSJ, &HH, &mm, &ss); + ppResults[i]->WTSJ_ = HH * 10000 + mm * 100 + ss; + } + else + { + ppResults[i]->WTSJ_ = atoi(ppResults[i]->WTSJ); + } + + + if (col_147 >= 0) + { + // 第一个的字符,并转成数字,其实也可以全走文本比较的方式,但认为这样更快 + if (ppResults[i]->ZTSM[1] == '-') + { + ppResults[i]->ZTSM_ = ppResults[i]->ZTSM[0] - '0'; + } + else + { + ppResults[i]->ZTSM_ = ZTSM_str_2_int(ppResults[i]->ZTSM); + } + } + else + { + // 信达证券没有状态说明,需要模拟计算出来,这种情况下,撤单数量怎么都要有 + if (ppResults[i]->CDSL_ > 0) + { + ppResults[i]->ZTSM_ = ZTSM_AllCancelled; + } + else if (ppResults[i]->CJSL_ == ppResults[i]->WTSL_) + { + ppResults[i]->ZTSM_ = ZTSM_AllFilled; + } + else if (ppResults[i]->CJSL_ == 0) + { + ppResults[i]->ZTSM_ = ZTSM_New; + } + else + { + ppResults[i]->ZTSM_ = ZTSM_PartiallyFilled; + } + } + + + ppResults[i]->BJFS_ = BJFS_str_2_int(ppResults[i]->BJFS); + ppResults[i]->WTLB_ = WTLB_str_2_int(ppResults[i]->WTLB); + + ppResults[i]->Client = Client; + } +} + +void CharTable2CJLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, CJLB_STRUCT*** pppResults, void* Client, CMsgQueue* pQueue) +{ + *pppResults = nullptr; + if (ppTable == nullptr) + return; + + int count = GetRowCountTableBody(ppTable); + if (count <= 0) + return; + + CJLB_STRUCT** ppResults = new CJLB_STRUCT*[count + 1](); + ppResults[count] = nullptr; + *pppResults = ppResults; + + for (int i = 0; i < count; ++i) + { + ppResults[i] = new CJLB_STRUCT(); + + int j = 0; + FieldInfo_STRUCT* pRow = ppFieldInfos[j]; + while (pRow != 0) + { + char* t = ppTable[i * COL_EACH_ROW + j]; + switch (pRow->FieldID) + { + case FIELD_CJRQ: + strcpy_s(ppResults[i]->CJRQ, t); + break; + case FIELD_CJSJ: + strcpy_s(ppResults[i]->CJSJ, t); + break; + case FIELD_GDDM: + strcpy_s(ppResults[i]->GDDM, t); + break; + case FIELD_ZQDM: + strcpy_s(ppResults[i]->ZQDM, t); + break; + case FIELD_ZQMC: + strcpy_s(ppResults[i]->ZQMC, t); + break; + case FIELD_MMBZ: + strcpy_s(ppResults[i]->MMBZ, t); + break; + case FIELD_WTLB: + strcpy_s(ppResults[i]->WTLB, t); + break; + case FIELD_CJJG: + strcpy_s(ppResults[i]->CJJG, t); + break; + case FIELD_CJSL: + strcpy_s(ppResults[i]->CJSL, t); + break; + case FIELD_FSJE: + strcpy_s(ppResults[i]->FSJE, t); + break; + case FIELD_SYJE: + strcpy_s(ppResults[i]->SYJE, t); + break; + case FIELD_YJ: + strcpy_s(ppResults[i]->YJ, t); + break; + case FIELD_YHS: + strcpy_s(ppResults[i]->YHS, t); + break; + case FIELD_GHF: + strcpy_s(ppResults[i]->GHF, t); + break; + case FIELD_CJF: + strcpy_s(ppResults[i]->CJF, t); + break; + case FIELD_CJBH: + strcpy_s(ppResults[i]->CJBH, t); + break; + case FIELD_CDBZ: + strcpy_s(ppResults[i]->CDBZ, t); + break; + case FIELD_WTBH: + strcpy_s(ppResults[i]->WTBH, t); + break; + } + ++j; + pRow = ppFieldInfos[j]; + } + + ppResults[i]->CJRQ_ = atoi(ppResults[i]->CJRQ); + ppResults[i]->MMBZ_ = atoi(ppResults[i]->MMBZ); + ppResults[i]->CJJG_ = atof(ppResults[i]->CJJG); + ppResults[i]->CJSL_ = atoi(ppResults[i]->CJSL); + ppResults[i]->SYJE_ = atof(ppResults[i]->SYJE); + ppResults[i]->YJ_ = atof(ppResults[i]->YJ); + ppResults[i]->YHS_ = atof(ppResults[i]->YHS); + ppResults[i]->GHF_ = atof(ppResults[i]->GHF); + ppResults[i]->CJF_ = atof(ppResults[i]->CJF); + ppResults[i]->CDBZ_ = atoi(ppResults[i]->CDBZ); + ppResults[i]->FSJE_ = atof(ppResults[i]->FSJE); + + + if (strstr(ppResults[i]->CJSJ, ":")) + { + int HH = 0, mm = 0, ss = 0; + GetUpdateTime_HH_mm_ss(ppResults[i]->CJSJ, &HH, &mm, &ss); + ppResults[i]->CJSJ_ = HH * 10000 + mm * 100 + ss; + } + else + { + ppResults[i]->CJSJ_ = atoi(ppResults[i]->CJSJ); + } + + ppResults[i]->WTLB_ = WTLB_str_2_int(ppResults[i]->WTLB); + + ppResults[i]->Client = Client; + } +} + +void CharTable2GFLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GFLB_STRUCT*** pppResults, void* Client, CMsgQueue* pQueue) +{ + *pppResults = nullptr; + if (ppTable == nullptr) + return; + + int count = GetRowCountTableBody(ppTable); + if (count <= 0) + return; + + GFLB_STRUCT** ppResults = new GFLB_STRUCT*[count + 1](); + ppResults[count] = nullptr; + *pppResults = ppResults; + + for (int i = 0; i < count; ++i) + { + ppResults[i] = new GFLB_STRUCT(); + + int j = 0; + FieldInfo_STRUCT* pRow = ppFieldInfos[j]; + while (pRow != 0) + { + char* t = ppTable[i * COL_EACH_ROW + j]; + switch (pRow->FieldID) + { + case FIELD_ZQDM: + strcpy_s(ppResults[i]->ZQDM, t); + break; + case FIELD_ZQMC: + strcpy_s(ppResults[i]->ZQMC, t); + break; + case FIELD_ZQSL: + strcpy_s(ppResults[i]->ZQSL, t); + break; + case FIELD_KMSL: + strcpy_s(ppResults[i]->KMSL, t); + break; + case FIELD_TBCBJ: + strcpy_s(ppResults[i]->TBCBJ, t); + break; + case FIELD_DQJ: + strcpy_s(ppResults[i]->DQJ, t); + break; + case FIELD_ZXSZ: + strcpy_s(ppResults[i]->ZXSZ, t); + break; + case FIELD_TBFDYK: + strcpy_s(ppResults[i]->TBFDYK, t); + break; + case FIELD_SXYK: + strcpy_s(ppResults[i]->SXYK, t); + break; + case FIELD_CKYKBL: + strcpy_s(ppResults[i]->CKYKBL, t); + break; + case FIELD_DJSL: + strcpy_s(ppResults[i]->DJSL, t); + break; + case FIELD_GDDM: + strcpy_s(ppResults[i]->GDDM, t); + break; + case FIELD_JYSDM: + strcpy_s(ppResults[i]->JYSDM, t); + break; + case FIELD_JYSMC: + strcpy_s(ppResults[i]->JYSMC, t); + break; + case FIELD_BLXX: + strcpy_s(ppResults[i]->BLXX, t); + break; + } + ++j; + pRow = ppFieldInfos[j]; + } + + ppResults[i]->ZQSL_ = atoi(ppResults[i]->ZQSL); + ppResults[i]->KMSL_ = atoi(ppResults[i]->KMSL); + ppResults[i]->TBCBJ_ = atof(ppResults[i]->TBCBJ); + ppResults[i]->DQJ_ = atof(ppResults[i]->DQJ); + ppResults[i]->ZXSZ_ = atof(ppResults[i]->ZXSZ); + ppResults[i]->DJSL_ = atof(ppResults[i]->DJSL); + + ppResults[i]->Client = Client; + } +} + +void CharTable2ZJYE(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, ZJYE_STRUCT*** pppResults, void* Client, CMsgQueue* pQueue) +{ + *pppResults = nullptr; + if (ppTable == nullptr) + return; + + int count = GetRowCountTableBody(ppTable); + if (count <= 0) + return; + + ZJYE_STRUCT** ppResults = new ZJYE_STRUCT*[count + 1](); + ppResults[count] = nullptr; + *pppResults = ppResults; + + for (int i = 0; i < count; ++i) + { + ppResults[i] = new ZJYE_STRUCT(); + + int j = 0; + FieldInfo_STRUCT* pRow = ppFieldInfos[j]; + while (pRow != 0) + { + char* t = ppTable[i * COL_EACH_ROW + j]; + switch (pRow->FieldID) + { + case FIELD_BZ: + strcpy_s(ppResults[i]->BZ, t); + break; + case FIELD_ZJYE: + strcpy_s(ppResults[i]->ZJYE, t); + break; + case FIELD_KYZJ: + strcpy_s(ppResults[i]->KYZJ, t); + break; + case FIELD_ZZC_310: + strcpy_s(ppResults[i]->ZZC, t); + break; + case FIELD_KQZJ: + strcpy_s(ppResults[i]->KQZJ, t); + break; + case FIELD_ZJZH: + strcpy_s(ppResults[i]->ZJZH, t); + break; + case FIELD_ZXSZ: + strcpy_s(ppResults[i]->ZXSZ, t); + break; + } + ++j; + pRow = ppFieldInfos[j]; + } + + ppResults[i]->ZJYE_ = atof(ppResults[i]->ZJYE); + ppResults[i]->KYZJ_ = atof(ppResults[i]->KYZJ); + ppResults[i]->ZZC_ = atof(ppResults[i]->ZZC); + ppResults[i]->KQZJ_ = atof(ppResults[i]->KQZJ); + ppResults[i]->ZXSZ_ = atof(ppResults[i]->ZXSZ); + + ppResults[i]->Client = Client; + } +} + +//void CharTable2HQ(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, HQ_STRUCT*** pppResults, void* Client, CMsgQueue* pQueue) +//{ +// *pppResults = nullptr; +// if (ppTable == nullptr) +// return; +// +// int count = GetRowCountTableBody(ppTable); +// if (count <= 0) +// return; +// +// HQ_STRUCT** ppResults = new HQ_STRUCT*[count + 1](); +// ppResults[count] = nullptr; +// *pppResults = ppResults; +// +// for (int i = 0; i < count; ++i) +// { +// ppResults[i] = new HQ_STRUCT(); +// +// int j = 0; +// FieldInfo_STRUCT* pRow = ppFieldInfos[j]; +// while (pRow != 0) +// { +// char* t = ppTable[i * COL_EACH_ROW + j]; +// switch (pRow->FieldID) +// { +// case FIELD_ZQDM: +// strcpy_s(ppResults[i]->ZQDM, t); +// break; +// case FIELD_ZQMC: +// strcpy_s(ppResults[i]->ZQMC, t); +// break; +// case FIELD_ZSJ: +// strcpy_s(ppResults[i]->ZSJ, t); +// break; +// case FIELD_JKJ: +// strcpy_s(ppResults[i]->JKJ, t); +// break; +// case FIELD_GZLX: +// strcpy_s(ppResults[i]->GZLX, t); +// break; +// case FIELD_DQJ: +// strcpy_s(ppResults[i]->DQJ, t); +// break; +// case FIELD_BID_PRICE_1: +// strcpy_s(ppResults[i]->BidPrice1, t); +// break; +// case FIELD_BID_PRICE_2: +// strcpy_s(ppResults[i]->BidPrice2, t); +// break; +// case FIELD_BID_PRICE_3: +// strcpy_s(ppResults[i]->BidPrice3, t); +// break; +// case FIELD_BID_PRICE_4: +// strcpy_s(ppResults[i]->BidPrice4, t); +// break; +// case FIELD_BID_PRICE_5: +// strcpy_s(ppResults[i]->BidPrice5, t); +// break; +// case FIELD_BID_SIZE_1: +// strcpy_s(ppResults[i]->BidSize1, t); +// break; +// case FIELD_BID_SIZE_2: +// strcpy_s(ppResults[i]->BidSize2, t); +// break; +// case FIELD_BID_SIZE_3: +// strcpy_s(ppResults[i]->BidSize3, t); +// break; +// case FIELD_BID_SIZE_4: +// strcpy_s(ppResults[i]->BidSize4, t); +// break; +// case FIELD_BID_SIZE_5: +// strcpy_s(ppResults[i]->BidSize5, t); +// break; +// case FIELD_ASK_PRICE_1: +// strcpy_s(ppResults[i]->AskPrice1, t); +// break; +// case FIELD_ASK_PRICE_2: +// strcpy_s(ppResults[i]->AskPrice2, t); +// break; +// case FIELD_ASK_PRICE_3: +// strcpy_s(ppResults[i]->AskPrice3, t); +// break; +// case FIELD_ASK_PRICE_4: +// strcpy_s(ppResults[i]->AskPrice4, t); +// break; +// case FIELD_ASK_PRICE_5: +// strcpy_s(ppResults[i]->AskPrice5, t); +// break; +// case FIELD_ASK_SIZE_1: +// strcpy_s(ppResults[i]->AskSize1, t); +// break; +// case FIELD_ASK_SIZE_2: +// strcpy_s(ppResults[i]->AskSize2, t); +// break; +// case FIELD_ASK_SIZE_3: +// strcpy_s(ppResults[i]->AskSize3, t); +// break; +// case FIELD_ASK_SIZE_4: +// strcpy_s(ppResults[i]->AskSize4, t); +// break; +// case FIELD_ASK_SIZE_5: +// strcpy_s(ppResults[i]->AskSize5, t); +// break; +// case FIELD_JYSDM: +// strcpy_s(ppResults[i]->JYSDM, t); +// break; +// case FIELD_ZXJYGS: +// strcpy_s(ppResults[i]->ZXJYGS, t); +// break; +// case FIELD_ZXMRBDJW: +// strcpy_s(ppResults[i]->ZXMRBDJW, t); +// break; +// case FIELD_ZXMCBDJW: +// strcpy_s(ppResults[i]->ZXMCBDJW, t); +// break; +// case FIELD_ZHLB: +// strcpy_s(ppResults[i]->ZHLB, t); +// break; +// case FIELD_BZ: +// strcpy_s(ppResults[i]->BZ, t); +// break; +// case FIELD_GZBS: +// strcpy_s(ppResults[i]->GZBS, t); +// break; +// case FIELD_ZTJG: +// strcpy_s(ppResults[i]->ZTJG, t); +// break; +// case FIELD_DTJG: +// strcpy_s(ppResults[i]->DTJG, t); +// break; +// case FIELD_BLXX: +// strcpy_s(ppResults[i]->BLXX, t); +// break; +// } +// ++j; +// pRow = ppFieldInfos[j]; +// } +// +// ppResults[i]->ZSJ_ = atof(ppResults[i]->ZSJ); +// ppResults[i]->JKJ_ = atof(ppResults[i]->JKJ); +// ppResults[i]->GZLX_ = atof(ppResults[i]->GZLX); +// ppResults[i]->DQJ_ = atof(ppResults[i]->DQJ); +// ppResults[i]->BidPrice1_ = atof(ppResults[i]->BidPrice1); +// ppResults[i]->BidPrice2_ = atof(ppResults[i]->BidPrice2); +// ppResults[i]->BidPrice3_ = atof(ppResults[i]->BidPrice3); +// ppResults[i]->BidPrice4_ = atof(ppResults[i]->BidPrice4); +// ppResults[i]->BidPrice5_ = atof(ppResults[i]->BidPrice5); +// ppResults[i]->AskPrice1_ = atof(ppResults[i]->AskPrice1); +// ppResults[i]->AskPrice2_ = atof(ppResults[i]->AskPrice2); +// ppResults[i]->AskPrice3_ = atof(ppResults[i]->AskPrice3); +// ppResults[i]->AskPrice4_ = atof(ppResults[i]->AskPrice4); +// ppResults[i]->AskPrice5_ = atof(ppResults[i]->AskPrice5); +// ppResults[i]->BidSize1_ = atoi(ppResults[i]->BidSize1); +// ppResults[i]->BidSize2_ = atoi(ppResults[i]->BidSize2); +// ppResults[i]->BidSize3_ = atoi(ppResults[i]->BidSize3); +// ppResults[i]->BidSize4_ = atoi(ppResults[i]->BidSize4); +// ppResults[i]->BidSize5_ = atoi(ppResults[i]->BidSize5); +// ppResults[i]->AskSize1_ = atoi(ppResults[i]->AskSize1); +// ppResults[i]->AskSize2_ = atoi(ppResults[i]->AskSize2); +// ppResults[i]->AskSize3_ = atoi(ppResults[i]->AskSize3); +// ppResults[i]->AskSize4_ = atoi(ppResults[i]->AskSize4); +// ppResults[i]->AskSize5_ = atoi(ppResults[i]->AskSize5); +// +// ppResults[i]->ZXJYGS_ = atoi(ppResults[i]->ZXJYGS); +// ppResults[i]->ZXMRBDJW_ = atof(ppResults[i]->ZXMRBDJW); +// ppResults[i]->ZXMCBDJW_ = atof(ppResults[i]->ZXMCBDJW); +// ppResults[i]->ZTJG_ = atof(ppResults[i]->ZTJG); +// ppResults[i]->DTJG_ = atof(ppResults[i]->DTJG); +// +// ppResults[i]->Client = Client; +// } +//} + +////////////////////////////////////////////////////////////////////////// + +OrderType WTFS_2_OrderType(int In) +{ + switch (In) + { + case WTFS_Limit: + return OrderType::OrderType_Limit; + default: + return OrderType::OrderType_Market; + } +} + +TimeInForce WTFS_2_TimeInForce(int In) +{ + switch (In) + { + case WTFS_Limit: + case WTFS_Best_Reverse: + case WTFS_Best_Forward: + return TimeInForce::TimeInForce_Day; + case WTFS_IOC: + case WTFS_Five_IOC: + return TimeInForce::TimeInForce_IOC; + case WTFS_FOK: + return TimeInForce::TimeInForce_FOK; + case WTFS_Five_Limit: + return TimeInForce::TimeInForce_Day; + default: + return TimeInForce::TimeInForce_Day; + } +} + +OrderStatus ZTSM_2_OrderStatus(int In) +{ + switch (In) + { + case ZTSM_NotSent: + return OrderStatus::OrderStatus_PendingNew; + case ZTSM_New: + return OrderStatus::OrderStatus_New; + case ZTSM_Illegal: + return OrderStatus::OrderStatus_Rejected; + case ZTSM_AllFilled: + return OrderStatus::OrderStatus_Filled; + case ZTSM_AllCancelled: + return OrderStatus::OrderStatus_Cancelled; + case ZTSM_PartiallyFilled: + return OrderStatus::OrderStatus_PartiallyFilled; + case ZTSM_WaitingForReport: + return OrderStatus::OrderStatus_New; + default: + return OrderStatus::OrderStatus_NotSent; + } +} + +ExecType ZTSM_2_ExecType(int In) +{ + switch (In) + { + case ZTSM_NotSent: + return ExecType::ExecType_New; + case ZTSM_New: + return ExecType::ExecType_New; + case ZTSM_Illegal: + return ExecType::ExecType_Rejected; + case ZTSM_AllFilled: + case ZTSM_PartiallyFilled: + return ExecType::ExecType_Trade; + case ZTSM_AllCancelled: + case ZTSM_PartiallyCancelled: + return ExecType::ExecType_Cancelled; + case ZTSM_WaitingForReport: + return ExecType::ExecType_New; + default: + return ExecType::ExecType_New; + } +} + +bool ZTSM_IsDone(int In) +{ + switch (In) + { + case ZTSM_Illegal: + case ZTSM_AllFilled: + case ZTSM_AllCancelled: + case ZTSM_PartiallyCancelled: + return true; + } + return false; +} + +bool ZTSM_IsNotSent(int In) +{ + switch (In) + { + case ZTSM_NotSent: + return true; + } + return false; +} + + +// 将买卖方式转成买卖方向 +OrderSide MMBZ_2_OrderSide(int In) +{ + switch (In / 100) + { + case REQUEST_ETF_SGSH: + switch (In % 100) + { + case JYLX_Creation: + return OrderSide::OrderSide_ETFCreation; + case JYLX_Redemption: + return OrderSide::OrderSide_ETFRedemption; + default: + break; + } + break; + case REQUEST_WT: + switch (In % 100) + { + case MMBZ_Buy_Limit: + return OrderSide::OrderSide_Buy; + case MMBZ_Sell_Limit: + return OrderSide::OrderSide_Sell; + case MMBZ_Buy_Market: + return OrderSide::OrderSide_Buy; + case MMBZ_Sell_Market: + return OrderSide::OrderSide_Sell; + case MMBZ_Creation: + return OrderSide::OrderSide_LOFCreation; + case MMBZ_Redemption: + return OrderSide::OrderSide_LOFRedemption; + case MMBZ_Merge: + return OrderSide::OrderSide_Merge; + case MMBZ_Split: + return OrderSide::OrderSide_Split; + default: + break; + } + break; + case REQUEST_ZGHS: + switch (In % 100) + { + case MMBZ_CB_Conv: + return OrderSide::OrderSide_CBConvert; + case MMBZ_CB_Red: + return OrderSide::OrderSide_CBRedemption; + default: + break; + } + break; + default: + break; + } + + return OrderSide::OrderSide_Unknown; +} + +void CJLB_2_TradeField(CJLB_STRUCT* pIn, TradeField* pOut) +{ + //strcpy(pOut->ID, pIn->WTBH);将会被修正 + strcpy(pOut->InstrumentID, pIn->ZQDM); + strcpy(pOut->InstrumentName, pIn->ZQMC); + strcpy(pOut->AccountID, pIn->GDDM); + pOut->Price = pIn->CJJG_; + pOut->Qty = pIn->CJSL_; + pOut->Date = pIn->CJRQ_; + pOut->Time = pIn->CJSJ_; + pOut->Side = MMBZ_2_OrderSide(pIn->WTLB_); + + strcpy(pOut->TradeID, pIn->CJBH); + + pOut->Commission = pIn->YJ_ + pIn->YHS_ + pIn->GHF_ + pIn->CJF_; + + pOut->OpenClose = pOut->Side % 2 == 0 ? OpenCloseType::OpenCloseType_Open : OpenCloseType::OpenCloseType_Close; + pOut->HedgeFlag = HedgeFlagType::HedgeFlagType_Speculation; + +} + +void WTLB_2_OrderField_0(WTLB_STRUCT* pIn, OrderField* pOut) +{ + //strcpy(pOut->ID, pIn->WTBH);//将会被修正 + strcpy(pOut->OrderID, pIn->WTBH); + strcpy(pOut->InstrumentID, pIn->ZQDM); + strcpy(pOut->InstrumentName, pIn->ZQMC); + strcpy(pOut->AccountID, pIn->GDDM); + pOut->Price = pIn->WTJG_; + pOut->Qty = pIn->WTSL_; + pOut->Date = pIn->WTRQ_; + pOut->Time = pIn->WTSJ_; + // 这个地方怎么会这样 + pOut->Side = MMBZ_2_OrderSide(pIn->WTLB_); + + pOut->Type = WTFS_2_OrderType(pIn->BJFS_); + pOut->TimeInForce = WTFS_2_TimeInForce(pIn->BJFS_); + + pOut->Status = ZTSM_2_OrderStatus(pIn->ZTSM_); + pOut->ExecType = ZTSM_2_ExecType(pIn->ZTSM_); + + pOut->OpenClose = pOut->Side % 2 == 0 ? OpenCloseType::OpenCloseType_Open : OpenCloseType::OpenCloseType_Close; + pOut->HedgeFlag = HedgeFlagType::HedgeFlagType_Speculation; + + strcpy(pOut->AccountID, pIn->GDDM); + + pOut->AvgPx = pIn->CJJG_; + pOut->CumQty = pIn->CJSL_; + pOut->LeavesQty = pIn->WTSL_ - pIn->CJSL_ - pIn->CDSL_; + + strcpy(pOut->Text, pIn->ZTSM); +} + +int OrderType_2_WTFS(OrderType In) +{ + switch (In) + { + case OrderType_Market: + case OrderType_Stop: + case OrderType_MarketOnClose: + case OrderType_TrailingStop: + return WTFS_Five_IOC;// 只推荐使用五档模拟市价 + case OrderType_Limit: + case OrderType_StopLimit: + case OrderType_TrailingStopLimit: + return WTFS_Limit; + case OrderType_Pegged: + default: + return WTFS_Limit; + } +} + + +void OrderField_2_Order_STRUCT(OrderField* pIn, Order_STRUCT* pOut) +{ + strcpy(pOut->KHH, pIn->ClientID); + strcpy(pOut->ZJZH, pIn->ClientID);//通达信模拟上是否会出错? + strcpy(pOut->GDDM, pIn->AccountID); + + strcpy(pOut->ZQDM, pIn->InstrumentID); + pOut->Price = pIn->Price; + pOut->Qty = pIn->Qty; + pOut->WTFS = OrderType_2_WTFS(pIn->Type); + pOut->RZRQBS = RZRQBS_NO; + pOut->requestType = REQUEST_WT; + + // 这个地方后期要再改,因为没有处理基金等情况 + switch (pIn->Side) + { + case OrderSide::OrderSide_Buy: + if (pIn->Type == OrderType::OrderType_Market) + pOut->MMBZ = MMBZ_Buy_Market; + else + pOut->MMBZ = MMBZ_Buy_Limit; + break; + case OrderSide::OrderSide_Sell: + if (pIn->Type == OrderType::OrderType_Market) + pOut->MMBZ = MMBZ_Sell_Market; + else + pOut->MMBZ = MMBZ_Sell_Limit; + break; + case OrderSide::OrderSide_LOFCreation: + pOut->MMBZ = MMBZ_Creation; + break; + case OrderSide::OrderSide_LOFRedemption: + pOut->MMBZ = MMBZ_Redemption; + break; + case OrderSide::OrderSide_ETFCreation: + pOut->MMBZ = JYLX_Creation; + pOut->requestType = REQUEST_ETF_SGSH; + break; + case OrderSide::OrderSide_ETFRedemption: + pOut->MMBZ = JYLX_Redemption; + pOut->requestType = REQUEST_ETF_SGSH; + break; + case OrderSide::OrderSide_Merge: + pOut->MMBZ = MMBZ_Merge; + break; + case OrderSide::OrderSide_Split: + pOut->MMBZ = MMBZ_Split; + break; + case OrderSide::OrderSide_CBConvert: + pOut->MMBZ = MMBZ_CB_Conv; + pOut->requestType = REQUEST_ZGHS; + break; + case OrderSide::OrderSide_CBRedemption: + pOut->MMBZ = MMBZ_CB_Red; + pOut->requestType = REQUEST_ZGHS; + break; + } +} + +void GDLB_2_InvestorField(GDLB_STRUCT* pIn, InvestorField* pOut) +{ + strcpy(pOut->InvestorID, pIn->GDDM); + strcpy(pOut->InvestorName, pIn->GDMC); +} + +void ZJYE_2_AccountField(ZJYE_STRUCT* pIn, AccountField* pOut) +{ + strcpy(pOut->AccountID, pIn->ZJZH); + //strcpy(pOut->ClientID, pIn->ZJZH); + + pOut->Available = pIn->KYZJ_; + + // 还有很多不知道如何对应,有可能需要扩展XAPI部分 + pOut->Balance = pIn->ZZC_; + +} + +void GFLB_2_PositionField(GFLB_STRUCT* pIn, PositionField* pOut) +{ + pOut->Side = PositionSide::PositionSide_Long; + pOut->Position = pIn->ZQSL_; + pOut->TodayPosition = pIn->DJSL_; + pOut->HistoryPosition = pIn->KMSL_; + pOut->HedgeFlag = HedgeFlagType::HedgeFlagType_Speculation; + strcpy(pOut->InstrumentName, pIn->ZQMC); + strcpy(pOut->InstrumentID, pIn->ZQDM); + strcpy(pOut->Symbol, pIn->ZQDM); + strcpy(pOut->AccountID, pIn->GDDM); + strcpy(pOut->ExchangeID, pIn->JYSDM); + + + sprintf(pOut->ID, "%s:%s:%d:%d", + pOut->InstrumentID, pOut->ExchangeID, + pOut->Side, pOut->HedgeFlag); +} \ No newline at end of file diff --git a/apis/Tdx_Trade/TypeConvert.h b/apis/Tdx_Trade/TypeConvert.h new file mode 100644 index 0000000..8b1f102 --- /dev/null +++ b/apis/Tdx_Trade/TypeConvert.h @@ -0,0 +1,40 @@ +#pragma once + +#include "../../include/ApiStruct.h" + +#include "../../include/Tdx/tdx_struct.h" + +// 两种情况: +// 1.完全重建 +// 2.部分重建 + +// 隐藏大Bug,谁建谁删 +class CMsgQueue; + +void CharTable2WTLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, WTLB_STRUCT*** pppResults, void* Client, CMsgQueue* pQueue); + +void CharTable2CJLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, CJLB_STRUCT*** pppResults, void* Client, CMsgQueue* pQueue); + +void CharTable2GFLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GFLB_STRUCT*** pppResults, void* Client, CMsgQueue* pQueue); + +void CharTable2ZJYE(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, ZJYE_STRUCT*** pppResults, void* Client, CMsgQueue* pQueue); + +// void CharTable2HQ(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, HQ_STRUCT*** pppResults, void* Client, CMsgQueue* pQueue); + +////////////////////////////////////////////////////////////////////////// + + +bool ZTSM_IsDone(int In); +bool ZTSM_IsNotSent(int In); + +void GDLB_2_InvestorField(GDLB_STRUCT* pIn, InvestorField* pOut); +void ZJYE_2_AccountField(ZJYE_STRUCT* pIn, AccountField* pOut); +void GFLB_2_PositionField(GFLB_STRUCT* pIn, PositionField* pOut); + +void CJLB_2_TradeField(CJLB_STRUCT* pIn, TradeField* pOut); + +// +void WTLB_2_OrderField_0(WTLB_STRUCT* pIn, OrderField* pOut); +//void WTLB_2_OrderField_1(WTLB_STRUCT* pIn, OrderField* pOut); + +void OrderField_2_Order_STRUCT(OrderField* pIn, Order_STRUCT* pOut); diff --git a/apis/Tdx_Trade/dllmain.cpp b/apis/Tdx_Trade/dllmain.cpp new file mode 100644 index 0000000..69b5891 --- /dev/null +++ b/apis/Tdx_Trade/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/QuantBox_Tdx_Trade/main.cpp b/apis/Tdx_Trade/main.cpp similarity index 60% rename from QuantBox_Tdx_Trade/main.cpp rename to apis/Tdx_Trade/main.cpp index bba8b4e..b3f29aa 100644 --- a/QuantBox_Tdx_Trade/main.cpp +++ b/apis/Tdx_Trade/main.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../include/ApiHeader.h" -#include "../include/QueueEnum.h" +#include "../../include/ApiHeader.h" +#include "../../include/QueueEnum.h" #include "TraderApi.h" inline CTraderApi* GetApi(void* pApi) @@ -13,13 +13,13 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do RequestType rt = (RequestType)type; switch (rt) { - case GetApiType: + case RequestType_GetApiTypes: return (void*)(ApiType::ApiType_Trade | ApiType::ApiType_MarketData | ApiType::ApiType_Query); - case GetApiVersion: - return (void*)"0.2.0.20151124"; - case GetApiName: + case RequestType_GetApiVersion: + return (void*)"0.4.0.20161026"; + case RequestType_GetApiName: return (void*)"Tdx"; - case Create: + case RequestType_Create: return new CTraderApi(); default: break; @@ -34,41 +34,33 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do switch (rt) { - case Release: + case RequestType_Release: delete pApi; return nullptr; - case Register: + case RequestType_Register: pApi->Register(ptr1, ptr2); break; - case Connect: + case RequestType_Connect: pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2,size2); break; - case Disconnect: + case RequestType_Disconnect: pApi->Disconnect(); break; - case ReqQryOrder: - case ReqQryTrade: - case ReqQryInvestorPosition: - case ReqQryTradingAccount: - case ReqQryInvestor: + case QueryType_ReqQryOrder: + case QueryType_ReqQryTrade: + case QueryType_ReqQryInvestorPosition: + case QueryType_ReqQryTradingAccount: + case QueryType_ReqQryInvestor: + // ⲿõIJѯ pApi->ReqQuery((QueryType)type, (ReqQueryField*)ptr1); break; - /*case ReqQryInstrument: - pApi->ReqQryInstrument((const char*)ptr1, (const char*)ptr2); - break; - case ReqQrySettlementInfo: - pApi->ReqQrySettlementInfo((const char*)ptr1); - break;*/ - case ReqOrderInsert: - return (void*)pApi->ReqOrderInsert((OrderField*)ptr1, size1, (OrderIDType*)ptr2); - case ReqOrderAction: - return (void*)pApi->ReqOrderAction((OrderIDType*)ptr1, size1, (OrderIDType*)ptr2); - case Subscribe: + case RequestType_ReqOrderInsert: + return (void*)pApi->ReqOrderInsert((OrderField*)ptr1, size1, (char*)ptr2); + case RequestType_ReqOrderAction: + return (void*)pApi->ReqOrderAction((OrderIDType*)ptr1, size1, (char*)ptr2); + case RequestType_Subscribe: pApi->Subscribe((const char*)ptr1, (const char*)ptr2); break; - //case Unsubscribe: - // pApi->Unsubscribe((const char*)ptr1, (const char*)ptr2); - // break; default: break; } diff --git a/apis/Tdx_Trade/stdafx.cpp b/apis/Tdx_Trade/stdafx.cpp new file mode 100644 index 0000000..59b3c80 --- /dev/null +++ b/apis/Tdx_Trade/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// Tdx_Trade.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/apis/Tdx_Trade/stdafx.h b/apis/Tdx_Trade/stdafx.h new file mode 100644 index 0000000..f3a0737 --- /dev/null +++ b/apis/Tdx_Trade/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here diff --git a/apis/Tdx_Trade/targetver.h b/apis/Tdx_Trade/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/apis/Tdx_Trade/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/QuantBox_TongShi_Quote/DialogStockDrv.cpp b/apis/TongShi_Quote/DialogStockDrv.cpp similarity index 97% rename from QuantBox_TongShi_Quote/DialogStockDrv.cpp rename to apis/TongShi_Quote/DialogStockDrv.cpp index 9f3f4b3..ed7961e 100644 --- a/QuantBox_TongShi_Quote/DialogStockDrv.cpp +++ b/apis/TongShi_Quote/DialogStockDrv.cpp @@ -2,7 +2,7 @@ // #include "stdafx.h" -#include "QuantBox_TongShi_Quote.h" +#include "TongShi_Quote.h" #include "DialogStockDrv.h" #include "afxdialogex.h" diff --git a/QuantBox_TongShi_Quote/DialogStockDrv.h b/apis/TongShi_Quote/DialogStockDrv.h similarity index 100% rename from QuantBox_TongShi_Quote/DialogStockDrv.h rename to apis/TongShi_Quote/DialogStockDrv.h diff --git a/QuantBox_TongShi_Quote/MdUserApi.cpp b/apis/TongShi_Quote/MdUserApi.cpp similarity index 85% rename from QuantBox_TongShi_Quote/MdUserApi.cpp rename to apis/TongShi_Quote/MdUserApi.cpp index f6beb42..0886fff 100644 --- a/QuantBox_TongShi_Quote/MdUserApi.cpp +++ b/apis/TongShi_Quote/MdUserApi.cpp @@ -1,18 +1,18 @@ #include "stdafx.h" #include "MdUserApi.h" -#include "../include/QueueEnum.h" +#include "../../include/QueueEnum.h" -#include "../include/ApiHeader.h" -#include "../include/ApiStruct.h" +#include "../../include/ApiHeader.h" +#include "../../include/ApiStruct.h" -#include "../include/toolkit.h" -#include "../include/ApiProcess.h" +#include "../../include/toolkit.h" +#include "../../include/ApiProcess.h" -#include "../QuantBox_Queue/MsgQueue.h" +#include "../../common/Queue/MsgQueue.h" -#include "../include/XApiC.h" +#include "../../include/XApiC.h" -#include "../include/ChinaStock.h" +#include "../../include/ChinaStock.h" #include "TypeConvert.h" #include @@ -197,7 +197,7 @@ void CMdUserApi::InitDriver(HWND hWnd, UINT Msg) pField->RawErrorID = GetLastError(); strncpy(pField->Text, X_GetLastError(), sizeof(Char256Type)); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); return; } @@ -210,12 +210,12 @@ void CMdUserApi::InitDriver(HWND hWnd, UINT Msg) pField->RawErrorID = GetLastError(); strncpy(pField->Text, X_GetLastError(), sizeof(Char256Type)); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); return; } - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); m_nInited = m_pfnStock_Init(hWnd, Msg, RCV_WORK_REQUEST);// RCV_WORK_SENDMSG); m_hWnd = hWnd; @@ -269,7 +269,7 @@ void CMdUserApi::Disconnect() if (m_msgQueue) { m_msgQueue->Clear(); - m_msgQueue->Input_NoCopy(ResponeType::OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); // 主动触发 m_msgQueue->Process(); } @@ -306,8 +306,8 @@ void CMdUserApi::OnRspQryInstrument(DepthMarketDataNField* _pField,RCV_REPORT_ST pField->PriceTick = InstrumentID_2_PriceTick_SSE(instrumentInt); break; case SZ_MARKET_EX: - pField->Type = InstrumentID_2_InstrumentType_SZE(instrumentInt); - pField->PriceTick = InstrumentID_2_PriceTick_SZE(instrumentInt); + pField->Type = InstrumentID_2_InstrumentType_SZSE(instrumentInt); + pField->PriceTick = InstrumentID_2_PriceTick_SZSE(instrumentInt); break; case SB_MARKET_EX: pField->Type = InstrumentID_2_InstrumentType_NEEQ(instrumentInt); @@ -317,14 +317,14 @@ void CMdUserApi::OnRspQryInstrument(DepthMarketDataNField* _pField,RCV_REPORT_ST break; } - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInstrument, m_msgQueue, m_pClass, index >= Count - 1, 0, pField, sizeof(InstrumentField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRspQryInstrument, m_msgQueue, m_pClass, index >= Count - 1, 0, pField, sizeof(InstrumentField), nullptr, 0, nullptr, 0); } bool CMdUserApi::FilterExchangeInstrument(WORD wMarket, int instrument) { // 行情太多,需要过滤 - return (bool)m_msgQueue->Input_Output(ResponeType::OnFilterSubscribe, m_msgQueue, m_pClass, Market_2_ExchangeType(wMarket), 0, nullptr, instrument, nullptr, 0, nullptr, 0); + return (bool)m_msgQueue->Input_Output(ResponseType::ResponseType_OnFilterSubscribe, m_msgQueue, m_pClass, Market_2_ExchangeType(wMarket), 0, nullptr, instrument, nullptr, 0, nullptr, 0); } //行情回调,得保证此函数尽快返回 @@ -414,7 +414,7 @@ void CMdUserApi::OnRtnDepthMarketData(RCV_REPORT_STRUCTEx *pDepthMarketData, int AddAsk(pField, my_round(pDepthMarketData->m_fSellPrice5), pDepthMarketData->m_fSellVolume5 * nLots, 0); } while (false); - m_msgQueue->Input_NoCopy(ResponeType::OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); } void CMdUserApi::StartThread() diff --git a/QuantBox_TongShi_Quote/MdUserApi.h b/apis/TongShi_Quote/MdUserApi.h similarity index 91% rename from QuantBox_TongShi_Quote/MdUserApi.h rename to apis/TongShi_Quote/MdUserApi.h index 9555c92..6224ca4 100644 --- a/QuantBox_TongShi_Quote/MdUserApi.h +++ b/apis/TongShi_Quote/MdUserApi.h @@ -2,16 +2,25 @@ #ifndef _USE_32BIT_TIME_T #define _USE_32BIT_TIME_T #endif -#include "../include/ApiStruct.h" +#include "../../include/ApiStruct.h" +#include "../../include/QueueHeader.h" #include #include "Stockdrv.h" -#include "../include/QueueHeader.h" + #ifdef _WIN64 -#pragma comment(lib, "../lib/QuantBox_Queue_x64.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif #else -#pragma comment(lib, "../lib/QuantBox_Queue_x86.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif #endif #include @@ -56,11 +65,11 @@ class CMdUserApi void InitDriver(HWND hWnd, UINT Msg); void QuitDriver(); - //void Subscribe(const string& szInstrumentIDs, const string& szExchageID); - //void Unsubscribe(const string& szInstrumentIDs, const string& szExchageID); + //void Subscribe(const string& szInstrumentIDs, const string& szExchangeID); + //void Unsubscribe(const string& szInstrumentIDs, const string& szExchangeID); - //void SubscribeQuote(const string& szInstrumentIDs, const string& szExchageID); - //void UnsubscribeQuote(const string& szInstrumentIDs, const string& szExchageID); + //void SubscribeQuote(const string& szInstrumentIDs, const string& szExchangeID); + //void UnsubscribeQuote(const string& szInstrumentIDs, const string& szExchangeID); private: bool FilterExchangeInstrument(WORD wMarket, int instrument); @@ -84,8 +93,8 @@ class CMdUserApi //int _ReqUserLogin(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); // - void Subscribe(const set& instrumentIDs, const string& szExchageID); - void SubscribeQuote(const set& instrumentIDs, const string& szExchageID); + void Subscribe(const set& instrumentIDs, const string& szExchangeID); + void SubscribeQuote(const set& instrumentIDs, const string& szExchangeID); //virtual void OnFrontConnected(); //virtual void OnFrontDisconnected(int nReason); diff --git a/QuantBox_TongShi_Quote/ReadMe.txt b/apis/TongShi_Quote/ReadMe.txt similarity index 78% rename from QuantBox_TongShi_Quote/ReadMe.txt rename to apis/TongShi_Quote/ReadMe.txt index 5496323..69ee960 100644 --- a/QuantBox_TongShi_Quote/ReadMe.txt +++ b/apis/TongShi_Quote/ReadMe.txt @@ -1,47 +1,47 @@ ======================================================================== - MICROSOFT FOUNDATION CLASS LIBRARY : QuantBox_TongShi_Quote Project Overview + MICROSOFT FOUNDATION CLASS LIBRARY : TongShi_Quote Project Overview ======================================================================== -AppWizard has created this QuantBox_TongShi_Quote DLL for you. This DLL not only +AppWizard has created this TongShi_Quote DLL for you. This DLL not only demonstrates the basics of using the Microsoft Foundation classes but is also a starting point for writing your DLL. This file contains a summary of what you will find in each of the files that -make up your QuantBox_TongShi_Quote DLL. +make up your TongShi_Quote DLL. -QuantBox_TongShi_Quote.vcxproj +TongShi_Quote.vcxproj This is the main project file for VC++ projects generated using an Application Wizard. It contains information about the version of Visual C++ that generated the file, and information about the platforms, configurations, and project features selected with the Application Wizard. -QuantBox_TongShi_Quote.vcxproj.filters +TongShi_Quote.vcxproj.filters This is the filters file for VC++ projects generated using an Application Wizard. It contains information about the association between the files in your project and the filters. This association is used in the IDE to show grouping of files with similar extensions under a specific node (for e.g. ".cpp" files are associated with the "Source Files" filter). -QuantBox_TongShi_Quote.h +TongShi_Quote.h This is the main header file for the DLL. It declares the - CQuantBox_TongShi_QuoteApp class. + CTongShi_QuoteApp class. -QuantBox_TongShi_Quote.cpp - This is the main DLL source file. It contains the class CQuantBox_TongShi_QuoteApp. +TongShi_Quote.cpp + This is the main DLL source file. It contains the class CTongShi_QuoteApp. -QuantBox_TongShi_Quote.rc +TongShi_Quote.rc This is a listing of all of the Microsoft Windows resources that the program uses. It includes the icons, bitmaps, and cursors that are stored in the RES subdirectory. This file can be directly edited in Microsoft Visual C++. -res\QuantBox_TongShi_Quote.rc2 +res\TongShi_Quote.rc2 This file contains resources that are not edited by Microsoft Visual C++. You should place all resources not editable by the resource editor in this file. -QuantBox_TongShi_Quote.def +TongShi_Quote.def This file contains information about the DLL that must be provided to run with Microsoft Windows. It defines parameters such as the name and description of the DLL. It also exports @@ -52,7 +52,7 @@ Other standard files: StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file - named QuantBox_TongShi_Quote.pch and a precompiled types file named StdAfx.obj. + named TongShi_Quote.pch and a precompiled types file named StdAfx.obj. Resource.h This is the standard header file, which defines new resource IDs. diff --git a/QuantBox_TongShi_Quote/Stockdrv.h b/apis/TongShi_Quote/Stockdrv.h similarity index 100% rename from QuantBox_TongShi_Quote/Stockdrv.h rename to apis/TongShi_Quote/Stockdrv.h diff --git a/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.cpp b/apis/TongShi_Quote/TongShi_Quote.cpp similarity index 67% rename from QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.cpp rename to apis/TongShi_Quote/TongShi_Quote.cpp index cd93770..a7f82d6 100644 --- a/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.cpp +++ b/apis/TongShi_Quote/TongShi_Quote.cpp @@ -1,8 +1,8 @@ -// QuantBox_TongShi_Quote.cpp : Defines the initialization routines for the DLL. +// TongShi_Quote.cpp : Defines the initialization routines for the DLL. // #include "stdafx.h" -#include "QuantBox_TongShi_Quote.h" +#include "TongShi_Quote.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -33,29 +33,29 @@ // details. // -// CQuantBox_TongShi_QuoteApp +// CTongShi_QuoteApp -BEGIN_MESSAGE_MAP(CQuantBox_TongShi_QuoteApp, CWinApp) +BEGIN_MESSAGE_MAP(CTongShi_QuoteApp, CWinApp) END_MESSAGE_MAP() -// CQuantBox_TongShi_QuoteApp construction +// CTongShi_QuoteApp construction -CQuantBox_TongShi_QuoteApp::CQuantBox_TongShi_QuoteApp() +CTongShi_QuoteApp::CTongShi_QuoteApp() { // TODO: add construction code here, // Place all significant initialization in InitInstance } -// The one and only CQuantBox_TongShi_QuoteApp object +// The one and only CTongShi_QuoteApp object -CQuantBox_TongShi_QuoteApp theApp; +CTongShi_QuoteApp theApp; -// CQuantBox_TongShi_QuoteApp initialization +// CTongShi_QuoteApp initialization -BOOL CQuantBox_TongShi_QuoteApp::InitInstance() +BOOL CTongShi_QuoteApp::InitInstance() { CWinApp::InitInstance(); diff --git a/apis/TongShi_Quote/TongShi_Quote.h b/apis/TongShi_Quote/TongShi_Quote.h new file mode 100644 index 0000000..5e755ee --- /dev/null +++ b/apis/TongShi_Quote/TongShi_Quote.h @@ -0,0 +1,26 @@ +// TongShi_Quote.h : main header file for the TongShi_Quote DLL +// + +#pragma once + +#ifndef __AFXWIN_H__ + #error "include 'stdafx.h' before including this file for PCH" +#endif + +#include "resource.h" // main symbols + +// CTongShi_QuoteApp +// See TongShi_Quote.cpp for the implementation of this class +// + +class CTongShi_QuoteApp : public CWinApp +{ +public: + CTongShi_QuoteApp(); + +// Overrides +public: + virtual BOOL InitInstance(); + + DECLARE_MESSAGE_MAP() +}; diff --git a/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.rc b/apis/TongShi_Quote/TongShi_Quote.rc similarity index 93% rename from QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.rc rename to apis/TongShi_Quote/TongShi_Quote.rc index cbe176c..9f276cd 100644 Binary files a/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.rc and b/apis/TongShi_Quote/TongShi_Quote.rc differ diff --git a/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.vcxproj b/apis/TongShi_Quote/TongShi_Quote.vcxproj similarity index 80% rename from QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.vcxproj rename to apis/TongShi_Quote/TongShi_Quote.vcxproj index ba0ee99..41e4cfd 100644 --- a/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.vcxproj +++ b/apis/TongShi_Quote/TongShi_Quote.vcxproj @@ -12,21 +12,21 @@ {372C0D5E-ED93-4335-849C-65494AE8A17D} - QuantBox_TongShi_Quote + TongShi_Quote MFCDLLProj DynamicLibrary true - v120 + v140 Unicode Dynamic DynamicLibrary false - v120 + v140 true Unicode Dynamic @@ -43,10 +43,13 @@ true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\TongShi\x86 + ..\..\bin\$(Configuration)\$(PlatformTarget)\TongShi + $(ProjectName)_$(PlatformTarget) false + ..\..\bin\$(Configuration)\$(PlatformTarget)\TongShi + $(ProjectName)_$(PlatformTarget) @@ -59,7 +62,7 @@ Windows true - ..\include\ApiHeader.def + ../../include/ApiHeader.def false @@ -71,7 +74,8 @@ $(IntDir);%(AdditionalIncludeDirectories) - xcopy "$(TargetPath)" "$(SolutionDir)XAPI\TongShi\x86\" /Y + + @@ -81,7 +85,7 @@ MaxSpeed true true - WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) + WIN32;_WINDOWS;NDEBUG;_USRDLL;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -89,7 +93,7 @@ true true true - .\QuantBox_TongShi_Quote.def + ../../include/ApiHeader.def false @@ -105,45 +109,42 @@ - - - - + + + + - Create Create + - - - + + + - + - - - - + - + \ No newline at end of file diff --git a/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.vcxproj.filters b/apis/TongShi_Quote/TongShi_Quote.vcxproj.filters similarity index 80% rename from QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.vcxproj.filters rename to apis/TongShi_Quote/TongShi_Quote.vcxproj.filters index 28d4929..a834d48 100644 --- a/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.vcxproj.filters +++ b/apis/TongShi_Quote/TongShi_Quote.vcxproj.filters @@ -18,9 +18,6 @@ - - Source Files - Source Files @@ -33,26 +30,26 @@ Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + + Source Files + + Source Files - - Header Files - Header Files @@ -71,26 +68,24 @@ Header Files - + Header Files - + Header Files - + Header Files - + + Header Files + + Header Files - - Resource Files - - - - + Resource Files diff --git a/QuantBox_TongShi_Quote/TypeConvert.cpp b/apis/TongShi_Quote/TypeConvert.cpp similarity index 98% rename from QuantBox_TongShi_Quote/TypeConvert.cpp rename to apis/TongShi_Quote/TypeConvert.cpp index b24b895..2534d1b 100644 --- a/QuantBox_TongShi_Quote/TypeConvert.cpp +++ b/apis/TongShi_Quote/TypeConvert.cpp @@ -25,7 +25,7 @@ char* Market_2_ExchangeID(WORD In) case SH_MARKET_EX: return "SSE"; case SZ_MARKET_EX: - return "SZE"; + return "SZSE"; case HK_MARKET_EX: return "HKEx"; case EB_MARKET_EX: diff --git a/QuantBox_TongShi_Quote/TypeConvert.h b/apis/TongShi_Quote/TypeConvert.h similarity index 83% rename from QuantBox_TongShi_Quote/TypeConvert.h rename to apis/TongShi_Quote/TypeConvert.h index f4e48a8..5665ea3 100644 --- a/QuantBox_TongShi_Quote/TypeConvert.h +++ b/apis/TongShi_Quote/TypeConvert.h @@ -2,7 +2,7 @@ #include #include "Stockdrv.h" -#include "../include/ApiStruct.h" +#include "../../include/ApiStruct.h" ExchangeType Market_2_ExchangeType(WORD In); char* Market_2_ExchangeID(WORD In); diff --git a/QuantBox_TongShi_Quote/main.cpp b/apis/TongShi_Quote/main.cpp similarity index 79% rename from QuantBox_TongShi_Quote/main.cpp rename to apis/TongShi_Quote/main.cpp index ecfbbdf..3f3aa80 100644 --- a/QuantBox_TongShi_Quote/main.cpp +++ b/apis/TongShi_Quote/main.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" -#include "../include/ApiHeader.h" - -#include "../include/QueueEnum.h" +#include "../../include/ApiHeader.h" +#include "../../include/QueueEnum.h" #include "MdUserApi.h" inline CMdUserApi* GetApi(void* pApi) @@ -14,13 +13,13 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do RequestType rt = (RequestType)type; switch (rt) { - case GetApiType: + case RequestType_GetApiTypes: return (void*)(ApiType::ApiType_MarketData | ApiType::ApiType_Instrument); - case GetApiVersion: + case RequestType_GetApiVersion: return (void*)"0.2.0.20150419"; - case GetApiName: + case RequestType_GetApiName: return (void*)"TongShi"; - case Create: + case RequestType_Create: return new CMdUserApi(); default: break; @@ -35,18 +34,18 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do switch (rt) { - case Release: + case RequestType_Release: delete pApi; return 0; - case Register: + case RequestType_Register: pApi->Register(ptr1,ptr2); break; - case Config: + case RequestType_Config: return (void*)pApi->Config((ConfigInfoField*)ptr1); - case Connect: + case RequestType_Connect: pApi->Connect((const char*)ptr3, (ServerInfoField*)ptr1, (UserInfoField*)ptr2,size2); break; - case Disconnect: + case RequestType_Disconnect: pApi->Disconnect(); break; //case Subscribe: diff --git a/QuantBox_TongShi_Quote/res/QuantBox_TongShi_Quote.rc2 b/apis/TongShi_Quote/res/TongShi_Quote.rc2 similarity index 100% rename from QuantBox_TongShi_Quote/res/QuantBox_TongShi_Quote.rc2 rename to apis/TongShi_Quote/res/TongShi_Quote.rc2 diff --git a/QuantBox_TongShi_Quote/resource.h b/apis/TongShi_Quote/resource.h similarity index 91% rename from QuantBox_TongShi_Quote/resource.h rename to apis/TongShi_Quote/resource.h index 66f6deb..1078804 100644 Binary files a/QuantBox_TongShi_Quote/resource.h and b/apis/TongShi_Quote/resource.h differ diff --git a/QuantBox_TongShi_Quote/stdafx.cpp b/apis/TongShi_Quote/stdafx.cpp similarity index 71% rename from QuantBox_TongShi_Quote/stdafx.cpp rename to apis/TongShi_Quote/stdafx.cpp index 90a86cb..583973f 100644 --- a/QuantBox_TongShi_Quote/stdafx.cpp +++ b/apis/TongShi_Quote/stdafx.cpp @@ -1,5 +1,5 @@ // stdafx.cpp : source file that includes just the standard includes -// QuantBox_TongShi_Quote.pch will be the pre-compiled header +// TongShi_Quote.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" diff --git a/QuantBox_TongShi_Quote/stdafx.h b/apis/TongShi_Quote/stdafx.h similarity index 100% rename from QuantBox_TongShi_Quote/stdafx.h rename to apis/TongShi_Quote/stdafx.h diff --git a/apis/TongShi_Quote/targetver.h b/apis/TongShi_Quote/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/apis/TongShi_Quote/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/QuantBox_XAPI/QuantBox_XAPI.vcxproj b/apis/UFX_Trade/UFX_Trade.vcxproj similarity index 81% rename from QuantBox_XAPI/QuantBox_XAPI.vcxproj rename to apis/UFX_Trade/UFX_Trade.vcxproj index 4057688..0e07414 100644 --- a/QuantBox_XAPI/QuantBox_XAPI.vcxproj +++ b/apis/UFX_Trade/UFX_Trade.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -11,21 +11,21 @@ - {39599EFE-428F-408F-BF4F-BF462E37C5E8} + {26C43947-9E7A-4B55-8A6D-A0F5222612AA} Win32Proj - QuantBox_XAPI + UFX_Trade DynamicLibrary true - v120 + v140 Unicode DynamicLibrary false - v120 + v140 true Unicode @@ -41,6 +41,8 @@ true + $(ProjectName)_$(PlatformTarget) + ..\..\bin\$(Configuration)\$(PlatformTarget)\UFX false @@ -50,17 +52,13 @@ Use Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_XAPI_EXPORTS;_CRT_SECURE_NO_WARNINGS;BUILDING_DLL;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;UFX_TRADE_EXPORTS;%(PreprocessorDefinitions) true Windows true - ..\include\XApiC.def - - xcopy "$(TargetPath)" "$(SolutionDir)XAPI\" /Y - @@ -69,7 +67,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTBOX_XAPI_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;UFX_TRADE_EXPORTS;%(PreprocessorDefinitions) true @@ -83,11 +81,9 @@ - - - + @@ -98,13 +94,13 @@ + Create Create - - - + + diff --git a/apis/UFX_Trade/UFX_Trade.vcxproj.filters b/apis/UFX_Trade/UFX_Trade.vcxproj.filters new file mode 100644 index 0000000..f268f62 --- /dev/null +++ b/apis/UFX_Trade/UFX_Trade.vcxproj.filters @@ -0,0 +1,48 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/apis/Wind_Quote/MdUserApi.cpp b/apis/Wind_Quote/MdUserApi.cpp new file mode 100644 index 0000000..a5d5f86 --- /dev/null +++ b/apis/Wind_Quote/MdUserApi.cpp @@ -0,0 +1,433 @@ +#include "stdafx.h" +#include "MdUserApi.h" +#include "../../include/QueueEnum.h" +#include "../../include/QueueHeader.h" + +#include "../../include/ApiHeader.h" +#include "../../include/ApiStruct.h" + +#include "../../include/toolkit.h" +#include "../../include/ApiProcess.h" + +#include "../../common/Queue/MsgQueue.h" +#ifdef _REMOTE +#include "../../common/Queue/RemoteQueue.h" +#endif + + + +#include +#include +#include +#include +#include +#include + +using namespace std; + +int Today(int day) +{ + time_t now = time(0); + now += day * 86400; + struct tm *ptmNow = localtime(&now); + + return (ptmNow->tm_year + 1900) * 10000 + + (ptmNow->tm_mon + 1) * 100 + + ptmNow->tm_mday; +} + +void WindGetErrorMessage(LONG errCode, char* buffer, int bufferSize){ + WCHAR errMsg[1024] = { 0 }; + int msgLength = sizeof errMsg; + CWAPIWrapperCpp::getErrorMsg(errCode, eCHN, errMsg, msgLength); + auto strLen = wcslen(errMsg) + 1; + char* str = new char[strLen]; + size_t converted; + wcstombs_s(&converted, str, strLen, errMsg, _TRUNCATE); + strcpy_s(buffer, bufferSize, str); + delete[] str; +} + +void* __stdcall Query(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + // ڲãüǷΪ + CMdUserApi* pApi = (CMdUserApi*)pApi2; + pApi->QueryInThread(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + return nullptr; +} + +CMdUserApi::CMdUserApi(void) +{ + pThis = this; + + m_CoInitialized = false; + // ԼάϢ + m_msgQueue = new CMsgQueue(); + m_msgQueue_Query = new CMsgQueue(); + + m_msgQueue_Query->Register((void*)Query, this); + m_msgQueue_Query->StartThread(); +} + +CMdUserApi::~CMdUserApi(void) +{ + Disconnect(); +} + +void CMdUserApi::QueryInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + int iRet = 0; + switch (type) + { + case Start: + WindStart(); + break; + case Stop: + WindStop(); + break; + case QueryInstrument: + WindQryInstrument(); + break; + default: + break; + } + + this_thread::sleep_for(chrono::milliseconds(1)); +} + +void CMdUserApi::Register(void* pCallback, void* pClass) +{ + m_pClass = pClass; + if (m_msgQueue == nullptr) + return; + + m_msgQueue_Query->Register((void*)Query, this); + m_msgQueue->Register(pCallback, this); + if (pCallback) + { + m_msgQueue_Query->StartThread(); + m_msgQueue->StartThread(); + } + else + { + m_msgQueue_Query->StopThread(); + m_msgQueue->StopThread(); + } +} + +void CMdUserApi::Connect() +{ + m_msgQueue_Query->Input_NoCopy(RequestType::Start, m_msgQueue_Query, this, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); +} + +void CMdUserApi::WindStart() +{ + // ֻΪ˵ԣԺҪر + AllocConsole(); + freopen("CON", "r", stdin); + freopen("CON", "w", stdout); + freopen("CON", "w", stderr); + ::DeleteMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE, MF_BYCOMMAND); + + if (!m_CoInitialized){ + CoInitialize(nullptr); + m_CoInitialized = true; + } + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); + + auto errCode = CWAPIWrapperCpp::start(); + if (errCode == 0){ + //m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } + else{ + RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + pField->RawErrorID = errCode; + WindGetErrorMessage(errCode, pField->Text, sizeof pField->Text); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } +} + +void CMdUserApi::WindStop() +{ + if (WindConnected()){ + // ȡ + CWAPIWrapperCpp::cancelRequest(0); + + CWAPIWrapperCpp::stop(); + // ȫֻһ + m_msgQueue->Clear(); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); + // + m_msgQueue->Process(); + } + + if (m_CoInitialized){ + CoUninitialize(); + m_CoInitialized = false; + } + + SetEvent(m_ExitEvent); +} + +bool CMdUserApi::WindConnected() +{ + return CWAPIWrapperCpp::isconnected(); +} + +void CMdUserApi::WindQryInstrument() +{ + WindData wd; + WCHAR options[1024]; + _snwprintf_s(options, sizeof options, _TRUNCATE, L"date=%d;sectorId=a001010100000000;field=wind_code,sec_name", Today(0)); + auto errCode = CWAPIWrapperCpp::wset(wd, L"SectorConstituent", options); + if (errCode != 0){ + ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); + pField->RawErrorID = errCode; + strcpy_s(pField->Source, sizeof pField->Source, "WindQryInstrument"); + WindGetErrorMessage(errCode, pField->Text, sizeof pField->Text); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, 0, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + return; + } + +} + +void CMdUserApi::Disconnect() +{ + // ѯ + if (m_msgQueue_Query) + { + m_ExitEvent = CreateEvent(nullptr, true, false, nullptr); + m_msgQueue_Query->Input_NoCopy(RequestType::Stop, m_msgQueue_Query, this, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); + WaitForSingleObject(m_ExitEvent, INFINITE); + m_msgQueue_Query->StopThread(); + m_msgQueue_Query->Register(nullptr, nullptr); + m_msgQueue_Query->Clear(); + delete m_msgQueue_Query; + m_msgQueue_Query = nullptr; + } + + // Ӧ + if (m_msgQueue) + { + m_msgQueue->StopThread(); + m_msgQueue->Register(nullptr, nullptr); + m_msgQueue->Clear(); + delete m_msgQueue; + m_msgQueue = nullptr; + } +} + +CMdUserApi* CMdUserApi::pThis = nullptr; + +LONG WINAPI WindCallback(ULONGLONG reqId, const WindData &wd) +{ + //wsqĻص,ݴڲwdУԶз + + return CMdUserApi::pThis->_WindCallback(reqId, wd); +} + +struct MyWindWsq +{ + double rt_date; + double rt_time; + double rt_last; + double rt_vol; + double rt_oi; + double rt_bid1; + double rt_ask1; + double rt_bsize1; + double rt_asize1; +}; + +string toString(const LPVARIANT data) +{ + string msg; + switch (data->vt & VT_BSTR_BLOB) + { + /*case VT_I4: + msg(_T("%d"), data->intVal); + break; + case VT_I8: + msg.Format(_T("%I64d"), data->llVal); + break; + case VT_R8: + msg.Format(_T("%f"), data->dblVal); + break; + case VT_EMPTY: + msg = _T("NaN"); + break; + case VT_BSTR: + msg.Format(_T("%s"), data->bstrVal); + break; + case VT_DATE: + msg = COleDateTime(data->date).Format(); + break;*/ + default: + break; + } + return msg; +} + + +LONG CMdUserApi::_WindCallback(ULONGLONG reqId, const WindData &wd) +{ + int timeLength = wd.GetTimesLength(); + int codeLength = wd.GetCodesLength(); + int fieldsLength = wd.GetFieldsLength(); + + for (int i = 0; i < codeLength; ++i) + { + //for (int j = 0; j < fieldsLength; ++j) + //{ + // VARIANT data; + // wcout << wd.GetDataItem(0, i, j, data) << endl; + + // wcout << data.vt << endl; + //} + MyWindWsq st = { 0 }; + VARIANT data; + + wd.GetDataItem(0, i, 0, data); + st.rt_date = data.dblVal; + wd.GetDataItem(0, i, 1, data); + st.rt_time = data.dblVal; + wd.GetDataItem(0, i, 2, data); + st.rt_last = data.dblVal; + wd.GetDataItem(0, i, 3, data); + st.rt_vol = data.dblVal; + wd.GetDataItem(0, i, 4, data); + st.rt_oi = data.dblVal; + wd.GetDataItem(0, i, 5, data); + st.rt_bid1 = data.dblVal; + wd.GetDataItem(0, i, 6, data); + st.rt_ask1 = data.dblVal; + wd.GetDataItem(0, i, 7, data); + st.rt_bsize1 = data.dblVal; + wd.GetDataItem(0, i, 8, data); + st.rt_asize1 = data.dblVal; + + //printf("rt_date:%f", st.rt_date); + //printf("rt_time:%f", st.rt_time); + //printf("rt_last:%f", st.rt_last); + //printf("rt_vol:%f", st.rt_vol); + //printf("rt_oi:%f", st.rt_oi); + //printf("rt_bid1:%f", st.rt_bid1); + //printf("rt_ask1:%f", st.rt_ask1); + //printf("rt_bsize1:%f", st.rt_bsize1); + //printf("rt_asize1:%f", st.rt_asize1); + + DepthMarketDataNField* pField = (DepthMarketDataNField*)m_msgQueue->new_block(sizeof(DepthMarketDataNField) + sizeof(DepthField) * 2); + + wstring wstr(wd.GetCodeByIndex(i)); + std::string str(wstr.length(), '\0'); + std::copy(wstr.begin(), wstr.end(), str.begin()); + + sprintf(pField->Symbol, "%s", str.c_str()); + pField->TradingDay = st.rt_date; + pField->ActionDay = st.rt_date; + pField->UpdateTime = st.rt_time; + pField->LastPrice = st.rt_last; + pField->Volume = st.rt_vol; + //pField->Turnover = pDepthMarketData->Turnover; + pField->OpenInterest = st.rt_oi; + //pField->AveragePrice = pDepthMarketData->AveragePrice; + + InitBidAsk(pField); + + do + { + if (st.rt_bsize1 == 0) + break; + AddBid(pField, st.rt_bid1, st.rt_bsize1, 0); + } while (false); + + do + { + if (st.rt_asize1 == 0) + break; + AddAsk(pField, st.rt_ask1, st.rt_asize1, 0); + } while (false); + + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); + } + + //if (timeLength > 1) + //{ + // if (fieldsLength > 1) + // { + // likeWsdList1(wd); + // } + // else //fieldsLength <= 1 + // { + // if (codeLength >= 1) + // { + // likeWsdList2(wd); + // } + // } + //} + //else if (codeLength > 1)//timeLength <= 1 + //{ + // if (fieldsLength > 1) + // { + // likeWssList(wd); + // } + // else + // { + // likeWsdList2(wd); + // } + //} + //else //timeLength <= 1 && codeLength <=1 + //{ + // likeWssList(wd); + //} + //printf("=================="); + + + return 0; +} + +void CMdUserApi::Subscribe(const string& szInstrumentIDs, const string& szExchangeID) +{ + ULONGLONG reqId = 0; + //WCHAR options[1024]; + //_snwprintf_s(options, sizeof options, _TRUNCATE, L"date=%d;sectorId=a001010100000000;field=wind_code,sec_name", Today(0)); + std::wstring wstr(szInstrumentIDs.length(), L'\0'); + std::copy(szInstrumentIDs.begin(), szInstrumentIDs.end(), wstr.begin()); + + + auto errCode = CWAPIWrapperCpp::wsq(reqId, wstr.c_str(), L"rt_date,rt_time,rt_last,rt_vol,rt_oi,rt_bid1,rt_ask1,rt_bsize1,rt_asize1", WindCallback, L"", TRUE); + if (errCode != 0) { + ErrorField* pField = (ErrorField*)m_msgQueue->new_block(sizeof(ErrorField)); + pField->RawErrorID = errCode; + strcpy_s(pField->Source, sizeof pField->Source, "wsq"); + WindGetErrorMessage(errCode, pField->Text, sizeof pField->Text); + m_msgQueue->Input_NoCopy(ResponseType::ResponseType_OnRtnError, m_msgQueue, m_pClass, 0, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); + return; + } + + // ԶĵĺԼŽз + m_map_code_reqId[szInstrumentIDs] = reqId; +} + +void CMdUserApi::Subscribe(const set& instrumentIDs, const string& szExchangeID) +{ + +} + +void CMdUserApi::Unsubscribe(const string& szInstrumentIDs, const string& szExchangeID) +{ + // ͨԼţȻжǷҪٶ + map::iterator it = m_map_code_reqId.find(szInstrumentIDs); + if (it == m_map_code_reqId.end()) + { + + } + else + { + ULONGLONG reqId = it->second; + + CWAPIWrapperCpp::cancelRequest(reqId); + } +} diff --git a/apis/Wind_Quote/MdUserApi.h b/apis/Wind_Quote/MdUserApi.h new file mode 100644 index 0000000..1a9b2dc --- /dev/null +++ b/apis/Wind_Quote/MdUserApi.h @@ -0,0 +1,90 @@ +#pragma once + +#include "../../include/ApiStruct.h" + +#ifdef _WIN64 + #pragma comment(lib, "../../include/Wind/win64/WAPIWrapperCpp.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x64d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x64.lib") + #endif +#else + #pragma comment(lib, "../../include/Wind/win32/WAPIWrapperCpp.lib") + #ifdef _DEBUG + #pragma comment(lib, "../../lib/Queue_x86d.lib") + #else + #pragma comment(lib, "../../lib/Queue_x86.lib") + #endif +#endif + +#include +#include +#include +#include +#include +#include + +#include "../../include/Wind/WAPIWrapperCpp.h" + +using namespace std; + +class CMsgQueue; + +class CMdUserApi +{ + enum RequestType + { + Start = 100, + Stop, + QueryInstrument, + }; + +public: + CMdUserApi(void); + virtual ~CMdUserApi(void); + + void Register(void* pCallback, void* pClass); + + void Connect(); + void Disconnect(); + + void Subscribe(const string& szInstrumentIDs, const string& szExchangeID); + void Unsubscribe(const string& szInstrumentIDs, const string& szExchangeID); + +private: + friend void* __stdcall Query(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + void QueryInThread(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + + friend LONG WINAPI WindCallback(ULONGLONG reqId, const WindData &wd); + LONG _WindCallback(ULONGLONG reqId, const WindData &wd); + + void WindStart(); + void WindStop(); + bool WindConnected(); + void WindQryInstrument(); + + // + void Subscribe(const set& instrumentIDs, const string& szExchangeID); + +private: + mutex m_csMapInstrumentIDs; + mutex m_csMapQuoteInstrumentIDs; + + //ڶĵĺԼ + map > m_mapInstrumentIDs; + //ڶĵĺԼ + map > m_mapQuoteInstrumentIDs; + + map m_map_code_reqId; + + //Ϣָ + CMsgQueue* m_msgQueue; + CMsgQueue* m_msgQueue_Query; + void* m_pClass; + bool m_CoInitialized; + HANDLE m_ExitEvent; +public: + static CMdUserApi * pThis; +}; + diff --git a/apis/Wind_Quote/ReadMe.txt b/apis/Wind_Quote/ReadMe.txt new file mode 100644 index 0000000..6591a17 --- /dev/null +++ b/apis/Wind_Quote/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : Wind_Quote Project Overview +======================================================================== + +AppWizard has created this Wind_Quote DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your Wind_Quote application. + + +Wind_Quote.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +Wind_Quote.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +Wind_Quote.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named Wind_Quote.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/apis/Wind_Quote/Wind_Quote.rc b/apis/Wind_Quote/Wind_Quote.rc new file mode 100644 index 0000000..deb5a06 Binary files /dev/null and b/apis/Wind_Quote/Wind_Quote.rc differ diff --git a/FakeAPI/FakeAPI.vcxproj b/apis/Wind_Quote/Wind_Quote.vcxproj similarity index 77% rename from FakeAPI/FakeAPI.vcxproj rename to apis/Wind_Quote/Wind_Quote.vcxproj index 82a8f6e..7dc42b2 100644 --- a/FakeAPI/FakeAPI.vcxproj +++ b/apis/Wind_Quote/Wind_Quote.vcxproj @@ -11,21 +11,23 @@ - {358586C9-A4B8-43E4-8376-59C68F0F6211} + {7B30B57A-6E59-482E-A8A8-5E2D978EA991} Win32Proj - FakeAPI + Wind_Quote + 8.1 DynamicLibrary true - v120 + v140 Unicode + false DynamicLibrary false - v120 + v140 true Unicode @@ -41,24 +43,26 @@ true - D:\Program Files (x86)\HailiLive - StockDrv + ..\..\bin\$(Configuration)\$(PlatformTarget)\Wind\ + $(ProjectName)_$(PlatformTarget) false + $(ProjectName)_$(PlatformTarget) + ..\..\bin\$(Configuration)\$(PlatformTarget)\Wind Use Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;FAKEAPI_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;WIND_QUOTE_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true Windows true - export.def + ../../include/ApiHeader.def @@ -68,7 +72,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;FAKEAPI_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;WIND_QUOTE_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -76,19 +80,21 @@ true true true - export.def + ../../include/ApiHeader.def + + - + false @@ -97,21 +103,15 @@ - - + + Create Create - - - - - - - + diff --git a/QuantBox_CTP_Quote/QuantBox_CTP_Quote.vcxproj.filters b/apis/Wind_Quote/Wind_Quote.vcxproj.filters similarity index 78% rename from QuantBox_CTP_Quote/QuantBox_CTP_Quote.vcxproj.filters rename to apis/Wind_Quote/Wind_Quote.vcxproj.filters index 8b20d4f..8613090 100644 --- a/QuantBox_CTP_Quote/QuantBox_CTP_Quote.vcxproj.filters +++ b/apis/Wind_Quote/Wind_Quote.vcxproj.filters @@ -24,16 +24,13 @@ Header Files - - Header Files - - + Header Files - + Header Files - + Header Files @@ -50,14 +47,13 @@ Source Files - - Source Files - - - Source Files - - + Source Files + + + Resource Files + + \ No newline at end of file diff --git a/apis/Wind_Quote/dllmain.cpp b/apis/Wind_Quote/dllmain.cpp new file mode 100644 index 0000000..69b5891 --- /dev/null +++ b/apis/Wind_Quote/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/apis/Wind_Quote/main.cpp b/apis/Wind_Quote/main.cpp new file mode 100644 index 0000000..0d16b6a --- /dev/null +++ b/apis/Wind_Quote/main.cpp @@ -0,0 +1,60 @@ +#include "stdafx.h" +#include "../../include/ApiHeader.h" +#include "../../include/QueueEnum.h" +#include "MdUserApi.h" + +inline CMdUserApi* GetApi(void* pApi) +{ + return static_cast(pApi); +} + +void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + RequestType requestType = (RequestType)type; + switch (requestType) + { + case RequestType_GetApiTypes: + return (void*)(ApiType::ApiType_MarketData | ApiType::ApiType_Instrument); + case RequestType_GetApiVersion: + return (void*)"0.1.0.20160120"; + case RequestType_GetApiName: + return (void*)"Wind"; + case RequestType_Create: + return new CMdUserApi(); + default: + break; + } + + if (pApi1 == nullptr) + { + return nullptr; + } + + CMdUserApi* api = GetApi(pApi1); + + switch (requestType) + { + case RequestType_Release: + delete api; + return nullptr; + case RequestType_Register: + api->Register(ptr1, ptr2); + break; + case RequestType_Connect: + api->Connect(); + break; + case RequestType_Disconnect: + api->Disconnect(); + break; + case RequestType_Subscribe: + api->Subscribe((const char*)ptr1, (const char*)ptr2); + break; + case RequestType_Unsubscribe: + api->Unsubscribe((const char*)ptr1, (const char*)ptr2); + break; + default: + break; + } + + return pApi1; +} diff --git a/apis/Wind_Quote/resource.h b/apis/Wind_Quote/resource.h new file mode 100644 index 0000000..2691c2e Binary files /dev/null and b/apis/Wind_Quote/resource.h differ diff --git a/apis/Wind_Quote/stdafx.cpp b/apis/Wind_Quote/stdafx.cpp new file mode 100644 index 0000000..102800c --- /dev/null +++ b/apis/Wind_Quote/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// Wind_Quote.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/apis/Wind_Quote/stdafx.h b/apis/Wind_Quote/stdafx.h new file mode 100644 index 0000000..f3a0737 --- /dev/null +++ b/apis/Wind_Quote/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here diff --git a/apis/Wind_Quote/targetver.h b/apis/Wind_Quote/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/apis/Wind_Quote/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/clear.bat b/clear.bat index 2097cb9..612569d 100644 --- a/clear.bat +++ b/clear.bat @@ -1,100 +1,104 @@ rd Debug /S /Q +rd Release /S /Q rd Debug64 /S /Q +rd Release64 /S /Q rd x64 /S /Q rd ipch /S /Q -rd csharp\QuantBox.XAPI\bin /S /Q -rd csharp\QuantBox.XAPI\obj /S /Q +del AllCppProjects.opensdf /S /Q +del AllCppProjects.sdf /S /Q +del AllCppProjects.v12.suo /S /Q /A H + +rd apis\CTP_Quote\Debug /S /Q +rd apis\CTP_Quote\Debug64 /S /Q +rd apis\CTP_Quote\Release /S /Q +rd apis\CTP_Quote\Release64 /S /Q +rd apis\CTP_Quote\x64 /S /Q +rd apis\CTP_Trade\Debug /S /Q +rd apis\CTP_Trade\Debug64 /S /Q +rd apis\CTP_Trade\Release /S /Q +rd apis\CTP_Trade\Release64 /S /Q +rd apis\CTP_Trade\x64 /S /Q +rd apis\CTPZQ_Quote\Debug /S /Q +rd apis\CTPZQ_Quote\Debug64 /S /Q +rd apis\CTPZQ_Quote\Release /S /Q +rd apis\CTPZQ_Quote\Release64 /S /Q +rd apis\CTPZQ_Quote\x64 /S /Q +rd apis\CTPZQ_Trade\Debug /S /Q +rd apis\CTPZQ_Trade\Debug64 /S /Q +rd apis\CTPZQ_Trade\Release /S /Q +rd apis\CTPZQ_Trade\Release64 /S /Q +rd apis\CTPZQ_Trade\x64 /S /Q +rd apis\CTP_SOPT_Trade\Debug /S /Q +rd apis\CTP_SOPT_Trade\Debug64 /S /Q +rd apis\CTP_SOPT_Trade\Release /S /Q +rd apis\CTP_SOPT_Trade\Release64 /S /Q +rd apis\CTP_SOPT_Trade\x64 /S /Q +rd apis\Kingstar_Quote\Debug /S /Q +rd apis\Kingstar_Quote\Release /S /Q +rd apis\Kingstar_Quote\x64 /S /Q +rd apis\Kingstar_Trade\Debug /S /Q +rd apis\Kingstar_Trade\Release /S /Q +rd apis\Kingstar_Trade\x64 /S /Q +rd apis\LTS_Query_v2\Debug /S /Q +rd apis\LTS_Query_v2\Release /S /Q +rd apis\LTS_Query_v2\x64 /S /Q +rd apis\LTS_Quote_v2\Debug /S /Q +rd apis\LTS_Quote_v2\Release /S /Q +rd apis\LTS_Quote_v2\x64 /S /Q +rd apis\LTS_Trade_v2\Debug /S /Q +rd apis\LTS_Trade_v2\Release /S /Q +rd apis\LTS_Trade_v2\x64 /S /Q +rd apis\Tdx_Trade\Debug /S /Q +rd apis\Tdx_Trade\Release /S /Q +rd apis\Tdx_Trade\x64 /S /Q +rd apis\TongShi_Quote\Debug /S /Q +rd apis\TongShi_Quote\Release /S /Q +rd apis\TongShi_Quote\x64 /S /Q +rd apis\Sgit_Quote\Debug /S /Q +rd apis\Sgit_Quote\Debug64 /S /Q +rd apis\Sgit_Quote\Release /S /Q +rd apis\Sgit_Quote\Release64 /S /Q +rd apis\Sgit_Quote\x64 /S /Q +rd apis\Sgit_Trade\Debug /S /Q +rd apis\Sgit_Trade\Debug64 /S /Q +rd apis\Sgit_Trade\Release /S /Q +rd apis\Sgit_Trade\Release64 /S /Q +rd apis\Sgit_Trade\x64 /S /Q +rd apis\ATP_Quote\Debug /S /Q +rd apis\ATP_Quote\Debug64 /S /Q +rd apis\ATP_Quote\Release /S /Q +rd apis\ATP_Quote\Release64 /S /Q +rd apis\ATP_Quote\x64 /S /Q +rd apis\ATP_Trade\Debug /S /Q +rd apis\ATP_Trade\Debug64 /S /Q +rd apis\ATP_Trade\Release /S /Q +rd apis\ATP_Trade\Release64 /S /Q +rd apis\ATP_Trade\x64 /S /Q + +rd apis\Kingstar_Quote\Release64 /S /Q +rd apis\Kingstar_Trade\Release64 /S /Q +rd apis\TongShi_Quote\Release64 /S /Q + +rd common\Queue\Debug /S /Q +rd common\Queue\Release /S /Q +rd common\Queue\x64 /S /Q + +rd tools\FakeAPI\Debug /S /Q +rd tools\FakeAPI\Release /S /Q +rd tools\FakeAPI\x64 /S /Q -rd QuantBox_CTP_Quote\Debug /S /Q -rd QuantBox_CTP_Trade\Debug /S /Q -rd QuantBox_DFITC_Level2\Debug /S /Q -rd QuantBox_Esunny_HistoricalData\Debug /S /Q -rd QuantBox_Femas_Quote\Debug /S /Q -rd QuantBox_Femas_Trade\Debug /S /Q -rd QuantBox_Kingstar_Quote\Debug /S /Q -rd QuantBox_Kingstar_Trade\Debug /S /Q -rd QuantBox_KingstarStock_Trade\Debug /S /Q -rd QuantBox_LTS_Level2\Debug /S /Q -rd QuantBox_LTS_Quote\Debug /S /Q -rd QuantBox_LTS_Trade\Debug /S /Q -rd QuantBox_Queue\Debug /S /Q -rd QuantBox_Kingstar_Quote\Debug /S /Q -rd QuantBox_Kingstar_Trade\Debug /S /Q -rd QuantBox_KingstarGold\Debug /S /Q -rd QuantBox_XSpeed_Quote\Debug /S /Q -rd QuantBox_XSpeed_Trade\Debug /S /Q -rd QuantBox_XSpeedStock_Quote\Debug /S /Q -rd QuantBox_XSpeedStock_Trade\Debug /S /Q -rd QuantBox_ZeroMQ_Quote\Debug /S /Q -rd QuantBox_TongShi_Quote\Debug /S /Q -rd QuantBox_Tdx_Trade\Debug /S /Q -rd QuantBox_LTS_Query_v2\Debug /S /Q -rd QuantBox_LTS_Quote_v2\Debug /S /Q -rd QuantBox_LTS_Trade_v2\Debug /S /Q -rd FakeAPI\Debug /S /Q -rd QuantBox_XAPI\Debug /S /Q -rd QuantBox_XAPI_TEST\Debug /S /Q +rd tests\CPP\Debug /S /Q +rd tests\CPP\Release /S /Q +rd tests\CPP\x64 /S /Q -rd QuantBox_CTP_Quote\Debug64 /S /Q -rd QuantBox_CTP_Trade\Debug64 /S /Q -rd QuantBox_DFITC_Level2\Debug64 /S /Q -rd QuantBox_Esunny_HistoricalData\Debug64 /S /Q -rd QuantBox_Femas_Quote\Debug64 /S /Q -rd QuantBox_Femas_Trade\Debug64 /S /Q -rd QuantBox_Kingstar_Quote\Debug64 /S /Q -rd QuantBox_Kingstar_Trade\Debug64 /S /Q -rd QuantBox_KingstarStock_Trade\Debug64 /S /Q -rd QuantBox_LTS_Level2\Debug64 /S /Q -rd QuantBox_LTS_Quote\Debug64 /S /Q -rd QuantBox_LTS_Trade\Debug64 /S /Q -rd QuantBox_Queue\Debug64 /S /Q -rd QuantBox_Kingstar_Quote\Debug64 /S /Q -rd QuantBox_Kingstar_Trade\Debug64 /S /Q -rd QuantBox_KingstarGold\Debug64 /S /Q -rd QuantBox_XSpeed_Quote\Debug64 /S /Q -rd QuantBox_XSpeed_Trade\Debug64 /S /Q -rd QuantBox_XSpeedStock_Quote\Debug64 /S /Q -rd QuantBox_XSpeedStock_Trade\Debug64 /S /Q +rd languages\CSharp\XAPI_CSharp\bin /S /Q +rd languages\CSharp\XAPI_CSharp\obj /S /Q -rd QuantBox_CTP_Quote\Release /S /Q -rd QuantBox_CTP_Trade\Release /S /Q -rd QuantBox_DFITC_Level2\Release /S /Q -rd QuantBox_Esunny_HistoricalData\Release /S /Q -rd QuantBox_Femas_Quote\Release /S /Q -rd QuantBox_Femas_Trade\Release /S /Q -rd QuantBox_Kingstar_Quote\Release /S /Q -rd QuantBox_Kingstar_Trade\Release /S /Q -rd QuantBox_KingstarStock_Trade\Release /S /Q -rd QuantBox_LTS_Level2\Release /S /Q -rd QuantBox_LTS_Quote\Release /S /Q -rd QuantBox_LTS_Trade\Release /S /Q -rd QuantBox_Queue\Release /S /Q -rd QuantBox_Kingstar_Quote\Release /S /Q -rd QuantBox_Kingstar_Trade\Release /S /Q -rd QuantBox_KingstarGold\Release /S /Q -rd QuantBox_XSpeed_Quote\Release /S /Q -rd QuantBox_XSpeed_Trade\Release /S /Q -rd QuantBox_XSpeedStock_Quote\Release /S /Q -rd QuantBox_XSpeedStock_Trade\Release /S /Q -rd QuantBox_CTP_Quote\x64 /S /Q -rd QuantBox_CTP_Trade\x64 /S /Q -rd QuantBox_DFITC_Level2\x64 /S /Q -rd QuantBox_Esunny_HistoricalData\x64 /S /Q -rd QuantBox_Femas_Quote\x64 /S /Q -rd QuantBox_Femas_Trade\x64 /S /Q -rd QuantBox_Kingstar_Quote\x64 /S /Q -rd QuantBox_Kingstar_Trade\x64 /S /Q -rd QuantBox_KingstarStock_Trade\x64 /S /Q -rd QuantBox_LTS_Level2\x64 /S /Q -rd QuantBox_LTS_Quote\x64 /S /Q -rd QuantBox_LTS_Trade\x64 /S /Q -rd QuantBox_Queue\x64 /S /Q -rd QuantBox_Kingstar_Quote\x64 /S /Q -rd QuantBox_Kingstar_Trade\x64 /S /Q -rd QuantBox_KingstarGold\x64 /S /Q -rd QuantBox_XSpeed_Quote\x64 /S /Q -rd QuantBox_XSpeed_Trade\x64 /S /Q -rd QuantBox_XSpeedStock_Quote\x64 /S /Q -rd QuantBox_XSpeedStock_Trade\x64 /S /Q + + + +rd csharp\QuantBox.XAPI\bin /S /Q +rd csharp\QuantBox.XAPI\obj /S /Q + diff --git a/clearBin.bat b/clearBin.bat new file mode 100644 index 0000000..c044a29 --- /dev/null +++ b/clearBin.bat @@ -0,0 +1,7 @@ +cd bin +del *.exp /S /Q +del *.ilk /S /Q +del *.pdb /S /Q +del *.lib /S /Q + + diff --git a/common/License/License.cpp b/common/License/License.cpp new file mode 100644 index 0000000..6d17677 --- /dev/null +++ b/common/License/License.cpp @@ -0,0 +1,607 @@ +#include "stdafx.h" +#include "License.h" +#include +#pragma comment(lib, "iphlpapi.lib") + +#ifdef ENABLE_LICENSE + +#include +#include + + + +#include "../../include/inirw.h" + +#define APP_NAME_USER "User" +#define KEY_NAME_ACCOUNT "Account" +#define KEY_NAME_USERNAME "UserName" + +#define KEY_NAME_PRODUCT "Product" +#define APP_NAME_LICENSE "License" +#define KEY_NAME_COUNT "Count" +#define KEY_NAME_MAC "MachineID" +#define KEY_NAME_TRIAL "Trial" +#define KEY_NAME_EXPIRE_DATE "ExpireDate" +#define KEY_NAME_SERIAL_NUMBER "SerialNumber" +#define KEY_NAME_INFO "Info" + +using namespace std; + +//// Prints the MAC address stored in a 6 byte array to stdout +//static void PrintMACaddress(unsigned char MACData[]) +//{ +// +//#ifdef PRINTING_TO_CONSOLE_ALLOWED +// +// printf("\nMAC Address: %02X-%02X-%02X-%02X-%02X-%02X\n", +// MACData[0], MACData[1], MACData[2], MACData[3], MACData[4], MACData[5]); +// +//#endif +// +// char string[256]; +// sprintf(string, "%02X-%02X-%02X-%02X-%02X-%02X\n", MACData[0], MACData[1], +// MACData[2], MACData[3], MACData[4], MACData[5]); +// //WriteConstantString("MACaddress", string); +// printf(string); +//} + +// Fetches the MAC address and prints it +//DWORD GetMACaddress() +//{ +// DWORD MACaddress = 0; +// IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information +// // for up to 16 NICs +// DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer +// +// DWORD dwStatus = GetAdaptersInfo( // Call GetAdapterInfo +// AdapterInfo, // [out] buffer to receive data +// &dwBufLen); // [in] size of receive data buffer +// //assert(dwStatus == ERROR_SUCCESS); // Verify return value is +// // valid, no buffer overflow +// +// PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to +// // current adapter info +// do { +// if (MACaddress == 0) +// MACaddress = pAdapterInfo->Address[5] + pAdapterInfo->Address[4] * 256 + +// pAdapterInfo->Address[3] * 256 * 256 + +// pAdapterInfo->Address[2] * 256 * 256 * 256; +// //PrintMACaddress(pAdapterInfo->Address); // Print MAC address +// //memcpy(pAddress1, pAdapterInfo->Address, sizeof(pAdapterInfo->Address)); +// //break; +// pAdapterInfo = pAdapterInfo->Next; // Progress through linked list +// } while (pAdapterInfo); // Terminate if last adapter +// +// return MACaddress; +//} + +// Prints the MAC address stored in a 6 byte array to stdout +static void PrintMACaddress(unsigned char MACData[],char* string) +{ + +#ifdef PRINTING_TO_CONSOLE_ALLOWED + + printf("\nMAC Address: %02X-%02X-%02X-%02X-%02X-%02X\n", + MACData[0], MACData[1], MACData[2], MACData[3], MACData[4], MACData[5]); + +#endif + + //char string[256]; + sprintf(string, "%02X%02X%02X%02X%02X%02X", MACData[0], MACData[1], + MACData[2], MACData[3], MACData[4], MACData[5]); + //WriteConstantString("MACaddress", string); + //printf(string); +} + +DWORD GetMACaddress(char* string) +{ + DWORD MACaddress = 0; + IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information + // for up to 16 NICs + DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer + + DWORD dwStatus = GetAdaptersInfo( // Call GetAdapterInfo + AdapterInfo, // [out] buffer to receive data + &dwBufLen); // [in] size of receive data buffer + //assert(dwStatus == ERROR_SUCCESS); // Verify return value is + // valid, no buffer overflow + + PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to + // current adapter info + do { + if (MACaddress == 0) + MACaddress = pAdapterInfo->Address[5] + pAdapterInfo->Address[4] * 256 + + pAdapterInfo->Address[3] * 256 * 256 + + pAdapterInfo->Address[2] * 256 * 256 * 256; + PrintMACaddress(pAdapterInfo->Address, string); // Print MAC address + //memcpy(pAddress1, pAdapterInfo->Address, sizeof(pAdapterInfo->Address)); + break; + pAdapterInfo = pAdapterInfo->Next; // Progress through linked list + } while (pAdapterInfo); // Terminate if last adapter + + return MACaddress; +} + + +CLicense::CLicense() +{ + memset(m_LicensePath, 0, sizeof(m_LicensePath)); + memset(m_PublicKeyPath, 0, sizeof(m_PublicKeyPath)); + memset(m_PrivateKeyPath, 0, sizeof(m_PrivateKeyPath)); + memset(m_SignaturePath, 0, sizeof(m_SignaturePath)); + memset(m_PublicKeyString, 0, sizeof(m_PublicKeyString)); + memset(m_SignatureString, 0, sizeof(m_SignatureString)); + memset(m_RealMAC, 0, sizeof(m_RealMAC)); + + m_bHasSaved = false; + m_bLoaded = false; + m_bSendOrderFlag = false; + + //sprintf_s(m_RealMAC, "%ld", GetMACaddress()); + GetMACaddress(m_RealMAC); + + CreateDefault(); +} + + +CLicense::~CLicense() +{ +} + +int CLicense::Today(int day) +{ + time_t now = time(0); + now += day * 86400; + struct tm *ptmNow = localtime(&now); + + return (ptmNow->tm_year + 1900) * 10000 + + (ptmNow->tm_mon + 1) * 100 + + ptmNow->tm_mday; +} + +int CLicense::Date(int date, int day) +{ + time_t now = time(0); + struct tm *ptmNow = localtime(&now); + + ptmNow->tm_year = date / 10000 - 1900; + ptmNow->tm_mon = date % 10000 / 100 - 1; + ptmNow->tm_mday = date % 100; + + now = mktime(ptmNow); + + now += day * 86400; + ptmNow = localtime(&now); + + return (ptmNow->tm_year + 1900) * 10000 + + (ptmNow->tm_mon + 1) * 100 + + ptmNow->tm_mday; +} + +void CLicense::GetDllPathByFunctionName(const char* szFunctionName, char* szPath) +{ + HMODULE hModule = nullptr; + GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, szFunctionName, &hModule); + + GetModuleFileNameA(hModule, szPath, MAX_PATH); +} + +void CLicense::SetLicensePath(const char* licPath) +{ + // 授权文件的路径是生成签名和验证都需要,所以最核心 + char szPath[_MAX_PATH] = { 0 }; + char drive[_MAX_DRIVE] = {0}; + char dir[_MAX_DIR] = { 0 }; + char fname[_MAX_FNAME] = { 0 }; + char ext[_MAX_EXT] = { 0 }; + _splitpath(licPath, drive, dir, fname, ext); + _makepath(m_LicensePath, drive, dir, fname, FILE_EXT_LIC); + _makepath(m_PublicKeyPath, drive, dir, fname, FILE_EXT_PUB); + _makepath(m_PrivateKeyPath, drive, dir, fname, FILE_EXT_PRIV); + _makepath(m_SignaturePath, drive, dir, fname, FILE_EXT_SIGN); +} + +void CLicense::SetPublicKeyString(const char* pubKey) +{ + strncpy(m_PublicKeyString, pubKey, sizeof(m_PublicKeyString)); +} + +void CLicense::SetSignatureString(const char* signature) +{ + strncpy(m_SignatureString, signature, sizeof(m_SignatureString)); +} + +bool CLicense::IsTrial() +{ + return (m_Trial == 0 || strlen(m_PublicKeyString) <= 0); +} + +bool CLicense::HasSignature() +{ + return (strlen(m_SignatureString) > 0); +} + +bool CLicense::HasSaved() +{ + return m_bHasSaved; +} + +void CLicense::SetSendOrderFlag(bool flag) +{ + m_bSendOrderFlag = flag; +} + +bool CLicense::GetSendOrderFlag() +{ + return m_bSendOrderFlag; +} + +int CLicense::LoadIni() +{ + m_bLoaded = iniFileLoad(m_LicensePath); + + // 无所谓是否加载成功,反正有默认 + m_ExpireDate = iniGetInt(APP_NAME_LICENSE, KEY_NAME_EXPIRE_DATE, -1); + m_Trial = iniGetInt(APP_NAME_LICENSE, KEY_NAME_TRIAL, 5); + + iniGetString(APP_NAME_USER, KEY_NAME_ACCOUNT, m_Account, sizeof(m_Account), ""); + iniGetString(APP_NAME_USER, KEY_NAME_USERNAME, m_UserName, sizeof(m_UserName), ""); + iniGetString(APP_NAME_LICENSE, KEY_NAME_MAC, m_MAC, sizeof(m_MAC), ""); + + iniFileFree(); + + if (m_bLoaded != 0) + return 0; + + sprintf(m_ErrorInfo, ERROR_CODE_1, m_RealMAC); + m_ErrorCode = 1; + return m_ErrorCode; +} + +void CLicense::AddUser(const char* account, const char* name) +{ + m_UserMap[string(account)] = string(name); +} + +int CLicense::SaveIni() +{ + iniFileLoad(m_LicensePath); + + int bRet = iniSetInt(APP_NAME_LICENSE, KEY_NAME_EXPIRE_DATE, m_ExpireDate, Today(7)); + iniSetInt(APP_NAME_LICENSE, KEY_NAME_TRIAL, m_Trial, 5); + iniSetString(APP_NAME_LICENSE, KEY_NAME_MAC, m_MAC); + + iniSetString(APP_NAME_USER, KEY_NAME_ACCOUNT, m_Account); + iniSetString(APP_NAME_USER, KEY_NAME_USERNAME, m_UserName); + + char szInfo[2048] = { 0 }; + strcat(szInfo, m_RealMAC); + strcat(szInfo, ":"); + for (map::iterator it = m_UserMap.begin(); it != m_UserMap.end(); ++it) + { + strcat(szInfo, it->first.c_str()); + strcat(szInfo, "|"); + strcat(szInfo, it->second.c_str()); + strcat(szInfo, "|"); + } + iniSetString(APP_NAME_USER, KEY_NAME_INFO, szInfo); + iniFileFree(); + + if (bRet != 0) + { + m_bHasSaved = true; + return 0; + } + + sprintf(m_ErrorInfo, ERROR_CODE_11, m_Trial, m_RealMAC); + m_ErrorCode = 11; + return m_ErrorCode; +} + + +void CLicense::CreateDefault() +{ + m_Trial = 5; // 默认5次 + m_ExpireDate = Today(7); // 7天 + m_UserMap.clear(); + m_nCurrentTrial = 0; + + strncpy(m_Account, ".*", sizeof(m_Account)); + strncpy(m_UserName, "", sizeof(m_UserName)); + strncpy(m_MAC, ".*", sizeof(m_MAC)); +} + +int CLicense::GetErrorCodeForSign() +{ + // 认证通过 + m_ErrorCode = 0; + + do + { + // 由于在前面已经有GetErrorCodeForSign()做了签名信息是否存在的检查 + if (!HasSignature()) + { + // 所以这里是以最小授权进行通过 + // 只有试用次数可以检查了 + m_Trial = min(m_Trial, 5); + // 由于在这之前就已经检查过了过期时间了,所以这地方没有必要 + //m_ExpireDate = min(m_ExpireDate, Today(7)); + + m_ErrorCode = 12; + sprintf_s(m_ErrorInfo, ERROR_CODE_12, m_Trial, m_RealMAC); + + break; + } + + string s = LoadStringFromFile(m_LicensePath); + + if (Verify(s.c_str(), m_PublicKeyString, m_SignatureString)) + { + + } + else + { + m_ErrorCode = -2; + strcpy(m_ErrorInfo, ERROR_CODE_2); + break; + } + + } while (false); + + return m_ErrorCode; +} + +int CLicense::GetErrorCodeForMachineID() +{ + // 认证通过 + m_ErrorCode = 0; + + do + { + if (strlen(m_MAC) <= 0) + { + break; + } + // 检查机器码 + regex pattern(m_MAC); + if (!regex_search(m_RealMAC, pattern)) + { + strcpy(m_ErrorInfo, ERROR_CODE_5); + m_ErrorCode = -5; + break; + } + + } while (false); + + return m_ErrorCode; +} + +int CLicense::GetErrorCodeForExpireDate() +{ + // 认证通过 + m_ErrorCode = 0; + + do + { + // 是否过期了 + if (m_ExpireDate < Today(0)) + { + m_ErrorCode = -3; + sprintf(m_ErrorInfo, ERROR_CODE_3, m_ExpireDate); + break; + } + + // 看授权时间是否合要求 + int metion = Date(m_ExpireDate, -15); + if (metion <= Today(0)) + { + m_ErrorCode = 13; + sprintf_s(m_ErrorInfo, ERROR_CODE_13, m_ExpireDate, metion); + break; + } + } while (false); + + return m_ErrorCode; +} + +int CLicense::GetErrorCodeByAccount(const char* account) +{ + // 认证通过 + m_ErrorCode = 0; + + do + { + if (strlen(m_Account) <= 0) + { + break; + } + regex pattern(m_Account); + if (!regex_search(account, pattern)) + { + m_ErrorCode = -4; + sprintf(m_ErrorInfo, ERROR_CODE_4, account); + break; + } + + } while (false); + + return m_ErrorCode; +} + +int CLicense::GetErrorCodeByNameThenAccount(const char* name, const char* account) +{ + // 认证通过 + m_ErrorCode = 0; + + do + { + // 汉字使用正则太复杂,还是改用查找 + if (strlen(m_UserName) <= 0) + { + break; + } + if (nullptr == strstr(m_UserName, name)) + { + m_ErrorCode = -9; + sprintf(m_ErrorInfo, ERROR_CODE_9, name); + break; + } + } while (false); + + return m_ErrorCode; +} + +int CLicense::GetErrorCodeForSendOrder() +{ + do + { + if (!m_bSendOrderFlag) + { + sprintf(m_ErrorInfo, ERROR_CODE_14); + m_ErrorCode = -14; + break; + } + + // 检查次数 + if (m_Trial > 0) + { + if (m_nCurrentTrial >= m_Trial) + { + sprintf(m_ErrorInfo, ERROR_CODE_6, m_Trial); + m_ErrorCode = -6; + break; + } + } + + // 认证通过就加1 + ++m_nCurrentTrial; + + // 认证通过 + m_ErrorCode = 0; + } while (false); + + return m_ErrorCode; +} + +const char* CLicense::GetErrorInfo() +{ + if (m_ErrorCode == 0) + return nullptr; + return m_ErrorInfo; +} + +string CLicense::LoadStringFromFile(const char *filename) +{ + try + { + string result; + FileSource(filename, true, new StringSink(result)); + return result; + } + catch (...) + { + return ""; + } +} + +void CLicense::Sign(const char* message) +{ + if (strlen(message) <= 0) + { + return; + } + if (strlen(m_PrivateKeyPath) <= 0) + { + return; + } + RSASignFileStringFile(m_PrivateKeyPath, message, m_SignaturePath); +} + +bool CLicense::Verify(const char* message, const char* pubKey, const char* signature) +{ + if (strlen(message) <= 0) + { + return false; + } + if (strlen(pubKey) <= 0) + { + return false; + } + + return RSAVerifyStringStringString(pubKey, message, signature); +} + +//------------------------ +// 定义全局的随机数池 +//------------------------ +RandomPool & GlobalRNG() +{ + static RandomPool randomPool; + return randomPool; +} + +void GenerateRSAKey(unsigned int keyLength, const char *privFilename, const char *pubFilename, const char *seed) +{ + RandomPool randPool; + randPool.IncorporateEntropy((byte *)seed, strlen(seed)); + + RSAES_OAEP_SHA_Decryptor priv(randPool, keyLength); + HexEncoder privFile(new FileSink(privFilename)); + priv.DEREncode(privFile); + privFile.MessageEnd(); + + RSAES_OAEP_SHA_Encryptor pub(priv); + HexEncoder pubFile(new FileSink(pubFilename)); + pub.DEREncode(pubFile); + pubFile.MessageEnd(); +} + +string RSAEncryptString(const char *pubFilename, const char *seed, const char *message) +{ + FileSource pubFile(pubFilename, true, new HexDecoder); + RSAES_OAEP_SHA_Encryptor pub(pubFile); + + RandomPool randPool; + randPool.IncorporateEntropy((byte *)seed, strlen(seed)); + + string result; + StringSource(message, true, new PK_EncryptorFilter(randPool, pub, new HexEncoder(new StringSink(result)))); + return result; +} + +string RSADecryptString(const char *privFilename, const char *ciphertext) +{ + FileSource privFile(privFilename, true, new HexDecoder); + RSAES_OAEP_SHA_Decryptor priv(privFile); + + string result; + StringSource(ciphertext, true, new HexDecoder(new PK_DecryptorFilter(GlobalRNG(), priv, new StringSink(result)))); + return result; +} + +void RSASignFileStringFile(const char *privFilename, const char *messageFilename, const char *signatureFilename) +{ + FileSource privFile(privFilename, true, new HexDecoder); + RSASS::Signer priv(privFile); + StringSource f(messageFilename, true, new SignerFilter(GlobalRNG(), priv, new HexEncoder(new FileSink(signatureFilename)))); +} + +bool RSAVerifyStringStringString(const char *pubFilename, const char *messageFilename, const char *signatureFilename) +{ + StringSource pubFile(pubFilename, true, new HexDecoder); + RSASS::Verifier pub(pubFile); + + StringSource signatureFile(signatureFilename, true, new HexDecoder); + if (signatureFile.MaxRetrievable() != pub.SignatureLength()) + return false; + SecByteBlock signature(pub.SignatureLength()); + signatureFile.Get(signature, signature.size()); + + VerifierFilter *verifierFilter = new VerifierFilter(pub); + verifierFilter->Put(signature, pub.SignatureLength()); + StringSource f(messageFilename, true, verifierFilter); + + return verifierFilter->GetLastResult(); +} + +#endif diff --git a/common/License/License.h b/common/License/License.h new file mode 100644 index 0000000..9e6c093 --- /dev/null +++ b/common/License/License.h @@ -0,0 +1,172 @@ +#pragma once + +#ifdef ENABLE_LICENSE + +#include +#include +#include +#include +#include + +#include "randpool.h" +#include "rsa.h" +#include "hex.h" +#include "files.h" + +// 1 +#define ERROR_CODE_1 "没有读取到授权文件,将自动生成试用版授权到dll同目录下,机器码为[%s]" +#define ERROR_CODE_2 "授权认证失败" +#define ERROR_CODE_3 "授权过期,过期时间为[%d]" +#define ERROR_CODE_4 "没有[用户号:%s]的授权" +#define ERROR_CODE_5 "机器码验证失败" +#define ERROR_CODE_6 "试用超次数,限制[%d]次" +#define ERROR_CODE_7 "授权产品名不对应" +#define ERROR_CODE_8 "[用户号:%s]授权的[姓名:%s],现获得的为[%s],下单将被拒绝" +#define ERROR_CODE_9 "没有[姓名:%s]的授权" +#define ERROR_CODE_10 "授权范围太广时,到期时间不能过长" +#define ERROR_CODE_11 "写入授权文件失败,请检查是否有权限写入或以管理员方式再次启动。试用次数为[%d],机器码为[%s]" +#define ERROR_CODE_14 "授权失败,无法下单" +// 12 +#define ERROR_CODE_12 "未读取到签名信息,使用最小授权,试用次数为[%d],机器码为[%s]" +#define ERROR_CODE_13 "授权快要过期,请提前申请新的授权。过期时间为[%d],开始提醒日为[%d]" + +#define FILE_EXT_LIC "License" +#define FILE_EXT_PUB "PublicKey" +#define FILE_EXT_PRIV "PrivateKey" +#define FILE_EXT_SIGN "Signature" + +using namespace std; +using namespace CryptoPP; + +#ifdef _DEBUG +#pragma comment(lib, "../../lib/Debug/cryptlib.lib") +#else +#pragma comment(lib, "../../lib/Release/cryptlib.lib") +#endif // DEBUG + + + +void GenerateRSAKey(unsigned int keyLength, const char *privFilename, const char *pubFilename, const char *seed); +string RSAEncryptString(const char *pubFilename, const char *seed, const char *message); +string RSADecryptString(const char *privFilename, const char *ciphertext); +void RSASignFileStringFile(const char *privFilename, const char *messageFilename, const char *signatureFilename); +bool RSAVerifyStringStringString(const char *pubFilename, const char *messageFilename, const char *signatureFilename); + +RandomPool & GlobalRNG(); + +/* +功能说明: +1.没有证书文件时要重新生成,生成的要能直接通过临时认证 +2.有证书文件时,要判断是不是绑定了机器 +3.还有试用检查 +4.没有绑定的时间不能过长 + +应当检查一下,如果是试用版,就可以一直添加新用户和机器码,而正式用户就不可以了,这样就可以记录很多账户了 + +决定多加一些东西 +1.记录一些权限信息.License +2.记录公钥.PublicKey +3.记录签名文件.Signature + +4.记录私钥.PrivateKey + +如何防止用户自己生成公私钥后再签名 +1.公钥不容易改,建议添加到资源中 +2.授权文件可再加一次密后再来签名 + +授权检查的逻辑 +1.所有相关文件都没有,使用临时授权,生成临时授权文件,不生成签名 +2.有授权文件,但没有签名,临时授权与本地授权文件取最小 +3.有授权文件,但签名是错的,直接拒绝 +4.有授权文件,签名也是正确的,按授权文件来 +*/ +class CLicense +{ +public: + CLicense(); + ~CLicense(); + + // 通过导出函数得到当前dll的路径 + void GetDllPathByFunctionName(const char* szFunctionName, char* szPath); + // 设置证书路径,会同时再生成其它路径,这个函数会忽视后缀,生成自己的后缀 + void SetLicensePath(const char* licPath); + + + + int LoadIni(); + int SaveIni(); + + const char* GetErrorInfo(); + int GetErrorCodeForMachineID(); + int GetErrorCodeByAccount(const char* account); + int GetErrorCodeForSign(); + int GetErrorCodeForExpireDate(); + int GetErrorCodeByNameThenAccount(const char* name, const char* account); + int GetErrorCodeForSendOrder(); + + void SetSendOrderFlag(bool flag); + bool GetSendOrderFlag(); + + + int Today(int day); + int Date(int date, int day); + + void AddUser(const char* account, const char* name); + + void CreateDefault(); + + + // 只是简单的加载文件 + string LoadStringFromFile(const char *filename); + + // 对某个字符串进行签名,可以先对此字符串预处理 + void Sign(const char* message); + // 对某个字符串进行验证,可以先对此字符串预处理 + // 公钥可以保存在dll中,不便修改的模式,这样用户 + bool Verify(const char* message, const char* pubKey, const char* signature); + + + // 在进行GetErrorCode时,需要先设置公钥,这样好检查是否正确 + void SetPublicKeyString(const char* pubKey); + void SetSignatureString(const char* signature); + + bool IsTrial(); + bool HasSignature(); + bool HasSaved(); + +public: + char m_LicensePath[260]; + char m_PublicKeyPath[260]; + char m_PrivateKeyPath[260]; + char m_SignaturePath[260]; + + char m_PublicKeyString[1024]; + char m_SignatureString[1024]; + +private: + bool m_bHasSaved; + int m_ExpireDate; + int m_Trial; + int m_nCurrentTrial; + + char m_RealMAC[32]; + + char m_ErrorInfo[256]; + int m_ErrorCode; + + map m_UserMap; + //set m_MacSet; + char m_Account[1024]; + char m_UserName[1024]; + char m_MAC[1024]; + bool m_bLoaded; + + bool m_bHasStarAccount; + bool m_bHasStarUserName; + bool m_bHasStarMAC; + + bool m_bSendOrderFlag; +}; + +#endif + diff --git a/common/License/License.vcxproj b/common/License/License.vcxproj new file mode 100644 index 0000000..86829f9 --- /dev/null +++ b/common/License/License.vcxproj @@ -0,0 +1,103 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {D3231052-575C-4D58-BA38-2C01B10BF205} + Win32Proj + License + + + + Application + true + v140 + MultiByte + + + Application + false + v140 + true + MultiByte + + + + + + + + + + + + + true + ../../include/cryptopp/;$(IncludePath) + D:\AppServ\www\www + + + false + ../../include/cryptopp/;$(IncludePath) + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;ENABLE_LICENSE;%(PreprocessorDefinitions) + true + MultiThreadedDebugDLL + + + Console + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;ENABLE_LICENSE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + + + + + + + + + Create + Create + + + + + + \ No newline at end of file diff --git a/common/License/License.vcxproj.filters b/common/License/License.vcxproj.filters new file mode 100644 index 0000000..e89217a --- /dev/null +++ b/common/License/License.vcxproj.filters @@ -0,0 +1,48 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/common/License/LicenseMaker.cpp b/common/License/LicenseMaker.cpp new file mode 100644 index 0000000..031152c --- /dev/null +++ b/common/License/LicenseMaker.cpp @@ -0,0 +1,159 @@ +// License.cpp : Defines the entry point for the console application. +// + +#include "stdafx.h" +#include +#include + +#include "License.h" + +// BOOLEAN与asn.h中的冲突,不得不将asn.h中的改了,希望有人帮忙解决这个问题 +#include + +// 文件选择信息 +CHAR strFile[MAX_PATH] = { 0 }; +CHAR strFileTitle[MAX_PATH] = { 0 }; + +CHAR strFilter[MAX_PATH] = "*.exe\0*.exe\0TdxW.exe\0TdxW.exe\0Tc.exe\0Tc.exe\0all\0*.*\0"; + +BOOL OpenFileDlg() +{ + OPENFILENAMEA ofn; + ZeroMemory(&ofn, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.lpstrFile = strFile; + ofn.lpstrFile[0] = '\0'; + ofn.nMaxFile = sizeof(strFile); + ofn.lpstrFilter = strFilter; + ofn.nFilterIndex = 1; + ofn.lpstrFileTitle = strFileTitle; + ofn.lpstrFileTitle[0] = ('\0'); + ofn.nMaxFileTitle = sizeof(strFileTitle); + ofn.lpstrInitialDir = NULL; + ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + + return GetOpenFileNameA(&ofn); +} + +void Select1() +{ + char priKey[128] = { 0 }; + char pubKey[128] = { 0 }; + char seed[1024] = { 0 }; + + char fname[64] = { 0 }; + + cout << "请输入文件名,不要带扩展名,系统将自动添加扩展名" << endl; + cin >> fname; + + // 生成 RSA 密钥对 + sprintf_s(priKey, "%s.PrivateKey", fname); // 生成的私钥文件 + sprintf_s(pubKey, "%s.PublicKey", fname); + strcpy(seed, "seed"); + GenerateRSAKey(1024, priKey, pubKey, seed); + + cout << "已经生成在当前目录下,您需要自己修改文件名" << endl; +} + +void Select2() +{ + cout << "选择授权文件:" << endl; + + CLicense license; + + memcpy(strFilter, "*.License\0*.License\0All\0*.*\0", sizeof(strFilter)); + if (OpenFileDlg()) + { + // 设置授权文件 + license.SetLicensePath(strFile); + + string s = license.LoadStringFromFile(strFile); + + // 签名 + license.Sign(s.c_str()); + } + + cout << "签名已经生成,请查看" << endl; +} + +int _tmain(int argc, _TCHAR* argv[]) +{ + //printf("START"); + //return 0; + + // 如果带参数,按参数进行操作 + if (argc == 5) + { + CLicense license; + string s; + + bool bOK1 = false; + bool bOK2 = false; + + int arg = 0; + /* Parse command line arguments. */ + while (++arg < argc) { + if (!strcmp(argv[arg], "--License") || + !strcmp(argv[arg], "--license")) { + license.SetLicensePath(argv[arg + 1]); + bOK1 = true; + } + else if (!strcmp(argv[arg], "--PrivateKey") || + !strcmp(argv[arg], "--privateKey")) { + strcpy(license.m_PrivateKeyPath, argv[arg + 1]); + s = license.LoadStringFromFile(license.m_LicensePath); + bOK2 = true; + } + else { + if (argc > 1) + printf("Invalid command line argument: %s\n", argv[arg]); + } + arg++; + } + + if (bOK1&&bOK2) + { + license.Sign(s.c_str()); + printf("OK"); + } + else + { + printf("NO"); + } + return 1; + } + + cout << "=====授权生成工具v1.0=====" << endl; +SELECT: + cout << "请选择:" << endl; + cout << " 1.生成公钥文件和私钥文件" << endl; // + cout << " 2.使用已有私钥签名文件" << endl;// + cout << " 0.退出" << endl; // + cout << endl; + + int select = _getch(); + cout << (char)select << endl; + switch (select - '0') + { + case 1: + Select1(); + goto SELECT; + break; + case 2: + Select2(); + goto SELECT; + break; + case 0: + break; + default: + goto SELECT; + break; + } + + + printf("按任意键关闭"); + getchar(); + + return 0; +} + diff --git a/common/License/README.md b/common/License/README.md new file mode 100644 index 0000000..0802cbe --- /dev/null +++ b/common/License/README.md @@ -0,0 +1,26 @@ +# License授权模块使用说明 + +## 项目目的 +此开源项目为了鼓励更多的开发人员参与到项目中,商业化部分功能或服务是一条可行的途径。 +如果要进行商业化开发,授权功能必不可少。开发人员自己开发授权模块要耗费不少时间,所以这里直接提供一个示例。
+开发人员只要在自己的代码中嵌入api和部分函数即可。 +同时我们还开源了授权网站的代码www,开发者可以自己部署在服务器上进行授权的分发。 + +## 原理与过程 +* 客户端:分发的授权文件、分发的签名文件、api中嵌入公钥。 + * api利用公钥检查明文与签名是否正确 + * 在签名正确的前提下,比较明文中的记录与当前交易环境是否匹配 +* 服务器:签名生成工具、私钥。 + * 调整好客户提交的授权并生成文件 + * 使用工具和私钥生成签名文件 + +## 编译 +AllCppProjects中将License项目启用,编译报randpool.h找不到。 +到include目录下解压cryptopp.zip到当前文件夹,lib目录下解压cryptlib_vs2015.zip到当前文件夹。 +再次编译可以生成License.exe,这就是由api开发人员使用的生成公私钥和签名的工具。 + + +## 在项目中使用 +在自己的项目中添加License.h和License.cpp等文件,参考CTP中的使用方法 +使用License.exe生成公私钥,将公钥复制到原代码中编译进去,私钥要自己好好保存。 +后期将利用它进行授权的生成。 diff --git a/QuantBox_XAPI_TEST/ReadMe.txt b/common/License/ReadMe.txt similarity index 80% rename from QuantBox_XAPI_TEST/ReadMe.txt rename to common/License/ReadMe.txt index f3d7fde..95da445 100644 --- a/QuantBox_XAPI_TEST/ReadMe.txt +++ b/common/License/ReadMe.txt @@ -1,27 +1,27 @@ ======================================================================== - CONSOLE APPLICATION : QuantBox_XAPI_TEST Project Overview + CONSOLE APPLICATION : License Project Overview ======================================================================== -AppWizard has created this QuantBox_XAPI_TEST application for you. +AppWizard has created this License application for you. This file contains a summary of what you will find in each of the files that -make up your QuantBox_XAPI_TEST application. +make up your License application. -QuantBox_XAPI_TEST.vcxproj +License.vcxproj This is the main project file for VC++ projects generated using an Application Wizard. It contains information about the version of Visual C++ that generated the file, and information about the platforms, configurations, and project features selected with the Application Wizard. -QuantBox_XAPI_TEST.vcxproj.filters +License.vcxproj.filters This is the filters file for VC++ projects generated using an Application Wizard. It contains information about the association between the files in your project and the filters. This association is used in the IDE to show grouping of files with similar extensions under a specific node (for e.g. ".cpp" files are associated with the "Source Files" filter). -QuantBox_XAPI_TEST.cpp +License.cpp This is the main application source file. ///////////////////////////////////////////////////////////////////////////// @@ -29,7 +29,7 @@ Other standard files: StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file - named QuantBox_XAPI_TEST.pch and a precompiled types file named StdAfx.obj. + named License.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: diff --git a/common/License/stdafx.cpp b/common/License/stdafx.cpp new file mode 100644 index 0000000..3ae5257 --- /dev/null +++ b/common/License/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// License.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/common/License/stdafx.h b/common/License/stdafx.h new file mode 100644 index 0000000..88d7581 --- /dev/null +++ b/common/License/stdafx.h @@ -0,0 +1,20 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#include +#include + + + +// TODO: reference additional headers your program requires here +// BOOLEAN与asn.h中的冲突,不得不将asn.h中的改了,希望有人帮忙解决这个问题 +// 已经解决,移动到这就可以了 +#include +#include +#pragma comment(lib, "IPHLPAPI.lib") diff --git a/common/License/targetver.h b/common/License/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/common/License/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/QuantBox_Queue/ArrayLockFreeQueue.h b/common/Queue/ArrayLockFreeQueue.h similarity index 100% rename from QuantBox_Queue/ArrayLockFreeQueue.h rename to common/Queue/ArrayLockFreeQueue.h diff --git a/QuantBox_Queue/ArrayLockFreeQueueImp.h b/common/Queue/ArrayLockFreeQueueImp.h similarity index 100% rename from QuantBox_Queue/ArrayLockFreeQueueImp.h rename to common/Queue/ArrayLockFreeQueueImp.h diff --git a/common/Queue/Makefile b/common/Queue/Makefile new file mode 100644 index 0000000..266e903 --- /dev/null +++ b/common/Queue/Makefile @@ -0,0 +1,11 @@ +include ../../Makefile.global + +LFLAGS=-Wl,-rpath,\$$ORIGIN -ldl +ALL=libQueue.so + +all: $(ALL) + +libQueue.so: main.o MsgQueue.o RemoteQueue.o $(DEPS) + $(CXX) --shared $(IFLAGS) $(CFLAGS) -I../CTP_Quote -o $@ $^ + + diff --git a/common/Queue/MsgQueue.cpp b/common/Queue/MsgQueue.cpp new file mode 100644 index 0000000..3952e1a --- /dev/null +++ b/common/Queue/MsgQueue.cpp @@ -0,0 +1,140 @@ +#include "stdafx.h" +#include "MsgQueue.h" + +CMsgQueue::CMsgQueue()//:m_queue(1024) +{ + m_hThread = nullptr; + m_bRunning = false; + m_bDirectOutput = false; + + //回调函数地址指针 + m_fnOnResponse = nullptr; +} + +void CMsgQueue::Clear() +{ + ResponeItem* pItem = nullptr; + //清空队列 + while (m_queue.try_dequeue(pItem)) + { + if (pItem->bNeedDelete) + { + delete[] pItem->ptr1; + delete[] pItem->ptr2; + delete[] pItem->ptr3; + } + delete pItem; + } +} + +bool CMsgQueue::Process() +{ + try + { + ResponeItem* pItem = nullptr; + if (m_queue.try_dequeue(pItem)) + { + Output(pItem); + if (pItem->bNeedDelete) + { + // 删除的是数组,目前是自己模块创建的自己删 + delete[] pItem->ptr1; + delete[] pItem->ptr2; + delete[] pItem->ptr3; + } + delete pItem; + return true; + } + return false; + } + catch (...) + { + return false; + } +} + +void CMsgQueue::Output(ResponeItem* pItem) +{ + try + { + if (m_fnOnResponse) + (*m_fnOnResponse)(pItem->type, pItem->pApi1, pItem->pApi2, pItem->double1, pItem->double2, pItem->ptr1, pItem->size1, pItem->ptr2, pItem->size2, pItem->ptr3, pItem->size3); + } + catch (...) + { + m_fnOnResponse = nullptr; + } +} + +void CMsgQueue::StartThread() +{ + if(nullptr == m_hThread) + { + m_bRunning = true; + m_hThread = new thread(ProcessThread,this); + } +} + +void CMsgQueue::StopThread() +{ + m_bRunning = false; + m_cv.notify_all(); + this_thread::sleep_for(chrono::milliseconds(10)); + lock_guard cl(m_mtx_del); + if(m_hThread) + { + // 这里很少有机会执行 + m_hThread->join(); + m_hThread = nullptr; + } +} + + +void CMsgQueue::RunInThread() +{ + try + { + while (m_bRunning) + { + if (Process()) + { + } + else + { + // 空闲时等1ms,如果立即有事件过来就晚了1ms + //this_thread::sleep_for(chrono::milliseconds(1)); + + // 空闲时过来等1ms,没等到就回去再试 + // 如过正好等到了,就立即去试,应当会快一点吧? + + // wait_for的效果为何不是遇到事件后就立即返回?而是一定要等满时间?太奇怪了,这个地方可以改成seconds(10)就知道效果了 + unique_lock lck(m_mtx); + //m_cv.wait_for(lck, std::chrono::seconds(10), [this]{return m_bRunning == false; }); //这种写法会导致收到事件立即处理的功能失效 + m_cv.wait_for(lck, std::chrono::seconds(2)); + } + } + } + catch (...) + { + + } + + // 这句加了有效果吗? + // 加了后可能报以下错,但不当了 +/* + ************** Exception Text ************** + System.Runtime.InteropServices.SEHException(0x80004005) : External component has thrown an exception. + at XAPI.Proxy.XRequest(Byte type, IntPtr pApi1, IntPtr pApi2, Double double1, Double double2, IntPtr ptr1, Int32 size1, IntPtr ptr2, Int32 size2, IntPtr ptr3, Int32 size3) in D : \Users\Kan\Documents\GitHub\XAPI2\languages\CSharp\XAPI_CSharp\Proxy.cs:line 79 +*/ + //m_hThread->detach(); + + + // 清理线程 + m_hThread = nullptr; + m_bRunning = false; +} + +ConfigInfoField* CMsgQueue::Config(ConfigInfoField* pConfigInfo) +{ + return nullptr; +} diff --git a/QuantBox_Queue/MsgQueue.h b/common/Queue/MsgQueue.h similarity index 88% rename from QuantBox_Queue/MsgQueue.h rename to common/Queue/MsgQueue.h index c528364..c88d8e3 100644 --- a/QuantBox_Queue/MsgQueue.h +++ b/common/Queue/MsgQueue.h @@ -6,11 +6,11 @@ #include #include -#include "../include/CrossPlatform.h" +#include "../../include/CrossPlatform.h" -#include "../include/QueueHeader.h" -#include "../include/QueueStruct.h" -#include "../include/ApiStruct.h" +#include "../../include/QueueHeader.h" +#include "../../include/QueueStruct.h" +#include "../../include/ApiStruct.h" //#include "readerwriterqueue.h" //#include "concurrentqueue.h" @@ -23,7 +23,10 @@ using namespace std; #pragma warning(push) #pragma warning(disable:4251) -class DLL_PUBLIC CMsgQueue +// 在队列dll中是导出函数 +// 在api dll中不是导出函数,是导入函数 + +class QUEUE_DLL_PUBLIC CMsgQueue { public: bool m_bDirectOutput; @@ -38,6 +41,10 @@ class DLL_PUBLIC CMsgQueue public: //清空队列 void Clear(); + unsigned long Size() + { + return m_queue.size(); + } //可以由外部发起,顺序处理队列触发回调函数 bool Process(); @@ -49,7 +56,7 @@ class DLL_PUBLIC CMsgQueue //将外部的函数地址注册到队列 void Register(void* pCallback,void* pClass) { - m_fnOnRespone = (fnOnRespone)pCallback; + m_fnOnResponse = (fnOnResponse)pCallback; // 目前没啥用,只是为了与行情和交易的接口统一 m_pClass = pClass; } @@ -78,12 +85,12 @@ class DLL_PUBLIC CMsgQueue { try { - if (m_fnOnRespone) - return (*m_fnOnRespone)(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + if (m_fnOnResponse) + return (*m_fnOnResponse)(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); } catch (...) { - m_fnOnRespone = nullptr; + m_fnOnResponse = nullptr; } return nullptr; } @@ -152,6 +159,7 @@ class DLL_PUBLIC CMsgQueue return; } ResponeItem* pItem = new ResponeItem; + //memset(pItem, 0, sizeof(ResponeItem)); pItem->bNeedDelete = true; pItem->type = type; @@ -183,6 +191,7 @@ class DLL_PUBLIC CMsgQueue return; } ResponeItem* pItem = new ResponeItem; + //memset(pItem, 0, sizeof(ResponeItem)); pItem->bNeedDelete = false; pItem->type = type; @@ -227,7 +236,7 @@ class DLL_PUBLIC CMsgQueue // ConcurrentQueue m_queue; ArrayLockFreeQueue m_queue; - fnOnRespone m_fnOnRespone; + fnOnResponse m_fnOnResponse; void* m_pClass; }; diff --git a/QuantBox_Queue/QuantBox_Queue.cbp b/common/Queue/Queue.cbp similarity index 100% rename from QuantBox_Queue/QuantBox_Queue.cbp rename to common/Queue/Queue.cbp diff --git a/QuantBox_Queue/QuantBox_Queue.depend b/common/Queue/Queue.depend similarity index 100% rename from QuantBox_Queue/QuantBox_Queue.depend rename to common/Queue/Queue.depend diff --git a/QuantBox_Queue/QuantBox_Queue.vcxproj b/common/Queue/Queue.vcxproj similarity index 51% rename from QuantBox_Queue/QuantBox_Queue.vcxproj rename to common/Queue/Queue.vcxproj index 438eca1..3153144 100644 --- a/QuantBox_Queue/QuantBox_Queue.vcxproj +++ b/common/Queue/Queue.vcxproj @@ -1,10 +1,6 @@  - - Debug64 - Win32 - Debug64 x64 @@ -13,60 +9,46 @@ Debug Win32 - - Debug + + Release64 x64 Release Win32 - - Release - x64 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F} Win32Proj - QuantBox_Queue + Queue + Queue + 8.1 DynamicLibrary true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 + v140 Unicode DynamicLibrary true - v120 + v140 Unicode DynamicLibrary false - v120 + v140 true Unicode - + DynamicLibrary false - v120 + v140 true Unicode @@ -76,55 +58,42 @@ - - - - - - - + true - QuantBox_Queue_x86 - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\Tdx\x86 - - - true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI - QuantBox_Queue_x64 - - - true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014 + $(ProjectName)_$(PlatformTarget)d + ..\..\bin\$(Configuration)\$(PlatformTarget)\$(ProjectName) true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI - QuantBox_Queue_x64 + ..\..\bin\$(Configuration)\$(PlatformTarget)\$(ProjectName) + $(ProjectName)_$(PlatformTarget)d false - QuantBox_Queue_x86 - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\TongShi\x86 + $(ProjectName)_$(PlatformTarget) + ..\..\bin\$(Configuration)\$(PlatformTarget)\$(ProjectName) - + false + ..\..\bin\$(Configuration)\$(PlatformTarget)\$(ProjectName) + $(ProjectName)_$(PlatformTarget) Use Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;BUILDING_QUEUE_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true ..\include\ZeroMQ\libzmq\include;..\include\ZeroMQ\czmq\include;%(AdditionalIncludeDirectories) @@ -139,45 +108,16 @@ - xcopy "$(TargetPath)" "$(SolutionDir)XAPI\" /Y + + - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;%(PreprocessorDefinitions) - true - - - Windows - true - - - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;%(PreprocessorDefinitions) - true - - - Windows - true - - - - Use Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;BUILDING_QUEUE_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -194,7 +134,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;BUILDING_QUEUE_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -206,14 +146,14 @@ - + Level3 Use MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTBOX_QUEUE_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;QUEUE_EXPORTS;BUILDING_DLL;BUILDING_QUEUE_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -221,60 +161,32 @@ true true true - QuantBox_Queue.def + + - - - - - + + + - - false - false - false - false - Use - Use - Use - Use - false - false - - - - - - - Use - Use - Use - Use - - - Use - Use - Use - Use - + + + Create - Create - Create Create Create - Create + Create diff --git a/QuantBox_Queue/QuantBox_Queue.vcxproj.filters b/common/Queue/Queue.vcxproj.filters similarity index 81% rename from QuantBox_Queue/QuantBox_Queue.vcxproj.filters rename to common/Queue/Queue.vcxproj.filters index f77e535..673ccfd 100644 --- a/QuantBox_Queue/QuantBox_Queue.vcxproj.filters +++ b/common/Queue/Queue.vcxproj.filters @@ -30,22 +30,16 @@ Header Files - - include - - - include - - - include + + Header Files - - include + + Header Files - - include + + Header Files - + Header Files diff --git a/common/Queue/ReadMe.txt b/common/Queue/ReadMe.txt new file mode 100644 index 0000000..89a2d30 --- /dev/null +++ b/common/Queue/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : Queue Project Overview +======================================================================== + +AppWizard has created this Queue DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your Queue application. + + +Queue.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +Queue.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +Queue.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named Queue.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/QuantBox_Queue/RemoteQueue.cpp b/common/Queue/RemoteQueue.cpp similarity index 77% rename from QuantBox_Queue/RemoteQueue.cpp rename to common/Queue/RemoteQueue.cpp index 83456d0..1ef77de 100644 --- a/QuantBox_Queue/RemoteQueue.cpp +++ b/common/Queue/RemoteQueue.cpp @@ -33,13 +33,13 @@ void CRemoteQueue::RunInThread() } else { - // ʱ1ms,¼1ms + // 空闲时等1ms,如果立即有事件过来就晚了1ms //this_thread::sleep_for(chrono::milliseconds(1)); - // ʱ1ms,ûȵͻȥ - // õȵˣȥԣӦһ? + // 空闲时过来等1ms,没等到就回去再试 + // 如过正好等到了,就立即去试,应当会快一点吧? unique_lock lck(m_mtx); - m_cv.wait_for(lck, std::chrono::seconds(1)); + m_cv.wait_for(lck, std::chrono::seconds(2)); } } @@ -50,7 +50,7 @@ void CRemoteQueue::RunInThread() m_ctx = nullptr; } #endif - // ߳ + // 清理线程 m_hThread = nullptr; m_bRunning = false; } @@ -58,7 +58,7 @@ void CRemoteQueue::RunInThread() void CRemoteQueue::Output(ResponeItem* pItem) { #ifdef _REMOTE - // + // 发送数据 if (pItem->ptr1 && pItem->size1>0) { int ret = zsocket_sendmem(m_pubisher, pItem->ptr1, pItem->size1, ZFRAME_DONTWAIT); diff --git a/QuantBox_Queue/RemoteQueue.h b/common/Queue/RemoteQueue.h similarity index 92% rename from QuantBox_Queue/RemoteQueue.h rename to common/Queue/RemoteQueue.h index 759288a..751ded0 100644 --- a/QuantBox_Queue/RemoteQueue.h +++ b/common/Queue/RemoteQueue.h @@ -15,7 +15,7 @@ -class DLL_PUBLIC CRemoteQueue : +class QUEUE_DLL_PUBLIC CRemoteQueue : public CMsgQueue { public: diff --git a/QuantBox_Queue/atom_opt.h b/common/Queue/atom_opt.h similarity index 100% rename from QuantBox_Queue/atom_opt.h rename to common/Queue/atom_opt.h diff --git a/QuantBox_Queue/atomicops.h b/common/Queue/atomicops.h similarity index 100% rename from QuantBox_Queue/atomicops.h rename to common/Queue/atomicops.h diff --git a/QuantBox_Queue/concurrentqueue.h b/common/Queue/concurrentqueue.h similarity index 100% rename from QuantBox_Queue/concurrentqueue.h rename to common/Queue/concurrentqueue.h diff --git a/common/Queue/dllmain.cpp b/common/Queue/dllmain.cpp new file mode 100644 index 0000000..69b5891 --- /dev/null +++ b/common/Queue/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/QuantBox_Queue/main.cpp b/common/Queue/main.cpp similarity index 66% rename from QuantBox_Queue/main.cpp rename to common/Queue/main.cpp index ba844b6..e4c793c 100644 --- a/QuantBox_Queue/main.cpp +++ b/common/Queue/main.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" #include "MsgQueue.h" -#include "../include/QueueHeader.h" -#include "../include/QueueEnum.h" -#include "../include/QueueStruct.h" +#include "../../include/QueueHeader.h" +#include "../../include/QueueEnum.h" +#include "../../include/QueueStruct.h" -#include "../include/ApiHeader.h" -#include "../include/ApiStruct.h" +#include "../../include/ApiHeader.h" +#include "../../include/ApiStruct.h" inline CMsgQueue* GetQueue(void* pMsgQueue) { @@ -17,13 +17,13 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do RequestType rt = (RequestType)type; switch (rt) { - case GetApiType: + case RequestType_GetApiTypes: return nullptr; - case GetApiVersion: + case RequestType_GetApiVersion: return (void*)"0.4.0.20150526"; - case GetApiName: + case RequestType_GetApiName: return (void*)"Queue"; - case Create: + case RequestType_Create: return new CMsgQueue(); default: break; @@ -38,24 +38,24 @@ void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, do switch (rt) { - case Release: + case RequestType_Release: delete pQueue; return 0; - case Register: + case RequestType_Register: pQueue->Register(ptr1,ptr2); break; - case Config: + case RequestType_Config: return (void*)pQueue->Config((ConfigInfoField*)ptr1); - case Connect: + case RequestType_Connect: pQueue->StartThread(); break; - case Disconnect: + case RequestType_Disconnect: pQueue->StopThread(); break; - case Clear: + case RequestType_Clear: pQueue->Clear(); break; - case Process: + case RequestType_Process: pQueue->Process(); break; default: diff --git a/QuantBox_Queue/readerwriterqueue.h b/common/Queue/readerwriterqueue.h similarity index 100% rename from QuantBox_Queue/readerwriterqueue.h rename to common/Queue/readerwriterqueue.h diff --git a/QuantBox_Queue/stdafx.cpp b/common/Queue/stdafx.cpp similarity index 100% rename from QuantBox_Queue/stdafx.cpp rename to common/Queue/stdafx.cpp diff --git a/QuantBox_Queue/stdafx.h b/common/Queue/stdafx.h similarity index 100% rename from QuantBox_Queue/stdafx.h rename to common/Queue/stdafx.h diff --git a/common/Queue/targetver.h b/common/Queue/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/common/Queue/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/common/www/CheckSignin.php b/common/www/CheckSignin.php new file mode 100644 index 0000000..abf0360 --- /dev/null +++ b/common/www/CheckSignin.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/common/www/ConvertCode.vbs b/common/www/ConvertCode.vbs new file mode 100644 index 0000000..60da1cc --- /dev/null +++ b/common/www/ConvertCode.vbs @@ -0,0 +1,113 @@ +'/*=========================================================== +' * Intro ҪתĶļ/ļϵļϼ +' * FileName ConvertCode.vbs +' * Author Florian +' * Version v1.0 +' * WEB http://www.cnblogs.com/fanzhidongyzby +' * Email fanzhidongyzby@163.com +' * LastModify 2014-06-11 00:39:58 +' *==========================================================*/ + +'------------------------------------------------- +'ñ룺Ĭ utf-8 --> gb2312 +'------------------------------------------------- + +SrcCode="utf-8" +DestCode="gb2312" + +'------------------------------------------------- +' +'------------------------------------------------- +' ʹWSH.EchoֱִлᵯҪͨcscript.exeִ + +Set fs = CreateObject("scripting.filesystemobject") +Set objArgs = WScript.Arguments +If objArgs.Count>0 Then + For I = 0 To objArgs.Count - 1 + FileUrl = objArgs(I) + Call ConvertDir(FileUrl) + Next +Else + 'MsgBox "ûļ/ļб룡" + WSH.Echo "NO" + wscript.quit +End If +'MsgBox "תɹ" +WSH.Echo "OK" + +'------------------------------------------------- +':ConvertDir +':Ŀ¼ڵļбת +'------------------------------------------------- + +Function ConvertDir(DirUrl) + If fs.FileExists(DirUrl) Then + Call ConvertFile(DirUrl) + Else + Call SearchDir(DirUrl) + End If +End Function + + +'------------------------------------------------- +':SearchDir +':ݹĿ¼ڵļбת +'------------------------------------------------- + +Function SearchDir(path) + Set folder = fs.getfolder(path) + Set subfolders = folder.subfolders + Set Files = folder.Files + For Each i In Files + Call ConvertFile(i.path) + Next + For Each j In subfolders + Call SearchDir(j.path) + Next +End Function + +'------------------------------------------------- +':ConvertFile +':һļбת +'------------------------------------------------- + +Function ConvertFile(FileUrl) + Call WriteToFile(FileUrl, ReadFile(FileUrl, SrcCode), DestCode) +End Function + +'------------------------------------------------- +':ReadFile +':AdoDb.Streamȡָʽıļ +'------------------------------------------------- + +Function ReadFile(FileUrl, CharSet) + Dim Str + Set stm = CreateObject("Adodb.Stream") + stm.Type = 2 + stm.mode = 3 + stm.charset = CharSet + stm.Open + stm.loadfromfile FileUrl + Str = stm.readtext + stm.Close + Set stm = Nothing + ReadFile = Str +End Function + +'------------------------------------------------- +':WriteToFile +':AdoDb.Streamдָʽıļ +'------------------------------------------------- + +Function WriteToFile (FileUrl, Str, CharSet) + Set stm = CreateObject("Adodb.Stream") + stm.Type = 2 + stm.mode = 3 + stm.charset = CharSet + stm.Open + stm.WriteText Str + stm.SaveToFile FileUrl, 2 + stm.flush + stm.Close + Set stm = Nothing +End Function \ No newline at end of file diff --git a/common/www/DirFileFun.php b/common/www/DirFileFun.php new file mode 100644 index 0000000..a2d5dac --- /dev/null +++ b/common/www/DirFileFun.php @@ -0,0 +1,69 @@ +$elem) { + $content .= "[".$key."]\n"; + foreach ($elem as $key2=>$elem2) { + if(is_array($elem2)) + { + for($i=0;$i$elem) { + if(is_array($elem)) + { + for($i=0;$i \ No newline at end of file diff --git a/common/www/EnumFun.php b/common/www/EnumFun.php new file mode 100644 index 0000000..fd1a1c8 --- /dev/null +++ b/common/www/EnumFun.php @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/common/www/Home.php b/common/www/Home.php new file mode 100644 index 0000000..567de65 --- /dev/null +++ b/common/www/Home.php @@ -0,0 +1,36 @@ + + + + +主页 + + +当前用户: 当前IP: 退出 关于我们 +
+

用户信息

+查看/修改个人信息,修改密码 +
+

产品信息

+查看产品列表,下载与本授权系统配套的DLL +
+

授权信息

+查看授权列表,添加授权 += 2) {?> +
+

审核管理

+审核用户 + + +
+

管理员专区

+审核用户 +查看审核人员列表 +注册用户 +切换用户ID + + + \ No newline at end of file diff --git a/common/www/JSON.php b/common/www/JSON.php new file mode 100644 index 0000000..e196fa5 --- /dev/null +++ b/common/www/JSON.php @@ -0,0 +1,48 @@ + 1000) { + die('possible deep recursion attack'); + } + foreach ($array as $key => $value) { + if (is_array($value)) { + arrayRecursive($array[$key], $function, $apply_to_keys_also); + } else { + $array[$key] = $function($value); + } + + if ($apply_to_keys_also && is_string($key)) { + $new_key = $function($key); + if ($new_key != $key) { + $array[$new_key] = $array[$key]; + unset($array[$key]); + } + } + } + $recursive_counter--; +} + +/************************************************************** + * + * 将数组转换为JSON字符串(兼容中文) + * @param array $array 要转换的数组 + * @return string 转换得到的json字符串 + * @access public + * + *************************************************************/ +function JSON($array) { + arrayRecursive($array, 'urlencode', true); + $json = json_encode($array); + return urldecode($json); +} +?> \ No newline at end of file diff --git a/common/www/Join.php b/common/www/Join.php new file mode 100644 index 0000000..8735dbe --- /dev/null +++ b/common/www/Join.php @@ -0,0 +1,67 @@ +16) +{ + $_SESSION['Error'] = '用户名长度不对'; + header("Location:".getenv("HTTP_REFERER")); + return; +} + +if($_POST['Password'] != $_POST['Password2']) +{ + $_SESSION['Error'] = '两次密码不同!'; + header("Location:".getenv("HTTP_REFERER")); + return; +} + +// 检查用户是否已经存在,因为在有些MDB2上报的错太不靠谱 +$query = 'SELECT * FROM UserInfo WHERE UserID = ' + .$mdb2->quote($_POST['UserID'],"text"); +//echo $query; +$result = $mdb2->query($query); + +if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); +} + +$row = $result->fetchRow(); + +if(!empty($row)) +{ + $_SESSION['Error'] = '用户名已经存在'; + header("Location:".getenv("HTTP_REFERER")); + return; +} + +// 插入用户 +$query = + 'INSERT INTO UserInfo(UserID,Password,' + .'RegisterTime,IP) ' + .' VALUES(' + .$mdb2->quote($_POST['UserID'],"text").',' + .$mdb2->quote(md5($_POST['Password']),"text").',' + .'NOW(),' + .$mdb2->quote($_SERVER['REMOTE_ADDR'],"text").')'; +//echo $query; +$result = $mdb2->query($query); + +if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); +} + +$_SESSION['Error'] = '注册成功,请用新账号登录!'; +header("Location:Signin.php"); +return; +?> \ No newline at end of file diff --git a/common/www/License.exe b/common/www/License.exe new file mode 100644 index 0000000..5924d59 Binary files /dev/null and b/common/www/License.exe differ diff --git a/common/www/LicenseInfoAction.php b/common/www/LicenseInfoAction.php new file mode 100644 index 0000000..b38b38f --- /dev/null +++ b/common/www/LicenseInfoAction.php @@ -0,0 +1,172 @@ +quote($_GET['ID'],"integer") + .' AND Status <4 '; + + // 只能删除自己的吗?管理员可以更新所有的 + if($_SESSION['Right'] <= 2) + { + $query = $query.' AND User1 = '.$mdb2->quote($_SESSION['UserID'],"text"); + } + + $result = $mdb2->query($query); + + if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); + } + + header("Location:".getenv("HTTP_REFERER")); + return; + } +} + +if(get_magic_quotes_gpc()){ + function stripslashes_deep($value){ + $value=is_array($value)?array_map('stripslashes_deep',$value):stripslashes($value); + return $value; + } + $_POST=array_map('stripslashes_deep',$_POST); + $_GET=array_map('stripslashes_deep',$_GET); + $_COOKIE=array_map('stripslashes_deep',$_COOKIE); + $_REQUEST=array_map('stripslashes_deep',$_REQUEST); +} + +$sampleData = array( + 'License' => array( + 'ExpireDate' => $_POST['ExpireDate'], + 'Trial' => $_POST['Trial'], + 'MachineID' => $_POST['MachineID'], + 'Product' => $_POST['Product'], + ), + 'User' => array( + 'Account' => $_POST['Account'], + 'UserName' => $_POST['UserName'], + 'Info' => $_POST['Info'], + )); + +$content1 = json_encode($sampleData); + +// 接收各种提交,进行处理 + +// 1.用户新建一个授权 +// 2.用户编辑授权 +// 3.审核员审核左边 +// 4.审核员审核右边 + +if(isset($_POST['Create'])) +{ + $query = "SELECT COUNT(*) AS NUM_A FROM LicenceInfo WHERE " + ." User1 = ".$mdb2->quote($_SESSION['UserID'],"text") + ." AND Status <3 "; + //echo $query; + $result = $mdb2->query($query); + $row = $result->fetchRow(); + //print_r($row); + //echo $row[strtolower('NUM_A')]; + $count = 5; + if($row[strtolower('NUM_A')]>$count) + { + echo "非审核的授权超过 $count 个,请等部分批准后再新申请"; + return; + } + // 插入用户 + $query = 'INSERT INTO LicenceInfo(' + .'User1,Time1,Content1,' + .'Product,Status,Remark) ' + .' VALUES(' + .$mdb2->quote($_SESSION['UserID'],"text").',' + .'NOW(),' + .$mdb2->quote($content1,"text").',' + .$mdb2->quote($_POST['Product'],"text").',' + .$mdb2->quote("1","text").',' + .$mdb2->quote($_POST['Remark'],"text") + .')'; + + $result = $mdb2->query($query); + + if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); + } + + header("Location:LicenseInfoListView.php"); + return; +} + +if(isset($_POST['Update'])) +{ + $query = 'UPDATE LicenceInfo SET ' + .' Time1 = NOW(),Content1 = ' + .$mdb2->quote($content1,"text") + .' , Remark = ' + .$mdb2->quote($_POST['Remark'],"text") + .' , Status = 1' + .' WHERE ID = ' + .$mdb2->quote($_GET['ID'],"integer"); + + // 只能更新自己的吗?管理员可以更新所有的 + if($_SESSION['Right'] <= 2) + { + $query = $query.' AND User1 = '.$mdb2->quote($_SESSION['UserID'],"text"); + } + + $result = $mdb2->query($query); + if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); + } + + header("Location:".getenv("HTTP_REFERER")); + return; +} + +if(isset($_POST['Review_Left'])||isset($_POST['Review_Right'])) +{ + if(in_array($_POST['Product'],$_SESSION['Products'],true)) + { + + } + else + { + if($_SESSION['Right'] > 2) + { + } + else + { + echo "您没有权限审核此授权信息"; + return; + } + } + + $query = 'UPDATE LicenceInfo SET User2 = ' + .$mdb2->quote($_SESSION['UserID'],"text") + .' , Time2 = NOW(),Content2 = ' + .$mdb2->quote($content1,"text") + .' , Status = ' + .$mdb2->quote($_POST['Status'],"text") + .' , Remark = ' + .$mdb2->quote($_POST['Remark'],"text") + .' WHERE ID = ' + .$mdb2->quote($_GET['ID'],"integer") + .' AND Product = ' + .$mdb2->quote($_POST['Product'],"text") + ; + + $result = $mdb2->query($query); + + if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); + } + + header("Location:".getenv("HTTP_REFERER")); + return; +} +?> \ No newline at end of file diff --git a/common/www/LicenseInfoAdd.php b/common/www/LicenseInfoAdd.php new file mode 100644 index 0000000..937f84c --- /dev/null +++ b/common/www/LicenseInfoAdd.php @@ -0,0 +1,57 @@ +quote($_SESSION['UserID'],"text") + ." AND Status <3 "; +//echo $query; +$result = $mdb2->query($query); +$row = $result->fetchRow(); +//print_r($row); +//echo $row[strtolower('NUM_A')]; +if($row[strtolower('NUM_A')]>$PendingLicenseCount) +{ + echo "未审核的授权超过 $PendingLicenseCount 个,请等部分批准后再新申请"; + return; +} + +$result = $mdb2->query( + 'SELECT * FROM ProductInfo '); +if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); +} +?> + + + +申请授权 + + + +
+

注意:您的申请经过人工审核后才能通过,请准确填写。被打回来后重新填写将耽误双方的时间

+

Product: 产品ID

+

ExpireDate: "/>到期时间,格式:例如20160315

+

Trial: 单次会话下单次数,0表示无限制

+

MachineID: 机器码,如果没有绑定账号就必须绑定机器码,支持正则

+

Account: 登录时所用的客户号,支持正则

+

UserName: 接口登录后所能取到的客户真实姓名,不支持正则

+

Info: 额外信息,一般由审核员填写,会写入到授权文件中

+
+

上面的信息如果不会填写,那就把*.Licence中的文本直接粘贴到下面的备注即可,后面的事交审核人员处理

+

Remark: 备注,需告知审核员的消息

+ +
+ + + \ No newline at end of file diff --git a/common/www/LicenseInfoGenerate.php b/common/www/LicenseInfoGenerate.php new file mode 100644 index 0000000..4c9d6d8 --- /dev/null +++ b/common/www/LicenseInfoGenerate.php @@ -0,0 +1,155 @@ +query( + 'SELECT * FROM LicenceInfo WHERE ' + ." ID = " + .$mdb2->quote($_GET['ID'],"integer") + ); +if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); +} +$row = $result->fetchRow(); + +$product = $row[strtolower('Product')]; + +if(in_array($product,$_SESSION['Products'],true)) +{ +} +else +{ + if($_SESSION['Right'] > 2) + { + } + else if($_SESSION['UserID'] == $row[strtolower('User1')]) + { + } + else + { + echo "您没有下载权限"; + return; + } +} + +if($row[strtolower('Status')]<3) +{ + header("Location:".getenv("HTTP_REFERER")); + return; +} + +$content2 = strval($row[strtolower('Content2')]); + +$path = "temp"; + +if(!file_exists($path)) +{ + mkdir($path); +} + +$result = $mdb2->query( + 'SELECT * FROM UserInfo ' + .' WHERE UserID = ' + .$mdb2->quote($_SESSION['UserID'],"text") + ); + if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); + } +$row2 = $result->fetchRow(); + +if(!empty($row2[strtolower("SessionID")])) +{ + if(session_id() != $row2[strtolower("SessionID")]) + { + $path3 = $path."/".$row2[strtolower("SessionID")]; + my_del_dir($path3); + } +} + +$result = $mdb2->query( + 'UPDATE UserInfo SET SessionID = ' + .$mdb2->quote(session_id(),"text") + .' WHERE UserID = ' + .$mdb2->quote($_SESSION['UserID'],"text") + ); + if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); + } + +$path = $path."/".session_id(); + +if(!file_exists($path)) +{ + mkdir($path); +} +$Product = $row[strtolower("Product")]; +$path1 = "$path/$Product.License"; +$path2 = "$path/$Product.Signature"; + +?> + + +授权生成 + + +"; + + $cmd = "cscript.exe $VbsPath \"$LicensePath\""; + $ret = exec($cmd); + //echo $ret; + if("OK" == $ret) + { + echo "编码转换成功
"; + } + else + { + echo "编码转换失败
"; + return; + } + + echo "下载License文件,请鼠标右键->链接另存为
"; + + $PrivateKeyPath = "$PrivateKeyDir\\$Product\\$Product.PrivateKey"; + + $cmd = "$ExePath --License \"$LicensePath\" --PrivateKey \"$PrivateKeyPath\" "; + $ret = exec($cmd); + // 判断是否执行成功 + if("OK" == $ret) + { + echo "生成签名文件成功
"; + echo "下载Signature文件,请鼠标右键->链接另存为
"; + + // 更新下载状态 + $result = $mdb2->query( + 'UPDATE LicenceInfo SET Status = 4' + .' WHERE ID = ' + .$mdb2->quote($_GET['ID'],"integer") + ); + if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); + } + } + else + { + echo "生成签名文件失败
"; + } +} +else +{ + echo "生成License失败
"; +} + +?> +

请将License文件和Signature文件放到与dll同目录下

+

如果你拿到的授权文件为Xxx.License和Xxx.Signature,但dll名为Xxx_x86.dll,请将两个授权名改为Xxx_x86.License和Xxx_x86.Signature。 +因为有可能授权分发者对x86与x64使用相同的授权

+ + \ No newline at end of file diff --git a/common/www/LicenseInfoListView.php b/common/www/LicenseInfoListView.php new file mode 100644 index 0000000..2f013f2 --- /dev/null +++ b/common/www/LicenseInfoListView.php @@ -0,0 +1,70 @@ +query( + 'SELECT * FROM LicenceInfo WHERE User1 = ' + .$mdb2->quote($_SESSION['UserID'],"text") + ." ORDER BY ID DESC" + ); + if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); + } +?> + + +授权信息列表 + + + +申请新授权 +
+ + + + + + + + + + + + + + fetchRow()) +{ + //$content1 = strval($row[strtolower('Content1')]); + //$content2 = strval($row[strtolower('Content2')]); + $product = $row[strtolower('Product')]; + $status = $row[strtolower('Status')]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + if($status<4) + { + echo ""; + } + else + { + echo ""; + } + + echo ""; +} +?> +
ID申请人员申请时间审核人员审核时间产品状态备注详情删除
".$row[strtolower('ID')]."".$row[strtolower('User1')]."".$row[strtolower('Time1')]."".$row[strtolower('User2')]."".$row[strtolower('Time2')]."".$product."".EnumStatusToString($status)."".$row[strtolower('Remark')]."查看或下载删除
+ + + \ No newline at end of file diff --git a/common/www/LicenseInfoListView2.php b/common/www/LicenseInfoListView2.php new file mode 100644 index 0000000..9b849f1 --- /dev/null +++ b/common/www/LicenseInfoListView2.php @@ -0,0 +1,108 @@ +query( + 'SELECT * FROM ProductInfo '); +if (PEAR::isError($result2)) { + die("{'Error':'".$result2->getMessage()."'}"); +} + +$query = "SELECT * FROM LicenceInfo WHERE 1=1 "; +if(!empty($_POST['Product'])) +{ + $query = $query." AND Product = ".$mdb2->quote($_POST['Product'],"text"); +} +if(!empty($_POST['Status'])) +{ + $query = $query." AND Status = ".$mdb2->quote($_POST['Status'],"text"); +} +if(!empty($_POST['User1'])) +{ + $query = $query." AND User1 = ".$mdb2->quote($_POST['User1'],"text"); +} +if(!empty($_POST['User2'])) +{ + $query = $query." AND User2 = ".$mdb2->quote($_POST['User2'],"text"); +} +$query = $query." ORDER BY ID DESC"; + +$result = $mdb2->query($query); + +?> + + +授权信息列表 + + + +

您有以下产品的审核权限:

+
+

申请人员:审核人员: +产品: +状态:

+
+
+ + + + + + + + + + + + + + fetchRow()) +{ + if(in_array($product,$_SESSION['Products'],true)) + { + $product = $row[strtolower('Product')]; + $status = $row[strtolower('Status')]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "";; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } +} +?> +
ID申请人员申请时间审核人员审核时间产品状态备注详情审核
".$row[strtolower('ID')]."".$row[strtolower('User1')]."".$row[strtolower('Time1')]."".$row[strtolower('User2')]."".$row[strtolower('Time2')]."".$product."".EnumStatusToString($status)."".$row[strtolower('Remark')]."查看或下载审核
+ + + \ No newline at end of file diff --git a/common/www/LicenseInfoListView99.php b/common/www/LicenseInfoListView99.php new file mode 100644 index 0000000..b135144 --- /dev/null +++ b/common/www/LicenseInfoListView99.php @@ -0,0 +1,123 @@ +query( + 'SELECT * FROM ProductInfo '); +if (PEAR::isError($result2)) { + die("{'Error':'".$result2->getMessage()."'}"); +} + +$query = "SELECT * FROM LicenceInfo WHERE 1=1 "; +if(!empty($_POST['Product'])) +{ + $query = $query." AND Product = ".$mdb2->quote($_POST['Product'],"text"); +} +if(!empty($_POST['Status'])) +{ + $query = $query." AND Status = ".$mdb2->quote($_POST['Status'],"text"); +} +if(!empty($_POST['User1'])) +{ + $query = $query." AND User1 = ".$mdb2->quote($_POST['User1'],"text"); +} +if(!empty($_POST['User2'])) +{ + $query = $query." AND User2 = ".$mdb2->quote($_POST['User2'],"text"); +} +// 如果是管理员,是可以看到所有的 +if($_SESSION['Right']<=1) +{ + $query = $query." AND User1 = ".$mdb2->quote($_SESSION['UserID'],"text"); +} +$query = $query." ORDER BY ID DESC"; + +// 如果是审核员是可以看到自己能审核的 + +$result = $mdb2->query($query); +?> + + +授权信息列表 + + + +

您有以下产品的审核权限:

+
+

申请人员:审核人员: +产品: +状态:

+
+
+ + + + + + + + + + + + + + + fetchRow()) +{ + //$content1 = strval($row[strtolower('Content1')]); + //$content2 = strval($row[strtolower('Content2')]); + $product = $row[strtolower('Product')]; + $status = $row[strtolower('Status')]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "";; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + if($status<4) + { + echo ""; + } + else + { + echo ""; + } + + echo ""; +} +?> +
ID申请人员申请时间审核人员审核时间产品状态备注详情审核删除
".$row[strtolower('ID')]."".$row[strtolower('User1')]."".$row[strtolower('Time1')]."".$row[strtolower('User2')]."".$row[strtolower('Time2')]."".$product."".EnumStatusToString($status)."".$row[strtolower('Remark')]."查看或下载审核删除
+ + + \ No newline at end of file diff --git a/common/www/LicenseInfoReview.php b/common/www/LicenseInfoReview.php new file mode 100644 index 0000000..dce3ed9 --- /dev/null +++ b/common/www/LicenseInfoReview.php @@ -0,0 +1,169 @@ +query( + 'SELECT * FROM LicenceInfo WHERE ' + ." ID = " + .$mdb2->quote($_GET['ID'],"integer") + ); +if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); +} +$row = $result->fetchRow(); + +$product = $row[strtolower('Product')]; + +$content1 = strval($row[strtolower('Content1')]); +$content2 = strval($row[strtolower('Content2')]); + +$json_content = json_decode($content1,true); +$json_content2 = json_decode($content2,true); + +if(!empty($content2)) + $json_content = $json_content2; +?> + + + +授权审核 + + + 2) + { + // 管理员是有权限审核的 + } + else + { + echo "您没有权限审核此授权信息"; + return; + } +} +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID产品
申请人员审核人员
申请时间审核时间
申请内容
审核内容
状态备注
+
+"; +echo date(DATE_RFC822,time()); +echo "
";*/ +// 注意时区问题 +$t = time()-strtotime($row[strtolower('Time2')]); + +$show1 = false; +$show2 = false; +$show3 = false; + +// 审核员可以再修改时间后重新审核 +// 考虑到用户可能买了一年的授权,但有可能用了一段时间后又想换绑定的账号 +// 所以一次发三个月授权,每次来这延期即可 +if( +($row[strtolower('Status')]>=3) // 审核通过的和已经下载的都可以改时间 +) +{ + $show2 = true; +} + +if( +($row[strtolower('Status')]<4) // 没有下载的可以直接审核 +||($row[strtolower('Status')]==4 && $t<$ReviewTimeLimit2) // 已经下载的一定时间内可以再审核 +||($_SESSION['Right']==99&& $t<$ReviewTimeLimit99) // 管理员一定时间内可以再审核 +) +{ + $show1 = true; + // 有一个显示了,另一个就不显示 + $show2 = false; +} + +if($show1) +{ +?> +
+

审核内容为空时,将取申请内容自动填写下表

+

Product:

+

ExpireDate: 到期时间,格式:20160315

+

Trial: 单次会话下单次数,0表示无限制

+

MachineID: 机器码,如果没有绑定账号就必须绑定机器码,支持正则

+

Account: 登录时所用的客户号,支持正则

+

UserName: 接口登录后所能取到的客户真实姓名,不支持正则

+

Info: 额外信息,一般由审核员填写,会写入到授权文件中

+
+

状态: 状态信息决定了是否审核完成,用户是否可下载,不要改错了

+

备注: 备注,需告知审核员或用户的消息

+ +
+
+ +
+

审核内容为空时,将取申请内容自动填写下表

+

Product:

+

ExpireDate: 到期时间,格式:20160315

+

Trial: 单次会话下单次数,0表示无限制

+

MachineID: 机器码,如果没有绑定账号就必须绑定机器码,支持正则

+

Account: 登录时所用的客户号,支持正则

+

UserName: 接口登录后所能取到的客户真实姓名,不支持正则

+

Info: 额外信息,一般由审核员填写,会写入到授权文件中

+
+

状态: 状态信息决定了是否审核完成,用户是否可下载,不要改错了

+

备注: 备注,需告知审核员或用户的消息

+ +
+ + + \ No newline at end of file diff --git a/common/www/LicenseInfoView.php b/common/www/LicenseInfoView.php new file mode 100644 index 0000000..8cf82b4 --- /dev/null +++ b/common/www/LicenseInfoView.php @@ -0,0 +1,114 @@ +query( + 'SELECT * FROM LicenceInfo WHERE ' + ." ID = " + .$mdb2->quote($_GET['ID'],"integer") + ); +if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); +} +$row = $result->fetchRow(); + +$product = $row[strtolower('Product')]; + +if(in_array($product,$_SESSION['Products'],true)) +{ +} +else +{ + if($_SESSION['Right'] > 2) + { + } + else if($_SESSION['UserID'] == $row[strtolower('User1')]) + { + } + else + { + echo "您没有权限查看此授权信息"; + return; + } +} + +$content1 = strval($row[strtolower('Content1')]); +$content2 = strval($row[strtolower('Content2')]); + +$json_content1 = json_decode($content1,true); +$json_content2 = json_decode($content2,true); +?> + + +授权信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID产品
申请人员审核人员
申请时间审核时间
申请内容
审核内容
状态备注
+=3) +{ +?> +
+

下载

+

生成授权并下载"?>

+ +
+
+

在没有通过审核人员审核前,是可以再编辑的

+

Product:

+

ExpireDate: 到期时间,格式:例如20160315

+

Trial: 单次会话下单次数,0表示无限制

+

MachineID: 机器码,如果没有绑定账号就必须绑定机器码,支持正则

+

Account: 登录时所用的客户号,支持正则

+

UserName: 接口登录后所能取到的客户真实姓名,不支持正则

+

Info: 额外信息,一般由审核员填写,会写入到授权文件中

+
+

上面的信息如果不会填写,那就把*.Licence中的文本直接粘贴到下面的备注即可,后面的事交审核人员处理

+

备注: 备注,需告知审核员或用户的消息

+ +
+ + + + diff --git a/common/www/Logout.php b/common/www/Logout.php new file mode 100644 index 0000000..2f2a5aa --- /dev/null +++ b/common/www/Logout.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/common/www/ProductInfoListView.php b/common/www/ProductInfoListView.php new file mode 100644 index 0000000..4f258ab --- /dev/null +++ b/common/www/ProductInfoListView.php @@ -0,0 +1,39 @@ +query( + 'SELECT * FROM ProductInfo '); +if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); +} +?> + + +产品信息列表 + + +

如想登记自己开发的组件,请与管理员联系 关于我们

+
+ + + + + + + fetchRow()) +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +?> +
ID产品名介绍页
".$row[strtolower('ID')]."".$row[strtolower('Name')]."查看并下载
+ + + diff --git a/common/www/Session.php b/common/www/Session.php new file mode 100644 index 0000000..bfef3cd --- /dev/null +++ b/common/www/Session.php @@ -0,0 +1,117 @@ +quote($_SESSION['SWITCH_ID'],"text"); +} +else +{ + // 取账号信息 + $query = 'SELECT * FROM UserInfo WHERE UserID = ' + .$mdb2->quote($_POST['UserID'],"text"); +} + +//echo $query; +$result = $mdb2->query($query); + +if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); +} + +$row = $result->fetchRow(); + +if(empty($row)) +{ + $_SESSION['Error'] = '账号不存在,请检查账号是否填错'; + header("Location:".getenv("HTTP_REFERER")); + return; +} + +if(@$_SESSION['SWITCH']==true) +{ + // 切换账号,不检查密码 +} +else +{ + if(md5($_POST['Password']) != $row[strtolower('Password')]) + { + $_SESSION['Error'] = '密码错误,请检查账号或密码是否填错'; + header("Location:".getenv("HTTP_REFERER")); + return; + } +} + +unset($_SESSION['SWITCH']); +unset($_SESSION['SWITCH_ID']); + +$_SESSION['LOGINED'] = true; +$_SESSION['UserID'] = $row[strtolower('UserID')]; +$_SESSION['ID'] = $row[strtolower('ID')]; +$_SESSION['Password'] = $row[strtolower('Password')]; +$_SESSION['Right'] = $row[strtolower('Right')]; + +// 查找是否有审核权限 +$query = 'SELECT * FROM Product_User2 WHERE User2 = ' + .$mdb2->quote($_SESSION['UserID'],"text"); +//echo $query; +$result = $mdb2->query($query); + +if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); +} + +$Products = array(); +while($row = $result->fetchRow()) +{ + array_push($Products,$row[strtolower('Product')]); +} +$_SESSION['Products'] = $Products; + +// 可以判断一下,只让本机登录的为管理员 +/*if($_SESSION['Right'] == 99) +{ + // 居然有IPv6的问题 + $admin_ips = array('127.0.0.1','::1',''); + if(in_array($_SERVER['REMOTE_ADDR'],$admin_ips,true)) + { + } + else + { + // 降级为审核员 + $_SESSION['Right'] = 2; + } +}*/ + +if($_SESSION['Right'] == 99) +{ + // 通过特殊页面登录成功的管理员才有管理员权限 + //echo (int)$_POST['Token']; + //echo (int)$admin_token; + //return; + // 这个功能与某个管理员登录的php有关联,要改的话得同时改 + if(@$_SESSION['TRY_ADMIN'] == true) + { + } + else + { + // 降级为审核员 + $_SESSION['Right'] = 2; + } +} + +// 会话有效期1小时 +$lifeTime = 3600; +setcookie(session_name(), session_id(), time() + $lifeTime, "/"); + +header("Location: $Homepage"); +return; +?> \ No newline at end of file diff --git a/common/www/Signin.php b/common/www/Signin.php new file mode 100644 index 0000000..4858562 --- /dev/null +++ b/common/www/Signin.php @@ -0,0 +1,26 @@ + + + +登录 + + +
+ +

用户名:

+

密码:

+

+
+注册"; +} +?> + + + \ No newline at end of file diff --git a/common/www/Signin_admin.php b/common/www/Signin_admin.php new file mode 100644 index 0000000..6ecb7cc --- /dev/null +++ b/common/www/Signin_admin.php @@ -0,0 +1,30 @@ + + + +管理员登录 + + +
+ +

用户名:

+

密码:

+

+
+注册"; +} +?> + + + \ No newline at end of file diff --git a/common/www/Signup.php b/common/www/Signup.php new file mode 100644 index 0000000..b145fec --- /dev/null +++ b/common/www/Signup.php @@ -0,0 +1,31 @@ + + + + +注册 + + + + + +
+ +

用户名

+

密码

+

密码2再次输入密码

+

+
+ + \ No newline at end of file diff --git a/common/www/SwitchUserID.php b/common/www/SwitchUserID.php new file mode 100644 index 0000000..6c05ca7 --- /dev/null +++ b/common/www/SwitchUserID.php @@ -0,0 +1,34 @@ + + + + + +主页 + + + +
+

这个功能只对管理员开放,用于切换到某个用户上看授权设置是否正确,或对账号信息进行修改

+

UserID

+
+ + + \ No newline at end of file diff --git a/common/www/User2ListView.php b/common/www/User2ListView.php new file mode 100644 index 0000000..e8ae056 --- /dev/null +++ b/common/www/User2ListView.php @@ -0,0 +1,43 @@ +query( + 'SELECT * FROM Product_User2 ORDER BY Product'); +if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); +} +?> + + + + +审核人员列表 + + + +

只是给管理员核对使用,由于一般很少有改动,所以直接编辑数据库即可。

+

如果要给某个用户添加审核功能,还需要改用户信息表的Right,2=,否则审核员是看不到可审核列表的

+ + + + + + + fetchRow()) +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +?> +
IDProductUser2
".$row[strtolower('ID')]."".$row[strtolower('Product')]."".$row[strtolower('User2')]."
+ + + \ No newline at end of file diff --git a/common/www/UserInfoAction.php b/common/www/UserInfoAction.php new file mode 100644 index 0000000..992c181 --- /dev/null +++ b/common/www/UserInfoAction.php @@ -0,0 +1,66 @@ +query( + 'UPDATE UserInfo SET Name = ' + .$mdb2->quote($_POST['Name'],"text") + .' , Phone = ' + .$mdb2->quote($_POST['Phone'],"text") + .' , Email = ' + .$mdb2->quote($_POST['Email'],"text") + .' , IM = ' + .$mdb2->quote($_POST['IM'],"text") + .' , Remark = ' + .$mdb2->quote($_POST['Remark'],"text") + .' WHERE ID = ' + .$mdb2->quote($_SESSION['ID'],"integer") + ); + if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); + } + + header("Location:".getenv("HTTP_REFERER")); + return; +} + +if(isset($_POST['ModifyPassword'])) +{ + if($_SESSION['Password'] != md5($_POST['OldPassword'])) + { + $_SESSION['Error'] = '原密错误'; + header("Location:".getenv("HTTP_REFERER")); + return; + } + + if($_POST['NewPassword'] != $_POST['NewPassword2']) + { + $_SESSION['Error'] = '两次密码不相同'; + header("Location:".getenv("HTTP_REFERER")); + return; + } + + if($_SESSION['Password'] == $_POST['NewPassword']) + { + $_SESSION['Error'] = '新密码与原密码相同'; + header("Location:".getenv("HTTP_REFERER")); + return; + } + + $result = $mdb2->query( + 'UPDATE UserInfo SET Password = ' + .$mdb2->quote(md5($_POST['NewPassword']),"text") + .' WHERE ID = ' + .$mdb2->quote($_SESSION['ID'],"integer") + ); + if (PEAR::isError($result)) { + die("{'Error':'".$result->getMessage()."'}"); + } + + header("Location:Logout.php"); + return; +} +?> \ No newline at end of file diff --git a/common/www/UserInfoView.php b/common/www/UserInfoView.php new file mode 100644 index 0000000..2bcec76 --- /dev/null +++ b/common/www/UserInfoView.php @@ -0,0 +1,50 @@ +quote($_SESSION['UserID'],"text"); +$result = $mdb2->query($query); + +$row = $result->fetchRow(); +// 不显示密码 +unset($row[strtolower('Password')]); +?> + + + +个人信息 + + +个人信息
";
+print_r($row);
+echo "
"; +?> +
+
+

修改个人信息

+

以下是用来完善个人信息使用,如已经通过审核可不用修改。请认真填写信息。

+

Name: 真实姓名

+

Phone: 电话,手机号或固定电话都可以

+

Email: 电子邮箱地址

+

QQ: 即时聊天工具,如QQ\微信等

+

Remark: 备注信息,请填写公司、职务等信息

+ +
+
+
+

修改密码

+

修改成功后将不提示,直接跳转到重新登录界面

+ +

原始密码:

+

新密码:

+

确认密码:

+ + +
+ + + \ No newline at end of file diff --git a/common/www/aboutus.php b/common/www/aboutus.php new file mode 100644 index 0000000..34a63c1 --- /dev/null +++ b/common/www/aboutus.php @@ -0,0 +1,12 @@ + + + + +关于 + + +联系我们
+QQ:
+Email:
+ + \ No newline at end of file diff --git a/common/www/config.php b/common/www/config.php new file mode 100644 index 0000000..0c571dd --- /dev/null +++ b/common/www/config.php @@ -0,0 +1,48 @@ +getMessage()."'}"); +} +$mdb2->setFetchMode(MDB2_FETCHMODE_ASSOC); +$mdb2->exec("SET NAMES 'utf8'"); + +//================================================= + + +// 这两个参数用于生成授权使用,需要检查授权是否可用 +$ExePath = "D:\AppServ\www\License.exe"; +$VbsPath = "D:\AppServ\www\ConvertCode.vbs"; +//密钥目录一定不能在网页目录下,不然就被人下载 +$PrivateKeyDir = "D:\AppServ\keys"; + +// 是否开放公众注册 +$OpenSignup = true; + +// 未处理的授权条目上限 +$PendingLicenseCount = 5; + +// 首页,如果改动了首页文件,此处也可能需要改变 +// 目前在Session.php和SwitchUserID.php中出现 +$Homepage = "Home.php"; + +?> \ No newline at end of file diff --git a/common/www/products/CTP_Trade_x86/index.html b/common/www/products/CTP_Trade_x86/index.html new file mode 100644 index 0000000..e4de975 --- /dev/null +++ b/common/www/products/CTP_Trade_x86/index.html @@ -0,0 +1,15 @@ + + + + +介绍 + + +

软件介绍:

+

软件下载:

+

软件安装:

+

售前咨询人员:

+

售后支持服务:

+

价格:

+ + \ No newline at end of file diff --git a/common/www/products/TdxApi/TdxApi.dll b/common/www/products/TdxApi/TdxApi.dll new file mode 100644 index 0000000..3c8d3d2 Binary files /dev/null and b/common/www/products/TdxApi/TdxApi.dll differ diff --git a/common/www/products/TdxApi/index.html b/common/www/products/TdxApi/index.html new file mode 100644 index 0000000..7ce92c8 --- /dev/null +++ b/common/www/products/TdxApi/index.html @@ -0,0 +1,16 @@ + + + + +介绍 + + +

软件介绍:

+

更新日期:20160128

+

软件下载:下载

+

软件安装:

+

售前咨询人员:

+

售后支持服务:

+

价格:

+ + \ No newline at end of file diff --git "a/common/www/\345\256\211\350\243\205\346\226\271\346\263\225.txt" "b/common/www/\345\256\211\350\243\205\346\226\271\346\263\225.txt" new file mode 100644 index 0000000..4157a91 --- /dev/null +++ "b/common/www/\345\256\211\350\243\205\346\226\271\346\263\225.txt" @@ -0,0 +1,14 @@ +1.װpear, php go-pear.php +2.װpear install MDB2 +3.װpear install MDB2#mysql +4.Ŀҳ +5.keysĿ굽ҳĿ¼¡ע⣬Ŀ¼ʣΪĿ¼˽Կ +6.עkeysеĿ¼ݿIJƷ +7.޸config.phpеȨkeyĿ¼License.exe·ǩ +8.޸config.phpеݿϢ +9.עһûadminȻݿUserInfoûRightij9999ΪԱ +10.ProductInfoһProductUrlProduct=CTP_Trader_86Url=/products/TdxApi/index.html +11.עһûxyzRightij22ΪԱ,ȻProduct_User2һProduct=CTP_Trader_86,User2=xyz,ԱCTP_Trader_86Ȩ +12.һȨļĹǷܳɹأغļǷʹá +ΪҳȫUTF-8룬ȨļASCII룬õһvbsUTF-8תASCIIҪú +13.Signin_admin.phpǹԱ¼ҳ棬Աֻͨ¼ǹԱļһҪڸ֪ diff --git "a/common/www/\345\274\200\345\217\221\350\256\241\345\210\222.txt" "b/common/www/\345\274\200\345\217\221\350\256\241\345\210\222.txt" new file mode 100644 index 0000000..6dd6a40 --- /dev/null +++ "b/common/www/\345\274\200\345\217\221\350\256\241\345\210\222.txt" @@ -0,0 +1,5 @@ +һ׶: +1.ûύȨϢ +2.˹༭ +3.ṩ +4.ṩ֧ܣûԱЭ \ No newline at end of file diff --git "a/common/www/\350\241\250\347\273\223\346\236\204.txt" "b/common/www/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000..efa9fe7 --- /dev/null +++ "b/common/www/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,85 @@ +-- phpMyAdmin SQL Dump +-- version 2.10.3 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: Jan 22, 2016 at 09:55 AM +-- Server version: 5.0.51 +-- PHP Version: 5.2.6 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + +-- +-- Database: `test` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `licenceinfo` +-- + +CREATE TABLE `LicenceInfo` ( + `ID` int(10) unsigned NOT NULL auto_increment, + `User1` varchar(20) NOT NULL, + `Time1` datetime NOT NULL, + `Content1` varchar(1024) NOT NULL, + `User2` varchar(20) default NULL, + `Time2` datetime default NULL, + `Content2` varchar(1024) default NULL, + `Product` varchar(64) NOT NULL, + `Status` varchar(32) NOT NULL, + `Remark` varchar(256) default NULL, + PRIMARY KEY (`ID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='ȨϢ'; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `productinfo` +-- + +CREATE TABLE `ProductInfo` ( + `ID` int(11) NOT NULL auto_increment, + `Name` varchar(20) NOT NULL, + `Url` varchar(260) NOT NULL, + PRIMARY KEY (`ID`), + UNIQUE KEY `Name` (`Name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='ƷϢ'; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `product_user2` +-- + +CREATE TABLE `Product_User2` ( + `ID` int(11) NOT NULL auto_increment, + `Product` varchar(64) NOT NULL, + `User2` varchar(20) NOT NULL, + PRIMARY KEY (`ID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Ȩϵ'; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `userinfo` +-- + +CREATE TABLE `UserInfo` ( + `ID` int(10) unsigned NOT NULL auto_increment, + `UserID` varchar(20) NOT NULL, + `Password` varchar(40) NOT NULL, + `Name` varchar(16) NOT NULL, + `Phone` varchar(16) default NULL, + `Email` varchar(40) default NULL, + `IM` varchar(64) default NULL, + `RegisterTime` datetime NOT NULL, + `IP` varchar(40) NOT NULL, + `Status` varchar(20) NOT NULL, + `Right` tinyint(4) NOT NULL, + `SessionID` varchar(40) default NULL, + `Remark` varchar(1024) default NULL, + PRIMARY KEY (`ID`), + UNIQUE KEY `UserID` (`UserID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='ûϢ'; diff --git a/conf.sh b/conf.sh new file mode 100755 index 0000000..53d1476 --- /dev/null +++ b/conf.sh @@ -0,0 +1,2 @@ +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/Workspaces/XAPI2/common/Queue:~/Workspaces/XAPI2/apis/CTP:~/Workspaces/XAPI2/include/CTP/linux64 +export MALLOC_CHECK_=0 diff --git a/csharp/QuantBox.XAPI/QuantBox.XAPI_Linux.csproj b/csharp/QuantBox.XAPI/QuantBox.XAPI_Linux.csproj deleted file mode 100644 index 48f1af2..0000000 --- a/csharp/QuantBox.XAPI/QuantBox.XAPI_Linux.csproj +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Debug - AnyCPU - {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB} - Exe - Properties - QuantBox.XAPI - QuantBox.XAPI - v4.5 - 512 - - - true - full - false - ..\bin\Debug - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - ..\..\packages\NLog.3.2.1\lib\net45\NLog.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/design.md b/design.md new file mode 100644 index 0000000..17c4343 --- /dev/null +++ b/design.md @@ -0,0 +1,96 @@ +# XAPI2设计文档 + +## 支持的API +目前想支持的: +* CTP 期货交易 +* CTPZQ +* LTS 股票交易 +* Femas 期货交易 +* Kingstar +* KingstarGold 上海黄金交易所的接口 +* SPTrader 想干的经纪公司基本都用这个 + +以后再说的: +* XSpeed +* XSpeed_Stock + + +## 设计中需要解决的问题 + +####1. 在`ApiStruct.h`中的结构体的命名 + +在[`ApiStruct.h`](https://github.com/QuantBox/XAPI2/blob/master/include/ApiStruct.h)中很多结构体的名称以Field结尾,比如`PositionField`。但是在C++中,结构体中的元素才叫做field,结构体名称不叫Field。 + +建议修改:把结构体的名称中的Field后缀去掉,比如`PositionField`更名为`Position`。这样从C++的概念上才正确,其次代码因为结构体的名称变短会更易读。 + +####2. [CXApi类](https://github.com/QuantBox/XAPI2/blob/master/include/XApiCpp.h)中的回调函数中的int size1参数 +在这些回调函数中,有个参数`int size1`,似乎和业务不相关。 + +解决方案:(来自伍侃)回调函数的参数风格按照CTP回调函数的风格来修改:在回调函数中,参数为先是数据相关的,然后是一个错误,然后是一个`isLast`。 + +####3. 枚举类型`ExchangeType` +在[`ApiEnum.h`](https://github.com/QuantBox/XAPI2/blob/master/include/ApiEnum.h)中定义了`ExchangeType`枚举类型。但是在[CXApiCpp.h](https://github.com/QuantBox/XAPI2/blob/master/include/XApiCpp.h)中,有些地方使用的是`ExchangeType`,比如回调函数`OnFilterSubscribe`。但是有些地方使用的是以字符串指定的交易所,比如函数`Subscribe`,`Unsubscribe`,`ReqQryInstrument`和`ReqQryInvestorPosition`。从减少混淆的角度出发,应该统一使用`ExchangeType`来引用交易所。 + +建议修改:所有需要交易所的地方都使用ExchangeType。 + +####4. 结构体DepthMarketDataNField的名称 +在[`ApiStruct.h`](https://github.com/QuantBox/XAPI2/blob/master/include/ApiStruct.h)中定义了结构体`DepthMarketDataNField`。在XAPI2中并没有找到`DepthMarketDataField`,是否可以把其中的N去掉,并且去掉Field后缀(见问题1)。 + +建议修改:把`DepthMarketNDataField`重命名为`DepthMarketData`。 + +####5. 是否需要增加一个OnRspQryOrder的回调函数 +现在有一个OnRtnOrder,是否需要增加一个OnRspQryOrder? +问题:OnRspQryOrder是响应哪个request的回调函数?OnRspQryOrder在什么情况下会被调用? +同样,是否要增加一个OnRspQryTrade的回调函数? + +####6. 对于股票的只有查询,没有主动回报的功能的API,可能查询委托功能会交给用户 +这是什么意思? + +####8. OrderField.ID在什么范围内能保证ID的唯一性 +关于`OrderField.ID`,因为是字符串,如果把它变长一点,`yyyy-mm-dd:HHMMSS:SessionID:FrontID:OrderRef`,这样让ID在历史上都是唯一的,而且依然有实际意义(而不是像UUID)。用户只需要在其前面加上策略的名称,就能做到整个策略组合ID历史唯一。 + +修改建议:如上,伍侃反馈:同意,以后改。 +新问题:通过查询进行订单的恢复,报单的时间可能没办法恢复成功,特别是在秒部分,本地下单时间与柜台转的时间基本上无法对应上。 + + +####9. 撤单的问题 +1.撤单一定要指定FrontID:SessionID:OrderRef,好像还要指定别的东西,但实在不记得了是哪些了 +2.FrontID与SessionID不一定是本次会话的,而必须是发单时会话的值,也就是断线后重连,要撤上次的单必需用上次的值 +3.所以我一般是在重新登录时,查询委托列表,然后要撤单时通过这个列表把撤单的结构体全写上 + +首先,我下单时会返回一个FrontID:SessionID:OrderRef字符串 +撤单时通过这个字符串查一个map,找到对应的委托,然后撤单 + +存在的问题 +1.断线时再重连,由于下单太多,这个表可能要返回很久 +2.这时立即撤单会由于表没有更新完,撤单失败 + + +####10. 下单时的问题 +1.主要是批量下单时的结构体如何设计 +2.目前的方法是SendOrders(OrderField[] orders,out string[] orderref) +这个存在的问题是stirng[]中的string是一种比较复杂的类型,不同语言或框架中都有可能不一样,再对其[]就更复杂了,还要out。。。 +3.批量下单时,不一定每个单子都能下成功,如何通过string[]或别的方式来区分成功与失败呢? +4.我以前的方法是int SendOrders(order),登录时得到FrontID:SessionID,然后返回的int与FrontID:SessionID拼起来,就是一个唯一的字符串 +后来因为Femas必须前面填充为0,填满共12个。这样FrontID:SessionID:OrderRef实际拼接方法可能就各不一样 +后来又改成char* SendOrders(order),也就是一开始就是传出的唯一的字符串,但这种方法需要解决内存释放的问题 + +所有现在需要大家共同设计一下SendOrders与CacelOrders。 + +####[已解决] 11. XAPI2的目录结构 +目录中的项目名称不应该包括QuantBox前缀,因为没有必要,同时QuantBox是一个比XAPI2更大的概念。 + +解决方案:已经去掉了前缀。 + +####[已解决] 12. XAPI2的编译输出路径 +XAPI2中各项目的输出路径都应该同一放到一个文件夹中。 + +解决方案:所有编译输出放在XAPI2\bin中,其中子目录结构举例:XAPI2\bin\Debug\x64\CTP\($solution)_($project)_($arch).dll。 + +#### 13. XAPI与XAPI2名称的使用 +在XAPI2中的各项目中,XAPI和XAPI2不应该视为可混用(interchangable)。XAPI应该仅用来表达与之前XAPI相关的内容(如果有的话),否则应该一律使用XAPI2。 + +比如在C#的接口中,名称空间应该是QuantBox.XAPI2,而不是QuantBox.XAPI。 + +#### 14. 消息队列MessageQueue对远程推送数据的支持 +MessageQueue需要能够将数据通过不同的消息中间件(zeromq, Rabbitmq)推送到其它地方(其它机器,网络)中的能力。考虑的解决方案为:将CMsgQueue中的回调函数m_fnOnResponse从一个回调函数扩展成一组回调函数,然后实现一些回调函数,可以向zeromq或Rabbitmq中发送数据。这样可以做到各种数据分发底层实现的低耦合。用户可以随意增加和替换。zeromq在网络中断的时候不负责消息丢失的维护,Rabbitmq则负责。所以,zeromq发送行情数据类的消息应该够用,Rabbitmq可能比较适合发送交易类的消息。 diff --git a/include/ApiEnum.h b/include/ApiEnum.h index c686c91..0d28b22 100644 --- a/include/ApiEnum.h +++ b/include/ApiEnum.h @@ -76,16 +76,21 @@ enum OrderStatus :char OrderStatus_Replaced, }; -/// 方向,没有区分ETF与开放式基金的申购赎回 +/// 方向 /// 新股申购、回购,质押都暂时不写入,等业务掌握熟了后再加 enum OrderSide :char { OrderSide_Buy, OrderSide_Sell, - OrderSide_Creation, ///申购 - OrderSide_Redemption, ///赎回 - OrderSide_Merge, ///合并 - OrderSide_Split, ///拆分 + OrderSide_LOFCreation, ///申购,LOF申购 + OrderSide_LOFRedemption, ///赎回,LOF赎回 + OrderSide_ETFCreation, ///ETF申购 + OrderSide_ETFRedemption, ///ETF赎回 + OrderSide_Merge, ///合并 + OrderSide_Split, ///拆分 + OrderSide_CBConvert, ///可转债转股,参考于https://en.wikipedia.org/wiki/Convertible_bond + OrderSide_CBRedemption, ///可转债回售,参考于https://en.wikipedia.org/wiki/Convertible_bond + OrderSide_Unknown, ///出现这个输出时,需要技术人员去查找原因修正代码 }; /// 报单类型,与OpenQuant2014中的值一样 @@ -141,11 +146,17 @@ enum ExecType : char ExecType_PendingReplace, ExecType_Replace, ExecType_ReplaceReject, + ExecType_TradeCorrect, + ExecType_TradeCancel, + ExecType_OrderStatus, + ExecType_PendingNew, + ExecType_ClearingHold, }; ///开平标志,没有提供专门的平昨,而是用Close enum OpenCloseType :char { + OpenCloseType_Undefined = 0, // 未指定,用来自行处理 OpenCloseType_Open, OpenCloseType_Close, OpenCloseType_CloseToday, @@ -179,6 +190,7 @@ enum InstrumentType :char InstrumentType_ETF, InstrumentType_MultiLeg, InstrumentType_Synthetic, + InstrumentType_LOF, ///多加LOF }; ////////////////////////////////////////////////////////////////////////// @@ -245,6 +257,16 @@ enum TradingPhaseType :char TradingPhaseType_Fuse, ///熔断时段,参考于LTS }; +/// 业务类型,主要是有些API实际上已经对接了各种市场 +// 不同的市场需要不同的函数,统一到一起实在太难,所以这个地方交给用户自己来指定 +enum BusinessType :char +{ + BusinessType_Undefined = 0, /// 未指定 + BusinessType_Future, + BusinessType_Stock, + BusinessType_Option, +}; + @@ -260,7 +282,7 @@ enum TradingPhaseType :char enum BarType :char { - Time = 1, + BarType_Time = 1, Tick, Volume, Range, diff --git a/include/ApiHeader.h b/include/ApiHeader.h index 5ed0b04..84547a4 100644 --- a/include/ApiHeader.h +++ b/include/ApiHeader.h @@ -1,13 +1,13 @@ -#ifndef _API_HEADER_H_ +#ifndef _API_HEADER_H_ #define _API_HEADER_H_ -#include "../include/CrossPlatform.h" +#include "CrossPlatform.h" #ifdef __cplusplus extern "C" { #endif - //ڷָĺбǰûַбԲܳ֡:һ - #define _QUANTBOX_SEPS_ ",;" + //用于分隔输入的合列表,与前置机地址列表,所以不能出现“:”一类的 + #define _QUANTBOX_SEPS_ ";" DLL_PUBLIC void* __stdcall XRequest(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); #ifdef __cplusplus diff --git a/include/ApiStruct.h b/include/ApiStruct.h index ab0deaf..4121232 100644 --- a/include/ApiStruct.h +++ b/include/ApiStruct.h @@ -3,7 +3,6 @@ #include "ApiDataType.h" #include "ApiEnum.h" -//#include "QueueEnum.h" #pragma pack(push,1) @@ -12,6 +11,15 @@ /// 1.由API直接提供有效值 /// 2.计算出来的值,字段正好预留了此字段,可以直接填充,这样使用者就不需要定义自己的字段了 +///////////////////////////////////////////////////////////////////////// +/// +/// 账号体系分成三层 +/// 客户端XAPI层,主要是多账号功能,如TDX可以登录多个账号 +/// 分账户层,如O32中下单要指定资产单元或投资组合 +/// 交易所层,比如股东代码,有可能无法区分需要 + + + ///查询持仓,查委托,查成交,查合约,查资金等 ///定义一个通用的结构,省事 struct ReqQueryField @@ -46,8 +54,19 @@ struct ReqQueryField Int32Type Int32ID; ///一般是由API底层查询预留 - OrderIDType Char64RefID; - Int32Type Int32RefID; + OrderIDType Char64PositionIndex; + Int32Type Int32PositionIndex; + + + + /// 基金 + IDChar32Type PortfolioID1; + /// 资产单元 + IDChar32Type PortfolioID2; + /// 投资组合 + IDChar32Type PortfolioID3; + + BusinessType Business; }; ///持仓 @@ -95,6 +114,18 @@ struct PositionField QtyType TodayPRPosition; ///今日申赎持仓冻结 QtyType TodayPRFrozen; + + ///同一账号下的唯一ID,本地拼接成的,方便其它程序存到dict中 + PositionIDType ID; + + /// 基金 + IDChar32Type PortfolioID1; + /// 资产单元 + IDChar32Type PortfolioID2; + /// 投资组合 + IDChar32Type PortfolioID3; + + BusinessType Business; }; ///做市商双向报价 @@ -219,6 +250,19 @@ struct OrderField Int32Type ReserveInt32; ///预留字符串 Char64Type ReserveChar64; + + /// 基金 + IDChar32Type PortfolioID1; + /// 资产单元 + IDChar32Type PortfolioID2; + /// 投资组合 + IDChar32Type PortfolioID3; + + BusinessType Business; + + // 本处代码只内部使用,用于方便在封装API时快速的进行查找,减少代码 + void* pUserData1; + void* pUserData2; }; @@ -269,6 +313,15 @@ struct TradeField Int32Type ReserveInt32; ///预留字符串 Char64Type ReserveChar64; + + /// 基金 + IDChar32Type PortfolioID1; + /// 资产单元 + IDChar32Type PortfolioID2; + /// 投资组合 + IDChar32Type PortfolioID3; + + BusinessType Business; }; ///服务器信息 @@ -363,6 +416,10 @@ struct RspUserLoginField Int32Type RawErrorID; ///信息 Char256Type Text; + + Char32Type Version; + + Char32Type Lang; }; @@ -384,6 +441,8 @@ struct DepthMarketDataNField SymbolType Symbol; ///合约代码 InstrumentIDType InstrumentID; + + ExchangeIDType ExchangeID; ///交易所代码,枚举类型,主要是用于过滤使用,效率比字符串比较要高 ExchangeType Exchange; diff --git a/include/CTP/ThostFtdcTraderApi.h b/include/CTP/ThostFtdcTraderApi.h index 4cccbf7..eae0a08 100644 --- a/include/CTP/ThostFtdcTraderApi.h +++ b/include/CTP/ThostFtdcTraderApi.h @@ -100,8 +100,8 @@ class CThostFtdcTraderSpi ///۲Ӧ virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; - ///Ӧ - virtual void OnRspLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + ///Ӧ + virtual void OnRspBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; ///¼Ӧ virtual void OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; @@ -184,6 +184,18 @@ class CThostFtdcTraderSpi ///ѯƷۻ virtual void OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + ///ѯƷ + virtual void OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ̺ԼӦ + virtual void OnRspQryMMInstrumentCommissionRate(CThostFtdcMMInstrumentCommissionRateField *pMMInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨԼӦ + virtual void OnRspQryMMOptionInstrCommRate(CThostFtdcMMOptionInstrCommRateField *pMMOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryInstrumentOrderCommRate(CThostFtdcInstrumentOrderCommRateField *pInstrumentOrderCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + ///ѯȨ׳ɱӦ virtual void OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; @@ -199,12 +211,6 @@ class CThostFtdcTraderSpi ///ѯӦ virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; - ///ѯӦ - virtual void OnRspQryLock(CThostFtdcLockField *pLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; - - ///ѯ֤ȯλӦ - virtual void OnRspQryLockPosition(CThostFtdcLockPositionField *pLockPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; - ///ѯϺԼȫϵӦ virtual void OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; @@ -235,6 +241,9 @@ class CThostFtdcTraderSpi ///Լ״̬֪ͨ virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {}; + ///֪ͨ + virtual void OnRtnBulletin(CThostFtdcBulletinField *pBulletin) {}; + ///֪ͨ virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) {}; @@ -268,11 +277,8 @@ class CThostFtdcTraderSpi ///֤û virtual void OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) {}; - ///֪ͨ - virtual void OnRtnLock(CThostFtdcLockField *pLock) {}; - - ///֪ͨ - virtual void OnErrRtnLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo) {}; + ///ر + virtual void OnErrRtnBatchOrderAction(CThostFtdcBatchOrderActionField *pBatchOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; ///֪ͨ virtual void OnRtnCombAction(CThostFtdcCombActionField *pCombAction) {}; @@ -489,8 +495,8 @@ class TRADER_API_EXPORT CThostFtdcTraderApi ///۲ virtual int ReqQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, int nRequestID) = 0; - /// - virtual int ReqLockInsert(CThostFtdcInputLockField *pInputLock, int nRequestID) = 0; + /// + virtual int ReqBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, int nRequestID) = 0; ///¼ virtual int ReqCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, int nRequestID) = 0; @@ -573,6 +579,18 @@ class TRADER_API_EXPORT CThostFtdcTraderApi ///ѯƷۻ virtual int ReqQryProductExchRate(CThostFtdcQryProductExchRateField *pQryProductExchRate, int nRequestID) = 0; + ///ѯƷ + virtual int ReqQryProductGroup(CThostFtdcQryProductGroupField *pQryProductGroup, int nRequestID) = 0; + + ///ѯ̺Լ + virtual int ReqQryMMInstrumentCommissionRate(CThostFtdcQryMMInstrumentCommissionRateField *pQryMMInstrumentCommissionRate, int nRequestID) = 0; + + ///ѯȨԼ + virtual int ReqQryMMOptionInstrCommRate(CThostFtdcQryMMOptionInstrCommRateField *pQryMMOptionInstrCommRate, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryInstrumentOrderCommRate(CThostFtdcQryInstrumentOrderCommRateField *pQryInstrumentOrderCommRate, int nRequestID) = 0; + ///ѯȨ׳ɱ virtual int ReqQryOptionInstrTradeCost(CThostFtdcQryOptionInstrTradeCostField *pQryOptionInstrTradeCost, int nRequestID) = 0; @@ -588,12 +606,6 @@ class TRADER_API_EXPORT CThostFtdcTraderApi ///ѯ virtual int ReqQryQuote(CThostFtdcQryQuoteField *pQryQuote, int nRequestID) = 0; - ///ѯ - virtual int ReqQryLock(CThostFtdcQryLockField *pQryLock, int nRequestID) = 0; - - ///ѯ֤ȯλ - virtual int ReqQryLockPosition(CThostFtdcQryLockPositionField *pQryLockPosition, int nRequestID) = 0; - ///ѯϺԼȫϵ virtual int ReqQryCombInstrumentGuard(CThostFtdcQryCombInstrumentGuardField *pQryCombInstrumentGuard, int nRequestID) = 0; diff --git a/include/CTP/ThostFtdcUserApiDataType.h b/include/CTP/ThostFtdcUserApiDataType.h index 1414426..dbeee6f 100644 --- a/include/CTP/ThostFtdcUserApiDataType.h +++ b/include/CTP/ThostFtdcUserApiDataType.h @@ -77,11 +77,6 @@ typedef char TThostFtdcClientIDType[11]; ///////////////////////////////////////////////////////////////////////// typedef char TThostFtdcInstrumentIDType[31]; -///////////////////////////////////////////////////////////////////////// -///TFtdcInstrumentCodeTypeһԼʶ -///////////////////////////////////////////////////////////////////////// -typedef char TThostFtdcInstrumentCodeType[31]; - ///////////////////////////////////////////////////////////////////////// ///TFtdcMarketIDTypeһг ///////////////////////////////////////////////////////////////////////// @@ -398,8 +393,6 @@ typedef char TThostFtdcTraderConnectStatusType; #define THOST_FTDC_FC_SyncOTP 'E' ///ɾδ֪ #define THOST_FTDC_FC_DeleteOrder 'F' -///Ȩ -#define THOST_FTDC_FC_LockInsert 'G' typedef char TThostFtdcFunctionCodeType; @@ -494,8 +487,8 @@ typedef char TThostFtdcFunctionCodeType; #define THOST_FTDC_BFC_ParkedOrderInsert 'K' ///Ԥ񱨵 #define THOST_FTDC_BFC_ParkedOrderAction 'L' -///Ȩ -#define THOST_FTDC_BFC_LockInsert 'M' +///ʽ𲻹Ȩ +#define THOST_FTDC_BFC_ExecOrderNoCheck 'M' typedef char TThostFtdcBrokerFunctionCodeType; @@ -602,10 +595,6 @@ typedef char TThostFtdcTradingRoleType; #define THOST_FTDC_PC_EFP '5' ///ֻȨ #define THOST_FTDC_PC_SpotOption '6' -///Ȩ -#define THOST_FTDC_PC_ETFOption '7' -///֤ȯ -#define THOST_FTDC_PC_Stock '8' typedef char TThostFtdcProductClassType; @@ -690,8 +679,8 @@ typedef char TThostFtdcRatioAttrType; #define THOST_FTDC_HF_Arbitrage '2' ///ױ #define THOST_FTDC_HF_Hedge '3' -/// -#define THOST_FTDC_HF_Covered '4' +/// +#define THOST_FTDC_HF_MarketMaker '5' typedef char TThostFtdcHedgeFlagType; @@ -716,6 +705,8 @@ typedef char TThostFtdcBillHedgeFlagType; #define THOST_FTDC_CIDT_Arbitrage '2' ///ױ #define THOST_FTDC_CIDT_Hedge '3' +/// +#define THOST_FTDC_CIDT_MarketMaker '5' typedef char TThostFtdcClientIDTypeType; @@ -1415,6 +1406,14 @@ typedef char TThostFtdcSystemParamIDType; #define THOST_FTDC_TPID_IsPosiFreeze 'F' ///Ƿ޲ #define THOST_FTDC_TPID_IsPosiLimit 'M' +///֣ѯʱ +#define THOST_FTDC_TPID_ForQuoteTimeInterval 'Q' +///Ƿڻ޲ +#define THOST_FTDC_TPID_IsFuturePosiLimit 'B' +///ǷڻµƵ +#define THOST_FTDC_TPID_IsFutureOrderFreq 'C' +///ȨǷӯ +#define THOST_FTDC_TPID_IsExecOrderProfit 'H' typedef char TThostFtdcTradeParamIDType; @@ -2799,31 +2798,6 @@ typedef char TThostFtdcCFMMCKeyKindType; ///////////////////////////////////////////////////////////////////////// typedef char TThostFtdcAMLReportNameType[81]; -///////////////////////////////////////////////////////////////////////// -///TFtdcDBFComdTypeTypeһDBF -///////////////////////////////////////////////////////////////////////// -typedef char TThostFtdcDBFComdTypeType[65]; - -///////////////////////////////////////////////////////////////////////// -///TFtdcDBFComTimeTypeһDBFʱ -///////////////////////////////////////////////////////////////////////// -typedef char TThostFtdcDBFComTimeType[65]; - -///////////////////////////////////////////////////////////////////////// -///TFtdcDBFComNoTypeһDBFˮ -///////////////////////////////////////////////////////////////////////// -typedef char TThostFtdcDBFComNoType[17]; - -///////////////////////////////////////////////////////////////////////// -///TFtdcDBFFdNameTypeһDBFֶ -///////////////////////////////////////////////////////////////////////// -typedef char TThostFtdcDBFFdNameType[256]; - -///////////////////////////////////////////////////////////////////////// -///TFtdcDBFFdContentTypeһDBFֶ -///////////////////////////////////////////////////////////////////////// -typedef char TThostFtdcDBFFdContentType[256]; - ///////////////////////////////////////////////////////////////////////// ///TFtdcIndividualNameTypeһ ///////////////////////////////////////////////////////////////////////// @@ -3697,6 +3671,12 @@ typedef char TThostFtdcReqRspTypeType; #define THOST_FTDC_FBTUET_SignOut 'A' ///Կͬ #define THOST_FTDC_FBTUET_SyncKey 'B' +///ԤԼ +#define THOST_FTDC_FBTUET_ReserveOpenAccount 'C' +///ԤԼ +#define THOST_FTDC_FBTUET_CancelReserveOpenAccount 'D' +///ԤԼȷ +#define THOST_FTDC_FBTUET_ReserveOpenAccountConfirm 'E' /// #define THOST_FTDC_FBTUET_Other 'Z' @@ -6323,98 +6303,76 @@ typedef char TThostFtdcCFFEXUploadFileNameType; typedef char TThostFtdcCombDirectionType; ///////////////////////////////////////////////////////////////////////// -///TFtdcLockTypeTypeһ +///TFtdcStrikeOffsetTypeTypeһȨƫ ///////////////////////////////////////////////////////////////////////// -/// -#define THOST_FTDC_LCKT_Lock '1' -/// -#define THOST_FTDC_LCKT_Unlock '2' +///ʵֵ +#define THOST_FTDC_STOV_RealValue '1' +///ӯ +#define THOST_FTDC_STOV_ProfitValue '2' +///ʵֵ +#define THOST_FTDC_STOV_RealRatio '3' +///ӯ +#define THOST_FTDC_STOV_ProfitRatio '4' -typedef char TThostFtdcLockTypeType; +typedef char TThostFtdcStrikeOffsetTypeType; ///////////////////////////////////////////////////////////////////////// -///TFtdcBizTypeTypeһҵ +///TFtdcReserveOpenAccStasTypeһԤԼ״̬ ///////////////////////////////////////////////////////////////////////// -///ڻ -#define THOST_FTDC_BZTP_Future '1' -///֤ȯ -#define THOST_FTDC_BZTP_Stock '2' +///ȴ +#define THOST_FTDC_ROAST_Processing '0' +///ѳ +#define THOST_FTDC_ROAST_Cancelled '1' +///ѿ +#define THOST_FTDC_ROAST_Opened '2' +///Ч +#define THOST_FTDC_ROAST_Invalid '3' -typedef char TThostFtdcBizTypeType; +typedef char TThostFtdcReserveOpenAccStasType; ///////////////////////////////////////////////////////////////////////// -///TFtdcDesignateTypeTypeһָ +///TFtdcLoginRemarkTypeһ¼ע ///////////////////////////////////////////////////////////////////////// -///ָǼ -#define THOST_FTDC_DSTP_Register '1' -///ָ -#define THOST_FTDC_DSTP_Cancel '2' - -typedef char TThostFtdcDesignateTypeType; +typedef char TThostFtdcLoginRemarkType[36]; ///////////////////////////////////////////////////////////////////////// -///TFtdcFreezeReasonTypeTypeһԭ +///TFtdcInvestUnitIDTypeһͶʵԪ ///////////////////////////////////////////////////////////////////////// -///ʼ -#define THOST_FTDC_FRTP_Init '1' -/// -#define THOST_FTDC_FRTP_Lock '2' -///ִ -#define THOST_FTDC_FRTP_Exec '3' - -typedef char TThostFtdcFreezeReasonTypeType; +typedef char TThostFtdcInvestUnitIDType[17]; ///////////////////////////////////////////////////////////////////////// -///TFtdcFreezeTypeTypeһ +///TFtdcBulletinIDTypeһ ///////////////////////////////////////////////////////////////////////// -/// -#define THOST_FTDC_FZTP_Freeze '1' -///ⶳ -#define THOST_FTDC_FZTP_Unfreeze '2' -///ǿִ -#define THOST_FTDC_FZTP_Force '3' - -typedef char TThostFtdcFreezeTypeType; +typedef int TThostFtdcBulletinIDType; ///////////////////////////////////////////////////////////////////////// -///TFtdcTradeSystemTypeTypeһϵͳ +///TFtdcNewsTypeTypeһ ///////////////////////////////////////////////////////////////////////// -///δ֪ϵͳ -#define THOST_FTDC_TSTP_Unknow '0' -///ڻϵͳ -#define THOST_FTDC_TSTP_Future '1' -///ϵͳ -#define THOST_FTDC_TSTP_IShare '2' - -typedef char TThostFtdcTradeSystemTypeType; +typedef char TThostFtdcNewsTypeType[3]; ///////////////////////////////////////////////////////////////////////// -///TFtdcStockDisposalTypeTypeһ֤ȯ÷ +///TFtdcNewsUrgencyTypeһ̶ ///////////////////////////////////////////////////////////////////////// -///뾭͹˾˻ -#define THOST_FTDC_STPT_ToBroker '1' -///Ͷ˻ -#define THOST_FTDC_STPT_ToInvestor '2' +typedef char TThostFtdcNewsUrgencyType; -typedef char TThostFtdcStockDisposalTypeType; +///////////////////////////////////////////////////////////////////////// +///TFtdcAbstractTypeһϢժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAbstractType[81]; ///////////////////////////////////////////////////////////////////////// -///TFtdcStockDisposalSysIDTypeһ֤ȯñ +///TFtdcComeFromTypeһϢԴ ///////////////////////////////////////////////////////////////////////// -typedef char TThostFtdcStockDisposalSysIDType[21]; +typedef char TThostFtdcComeFromType[21]; ///////////////////////////////////////////////////////////////////////// -///TFtdcStockDisposalStatusTypeһ״̬ +///TFtdcURLLinkTypeһWEBַ ///////////////////////////////////////////////////////////////////////// -///Ѿύ -#define THOST_FTDC_SDPS_Submitted 'a' -///Ѿ -#define THOST_FTDC_SDPS_Accepted 'b' -///Ѿܾ -#define THOST_FTDC_SDPS_Rejected 'c' -///Ѿ -#define THOST_FTDC_SDPS_Cancelled 'd' +typedef char TThostFtdcURLLinkType[201]; -typedef char TThostFtdcStockDisposalStatusType; +///////////////////////////////////////////////////////////////////////// +///TFtdcLongIndividualNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLongIndividualNameType[161]; #endif diff --git a/include/CTP/ThostFtdcUserApiStruct.h b/include/CTP/ThostFtdcUserApiStruct.h index 4ae204c..6af7695 100644 --- a/include/CTP/ThostFtdcUserApiStruct.h +++ b/include/CTP/ThostFtdcUserApiStruct.h @@ -48,6 +48,8 @@ struct CThostFtdcReqUserLoginField TThostFtdcPasswordType OneTimePassword; ///նIPַ TThostFtdcIPAddressType ClientIPAddress; + ///¼ע + TThostFtdcLoginRemarkType LoginRemark; }; ///û¼Ӧ @@ -433,12 +435,6 @@ struct CThostFtdcInstrumentField TThostFtdcUnderlyingMultipleType UnderlyingMultiple; /// TThostFtdcCombinationTypeType CombinationType; - ///Сµλ - TThostFtdcVolumeType MinBuyVolume; - ///Сµλ - TThostFtdcVolumeType MinSellVolume; - ///Լʶ - TThostFtdcInstrumentCodeType InstrumentCode; }; ///͹˾ @@ -517,10 +513,6 @@ struct CThostFtdcTradingCodeField TThostFtdcBoolType IsActive; ///ױ TThostFtdcClientIDTypeType ClientIDType; - ///Ӫҵ - TThostFtdcBranchIDType BranchID; - ///ҵ - TThostFtdcBizTypeType BizType; }; ///Ա;͹˾ձ @@ -664,8 +656,6 @@ struct CThostFtdcTradingAccountField TThostFtdcMoneyType SpecProductPositionProfitByAlg; ///Ʒ֤ TThostFtdcMoneyType SpecProductExchangeMargin; - ///ҵ - TThostFtdcBizTypeType BizType; }; ///Ͷֲ߳ @@ -757,8 +747,6 @@ struct CThostFtdcInvestorPositionField TThostFtdcMoneyType StrikeFrozenAmount; ///ִж TThostFtdcVolumeType AbandonFrozen; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///Լ֤ @@ -809,10 +797,6 @@ struct CThostFtdcInstrumentCommissionRateField TThostFtdcRatioType CloseTodayRatioByMoney; ///ƽ TThostFtdcRatioType CloseTodayRatioByVolume; - /// - TThostFtdcExchangeIDType ExchangeID; - ///ҵ - TThostFtdcBizTypeType BizType; }; /// @@ -921,10 +905,6 @@ struct CThostFtdcInstrumentTradingRightField TThostFtdcInvestorIDType InvestorID; ///Ȩ TThostFtdcTradingRightType TradingRight; - /// - TThostFtdcExchangeIDType ExchangeID; - ///ҵ - TThostFtdcBizTypeType BizType; }; ///͹˾û @@ -1007,8 +987,6 @@ struct CThostFtdcTraderOfferField TThostFtdcTradeIDType MaxTradeID; ///ϯλ󱨵 TThostFtdcReturnCodeType MaxOrderMessageReference; - ///ҵ - TThostFtdcBizTypeType BizType; }; ///Ͷ߽ @@ -1198,6 +1176,10 @@ struct CThostFtdcLoginInfoField TThostFtdcPasswordType OneTimePassword; ///Դʱ TThostFtdcTimeType INETime; + ///ѯʱǷҪ + TThostFtdcBoolType IsQryControl; + ///¼ע + TThostFtdcLoginRemarkType LoginRemark; }; ///¼Ϣ @@ -1288,6 +1270,18 @@ struct CThostFtdcInputOrderField TThostFtdcBoolType IsSwapOrder; /// TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; /// @@ -1409,6 +1403,16 @@ struct CThostFtdcOrderField TThostFtdcBoolType IsSwapOrder; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; /// @@ -1500,6 +1504,10 @@ struct CThostFtdcExchangeOrderField TThostFtdcSequenceNoType SequenceNo; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ʧ @@ -1552,6 +1560,12 @@ struct CThostFtdcInputOrderActionField TThostFtdcUserIDType UserID; ///Լ TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; /// @@ -1609,6 +1623,12 @@ struct CThostFtdcOrderActionField TThostFtdcInstrumentIDType InstrumentID; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; /// @@ -1648,6 +1668,10 @@ struct CThostFtdcExchangeOrderActionField TThostFtdcUserIDType UserID; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ʧ @@ -1669,8 +1693,6 @@ struct CThostFtdcExchangeOrderActionErrorField TThostFtdcErrorIDType ErrorID; ///Ϣ TThostFtdcErrorMsgType ErrorMsg; - ///͹˾ - TThostFtdcBrokerIDType BrokerID; }; ///ɽ @@ -1812,6 +1834,8 @@ struct CThostFtdcUserSessionField TThostFtdcProtocolInfoType ProtocolInfo; ///Macַ TThostFtdcMacAddressType MacAddress; + ///¼ע + TThostFtdcLoginRemarkType LoginRemark; }; ///ѯ󱨵 @@ -1831,8 +1855,6 @@ struct CThostFtdcQueryMaxOrderVolumeField TThostFtdcHedgeFlagType HedgeFlag; /// TThostFtdcVolumeType MaxVolume; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///Ͷ߽ȷϢ @@ -1935,8 +1957,6 @@ struct CThostFtdcSyncingTradingCodeField TThostFtdcBoolType IsActive; ///ױ TThostFtdcClientIDTypeType ClientIDType; - ///Ӫҵ - TThostFtdcBranchIDType BranchID; }; ///ͬеͶ߷ @@ -2136,8 +2156,6 @@ struct CThostFtdcSyncingInvestorPositionField TThostFtdcMoneyType StrikeFrozenAmount; ///ִж TThostFtdcVolumeType AbandonFrozen; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ͬеĺԼ֤ @@ -2188,8 +2206,6 @@ struct CThostFtdcSyncingInstrumentCommissionRateField TThostFtdcRatioType CloseTodayRatioByMoney; ///ƽ TThostFtdcRatioType CloseTodayRatioByVolume; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ͬеĺԼȨ @@ -2205,8 +2221,6 @@ struct CThostFtdcSyncingInstrumentTradingRightField TThostFtdcInvestorIDType InvestorID; ///Ȩ TThostFtdcTradingRightType TradingRight; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ѯ @@ -2256,8 +2270,6 @@ struct CThostFtdcQryInvestorPositionField TThostFtdcInvestorIDType InvestorID; ///Լ TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ѯʽ˻ @@ -2269,8 +2281,6 @@ struct CThostFtdcQryTradingAccountField TThostFtdcInvestorIDType InvestorID; ///ִ TThostFtdcCurrencyIDType CurrencyID; - ///ҵ - TThostFtdcBizTypeType BizType; }; ///ѯͶ @@ -2326,8 +2336,6 @@ struct CThostFtdcQryInstrumentCommissionRateField TThostFtdcInvestorIDType InvestorID; ///Լ TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ѯԼȨ @@ -2339,8 +2347,6 @@ struct CThostFtdcQryInstrumentTradingRightField TThostFtdcInvestorIDType InvestorID; ///Լ TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ѯ͹˾ @@ -2459,8 +2465,6 @@ struct CThostFtdcQryProductField TThostFtdcInstrumentIDType ProductID; ///Ʒ TThostFtdcProductClassType ProductClass; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ѯԼ @@ -2481,8 +2485,6 @@ struct CThostFtdcQryDepthMarketDataField { ///Լ TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ѯ͹˾û @@ -2616,8 +2618,6 @@ struct CThostFtdcOptionInstrMiniMarginField TThostFtdcValueMethodType ValueMethod; ///Ƿ潻ȡ TThostFtdcBoolType IsRelative; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ǰȨԼ֤ϵ @@ -2645,8 +2645,10 @@ struct CThostFtdcOptionInstrMarginAdjustField TThostFtdcMoneyType AShortMarginRatioByVolume; ///Ƿ潻ȡ TThostFtdcBoolType IsRelative; - /// - TThostFtdcExchangeIDType ExchangeID; + ///̿ͷ֤ϵ + TThostFtdcRatioType MShortMarginRatioByMoney; + ///̿ͷ֤ϵ + TThostFtdcMoneyType MShortMarginRatioByVolume; }; ///ǰȨԼѵϸ @@ -2676,8 +2678,6 @@ struct CThostFtdcOptionInstrCommRateField TThostFtdcRatioType StrikeRatioByMoney; ///ִ TThostFtdcRatioType StrikeRatioByVolume; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///Ȩ׳ɱ @@ -2701,8 +2701,6 @@ struct CThostFtdcOptionInstrTradeCostField TThostFtdcMoneyType ExchFixedMargin; ///ȨԼС֤ TThostFtdcMoneyType ExchMiniMargin; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///Ȩ׳ɱѯ @@ -2720,8 +2718,6 @@ struct CThostFtdcQryOptionInstrTradeCostField TThostFtdcPriceType InputPrice; ///ļ۸,0 TThostFtdcPriceType UnderlyingPrice; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///Ȩʲѯ @@ -2733,8 +2729,6 @@ struct CThostFtdcQryOptionInstrCommRateField TThostFtdcInvestorIDType InvestorID; ///Լ TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ָָֻ @@ -2746,8 +2740,6 @@ struct CThostFtdcIndexPriceField TThostFtdcInstrumentIDType InstrumentID; ///ָֻ̼ TThostFtdcPriceType ClosePrice; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ִ @@ -2783,6 +2775,18 @@ struct CThostFtdcInputExecOrderField TThostFtdcExecOrderCloseFlagType CloseFlag; /// TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ִ @@ -2812,6 +2816,12 @@ struct CThostFtdcInputExecOrderActionField TThostFtdcUserIDType UserID; ///Լ TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ִ @@ -2895,6 +2905,16 @@ struct CThostFtdcExecOrderField TThostFtdcSequenceNoType BrokerExecOrderSeq; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ִ @@ -2950,6 +2970,12 @@ struct CThostFtdcExecOrderActionField TThostFtdcInstrumentIDType InstrumentID; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ִѯ @@ -3030,6 +3056,10 @@ struct CThostFtdcExchangeExecOrderField TThostFtdcSequenceNoType SequenceNo; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ִѯ @@ -3093,6 +3123,10 @@ struct CThostFtdcExchangeExecOrderActionField TThostFtdcActionTypeType ActionType; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ִѯ @@ -3141,6 +3175,18 @@ struct CThostFtdcErrExecOrderField TThostFtdcExecOrderCloseFlagType CloseFlag; /// TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; /// TThostFtdcErrorIDType ErrorID; ///Ϣ @@ -3183,6 +3229,12 @@ struct CThostFtdcErrExecOrderActionField TThostFtdcUserIDType UserID; ///Լ TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; /// TThostFtdcErrorIDType ErrorID; ///Ϣ @@ -3213,10 +3265,6 @@ struct CThostFtdcOptionInstrTradingRightField TThostFtdcDirectionType Direction; ///Ȩ TThostFtdcTradingRightType TradingRight; - /// - TThostFtdcExchangeIDType ExchangeID; - ///Ͷױ־ - TThostFtdcHedgeFlagType HedgeFlag; }; ///ѯȨԼȨ @@ -3230,8 +3278,6 @@ struct CThostFtdcQryOptionInstrTradingRightField TThostFtdcInstrumentIDType InstrumentID; /// TThostFtdcDirectionType Direction; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ѯ @@ -3249,6 +3295,12 @@ struct CThostFtdcInputForQuoteField TThostFtdcUserIDType UserID; /// TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ѯ @@ -3294,6 +3346,12 @@ struct CThostFtdcForQuoteField TThostFtdcUserIDType ActiveUserID; ///͹˾ѯ۱ TThostFtdcSequenceNoType BrokerForQutoSeq; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ѯ۲ѯ @@ -3336,6 +3394,10 @@ struct CThostFtdcExchangeForQuoteField TThostFtdcTimeType InsertTime; ///ѯ״̬ TThostFtdcForQuoteStatusType ForQuoteStatus; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ѯ۲ѯ @@ -3394,6 +3456,14 @@ struct CThostFtdcInputQuoteField TThostFtdcOrderSysIDType ForQuoteSysID; /// TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///뱨۲ @@ -3423,6 +3493,14 @@ struct CThostFtdcInputQuoteActionField TThostFtdcUserIDType UserID; ///Լ TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; /// @@ -3518,6 +3596,16 @@ struct CThostFtdcQuoteField TThostFtdcOrderSysIDType ForQuoteSysID; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///۲ @@ -3571,6 +3659,12 @@ struct CThostFtdcQuoteActionField TThostFtdcInstrumentIDType InstrumentID; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///۲ѯ @@ -3659,6 +3753,10 @@ struct CThostFtdcExchangeQuoteField TThostFtdcOrderSysIDType ForQuoteSysID; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///۲ѯ @@ -3718,6 +3816,10 @@ struct CThostFtdcExchangeQuoteActionField TThostFtdcOrderActionStatusType OrderActionStatus; ///û TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///۲ѯ @@ -3746,8 +3848,6 @@ struct CThostFtdcOptionInstrDeltaField TThostFtdcInvestorIDType InvestorID; ///Deltaֵ TThostFtdcRatioType Delta; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///̵ѯ @@ -3780,8 +3880,8 @@ struct CThostFtdcStrikeOffsetField TThostFtdcInvestorIDType InvestorID; ///ִƫֵ TThostFtdcMoneyType Offset; - /// - TThostFtdcExchangeIDType ExchangeID; + ///ִƫ + TThostFtdcStrikeOffsetTypeType OffsetType; }; ///Ȩִƫֵѯ @@ -3795,788 +3895,120 @@ struct CThostFtdcQryStrikeOffsetField TThostFtdcInstrumentIDType InstrumentID; }; -///¼ -struct CThostFtdcInputLockField +/// +struct CThostFtdcInputBatchOrderActionField { ///͹˾ TThostFtdcBrokerIDType BrokerID; ///Ͷߴ TThostFtdcInvestorIDType InvestorID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcOrderRefType LockRef; - ///û - TThostFtdcUserIDType UserID; - /// - TThostFtdcVolumeType Volume; + /// + TThostFtdcOrderActionRefType OrderActionRef; /// TThostFtdcRequestIDType RequestID; - ///ҵԪ - TThostFtdcBusinessUnitType BusinessUnit; - /// - TThostFtdcLockTypeType LockType; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; /// TThostFtdcExchangeIDType ExchangeID; + ///û + TThostFtdcUserIDType UserID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; -/// -struct CThostFtdcLockField +/// +struct CThostFtdcBatchOrderActionField { ///͹˾ TThostFtdcBrokerIDType BrokerID; ///Ͷߴ TThostFtdcInvestorIDType InvestorID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcOrderRefType LockRef; - ///û - TThostFtdcUserIDType UserID; - /// - TThostFtdcVolumeType Volume; + /// + TThostFtdcOrderActionRefType OrderActionRef; /// TThostFtdcRequestIDType RequestID; - ///ҵԪ - TThostFtdcBusinessUnitType BusinessUnit; - /// - TThostFtdcLockTypeType LockType; - /// - TThostFtdcOrderLocalIDType LockLocalID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; /// TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; ///Ա TThostFtdcParticipantIDType ParticipantID; ///ͻ TThostFtdcClientIDType ClientID; - ///ԼڽĴ - TThostFtdcExchangeInstIDType ExchangeInstID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +/// +struct CThostFtdcExchangeBatchOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; ///Ա TThostFtdcTraderIDType TraderID; ///װ TThostFtdcInstallIDType InstallID; - ///ִύ״̬ - TThostFtdcOrderSubmitStatusType OrderSubmitStatus; - ///ʾ - TThostFtdcSequenceNoType NotifySequence; - /// - TThostFtdcDateType TradingDay; - /// - TThostFtdcSettlementIDType SettlementID; - /// - TThostFtdcOrderSysIDType LockSysID; - /// - TThostFtdcDateType InsertDate; - ///ʱ - TThostFtdcTimeType InsertTime; - ///ʱ - TThostFtdcTimeType CancelTime; - ///״̬ - TThostFtdcOrderActionStatusType LockStatus; - ///Ա - TThostFtdcParticipantIDType ClearingPartID; - /// - TThostFtdcSequenceNoType SequenceNo; - ///ǰñ - TThostFtdcFrontIDType FrontID; - ///Ự - TThostFtdcSessionIDType SessionID; - ///û˲ƷϢ - TThostFtdcProductInfoType UserProductInfo; - ///״̬Ϣ - TThostFtdcErrorMsgType StatusMsg; - ///û - TThostFtdcUserIDType ActiveUserID; - ///͹˾ - TThostFtdcSequenceNoType BrokerLockSeq; - ///Ӫҵ - TThostFtdcBranchIDType BranchID; -}; - -///ѯ -struct CThostFtdcQryLockField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; - /// - TThostFtdcOrderSysIDType LockSysID; - ///ʼʱ - TThostFtdcTimeType InsertTimeStart; - ///ʱ - TThostFtdcTimeType InsertTimeEnd; -}; - -///֤ȯλ -struct CThostFtdcLockPositionField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; - /// - TThostFtdcVolumeType Volume; - /// - TThostFtdcVolumeType FrozenVolume; -}; - -///ѯ֤ȯλ -struct CThostFtdcQryLockPositionField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; -}; - -///ǰETFȨԼѵϸ -struct CThostFtdcETFOptionInstrCommRateField -{ - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - ///Ͷ߷Χ - TThostFtdcInvestorRangeType InvestorRange; - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - /// - TThostFtdcRatioType OpenRatioByMoney; - /// - TThostFtdcRatioType OpenRatioByVolume; - ///ƽ - TThostFtdcRatioType CloseRatioByMoney; - ///ƽ - TThostFtdcRatioType CloseRatioByVolume; - ///ƽ - TThostFtdcRatioType CloseTodayRatioByMoney; - ///ƽ - TThostFtdcRatioType CloseTodayRatioByVolume; - ///ִ - TThostFtdcRatioType StrikeRatioByMoney; - ///ִ - TThostFtdcRatioType StrikeRatioByVolume; - /// - TThostFtdcExchangeIDType ExchangeID; - ///Ͷױ־ - TThostFtdcHedgeFlagType HedgeFlag; - ///ֲַ - TThostFtdcPosiDirectionType PosiDirection; -}; - -///ETFȨʲѯ -struct CThostFtdcQryETFOptionInstrCommRateField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; -}; - -///ijֲֶ -struct CThostFtdcPosiFreezeField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; - ///ر - TThostFtdcOrderLocalIDType OrderLocalID; - ///Ա - TThostFtdcTraderIDType TraderID; - ///Ա - TThostFtdcParticipantIDType ParticipantID; - ///װ - TThostFtdcInstallIDType InstallID; - /// - TThostFtdcVolumeType Volume; - ///ԭ - TThostFtdcFreezeReasonTypeType FreezeReasonType; - /// - TThostFtdcFreezeTypeType FreezeType; -}; - -///ѯ -struct CThostFtdcQryExchangeLockField -{ - ///Ա - TThostFtdcParticipantIDType ParticipantID; - ///ͻ - TThostFtdcClientIDType ClientID; - ///ԼڽĴ - TThostFtdcExchangeInstIDType ExchangeInstID; - /// - TThostFtdcExchangeIDType ExchangeID; - ///Ա - TThostFtdcTraderIDType TraderID; -}; - -/// -struct CThostFtdcExchangeLockField -{ - /// - TThostFtdcVolumeType Volume; - /// - TThostFtdcRequestIDType RequestID; - ///ҵԪ - TThostFtdcBusinessUnitType BusinessUnit; - /// - TThostFtdcLockTypeType LockType; - /// - TThostFtdcOrderLocalIDType LockLocalID; - /// - TThostFtdcExchangeIDType ExchangeID; - ///Ա - TThostFtdcParticipantIDType ParticipantID; - ///ͻ - TThostFtdcClientIDType ClientID; - ///ԼڽĴ - TThostFtdcExchangeInstIDType ExchangeInstID; - ///Ա - TThostFtdcTraderIDType TraderID; - ///װ - TThostFtdcInstallIDType InstallID; - ///ִύ״̬ - TThostFtdcOrderSubmitStatusType OrderSubmitStatus; - ///ʾ - TThostFtdcSequenceNoType NotifySequence; - /// - TThostFtdcDateType TradingDay; - /// - TThostFtdcSettlementIDType SettlementID; - /// - TThostFtdcOrderSysIDType LockSysID; - /// - TThostFtdcDateType InsertDate; - ///ʱ - TThostFtdcTimeType InsertTime; - ///ʱ - TThostFtdcTimeType CancelTime; - ///״̬ - TThostFtdcOrderActionStatusType LockStatus; - ///Ա - TThostFtdcParticipantIDType ClearingPartID; - /// - TThostFtdcSequenceNoType SequenceNo; - ///Ӫҵ - TThostFtdcBranchIDType BranchID; -}; - -/// -struct CThostFtdcExchangeExecOrderActionErrorField -{ - /// - TThostFtdcExchangeIDType ExchangeID; - ///ִ - TThostFtdcExecOrderSysIDType ExecOrderSysID; - ///Ա - TThostFtdcTraderIDType TraderID; - ///װ - TThostFtdcInstallIDType InstallID; - ///ִ - TThostFtdcOrderLocalIDType ExecOrderLocalID; - ///ر - TThostFtdcOrderLocalIDType ActionLocalID; - /// - TThostFtdcErrorIDType ErrorID; - ///Ϣ - TThostFtdcErrorMsgType ErrorMsg; - ///͹˾ - TThostFtdcBrokerIDType BrokerID; -}; - -/// -struct CThostFtdcInputBatchOrderActionField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - /// - TThostFtdcOrderActionRefType OrderActionRef; - /// - TThostFtdcRequestIDType RequestID; - ///ǰñ - TThostFtdcFrontIDType FrontID; - ///Ự - TThostFtdcSessionIDType SessionID; - /// - TThostFtdcExchangeIDType ExchangeID; - ///û - TThostFtdcUserIDType UserID; -}; - -/// -struct CThostFtdcBatchOrderActionField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - /// - TThostFtdcOrderActionRefType OrderActionRef; - /// - TThostFtdcRequestIDType RequestID; - ///ǰñ - TThostFtdcFrontIDType FrontID; - ///Ự - TThostFtdcSessionIDType SessionID; - /// - TThostFtdcExchangeIDType ExchangeID; - /// - TThostFtdcDateType ActionDate; - ///ʱ - TThostFtdcTimeType ActionTime; - ///Ա - TThostFtdcTraderIDType TraderID; - ///װ - TThostFtdcInstallIDType InstallID; - ///ر - TThostFtdcOrderLocalIDType ActionLocalID; - ///Ա - TThostFtdcParticipantIDType ParticipantID; - ///ͻ - TThostFtdcClientIDType ClientID; - ///ҵԪ - TThostFtdcBusinessUnitType BusinessUnit; - ///״̬ - TThostFtdcOrderActionStatusType OrderActionStatus; - ///û - TThostFtdcUserIDType UserID; - ///״̬Ϣ - TThostFtdcErrorMsgType StatusMsg; -}; - -/// -struct CThostFtdcExchangeBatchOrderActionField -{ - /// - TThostFtdcExchangeIDType ExchangeID; - /// - TThostFtdcDateType ActionDate; - ///ʱ - TThostFtdcTimeType ActionTime; - ///Ա - TThostFtdcTraderIDType TraderID; - ///װ - TThostFtdcInstallIDType InstallID; - ///ر - TThostFtdcOrderLocalIDType ActionLocalID; - ///Ա - TThostFtdcParticipantIDType ParticipantID; - ///ͻ - TThostFtdcClientIDType ClientID; - ///ҵԪ - TThostFtdcBusinessUnitType BusinessUnit; - ///״̬ - TThostFtdcOrderActionStatusType OrderActionStatus; - ///û - TThostFtdcUserIDType UserID; -}; - -///ѯ -struct CThostFtdcQryBatchOrderActionField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - /// - TThostFtdcExchangeIDType ExchangeID; -}; - -///Ͷֲ߳ -struct CThostFtdcLimitPosiField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; - /// - TThostFtdcVolumeType TotalVolume; - ///ͷ - TThostFtdcVolumeType LongVolume; - ///նͷ - TThostFtdcVolumeType OpenVolume; - ///ͷֲֽ - TThostFtdcMoneyType LongAmount; - /// - TThostFtdcVolumeType TotalVolumeFrozen; - ///ͷ - TThostFtdcVolumeType LongVolumeFrozen; - ///նͷ - TThostFtdcVolumeType OpenVolumeFrozen; - ///ͷֲֽ - TThostFtdcMoneyType LongAmountFrozen; -}; - -///ѯͶֲ߳ -struct CThostFtdcQryLimitPosiField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; -}; - -///͹˾ֲ -struct CThostFtdcBrokerLimitPosiField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; - /// - TThostFtdcLargeVolumeType TotalVolume; - ///ͷ - TThostFtdcLargeVolumeType LongVolume; - /// - TThostFtdcLargeVolumeType TotalVolumeFrozen; - ///ͷ - TThostFtdcLargeVolumeType LongVolumeFrozen; -}; - -///ѯ͹˾ֲ -struct CThostFtdcQryBrokerLimitPosiField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; -}; - -///Ͷ֤ȯֲ -struct CThostFtdcLimitPosiSField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; - /// - TThostFtdcVolumeType TotalVolume; - ///տ - TThostFtdcVolumeType OpenVolume; - /// - TThostFtdcVolumeType TotalVolumeFrozen; - ///տ - TThostFtdcVolumeType OpenVolumeFrozen; -}; - -///ѯͶ֤ȯֲ -struct CThostFtdcQryLimitPosiSField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; -}; - -///Ͷֲ߳Ʋ -struct CThostFtdcLimitPosiParamField -{ - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - ///Ͷ߷Χ - TThostFtdcInvestorRangeType InvestorRange; - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - /// - TThostFtdcExchangeIDType ExchangeID; - /// - TThostFtdcVolumeType TotalVolume; - ///ͷ - TThostFtdcVolumeType LongVolume; - ///նͷ - TThostFtdcVolumeType OpenVolume; - ///ͷֲֽ - TThostFtdcMoneyType LongAmount; -}; - -///͹˾ֲƲ -struct CThostFtdcBrokerLimitPosiParamField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; - /// - TThostFtdcLargeVolumeType TotalVolume; - ///ͷ - TThostFtdcLargeVolumeType LongVolume; -}; - -///Ͷ֤ȯֲƲ -struct CThostFtdcLimitPosiParamSField -{ - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - ///Ͷ߷Χ - TThostFtdcInvestorRangeType InvestorRange; - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - /// - TThostFtdcExchangeIDType ExchangeID; - /// - TThostFtdcVolumeType TotalVolume; - ///տ - TThostFtdcVolumeType OpenVolume; -}; - -///֤ȯò -struct CThostFtdcInputStockDisposalActionField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///֤ȯò - TThostFtdcOrderActionRefType StockDisposalActionRef; - ///֤ȯ - TThostFtdcOrderRefType StockDisposalRef; - /// - TThostFtdcRequestIDType RequestID; - ///ǰñ - TThostFtdcFrontIDType FrontID; - ///Ự - TThostFtdcSessionIDType SessionID; - /// - TThostFtdcExchangeIDType ExchangeID; - ///֤ȯò - TThostFtdcStockDisposalSysIDType StockDisposalSysID; - ///־ - TThostFtdcActionFlagType ActionFlag; - ///û - TThostFtdcUserIDType UserID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; -}; - -///֤ȯò -struct CThostFtdcStockDisposalActionField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///֤ȯò - TThostFtdcOrderActionRefType StockDisposalActionRef; - ///֤ȯ - TThostFtdcOrderRefType StockDisposalRef; - /// - TThostFtdcRequestIDType RequestID; - ///ǰñ - TThostFtdcFrontIDType FrontID; - ///Ự - TThostFtdcSessionIDType SessionID; - /// - TThostFtdcExchangeIDType ExchangeID; - ///֤ȯò - TThostFtdcStockDisposalSysIDType StockDisposalSysID; - ///־ - TThostFtdcActionFlagType ActionFlag; - /// - TThostFtdcDateType ActionDate; - ///ʱ - TThostFtdcTimeType ActionTime; - ///Ա - TThostFtdcTraderIDType TraderID; - ///װ - TThostFtdcInstallIDType InstallID; - ///֤ȯñ - TThostFtdcOrderLocalIDType StockDisposalLocalID; - ///ر - TThostFtdcOrderLocalIDType ActionLocalID; - ///Ա - TThostFtdcParticipantIDType ParticipantID; - ///ͻ - TThostFtdcClientIDType ClientID; - ///ҵԪ - TThostFtdcBusinessUnitType BusinessUnit; - ///״̬ - TThostFtdcOrderActionStatusType OrderActionStatus; - ///û - TThostFtdcUserIDType UserID; - ///ִ - TThostFtdcActionTypeType ActionType; - ///״̬Ϣ - TThostFtdcErrorMsgType StatusMsg; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - ///Ӫҵ - TThostFtdcBranchIDType BranchID; -}; - -///֤ȯòѯ -struct CThostFtdcQryStockDisposalActionField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - /// - TThostFtdcExchangeIDType ExchangeID; -}; - -///֤ȯò -struct CThostFtdcExchangeStockDisposalActionField -{ - /// - TThostFtdcExchangeIDType ExchangeID; - ///֤ȯò - TThostFtdcStockDisposalSysIDType StockDisposalSysID; - ///־ - TThostFtdcActionFlagType ActionFlag; - /// - TThostFtdcDateType ActionDate; - ///ʱ - TThostFtdcTimeType ActionTime; - ///Ա - TThostFtdcTraderIDType TraderID; - ///װ - TThostFtdcInstallIDType InstallID; - ///֤ȯñ - TThostFtdcOrderLocalIDType StockDisposalLocalID; - ///ر - TThostFtdcOrderLocalIDType ActionLocalID; - ///Ա - TThostFtdcParticipantIDType ParticipantID; - ///ͻ - TThostFtdcClientIDType ClientID; - ///ҵԪ - TThostFtdcBusinessUnitType BusinessUnit; - ///״̬ - TThostFtdcOrderActionStatusType OrderActionStatus; - ///û - TThostFtdcUserIDType UserID; - ///ִ - TThostFtdcActionTypeType ActionType; - ///Ӫҵ - TThostFtdcBranchIDType BranchID; -}; - -///֤ȯò -struct CThostFtdcQryExchangeStockDisposalActionField -{ + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; ///Ա TThostFtdcParticipantIDType ParticipantID; ///ͻ TThostFtdcClientIDType ClientID; - /// - TThostFtdcExchangeIDType ExchangeID; - ///Ա - TThostFtdcTraderIDType TraderID; -}; - -///ѯ֤ȯò -struct CThostFtdcQryErrStockDisposalActionField -{ - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; -}; - -///֤ȯò -struct CThostFtdcExchangeStockDisposalActionErrorField -{ - /// - TThostFtdcExchangeIDType ExchangeID; - ///֤ȯñ - TThostFtdcStockDisposalSysIDType StockDisposalSysID; - ///Ա - TThostFtdcTraderIDType TraderID; - ///װ - TThostFtdcInstallIDType InstallID; - ///֤ȯñ - TThostFtdcOrderLocalIDType StockDisposalLocalID; - ///ر - TThostFtdcOrderLocalIDType ActionLocalID; - /// - TThostFtdcErrorIDType ErrorID; - ///Ϣ - TThostFtdcErrorMsgType ErrorMsg; - ///͹˾ - TThostFtdcBrokerIDType BrokerID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; -///֤ȯò -struct CThostFtdcErrStockDisposalActionField +///ѯ +struct CThostFtdcQryBatchOrderActionField { ///͹˾ TThostFtdcBrokerIDType BrokerID; ///Ͷߴ TThostFtdcInvestorIDType InvestorID; - ///֤ȯò - TThostFtdcOrderActionRefType StockDisposalActionRef; - ///֤ȯ - TThostFtdcOrderRefType StockDisposalRef; - /// - TThostFtdcRequestIDType RequestID; - ///ǰñ - TThostFtdcFrontIDType FrontID; - ///Ự - TThostFtdcSessionIDType SessionID; /// TThostFtdcExchangeIDType ExchangeID; - ///֤ȯò - TThostFtdcStockDisposalSysIDType StockDisposalSysID; - ///־ - TThostFtdcActionFlagType ActionFlag; - ///û - TThostFtdcUserIDType UserID; - ///Լ - TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcErrorIDType ErrorID; - ///Ϣ - TThostFtdcErrorMsgType ErrorMsg; }; ///ϺԼȫϵ @@ -4622,6 +4054,10 @@ struct CThostFtdcInputCombActionField TThostFtdcHedgeFlagType HedgeFlag; /// TThostFtdcExchangeIDType ExchangeID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; /// @@ -4677,6 +4113,10 @@ struct CThostFtdcCombActionField TThostFtdcProductInfoType UserProductInfo; ///״̬Ϣ TThostFtdcErrorMsgType StatusMsg; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ϲѯ @@ -4727,6 +4167,10 @@ struct CThostFtdcExchangeCombActionField TThostFtdcSettlementIDType SettlementID; /// TThostFtdcSequenceNoType SequenceNo; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ϲѯ @@ -4762,246 +4206,136 @@ struct CThostFtdcQryProductExchRateField TThostFtdcInstrumentIDType ProductID; }; -///ָ -struct CThostFtdcInputDesignateField +///ѯѯۼ۲ +struct CThostFtdcQryForQuoteParamField { ///͹˾ TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///ָǼ - TThostFtdcOrderRefType DesignateRef; - ///û - TThostFtdcUserIDType UserID; - ///ָ - TThostFtdcDesignateTypeType DesignateType; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; /// TThostFtdcExchangeIDType ExchangeID; }; -///ָ -struct CThostFtdcDesignateField +///ѯۼ۲ +struct CThostFtdcForQuoteParamField { ///͹˾ TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///ָǼ - TThostFtdcOrderRefType DesignateRef; - ///û - TThostFtdcUserIDType UserID; - ///ָ - TThostFtdcDesignateTypeType DesignateType; - ///ָ - TThostFtdcOrderLocalIDType DesignateLocalID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; /// TThostFtdcExchangeIDType ExchangeID; - ///Ա - TThostFtdcParticipantIDType ParticipantID; - ///ͻ - TThostFtdcClientIDType ClientID; - ///Ա - TThostFtdcTraderIDType TraderID; - ///װ - TThostFtdcInstallIDType InstallID; - ///ָ״̬ - TThostFtdcOrderActionStatusType DesignateStatus; - ///ʾ - TThostFtdcSequenceNoType NotifySequence; - /// - TThostFtdcDateType TradingDay; - /// - TThostFtdcSettlementIDType SettlementID; - /// - TThostFtdcDateType InsertDate; - ///ʱ - TThostFtdcTimeType InsertTime; - ///ǰñ - TThostFtdcFrontIDType FrontID; - ///Ự - TThostFtdcSessionIDType SessionID; - ///û˲ƷϢ - TThostFtdcProductInfoType UserProductInfo; - ///״̬Ϣ - TThostFtdcErrorMsgType StatusMsg; - ///Ӫҵ - TThostFtdcBranchIDType BranchID; + ///¼ + TThostFtdcPriceType LastPrice; + ///۲ + TThostFtdcPriceType PriceInterval; }; -///ָ -struct CThostFtdcQryDesignateField +///ǰȨԼѵϸ +struct CThostFtdcMMOptionInstrCommRateField { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; ///͹˾ TThostFtdcBrokerIDType BrokerID; ///Ͷߴ TThostFtdcInvestorIDType InvestorID; - /// - TThostFtdcExchangeIDType ExchangeID; -}; - -///ָϢ -struct CThostFtdcExchangeDesignateField -{ - ///ָ - TThostFtdcDesignateTypeType DesignateType; - ///ָ - TThostFtdcOrderLocalIDType DesignateLocalID; - /// - TThostFtdcExchangeIDType ExchangeID; - ///Ա - TThostFtdcParticipantIDType ParticipantID; - ///ͻ - TThostFtdcClientIDType ClientID; - ///Ա - TThostFtdcTraderIDType TraderID; - ///װ - TThostFtdcInstallIDType InstallID; - ///ָ״̬ - TThostFtdcOrderActionStatusType DesignateStatus; - ///ʾ - TThostFtdcSequenceNoType NotifySequence; - /// - TThostFtdcDateType TradingDay; - /// - TThostFtdcSettlementIDType SettlementID; - /// - TThostFtdcDateType InsertDate; - ///ʱ - TThostFtdcTimeType InsertTime; - ///Ӫҵ - TThostFtdcBranchIDType BranchID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; }; -///֤ȯ -struct CThostFtdcInputStockDisposalField +///Ȩʲѯ +struct CThostFtdcQryMMOptionInstrCommRateField { ///͹˾ TThostFtdcBrokerIDType BrokerID; ///Ͷߴ TThostFtdcInvestorIDType InvestorID; - ///֤ȯõǼ - TThostFtdcOrderRefType StockDisposalRef; - ///û - TThostFtdcUserIDType UserID; ///Լ TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcVolumeType Volume; - ///֤ȯ÷ - TThostFtdcStockDisposalTypeType StockDisposalType; - /// - TThostFtdcExchangeIDType ExchangeID; }; -///֤ȯ -struct CThostFtdcStockDisposalField +///̺Լ +struct CThostFtdcMMInstrumentCommissionRateField { - ///͹˾ - TThostFtdcBrokerIDType BrokerID; - ///Ͷߴ - TThostFtdcInvestorIDType InvestorID; - ///֤ȯõǼ - TThostFtdcOrderRefType StockDisposalRef; - ///û - TThostFtdcUserIDType UserID; ///Լ TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcVolumeType Volume; - ///֤ȯ÷ - TThostFtdcStockDisposalTypeType StockDisposalType; - ///֤ȯñ - TThostFtdcOrderLocalIDType StockDisposalLocalID; - /// - TThostFtdcExchangeIDType ExchangeID; - ///ԼڽĴ - TThostFtdcExchangeInstIDType ExchangeInstID; - ///Ա - TThostFtdcParticipantIDType ParticipantID; - ///ͻ - TThostFtdcClientIDType ClientID; - ///Ա - TThostFtdcTraderIDType TraderID; - ///װ - TThostFtdcInstallIDType InstallID; - ///֤ȯ״̬ - TThostFtdcStockDisposalStatusType StockDisposalStatus; - ///ʾ - TThostFtdcSequenceNoType NotifySequence; - /// - TThostFtdcDateType TradingDay; - /// - TThostFtdcSettlementIDType SettlementID; - /// - TThostFtdcDateType InsertDate; - ///ʱ - TThostFtdcTimeType InsertTime; - ///ǰñ - TThostFtdcFrontIDType FrontID; - ///Ự - TThostFtdcSessionIDType SessionID; - ///û˲ƷϢ - TThostFtdcProductInfoType UserProductInfo; - ///״̬Ϣ - TThostFtdcErrorMsgType StatusMsg; - ///Ӫҵ - TThostFtdcBranchIDType BranchID; - ///֤ȯò - TThostFtdcStockDisposalSysIDType StockDisposalSysID; - ///ҵԪ - TThostFtdcBusinessUnitType BusinessUnit; -}; - -///֤ȯ -struct CThostFtdcQryStockDisposalField -{ + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; ///͹˾ TThostFtdcBrokerIDType BrokerID; ///Ͷߴ TThostFtdcInvestorIDType InvestorID; - /// - TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; }; - -///֤ȯϢ -struct CThostFtdcExchangeStockDisposalField -{ - /// - TThostFtdcVolumeType Volume; - ///֤ȯ÷ - TThostFtdcStockDisposalTypeType StockDisposalType; - ///֤ȯñ - TThostFtdcOrderLocalIDType StockDisposalLocalID; - /// - TThostFtdcExchangeIDType ExchangeID; - ///ԼڽĴ - TThostFtdcExchangeInstIDType ExchangeInstID; - ///Ա - TThostFtdcParticipantIDType ParticipantID; - ///ͻ - TThostFtdcClientIDType ClientID; - ///Ա - TThostFtdcTraderIDType TraderID; - ///װ - TThostFtdcInstallIDType InstallID; - ///֤ȯ״̬ - TThostFtdcStockDisposalStatusType StockDisposalStatus; - ///ʾ - TThostFtdcSequenceNoType NotifySequence; - /// - TThostFtdcDateType TradingDay; - /// - TThostFtdcSettlementIDType SettlementID; - /// - TThostFtdcDateType InsertDate; - ///ʱ - TThostFtdcTimeType InsertTime; - ///Ӫҵ - TThostFtdcBranchIDType BranchID; - ///֤ȯò - TThostFtdcStockDisposalSysIDType StockDisposalSysID; - ///ҵԪ - TThostFtdcBusinessUnitType BusinessUnit; + +///ѯ̺Լ +struct CThostFtdcQryMMInstrumentCommissionRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ǰѵϸ +struct CThostFtdcInstrumentOrderCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcRatioType OrderCommByVolume; + /// + TThostFtdcRatioType OrderActionCommByVolume; +}; + +///ʲѯ +struct CThostFtdcQryInstrumentOrderCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; }; ///г @@ -5180,8 +4514,6 @@ struct CThostFtdcMarketDataUpdateTimeField TThostFtdcMillisecType UpdateMillisec; ///ҵ TThostFtdcDateType ActionDay; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///齻 @@ -5300,8 +4632,6 @@ struct CThostFtdcQryInvestorPositionDetailField TThostFtdcInvestorIDType InvestorID; ///Լ TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///Ͷֲ߳ϸ @@ -5415,8 +4745,6 @@ struct CThostFtdcMDTraderOfferField TThostFtdcTradeIDType MaxTradeID; ///ϯλ󱨵 TThostFtdcReturnCodeType MaxOrderMessageReference; - ///ҵ - TThostFtdcBizTypeType BizType; }; ///ѯ鱨̻ @@ -5644,8 +4972,6 @@ struct CThostFtdcBrokerUserEventField TThostFtdcInvestorIDType InvestorID; ///Լ TThostFtdcInstrumentIDType InstrumentID; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ѯǩԼ @@ -5778,6 +5104,18 @@ struct CThostFtdcParkedOrderField TThostFtdcErrorMsgType ErrorMsg; ///־ TThostFtdcBoolType IsSwapOrder; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///Ԥ񵥲 @@ -5821,6 +5159,12 @@ struct CThostFtdcParkedOrderActionField TThostFtdcErrorIDType ErrorID; ///Ϣ TThostFtdcErrorMsgType ErrorMsg; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ѯԤ @@ -6043,6 +5387,18 @@ struct CThostFtdcErrOrderField TThostFtdcBoolType IsSwapOrder; /// TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ѯ󱨵 @@ -6168,6 +5524,16 @@ struct CThostFtdcErrorConditionalOrderField TThostFtdcBoolType IsSwapOrder; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; }; ///ѯ󱨵 @@ -6234,6 +5600,12 @@ struct CThostFtdcErrOrderActionField TThostFtdcInstrumentIDType InstrumentID; ///Ӫҵ TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; /// TThostFtdcErrorIDType ErrorID; ///Ϣ @@ -6277,8 +5649,6 @@ struct CThostFtdcQueryMaxOrderVolumeWithPriceField TThostFtdcVolumeType MaxVolume; ///۸ TThostFtdcPriceType Price; - /// - TThostFtdcExchangeIDType ExchangeID; }; ///ѯ͹˾ײ @@ -6635,6 +6005,70 @@ struct CThostFtdcCFMMCTradingAccountTokenField TThostFtdcCFMMCTokenType Token; }; +///ѯƷ +struct CThostFtdcQryProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ͶƷ/Ʒֱ֤Ʒ +struct CThostFtdcProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductGroupID; +}; + +/// +struct CThostFtdcBulletinField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcBulletinIDType BulletinID; + ///к + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcNewsTypeType NewsType; + ///̶ + TThostFtdcNewsUrgencyType NewsUrgency; + ///ʱ + TThostFtdcTimeType SendTime; + ///ϢժҪ + TThostFtdcAbstractType Abstract; + ///ϢԴ + TThostFtdcComeFromType ComeFrom; + ///Ϣ + TThostFtdcContentType Content; + ///WEBַ + TThostFtdcURLLinkType URLLink; + ///г + TThostFtdcMarketIDType MarketID; +}; + +///ѯ +struct CThostFtdcQryBulletinField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcBulletinIDType BulletinID; + ///к + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcNewsTypeType NewsType; + ///̶ + TThostFtdcNewsUrgencyType NewsUrgency; +}; + ///תʿ struct CThostFtdcReqOpenAccountField { @@ -6726,6 +6160,8 @@ struct CThostFtdcReqOpenAccountField TThostFtdcTIDType TID; ///ûʶ TThostFtdcUserIDType UserID; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///ת @@ -6819,6 +6255,8 @@ struct CThostFtdcReqCancelAccountField TThostFtdcTIDType TID; ///ûʶ TThostFtdcUserIDType UserID; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///˻ @@ -6904,6 +6342,8 @@ struct CThostFtdcReqChangeAccountField TThostFtdcTIDType TID; ///ժҪ TThostFtdcDigestType Digest; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///ת @@ -6995,6 +6435,8 @@ struct CThostFtdcReqTransferField TThostFtdcTIDType TID; ///ת˽״̬ TThostFtdcTransferStatusType TransferStatus; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///зʽתڻӦ @@ -7090,6 +6532,8 @@ struct CThostFtdcRspTransferField TThostFtdcErrorIDType ErrorID; ///Ϣ TThostFtdcErrorMsgType ErrorMsg; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; /// @@ -7195,6 +6639,8 @@ struct CThostFtdcReqRepealField TThostFtdcTIDType TID; ///ת˽״̬ TThostFtdcTransferStatusType TransferStatus; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///Ӧ @@ -7304,6 +6750,8 @@ struct CThostFtdcRspRepealField TThostFtdcErrorIDType ErrorID; ///Ϣ TThostFtdcErrorMsgType ErrorMsg; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///ѯ˻Ϣ @@ -7381,6 +6829,8 @@ struct CThostFtdcReqQueryAccountField TThostFtdcRequestIDType RequestID; ///ID TThostFtdcTIDType TID; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///ѯ˻ϢӦ @@ -7462,6 +6912,8 @@ struct CThostFtdcRspQueryAccountField TThostFtdcTradeAmountType BankUseAmount; ///пȡ TThostFtdcTradeAmountType BankFetchAmount; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///ǩǩ @@ -7719,6 +7171,8 @@ struct CThostFtdcReqQueryTradeResultBySerialField TThostFtdcTradeAmountType TradeAmount; ///ժҪ TThostFtdcDigestType Digest; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///ѯָˮŵĽ׽Ӧ @@ -7874,6 +7328,8 @@ struct CThostFtdcVerifyCustInfoField TThostFtdcIdentifiedCardNoType IdentifiedCardNo; ///ͻ TThostFtdcCustTypeType CustType; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///֤ڻʽͿͻϢ @@ -7893,6 +7349,8 @@ struct CThostFtdcVerifyFuturePasswordAndCustInfoField TThostFtdcPasswordType Password; ///ִ TThostFtdcCurrencyIDType CurrencyID; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///֤ڻʽͿͻϢ @@ -8091,6 +7549,8 @@ struct CThostFtdcNotifyQueryAccountField TThostFtdcErrorIDType ErrorID; ///Ϣ TThostFtdcErrorMsgType ErrorMsg; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///ת˽ˮ @@ -8374,6 +7834,8 @@ struct CThostFtdcAccountregisterField TThostFtdcCustTypeType CustType; ///ʺ TThostFtdcBankAccTypeType BankAccType; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///ڿϢ @@ -8471,6 +7933,8 @@ struct CThostFtdcOpenAccountField TThostFtdcErrorIDType ErrorID; ///Ϣ TThostFtdcErrorMsgType ErrorMsg; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///Ϣ @@ -8568,6 +8032,8 @@ struct CThostFtdcCancelAccountField TThostFtdcErrorIDType ErrorID; ///Ϣ TThostFtdcErrorMsgType ErrorMsg; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///ڱ˺Ϣ @@ -8657,6 +8123,8 @@ struct CThostFtdcChangeAccountField TThostFtdcErrorIDType ErrorID; ///Ϣ TThostFtdcErrorMsgType ErrorMsg; + ///ͻ + TThostFtdcLongIndividualNameType LongCustomerName; }; ///ԱȨ @@ -8747,6 +8215,8 @@ struct CThostFtdcLoginForbiddenUserField TThostFtdcBrokerIDType BrokerID; ///û TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; }; ///ѯֹ¼û @@ -8782,33 +8252,170 @@ struct CThostFtdcTradingAccountReserveField TThostFtdcCurrencyIDType CurrencyID; }; -///DBF¼ -struct CThostFtdcDBFRecordField -{ - ///DBF - TThostFtdcDBFComdTypeType DBFComdType; - ///DBFʱ - TThostFtdcDBFComTimeType DBFComTime; - ///DBFԭʼˮ - TThostFtdcDBFComNoType DBFOComNo; - ///DBFˮ - TThostFtdcDBFComNoType DBFComNo; - ///DBFֶ - TThostFtdcDBFFdNameType DBFFdName1; - ///DBFֶ - TThostFtdcDBFFdContentType DBFFdContent1; - ///DBFֶ - TThostFtdcDBFFdNameType DBFFdName2; - ///DBFֶ - TThostFtdcDBFFdContentType DBFFdContent2; - ///DBFֶ - TThostFtdcDBFFdNameType DBFFdName3; - ///DBFֶ - TThostFtdcDBFFdContentType DBFFdContent3; - ///DBFֶ - TThostFtdcDBFFdNameType DBFFdName4; - ///DBFֶ - TThostFtdcDBFFdContentType DBFFdContent4; +///ԤԼȷ +struct CThostFtdcReserveOpenAccountConfirmField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcLongIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ID + TThostFtdcTIDType TID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ԤԼˮ + TThostFtdcBankSerialType BankReserveOpenSeq; + ///ԤԼ + TThostFtdcTradeDateType BookDate; + ///ԤԼ֤ + TThostFtdcPasswordType BookPsw; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ԤԼ +struct CThostFtdcReserveOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcLongIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ID + TThostFtdcTIDType TID; + ///ԤԼ״̬ + TThostFtdcReserveOpenAccStasType ReserveOpenAccStas; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; }; diff --git a/include/CTP/error.xml b/include/CTP/error.xml index 4a798a1..5902604 100644 --- a/include/CTP/error.xml +++ b/include/CTP/error.xml @@ -63,7 +63,7 @@ - + @@ -96,24 +96,14 @@ - - - - - - - - - - + - - - - + + + @@ -155,7 +145,8 @@ - + + @@ -170,7 +161,10 @@ + + + diff --git a/include/CTP/linux32/libthostmduserapi.so b/include/CTP/linux32/libthostmduserapi.so deleted file mode 100644 index 1b6e4cf..0000000 Binary files a/include/CTP/linux32/libthostmduserapi.so and /dev/null differ diff --git a/include/CTP/linux32/libthosttraderapi.so b/include/CTP/linux32/libthosttraderapi.so deleted file mode 100644 index 87c231e..0000000 Binary files a/include/CTP/linux32/libthosttraderapi.so and /dev/null differ diff --git a/include/CTP/linux64/libthostmduserapi.so b/include/CTP/linux64/libthostmduserapi.so index bae6a82..d09d25d 100644 Binary files a/include/CTP/linux64/libthostmduserapi.so and b/include/CTP/linux64/libthostmduserapi.so differ diff --git a/include/CTP/linux64/libthosttraderapi.so b/include/CTP/linux64/libthosttraderapi.so index 4fc941a..37001c8 100644 Binary files a/include/CTP/linux64/libthosttraderapi.so and b/include/CTP/linux64/libthosttraderapi.so differ diff --git a/include/CTP/version.txt b/include/CTP/version.txt index f7e01f2..ad2b2f5 100644 --- a/include/CTP/version.txt +++ b/include/CTP/version.txt @@ -1,3 +1,4 @@ 20141217 64位windows 20141230 其它版本 -20150324 个股期权版 \ No newline at end of file +20150324 个股期权版 +20160606 修正CTP断线重连崩溃的Bug \ No newline at end of file diff --git a/include/CTP/win32/thostmduserapi.dll b/include/CTP/win32/thostmduserapi.dll index c5186ef..89b7cec 100644 Binary files a/include/CTP/win32/thostmduserapi.dll and b/include/CTP/win32/thostmduserapi.dll differ diff --git a/include/CTP/win32/thostmduserapi.lib b/include/CTP/win32/thostmduserapi.lib index b14c3e9..a538487 100644 Binary files a/include/CTP/win32/thostmduserapi.lib and b/include/CTP/win32/thostmduserapi.lib differ diff --git a/include/CTP/win32/thosttraderapi.dll b/include/CTP/win32/thosttraderapi.dll index 79999aa..9e38618 100644 Binary files a/include/CTP/win32/thosttraderapi.dll and b/include/CTP/win32/thosttraderapi.dll differ diff --git a/include/CTP/win32/thosttraderapi.lib b/include/CTP/win32/thosttraderapi.lib index fbb60a7..11137c2 100644 Binary files a/include/CTP/win32/thosttraderapi.lib and b/include/CTP/win32/thosttraderapi.lib differ diff --git a/include/CTP/win64/thostmduserapi.dll b/include/CTP/win64/thostmduserapi.dll new file mode 100644 index 0000000..05ac512 Binary files /dev/null and b/include/CTP/win64/thostmduserapi.dll differ diff --git a/include/CTP/win64/thostmduserapi.lib b/include/CTP/win64/thostmduserapi.lib new file mode 100644 index 0000000..8066490 Binary files /dev/null and b/include/CTP/win64/thostmduserapi.lib differ diff --git a/include/CTP/win64/thosttraderapi.dll b/include/CTP/win64/thosttraderapi.dll new file mode 100644 index 0000000..cccd7ed Binary files /dev/null and b/include/CTP/win64/thosttraderapi.dll differ diff --git a/include/CTP/win64/thosttraderapi.lib b/include/CTP/win64/thosttraderapi.lib new file mode 100644 index 0000000..13ed74f Binary files /dev/null and b/include/CTP/win64/thosttraderapi.lib differ diff --git a/include/CTP_INTER/ThostFtdcMdApi.h b/include/CTP_INTER/ThostFtdcMdApi.h new file mode 100644 index 0000000..d3abce2 --- /dev/null +++ b/include/CTP_INTER/ThostFtdcMdApi.h @@ -0,0 +1,141 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcMdApi.h +///@brief ˿ͻ˽ӿ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCMDAPI_H) +#define THOST_FTDCMDAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) +#ifdef LIB_MD_API_EXPORT +#define MD_API_EXPORT __declspec(dllexport) +#else +#define MD_API_EXPORT __declspec(dllimport) +#endif +#else +#define MD_API_EXPORT +#endif + +class CThostFtdcMdSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + + ///¼Ӧ + virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡӦ + virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData) {}; +}; + +class MD_API_EXPORT CThostFtdcMdApi +{ +public: + ///MdApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + ///modify for udp marketdata + static CThostFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = "", const bool bIsUsingUdp=false, const bool bIsMulticast=false); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עַַ + ///@param pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcMdSpi *pSpi) = 0; + + ///顣 + ///@param pInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeMarketData(CThostFtdcSpecificInstrumentField *pInstrumentID, int nCount) = 0; + ///˶顣 + ///@param pInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeMarketData(CThostFtdcSpecificInstrumentField * pInstrumentID, int nCount) = 0; + + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; +protected: + ~CThostFtdcMdApi(){}; +}; + +#endif diff --git a/include/CTP_INTER/ThostFtdcTraderApi.h b/include/CTP_INTER/ThostFtdcTraderApi.h new file mode 100644 index 0000000..98e2b4e --- /dev/null +++ b/include/CTP_INTER/ThostFtdcTraderApi.h @@ -0,0 +1,336 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcTraderApi.h +///@brief ˿ͻ˽ӿ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCTRADERAPI_H) +#define THOST_FTDCTRADERAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) +#ifdef LIB_TRADER_API_EXPORT +#define TRADER_API_EXPORT __declspec(dllexport) +#else +#define TRADER_API_EXPORT __declspec(dllimport) +#endif +#else +#define TRADER_API_EXPORT +#endif + +class CThostFtdcTraderSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + ///ͻ֤Ӧ + virtual void OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + + ///¼Ӧ + virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ûӦ + virtual void OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽ˻Ӧ + virtual void OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ󱨵Ӧ + virtual void OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ͷ߽ȷӦ + virtual void OnRspInvestorSettlementInfoConfirm(CThostFtdcInvestorSettlementInfoConfirmField *pInvestorSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯɽӦ + virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳Ӧ + virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʽ˻Ӧ + virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶӦ + virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯױӦ + virtual void OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼ֤Ӧ + virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷӦ + virtual void OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶ߽Ӧ + virtual void OnRspQryInvestorSettlementInfo(CThostFtdcInvestorSettlementInfoField *pInvestorSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͻ֪ͨӦ + virtual void OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϢȷӦ + virtual void OnRspQryInvestorSettlementInfoConfirm(CThostFtdcInvestorSettlementInfoConfirmField *pInvestorSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶƷ/Ʒֱ֤Ӧ + virtual void OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯұӦ + virtual void OnRspQryBaseCurrencyAccount(CThostFtdcBaseCurrencyAccountField *pBaseCurrencyAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnOrder(CThostFtdcOrderField *pOrder) {}; + + ///ɽ֪ͨ + virtual void OnRtnTrade(CThostFtdcTradeField *pTrade) {}; + + ///¼ر + virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ر + virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///Լ״̬֪ͨ + virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {}; + + ///֪ͨ + virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) {}; + + ///ʾУ + virtual void OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) {}; + + ///ѯ֪ͨӦ + virtual void OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ͹˾ײӦ + virtual void OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; +}; + +class TRADER_API_EXPORT CThostFtdcTraderApi +{ +public: + ///TraderApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + static CThostFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = ""); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עַַ + ///@param pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcTraderSpi *pSpi) = 0; + + ///˽ + ///@param nResumeType ˽شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼˽ + ///@remark ÷ҪInitǰá򲻻յ˽ݡ + virtual void SubscribePrivateTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///Ĺ + ///@param nResumeType شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼󹫹 + ///@remark ÷ҪInitǰá򲻻յݡ + virtual void SubscribePublicTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///ͻ֤ + virtual int ReqAuthenticate(CThostFtdcReqAuthenticateField *pReqAuthenticateField, int nRequestID) = 0; + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; + + ///û + virtual int ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0; + + ///ʽ˻ + virtual int ReqTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, int nRequestID) = 0; + + ///¼ + virtual int ReqOrderInsert(CThostFtdcInputOrderField *pInputOrder, int nRequestID) = 0; + + /// + virtual int ReqOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0; + + ///ѯ󱨵 + virtual int ReqQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, int nRequestID) = 0; + + ///Ͷ߽ȷ + virtual int ReqInvestorSettlementInfoConfirm(CThostFtdcInvestorSettlementInfoConfirmField *pInvestorSettlementInfoConfirm, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryOrder(CThostFtdcQryOrderField *pQryOrder, int nRequestID) = 0; + + ///ѯɽ + virtual int ReqQryTrade(CThostFtdcQryTradeField *pQryTrade, int nRequestID) = 0; + + ///ѯͶֲ߳ + virtual int ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0; + + ///ѯʽ˻ + virtual int ReqQryTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0; + + ///ѯͶ + virtual int ReqQryInvestor(CThostFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0; + + ///ѯױ + virtual int ReqQryTradingCode(CThostFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0; + + ///ѯԼ֤ + virtual int ReqQryInstrumentMarginRate(CThostFtdcQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrumentCommissionRate(CThostFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchange(CThostFtdcQryExchangeField *pQryExchange, int nRequestID) = 0; + + ///ѯƷ + virtual int ReqQryProduct(CThostFtdcQryProductField *pQryProduct, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrument(CThostFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryDepthMarketData(CThostFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0; + + ///ѯͶ߽ + virtual int ReqQryInvestorSettlementInfo(CThostFtdcQryInvestorSettlementInfoField *pQryInvestorSettlementInfo, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionDetail(CThostFtdcQryInvestorPositionDetailField *pQryInvestorPositionDetail, int nRequestID) = 0; + + ///ѯͻ֪ͨ + virtual int ReqQryNotice(CThostFtdcQryNoticeField *pQryNotice, int nRequestID) = 0; + + ///ѯϢȷ + virtual int ReqQryInvestorSettlementInfoConfirm(CThostFtdcQryInvestorSettlementInfoConfirmField *pQryInvestorSettlementInfoConfirm, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionCombineDetail(CThostFtdcQryInvestorPositionCombineDetailField *pQryInvestorPositionCombineDetail, int nRequestID) = 0; + + ///ѯͶƷ/Ʒֱ֤ + virtual int ReqQryInvestorProductGroupMargin(CThostFtdcQryInvestorProductGroupMarginField *pQryInvestorProductGroupMargin, int nRequestID) = 0; + + ///ѯ֤ + virtual int ReqQryExchangeMarginRate(CThostFtdcQryExchangeMarginRateField *pQryExchangeMarginRate, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchangeRate(CThostFtdcQryExchangeRateField *pQryExchangeRate, int nRequestID) = 0; + + ///ѯұ + virtual int ReqQryBaseCurrencyAccount(CThostFtdcQryBaseCurrencyAccountField *pQryBaseCurrencyAccount, int nRequestID) = 0; + + ///ѯ֪ͨ + virtual int ReqQryTradingNotice(CThostFtdcQryTradingNoticeField *pQryTradingNotice, int nRequestID) = 0; + + ///ѯ͹˾ײ + virtual int ReqQryBrokerTradingParams(CThostFtdcQryBrokerTradingParamsField *pQryBrokerTradingParams, int nRequestID) = 0; +protected: + ~CThostFtdcTraderApi(){}; +}; + +#endif diff --git a/include/CTP_INTER/ThostFtdcUserApiDataType.h b/include/CTP_INTER/ThostFtdcUserApiDataType.h new file mode 100644 index 0000000..8874cae --- /dev/null +++ b/include/CTP_INTER/ThostFtdcUserApiDataType.h @@ -0,0 +1,6807 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcUserApiDataType.h +///@brief ˿ͻ˽ӿʹõҵ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#ifndef THOST_FTDCDATATYPE_H +#define THOST_FTDCDATATYPE_H + +enum THOST_TE_RESUME_TYPE +{ + THOST_TERT_RESTART = 0, + THOST_TERT_RESUME, + THOST_TERT_QUICK +}; + +typedef __int64 LONGLONG; +typedef unsigned __int64 ULONGLONG; +///////////////////////////////////////////////////////////////////////// +///TFtdcRtnFlowID_BaseTypeһ֪ͨID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRtnFlowID_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNo_BaseTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSequenceNo_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessID_BaseTypeһҵID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBusinessID_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataLength_BaseTypeһҵݳ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDataLength_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRtnObjPoint_BaseTypeһָ֪ͨ +///////////////////////////////////////////////////////////////////////// +typedef char *TThostFtdcRtnObjPoint_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInt32Typeһ32λ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcInt32Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInt64Typeһ64λ +///////////////////////////////////////////////////////////////////////// +typedef LONGLONG TThostFtdcInt64Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDbConnStrTypeһݿַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDbConnStrType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDbConnTypeTypeһݿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDbConnTypeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransactionIDTypeһױʾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTransactionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAppNameTypeһӦ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAppNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRunIDTypeһб +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcRunIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAppTypeTypeһӦó +///////////////////////////////////////////////////////////////////////// +///Offer +#define THOST_FTDC_APP_Offer '1' +///Tmdb +#define THOST_FTDC_APP_Tmdb '2' +///Dbmt +#define THOST_FTDC_APP_Dbmt '3' +///MdServer +#define THOST_FTDC_APP_MdServer '4' +///TInit +#define THOST_FTDC_APP_TInit '5' +///֤Ʋѯ +#define THOST_FTDC_APP_CFMMCToken '6' + +typedef char TThostFtdcAppTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSnapShotPointTypeһյ +///////////////////////////////////////////////////////////////////////// +typedef LONGLONG TThostFtdcSnapShotPointType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVarDataTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcVarDataType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTableNameTypeһFBT +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTableNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcObjStreamTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcObjStreamType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLogSNTypeһ־к +///////////////////////////////////////////////////////////////////////// +typedef LONGLONG TThostFtdcLogSNType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRowSequenceTypeһ¼к +///////////////////////////////////////////////////////////////////////// +typedef LONGLONG TThostFtdcRowSequenceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBigSequenceNoTypeһLongк +///////////////////////////////////////////////////////////////////////// +typedef LONGLONG TThostFtdcBigSequenceNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBOperationTypeһ¼ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_DBOP_Unknown '0' +/// +#define THOST_FTDC_DBOP_Insert '1' +/// +#define THOST_FTDC_DBOP_Update '2' +///ɾ +#define THOST_FTDC_DBOP_Delete '3' +///ύ +#define THOST_FTDC_DBOP_Commit '4' + +typedef char TThostFtdcDBOperationType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorID_BaseTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcErrorID_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorMsg_BaseTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcErrorMsg_BaseType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceSeries_BaseTypeһϵк +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcSequenceSeries_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerID_BaseTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerID_BaseType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserID_BaseTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserID_BaseType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParticipantID_BaseTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParticipantID_BaseType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPassword_BaseTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPassword_BaseType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataCenterID_BaseTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDataCenterID_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSmdbSqlText_BaseTypeһsqlı +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSmdbSqlText_BaseType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStatementID_BaseTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcStatementID_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordSetID_BaseTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRecordSetID_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataType_BaseTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDataType_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcColumnName_BaseTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcColumnName_BaseType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamData_BaseTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParamData_BaseType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoreRows_BaseTypeһǷк +///////////////////////////////////////////////////////////////////////// +///к +#define THOST_FTDC_MoreRows_Yes '1' +///ûк +#define THOST_FTDC_MoreRows_No '2' + +typedef char TThostFtdcMoreRows_BaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerAbbrTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerNameTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeInstIDTypeһԼڽĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderRefType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTraderIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDTypeһͶߴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestUnitIDTypeһͶʵԪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestUnitIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerAbbrTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerNameTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeInstIDTypeһԼڽĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderRefType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParticipantIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParticipantIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserIDTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserIDType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPasswordType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductIDTypeһƷִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarketIDTypeһг +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMarketIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubExchangeIDTypeһг +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSubExchangeIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcExchangeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeAbbrTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMacAddressTypeһMacַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMacAddressType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSystemIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangePropertyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EXP_Normal '0' +///ݳɽɱ +#define THOST_FTDC_EXP_GenOrderByTrade '1' + +typedef char TThostFtdcExchangePropertyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLongTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLongTimeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettlementGroupIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSysIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandTypeTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommandTypeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPAddressTypeһIPַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIPAddressType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPPortTypeһIP˿ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcIPPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductInfoTypeһƷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocolInfoTypeһЭϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProtocolInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessUnitTypeһҵԪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessUnitType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepositSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef LONGLONG TThostFtdcDepositSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֯ +#define THOST_FTDC_ICT_EID '0' +///й֤ +#define THOST_FTDC_ICT_IDCard '1' +///֤ +#define THOST_FTDC_ICT_OfficerIDCard '2' +///֤ +#define THOST_FTDC_ICT_PoliceIDCard '3' +///ʿ֤ +#define THOST_FTDC_ICT_SoldierIDCard '4' +///ڲ +#define THOST_FTDC_ICT_HouseholdRegister '5' +/// +#define THOST_FTDC_ICT_Passport '6' +///̨֤ +#define THOST_FTDC_ICT_TaiwanCompatriotIDCard '7' +///֤ +#define THOST_FTDC_ICT_HomeComingCard '8' +///Ӫҵִպ +#define THOST_FTDC_ICT_LicenseNo '9' +///˰ǼǺ/˰ID +#define THOST_FTDC_ICT_TaxNo 'A' +///۰ľڵ֤ͨ +#define THOST_FTDC_ICT_HMMainlandTravelPermit 'B' +///̨½֤ͨ +#define THOST_FTDC_ICT_TwMainlandTravelPermit 'C' +/// +#define THOST_FTDC_ICT_DrivingLicense 'D' +///籣ID +#define THOST_FTDC_ICT_SocialID 'F' +///֤ +#define THOST_FTDC_ICT_LocalID 'G' +///ҵǼ֤ +#define THOST_FTDC_ICT_BusinessRegistration 'H' +///۰Ծ֤ +#define THOST_FTDC_ICT_HKMCIDCard 'I' +///֤ +#define THOST_FTDC_ICT_OtherCard 'x' + +typedef char TThostFtdcIdCardTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderLocalIDTypeһر +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderLocalIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserNameTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPartyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPartyNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcErrorIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorMsgTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcErrorMsgType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldNameTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFieldNameType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldContentTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFieldContentType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemNameTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSystemNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContentTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcContentType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IR_All '1' +///Ͷ +#define THOST_FTDC_IR_Group '2' +///һͶ +#define THOST_FTDC_IR_Single '3' + +typedef char TThostFtdcInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepartmentRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_DR_All '1' +///ܹ֯ +#define THOST_FTDC_DR_Group '2' +///һͶ +#define THOST_FTDC_DR_Single '3' + +typedef char TThostFtdcDepartmentRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataSyncStatusTypeһͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define THOST_FTDC_DS_Asynchronous '1' +///ͬ +#define THOST_FTDC_DS_Synchronizing '2' +///ͬ +#define THOST_FTDC_DS_Synchronized '3' + +typedef char TThostFtdcDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDataSyncStatusTypeһ͹˾ͬ״̬ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_BDS_Synchronized '1' +///ͬ +#define THOST_FTDC_BDS_Synchronizing '2' + +typedef char TThostFtdcBrokerDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeConnectStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_ECS_NoConnection '1' +///ѾԼѯ +#define THOST_FTDC_ECS_QryInstrumentSent '2' +///ѾȡϢ +#define THOST_FTDC_ECS_GotInformation '9' + +typedef char TThostFtdcExchangeConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderConnectStatusTypeһԱ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_TCS_NotConnected '1' +///Ѿ +#define THOST_FTDC_TCS_Connected '2' +///ѾԼѯ +#define THOST_FTDC_TCS_QryInstrumentSent '3' +///˽ +#define THOST_FTDC_TCS_SubPrivateFlow '4' + +typedef char TThostFtdcTraderConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionCodeTypeһܴ +///////////////////////////////////////////////////////////////////////// +///첽 +#define THOST_FTDC_FC_DataAsync '1' +///ǿûdz +#define THOST_FTDC_FC_ForceUserLogout '2' +///û +#define THOST_FTDC_FC_UserPasswordUpdate '3' +///͹˾ +#define THOST_FTDC_FC_BrokerPasswordUpdate '4' +///Ͷ߿ +#define THOST_FTDC_FC_InvestorPasswordUpdate '5' +/// +#define THOST_FTDC_FC_OrderInsert '6' +/// +#define THOST_FTDC_FC_OrderAction '7' +///ͬϵͳ +#define THOST_FTDC_FC_SyncSystemData '8' +///ͬ͹˾ +#define THOST_FTDC_FC_SyncBrokerData '9' +///ͬ͹˾ +#define THOST_FTDC_FC_BachSyncBrokerData 'A' +///ѯ +#define THOST_FTDC_FC_SuperQuery 'B' +///Ԥ񱨵 +#define THOST_FTDC_FC_PrePayOrderInsert 'C' +///Ԥ񱨵 +#define THOST_FTDC_FC_PrePayOrderAction 'D' +///̬ͬ +#define THOST_FTDC_FC_SyncOTP 'E' +///ɾδ֪ +#define THOST_FTDC_FC_DeleteOrder 'F' + +typedef char TThostFtdcFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerFunctionCodeTypeһ͹˾ܴ +///////////////////////////////////////////////////////////////////////// +///ǿûdz +#define THOST_FTDC_BFC_ForceUserLogout '1' +///û +#define THOST_FTDC_BFC_UserPasswordUpdate '2' +///ͬ͹˾ +#define THOST_FTDC_BFC_SyncBrokerData '3' +///ͬ͹˾ +#define THOST_FTDC_BFC_BachSyncBrokerData '4' +/// +#define THOST_FTDC_BFC_OrderInsert '5' +/// +#define THOST_FTDC_BFC_OrderAction '6' +///ȫѯ +#define THOST_FTDC_BFC_AllQuery '7' +///ϵͳܣ/dz/޸ +#define THOST_FTDC_BFC_log 'a' +///ѯѯݣԼȳ +#define THOST_FTDC_BFC_BaseQry 'b' +///ײѯɽί +#define THOST_FTDC_BFC_TradeQry 'c' +///׹ܣ +#define THOST_FTDC_BFC_Trade 'd' +///ת +#define THOST_FTDC_BFC_Virement 'e' +///ռ +#define THOST_FTDC_BFC_Risk 'f' +///ѯ/ѯỰ˵ +#define THOST_FTDC_BFC_Session 'g' +///֪ͨ +#define THOST_FTDC_BFC_RiskNoticeCtl 'h' +///֪ͨ +#define THOST_FTDC_BFC_RiskNotice 'i' +///쿴͹˾ʽȨ +#define THOST_FTDC_BFC_BrokerDeposit 'j' +///ʽѯ +#define THOST_FTDC_BFC_QueryFund 'k' +///ѯ +#define THOST_FTDC_BFC_QueryOrder 'l' +///ɽѯ +#define THOST_FTDC_BFC_QueryTrade 'm' +///ֲֲѯ +#define THOST_FTDC_BFC_QueryPosition 'n' +///ѯ +#define THOST_FTDC_BFC_QueryMarketData 'o' +///û¼ѯ +#define THOST_FTDC_BFC_QueryUserEvent 'p' +///֪ͨѯ +#define THOST_FTDC_BFC_QueryRiskNotify 'q' +///ѯ +#define THOST_FTDC_BFC_QueryFundChange 'r' +///ͶϢѯ +#define THOST_FTDC_BFC_QueryInvestor 's' +///ױѯ +#define THOST_FTDC_BFC_QueryTradingCode 't' +///ǿƽ +#define THOST_FTDC_BFC_ForceClose 'u' +///ѹ +#define THOST_FTDC_BFC_PressTest 'v' +///Ȩ淴 +#define THOST_FTDC_BFC_RemainCalc 'w' +///ֱֲָ֤ +#define THOST_FTDC_BFC_NetPositionInd 'x' +///Ԥ +#define THOST_FTDC_BFC_RiskPredict 'y' +///ݵ +#define THOST_FTDC_BFC_DataExport 'z' +///ָ +#define THOST_FTDC_BFC_RiskTargetSetup 'A' +///Ԥ +#define THOST_FTDC_BFC_MarketDataWarn 'B' +///ҵ֪ͨѯ +#define THOST_FTDC_BFC_QryBizNotice 'C' +///ҵ֪ͨģ +#define THOST_FTDC_BFC_CfgBizNotice 'D' +///̬ͬ +#define THOST_FTDC_BFC_SyncOTP 'E' +///ҵ֪ͨ +#define THOST_FTDC_BFC_SendBizNotice 'F' +///ռ׼ +#define THOST_FTDC_BFC_CfgRiskLevelStd 'G' +///նӦ +#define THOST_FTDC_BFC_TbCommand 'H' +///ɾδ֪ +#define THOST_FTDC_BFC_DeleteOrder 'J' +///Ԥ񱨵 +#define THOST_FTDC_BFC_PrePayOrderInsert 'K' +///Ԥ񱨵 +#define THOST_FTDC_BFC_PrePayOrderAction 'L' + +typedef char TThostFtdcBrokerFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_OAS_Submitted 'a' +///Ѿ +#define THOST_FTDC_OAS_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_OAS_Rejected 'c' + +typedef char TThostFtdcOrderActionStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ȫɽ +#define THOST_FTDC_OST_AllTraded '0' +///ֳɽڶ +#define THOST_FTDC_OST_PartTradedQueueing '1' +///ֳɽڶ +#define THOST_FTDC_OST_PartTradedNotQueueing '2' +///δɽڶ +#define THOST_FTDC_OST_NoTradeQueueing '3' +///δɽڶ +#define THOST_FTDC_OST_NoTradeNotQueueing '4' +/// +#define THOST_FTDC_OST_Canceled '5' +///δ֪ +#define THOST_FTDC_OST_Unknown 'a' +///δ +#define THOST_FTDC_OST_NotTouched 'b' +///Ѵ +#define THOST_FTDC_OST_Touched 'c' + +typedef char TThostFtdcOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSubmitStatusTypeһύ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_OSS_InsertSubmitted '0' +///Ѿύ +#define THOST_FTDC_OSS_CancelSubmitted '1' +///޸Ѿύ +#define THOST_FTDC_OSS_ModifySubmitted '2' +///Ѿ +#define THOST_FTDC_OSS_Accepted '3' +///Ѿܾ +#define THOST_FTDC_OSS_InsertRejected '4' +///Ѿܾ +#define THOST_FTDC_OSS_CancelRejected '5' +///ĵѾܾ +#define THOST_FTDC_OSS_ModifyRejected '6' + +typedef char TThostFtdcOrderSubmitStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ճֲ +#define THOST_FTDC_PSD_Today '1' +///ʷֲ +#define THOST_FTDC_PSD_History '2' + +typedef char TThostFtdcPositionDateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateModeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ʹʷֲ +#define THOST_FTDC_PDM_UseHistory '1' +///ʹʷֲ +#define THOST_FTDC_PDM_NoUseHistory '2' + +typedef char TThostFtdcPositionDateModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRoleTypeһ׽ɫ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ER_Broker '1' +///Ӫ +#define THOST_FTDC_ER_Host '2' +/// +#define THOST_FTDC_ER_Maker '3' + +typedef char TThostFtdcTradingRoleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_PC_Futures '1' +///ڻȨ +#define THOST_FTDC_PC_Options '2' +/// +#define THOST_FTDC_PC_Combination '3' +/// +#define THOST_FTDC_PC_Spot '4' +///ת +#define THOST_FTDC_PC_EFP '5' +///ֻȨ +#define THOST_FTDC_PC_SpotOption '6' + +typedef char TThostFtdcProductClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +///Ʒڻ +#define THOST_FTDC_RPC_Futures '1' +///ڻȨ +#define THOST_FTDC_RPC_Options '2' +///ֻȨ +#define THOST_FTDC_RPC_SpotOption '6' +///ڻ +#define THOST_FTDC_RPC_FinancialFutures '7' + +typedef char TThostFtdcReportProductClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_IP_NotStart '0' +/// +#define THOST_FTDC_IP_Started '1' +///ͣ +#define THOST_FTDC_IP_Pause '2' +/// +#define THOST_FTDC_IP_Expired '3' + +typedef char TThostFtdcInstLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_D_Buy '0' +/// +#define THOST_FTDC_D_Sell '1' + +typedef char TThostFtdcDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombDirectionTypeһָ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CMDR_Comb '0' +/// +#define THOST_FTDC_CMDR_UnComb '1' + +typedef char TThostFtdcCombDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionModeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ֲ +#define THOST_FTDC_PM_Net '1' +///ۺϳֲ +#define THOST_FTDC_PM_Gross '2' + +typedef char TThostFtdcPositionModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosiDirectionTypeһֲֶշ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PD_Net '1' +///ͷ +#define THOST_FTDC_PD_Long '2' +///ͷ +#define THOST_FTDC_PD_Short '3' + +typedef char TThostFtdcPosiDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysSettlementStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_SS_NonActive '1' +/// +#define THOST_FTDC_SS_Startup '2' +/// +#define THOST_FTDC_SS_Operating '3' +/// +#define THOST_FTDC_SS_Settlement '4' +/// +#define THOST_FTDC_SS_SettlementFinished '5' + +typedef char TThostFtdcSysSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioAttrTypeһ +///////////////////////////////////////////////////////////////////////// +///׷ +#define THOST_FTDC_RA_Trade '0' +/// +#define THOST_FTDC_RA_Settlement '1' + +typedef char TThostFtdcRatioAttrType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_HF_Speculation '1' +/// +#define THOST_FTDC_HF_Arbitrage '2' +///ױ +#define THOST_FTDC_HF_Hedge '3' +/// +#define THOST_FTDC_HF_Maker '5' + +typedef char TThostFtdcHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDModeTypeһױ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_CIDM_Speculation '1' +/// +#define THOST_FTDC_CIDM_Arbitrage '2' +///ױ +#define THOST_FTDC_CIDM_Hedge '3' +/// +#define THOST_FTDC_CIDM_Maker '4' + +typedef char TThostFtdcClientIDModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderPriceTypeTypeһ۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OPT_AnyPrice '1' +///޼ +#define THOST_FTDC_OPT_LimitPrice '2' +///ż +#define THOST_FTDC_OPT_BestPrice '3' +///¼ +#define THOST_FTDC_OPT_LastPrice '4' +///¼۸ϸ1ticks +#define THOST_FTDC_OPT_LastPricePlusOneTicks '5' +///¼۸ϸ2ticks +#define THOST_FTDC_OPT_LastPricePlusTwoTicks '6' +///¼۸ϸ3ticks +#define THOST_FTDC_OPT_LastPricePlusThreeTicks '7' +///һ +#define THOST_FTDC_OPT_AskPrice1 '8' +///һ۸ϸ1ticks +#define THOST_FTDC_OPT_AskPrice1PlusOneTicks '9' +///һ۸ϸ2ticks +#define THOST_FTDC_OPT_AskPrice1PlusTwoTicks 'A' +///һ۸ϸ3ticks +#define THOST_FTDC_OPT_AskPrice1PlusThreeTicks 'B' +///һ +#define THOST_FTDC_OPT_BidPrice1 'C' +///һ۸ϸ1ticks +#define THOST_FTDC_OPT_BidPrice1PlusOneTicks 'D' +///һ۸ϸ2ticks +#define THOST_FTDC_OPT_BidPrice1PlusTwoTicks 'E' +///һ۸ϸ3ticks +#define THOST_FTDC_OPT_BidPrice1PlusThreeTicks 'F' +///嵵 +#define THOST_FTDC_OPT_FiveLevelPrice 'G' + +typedef char TThostFtdcOrderPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OF_Open '0' +///ƽ +#define THOST_FTDC_OF_Close '1' +///ǿƽ +#define THOST_FTDC_OF_ForceClose '2' +///ƽ +#define THOST_FTDC_OF_CloseToday '3' +///ƽ +#define THOST_FTDC_OF_CloseYesterday '4' +///ǿ +#define THOST_FTDC_OF_ForceOff '5' +///ǿƽ +#define THOST_FTDC_OF_LocalForceClose '6' +///Ч +#define THOST_FTDC_OF_Invalid '7' + +typedef char TThostFtdcOffsetFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseReasonTypeһǿƽԭ +///////////////////////////////////////////////////////////////////////// +///ǿƽ +#define THOST_FTDC_FCC_NotForceClose '0' +///ʽ +#define THOST_FTDC_FCC_LackDeposit '1' +///ͻ +#define THOST_FTDC_FCC_ClientOverPositionLimit '2' +///Ա +#define THOST_FTDC_FCC_MemberOverPositionLimit '3' +///ֲַ +#define THOST_FTDC_FCC_NotMultiple '4' +///Υ +#define THOST_FTDC_FCC_Violation '5' +/// +#define THOST_FTDC_FCC_Other '6' +///Ȼٽ +#define THOST_FTDC_FCC_PersonDeliv '7' + +typedef char TThostFtdcForceCloseReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ORDT_Normal '0' +/// +#define THOST_FTDC_ORDT_DeriveFromQuote '1' +/// +#define THOST_FTDC_ORDT_DeriveFromCombination '2' +///ϱ +#define THOST_FTDC_ORDT_Combination '3' +/// +#define THOST_FTDC_ORDT_ConditionalOrder '4' +/// +#define THOST_FTDC_ORDT_Swap '5' + +typedef char TThostFtdcOrderTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeConditionTypeһЧ +///////////////////////////////////////////////////////////////////////// +///ɣ +#define THOST_FTDC_TC_IOC '1' +///Ч +#define THOST_FTDC_TC_GFS '2' +///Ч +#define THOST_FTDC_TC_GFD '3' +///ָǰЧ +#define THOST_FTDC_TC_GTD '4' +///ǰЧ +#define THOST_FTDC_TC_GTC '5' +///ϾЧ +#define THOST_FTDC_TC_GFA '6' + +typedef char TThostFtdcTimeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeConditionTypeһɽ +///////////////////////////////////////////////////////////////////////// +///κ +#define THOST_FTDC_VC_AV '1' +///С +#define THOST_FTDC_VC_MV '2' +///ȫ +#define THOST_FTDC_VC_CV '3' + +typedef char TThostFtdcVolumeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContingentConditionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CC_Immediately '1' +///ֹ +#define THOST_FTDC_CC_Touch '2' +///ֹӮ +#define THOST_FTDC_CC_TouchProfit '3' +///Ԥ +#define THOST_FTDC_CC_PrePayOrder '4' +///¼۴ +#define THOST_FTDC_CC_LastPriceGreaterThanStopPrice '5' +///¼۴ڵ +#define THOST_FTDC_CC_LastPriceGreaterEqualStopPrice '6' +///¼С +#define THOST_FTDC_CC_LastPriceLesserThanStopPrice '7' +///¼Сڵ +#define THOST_FTDC_CC_LastPriceLesserEqualStopPrice '8' +///һ۴ +#define THOST_FTDC_CC_AskPriceGreaterThanStopPrice '9' +///һ۴ڵ +#define THOST_FTDC_CC_AskPriceGreaterEqualStopPrice 'A' +///һС +#define THOST_FTDC_CC_AskPriceLesserThanStopPrice 'B' +///һСڵ +#define THOST_FTDC_CC_AskPriceLesserEqualStopPrice 'C' +///һ۴ +#define THOST_FTDC_CC_BidPriceGreaterThanStopPrice 'D' +///һ۴ڵ +#define THOST_FTDC_CC_BidPriceGreaterEqualStopPrice 'E' +///һС +#define THOST_FTDC_CC_BidPriceLesserThanStopPrice 'F' +///һСڵ +#define THOST_FTDC_CC_BidPriceLesserEqualStopPrice 'H' + +typedef char TThostFtdcContingentConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +///ɾ +#define THOST_FTDC_AF_Delete '0' +///޸ +#define THOST_FTDC_AF_Modify '3' + +typedef char TThostFtdcActionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRightTypeһȨ +///////////////////////////////////////////////////////////////////////// +///Խ +#define THOST_FTDC_TR_Allow '0' +///ֻƽ +#define THOST_FTDC_TR_CloseOnly '1' +///ܽ +#define THOST_FTDC_TR_Forbidden '2' + +typedef char TThostFtdcTradingRightType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///Բ +#define THOST_FTDC_OSRC_Participant '0' +///ԹԱ +#define THOST_FTDC_OSRC_Administrator '1' + +typedef char TThostFtdcOrderSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTypeTypeһɽ +///////////////////////////////////////////////////////////////////////// +///ϳֲֲΪһֲ,ʼӦ͵ijֲ +#define THOST_FTDC_TRDT_SplitCombination '#' +///ͨɽ +#define THOST_FTDC_TRDT_Common '0' +///Ȩִ +#define THOST_FTDC_TRDT_OptionsExecution '1' +///OTCɽ +#define THOST_FTDC_TRDT_OTC '2' +///תɽ +#define THOST_FTDC_TRDT_EFPDerived '3' +///ɽ +#define THOST_FTDC_TRDT_CombinationDerived '4' + +typedef char TThostFtdcTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///ǰɽ +#define THOST_FTDC_PSRC_LastPrice '0' +///ίм +#define THOST_FTDC_PSRC_Buy '1' +///ίм +#define THOST_FTDC_PSRC_Sell '2' + +typedef char TThostFtdcPriceSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentStatusTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define THOST_FTDC_IS_BeforeTrading '0' +///ǽ +#define THOST_FTDC_IS_NoTrading '1' +/// +#define THOST_FTDC_IS_Continous '2' +///Ͼ۱ +#define THOST_FTDC_IS_AuctionOrdering '3' +///Ͼۼ۸ƽ +#define THOST_FTDC_IS_AuctionBalance '4' +///Ͼ۴ +#define THOST_FTDC_IS_AuctionMatch '5' +/// +#define THOST_FTDC_IS_Closed '6' + +typedef char TThostFtdcInstrumentStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstStatusEnterReasonTypeһƷֽ뽻״̬ԭ +///////////////////////////////////////////////////////////////////////// +///Զл +#define THOST_FTDC_IER_Automatic '1' +///ֶл +#define THOST_FTDC_IER_Manual '2' +///۶ +#define THOST_FTDC_IER_Fuse '3' + +typedef char TThostFtdcInstStatusEnterReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcOrderActionRefType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallCountTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcInstallCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallIDTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcInstallIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSettlementIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFrontIDTypeһǰñ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFrontIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSessionIDTypeһỰ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSessionIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubjectIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcSubjectIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSequenceNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandNoTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCommandNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMillisecTypeһʱ䣨룩 +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMillisecType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeDifferTypeһʱ룩 +///////////////////////////////////////////////////////////////////////// +typedef LONGLONG TThostFtdcTimeDifferType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeMultipleTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcVolumeMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingSegmentSNTypeһ׽׶α +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradingSegmentSNType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRequestIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYearTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcYearType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMonthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBoolTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBoolType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceTickTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcPriceTickType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombOffsetFlagTypeһϿƽ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombOffsetFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombHedgeFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcRatioType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLargeVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcLargeVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceSeriesTypeһϵк +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcSequenceSeriesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommPhaseNoTypeһͨѶʱα +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcCommPhaseNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceLabelTypeһб +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSequenceLabelType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUnderlyingMultipleTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcUnderlyingMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContractCodeTypeһͬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcContractCodeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCityTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCityType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsStockTypeһǷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIsStockType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcChannelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcChannelType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddressTypeһͨѶַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAddressType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcZipCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcZipCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTelephoneTypeһϵ绰 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTelephoneType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFaxTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFaxType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobileTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMobileType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEMailTypeһʼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEMailType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMemoTypeһע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMemoType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyCodeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCompanyCodeType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWebsiteTypeһվַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWebsiteType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTaxNoTypeһ˰ǼǺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTaxNoType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBatchStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δϴ +#define THOST_FTDC_BS_NoUpload '1' +///ϴ +#define THOST_FTDC_BS_Uploaded '2' +///ʧ +#define THOST_FTDC_BS_Failed '3' + +typedef char TThostFtdcBatchStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyIDTypeһԴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNoTypeһӪҵִպ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLicenseNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentIDTypeһ˴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentGroupIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStyleTypeһƷַʽ +///////////////////////////////////////////////////////////////////////// +///Ʒ +#define THOST_FTDC_RS_All '1' +///Ʒ +#define THOST_FTDC_RS_ByProduct '2' + +typedef char TThostFtdcReturnStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnPatternTypeһģʽ +///////////////////////////////////////////////////////////////////////// +///ɽ +#define THOST_FTDC_RP_ByVolume '1' +/// +#define THOST_FTDC_RP_ByFeeOnHand '2' + +typedef char TThostFtdcReturnPatternType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///1 +#define THOST_FTDC_RL_Level1 '1' +///2 +#define THOST_FTDC_RL_Level2 '2' +///3 +#define THOST_FTDC_RL_Level3 '3' +///4 +#define THOST_FTDC_RL_Level4 '4' +///5 +#define THOST_FTDC_RL_Level5 '5' +///6 +#define THOST_FTDC_RL_Level6 '6' +///7 +#define THOST_FTDC_RL_Level7 '7' +///8 +#define THOST_FTDC_RL_Level8 '8' +///9 +#define THOST_FTDC_RL_Level9 '9' + +typedef char TThostFtdcReturnLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStandardTypeһ׼ +///////////////////////////////////////////////////////////////////////// +///ֽ׶η +#define THOST_FTDC_RSD_ByPeriod '1' +///ijһ׼ +#define THOST_FTDC_RSD_ByStandard '2' + +typedef char TThostFtdcReturnStandardType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMortgageTypeTypeһѺ +///////////////////////////////////////////////////////////////////////// +///ʳ +#define THOST_FTDC_MT_Out '0' +/// +#define THOST_FTDC_MT_In '1' + +typedef char TThostFtdcMortgageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorSettlementParamIDTypeһͶ߽ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_ISPI_MortgageRatio '4' +///֤㷨 +#define THOST_FTDC_ISPI_MarginWay '5' +///㵥ǷѺ +#define THOST_FTDC_ISPI_BillDeposit '9' + +typedef char TThostFtdcInvestorSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeSettlementParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_ESPI_MortgageRatio '1' +///ʽ +#define THOST_FTDC_ESPI_OtherFundItem '2' +///ʽ뽻 +#define THOST_FTDC_ESPI_OtherFundImport '3' +///нͿý +#define THOST_FTDC_ESPI_CFFEXMinPrepa '6' +///֣㷽ʽ +#define THOST_FTDC_ESPI_CZCESettlementType '7' +///ȡʽ +#define THOST_FTDC_ESPI_ExchDelivFeeMode '9' +///Ͷ߽ȡʽ +#define THOST_FTDC_ESPI_DelivFeeMode '0' +///֣ϳֱֲ֤ȡʽ +#define THOST_FTDC_ESPI_CZCEComMarginType 'A' +///֤ǷŻ +#define THOST_FTDC_ESPI_DceComMarginType 'B' +///ֵȨ֤Żݱ +#define THOST_FTDC_ESPI_OptOutDisCountRate 'a' +///ͱϵ +#define THOST_FTDC_ESPI_OptMiniGuarantee 'b' +///֣Ȩȡʽ +#define THOST_FTDC_ESPI_CZCEOptExerFeeType 'c' + +typedef char TThostFtdcExchangeSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ͶߴС +#define THOST_FTDC_SPI_InvestorIDMinLength '1' +///ͶʺŴС +#define THOST_FTDC_SPI_AccountIDMinLength '2' +///Ͷ߿Ĭϵ¼Ȩ +#define THOST_FTDC_SPI_UserRightLogon '3' +///Ͷ߽׽㵥ɽܷʽ +#define THOST_FTDC_SPI_SettlementBillTrade '4' +///ͳһ½ױ뷽ʽ +#define THOST_FTDC_SPI_TradingCode '5' +///Ƿжϴδ˵ijͷʽ +#define THOST_FTDC_SPI_CheckFund '6' +///ǷģȨ +#define THOST_FTDC_SPI_CommModelRight '7' +///Ƿñ֤ģȨ +#define THOST_FTDC_SPI_MarginModelRight '9' +///Ƿ淶ûܼ +#define THOST_FTDC_SPI_IsStandardActive '8' +///ϴĽļ· +#define THOST_FTDC_SPI_UploadSettlementFile 'U' +///ϱ֤ļ· +#define THOST_FTDC_SPI_DownloadCSRCFile 'D' +///ɵĽ㵥ļ· +#define THOST_FTDC_SPI_SettlementBillFile 'S' +///֤ļʶ +#define THOST_FTDC_SPI_CSRCOthersFile 'C' +///ͶƬ· +#define THOST_FTDC_SPI_InvestorPhoto 'P' +///ȫᾭ͹˾ϴļ· +#define THOST_FTDC_SPI_CSRCData 'R' +///¼뷽ʽ +#define THOST_FTDC_SPI_InvestorPwdModel 'I' +///Ͷнļ· +#define THOST_FTDC_SPI_CFFEXInvestorSettleFile 'F' +///Ͷߴ뷽ʽ +#define THOST_FTDC_SPI_InvestorIDType 'a' +///߻Ȩ +#define THOST_FTDC_SPI_FreezeMaxReMain 'r' +///زʵʱϳ +#define THOST_FTDC_SPI_IsSync 'A' +///Ȩ +#define THOST_FTDC_SPI_RelieveOpenLimit 'O' +///Ƿ淶û +#define THOST_FTDC_SPI_IsStandardFreeze 'X' +///֣Ƿ񿪷Ʒױ +#define THOST_FTDC_SPI_CZCENormalProductHedge 'B' + +typedef char TThostFtdcSystemParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ϵͳ㷨 +#define THOST_FTDC_TPID_EncryptionStandard 'E' +///ϵͳ㷨 +#define THOST_FTDC_TPID_RiskMode 'R' +///ϵͳ㷨Ƿȫ 0- 1- +#define THOST_FTDC_TPID_RiskModeGlobal 'G' +///㷨 +#define THOST_FTDC_TPID_modeEncode 'P' +///۸Сλ +#define THOST_FTDC_TPID_tickMode 'T' +///ûỰ +#define THOST_FTDC_TPID_SingleUserSessionMaxNum 'S' +///¼ʧ +#define THOST_FTDC_TPID_LoginFailMaxNum 'L' +///Ƿǿ֤ +#define THOST_FTDC_TPID_IsAuthForce 'A' + +typedef char TThostFtdcTradeParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettlementParamValueType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCounterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCounterIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorGroupNameTypeһͶ߷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrandCodeTypeһƺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrandCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWarehouseTypeһֿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWarehouseType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductDateType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGradeTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcGradeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClassifyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClassifyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPositionType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYieldlyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcYieldlyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWeightTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWeightType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubEntryFundNoTypeһʽˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSubEntryFundNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileIDTypeһļʶ +///////////////////////////////////////////////////////////////////////// +///ʽ +#define THOST_FTDC_FI_SettlementFund 'F' +///ɽ +#define THOST_FTDC_FI_Trade 'T' +///Ͷֲ߳ +#define THOST_FTDC_FI_InvestorPosition 'P' +///Ͷ߷ʽ +#define THOST_FTDC_FI_SubEntryFund 'O' +///ϳֲ +#define THOST_FTDC_FI_CZCECombinationPos 'C' +///ϱ֤ +#define THOST_FTDC_FI_CSRCData 'R' +///֣ƽ˽ +#define THOST_FTDC_FI_CZCEClose 'L' +///֣ƽ˽ +#define THOST_FTDC_FI_CZCENoClose 'N' +///ֲϸ +#define THOST_FTDC_FI_PositionDtl 'D' +///Ȩִļ +#define THOST_FTDC_FI_OptionStrike 'S' +///۱ȶļ +#define THOST_FTDC_FI_SettlementPriceComparison 'M' +///dzֱֲ䶯ϸ +#define THOST_FTDC_FI_NonTradePosChange 'B' + +typedef char TThostFtdcFileIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileTypeTypeһļϴ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FUT_Settlement '0' +///˶ +#define THOST_FTDC_FUT_Check '1' + +typedef char TThostFtdcFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileFormatTypeһļʽ +///////////////////////////////////////////////////////////////////////// +///ıļ(.txt) +#define THOST_FTDC_FFT_Txt '0' +///ѹļ(.zip) +#define THOST_FTDC_FFT_Zip '1' +///DBFļ(.dbf) +#define THOST_FTDC_FFT_DBF '2' + +typedef char TThostFtdcFileFormatType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileUploadStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///ϴɹ +#define THOST_FTDC_FUS_SucceedUpload '1' +///ϴʧ +#define THOST_FTDC_FUS_FailedUpload '2' +///ɹ +#define THOST_FTDC_FUS_SucceedLoad '3' +///벿ֳɹ +#define THOST_FTDC_FUS_PartSucceedLoad '4' +///ʧ +#define THOST_FTDC_FUS_FailedLoad '5' + +typedef char TThostFtdcFileUploadStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferDirectionTypeһƲַ +///////////////////////////////////////////////////////////////////////// +///Ƴ +#define THOST_FTDC_TD_Out '0' +/// +#define THOST_FTDC_TD_In '1' + +typedef char TThostFtdcTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUploadModeTypeһϴļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUploadModeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountIDTypeһʽ˺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAccountIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountOwnerModeTypeһʽ˺ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_AOM_Investor '1' +/// +#define THOST_FTDC_AOM_SecAgent '2' +///׻Ա +#define THOST_FTDC_AOM_TradeMember '3' + +typedef char TThostFtdcAccountOwnerModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankFlagTypeһͳһʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankFlagType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenNameTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOpenNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenBankTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOpenBankType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishPathTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPublishPathType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperatorIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthCountTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMonthCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAdvanceMonthArrayTypeһ·ǰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAdvanceMonthArrayType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateExprTypeһڱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDateExprType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDExprTypeһԼʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameExprTypeһԼƱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentNameExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSpecialCreateRuleTypeһĴ +///////////////////////////////////////////////////////////////////////// +///ûⴴ +#define THOST_FTDC_SC_NoSpecialRule '0' +/// +#define THOST_FTDC_SC_NoSpringFestival '1' + +typedef char TThostFtdcSpecialCreateRuleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBasisPriceTypeTypeһƻ׼ +///////////////////////////////////////////////////////////////////////// +///һԼ +#define THOST_FTDC_IPT_LastSettlement '1' +///һԼ̼ +#define THOST_FTDC_IPT_LaseClose '2' + +typedef char TThostFtdcBasisPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductLifePhaseTypeһƷ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_PLP_Active '1' +///Ծ +#define THOST_FTDC_PLP_NonActive '2' +///ע +#define THOST_FTDC_PLP_Canceled '3' + +typedef char TThostFtdcProductLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeliveryModeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ֽ𽻸 +#define THOST_FTDC_DM_CashDeliv '1' +///ʵサ +#define THOST_FTDC_DM_CommodityDeliv '2' + +typedef char TThostFtdcDeliveryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLogLevelTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLogLevelType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessNameTypeһ洢 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperationMemoTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperationMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FIOT_FundIO '1' +///ת +#define THOST_FTDC_FIOT_Transfer '2' +///ڻ +#define THOST_FTDC_FIOT_SwapCurrency '3' + +typedef char TThostFtdcFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_FT_Deposite '1' +///ʽ +#define THOST_FTDC_FT_ItemFund '2' +///˾ +#define THOST_FTDC_FT_Company '3' +///ʽת +#define THOST_FTDC_FT_InnerTransfer '4' + +typedef char TThostFtdcFundTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FD_In '1' +/// +#define THOST_FTDC_FD_Out '2' + +typedef char TThostFtdcFundDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundStatusTypeһʽ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_FS_Record '1' +///Ѹ +#define THOST_FTDC_FS_Check '2' +///ѳ +#define THOST_FTDC_FS_Charge '3' + +typedef char TThostFtdcFundStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNoTypeһƱݺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBillNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNameTypeһƱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBillNameType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PS_None '1' +///ڷ +#define THOST_FTDC_PS_Publishing '2' +///ѷ +#define THOST_FTDC_PS_Published '3' + +typedef char TThostFtdcPublishStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueIDTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueTypeTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueLabelTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueLabelType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueResultTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueResultType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_ES_NonActive '1' +/// +#define THOST_FTDC_ES_Startup '2' +///׿ʼʼ +#define THOST_FTDC_ES_Initialize '3' +///ɳʼ +#define THOST_FTDC_ES_Initialized '4' +///пʼ +#define THOST_FTDC_ES_Close '5' +/// +#define THOST_FTDC_ES_Closed '6' +/// +#define THOST_FTDC_ES_Settlement '7' + +typedef char TThostFtdcSystemStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ʼ +#define THOST_FTDC_STS_Initialize '0' +/// +#define THOST_FTDC_STS_Settlementing '1' +///ѽ +#define THOST_FTDC_STS_Settlemented '2' +/// +#define THOST_FTDC_STS_Finished '3' + +typedef char TThostFtdcSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntTypeTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntFromTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntFromType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntToTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntToType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionIDTypeһܴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionValueCodeTypeһܱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionValueCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleIDTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRoleIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleNameTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRoleNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescriptionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDescriptionType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineIDTypeһϱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombineIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombineTypeType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CT_Person '0' +/// +#define THOST_FTDC_CT_Company '1' +///Ͷʻ +#define THOST_FTDC_CT_Fund '2' +///ⷨ +#define THOST_FTDC_CT_SpecialOrgan '3' +///ʹܻ +#define THOST_FTDC_CT_Asset '4' + +typedef char TThostFtdcInvestorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPartTypeTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +///׻Ա +#define THOST_FTDC_PART_Trade '0' +///׽Ա +#define THOST_FTDC_PART_TradeSettle '1' + +typedef char TThostFtdcPartTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskLevelTypeһյȼ +///////////////////////////////////////////////////////////////////////// +///ͷտͻ +#define THOST_FTDC_FAS_Low '1' +///ͨͻ +#define THOST_FTDC_FAS_Normal '2' +///עͻ +#define THOST_FTDC_FAS_Focus '3' +///տͻ +#define THOST_FTDC_FAS_Risk '4' + +typedef char TThostFtdcRiskLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PWDT_Trade '1' +///ʽ +#define THOST_FTDC_PWDT_Account '2' + +typedef char TThostFtdcPasswordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgorithmTypeһӯ㷨 +///////////////////////////////////////////////////////////////////////// +///ӯ +#define THOST_FTDC_AG_All '1' +///ӯƣ +#define THOST_FTDC_AG_OnlyLost '2' +///ӯƣ +#define THOST_FTDC_AG_OnlyGain '3' +///ӯ +#define THOST_FTDC_AG_None '4' + +typedef char TThostFtdcAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIncludeCloseProfitTypeһǷƽӯ +///////////////////////////////////////////////////////////////////////// +///ƽӯ +#define THOST_FTDC_ICP_Include '0' +///ƽӯ +#define THOST_FTDC_ICP_NotInclude '2' + +typedef char TThostFtdcIncludeCloseProfitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAllWithoutTradeTypeһǷܿ +///////////////////////////////////////////////////////////////////////// +///޲޳ɽܿ +#define THOST_FTDC_AWT_Enable '0' +///ܿ +#define THOST_FTDC_AWT_Disable '2' +///޲ֲܿ +#define THOST_FTDC_AWT_NoHoldEnable '3' + +typedef char TThostFtdcAllWithoutTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommentTypeһӯ㷨˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommentType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVersionTypeһ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcVersionType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeSerialType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradeSerialNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureIDTypeһڻ˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDTypeһд +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBrchIDTypeһзĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankBrchIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBranchIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankBranchIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperNoTypeһ׹Ա +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperNoType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeviceIDTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDeviceIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordNumTypeһ¼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRecordNumType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountTypeһڻʽ˺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccountType[22]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturePwdFlagTypeһʽ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_FPWD_UnCheck '0' +///˶ +#define THOST_FTDC_FPWD_Check '1' + +typedef char TThostFtdcFuturePwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferTypeTypeһת +///////////////////////////////////////////////////////////////////////// +///תڻ +#define THOST_FTDC_TT_BankToFuture '0' +///ڻת +#define THOST_FTDC_TT_FutureToBank '1' + +typedef char TThostFtdcTransferTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccPwdTypeһڻʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccPwdType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetCodeTypeһӦ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRetCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetInfoTypeһӦϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRetInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmtTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUseAmtTypeһп +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUseAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFetchAmtTypeһпȡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFetchAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferValidFlagTypeһתЧ־ +///////////////////////////////////////////////////////////////////////// +///Чʧ +#define THOST_FTDC_TVF_Invalid '0' +///Ч +#define THOST_FTDC_TVF_Valid '1' +/// +#define THOST_FTDC_TVF_Reverse '2' + +typedef char TThostFtdcTransferValidFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertCodeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCertCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReasonTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_RN_CD '0' +///ʽ; +#define THOST_FTDC_RN_ZT '1' +/// +#define THOST_FTDC_RN_QT '2' + +typedef char TThostFtdcReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundProjectIDTypeһʽĿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFundProjectIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSexTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_SEX_None '0' +/// +#define THOST_FTDC_SEX_Man '1' +///Ů +#define THOST_FTDC_SEX_Woman '2' + +typedef char TThostFtdcSexType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProfessionTypeһְҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProfessionType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNationalTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNationalType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProvinceTypeһʡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProvinceType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRegionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRegionType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCountryType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNOTypeһӪҵִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLicenseNOType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCompanyTypeType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessScopeTypeһӪΧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessScopeType[1001]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCapitalCurrencyTypeһעʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCapitalCurrencyType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserTypeTypeһû +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_UT_Investor '0' +///Ա +#define THOST_FTDC_UT_Operator '1' +///Ա +#define THOST_FTDC_UT_SuperUser '2' + +typedef char TThostFtdcUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_RATETYPE_MarginRate '2' + +typedef char TThostFtdcRateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNoteTypeTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +///׽㵥 +#define THOST_FTDC_NOTETYPE_TradeSettleBill '1' +///׽± +#define THOST_FTDC_NOTETYPE_TradeSettleMonth '2' +///׷ӱ֤֪ͨ +#define THOST_FTDC_NOTETYPE_CallMarginNotes '3' +///ǿƽ֪ͨ +#define THOST_FTDC_NOTETYPE_ForceCloseNotes '4' +///ɽ֪ͨ +#define THOST_FTDC_NOTETYPE_TradeNotes '5' +///֪ͨ +#define THOST_FTDC_NOTETYPE_DelivNotes '6' + +typedef char TThostFtdcNoteTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStyleTypeһ㵥ʽ +///////////////////////////////////////////////////////////////////////// +///ն +#define THOST_FTDC_SBS_Day '1' +///ʶԳ +#define THOST_FTDC_SBS_Volume '2' + +typedef char TThostFtdcSettlementStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDNSTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerDNSType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSentenceTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSentenceType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementBillTypeTypeһ㵥 +///////////////////////////////////////////////////////////////////////// +///ձ +#define THOST_FTDC_ST_Day '0' +///± +#define THOST_FTDC_ST_Month '1' + +typedef char TThostFtdcSettlementBillTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRightTypeTypeһͻȨ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_URT_Logon '1' +///ת +#define THOST_FTDC_URT_Transfer '2' +///ʼĽ㵥 +#define THOST_FTDC_URT_EMail '3' +///㵥 +#define THOST_FTDC_URT_Fax '4' +/// +#define THOST_FTDC_URT_ConditionOrder '5' + +typedef char TThostFtdcUserRightTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginPriceTypeTypeһ֤۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_MPT_PreSettlementPrice '1' +///¼ +#define THOST_FTDC_MPT_SettlementPrice '2' +///ɽ +#define THOST_FTDC_MPT_AveragePrice '3' +///ּ +#define THOST_FTDC_MPT_OpenPrice '4' + +typedef char TThostFtdcMarginPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillGenStatusTypeһ㵥״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_BGS_None '0' +/// +#define THOST_FTDC_BGS_NoGenerated '1' +/// +#define THOST_FTDC_BGS_Generated '2' + +typedef char TThostFtdcBillGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgoTypeTypeһ㷨 +///////////////////////////////////////////////////////////////////////// +///ֲִ㷨 +#define THOST_FTDC_AT_HandlePositionAlgo '1' +///Ѱұ֤㷨 +#define THOST_FTDC_AT_FindMarginRateAlgo '2' + +typedef char TThostFtdcAlgoTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandlePositionAlgoIDTypeһֲִ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HPA_Base '1' +///Ʒ +#define THOST_FTDC_HPA_DCE '2' +///֣Ʒ +#define THOST_FTDC_HPA_CZCE '3' + +typedef char TThostFtdcHandlePositionAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFindMarginRateAlgoIDTypeһѰұ֤㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FMRA_Base '1' +///Ʒ +#define THOST_FTDC_FMRA_DCE '2' +///֣Ʒ +#define THOST_FTDC_FMRA_CZCE '3' + +typedef char TThostFtdcFindMarginRateAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandleTradingAccountAlgoIDTypeһʽ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HTAA_Base '1' +///Ʒ +#define THOST_FTDC_HTAA_DCE '2' +///֣Ʒ +#define THOST_FTDC_HTAA_CZCE '3' + +typedef char TThostFtdcHandleTradingAccountAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPersonTypeTypeһϵ +///////////////////////////////////////////////////////////////////////// +///ָµ +#define THOST_FTDC_PST_Order '1' +///Ȩ +#define THOST_FTDC_PST_Open '2' +///ʽ +#define THOST_FTDC_PST_Fund '3' +///㵥ȷ +#define THOST_FTDC_PST_Settlement '4' +/// +#define THOST_FTDC_PST_Company '5' +///˴ +#define THOST_FTDC_PST_Corporation '6' +///Ͷϵ +#define THOST_FTDC_PST_LinkMan '7' +///ֻʲ +#define THOST_FTDC_PST_Ledger '8' +///У +#define THOST_FTDC_PST_Trustee '9' +///Уܻ˴ +#define THOST_FTDC_PST_TrusteeCorporation 'A' +///УܻȨ +#define THOST_FTDC_PST_TrusteeOpen 'B' +///Уܻϵ +#define THOST_FTDC_PST_TrusteeContact 'C' +///Ȼ˲ο֤ +#define THOST_FTDC_PST_ForeignerRefer 'D' +///˴ο֤ +#define THOST_FTDC_PST_CorporationRefer 'E' + +typedef char TThostFtdcPersonTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryInvestorRangeTypeһѯΧ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_QIR_All '1' +///ѯ +#define THOST_FTDC_QIR_Group '2' +///һͶ +#define THOST_FTDC_QIR_Single '3' + +typedef char TThostFtdcQueryInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRiskStatusTypeһͶ߷״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IRS_Normal '1' +/// +#define THOST_FTDC_IRS_Warn '2' +///׷ +#define THOST_FTDC_IRS_Call '3' +///ǿƽ +#define THOST_FTDC_IRS_Force '4' +///쳣 +#define THOST_FTDC_IRS_Exception '5' + +typedef char TThostFtdcInvestorRiskStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegIDTypeһȱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLegIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegMultipleTypeһȳ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLegMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImplyLevelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcImplyLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearAccountType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNOTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganNOType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearbarchIDTypeһ˻к +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearbarchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventTypeTypeһû¼ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_UET_Login '1' +///dz +#define THOST_FTDC_UET_Logout '2' +///׳ɹ +#define THOST_FTDC_UET_Trading '3' +///ʧ +#define THOST_FTDC_UET_TradingError '4' +///޸ +#define THOST_FTDC_UET_UpdatePassword '5' +///ͻ֤ +#define THOST_FTDC_UET_Authenticate '6' +/// +#define THOST_FTDC_UET_Other '9' + +typedef char TThostFtdcUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventInfoTypeһû¼Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserEventInfoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseStyleTypeһƽַʽ +///////////////////////////////////////////////////////////////////////// +///ȿƽ +#define THOST_FTDC_ICS_Close '0' +///ƽƽ +#define THOST_FTDC_ICS_CloseToday '1' + +typedef char TThostFtdcCloseStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStatModeTypeһͳƷʽ +///////////////////////////////////////////////////////////////////////// +///---- +#define THOST_FTDC_SM_Non '0' +///Լͳ +#define THOST_FTDC_SM_Instrument '1' +///Ʒͳ +#define THOST_FTDC_SM_Product '2' +///Ͷͳ +#define THOST_FTDC_SM_Investor '3' + +typedef char TThostFtdcStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPrePayOrderStatusTypeһԤ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PPOS_NotSend '1' +///ѷ +#define THOST_FTDC_PPOS_Send '2' +///ɾ +#define THOST_FTDC_PPOS_Deleted '3' + +typedef char TThostFtdcPrePayOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPrePayOrderIDTypeһԤ񱨵 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPrePayOrderIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirDealStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ڴ +#define THOST_FTDC_VDS_Dealing '1' +///ɹ +#define THOST_FTDC_VDS_DeaclSucceed '2' + +typedef char TThostFtdcVirDealStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrgSystemIDTypeһԭϵͳ +///////////////////////////////////////////////////////////////////////// +///ۺϽƽ̨ +#define THOST_FTDC_ORGS_Standard '0' +///ʢϵͳ +#define THOST_FTDC_ORGS_ESunny '1' +///˴V6ϵͳ +#define THOST_FTDC_ORGS_KingStarV6 '2' + +typedef char TThostFtdcOrgSystemIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirTradeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VTS_NaturalDeal '0' +///ɹ +#define THOST_FTDC_VTS_SucceedEnd '1' +///ʧܽ +#define THOST_FTDC_VTS_FailedEND '2' +///쳣 +#define THOST_FTDC_VTS_Exception '3' +///˹쳣 +#define THOST_FTDC_VTS_ManualDeal '4' +///ͨѶ쳣 ˹ +#define THOST_FTDC_VTS_MesException '5' +///ϵͳ˹ +#define THOST_FTDC_VTS_SysException '6' + +typedef char TThostFtdcVirTradeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirBankAccTypeTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VBAT_BankBook '1' +/// +#define THOST_FTDC_VBAT_BankCard '2' +///ÿ +#define THOST_FTDC_VBAT_CreditCard '3' + +typedef char TThostFtdcVirBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementStatusTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VMS_Natural '0' +/// +#define THOST_FTDC_VMS_Canceled '9' + +typedef char TThostFtdcVirementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementAvailAbilityTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define THOST_FTDC_VAA_NoAvailAbility '0' +///Ч +#define THOST_FTDC_VAA_AvailAbility '1' +/// +#define THOST_FTDC_VAA_Repeal '2' + +typedef char TThostFtdcVirementAvailAbilityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +///зʽתڻ +#define THOST_FTDC_VTC_BankBankToFuture '102001' +///зڻʽת +#define THOST_FTDC_VTC_BankFutureToBank '102002' +///ڻʽתڻ +#define THOST_FTDC_VTC_FutureBankToFuture '202001' +///ڻڻʽת +#define THOST_FTDC_VTC_FutureFutureToBank '202002' + +typedef char TThostFtdcVirementTradeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoTypeNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeIDTypeһӰʹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoTypeIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTopicIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTopicIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportTypeIDTypeһױͱʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcReportTypeIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCharacterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCharacterIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInvestorTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLIdCardTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeDirectTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradeDirectType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeModelTypeһʽʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradeModelType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLOpParamValueTypeһҵֵ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcAMLOpParamValueType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCustomerCardTypeTypeһͻ֤/֤ļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCustomerCardTypeType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionNameTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLDistrictIDTypeһڻڵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLDistrictIDType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLRelationShipTypeһڻ׵Ĺϵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLRelationShipType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionIDTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLAccountTypeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradingTypeTypeһ׷ʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradingTypeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTransactClassTypeһ֧׷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTransactClassType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalIOTypeһʽոʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCapitalIOType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSiteTypeһ׵ص +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSiteType[10]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalPurposeTypeһʽ; +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCapitalPurposeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLReportTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSerialNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSerialNoType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLGenStatusTypeһAmlɷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_GEN_Program '0' +///˹ +#define THOST_FTDC_GEN_HandWork '1' + +typedef char TThostFtdcAMLGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSeqCodeTypeһҵʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSeqCodeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileNameTypeһAMLļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLMoneyTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcAMLMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileAmountTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcAMLFileAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCTokenTypeһ(֤) +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCFMMCTokenType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCKeyKindTypeһ̬Կ(֤) +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CFMMCKK_REQUEST 'R' +///CFMMCԶ +#define THOST_FTDC_CFMMCKK_AUTO 'A' +///CFMMCֶ +#define THOST_FTDC_CFMMCKK_MANUAL 'M' + +typedef char TThostFtdcCFMMCKeyKindType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLReportNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndividualNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIndividualNameType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyIDTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustNumberTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCustNumberType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganCodeType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSuperOrganCodeTypeһϼ,ڻ˾ܲ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSuperOrganCodeType[12]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchIDTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchNameTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSubBranchNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchNetCodeType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchNetNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganFlagTypeһʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCodingForFutureTypeһжڻ˾ı +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankCodingForFutureType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankReturnCodeTypeһжԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateReturnCodeTypeһתƽ̨ԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPlateReturnCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSubBranchIDTypeһз֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureBranchIDTypeһڻ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnCodeTypeһش +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorCodeTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperatorCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearDepIDTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearBrchIDTypeһʻк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvDepIDTypeһͶ˺Ż +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvBrchIDTypeһͶк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMessageFormatVersionTypeһϢʽ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMessageFormatVersionType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDigestTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDigestType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthenticDataTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthenticDataType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPasswordKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountNameTypeһڻʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccountNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobilePhoneTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMobilePhoneType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureMainKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureWorkKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTransKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankMainKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankWorkKeyTypeһйԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankTransKeyTypeһдԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankServerDescriptionTypeһзϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankServerDescriptionType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddInfoTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAddInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescrInfoForReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDescrInfoForReturnCodeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCountryCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateSerialTypeһƽ̨ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcPlateSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankSerialType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorrectSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCorrectSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureSerialTypeһڻ˾ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFutureSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplicationIDTypeһӦñʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcApplicationIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankProxyIDTypeһдʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBankProxyIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTCoreIDTypeһתʺϵͳʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBTCoreIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServerPortTypeһ˿ں +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServerPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealedTimesTypeһѾ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRepealedTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealTimeIntervalTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRepealTimeIntervalType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalTimesTypeһÿۼתʴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTotalTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTRequestIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBTRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmountTypeһ׽Ԫ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcTradeAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustFeeTypeһӦտͻãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCustFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureFeeTypeһӦڻ˾ãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcFutureFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMaxAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcSingleMaxAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMinAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcSingleMinAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalAmtTypeһÿۼתʶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcTotalAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertificationTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_CFT_IDCard '0' +/// +#define THOST_FTDC_CFT_Passport '1' +///֤ +#define THOST_FTDC_CFT_OfficerIDCard '2' +///ʿ֤ +#define THOST_FTDC_CFT_SoldierIDCard '3' +///֤ +#define THOST_FTDC_CFT_HomeComingCard '4' +///ڲ +#define THOST_FTDC_CFT_HouseholdRegister '5' +///Ӫҵִպ +#define THOST_FTDC_CFT_LicenseNo '6' +///֤֯ +#define THOST_FTDC_CFT_InstitutionCodeCard '7' +///ʱӪҵִպ +#define THOST_FTDC_CFT_TempLicenseNo '8' +///ҵǼ֤ +#define THOST_FTDC_CFT_NoEnterpriseLicenseNo '9' +///֤ +#define THOST_FTDC_CFT_OtherCard 'x' +///ܲ +#define THOST_FTDC_CFT_SuperDepAgree 'a' + +typedef char TThostFtdcCertificationTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileBusinessCodeTypeһļҵ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBC_Others '0' +///ת˽ϸ +#define THOST_FTDC_FBC_TransferDetails '1' +///ͻ˻״̬ +#define THOST_FTDC_FBC_CustAccStatus '2' +///˻ཻϸ +#define THOST_FTDC_FBC_AccountTradeDetails '3' +///ڻ˻Ϣϸ +#define THOST_FTDC_FBC_FutureAccountChangeInfoDetails '4' +///ͻʽ̨ϸ +#define THOST_FTDC_FBC_CustMoneyDetail '5' +///ͻϢϸ +#define THOST_FTDC_FBC_CustCancelAccountInfo '6' +///ͻʽ˽ +#define THOST_FTDC_FBC_CustMoneyResult '7' +///쳣ļ +#define THOST_FTDC_FBC_OthersExceptionResult '8' +///ͻϢϸ +#define THOST_FTDC_FBC_CustInterestNetMoneyDetails '9' +///ͻʽϸ +#define THOST_FTDC_FBC_CustMoneySendAndReceiveDetails 'a' +///˴ʽջ +#define THOST_FTDC_FBC_CorporationMoneyTotal 'b' +///ʽջ +#define THOST_FTDC_FBC_MainbodyMoneyTotal 'c' +///ܷƽ +#define THOST_FTDC_FBC_MainPartMonitorData 'd' +///б +#define THOST_FTDC_FBC_PreparationMoney 'e' +///Эʽ +#define THOST_FTDC_FBC_BankMoneyMonitorData 'f' + +typedef char TThostFtdcFileBusinessCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCashExchangeCodeTypeһ㳮־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CEC_Exchange '1' +/// +#define THOST_FTDC_CEC_Cash '2' + +typedef char TThostFtdcCashExchangeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYesNoIndicatorTypeһǻʶ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_YNI_Yes '0' +/// +#define THOST_FTDC_YNI_No '1' + +typedef char TThostFtdcYesNoIndicatorType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBanlanceTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define THOST_FTDC_BLT_CurrentMoney '0' +/// +#define THOST_FTDC_BLT_UsableMoney '1' +///ȡ +#define THOST_FTDC_BLT_FetchableMoney '2' +/// +#define THOST_FTDC_BLT_FreezeMoney '3' + +typedef char TThostFtdcBanlanceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGenderTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪״̬ +#define THOST_FTDC_GD_Unknown '0' +/// +#define THOST_FTDC_GD_Male '1' +///Ů +#define THOST_FTDC_GD_Female '2' + +typedef char TThostFtdcGenderType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeePayFlagTypeһ֧־ +///////////////////////////////////////////////////////////////////////// +///淽֧ +#define THOST_FTDC_FPF_BEN '0' +///ɷͷ֧ +#define THOST_FTDC_FPF_OUR '1' +///ɷͷ֧ķã淽֧ܵķ +#define THOST_FTDC_FPF_SHA '2' + +typedef char TThostFtdcFeePayFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPassWordKeyTypeTypeһԿ +///////////////////////////////////////////////////////////////////////// +///Կ +#define THOST_FTDC_PWKT_ExchangeKey '0' +///Կ +#define THOST_FTDC_PWKT_PassWordKey '1' +///MACԿ +#define THOST_FTDC_PWKT_MACKey '2' +///Կ +#define THOST_FTDC_PWKT_MessageKey '3' + +typedef char TThostFtdcPassWordKeyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTPassWordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ѯ +#define THOST_FTDC_PWT_Query '0' +///ȡ +#define THOST_FTDC_PWT_Fetch '1' +///ת +#define THOST_FTDC_PWT_Transfer '2' +/// +#define THOST_FTDC_PWT_Trade '3' + +typedef char TThostFtdcFBTPassWordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTEncryModeTypeһܷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EM_NoEncry '0' +///DES +#define THOST_FTDC_EM_DES '1' +///3DES +#define THOST_FTDC_EM_3DES '2' + +typedef char TThostFtdcFBTEncryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankRepealFlagTypeһг־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define THOST_FTDC_BRF_BankNotNeedRepeal '0' +///дԶ +#define THOST_FTDC_BRF_BankWaitingRepeal '1' +///Զ +#define THOST_FTDC_BRF_BankBeenRepealed '2' + +typedef char TThostFtdcBankRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerRepealFlagTypeһ̳־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define THOST_FTDC_BRORF_BrokerNotNeedRepeal '0' +///̴Զ +#define THOST_FTDC_BRORF_BrokerWaitingRepeal '1' +///Զ +#define THOST_FTDC_BRORF_BrokerBeenRepealed '2' + +typedef char TThostFtdcBrokerRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstitutionTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TS_Bank '0' +/// +#define THOST_FTDC_TS_Future '1' +///ȯ +#define THOST_FTDC_TS_Store '2' + +typedef char TThostFtdcInstitutionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastFragmentTypeһƬ־ +///////////////////////////////////////////////////////////////////////// +///Ƭ +#define THOST_FTDC_LF_Yes '0' +///Ƭ +#define THOST_FTDC_LF_No '1' + +typedef char TThostFtdcLastFragmentType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccStatusTypeһ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_BAS_Normal '0' +/// +#define THOST_FTDC_BAS_Freeze '1' +///ʧ +#define THOST_FTDC_BAS_ReportLoss '2' + +typedef char TThostFtdcBankAccStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyAccountStatusTypeһʽ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_MAS_Normal '0' +/// +#define THOST_FTDC_MAS_Cancel '1' + +typedef char TThostFtdcMoneyAccountStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcManageStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ָ +#define THOST_FTDC_MSS_Point '0' +///Ԥָ +#define THOST_FTDC_MSS_PrePoint '1' +///ָ +#define THOST_FTDC_MSS_CancelPoint '2' + +typedef char TThostFtdcManageStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemTypeTypeһӦϵͳ +///////////////////////////////////////////////////////////////////////// +///ת +#define THOST_FTDC_SYT_FutureBankTransfer '0' +///֤ת +#define THOST_FTDC_SYT_StockBankTransfer '1' +/// +#define THOST_FTDC_SYT_TheThirdPartStore '2' + +typedef char TThostFtdcSystemTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTxnEndFlagTypeһתʻת־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TEF_NormalProcessing '0' +///ɹ +#define THOST_FTDC_TEF_Success '1' +///ʧܽ +#define THOST_FTDC_TEF_Failed '2' +///쳣 +#define THOST_FTDC_TEF_Abnormal '3' +///˹쳣 +#define THOST_FTDC_TEF_ManualProcessedForException '4' +///ͨѶ쳣 ˹ +#define THOST_FTDC_TEF_CommuFailedNeedManualProcess '5' +///ϵͳ˹ +#define THOST_FTDC_TEF_SysErrorNeedManualProcess '6' + +typedef char TThostFtdcTxnEndFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessStatusTypeһתʷ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PSS_NotProcess '0' +///ʼ +#define THOST_FTDC_PSS_StartProcess '1' +/// +#define THOST_FTDC_PSS_Finished '2' + +typedef char TThostFtdcProcessStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CUSTT_Person '0' +/// +#define THOST_FTDC_CUSTT_Institution '1' + +typedef char TThostFtdcCustTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTransferDirectionTypeһתʷ +///////////////////////////////////////////////////////////////////////// +///תڻ +#define THOST_FTDC_FBTTD_FromBankToFuture '1' +///ڻת +#define THOST_FTDC_FBTTD_FromFutureToBank '2' + +typedef char TThostFtdcFBTTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenOrDestroyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OOD_Open '1' +/// +#define THOST_FTDC_OOD_Destroy '0' + +typedef char TThostFtdcOpenOrDestroyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAvailabilityFlagTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define THOST_FTDC_AVAF_Invalid '0' +///Ч +#define THOST_FTDC_AVAF_Valid '1' +/// +#define THOST_FTDC_AVAF_Repeal '2' + +typedef char TThostFtdcAvailabilityFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_OT_Bank '1' +///ǰ +#define THOST_FTDC_OT_Future '2' +///תƽ̨ +#define THOST_FTDC_OT_PlateForm '9' + +typedef char TThostFtdcOrganTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///лܲ +#define THOST_FTDC_OL_HeadQuarters '1' +///зĻڻ˾Ӫҵ +#define THOST_FTDC_OL_Branch '2' + +typedef char TThostFtdcOrganLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocalIDTypeһЭ +///////////////////////////////////////////////////////////////////////// +///Э +#define THOST_FTDC_PID_FutureProtocal '0' +///Э +#define THOST_FTDC_PID_ICBCProtocal '1' +///ũЭ +#define THOST_FTDC_PID_ABCProtocal '2' +///йЭ +#define THOST_FTDC_PID_CBCProtocal '3' +///Э +#define THOST_FTDC_PID_CCBProtocal '4' +///Э +#define THOST_FTDC_PID_BOCOMProtocal '5' +///תƽ̨Э +#define THOST_FTDC_PID_FBTPlateFormProtocal 'X' + +typedef char TThostFtdcProtocalIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConnectModeTypeһ׽ӷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CM_ShortConnect '0' +/// +#define THOST_FTDC_CM_LongConnect '1' + +typedef char TThostFtdcConnectModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncModeTypeһ׽ͨŷʽ +///////////////////////////////////////////////////////////////////////// +///첽 +#define THOST_FTDC_SRM_ASync '0' +///ͬ +#define THOST_FTDC_SRM_Sync '1' + +typedef char TThostFtdcSyncModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccTypeTypeһʺ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_BAT_BankBook '1' +/// +#define THOST_FTDC_BAT_SavingCard '2' +///ÿ +#define THOST_FTDC_BAT_CreditCard '3' + +typedef char TThostFtdcBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccTypeTypeһڻ˾ʺ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_FAT_BankBook '1' +/// +#define THOST_FTDC_FAT_SavingCard '2' +///ÿ +#define THOST_FTDC_FAT_CreditCard '3' + +typedef char TThostFtdcFutureAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OS_Ready '0' +///ǩ +#define THOST_FTDC_OS_CheckIn '1' +///ǩ +#define THOST_FTDC_OS_CheckOut '2' +///ļ +#define THOST_FTDC_OS_CheckFileArrived '3' +/// +#define THOST_FTDC_OS_CheckDetail '4' +/// +#define THOST_FTDC_OS_DayEndClean '5' +///ע +#define THOST_FTDC_OS_Invalid '9' + +typedef char TThostFtdcOrganStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCCBFeeModeTypeһշģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CCBFM_ByAmount '1' +///¿ +#define THOST_FTDC_CCBFM_ByMonth '2' + +typedef char TThostFtdcCCBFeeModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiTypeTypeһͨѶAPI +///////////////////////////////////////////////////////////////////////// +///ͻ +#define THOST_FTDC_CAPIT_Client '1' +/// +#define THOST_FTDC_CAPIT_Server '2' +///ϵͳUserApi +#define THOST_FTDC_CAPIT_UserApi '3' + +typedef char TThostFtdcCommApiTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServiceIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceLineNoTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServiceLineNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcServiceNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLinkStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿ +#define THOST_FTDC_LS_Connected '1' +///û +#define THOST_FTDC_LS_Disconnected '2' + +typedef char TThostFtdcLinkStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiPointerTypeһͨѶAPIָ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCommApiPointerType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPwdFlagTypeһ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_BPWDF_NoCheck '0' +///ĺ˶ +#define THOST_FTDC_BPWDF_BlankCheck '1' +///ĺ˶ +#define THOST_FTDC_BPWDF_EncryptCheck '2' + +typedef char TThostFtdcPwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSecuAccTypeTypeһڻʺ +///////////////////////////////////////////////////////////////////////// +///ʽʺ +#define THOST_FTDC_SAT_AccountID '1' +///ʽ𿨺 +#define THOST_FTDC_SAT_CardID '2' +///Ϻɶʺ +#define THOST_FTDC_SAT_SHStockholderID '3' +///ڹɶʺ +#define THOST_FTDC_SAT_SZStockholderID '4' + +typedef char TThostFtdcSecuAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferStatusTypeһת˽״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TRFS_Normal '0' +/// +#define THOST_FTDC_TRFS_Repealed '1' + +typedef char TThostFtdcTransferStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSponsorTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SPTYPE_Broker '0' +/// +#define THOST_FTDC_SPTYPE_Bank '1' + +typedef char TThostFtdcSponsorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReqRspTypeTypeһӦ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_REQRSP_Request '0' +///Ӧ +#define THOST_FTDC_REQRSP_Response '1' + +typedef char TThostFtdcReqRspTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTUserEventTypeTypeһתû¼ +///////////////////////////////////////////////////////////////////////// +///ǩ +#define THOST_FTDC_FBTUET_SignIn '0' +///תڻ +#define THOST_FTDC_FBTUET_FromBankToFuture '1' +///ڻת +#define THOST_FTDC_FBTUET_FromFutureToBank '2' +/// +#define THOST_FTDC_FBTUET_OpenAccount '3' +/// +#define THOST_FTDC_FBTUET_CancelAccount '4' +///˻ +#define THOST_FTDC_FBTUET_ChangeAccount '5' +///תڻ +#define THOST_FTDC_FBTUET_RepealFromBankToFuture '6' +///ڻת +#define THOST_FTDC_FBTUET_RepealFromFutureToBank '7' +///ѯ˻ +#define THOST_FTDC_FBTUET_QueryBankAccount '8' +///ѯڻ˻ +#define THOST_FTDC_FBTUET_QueryFutureAccount '9' +///ǩ +#define THOST_FTDC_FBTUET_SignOut 'A' +///Կͬ +#define THOST_FTDC_FBTUET_SyncKey 'B' +/// +#define THOST_FTDC_FBTUET_Other 'Z' + +typedef char TThostFtdcFBTUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDByBankTypeһԼı +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankIDByBankType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankOperNoTypeһвԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankOperNoType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCustNoTypeһпͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankCustNoType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBOPSeqNoTypeһк +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDBOPSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTableNameTypeһFBT +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTableNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPKNameTypeһFBT +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPKNameType[201]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPKValueTypeһFBTֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPKValueType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncFlagTypeһͬ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_SYNF_Yes '0' +///δͬ +#define THOST_FTDC_SYNF_No '1' + +typedef char TThostFtdcSyncFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTargetIDTypeһͬĿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTargetIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncTypeTypeһͬ +///////////////////////////////////////////////////////////////////////// +///һͬ +#define THOST_FTDC_SYNT_OneOffSync '0' +///ʱͬ +#define THOST_FTDC_SYNT_TimerSync '1' +///ʱȫͬ +#define THOST_FTDC_SYNT_TimerFullSync '2' + +typedef char TThostFtdcSyncTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBETimeTypeһֻʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBETimeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankNoTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBECertNoTypeһƾ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBECertNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExDirectionTypeһ㷽 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBEDIR_Settlement '0' +///ۻ +#define THOST_FTDC_FBEDIR_Sale '1' + +typedef char TThostFtdcExDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankAccountType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankAccountNameTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankAccountNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEAmtTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcFBEAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBusinessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEPostScriptTypeһ㸽 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEPostScriptType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBERemarkTypeһ㱸ע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBERemarkType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExRateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcExRateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEResultFlagTypeһɹ־ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_FBERES_Success '0' +///˻ +#define THOST_FTDC_FBERES_InsufficientBalance '1' +///׽δ֪ +#define THOST_FTDC_FBERES_UnknownTrading '8' +///ʧ +#define THOST_FTDC_FBERES_Fail 'x' + +typedef char TThostFtdcFBEResultFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBERtnMsgTypeһ㷵Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBERtnMsgType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEExtendMsgTypeһչϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEExtendMsgType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBusinessSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBusinessSerialType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBESystemSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBESystemSerialType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBETotalExCntTypeһ㽻ܱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBETotalExCntType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEExchStatusTypeһ㽻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBEES_Normal '0' +///ط +#define THOST_FTDC_FBEES_ReExchange '1' + +typedef char TThostFtdcFBEExchStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEFileFlagTypeһļ־ +///////////////////////////////////////////////////////////////////////// +///ݰ +#define THOST_FTDC_FBEFG_DataPackage '0' +///ļ +#define THOST_FTDC_FBEFG_File '1' + +typedef char TThostFtdcFBEFileFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEAlreadyTradeTypeһѽױ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FBEAT_NotTrade '0' +///ѽ +#define THOST_FTDC_FBEAT_Trade '1' + +typedef char TThostFtdcFBEAlreadyTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEOpenBankTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEOpenBankType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEUserEventTypeTypeһڻû¼ +///////////////////////////////////////////////////////////////////////// +///ǩ +#define THOST_FTDC_FBEUET_SignIn '0' +/// +#define THOST_FTDC_FBEUET_Exchange '1' +///ط +#define THOST_FTDC_FBEUET_ReExchange '2' +///˻ѯ +#define THOST_FTDC_FBEUET_QueryBankAccount '3' +///ϸѯ +#define THOST_FTDC_FBEUET_QueryExchDetial '4' +///ܲѯ +#define THOST_FTDC_FBEUET_QueryExchSummary '5' +///ʲѯ +#define THOST_FTDC_FBEUET_QueryExchRate '6' +///ļ֪ͨ +#define THOST_FTDC_FBEUET_CheckBankAccount '7' +///ǩ +#define THOST_FTDC_FBEUET_SignOut '8' +/// +#define THOST_FTDC_FBEUET_Other 'Z' + +typedef char TThostFtdcFBEUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEFileNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBatchSerialTypeһκ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBatchSerialType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEReqFlagTypeһ㷢ͱ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FBERF_UnProcessed '0' +///ȴ +#define THOST_FTDC_FBERF_WaitSend '1' +///ͳɹ +#define THOST_FTDC_FBERF_SendSuccess '2' +///ʧ +#define THOST_FTDC_FBERF_SendFailed '3' +///ȴط +#define THOST_FTDC_FBERF_WaitReSend '4' + +typedef char TThostFtdcFBEReqFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNotifyClassTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_NC_NOERROR '0' +///ʾ +#define THOST_FTDC_NC_Warn '1' +///׷ +#define THOST_FTDC_NC_Call '2' +///ǿƽ +#define THOST_FTDC_NC_Force '3' +/// +#define THOST_FTDC_NC_CHUANCANG '4' +///쳣 +#define THOST_FTDC_NC_Exception '5' + +typedef char TThostFtdcNotifyClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNofityInfoTypeһͻ֪ͨϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRiskNofityInfoType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseSceneIdTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcForceCloseSceneIdType[24]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseTypeTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +///ֹǿƽ +#define THOST_FTDC_FCT_Manual '0' +///һͶ߸ǿƽ +#define THOST_FTDC_FCT_Single '1' +///Ͷ߸ǿƽ +#define THOST_FTDC_FCT_Group '2' + +typedef char TThostFtdcForceCloseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDsTypeһƷ,+ָ,cu+zn +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDsType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyMethodTypeһ֪ͨ; +///////////////////////////////////////////////////////////////////////// +///ϵͳ֪ͨ +#define THOST_FTDC_RNM_System '0' +///֪ͨ +#define THOST_FTDC_RNM_SMS '1' +///ʼ֪ͨ +#define THOST_FTDC_RNM_EMail '2' +///˹֪ͨ +#define THOST_FTDC_RNM_Manual '3' + +typedef char TThostFtdcRiskNotifyMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyStatusTypeһ֪ͨ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_RNS_NotGen '0' +///δ +#define THOST_FTDC_RNS_Generated '1' +///ʧ +#define THOST_FTDC_RNS_SendError '2' +///ѷδ +#define THOST_FTDC_RNS_SendOk '3' +///ѽδȷ +#define THOST_FTDC_RNS_Received '4' +///ȷ +#define THOST_FTDC_RNS_Confirmed '5' + +typedef char TThostFtdcRiskNotifyStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskUserEventTypeһû¼ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_RUE_ExportData '0' + +typedef char TThostFtdcRiskUserEventType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParamNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParamValueType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConditionalOrderSortTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ʹ¼ +#define THOST_FTDC_COST_LastPriceAsc '0' +///ʹ¼۽ +#define THOST_FTDC_COST_LastPriceDesc '1' +///ʹ +#define THOST_FTDC_COST_AskPriceAsc '2' +///ʹ۽ +#define THOST_FTDC_COST_AskPriceDesc '3' +///ʹ +#define THOST_FTDC_COST_BidPriceAsc '4' +///ʹ۽ +#define THOST_FTDC_COST_BidPriceDesc '5' + +typedef char TThostFtdcConditionalOrderSortTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendTypeTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UOAST_NoSend '0' +///ѷ +#define THOST_FTDC_UOAST_Sended '1' +/// +#define THOST_FTDC_UOAST_Generated '2' +///ʧ +#define THOST_FTDC_UOAST_SendFail '3' +///ճɹ +#define THOST_FTDC_UOAST_Success '4' +///ʧ +#define THOST_FTDC_UOAST_Fail '5' +///ȡ +#define THOST_FTDC_UOAST_Cancel '6' + +typedef char TThostFtdcSendTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDStatusTypeһױ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UOACS_NoApply '1' +///ύ +#define THOST_FTDC_UOACS_Submited '2' +///ѷ +#define THOST_FTDC_UOACS_Sended '3' +/// +#define THOST_FTDC_UOACS_Success '4' +///ܾ +#define THOST_FTDC_UOACS_Refuse '5' +///ѳ +#define THOST_FTDC_UOACS_Cancel '6' + +typedef char TThostFtdcClientIDStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndustryIDTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIndustryIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionIDTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcQuestionIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionContentTypeһϢ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcQuestionContentType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionIDTypeһѡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOptionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionContentTypeһѡ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOptionContentType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionTypeTypeһϢ +///////////////////////////////////////////////////////////////////////// +///ѡ +#define THOST_FTDC_QT_Radio '1' +///ѡ +#define THOST_FTDC_QT_Option '2' +/// +#define THOST_FTDC_QT_Blank '3' + +typedef char TThostFtdcQuestionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessIDTypeһҵˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAProcessStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAProcessStatusType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessTypeTypeһ̹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_BT_Request '1' +///Ӧ +#define THOST_FTDC_BT_Response '2' +///֪ͨ +#define THOST_FTDC_BT_Notice '3' + +typedef char TThostFtdcBusinessTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCfmmcReturnCodeTypeһķ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_CRC_Success '0' +///ÿͻѾڴ +#define THOST_FTDC_CRC_Working '1' +///пͻϼʧ +#define THOST_FTDC_CRC_InfoFail '2' +///ʵƼʧ +#define THOST_FTDC_CRC_IDCardFail '3' +/// +#define THOST_FTDC_CRC_OtherFail '4' + +typedef char TThostFtdcCfmmcReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcExReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CfMMCCT_All '0' +/// +#define THOST_FTDC_CfMMCCT_Person '1' +///λ +#define THOST_FTDC_CfMMCCT_Company '2' +/// +#define THOST_FTDC_CfMMCCT_Other '3' +///ⷨ +#define THOST_FTDC_CfMMCCT_SpecialOrgan '4' +///ʹܻ +#define THOST_FTDC_CfMMCCT_Asset '5' + +typedef char TThostFtdcClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///Ϻڻ +#define THOST_FTDC_EIDT_SHFE 'S' +///֣Ʒ +#define THOST_FTDC_EIDT_CZCE 'Z' +///Ʒ +#define THOST_FTDC_EIDT_DCE 'D' +///йڻ +#define THOST_FTDC_EIDT_CFFEX 'J' +///ϺԴĹɷ޹˾ +#define THOST_FTDC_EIDT_INE 'N' + +typedef char TThostFtdcExchangeIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientClassifyTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientClassifyType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAOrganTypeTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAOrganTypeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOACountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOACountryCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAreaCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAreaCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturesIDTypeһΪͻĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFuturesIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffmcDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffmcTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNocIDTypeһ֯ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNocIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUpdateFlagTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UF_NoUpdate '0' +///ȫϢɹ +#define THOST_FTDC_UF_Success '1' +///ȫϢʧ +#define THOST_FTDC_UF_Fail '2' +///½ױɹ +#define THOST_FTDC_UF_TCSuccess '3' +///½ױʧ +#define THOST_FTDC_UF_TCFail '4' +///Ѷ +#define THOST_FTDC_UF_Cancel '5' + +typedef char TThostFtdcUpdateFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyOperateIDTypeһ붯 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AOID_OpenInvestor '1' +///޸Ϣ +#define THOST_FTDC_AOID_ModifyIDCard '2' +///޸һϢ +#define THOST_FTDC_AOID_ModifyNoIDCard '3' +///뽻ױ +#define THOST_FTDC_AOID_ApplyTradingCode '4' +///ױ +#define THOST_FTDC_AOID_CancelTradingCode '5' +/// +#define THOST_FTDC_AOID_CancelInvestor '6' +///˻ +#define THOST_FTDC_AOID_FreezeAccount '8' +///˻ +#define THOST_FTDC_AOID_ActiveFreezeAccount '9' + +typedef char TThostFtdcApplyOperateIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyStatusIDTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δȫ +#define THOST_FTDC_ASID_NoComplete '1' +///ύ +#define THOST_FTDC_ASID_Submited '2' +/// +#define THOST_FTDC_ASID_Checked '3' +///Ѿܾ +#define THOST_FTDC_ASID_Refused '4' +///ɾ +#define THOST_FTDC_ASID_Deleted '5' + +typedef char TThostFtdcApplyStatusIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendMethodTypeһͷʽ +///////////////////////////////////////////////////////////////////////// +///ļ +#define THOST_FTDC_UOASM_ByAPI '1' +///ӷ +#define THOST_FTDC_UOASM_ByFile '2' + +typedef char TThostFtdcSendMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEventTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventModeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EvM_ADD '1' +///޸ +#define THOST_FTDC_EvM_UPDATE '2' +///ɾ +#define THOST_FTDC_EvM_DELETE '3' +/// +#define THOST_FTDC_EvM_CHECK '4' +/// +#define THOST_FTDC_EvM_COPY '5' +///ע +#define THOST_FTDC_EvM_CANCEL '6' +/// +#define THOST_FTDC_EvM_Reverse '7' + +typedef char TThostFtdcEventModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAAutoSendTypeһͳһԶ +///////////////////////////////////////////////////////////////////////// +///ԶͲ +#define THOST_FTDC_UOAA_ASR '1' +///ԶͣԶ +#define THOST_FTDC_UOAA_ASNR '2' +///ԶͣԶ +#define THOST_FTDC_UOAA_NSAR '3' +///ԶͣҲԶ +#define THOST_FTDC_UOAA_NSR '4' + +typedef char TThostFtdcUOAAutoSendType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryDepthTypeһѯ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcQueryDepthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataCenterIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDataCenterIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define THOST_FTDC_CL_Zero '0' +///һ +#define THOST_FTDC_CL_One '1' +/// +#define THOST_FTDC_CL_Two '2' + +typedef char TThostFtdcCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCheckNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckStatusTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_CHS_Init '0' +/// +#define THOST_FTDC_CHS_Checking '1' +///Ѹ +#define THOST_FTDC_CHS_Checked '2' +///ܾ +#define THOST_FTDC_CHS_Refuse '3' +/// +#define THOST_FTDC_CHS_Cancel '4' + +typedef char TThostFtdcCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUsedStatusTypeһЧ״̬ +///////////////////////////////////////////////////////////////////////// +///δЧ +#define THOST_FTDC_CHU_Unused '0' +///Ч +#define THOST_FTDC_CHU_Used '1' +///Чʧ +#define THOST_FTDC_CHU_Fail '2' + +typedef char TThostFtdcUsedStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRateTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyStringTypeһڲѯͶֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyStringType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAcountOriginTypeһ˻Դ +///////////////////////////////////////////////////////////////////////// +///ֹ¼ +#define THOST_FTDC_BAO_ByAccProperty '0' +///ת +#define THOST_FTDC_BAO_ByFBTransfer '1' + +typedef char TThostFtdcBankAcountOriginType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthBillTradeSumTypeһ㵥±ɽܷʽ +///////////////////////////////////////////////////////////////////////// +///ͬͬԼ +#define THOST_FTDC_MBTS_ByInstrument '0' +///ͬͬԼͬ۸ +#define THOST_FTDC_MBTS_ByDayInsPrc '1' +///ͬԼ +#define THOST_FTDC_MBTS_ByDayIns '2' + +typedef char TThostFtdcMonthBillTradeSumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTradeCodeEnumTypeһڽ״ö +///////////////////////////////////////////////////////////////////////// +///зתڻ +#define THOST_FTDC_FTC_BankLaunchBankToBroker '102001' +///ڻתڻ +#define THOST_FTDC_FTC_BrokerLaunchBankToBroker '202001' +///зڻת +#define THOST_FTDC_FTC_BankLaunchBrokerToBank '102002' +///ڻڻת +#define THOST_FTDC_FTC_BrokerLaunchBrokerToBank '202002' + +typedef char TThostFtdcFBTTradeCodeEnumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateIDTypeһģʹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRateTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimestampTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTimestampType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleNameTypeһŶι +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDRuleNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleExprTypeһŶιʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDRuleExprType[513]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastDriftTypeһϴOTPƯֵ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLastDriftType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastSuccessTypeһϴOTPɹֵ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLastSuccessType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthKeyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialNumberTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSerialNumberType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPTypeTypeһ̬ +///////////////////////////////////////////////////////////////////////// +///޶̬ +#define THOST_FTDC_OTP_NONE '0' +///ʱ +#define THOST_FTDC_OTP_TOTP '1' + +typedef char TThostFtdcOTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsIDTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOTPVendorsIDType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsNameTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOTPVendorsNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPStatusTypeһ̬״̬ +///////////////////////////////////////////////////////////////////////// +///δʹ +#define THOST_FTDC_OTPS_Unused '0' +///ʹ +#define THOST_FTDC_OTPS_Used '1' +///ע +#define THOST_FTDC_OTPS_Disuse '2' + +typedef char TThostFtdcOTPStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +///Ʒڻ +#define THOST_FTDC_FUTT_Commodity '1' +///ڻ +#define THOST_FTDC_FUTT_Financial '2' + +typedef char TThostFtdcFutureTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundEventTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ת޶ +#define THOST_FTDC_FET_Restriction '0' +///ת޶ +#define THOST_FTDC_FET_TodayRestriction '1' +///ˮ +#define THOST_FTDC_FET_Transfer '2' +///ʽ𶳽 +#define THOST_FTDC_FET_Credit '3' +///Ͷ߿ʽ +#define THOST_FTDC_FET_InvestorWithdrawAlm '4' +///ʻת޶ +#define THOST_FTDC_FET_BankRestriction '5' +///ǩԼ˻ +#define THOST_FTDC_FET_Accountregister '6' +/// +#define THOST_FTDC_FET_ExchangeFundIO '7' +///Ͷ߳ +#define THOST_FTDC_FET_InvestorFundIO '8' + +typedef char TThostFtdcFundEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountSourceTypeTypeһʽ˻Դ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_AST_FBTransfer '0' +///ֹ¼ +#define THOST_FTDC_AST_ManualEntry '1' + +typedef char TThostFtdcAccountSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCodeSourceTypeTypeһױԴ +///////////////////////////////////////////////////////////////////////// +///ͳһ(ѹ淶) +#define THOST_FTDC_CST_UnifyAccount '0' +///ֹ¼(δ淶) +#define THOST_FTDC_CST_ManualEntry '1' + +typedef char TThostFtdcCodeSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRangeTypeһԱΧ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_UR_All '0' +///һԱ +#define THOST_FTDC_UR_Single '1' + +typedef char TThostFtdcUserRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeSpanTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTimeSpanType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImportSequenceIDTypeһ̬Ƶα +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcImportSequenceIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByGroupTypeһͳƱͻͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ͷͳ +#define THOST_FTDC_BG_Investor '2' +///ͳ +#define THOST_FTDC_BG_Group '1' + +typedef char TThostFtdcByGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSumStatModeTypeһͳƱΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Լͳ +#define THOST_FTDC_TSSM_Instrument '1' +///Ʒͳ +#define THOST_FTDC_TSSM_Product '2' +///ͳ +#define THOST_FTDC_TSSM_Exchange '3' + +typedef char TThostFtdcTradeSumStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcComTypeTypeһϳɽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcComTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductIDTypeһƷʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductMemoTypeһƷ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductMemoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCCancelFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCCancelFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorNameTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCInvestorNameType[201]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOpenInvestorNameTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOpenInvestorNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorIDTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankFlagTypeһбʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCBankFlagType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCBankAccountType[23]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOpenNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOpenNameType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMemoTypeһ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMemoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTradeIDTypeһɽˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCExchangeInstIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMortgageNameTypeһѺƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMortgageNameType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCReasonTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCReasonType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsSettlementTypeһǷΪǽԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIsSettlementType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOptionsTypeTypeһȨ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOptionsTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCStrikePriceTypeһִм +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCStrikePriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTargetProductIDTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTargetProductIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTargetInstrIDTypeһĺԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTargetInstrIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommModelNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelMemoTypeһģ屸ע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommModelMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExprSetModeTypeһڱʽ +///////////////////////////////////////////////////////////////////////// +///й +#define THOST_FTDC_ESM_Relative '1' +/// +#define THOST_FTDC_ESM_Typical '2' + +typedef char TThostFtdcExprSetModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +///˾׼ +#define THOST_FTDC_RIR_All '1' +///ģ +#define THOST_FTDC_RIR_Model '2' +///һͶ +#define THOST_FTDC_RIR_Single '3' + +typedef char TThostFtdcRateInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentBrokerIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDRIdentityIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDRIdentityNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBLinkIDTypeһDBLinkʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBLinkIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncDataStatusTypeһϵͳͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define THOST_FTDC_SDS_Initialize '0' +///ͬ +#define THOST_FTDC_SDS_Settlementing '1' +///ͬ +#define THOST_FTDC_SDS_Settlemented '2' + +typedef char TThostFtdcSyncDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///Խͨر +#define THOST_FTDC_TSRC_NORMAL '0' +///Բѯ +#define THOST_FTDC_TSRC_QUERY '1' + +typedef char TThostFtdcTradeSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFlexStatModeTypeһƷԼͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ʒͳ +#define THOST_FTDC_FSM_Product '1' +///ͳ +#define THOST_FTDC_FSM_Exchange '2' +///ͳ +#define THOST_FTDC_FSM_All '3' + +typedef char TThostFtdcFlexStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByInvestorRangeTypeһͶ߷ΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///ͳ +#define THOST_FTDC_BIR_Property '1' +///ͳ +#define THOST_FTDC_BIR_All '2' + +typedef char TThostFtdcByInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PIR_All '1' +///Ͷ +#define THOST_FTDC_PIR_Property '2' +///һͶ +#define THOST_FTDC_PIR_Single '3' + +typedef char TThostFtdcPropertyInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FIS_NoCreate '0' +/// +#define THOST_FTDC_FIS_Created '1' +///ʧ +#define THOST_FTDC_FIS_Failed '2' + +typedef char TThostFtdcFileStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileGenStyleTypeһļɷʽ +///////////////////////////////////////////////////////////////////////// +///· +#define THOST_FTDC_FGS_FileTransmit '0' +/// +#define THOST_FTDC_FGS_FileGen '1' + +typedef char TThostFtdcFileGenStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperModeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SoM_Add '1' +///޸ +#define THOST_FTDC_SoM_Update '2' +///ɾ +#define THOST_FTDC_SoM_Delete '3' +/// +#define THOST_FTDC_SoM_Copy '4' +/// +#define THOST_FTDC_SoM_AcTive '5' +///ע +#define THOST_FTDC_SoM_CanCel '6' +/// +#define THOST_FTDC_SoM_ReSet '7' + +typedef char TThostFtdcSysOperModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperTypeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +///޸IJԱ +#define THOST_FTDC_SoT_UpdatePassword '0' +///Աܹ֯ϵ +#define THOST_FTDC_SoT_UserDepartment '1' +///ɫ +#define THOST_FTDC_SoT_RoleManager '2' +///ɫ +#define THOST_FTDC_SoT_RoleFunction '3' +/// +#define THOST_FTDC_SoT_BaseParam '4' +///òԱ +#define THOST_FTDC_SoT_SetUserID '5' +///ûɫ +#define THOST_FTDC_SoT_SetUserRole '6' +///ûIP +#define THOST_FTDC_SoT_UserIpRestriction '7' +///ܹ֯ +#define THOST_FTDC_SoT_DepartmentManager '8' +///ܹ֯ѯิ +#define THOST_FTDC_SoT_DepartmentCopy '9' +///ױ +#define THOST_FTDC_SoT_Tradingcode 'A' +///Ͷ״̬ά +#define THOST_FTDC_SoT_InvestorStatus 'B' +///ͶȨ޹ +#define THOST_FTDC_SoT_InvestorAuthority 'C' +/// +#define THOST_FTDC_SoT_PropertySet 'D' +///Ͷ +#define THOST_FTDC_SoT_ReSetInvestorPasswd 'E' +///Ͷ߸Ϣά +#define THOST_FTDC_SoT_InvestorPersonalityInfo 'F' + +typedef char TThostFtdcSysOperTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDataQueyTypeTypeһϱݲѯ +///////////////////////////////////////////////////////////////////////// +///ѯǰձ͵ +#define THOST_FTDC_CSRCQ_Current '0' +///ѯʷ͵Ĵ͹˾ +#define THOST_FTDC_CSRCQ_History '1' + +typedef char TThostFtdcCSRCDataQueyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_FRS_Normal '1' +/// +#define THOST_FTDC_FRS_Freeze '0' + +typedef char TThostFtdcFreezeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStandardStatusTypeһ淶״̬ +///////////////////////////////////////////////////////////////////////// +///ѹ淶 +#define THOST_FTDC_STST_Standard '0' +///δ淶 +#define THOST_FTDC_STST_NonStandard '1' + +typedef char TThostFtdcStandardStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCFreezeStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightParamTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///߻ +#define THOST_FTDC_RPT_Freeze '1' +///߻ +#define THOST_FTDC_RPT_FreezeActive '2' +///Ȩ +#define THOST_FTDC_RPT_OpenLimit '3' +///Ȩ +#define THOST_FTDC_RPT_RelieveOpenLimit '4' + +typedef char TThostFtdcRightParamTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateIDTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRightTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRightTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataStatusTypeһϴǮ˱״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMLDS_Normal '0' +///ɾ +#define THOST_FTDC_AMLDS_Deleted '1' + +typedef char TThostFtdcDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCheckStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_AMLCHS_Init '0' +/// +#define THOST_FTDC_AMLCHS_Checking '1' +///Ѹ +#define THOST_FTDC_AMLCHS_Checked '2' +///ܾϱ +#define THOST_FTDC_AMLCHS_RefuseReport '3' + +typedef char TThostFtdcAMLCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlDateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMLDT_DrawDay '0' +/// +#define THOST_FTDC_AMLDT_TouchDay '1' + +typedef char TThostFtdcAmlDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define THOST_FTDC_AMLCL_CheckLevel0 '0' +///һ +#define THOST_FTDC_AMLCL_CheckLevel1 '1' +/// +#define THOST_FTDC_AMLCL_CheckLevel2 '2' +/// +#define THOST_FTDC_AMLCL_CheckLevel3 '3' + +typedef char TThostFtdcAmlCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckFlowTypeһϴǮݳȡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAmlCheckFlowType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDataTypeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExportFileTypeTypeһļ +///////////////////////////////////////////////////////////////////////// +///CSV +#define THOST_FTDC_EFT_CSV '0' +///Excel +#define THOST_FTDC_EFT_EXCEL '1' +///DBF +#define THOST_FTDC_EFT_DBF '2' + +typedef char TThostFtdcExportFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ׼ +#define THOST_FTDC_SMT_Before '1' +/// +#define THOST_FTDC_SMT_Settlement '2' +///˶ +#define THOST_FTDC_SMT_After '3' +/// +#define THOST_FTDC_SMT_Settlemented '4' + +typedef char TThostFtdcSettleManagerTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerIDTypeһô +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettleManagerIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettleManagerNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerLevelTypeһõȼ +///////////////////////////////////////////////////////////////////////// +///Ҫ +#define THOST_FTDC_SML_Must '1' +/// +#define THOST_FTDC_SML_Alarm '2' +///ʾ +#define THOST_FTDC_SML_Prompt '3' +/// +#define THOST_FTDC_SML_Ignore '4' + +typedef char TThostFtdcSettleManagerLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerGroupTypeһģ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_SMG_Exhcange '1' +///ڲ˶ +#define THOST_FTDC_SMG_ASP '2' +///ϱݺ˶ +#define THOST_FTDC_SMG_CSRC '3' + +typedef char TThostFtdcSettleManagerGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckResultMemoTypeһ˶Խ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCheckResultMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionUrlTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionUrlType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthInfoTypeһͻ֤Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthCodeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLimitUseTypeTypeһֵʹ +///////////////////////////////////////////////////////////////////////// +///ظʹ +#define THOST_FTDC_LUT_Repeatable '1' +///ظʹ +#define THOST_FTDC_LUT_Unrepeatable '2' + +typedef char TThostFtdcLimitUseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataResourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define THOST_FTDC_DAR_Settle '1' +/// +#define THOST_FTDC_DAR_Exchange '2' +/// +#define THOST_FTDC_DAR_CSRC '3' + +typedef char TThostFtdcDataResourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_MGT_ExchMarginRate '0' +///Ͷ֤߱ +#define THOST_FTDC_MGT_InstrMarginRate '1' +///Ͷ߽ױ֤ +#define THOST_FTDC_MGT_InstrMarginRateTrade '2' + +typedef char TThostFtdcMarginTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActiveTypeTypeһЧ +///////////////////////////////////////////////////////////////////////// +///Ч +#define THOST_FTDC_ACT_Intraday '1' +///Ч +#define THOST_FTDC_ACT_Long '2' + +typedef char TThostFtdcActiveTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginRateTypeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_MRT_Exchange '1' +///Ͷ֤߱ +#define THOST_FTDC_MRT_Investor '2' +///Ͷ߽ױ֤ +#define THOST_FTDC_MRT_InvestorTrade '3' + +typedef char TThostFtdcMarginRateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBackUpStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δɱ +#define THOST_FTDC_BUS_UnBak '0' +/// +#define THOST_FTDC_BUS_BakUp '1' +///ɱ +#define THOST_FTDC_BUS_BakUped '2' +///ʧ +#define THOST_FTDC_BUS_BakFail '3' + +typedef char TThostFtdcBackUpStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInitSettlementTypeһʼ״̬ +///////////////////////////////////////////////////////////////////////// +///ʼδʼ +#define THOST_FTDC_SIS_UnInitialize '0' +///ʼ +#define THOST_FTDC_SIS_Initialize '1' +///ʼ +#define THOST_FTDC_SIS_Initialized '2' + +typedef char TThostFtdcInitSettlementType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δɱ +#define THOST_FTDC_SRS_NoCreate '0' +/// +#define THOST_FTDC_SRS_Create '1' +///ɱ +#define THOST_FTDC_SRS_Created '2' +///ɱʧ +#define THOST_FTDC_SRS_CreateFail '3' + +typedef char TThostFtdcReportStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSaveStatusTypeһݹ鵵״̬ +///////////////////////////////////////////////////////////////////////// +///鵵δ +#define THOST_FTDC_SSS_UnSaveData '0' +///鵵 +#define THOST_FTDC_SSS_SaveDatad '1' + +typedef char TThostFtdcSaveStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettArchiveStatusTypeһȷݹ鵵״̬ +///////////////////////////////////////////////////////////////////////// +///δ鵵 +#define THOST_FTDC_SAS_UnArchived '0' +///ݹ鵵 +#define THOST_FTDC_SAS_Archiving '1' +///ѹ鵵 +#define THOST_FTDC_SAS_Archived '2' +///鵵ʧ +#define THOST_FTDC_SAS_ArchiveFail '3' + +typedef char TThostFtdcSettArchiveStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCTPTypeTypeһCTPϵͳ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_CTPT_Unkown '0' +/// +#define THOST_FTDC_CTPT_MainCenter '1' +/// +#define THOST_FTDC_CTPT_BackUp '2' + +typedef char TThostFtdcCTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcToolIDTypeһߴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcToolIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcToolNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcToolNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseDealTypeTypeһƽִ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CDT_Normal '0' +///Ͷƽ +#define THOST_FTDC_CDT_SpecFirst '1' + +typedef char TThostFtdcCloseDealTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMortgageFundUseRangeTypeһѺʽ÷Χ +///////////////////////////////////////////////////////////////////////// +///ʹ +#define THOST_FTDC_MFUR_None '0' +///ڱ֤ +#define THOST_FTDC_MFUR_Margin '1' +///ѡӯ֤ +#define THOST_FTDC_MFUR_All '2' + +typedef char TThostFtdcMortgageFundUseRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyUnitTypeһֵλ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCurrencyUnitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeRateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcExchangeRateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSpecProductTypeTypeһƷ +///////////////////////////////////////////////////////////////////////// +///֣ױƷ +#define THOST_FTDC_SPT_CzceHedge '1' +///ѺƷ +#define THOST_FTDC_SPT_IneForeignCurrency '2' +///߿ƽֲƷ +#define THOST_FTDC_SPT_DceOpenClose '3' + +typedef char TThostFtdcSpecProductTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortgageTypeTypeһѺ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_FMT_Mortgage '1' +/// +#define THOST_FTDC_FMT_Redemption '2' + +typedef char TThostFtdcFundMortgageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountSettlementParamIDTypeһͶ˻ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_ASPI_BaseMargin '1' +///Ȩ׼ +#define THOST_FTDC_ASPI_LowestInterest '2' + +typedef char TThostFtdcAccountSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyNameType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySignTypeһַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencySignType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountsTypeһѿʽ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAccountsType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortDirectionTypeһѺ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FMD_In '1' +///ʳ +#define THOST_FTDC_FMD_Out '2' + +typedef char TThostFtdcFundMortDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessClassTypeһ +///////////////////////////////////////////////////////////////////////// +///ӯ +#define THOST_FTDC_BT_Profit '0' +/// +#define THOST_FTDC_BT_Loss '1' +/// +#define THOST_FTDC_BT_Other 'Z' + +typedef char TThostFtdcBusinessClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSwapSourceTypeTypeһԴ +///////////////////////////////////////////////////////////////////////// +///ֹ +#define THOST_FTDC_SST_Manual '0' +///Զ +#define THOST_FTDC_SST_Automatic '1' + +typedef char TThostFtdcSwapSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrExDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CED_Settlement '0' +///ۻ +#define THOST_FTDC_CED_Sale '1' + +typedef char TThostFtdcCurrExDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySwapStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_CSS_Entry '1' +/// +#define THOST_FTDC_CSS_Approve '2' +///Ѿܾ +#define THOST_FTDC_CSS_Refuse '3' +///ѳ +#define THOST_FTDC_CSS_Revoke '4' +///ѷ +#define THOST_FTDC_CSS_Send '5' +///ɹ +#define THOST_FTDC_CSS_Success '6' +///ʧ +#define THOST_FTDC_CSS_Failure '7' + +typedef char TThostFtdcCurrencySwapStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrExchCertNoTypeһƾ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrExchCertNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBatchSerialNoTypeһκ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBatchSerialNoType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReqFlagTypeһ㷢ͱ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_REQF_NoSend '0' +///ͳɹ +#define THOST_FTDC_REQF_SendSuccess '1' +///ʧ +#define THOST_FTDC_REQF_SendFailed '2' +///ȴط +#define THOST_FTDC_REQF_WaitReSend '3' + +typedef char TThostFtdcReqFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcResFlagTypeһ㷵سɹ־ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_RESF_Success '0' +///˻ +#define THOST_FTDC_RESF_InsuffiCient '1' +///׽δ֪ +#define THOST_FTDC_RESF_UnKnown '8' + +typedef char TThostFtdcResFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPageControlTypeһҳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPageControlType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordCountTypeһ¼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRecordCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySwapMemoTypeһȷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencySwapMemoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExStatusTypeһ޸״̬ +///////////////////////////////////////////////////////////////////////// +///޸ǰ +#define THOST_FTDC_EXS_Before '0' +///޸ĺ +#define THOST_FTDC_EXS_After '1' + +typedef char TThostFtdcExStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientRegionTypeһͻ +///////////////////////////////////////////////////////////////////////// +///ڿͻ +#define THOST_FTDC_CR_Domestic '1' +///۰̨ͻ +#define THOST_FTDC_CR_GMT '2' +///ͻ +#define THOST_FTDC_CR_Foreign '3' + +typedef char TThostFtdcClientRegionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWorkPlaceTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWorkPlaceType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessPeriodTypeһӪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessPeriodType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWebSiteTypeһַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWebSiteType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAIdCardTypeTypeһͳһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAIdCardTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientModeTypeһģʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientModeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorFullNameTypeһͶȫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorFullNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOABrokerIDTypeһнID +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOABrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAZipCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAZipCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAEMailTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAEMailType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOldCityTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOldCityType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorporateIdentifiedCardNoTypeһ˴֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCorporateIdentifiedCardNoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHasBoardTypeһǷж» +///////////////////////////////////////////////////////////////////////// +///û +#define THOST_FTDC_HB_No '0' +/// +#define THOST_FTDC_HB_Yes '1' + +typedef char TThostFtdcHasBoardType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTemplateTypeTypeһģ +///////////////////////////////////////////////////////////////////////// +///ȫ +#define THOST_FTDC_TPT_Full '1' +/// +#define THOST_FTDC_TPT_Increment '2' +/// +#define THOST_FTDC_TPT_BackUp '3' + +typedef char TThostFtdcTemplateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLoginModeTypeһ¼ģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LM_Trade '0' +///ת +#define THOST_FTDC_LM_Transfer '1' + +typedef char TThostFtdcLoginModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPromptTypeTypeһʾ +///////////////////////////////////////////////////////////////////////// +///Լ +#define THOST_FTDC_CPT_Instrument '1' +///ֶ֤Ч +#define THOST_FTDC_CPT_Margin '2' + +typedef char TThostFtdcPromptTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLedgerManageIDTypeһֻʲ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLedgerManageIDType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestVarietyTypeһͶƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestVarietyType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLedgerManageBankTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLedgerManageBankType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffexDepartmentNameTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffexDepartmentNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffexDepartmentCodeTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffexDepartmentCodeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHasTrusteeTypeһǷй +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HT_Yes '1' +///û +#define THOST_FTDC_HT_No '0' + +typedef char TThostFtdcHasTrusteeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrCFullNameTypeһʲҵڻ˾ȫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrCFullNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrApprovalNOTypeһʲҵĺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrApprovalNOType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrMgrNameTypeһʲҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrMgrNameType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMT_Bank '1' +///֤ȯ˾ +#define THOST_FTDC_AMT_Securities '2' +///˾ +#define THOST_FTDC_AMT_Fund '3' +///չ˾ +#define THOST_FTDC_AMT_Insurance '4' +///й˾ +#define THOST_FTDC_AMT_Trust '5' +/// +#define THOST_FTDC_AMT_Other '9' + +typedef char TThostFtdcAmTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCAmTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCAmTypeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CFIOT_FundIO '0' +///ڻ +#define THOST_FTDC_CFIOT_SwapCurrency '1' + +typedef char TThostFtdcCSRCFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCusAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +///ڻ˻ +#define THOST_FTDC_CAT_Futures '1' +///ڻʹҵµʹܽ˻ +#define THOST_FTDC_CAT_AssetmgrFuture '2' +///ۺʹҵµڻʹй˻ +#define THOST_FTDC_CAT_AssetmgrTrustee '3' +///ۺʹҵµʽת˻ +#define THOST_FTDC_CAT_AssetmgrTransfer '4' + +typedef char TThostFtdcCusAccountTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCNationalTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCNationalType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCSecAgentIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCSecAgentIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLanguageTypeTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LT_Chinese '0' +///Ӣ +#define THOST_FTDC_LT_English '1' + +typedef char TThostFtdcLanguageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmAccountTypeһͶ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAmAccountType[23]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrClientTypeTypeһʲͻ +///////////////////////////////////////////////////////////////////////// +///ʹܿͻ +#define THOST_FTDC_AMCT_Person '1' +///λʹܿͻ +#define THOST_FTDC_AMCT_Organ '2' +///ⵥλʹܿͻ +#define THOST_FTDC_AMCT_SpecialOrgan '4' + +typedef char TThostFtdcAssetmgrClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_ASST_Futures '3' +///ۺ +#define THOST_FTDC_ASST_SpecialOrgan '4' + +typedef char TThostFtdcAssetmgrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOMTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOMType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSHFEInstLifePhaseType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSHFEProductClassType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceDecimalTypeһ۸Сλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPriceDecimalType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInTheMoneyFlagTypeһƽֵȨ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInTheMoneyFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckInstrTypeTypeһԼȽ +///////////////////////////////////////////////////////////////////////// +///Լ +#define THOST_FTDC_CIT_HasExch '0' +///Լϵͳ +#define THOST_FTDC_CIT_HasATP '1' +///ԼȽϲһ +#define THOST_FTDC_CIT_HasDiff '2' + +typedef char TThostFtdcCheckInstrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckInstrPriceTypeTypeһ۱Ƚ +///////////////////////////////////////////////////////////////////////// +///۽ +#define THOST_FTDC_CIPT_HasExch '0' +///۱ϵͳ +#define THOST_FTDC_CIPT_HasATP '1' +///۱Ƚϲһ +#define THOST_FTDC_CIPT_HasDiff '2' + +typedef char TThostFtdcCheckInstrPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeliveryTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ֹ +#define THOST_FTDC_DT_HandDeliv '1' +///ڽ +#define THOST_FTDC_DT_PersonDeliv '2' + +typedef char TThostFtdcDeliveryTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBigMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcBigMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMaxMarginSideAlgorithmTypeһ֤߱㷨 +///////////////////////////////////////////////////////////////////////// +///ʹô֤߱㷨 +#define THOST_FTDC_MMSA_NO '0' +///ʹô֤߱㷨 +#define THOST_FTDC_MMSA_YES '1' + +typedef char TThostFtdcMaxMarginSideAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDAClientTypeTypeһʲͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CACT_Person '0' +/// +#define THOST_FTDC_CACT_Company '1' +/// +#define THOST_FTDC_CACT_Other '2' + +typedef char TThostFtdcDAClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinInstrIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombinInstrIDType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinSettlePriceTypeһȽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombinSettlePriceType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDCEPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDCEPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeGroupIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradeGroupIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsCheckPrepaTypeһǷУ鿪ʽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcIsCheckPrepaType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAAssetmgrTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_UOAAT_Futures '1' +///ۺ +#define THOST_FTDC_UOAAT_SpecialOrgan '2' + +typedef char TThostFtdcUOAAssetmgrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Buy +#define THOST_FTDC_DEN_Buy '0' +///Sell +#define THOST_FTDC_DEN_Sell '1' + +typedef char TThostFtdcDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagEnTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +///Position Opening +#define THOST_FTDC_OFEN_Open '0' +///Position Close +#define THOST_FTDC_OFEN_Close '1' +///Forced Liquidation +#define THOST_FTDC_OFEN_ForceClose '2' +///Close Today +#define THOST_FTDC_OFEN_CloseToday '3' +///Close Prev. +#define THOST_FTDC_OFEN_CloseYesterday '4' +///Forced Reduction +#define THOST_FTDC_OFEN_ForceOff '5' +///Local Forced Liquidation +#define THOST_FTDC_OFEN_LocalForceClose '6' + +typedef char TThostFtdcOffsetFlagEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagEnTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Speculation +#define THOST_FTDC_HFEN_Speculation '1' +///Arbitrage +#define THOST_FTDC_HFEN_Arbitrage '2' +///Hedge +#define THOST_FTDC_HFEN_Hedge '3' + +typedef char TThostFtdcHedgeFlagEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Deposit/Withdrawal +#define THOST_FTDC_FIOTEN_FundIO '1' +///Bank-Futures Transfer +#define THOST_FTDC_FIOTEN_Transfer '2' +///Bank-Futures FX Exchange +#define THOST_FTDC_FIOTEN_SwapCurrency '3' + +typedef char TThostFtdcFundIOTypeEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeEnTypeһʽ +///////////////////////////////////////////////////////////////////////// +///Bank Deposit +#define THOST_FTDC_FTEN_Deposite '1' +///Payment/Fee +#define THOST_FTDC_FTEN_ItemFund '2' +///Brokerage Adj +#define THOST_FTDC_FTEN_Company '3' +///Internal Transfer +#define THOST_FTDC_FTEN_InnerTransfer '4' + +typedef char TThostFtdcFundTypeEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Deposit +#define THOST_FTDC_FDEN_In '1' +///Withdrawal +#define THOST_FTDC_FDEN_Out '2' + +typedef char TThostFtdcFundDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortDirectionEnTypeһѺ +///////////////////////////////////////////////////////////////////////// +///Pledge +#define THOST_FTDC_FMDEN_In '1' +///Redemption +#define THOST_FTDC_FMDEN_Out '2' + +typedef char TThostFtdcFundMortDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSwapBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSwapBusinessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionsTypeTypeһȨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CP_CallOptions '1' +/// +#define THOST_FTDC_CP_PutOptions '2' + +typedef char TThostFtdcOptionsTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeModeTypeһִзʽ +///////////////////////////////////////////////////////////////////////// +///ŷʽ +#define THOST_FTDC_STM_Continental '0' +///ʽ +#define THOST_FTDC_STM_American '1' +///Ľ +#define THOST_FTDC_STM_Bermuda '2' + +typedef char TThostFtdcStrikeModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeTypeTypeһȨ +///////////////////////////////////////////////////////////////////////// +///Ȩִ +#define THOST_FTDC_STT_Strike '0' +///Ȩ +#define THOST_FTDC_STT_GiveUp '1' + +typedef char TThostFtdcStrikeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyTypeTypeһнȨִ +///////////////////////////////////////////////////////////////////////// +///ִ +#define THOST_FTDC_APPT_NotStrikeNum '4' + +typedef char TThostFtdcApplyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGiveUpDataSourceTypeһִԴ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define THOST_FTDC_GUDS_Gen '0' +///ֹ +#define THOST_FTDC_GUDS_Hand '1' + +typedef char TThostFtdcGiveUpDataSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderSysIDTypeһִϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExecOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecResultTypeһִн +///////////////////////////////////////////////////////////////////////// +///ûִ +#define THOST_FTDC_OER_NoExec 'n' +///Ѿȡ +#define THOST_FTDC_OER_Canceled 'c' +///ִгɹ +#define THOST_FTDC_OER_OK '0' +///Ȩֲֲ +#define THOST_FTDC_OER_NoPosition '1' +///ʽ𲻹 +#define THOST_FTDC_OER_NoDeposit '2' +///Ա +#define THOST_FTDC_OER_NoParticipant '3' +///ͻ +#define THOST_FTDC_OER_NoClient '4' +///Լ +#define THOST_FTDC_OER_NoInstrument '6' +///ûִȨ +#define THOST_FTDC_OER_NoRight '7' +/// +#define THOST_FTDC_OER_InvalidVolume '8' +///û㹻ʷɽ +#define THOST_FTDC_OER_NoEnoughHistoryTrade '9' +///δ֪ +#define THOST_FTDC_OER_Unknown 'a' + +typedef char TThostFtdcExecResultType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeSequenceTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcStrikeSequenceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeTimeTypeһִʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcStrikeTimeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosChangeTypeTypeһֱֲ䶯 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPosChangeTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosDirectionTypeһֲַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPosDirectionType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosChangeNumTypeһֱֲ䶯 +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcPosChangeNumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDelivTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDelivTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDelivModeTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDelivModeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionChangeTypeTypeһֱֲ䶯 +///////////////////////////////////////////////////////////////////////// +///Ȩִ +#define THOST_FTDC_PCT_OptionStrike '1' +///ֲֶԳ +#define THOST_FTDC_PCT_PositionHedge '2' +///ת뽻 +#define THOST_FTDC_PCT_SwitchToDeliv '3' +///Ʋ +#define THOST_FTDC_PCT_TransferPos '4' + +typedef char TThostFtdcPositionChangeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPctDelivTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ת +#define THOST_FTDC_PCTDT_FutureToSpot '0' +///ڽ +#define THOST_FTDC_PCTDT_ExpireToDeliv '1' + +typedef char TThostFtdcPctDelivTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPctDelivModeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ֽ𽻸 +#define THOST_FTDC_PCTDM_Cash '0' +///ʵサ +#define THOST_FTDC_PCTDM_Physical '1' + +typedef char TThostFtdcPctDelivModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinationTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_COMBT_Future '0' +///ֱ۲BUL +#define THOST_FTDC_COMBT_BUL '1' +///ֱ۲BER +#define THOST_FTDC_COMBT_BER '2' +///ʽ +#define THOST_FTDC_COMBT_STD '3' +///ʽ +#define THOST_FTDC_COMBT_STG '4' +/// +#define THOST_FTDC_COMBT_PRT '5' +///ʱ۲ +#define THOST_FTDC_COMBT_CLD '6' + +typedef char TThostFtdcCombinationTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionRoyaltyPriceTypeTypeһȨȨ۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ORPT_PreSettlementPrice '1' +///ּ +#define THOST_FTDC_ORPT_OpenPrice '4' + +typedef char TThostFtdcOptionRoyaltyPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBalanceAlgorithmTypeһȨ㷨 +///////////////////////////////////////////////////////////////////////// +///Ȩֵӯ +#define THOST_FTDC_BLAG_Default '1' +///Ȩֵ +#define THOST_FTDC_BLAG_IncludeOptValLost '2' + +typedef char TThostFtdcBalanceAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionTypeTypeһִ +///////////////////////////////////////////////////////////////////////// +///ִ +#define THOST_FTDC_ACTP_Exec '1' +/// +#define THOST_FTDC_ACTP_Abandon '2' + +typedef char TThostFtdcActionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForQuoteStatusTypeһѯ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_FQST_Submitted 'a' +///Ѿ +#define THOST_FTDC_FQST_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_FQST_Rejected 'c' + +typedef char TThostFtdcForQuoteStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuotStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_QTST_Unknown 'a' +///Ѿ +#define THOST_FTDC_QTST_Accepted 'b' +///Ѿ +#define THOST_FTDC_QTST_Canceled 'c' + +typedef char TThostFtdcQuotStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcValueMethodTypeһȡֵʽ +///////////////////////////////////////////////////////////////////////// +///ֵ +#define THOST_FTDC_VM_Absolute '0' +/// +#define THOST_FTDC_VM_Ratio '1' + +typedef char TThostFtdcValueMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderPositionFlagTypeһȨȨǷڻͷı +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EOPF_Reserve '0' +/// +#define THOST_FTDC_EOPF_UnReserve '1' + +typedef char TThostFtdcExecOrderPositionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderCloseFlagTypeһȨȨɵͷǷԶƽ +///////////////////////////////////////////////////////////////////////// +///Զƽ +#define THOST_FTDC_EOCF_AutoClose '0' +///Զƽ +#define THOST_FTDC_EOCF_NotToClose '1' + +typedef char TThostFtdcExecOrderCloseFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductTypeTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_PTE_Futures '1' +///Ȩ +#define THOST_FTDC_PTE_Options '2' + +typedef char TThostFtdcProductTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCZCEUploadFileNameTypeһ֣ļ +///////////////////////////////////////////////////////////////////////// +///^\d{8}_zz_\d{4} +#define THOST_FTDC_CUFN_CUFN_O 'O' +///^\d{8}ɽ +#define THOST_FTDC_CUFN_CUFN_T 'T' +///^\d{8}ȳֱֲnew +#define THOST_FTDC_CUFN_CUFN_P 'P' +///^\d{8}ƽ˽ +#define THOST_FTDC_CUFN_CUFN_N 'N' +///^\d{8}ƽֱ +#define THOST_FTDC_CUFN_CUFN_L 'L' +///^\d{8}ʽ +#define THOST_FTDC_CUFN_CUFN_F 'F' +///^\d{8}ϳֱֲ +#define THOST_FTDC_CUFN_CUFN_C 'C' +///^\d{8}֤ +#define THOST_FTDC_CUFN_CUFN_M 'M' + +typedef char TThostFtdcCZCEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDCEUploadFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +///^\d{8}_dl_\d{3} +#define THOST_FTDC_DUFN_DUFN_O 'O' +///^\d{8}_ɽ +#define THOST_FTDC_DUFN_DUFN_T 'T' +///^\d{8}_ֱֲ +#define THOST_FTDC_DUFN_DUFN_P 'P' +///^\d{8}_ʽ +#define THOST_FTDC_DUFN_DUFN_F 'F' +///^\d{8}_Żϳֲϸ +#define THOST_FTDC_DUFN_DUFN_C 'C' +///^\d{8}_ֲϸ +#define THOST_FTDC_DUFN_DUFN_D 'D' +///^\d{8}_֤ +#define THOST_FTDC_DUFN_DUFN_M 'M' +///^\d{8}_Ȩִб +#define THOST_FTDC_DUFN_DUFN_S 'S' + +typedef char TThostFtdcDCEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEUploadFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +///^\d{4}_\d{8}_\d{8}_\d{8}_DailyFundChg_CNY +#define THOST_FTDC_SUFN_SUFN_O 'O' +///^\d{4}_\d{8}_\d{8}_\d{8}_Trade_CNY +#define THOST_FTDC_SUFN_SUFN_T 'T' +///^\d{4}_\d{8}_\d{8}_\d{8}_SettlementDetail_CNY +#define THOST_FTDC_SUFN_SUFN_P 'P' +///^\d{4}_\d{8}_\d{8}_\d{8}_Capital_CNY +#define THOST_FTDC_SUFN_SUFN_F 'F' + +typedef char TThostFtdcSHFEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFFEXUploadFileNameTypeһнļ +///////////////////////////////////////////////////////////////////////// +///^\d{4}_SG\d{1}_\d{8}_\d{1}_Trade +#define THOST_FTDC_CFUFN_SUFN_T 'T' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_SettlementDetail +#define THOST_FTDC_CFUFN_SUFN_P 'P' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_Capital +#define THOST_FTDC_CFUFN_SUFN_F 'F' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_OptionExec +#define THOST_FTDC_CFUFN_SUFN_S 'S' + +typedef char TThostFtdcCFFEXUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderRefTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExecOrderRefType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderLocalidTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExecOrderLocalidType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerExecOrderseqTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBrokerExecOrderseqType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerFlagTypeһ͹˾״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_BF_InActive '0' +///Ծ +#define THOST_FTDC_BF_Active '1' + +typedef char TThostFtdcBrokerFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommodityIDTypeһƷִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommodityIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommodityNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommodityNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentFlagTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_INF_Normal '1' + +typedef char TThostFtdcInstrumentFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorFlagTypeһͶ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IVF_Normal '1' + +typedef char TThostFtdcInvestorFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorporateClassifyTypeһ˿ͻ +///////////////////////////////////////////////////////////////////////// +///ҵ +#define THOST_FTDC_CC_Company '1' + +typedef char TThostFtdcCorporateClassifyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleEntityIDTypeһʵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettleEntityIDType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleEntityTypeTypeһʵ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_SET_Investor 'a' + +typedef char TThostFtdcSettleEntityTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsAllowedTypeһǷ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IA_NotAllowed '0' +/// +#define THOST_FTDC_IA_Allowed '1' + +typedef char TThostFtdcIsAllowedType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///һ +#define THOST_FTDC_L_One '1' +/// +#define THOST_FTDC_L_Two '2' + +typedef char TThostFtdcLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSecurityVarietiyIDTypeһм֤ȯƷִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSecurityVarietiyIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSecurityVarietiyNameTypeһм֤ȯƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSecurityVarietiyNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetNameTypeһֵλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOffsetNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessTypeNameTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessTypeNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransactionNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTransactionNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperateTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +///ղ +#define THOST_FTDC_OPTY_None '0' +/// +#define THOST_FTDC_OPTY_Add '1' +///޸ +#define THOST_FTDC_OPTY_Update '2' +///ɾ +#define THOST_FTDC_OPTY_Delete '3' + +typedef char TThostFtdcOperateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperateNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcOperateNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcShortMemoTypeһע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcShortMemoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperationStatusTypeһ״ֶ̬ +///////////////////////////////////////////////////////////////////////// +///δı +#define THOST_FTDC_OPS_UnChange '0' +/// +#define THOST_FTDC_OPS_Add '1' +///޸ +#define THOST_FTDC_OPS_Modify '2' +///ɾ +#define THOST_FTDC_OPS_Delete '3' + +typedef char TThostFtdcOperationStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDelivFeeClassTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_DFO_Exchange '1' +///Ͷ߽ +#define THOST_FTDC_DFO_Investor '2' + +typedef char TThostFtdcDelivFeeClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderRefTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExecOrderRefType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderLocalidTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExecOrderLocalidType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerExecOrderseqTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBrokerExecOrderseqType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMaxMarginProductGroupIdTypeһ߲Ʒ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMaxMarginProductGroupIdType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountRangeTypeһʽ˺ŷΧ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AR_All '1' +///һʽ˺ +#define THOST_FTDC_AR_Single '3' + +typedef char TThostFtdcAccountRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAppConnectStatusTypeһ̻״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_ACS_NotConnected '1' +///Ѿ½׺ +#define THOST_FTDC_ACS_Logged '2' +///Ѿӽ +#define THOST_FTDC_ACS_ExgConnected '3' +///Ѿ½ +#define THOST_FTDC_ACS_ExgLogged '4' + +typedef char TThostFtdcAppConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRemarkTypeһע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRemarkType[37]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeApiStatusTypeһApi״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_EAS_NotConnected '1' +///Ѿӽ +#define THOST_FTDC_EAS_ExgConnected '2' +///Ѿ½ +#define THOST_FTDC_EAS_ExgLogged '3' +///ѾѯԼ +#define THOST_FTDC_EAS_QryInstrumentSent '4' +///ѾȡϢ +#define THOST_FTDC_EAS_GotInformation '5' +/// +#define THOST_FTDC_EAS_SubTopic '6' + +typedef char TThostFtdcExchangeApiStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDisplayFactorTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcDisplayFactorType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFractionTypeTypeһ۹ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFractionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderReturnTypeTypeһر +///////////////////////////////////////////////////////////////////////// +///ر +#define THOST_FTDC_ODRTNT_RtnOrder '0' +///ر +#define THOST_FTDC_ODRTNT_RtnCancel '1' +///ĵر +#define THOST_FTDC_ODRTNT_RtnModify '2' + +typedef char TThostFtdcOrderReturnTypeType; + +#endif diff --git a/include/CTP_INTER/ThostFtdcUserApiStruct.h b/include/CTP_INTER/ThostFtdcUserApiStruct.h new file mode 100644 index 0000000..ac07f60 --- /dev/null +++ b/include/CTP_INTER/ThostFtdcUserApiStruct.h @@ -0,0 +1,8076 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcUserApiStruct.h +///@brief ˿ͻ˽ӿʹõҵݽṹ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCSTRUCT_H) +#define THOST_FTDCSTRUCT_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiDataType.h" + +///Ϣַ +struct CThostFtdcDisseminationField +{ + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///к + TThostFtdcSequenceNoType SequenceNo; +}; + +///û¼ +struct CThostFtdcReqUserLoginField +{ + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///նIPַ + TThostFtdcIPAddressType ClientIPAddress; + /// + TThostFtdcLanguageTypeType Lang; + ///¼ע + TThostFtdcRemarkType Remark; +}; + +///û¼Ӧ +struct CThostFtdcRspUserLoginField +{ + /// + TThostFtdcDateType TradingDay; + ///¼ɹʱ + TThostFtdcTimeType LoginTime; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Դʱ + TThostFtdcTimeType INETime; + /// + TThostFtdcLanguageTypeType Lang; + ///֥Ӹҵ + TThostFtdcTimeType CMETime; +}; + +///ûdz +struct CThostFtdcUserLogoutField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ǿƽԱ˳ +struct CThostFtdcForceUserLogoutField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ͻ֤ +struct CThostFtdcReqAuthenticateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤ + TThostFtdcAuthCodeType AuthCode; +}; + +///ͻ֤Ӧ +struct CThostFtdcRspAuthenticateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; +}; + +///ͻ֤Ϣ +struct CThostFtdcAuthenticationInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤Ϣ + TThostFtdcAuthInfoType AuthInfo; + ///ǷΪ֤ + TThostFtdcBoolType IsResult; + /// + TThostFtdcLanguageTypeType Lang; +}; + +///תʱͷ +struct CThostFtdcTransferHeaderField +{ + ///汾ţ1.0 + TThostFtdcVersionType Version; + ///״룬 + TThostFtdcTradeCodeType TradeCode; + ///ڣʽyyyymmdd + TThostFtdcTradeDateType TradeDate; + ///ʱ䣬ʽhhmmss + TThostFtdcTradeTimeType TradeTime; + ///ˮţN/A + TThostFtdcTradeSerialType TradeSerial; + ///ڻ˾룬 + TThostFtdcFutureIDType FutureID; + ///д룬ݲѯеõ + TThostFtdcBankIDType BankID; + ///зĴ룬ݲѯеõ + TThostFtdcBankBrchIDType BankBrchID; + ///ԱN/A + TThostFtdcOperNoType OperNo; + ///豸ͣN/A + TThostFtdcDeviceIDType DeviceID; + ///¼N/A + TThostFtdcRecordNumType RecordNum; + ///ỰţN/A + TThostFtdcSessionIDType SessionID; + ///ţN/A + TThostFtdcRequestIDType RequestID; +}; + +///ʽתڻTradeCode=202001 +struct CThostFtdcTransferBankToFutureReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ʽתڻӦ +struct CThostFtdcTransferBankToFutureRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ڻʽתTradeCode=202002 +struct CThostFtdcTransferFutureToBankReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ڻʽתӦ +struct CThostFtdcTransferFutureToBankRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯʽTradeCode=204002 +struct CThostFtdcTransferQryBankReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯʽӦ +struct CThostFtdcTransferQryBankRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + /// + TThostFtdcMoneyType TradeAmt; + ///п + TThostFtdcMoneyType UseAmt; + ///пȡ + TThostFtdcMoneyType FetchAmt; + /// + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯнϸTradeCode=204999 +struct CThostFtdcTransferQryDetailReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; +}; + +///ѯнϸӦ +struct CThostFtdcTransferQryDetailRspField +{ + /// + TThostFtdcDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///ڻˮ + TThostFtdcTradeSerialNoType FutureSerial; + ///ڻ˾ + TThostFtdcFutureIDType FutureID; + ///ʽʺ + TThostFtdcFutureAccountType FutureAccount; + ///ˮ + TThostFtdcTradeSerialNoType BankSerial; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + ///˺ + TThostFtdcBankAccountType BankAccount; + ///֤ + TThostFtdcCertCodeType CertCode; + ///Ҵ + TThostFtdcCurrencyIDType CurrencyID; + /// + TThostFtdcMoneyType TxAmount; + ///Ч־ + TThostFtdcTransferValidFlagType Flag; +}; + +///ӦϢ +struct CThostFtdcRspInfoField +{ + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CThostFtdcExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcExchangeNameType ExchangeName; + /// + TThostFtdcExchangePropertyType ExchangeProperty; +}; + +///Ʒ +struct CThostFtdcProductField +{ + ///Ʒִ + TThostFtdcProductIDType ProductID; + ///Ʒ + TThostFtdcProductNameType ProductName; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceTickType PriceTick; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///ֲ + TThostFtdcPositionModeType PositionMode; + ///ֲ + TThostFtdcPositionDateModeType PositionDateMode; + ///ƽִ + TThostFtdcCloseDealTypeType CloseDealType; + ///ױ + TThostFtdcCurrencyIDType TradeCurrencyID; + ///Ѻʽ÷Χ + TThostFtdcMortgageFundUseRangeType MortgageFundUseRange; + ///Ʒ + TThostFtdcProductIDType ExchangeProductID; + ///Ʒ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; + ///г + TThostFtdcSubExchangeIDType SubExchangeID; + ///ֵλ + TThostFtdcCurrencyUnitType ExchangeCurrencyUnit; +}; + +///Լ +struct CThostFtdcInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentNameType InstrumentName; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒִ + TThostFtdcProductIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcYearType DeliveryYear; + /// + TThostFtdcMonthType DeliveryMonth; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceTickType PriceTick; + /// + TThostFtdcDateType CreateDate; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcDateType ExpireDate; + ///ʼ + TThostFtdcDateType StartDelivDate; + /// + TThostFtdcDateType EndDelivDate; + ///Լ״̬ + TThostFtdcInstLifePhaseType InstLifePhase; + ///ǰǷ + TThostFtdcBoolType IsTrading; + ///ֲ + TThostFtdcPositionModeType PositionMode; + ///ֲ + TThostFtdcPositionDateModeType PositionDateMode; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatio; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatio; + ///֤߱㷨 + TThostFtdcMaxMarginSideAlgorithmType MaxMarginSideAlgorithm; + ///Ʒ + TThostFtdcInstrumentIDType UnderlyingInstrID; + ///ִм + TThostFtdcPriceType StrikePrice; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + ///Ʒ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; + /// + TThostFtdcCombinationTypeType CombinationType; + ///г + TThostFtdcSubExchangeIDType SubExchangeID; + ///۸ + TThostFtdcDisplayFactorType DisplayFactor; + ///۹1 + TThostFtdcFractionTypeType MainFraction; + ///۹2 + TThostFtdcFractionTypeType SubFraction; +}; + +///͹˾ +struct CThostFtdcBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ + TThostFtdcBrokerAbbrType BrokerAbbr; + ///͹˾ + TThostFtdcBrokerNameType BrokerName; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///Ա +struct CThostFtdcTraderField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///ʹõ + TThostFtdcSubjectIDType SubjectID; + ///IPƷΧ + TThostFtdcIPAddressType IpRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///Ͷ +struct CThostFtdcInvestorField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcDateType OpenDate; + ///ֻ + TThostFtdcMobileType Mobile; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ױ +struct CThostFtdcTradingCodeField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ױ + TThostFtdcClientIDModeType ClientIDMode; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///Ա;͹˾ձ +struct CThostFtdcPartBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///͹˾ + TThostFtdcPartTypeType ParticipantType; +}; + +///û +struct CThostFtdcSuperUserField +{ + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + /// + TThostFtdcPasswordType Password; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///ûȨ +struct CThostFtdcSuperUserFunctionField +{ + ///û + TThostFtdcUserIDType UserID; + ///ܴ + TThostFtdcFunctionCodeType FunctionCode; +}; + +///Ͷ +struct CThostFtdcInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TThostFtdcInvestorGroupNameType InvestorGroupName; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ϴѺ + TThostFtdcMoneyType PreMortgage; + ///ϴö + TThostFtdcMoneyType PreCredit; + ///ϴδ + TThostFtdcMoneyType PreDeposit; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///Ϣ + TThostFtdcMoneyType InterestBase; + ///Ϣ + TThostFtdcMoneyType Interest; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + ///ʽ + TThostFtdcMoneyType Available; + ///ȡʽ + TThostFtdcMoneyType WithdrawQuota; + ///׼ + TThostFtdcMoneyType Reserve; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ö + TThostFtdcMoneyType Credit; + ///Ѻ + TThostFtdcMoneyType Mortgage; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TThostFtdcMoneyType DeliveryMargin; + ///֤ + TThostFtdcMoneyType ExchangeDeliveryMargin; + ///ڻ׼ + TThostFtdcMoneyType ReserveBalance; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ϴλ + TThostFtdcMoneyType PreFundMortgageIn; + ///ϴλʳ + TThostFtdcMoneyType PreFundMortgageOut; + /// + TThostFtdcMoneyType FundMortgageIn; + ///ʳ + TThostFtdcMoneyType FundMortgageOut; + ///Ѻ + TThostFtdcMoneyType FundMortgageAvailable; + ///Ѻҽ + TThostFtdcMoneyType MortgageableFund; + ///Ʒռñ֤ + TThostFtdcMoneyType SpecProductMargin; + ///Ʒᱣ֤ + TThostFtdcMoneyType SpecProductFrozenMargin; + ///Ʒ + TThostFtdcMoneyType SpecProductCommission; + ///Ʒ + TThostFtdcMoneyType SpecProductFrozenCommission; + ///Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfit; + ///Ʒƽӯ + TThostFtdcMoneyType SpecProductCloseProfit; + ///ݳֲӯ㷨Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfitByAlg; + ///Ʒ֤ + TThostFtdcMoneyType SpecProductExchangeMargin; + /// + TThostFtdcCurrencyNameType CurrencyName; + ///άֱ֤ + TThostFtdcMoneyType MaintenMargin; + ///άֱ֤ + TThostFtdcMoneyType ExchangeMaintenMargin; +}; + +///Ͷֲ߳ +struct CThostFtdcInvestorPositionField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcPositionDateType PositionDate; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ǰֲ + TThostFtdcVolumeType Position; + ///ͷ + TThostFtdcVolumeType LongFrozen; + ///ͷ + TThostFtdcVolumeType ShortFrozen; + ///ͷ + TThostFtdcMoneyType LongFrozenAmount; + ///ͷ + TThostFtdcMoneyType ShortFrozenAmount; + /// + TThostFtdcVolumeType OpenVolume; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ֽ + TThostFtdcMoneyType OpenAmount; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ֲֳɱ + TThostFtdcMoneyType PositionCost; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ֳɱ + TThostFtdcMoneyType OpenCost; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TThostFtdcVolumeType CombPosition; + ///϶ͷ + TThostFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TThostFtdcVolumeType CombShortFrozen; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TThostFtdcVolumeType TodayPosition; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ִж + TThostFtdcVolumeType StrikeFrozen; + ///ִж + TThostFtdcMoneyType StrikeFrozenAmount; + ///ִж + TThostFtdcVolumeType AbandonFrozen; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ױ + TThostFtdcClientIDType ClientID; + ///άֱ֤ + TThostFtdcMoneyType MaintenMargin; + ///άֱ֤ + TThostFtdcMoneyType ExchMaintenMargin; +}; + +///Լ֤ +struct CThostFtdcInstrumentMarginRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ͷάֱ֤ + TThostFtdcRatioType LMaintenMarginRatioByMoney; + ///ͷάֱ֤ + TThostFtdcMoneyType LMaintenMarginRatioByVolume; + ///ͷάֱ֤ + TThostFtdcRatioType SMaintenMarginRatioByMoney; + ///ͷάֱ֤ + TThostFtdcMoneyType SMaintenMarginRatioByVolume; +}; + +///Լ +struct CThostFtdcInstrumentCommissionRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +/// +struct CThostFtdcDepthMarketDataField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; + ///վ + TThostFtdcPriceType AveragePrice; + ///ҵ + TThostFtdcDateType ActionDay; + /// + TThostFtdcPriceType BidPrice6; + /// + TThostFtdcVolumeType BidVolume6; + /// + TThostFtdcPriceType AskPrice6; + /// + TThostFtdcVolumeType AskVolume6; + /// + TThostFtdcPriceType BidPrice7; + /// + TThostFtdcVolumeType BidVolume7; + /// + TThostFtdcPriceType AskPrice7; + /// + TThostFtdcVolumeType AskVolume7; + ///۰ + TThostFtdcPriceType BidPrice8; + /// + TThostFtdcVolumeType BidVolume8; + ///۰ + TThostFtdcPriceType AskPrice8; + /// + TThostFtdcVolumeType AskVolume8; + ///۾ + TThostFtdcPriceType BidPrice9; + /// + TThostFtdcVolumeType BidVolume9; + ///۾ + TThostFtdcPriceType AskPrice9; + /// + TThostFtdcVolumeType AskVolume9; + ///ʮ + TThostFtdcPriceType BidPrice10; + ///ʮ + TThostFtdcVolumeType BidVolume10; + ///ʮ + TThostFtdcPriceType AskPrice10; + ///ʮ + TThostFtdcVolumeType AskVolume10; +}; + +///ͶߺԼȨ +struct CThostFtdcInstrumentTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///͹˾û +struct CThostFtdcBrokerUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + ///û + TThostFtdcUserTypeType UserType; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///Ƿʹ + TThostFtdcBoolType IsUsingOTP; +}; + +///͹˾û +struct CThostFtdcBrokerUserPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; +}; + +///͹˾ûȨ +struct CThostFtdcBrokerUserFunctionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///͹˾ܴ + TThostFtdcBrokerFunctionCodeType BrokerFunctionCode; +}; + +///ͶʵԪ +struct CThostFtdcInvestUnitField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ͶʵԪ + TThostFtdcPartyNameType InvestUnitName; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; + ///ͶʵԪĬʽʺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///Ա̻ +struct CThostFtdcTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///Ӧ + TThostFtdcAppNameType AppName; + ///б + TThostFtdcRunIDType RunID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///IPƷΧ + TThostFtdcIPAddressType IpRange; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ + TThostFtdcPartTypeType ParticipantType; +}; + +///Ͷ߽ +struct CThostFtdcInvestorSettlementInfoField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType Content; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///֤ +struct CThostFtdcExchangeMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͷάֱ֤ + TThostFtdcRatioType LMaintenMarginRatioByMoney; + ///ͷάֱ֤ + TThostFtdcMoneyType LMaintenMarginRatioByVolume; + ///ͷάֱ֤ + TThostFtdcRatioType SMaintenMarginRatioByMoney; + ///ͷάֱ֤ + TThostFtdcMoneyType SMaintenMarginRatioByVolume; +}; + +/// +struct CThostFtdcExchangeRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Դֵλ + TThostFtdcCurrencyUnitType FromCurrencyUnit; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +/// +struct CThostFtdcSettlementRefField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; +}; + +///ǰʱ +struct CThostFtdcCurrentTimeField +{ + ///ǰ + TThostFtdcDateType CurrDate; + ///ǰʱ + TThostFtdcTimeType CurrTime; + ///ǰʱ䣨룩 + TThostFtdcMillisecType CurrMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +///ͨѶ׶ +struct CThostFtdcCommPhaseField +{ + /// + TThostFtdcDateType TradingDay; + ///ͨѶʱα + TThostFtdcCommPhaseNoType CommPhaseNo; + ///ϵͳ + TThostFtdcSystemIDType SystemID; +}; + +///¼Ϣ +struct CThostFtdcLoginInfoField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + /// + TThostFtdcPasswordType Password; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///Դʱ + TThostFtdcTimeType INETime; + /// + TThostFtdcLanguageTypeType Lang; + ///¼ע + TThostFtdcRemarkType Remark; +}; + +///¼Ϣ +struct CThostFtdcLogoutAllField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; +}; + +///û +struct CThostFtdcUserPasswordUpdateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; +}; + +///뱨 +struct CThostFtdcInputOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///־ + TThostFtdcBoolType IsSwapOrder; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; +}; + +/// +struct CThostFtdcOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ + TThostFtdcVolumeType ZCETotalTradedVolume; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +/// +struct CThostFtdcExchangeOrderField +{ + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ر + TThostFtdcOrderReturnTypeType OrderReturnType; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; +}; + +///ʧ +struct CThostFtdcExchangeOrderInsertErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///뱨 +struct CThostFtdcInputOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +/// +struct CThostFtdcOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +/// +struct CThostFtdcExchangeOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcDirectionType Direction; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcContingentConditionType ContingentCondition; +}; + +///ʧ +struct CThostFtdcExchangeOrderActionErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///ĵ۸ + TThostFtdcPriceType LimitPrice; + ///ĵ + TThostFtdcVolumeType VolumeChange; + ///ĵֹ۸ + TThostFtdcPriceType StopPrice; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcContingentConditionType ContingentCondition; +}; + +///ɽ +struct CThostFtdcExchangeTradeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ױ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; +}; + +///ɽ +struct CThostFtdcTradeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ױ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ɽԴ + TThostFtdcTradeSourceType TradeSource; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ûỰ +struct CThostFtdcUserSessionField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; + /// + TThostFtdcLanguageTypeType Lang; + ///û + TThostFtdcUserTypeType UserType; + ///Ƿѵ¼ + TThostFtdcBoolType IsLogin; + ///¼ע + TThostFtdcRemarkType Remark; +}; + +///ѯ󱨵 +struct CThostFtdcQueryMaxOrderVolumeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///Ͷ߽ȷϢ +struct CThostFtdcInvestorSettlementInfoConfirmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ȷ + TThostFtdcDateType ConfirmDate; + ///ȷʱ + TThostFtdcTimeType ConfirmTime; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ͬ +struct CThostFtdcSyncDepositField +{ + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcMoneyType Deposit; + ///Ƿǿƽ + TThostFtdcBoolType IsForce; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///Ѻͬ +struct CThostFtdcSyncFundMortgageField +{ + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դʺ + TThostFtdcAccountIDType SourceAccountID; + ///Ŀʺ + TThostFtdcAccountIDType TargetAccountID; + ///Դ + TThostFtdcCurrencyIDType SourceCurrencyID; + ///Ŀ + TThostFtdcCurrencyIDType TargetCurrencyID; + ///Ѻ + TThostFtdcMoneyType MortgageAmount; +}; + +///ѯ +struct CThostFtdcQryOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯɽ +struct CThostFtdcQryTradeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + ///ʼʱ + TThostFtdcTimeType TradeTimeStart; + ///ʱ + TThostFtdcTimeType TradeTimeEnd; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯͶֲ߳ +struct CThostFtdcQryInvestorPositionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯʽ˻ +struct CThostFtdcQryTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯͶ +struct CThostFtdcQryInvestorField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ѯױ +struct CThostFtdcQryTradingCodeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ױ + TThostFtdcClientIDModeType ClientIDMode; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯͶ +struct CThostFtdcQryInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯԼ֤ +struct CThostFtdcQryInstrumentMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯ +struct CThostFtdcQryInstrumentCommissionRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯԼȨ +struct CThostFtdcQryInstrumentTradingRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯ͹˾ +struct CThostFtdcQryBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯԱ +struct CThostFtdcQryTraderField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯûȨ +struct CThostFtdcQrySuperUserFunctionField +{ + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯûỰ +struct CThostFtdcQryUserSessionField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ͹˾Ա +struct CThostFtdcQryPartBrokerField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; +}; + +///ѯ +struct CThostFtdcQryExchangeOrderField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯ +struct CThostFtdcQryOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ѯ +struct CThostFtdcQryExchangeOrderActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ױ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯû +struct CThostFtdcQrySuperUserField +{ + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ +struct CThostFtdcQryExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯƷ +struct CThostFtdcQryProductField +{ + ///Ʒִ + TThostFtdcProductIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcExchangeIDType ExchangeID; + ///г + TThostFtdcSubExchangeIDType SubExchangeID; +}; + +///ѯԼ +struct CThostFtdcQryInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒִ + TThostFtdcProductIDType ProductID; + ///г + TThostFtdcSubExchangeIDType SubExchangeID; +}; + +///ѯ +struct CThostFtdcQryDepthMarketDataField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ͹˾û +struct CThostFtdcQryBrokerUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ͹˾ûȨ +struct CThostFtdcQryBrokerUserFunctionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯͶʵԪ +struct CThostFtdcQryInvestUnitField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯԱ̻ +struct CThostFtdcQryTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯˮ +struct CThostFtdcQrySyncDepositField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; +}; + +///ѯͶ߽ +struct CThostFtdcQryInvestorSettlementInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; +}; + +///ѯ֤ +struct CThostFtdcQryExchangeMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcQryExchangeRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; +}; + +///ѯѺˮ +struct CThostFtdcQrySyncFundMortgageField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; +}; + +///ǰȨԼС֤ +struct CThostFtdcOptionInstrMiniMarginField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///λ֣ȨԼС֤ + TThostFtdcMoneyType MinMargin; + ///ȡֵʽ + TThostFtdcValueMethodType ValueMethod; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ǰȨԼ֤ϵ +struct CThostFtdcOptionInstrMarginAdjustField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷͷ֤ϵ + TThostFtdcRatioType SShortMarginRatioByMoney; + ///Ͷͷ֤ϵ + TThostFtdcMoneyType SShortMarginRatioByVolume; + ///ֵͷ֤ϵ + TThostFtdcRatioType HShortMarginRatioByMoney; + ///ֵͷ֤ϵ + TThostFtdcMoneyType HShortMarginRatioByVolume; + ///ͷ֤ϵ + TThostFtdcRatioType AShortMarginRatioByMoney; + ///ͷ֤ϵ + TThostFtdcMoneyType AShortMarginRatioByVolume; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; + ///̿ͷ֤ϵ + TThostFtdcRatioType MShortMarginRatioByMoney; + ///̿ͷ֤ϵ + TThostFtdcMoneyType MShortMarginRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ǰȨԼѵϸ +struct CThostFtdcOptionInstrCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///Ȩ׳ɱ +struct CThostFtdcOptionInstrTradeCostField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType FixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType MiniMargin; + ///ȨԼȨ + TThostFtdcMoneyType Royalty; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType ExchFixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType ExchMiniMargin; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///Ȩ׳ɱѯ +struct CThostFtdcQryOptionInstrTradeCostField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ + TThostFtdcPriceType InputPrice; + ///ļ۸,0 + TThostFtdcPriceType UnderlyingPrice; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///Ȩʲѯ +struct CThostFtdcQryOptionInstrCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ָָֻ +struct CThostFtdcIndexPriceField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ָֻ̼ + TThostFtdcPriceType ClosePrice; +}; + +///ִ +struct CThostFtdcInputExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; +}; + +///ִ +struct CThostFtdcInputExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ִ +struct CThostFtdcExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerExecOrderSeq; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ִ +struct CThostFtdcExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ִѯ +struct CThostFtdcQryExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ִϢ +struct CThostFtdcExchangeExecOrderField +{ + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; +}; + +///ִѯ +struct CThostFtdcQryExchangeExecOrderField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ִѯ +struct CThostFtdcQryExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ִ +struct CThostFtdcExchangeExecOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; +}; + +///ִѯ +struct CThostFtdcQryExchangeExecOrderActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ִ +struct CThostFtdcErrExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯִ +struct CThostFtdcQryErrExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ִ +struct CThostFtdcErrExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯִ +struct CThostFtdcQryErrExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ͶȨԼȨ +struct CThostFtdcOptionInstrTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDirectionType Direction; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯȨԼȨ +struct CThostFtdcQryOptionInstrTradingRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯ +struct CThostFtdcInputForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯ +struct CThostFtdcForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ѯ۱ + TThostFtdcSequenceNoType BrokerForQutoSeq; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯ۲ѯ +struct CThostFtdcQryForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯϢ +struct CThostFtdcExchangeForQuoteField +{ + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯ۲ѯ +struct CThostFtdcQryExchangeForQuoteField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ı +struct CThostFtdcInputQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ױ + TThostFtdcClientIDType ClientID; +}; + +///뱨۲ +struct CThostFtdcInputQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ױ + TThostFtdcClientIDType ClientID; +}; + +/// +struct CThostFtdcQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾۱ + TThostFtdcSequenceNoType BrokerQuoteSeq; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///۲ +struct CThostFtdcQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///۲ѯ +struct CThostFtdcQryQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///Ϣ +struct CThostFtdcExchangeQuoteField +{ + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; +}; + +///۲ѯ +struct CThostFtdcQryExchangeQuoteField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///۲ѯ +struct CThostFtdcQryQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///۲ +struct CThostFtdcExchangeQuoteActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; +}; + +///۲ѯ +struct CThostFtdcQryExchangeQuoteActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ȨԼdeltaֵ +struct CThostFtdcOptionInstrDeltaField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Deltaֵ + TThostFtdcRatioType Delta; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///̵ѯ +struct CThostFtdcForQuoteRspField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///ѯʱ + TThostFtdcTimeType ForQuoteTime; + ///ҵ + TThostFtdcDateType ActionDay; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰȨԼִƫֵϸ +struct CThostFtdcStrikeOffsetField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִƫֵ + TThostFtdcMoneyType Offset; +}; + +///Ȩִƫֵѯ +struct CThostFtdcQryStrikeOffsetField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +/// +struct CThostFtdcInputBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///û + TThostFtdcUserIDType UserID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +/// +struct CThostFtdcBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +/// +struct CThostFtdcExchangeBatchOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯ +struct CThostFtdcQryBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ϺԼȫϵ +struct CThostFtdcCombInstrumentGuardField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcRatioType GuarantRatio; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ϺԼȫϵѯ +struct CThostFtdcQryCombInstrumentGuardField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +/// +struct CThostFtdcInputCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +/// +struct CThostFtdcCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ϲѯ +struct CThostFtdcQryCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///Ϣ +struct CThostFtdcExchangeCombActionField +{ + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; +}; + +///ϲѯ +struct CThostFtdcQryExchangeCombActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///Ʒۻ +struct CThostFtdcProductExchRateField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///۱ + TThostFtdcCurrencyIDType QuoteCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ʒۻʲѯ +struct CThostFtdcQryProductExchRateField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯѯۼ۲ +struct CThostFtdcQryForQuoteParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯۼ۲ +struct CThostFtdcForQuoteParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///¼ + TThostFtdcPriceType LastPrice; + ///۲ + TThostFtdcPriceType PriceInterval; +}; + +///ǰѵϸ +struct CThostFtdcOrderCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcRatioType OrderCommByVolume; + /// + TThostFtdcRatioType OrderActionCommByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ʲѯ +struct CThostFtdcQryOrderCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///г +struct CThostFtdcMarketDataField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +/// +struct CThostFtdcMarketDataBaseField +{ + /// + TThostFtdcDateType TradingDay; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + ///ʵ + TThostFtdcRatioType PreDelta; +}; + +///龲̬ +struct CThostFtdcMarketDataStaticField +{ + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcPriceType ClosePrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ʵ + TThostFtdcRatioType CurrDelta; +}; + +///³ɽ +struct CThostFtdcMarketDataLastMatchField +{ + ///¼ + TThostFtdcPriceType LastPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; +}; + +///ż +struct CThostFtdcMarketDataBestPriceField +{ + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; +}; + +/// +struct CThostFtdcMarketDataBid23Field +{ + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; +}; + +/// +struct CThostFtdcMarketDataAsk23Field +{ + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; +}; + +///ġ +struct CThostFtdcMarketDataBid45Field +{ + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; +}; + +///ġ +struct CThostFtdcMarketDataAsk45Field +{ + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; +}; + +///ʱ +struct CThostFtdcMarketDataUpdateTimeField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +/// +struct CThostFtdcMarketDataBid67Field +{ + /// + TThostFtdcPriceType BidPrice6; + /// + TThostFtdcVolumeType BidVolume6; + /// + TThostFtdcPriceType BidPrice7; + /// + TThostFtdcVolumeType BidVolume7; +}; + +/// +struct CThostFtdcMarketDataAsk67Field +{ + /// + TThostFtdcPriceType AskPrice6; + /// + TThostFtdcVolumeType AskVolume6; + /// + TThostFtdcPriceType AskPrice7; + /// + TThostFtdcVolumeType AskVolume7; +}; + +///ˡ +struct CThostFtdcMarketDataBid89Field +{ + ///۰ + TThostFtdcPriceType BidPrice8; + /// + TThostFtdcVolumeType BidVolume8; + ///۾ + TThostFtdcPriceType BidPrice9; + /// + TThostFtdcVolumeType BidVolume9; +}; + +///ˡ +struct CThostFtdcMarketDataAsk89Field +{ + ///۰ + TThostFtdcPriceType AskPrice8; + /// + TThostFtdcVolumeType AskVolume8; + ///۾ + TThostFtdcPriceType AskPrice9; + /// + TThostFtdcVolumeType AskVolume9; +}; + +///ʮ +struct CThostFtdcMarketData10Field +{ + ///ʮ + TThostFtdcPriceType AskPrice10; + ///ʮ + TThostFtdcVolumeType AskVolume10; + ///ʮ + TThostFtdcPriceType BidPrice10; + ///ʮ + TThostFtdcVolumeType BidVolume10; +}; + +///齻 +struct CThostFtdcMarketDataExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָĺԼ +struct CThostFtdcSpecificInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Լ״̬ +struct CThostFtdcInstrumentStatusField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcSettlementGroupIDType SettlementGroupID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Լ״̬ + TThostFtdcInstrumentStatusType InstrumentStatus; + ///׽׶α + TThostFtdcTradingSegmentSNType TradingSegmentSN; + ///뱾״̬ʱ + TThostFtdcTimeType EnterTime; + ///뱾״̬ԭ + TThostFtdcInstStatusEnterReasonType EnterReason; + ///뱾״̬ + TThostFtdcDateType EnterDate; +}; + +///ѯԼ״̬ +struct CThostFtdcQryInstrumentStatusField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; +}; + +///ӯ㷨 +struct CThostFtdcPositionProfitAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///ע + TThostFtdcMemoType Memo; +}; + +///ѯת +struct CThostFtdcQryTransferBankField +{ + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; +}; + +///ת +struct CThostFtdcTransferBankField +{ + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///ѯͶֲ߳ϸ +struct CThostFtdcQryInvestorPositionDetailField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///Ͷֲ߳ϸ +struct CThostFtdcInvestorPositionDetailField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcDateType OpenDate; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcVolumeType Volume; + ///ּ + TThostFtdcPriceType OpenPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///նгֲӯ + TThostFtdcMoneyType PositionProfitByDate; + ///ʶԳֲӯ + TThostFtdcMoneyType PositionProfitByTrade; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + /// + TThostFtdcPriceType LastSettlementPrice; + /// + TThostFtdcPriceType SettlementPrice; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ױ + TThostFtdcClientIDType ClientID; + ///Ͷάֱ֤ + TThostFtdcMoneyType MaintenMargin; + ///άֱ֤ + TThostFtdcMoneyType ExchMaintenMargin; + ///άֱ֤ + TThostFtdcRatioType MaintenMarginRateByMoney; + ///άֱ֤() + TThostFtdcRatioType MaintenMarginRateByVolume; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + /// + TThostFtdcPasswordType Password; +}; + +///鱨̻ +struct CThostFtdcMDTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///Ӧ + TThostFtdcAppNameType AppName; + ///б + TThostFtdcRunIDType RunID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///IPƷΧ + TThostFtdcIPAddressType IpRange; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ + TThostFtdcPartTypeType ParticipantType; +}; + +///ѯ鱨̻ +struct CThostFtdcQryMDTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯͻ֪ͨ +struct CThostFtdcQryNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ͻ֪ͨ +struct CThostFtdcNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ϣ + TThostFtdcContentType Content; + ///к + TThostFtdcSequenceLabelType SequenceLabel; +}; + +///ûȨ +struct CThostFtdcUserRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ͻȨ + TThostFtdcUserRightTypeType UserRightType; + ///Ƿֹ + TThostFtdcBoolType IsForbidden; +}; + +///ѯϢȷ +struct CThostFtdcQryInvestorSettlementInfoConfirmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///͹˾ʽ㷨 +struct CThostFtdcBrokerWithdrawAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ʽ㷨 + TThostFtdcAlgorithmType WithdrawAlgorithm; + ///ʽʹ + TThostFtdcRatioType UsingRatio; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType IncludeCloseProfit; + ///޲޳ɽͻǷܿ + TThostFtdcAllWithoutTradeType AllWithoutTrade; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; + ///Ȩ㷨 + TThostFtdcBalanceAlgorithmType BalanceAlgorithm; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordUpdateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯϺԼ +struct CThostFtdcQryCombinationLegField +{ + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯͬ״̬ +struct CThostFtdcQrySyncStatusField +{ + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͻ׺Լĵ +struct CThostFtdcCombinationLegField +{ + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + /// + TThostFtdcImplyLevelType ImplyLevel; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ͬ״̬ +struct CThostFtdcSyncStatusField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///к + TThostFtdcSequenceNoType SettlementNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͬ״̬ + TThostFtdcDataSyncStatusType DataSyncStatus; +}; + +///ѯϵ +struct CThostFtdcQryLinkManField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ϵ +struct CThostFtdcLinkManField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵ + TThostFtdcPersonTypeType PersonType; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + /// + TThostFtdcPartyNameType PersonName; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcZipCodeType ZipCode; + ///ȼ + TThostFtdcPriorityType Priority; + /// + TThostFtdcUOAZipCodeType UOAZipCode; + ///ȫ + TThostFtdcInvestorFullNameType PersonFullName; +}; + +///ѯ͹˾û¼ +struct CThostFtdcQryBrokerUserEventField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; +}; + +///ѯ͹˾û¼ +struct CThostFtdcBrokerUserEventField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; + ///û¼ + TThostFtdcSequenceNoType EventSequenceNo; + ///¼ + TThostFtdcDateType EventDate; + ///¼ʱ + TThostFtdcTimeType EventTime; + ///û¼Ϣ + TThostFtdcUserEventInfoType UserEventInfo; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯǩԼ +struct CThostFtdcQryContractBankField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; +}; + +///ѯǩԼӦ +struct CThostFtdcContractBankField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; +}; + +///Ͷϳֲϸ +struct CThostFtdcInvestorPositionCombineDetailField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + ///ֲ + TThostFtdcVolumeType TotalAmt; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ɽ + TThostFtdcTradeGroupIDType TradeGroupID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ױ + TThostFtdcClientIDType ClientID; +}; + +///Ԥ +struct CThostFtdcPrePayOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ԥ񱨵 + TThostFtdcPrePayOrderIDType PrePayOrderID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ״̬ + TThostFtdcPrePayOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///Ԥ񵥲 +struct CThostFtdcPrePayOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ԥ񳷵 + TThostFtdcPrePayOrderIDType PrePayOrderActionID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ񳷵״̬ + TThostFtdcPrePayOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯԤ +struct CThostFtdcQryPrePayOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯԤ񳷵 +struct CThostFtdcQryPrePayOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ɾԤ +struct CThostFtdcRemovePrePayOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񱨵 + TThostFtdcPrePayOrderIDType PrePayOrderID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ɾԤ񳷵 +struct CThostFtdcRemovePrePayOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񳷵 + TThostFtdcPrePayOrderIDType PrePayOrderActionID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///͹˾ʽ㷨CTPһΪͶ߿ʽ +struct CThostFtdcAccountWithdrawAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ˻Χ + TThostFtdcAccountRangeType AccountRange; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ʽ + TThostFtdcRatioType UsingRatio; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; +}; + +///ѯϳֲϸ +struct CThostFtdcQryInvestorPositionCombineDetailField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ɽ +struct CThostFtdcMarketDataAveragePriceField +{ + ///վ + TThostFtdcPriceType AveragePrice; +}; + +///УͶ +struct CThostFtdcVerifyInvestorPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcPasswordType Password; +}; + +///ûIP +struct CThostFtdcUserIPField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///IPַ + TThostFtdcIPAddressType IPMask; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///û¼֪ͨϢ +struct CThostFtdcTradingNoticeInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʱ + TThostFtdcTimeType SendTime; + ///Ϣ + TThostFtdcContentType FieldContent; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///û¼֪ͨ +struct CThostFtdcTradingNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///û + TThostFtdcUserIDType UserID; + ///ʱ + TThostFtdcTimeType SendTime; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType FieldContent; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯ¼֪ͨ +struct CThostFtdcQryTradingNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯ󱨵 +struct CThostFtdcQryErrOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///󱨵 +struct CThostFtdcErrOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///У +struct CThostFtdcErrorConditionalOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ + TThostFtdcVolumeType ZCETotalTradedVolume; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯ󱨵 +struct CThostFtdcQryErrOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///󱨵 +struct CThostFtdcErrOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯ״̬ +struct CThostFtdcQryExchangeSequenceField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///״̬ +struct CThostFtdcExchangeSequenceField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Լ״̬ + TThostFtdcInstrumentStatusType MarketStatus; +}; + +///ݼ۸ѯ󱨵 +struct CThostFtdcQueryMaxOrderVolumeWithPriceField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯ͹˾ײ +struct CThostFtdcQryBrokerTradingParamsField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///͹˾ײ +struct CThostFtdcBrokerTradingParamsField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///֤۸ + TThostFtdcMarginPriceTypeType MarginPriceType; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ȨȨ۸ + TThostFtdcOptionRoyaltyPriceTypeType OptionRoyaltyPriceType; +}; + +///ѯ͹˾ʽ +struct CThostFtdcQueryBrokerDepositField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///͹˾ʽ +struct CThostFtdcBrokerDepositField +{ + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ʽ + TThostFtdcMoneyType Available; + ///׼ + TThostFtdcMoneyType Reserve; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; +}; + +///û̬Ʋ +struct CThostFtdcBrokerUserOTPParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ṩ + TThostFtdcOTPVendorsIDType OTPVendorsID; + ///̬к + TThostFtdcSerialNumberType SerialNumber; + ///Կ + TThostFtdcAuthKeyType AuthKey; + ///ϴOTPƯֵ + TThostFtdcLastDriftType LastDrift; + ///ϴOTPɹֵ + TThostFtdcLastSuccessType LastSuccess; + ///̬ + TThostFtdcOTPTypeType OTPType; +}; + +///ֹͬû̬ +struct CThostFtdcManualSyncBrokerUserOTPField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ + TThostFtdcOTPTypeType OTPType; + ///һ̬ + TThostFtdcPasswordType FirstOTP; + ///ڶ̬ + TThostFtdcPasswordType SecondOTP; +}; + +///Ͷģ +struct CThostFtdcCommRateModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///ģ + TThostFtdcCommModelNameType CommModelName; +}; + +///ѯͶģ +struct CThostFtdcQryCommRateModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; +}; + +///Ͷ֤߱ģ +struct CThostFtdcMarginModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; + ///ģ + TThostFtdcCommModelNameType MarginModelName; +}; + +///ѯͶ֤߱ģ +struct CThostFtdcQryMarginModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ֵ۵Ϣ +struct CThostFtdcEWarrantOffsetField +{ + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcVolumeType CloseVolume; +}; + +///ѯֵ۵Ϣ +struct CThostFtdcQryEWarrantOffsetField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ѯͶƷ/Ʒֱ֤ +struct CThostFtdcQryInvestorProductGroupMarginField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ͶƷ/Ʒֱ֤ +struct CThostFtdcInvestorProductGroupMarginField +{ + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType LongFrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType ShortFrozenMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ͷ֤ + TThostFtdcMoneyType LongUseMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortUseMargin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///ͷ֤ + TThostFtdcMoneyType LongExchMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortExchMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + /// + TThostFtdcMoneyType FrozenCommission; + /// + TThostFtdcMoneyType Commission; + ///ʽ + TThostFtdcMoneyType FrozenCash; + ///ʽ + TThostFtdcMoneyType CashIn; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///۵ܽ + TThostFtdcMoneyType OffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortOffsetAmount; + ///۵ܽ + TThostFtdcMoneyType ExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortExchOffsetAmount; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///άֱ֤ + TThostFtdcMoneyType MaintenMargin; + ///ͷάֱ֤ + TThostFtdcMoneyType LongMaintenMargin; + ///ͷάֱ֤ + TThostFtdcMoneyType ShortMaintenMargin; + ///άֱ֤ + TThostFtdcMoneyType ExchMaintenMargin; + ///ͷάֱ֤ + TThostFtdcMoneyType LongExchMaintenMargin; + ///ͷάֱ֤ + TThostFtdcMoneyType ShortExchMaintenMargin; +}; + +///ѯû +struct CThostFtdcQueryCFMMCTradingAccountTokenField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///û +struct CThostFtdcCFMMCTradingAccountTokenField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬ + TThostFtdcCFMMCTokenType Token; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; +}; + +///ѯƷ +struct CThostFtdcQryProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ͶƷ/Ʒֱ֤Ʒ +struct CThostFtdcProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductGroupID; +}; + +///תʿ +struct CThostFtdcReqOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcRequestIDType RequestID; +}; + +///תʿӦ +struct CThostFtdcRspOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcRequestIDType RequestID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ת +struct CThostFtdcReqCancelAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcRequestIDType RequestID; +}; + +///תӦ +struct CThostFtdcRspCancelAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcRequestIDType RequestID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///˻ +struct CThostFtdcReqChangeAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; + /// + TThostFtdcRequestIDType RequestID; +}; + +///˻Ӧ +struct CThostFtdcRspChangeAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; + /// + TThostFtdcRequestIDType RequestID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ת +struct CThostFtdcReqTransferField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; +}; + +///зʽתڻӦ +struct CThostFtdcRspTransferField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CThostFtdcReqRepealField +{ + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; +}; + +///Ӧ +struct CThostFtdcRspRepealField +{ + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ +struct CThostFtdcReqQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ѯ˻ϢӦ +struct CThostFtdcRspQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; +}; + +///ǩǩ +struct CThostFtdcFutureSignIOField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ǩӦ +struct CThostFtdcRspFutureSignInField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; +}; + +///ǩ +struct CThostFtdcReqFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ǩӦ +struct CThostFtdcRspFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///׺ڱ̷Կͬ +struct CThostFtdcReqSyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///׺ڱ̷ԿͬӦ +struct CThostFtdcRspSyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ֪ͨ +struct CThostFtdcNotifyQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ת˽ˮ +struct CThostFtdcTransferSerialField +{ + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateSerial; + ///׷ + TThostFtdcTradeDateType TradeDate; + /// + TThostFtdcDateType TradingDay; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///Ự + TThostFtdcSessionIDType SessionID; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///ڻ˾ʺ + TThostFtdcFutureAccTypeType FutureAccType; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///׽ + TThostFtdcTradeAmountType TradeAmount; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///Ч־ + TThostFtdcAvailabilityFlagType AvailabilityFlag; + ///Ա + TThostFtdcOperatorCodeType OperatorCode; + ///ʺ + TThostFtdcBankAccountType BankNewAccount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯתˮ +struct CThostFtdcQryTransferSerialField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ǩ֪ͨ +struct CThostFtdcNotifyFutureSignInField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; +}; + +///ǩ֪ͨ +struct CThostFtdcNotifyFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///׺ڱ̷Կ֪ͬͨ +struct CThostFtdcNotifySyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯǩԼϵ +struct CThostFtdcQryAccountregisterField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ͻϢ +struct CThostFtdcAccountregisterField +{ + /// + TThostFtdcTradeDateType TradeDay; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///ڻ˾֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + /// + TThostFtdcOpenOrDestroyType OpenOrDestroy; + ///ǩԼ + TThostFtdcTradeDateType RegDate; + ///Լ + TThostFtdcTradeDateType OutDate; + ///ID + TThostFtdcTIDType TID; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; +}; + +///ڿϢ +struct CThostFtdcOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcRequestIDType RequestID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///Ϣ +struct CThostFtdcCancelAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcRequestIDType RequestID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ڱ˺Ϣ +struct CThostFtdcChangeAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; + /// + TThostFtdcRequestIDType RequestID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ʽ˺Źϵ +struct CThostFtdcAccountOwnerShipField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + /// + TThostFtdcInvestorIDType AccountOwner; + ///ʽ˺ + TThostFtdcAccountOwnerModeType AccountOwnerMode; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///ͻ֤ +struct CThostFtdcAuthenticationCodeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤ + TThostFtdcAuthCodeType AuthCode; + ///֤ + TThostFtdcAuthCodeType PreAuthCode; +}; + +///ܹ֯ +struct CThostFtdcDepartmentField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ܹ֯ + TThostFtdcInvestorIDType DepartmentID; + ///ܹ֯ + TThostFtdcPartyNameType DepartmentName; +}; + +///Աܹ֯ϵ +struct CThostFtdcDepartmentUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///Ͷ߷Χ + TThostFtdcDepartmentRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ܹ֯Ͷ߶Ӧϵƽ +struct CThostFtdcInvestorDepartmentFlatField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ܹ֯ + TThostFtdcInvestorIDType DepartmentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ϵͳ +struct CThostFtdcTradeParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcTradeParamIDType TradeParamID; + ///ֵ + TThostFtdcSettlementParamValueType TradeParamValue; + ///ע + TThostFtdcMemoType Memo; +}; + +///ӦóϢ +struct CThostFtdcAppInfoField +{ + ///Ӧ + TThostFtdcAppNameType AppName; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ӧó + TThostFtdcAppTypeType AppType; +}; + +///Ӧóû +struct CThostFtdcAppUserField +{ + ///Ӧ + TThostFtdcAppNameType AppName; + ///б + TThostFtdcRunIDType RunID; + /// + TThostFtdcPasswordType Password; + ///IPַ + TThostFtdcIPAddressType IPAddress; +}; + +/// +struct CThostFtdcDRIdentityField +{ + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; + /// + TThostFtdcDRIdentityNameType DRIdentityName; + ///Ƿ + TThostFtdcBoolType IsMain; +}; + +///ǰıʶ +struct CThostFtdcCurrDRIdentityField +{ + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; +}; + +///ֱĽȨ +struct CThostFtdcUserRightAssignField +{ + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; +}; + +///͹˾ǷڱʾĽȨ +struct CThostFtdcBrokerRightAssignField +{ + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; + ///ܷ + TThostFtdcBoolType Tradeable; +}; + +///FensûϢ +struct CThostFtdcFensUserInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ģʽ + TThostFtdcLoginModeType LoginMode; +}; + +///ֹ¼û +struct CThostFtdcLoginForbiddenUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; +}; + +///ѯֹ¼û +struct CThostFtdcQryLoginForbiddenUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///UDP鲥Ϣ +struct CThostFtdcMulticastGroupInfoField +{ + ///鲥IPַ + TThostFtdcIPAddressType GroupIP; + ///鲥IP˿ + TThostFtdcIPPortType GroupPort; + ///Դַ + TThostFtdcIPAddressType SourceIP; +}; + +///ʽ˻׼ +struct CThostFtdcTradingAccountReserveField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///׼ + TThostFtdcMoneyType Reserve; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯ˻ +struct CThostFtdcQryBaseCurrencyAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; +}; + +///˻ +struct CThostFtdcBaseCurrencyAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯֲ޶ +struct CThostFtdcQryInvestorPositionLimitField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; +}; + +///ֲ޶ +struct CThostFtdcInvestorPositionLimitField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///Ʒִ + TThostFtdcProductIDType ProductID; + ///ʱ + TThostFtdcVolumeType SingleOrderMaxVolume; + ///ֲ޶ + TThostFtdcVolumeType PositionLimit; +}; + + + +#endif diff --git a/include/CTP_INTER/win32/thostmduserapi.dll b/include/CTP_INTER/win32/thostmduserapi.dll new file mode 100644 index 0000000..69564bc Binary files /dev/null and b/include/CTP_INTER/win32/thostmduserapi.dll differ diff --git a/include/CTP_INTER/win32/thostmduserapi.lib b/include/CTP_INTER/win32/thostmduserapi.lib new file mode 100644 index 0000000..4b344ad Binary files /dev/null and b/include/CTP_INTER/win32/thostmduserapi.lib differ diff --git a/include/CTP_INTER/win32/thosttraderapi.dll b/include/CTP_INTER/win32/thosttraderapi.dll new file mode 100644 index 0000000..bcd3d91 Binary files /dev/null and b/include/CTP_INTER/win32/thosttraderapi.dll differ diff --git a/include/CTP_INTER/win32/thosttraderapi.lib b/include/CTP_INTER/win32/thosttraderapi.lib new file mode 100644 index 0000000..9c46b1c Binary files /dev/null and b/include/CTP_INTER/win32/thosttraderapi.lib differ diff --git a/include/CTP_SOPT/ThostFtdcMdApi.h b/include/CTP_SOPT/ThostFtdcMdApi.h new file mode 100644 index 0000000..ece33f7 --- /dev/null +++ b/include/CTP_SOPT/ThostFtdcMdApi.h @@ -0,0 +1,162 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcMdApi.h +///@brief ˿ͻ˽ӿ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCMDAPI_H) +#define THOST_FTDCMDAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) +#ifdef LIB_MD_API_EXPORT +#define MD_API_EXPORT __declspec(dllexport) +#else +#define MD_API_EXPORT __declspec(dllimport) +#endif +#else +#define MD_API_EXPORT +#endif + +class CThostFtdcMdSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + + ///¼Ӧ + virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡӦ + virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡѯӦ + virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData) {}; + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {}; +}; + +class MD_API_EXPORT CThostFtdcMdApi +{ +public: + ///MdApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + ///modify for udp marketdata + static CThostFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = "", const bool bIsUsingUdp=false, const bool bIsMulticast=false); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עַַ + ///@param pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcMdSpi *pSpi) = 0; + + ///顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeMarketData(char *ppInstrumentID[], int nCount) = 0; + + ///˶顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeMarketData(char *ppInstrumentID[], int nCount) = 0; + + ///ѯۡ + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0; + + ///˶ѯۡ + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0; + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; +protected: + ~CThostFtdcMdApi(){}; +}; + +#endif diff --git a/include/CTP_SOPT/ThostFtdcTraderApi.h b/include/CTP_SOPT/ThostFtdcTraderApi.h new file mode 100644 index 0000000..d84d697 --- /dev/null +++ b/include/CTP_SOPT/ThostFtdcTraderApi.h @@ -0,0 +1,696 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcTraderApi.h +///@brief ˿ͻ˽ӿ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCTRADERAPI_H) +#define THOST_FTDCTRADERAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) +#ifdef LIB_TRADER_API_EXPORT +#define TRADER_API_EXPORT __declspec(dllexport) +#else +#define TRADER_API_EXPORT __declspec(dllimport) +#endif +#else +#define TRADER_API_EXPORT +#endif + +class CThostFtdcTraderSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + ///ͻ֤Ӧ + virtual void OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + + ///¼Ӧ + virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ûӦ + virtual void OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽ˻Ӧ + virtual void OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ԥ¼Ӧ + virtual void OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ԥ񳷵¼Ӧ + virtual void OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ󱨵Ӧ + virtual void OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ͷ߽ȷӦ + virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ɾԤӦ + virtual void OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ɾԤ񳷵Ӧ + virtual void OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ִ¼Ӧ + virtual void OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ִӦ + virtual void OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ¼Ӧ + virtual void OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///۲Ӧ + virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯɽӦ + virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳Ӧ + virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʽ˻Ӧ + virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶӦ + virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯױӦ + virtual void OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼ֤Ӧ + virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷӦ + virtual void OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶ߽Ӧ + virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯתӦ + virtual void OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͻ֪ͨӦ + virtual void OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϢȷӦ + virtual void OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤ϵͳ͹˾ʽ˻ԿӦ + virtual void OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯֵ۵ϢӦ + virtual void OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶƷ/Ʒֱ֤Ӧ + virtual void OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԱȨӦ + virtual void OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷۻ + virtual void OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷ + virtual void OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ̺ԼӦ + virtual void OnRspQryMMInstrumentCommissionRate(CThostFtdcMMInstrumentCommissionRateField *pMMInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨԼӦ + virtual void OnRspQryMMOptionInstrCommRate(CThostFtdcMMOptionInstrCommRateField *pMMOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryInstrumentOrderCommRate(CThostFtdcInstrumentOrderCommRateField *pInstrumentOrderCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨ׳ɱӦ + virtual void OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨԼӦ + virtual void OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯִӦ + virtual void OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯѯӦ + virtual void OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryLock(CThostFtdcLockField *pLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤ȯλӦ + virtual void OnRspQryLockPosition(CThostFtdcLockPositionField *pLockPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯETFȨԼӦ + virtual void OnRspQryETFOptionInstrCommRate(CThostFtdcETFOptionInstrCommRateField *pETFOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶ߷ּ + virtual void OnRspQryInvestorLevel(CThostFtdcInvestorLevelField *pInvestorLevel, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯE+1ȨӦ + virtual void OnRspQryExecFreeze(CThostFtdcExecFreezeField *pExecFreeze, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϺԼȫϵӦ + virtual void OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯתˮӦ + virtual void OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯǩԼϵӦ + virtual void OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnOrder(CThostFtdcOrderField *pOrder) {}; + + ///ɽ֪ͨ + virtual void OnRtnTrade(CThostFtdcTradeField *pTrade) {}; + + ///¼ر + virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ر + virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///Լ״̬֪ͨ + virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {}; + + ///֪ͨ + virtual void OnRtnBulletin(CThostFtdcBulletinField *pBulletin) {}; + + ///֪ͨ + virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) {}; + + ///ʾУ + virtual void OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) {}; + + ///ִ֪ͨ + virtual void OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder) {}; + + ///ִ¼ر + virtual void OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ִر + virtual void OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯ¼ر + virtual void OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo) {}; + + ///֪ͨ + virtual void OnRtnQuote(CThostFtdcQuoteField *pQuote) {}; + + ///¼ر + virtual void OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) {}; + + ///۲ر + virtual void OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {}; + + ///֤û + virtual void OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) {}; + + ///֪ͨ + virtual void OnRtnLock(CThostFtdcLockField *pLock) {}; + + ///֪ͨ + virtual void OnErrRtnLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ر + virtual void OnErrRtnBatchOrderAction(CThostFtdcBatchOrderActionField *pBatchOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///֪ͨ + virtual void OnRtnCombAction(CThostFtdcCombActionField *pCombAction) {}; + + ///¼ر + virtual void OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯǩԼӦ + virtual void OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԤӦ + virtual void OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԤ񳷵Ӧ + virtual void OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֪ͨӦ + virtual void OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ͹˾ײӦ + virtual void OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ͹˾㷨Ӧ + virtual void OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯû + virtual void OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///зʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///зڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///зתڻ֪ͨ + virtual void OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///зڻת֪ͨ + virtual void OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///ڻڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///ϵͳʱڻֹתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ϵͳʱڻֹڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻѯ֪ͨ + virtual void OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) {}; + + ///ڻʽתڻر + virtual void OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻڻʽתдر + virtual void OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ϵͳʱڻֹתڻر + virtual void OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ϵͳʱڻֹڻתдر + virtual void OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻѯر + virtual void OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻʽתڻӦ + virtual void OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ڻڻʽתӦ + virtual void OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ڻѯӦ + virtual void OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///зڿ֪ͨ + virtual void OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) {}; + + ///з֪ͨ + virtual void OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) {}; + + ///з˺֪ͨ + virtual void OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) {}; +}; + +class TRADER_API_EXPORT CThostFtdcTraderApi +{ +public: + ///TraderApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + static CThostFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = ""); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עַַ + ///@param pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcTraderSpi *pSpi) = 0; + + ///˽ + ///@param nResumeType ˽شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼˽ + ///@remark ÷ҪInitǰá򲻻յ˽ݡ + virtual void SubscribePrivateTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///Ĺ + ///@param nResumeType شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼󹫹 + ///@remark ÷ҪInitǰá򲻻յݡ + virtual void SubscribePublicTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///ͻ֤ + virtual int ReqAuthenticate(CThostFtdcReqAuthenticateField *pReqAuthenticateField, int nRequestID) = 0; + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; + + ///û + virtual int ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0; + + ///ʽ˻ + virtual int ReqTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, int nRequestID) = 0; + + ///¼ + virtual int ReqOrderInsert(CThostFtdcInputOrderField *pInputOrder, int nRequestID) = 0; + + ///Ԥ¼ + virtual int ReqParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, int nRequestID) = 0; + + ///Ԥ񳷵¼ + virtual int ReqParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, int nRequestID) = 0; + + /// + virtual int ReqOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0; + + ///ѯ󱨵 + virtual int ReqQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, int nRequestID) = 0; + + ///Ͷ߽ȷ + virtual int ReqSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, int nRequestID) = 0; + + ///ɾԤ + virtual int ReqRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, int nRequestID) = 0; + + ///ɾԤ񳷵 + virtual int ReqRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, int nRequestID) = 0; + + ///ִ¼ + virtual int ReqExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, int nRequestID) = 0; + + ///ִ + virtual int ReqExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, int nRequestID) = 0; + + ///ѯ¼ + virtual int ReqForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, int nRequestID) = 0; + + ///¼ + virtual int ReqQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, int nRequestID) = 0; + + ///۲ + virtual int ReqQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, int nRequestID) = 0; + + /// + virtual int ReqLockInsert(CThostFtdcInputLockField *pInputLock, int nRequestID) = 0; + + /// + virtual int ReqBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, int nRequestID) = 0; + + ///¼ + virtual int ReqCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryOrder(CThostFtdcQryOrderField *pQryOrder, int nRequestID) = 0; + + ///ѯɽ + virtual int ReqQryTrade(CThostFtdcQryTradeField *pQryTrade, int nRequestID) = 0; + + ///ѯͶֲ߳ + virtual int ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0; + + ///ѯʽ˻ + virtual int ReqQryTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0; + + ///ѯͶ + virtual int ReqQryInvestor(CThostFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0; + + ///ѯױ + virtual int ReqQryTradingCode(CThostFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0; + + ///ѯԼ֤ + virtual int ReqQryInstrumentMarginRate(CThostFtdcQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrumentCommissionRate(CThostFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchange(CThostFtdcQryExchangeField *pQryExchange, int nRequestID) = 0; + + ///ѯƷ + virtual int ReqQryProduct(CThostFtdcQryProductField *pQryProduct, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrument(CThostFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryDepthMarketData(CThostFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0; + + ///ѯͶ߽ + virtual int ReqQrySettlementInfo(CThostFtdcQrySettlementInfoField *pQrySettlementInfo, int nRequestID) = 0; + + ///ѯת + virtual int ReqQryTransferBank(CThostFtdcQryTransferBankField *pQryTransferBank, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionDetail(CThostFtdcQryInvestorPositionDetailField *pQryInvestorPositionDetail, int nRequestID) = 0; + + ///ѯͻ֪ͨ + virtual int ReqQryNotice(CThostFtdcQryNoticeField *pQryNotice, int nRequestID) = 0; + + ///ѯϢȷ + virtual int ReqQrySettlementInfoConfirm(CThostFtdcQrySettlementInfoConfirmField *pQrySettlementInfoConfirm, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionCombineDetail(CThostFtdcQryInvestorPositionCombineDetailField *pQryInvestorPositionCombineDetail, int nRequestID) = 0; + + ///ѯ֤ϵͳ͹˾ʽ˻Կ + virtual int ReqQryCFMMCTradingAccountKey(CThostFtdcQryCFMMCTradingAccountKeyField *pQryCFMMCTradingAccountKey, int nRequestID) = 0; + + ///ѯֵ۵Ϣ + virtual int ReqQryEWarrantOffset(CThostFtdcQryEWarrantOffsetField *pQryEWarrantOffset, int nRequestID) = 0; + + ///ѯͶƷ/Ʒֱ֤ + virtual int ReqQryInvestorProductGroupMargin(CThostFtdcQryInvestorProductGroupMarginField *pQryInvestorProductGroupMargin, int nRequestID) = 0; + + ///ѯ֤ + virtual int ReqQryExchangeMarginRate(CThostFtdcQryExchangeMarginRateField *pQryExchangeMarginRate, int nRequestID) = 0; + + ///ѯ֤ + virtual int ReqQryExchangeMarginRateAdjust(CThostFtdcQryExchangeMarginRateAdjustField *pQryExchangeMarginRateAdjust, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchangeRate(CThostFtdcQryExchangeRateField *pQryExchangeRate, int nRequestID) = 0; + + ///ѯԱȨ + virtual int ReqQrySecAgentACIDMap(CThostFtdcQrySecAgentACIDMapField *pQrySecAgentACIDMap, int nRequestID) = 0; + + ///ѯƷۻ + virtual int ReqQryProductExchRate(CThostFtdcQryProductExchRateField *pQryProductExchRate, int nRequestID) = 0; + + ///ѯƷ + virtual int ReqQryProductGroup(CThostFtdcQryProductGroupField *pQryProductGroup, int nRequestID) = 0; + + ///ѯ̺Լ + virtual int ReqQryMMInstrumentCommissionRate(CThostFtdcQryMMInstrumentCommissionRateField *pQryMMInstrumentCommissionRate, int nRequestID) = 0; + + ///ѯȨԼ + virtual int ReqQryMMOptionInstrCommRate(CThostFtdcQryMMOptionInstrCommRateField *pQryMMOptionInstrCommRate, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryInstrumentOrderCommRate(CThostFtdcQryInstrumentOrderCommRateField *pQryInstrumentOrderCommRate, int nRequestID) = 0; + + ///ѯȨ׳ɱ + virtual int ReqQryOptionInstrTradeCost(CThostFtdcQryOptionInstrTradeCostField *pQryOptionInstrTradeCost, int nRequestID) = 0; + + ///ѯȨԼ + virtual int ReqQryOptionInstrCommRate(CThostFtdcQryOptionInstrCommRateField *pQryOptionInstrCommRate, int nRequestID) = 0; + + ///ѯִ + virtual int ReqQryExecOrder(CThostFtdcQryExecOrderField *pQryExecOrder, int nRequestID) = 0; + + ///ѯѯ + virtual int ReqQryForQuote(CThostFtdcQryForQuoteField *pQryForQuote, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryQuote(CThostFtdcQryQuoteField *pQryQuote, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryLock(CThostFtdcQryLockField *pQryLock, int nRequestID) = 0; + + ///ѯ֤ȯλ + virtual int ReqQryLockPosition(CThostFtdcQryLockPositionField *pQryLockPosition, int nRequestID) = 0; + + ///ѯETFȨԼ + virtual int ReqQryETFOptionInstrCommRate(CThostFtdcQryETFOptionInstrCommRateField *pQryETFOptionInstrCommRate, int nRequestID) = 0; + + ///ѯͶ߷ּ + virtual int ReqQryInvestorLevel(CThostFtdcQryInvestorLevelField *pQryInvestorLevel, int nRequestID) = 0; + + ///ѯE+1Ȩ + virtual int ReqQryExecFreeze(CThostFtdcQryExecFreezeField *pQryExecFreeze, int nRequestID) = 0; + + ///ѯϺԼȫϵ + virtual int ReqQryCombInstrumentGuard(CThostFtdcQryCombInstrumentGuardField *pQryCombInstrumentGuard, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryCombAction(CThostFtdcQryCombActionField *pQryCombAction, int nRequestID) = 0; + + ///ѯתˮ + virtual int ReqQryTransferSerial(CThostFtdcQryTransferSerialField *pQryTransferSerial, int nRequestID) = 0; + + ///ѯǩԼϵ + virtual int ReqQryAccountregister(CThostFtdcQryAccountregisterField *pQryAccountregister, int nRequestID) = 0; + + ///ѯǩԼ + virtual int ReqQryContractBank(CThostFtdcQryContractBankField *pQryContractBank, int nRequestID) = 0; + + ///ѯԤ + virtual int ReqQryParkedOrder(CThostFtdcQryParkedOrderField *pQryParkedOrder, int nRequestID) = 0; + + ///ѯԤ񳷵 + virtual int ReqQryParkedOrderAction(CThostFtdcQryParkedOrderActionField *pQryParkedOrderAction, int nRequestID) = 0; + + ///ѯ֪ͨ + virtual int ReqQryTradingNotice(CThostFtdcQryTradingNoticeField *pQryTradingNotice, int nRequestID) = 0; + + ///ѯ͹˾ײ + virtual int ReqQryBrokerTradingParams(CThostFtdcQryBrokerTradingParamsField *pQryBrokerTradingParams, int nRequestID) = 0; + + ///ѯ͹˾㷨 + virtual int ReqQryBrokerTradingAlgos(CThostFtdcQryBrokerTradingAlgosField *pQryBrokerTradingAlgos, int nRequestID) = 0; + + ///ѯû + virtual int ReqQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, int nRequestID) = 0; + + ///ڻʽתڻ + virtual int ReqFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0; + + ///ڻڻʽת + virtual int ReqFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0; + + ///ڻѯ + virtual int ReqQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, int nRequestID) = 0; +protected: + ~CThostFtdcTraderApi(){}; +}; + +#endif diff --git a/include/CTP_SOPT/ThostFtdcUserApiDataType.h b/include/CTP_SOPT/ThostFtdcUserApiDataType.h new file mode 100644 index 0000000..1ec388a --- /dev/null +++ b/include/CTP_SOPT/ThostFtdcUserApiDataType.h @@ -0,0 +1,6528 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcUserApiDataType.h +///@brief ˿ͻ˽ӿʹõҵ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#ifndef THOST_FTDCDATATYPE_H +#define THOST_FTDCDATATYPE_H + +enum THOST_TE_RESUME_TYPE +{ + THOST_TERT_RESTART = 0, + THOST_TERT_RESUME, + THOST_TERT_QUICK +}; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTraderIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDTypeһͶߴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerAbbrTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerNameTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeInstIDTypeһԼڽĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderRefType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParticipantIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParticipantIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserIDTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserIDType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPasswordType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentCodeTypeһԼʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentCodeType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarketIDTypeһг +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMarketIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeAbbrTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMacAddressTypeһMacַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMacAddressType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSystemIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangePropertyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EXP_Normal '0' +///ݳɽɱ +#define THOST_FTDC_EXP_GenOrderByTrade '1' + +typedef char TThostFtdcExchangePropertyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLongTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLongTimeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettlementGroupIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSysIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandTypeTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommandTypeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPAddressTypeһIPַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIPAddressType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPPortTypeһIP˿ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcIPPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductInfoTypeһƷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocolInfoTypeһЭϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProtocolInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessUnitTypeһҵԪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessUnitType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepositSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDepositSeqNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֯ +#define THOST_FTDC_ICT_EID '0' +///й֤ +#define THOST_FTDC_ICT_IDCard '1' +///֤ +#define THOST_FTDC_ICT_OfficerIDCard '2' +///֤ +#define THOST_FTDC_ICT_PoliceIDCard '3' +///ʿ֤ +#define THOST_FTDC_ICT_SoldierIDCard '4' +///ڲ +#define THOST_FTDC_ICT_HouseholdRegister '5' +/// +#define THOST_FTDC_ICT_Passport '6' +///̨֤ +#define THOST_FTDC_ICT_TaiwanCompatriotIDCard '7' +///֤ +#define THOST_FTDC_ICT_HomeComingCard '8' +///Ӫҵִպ +#define THOST_FTDC_ICT_LicenseNo '9' +///˰ǼǺ/˰ID +#define THOST_FTDC_ICT_TaxNo 'A' +///۰ľڵ֤ͨ +#define THOST_FTDC_ICT_HMMainlandTravelPermit 'B' +///̨½֤ͨ +#define THOST_FTDC_ICT_TwMainlandTravelPermit 'C' +/// +#define THOST_FTDC_ICT_DrivingLicense 'D' +///籣ID +#define THOST_FTDC_ICT_SocialID 'F' +///֤ +#define THOST_FTDC_ICT_LocalID 'G' +///ҵǼ֤ +#define THOST_FTDC_ICT_BusinessRegistration 'H' +///۰Ծ֤ +#define THOST_FTDC_ICT_HKMCIDCard 'I' +///п֤ +#define THOST_FTDC_ICT_AccountsPermits 'J' +///֤ +#define THOST_FTDC_ICT_OtherCard 'x' + +typedef char TThostFtdcIdCardTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderLocalIDTypeһر +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderLocalIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserNameTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPartyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPartyNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorMsgTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcErrorMsgType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldNameTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFieldNameType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldContentTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFieldContentType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemNameTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSystemNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContentTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcContentType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IR_All '1' +///Ͷ +#define THOST_FTDC_IR_Group '2' +///һͶ +#define THOST_FTDC_IR_Single '3' + +typedef char TThostFtdcInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepartmentRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_DR_All '1' +///ܹ֯ +#define THOST_FTDC_DR_Group '2' +///һͶ +#define THOST_FTDC_DR_Single '3' + +typedef char TThostFtdcDepartmentRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataSyncStatusTypeһͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define THOST_FTDC_DS_Asynchronous '1' +///ͬ +#define THOST_FTDC_DS_Synchronizing '2' +///ͬ +#define THOST_FTDC_DS_Synchronized '3' + +typedef char TThostFtdcDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDataSyncStatusTypeһ͹˾ͬ״̬ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_BDS_Synchronized '1' +///ͬ +#define THOST_FTDC_BDS_Synchronizing '2' + +typedef char TThostFtdcBrokerDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeConnectStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_ECS_NoConnection '1' +///ѾԼѯ +#define THOST_FTDC_ECS_QryInstrumentSent '2' +///ѾȡϢ +#define THOST_FTDC_ECS_GotInformation '9' + +typedef char TThostFtdcExchangeConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderConnectStatusTypeһԱ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_TCS_NotConnected '1' +///Ѿ +#define THOST_FTDC_TCS_Connected '2' +///ѾԼѯ +#define THOST_FTDC_TCS_QryInstrumentSent '3' +///˽ +#define THOST_FTDC_TCS_SubPrivateFlow '4' + +typedef char TThostFtdcTraderConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionCodeTypeһܴ +///////////////////////////////////////////////////////////////////////// +///첽 +#define THOST_FTDC_FC_DataAsync '1' +///ǿûdz +#define THOST_FTDC_FC_ForceUserLogout '2' +///û +#define THOST_FTDC_FC_UserPasswordUpdate '3' +///͹˾ +#define THOST_FTDC_FC_BrokerPasswordUpdate '4' +///Ͷ߿ +#define THOST_FTDC_FC_InvestorPasswordUpdate '5' +/// +#define THOST_FTDC_FC_OrderInsert '6' +/// +#define THOST_FTDC_FC_OrderAction '7' +///ͬϵͳ +#define THOST_FTDC_FC_SyncSystemData '8' +///ͬ͹˾ +#define THOST_FTDC_FC_SyncBrokerData '9' +///ͬ͹˾ +#define THOST_FTDC_FC_BachSyncBrokerData 'A' +///ѯ +#define THOST_FTDC_FC_SuperQuery 'B' +///Ԥ񱨵 +#define THOST_FTDC_FC_ParkedOrderInsert 'C' +///Ԥ񱨵 +#define THOST_FTDC_FC_ParkedOrderAction 'D' +///̬ͬ +#define THOST_FTDC_FC_SyncOTP 'E' +///ɾδ֪ +#define THOST_FTDC_FC_DeleteOrder 'F' + +typedef char TThostFtdcFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerFunctionCodeTypeһ͹˾ܴ +///////////////////////////////////////////////////////////////////////// +///ǿûdz +#define THOST_FTDC_BFC_ForceUserLogout '1' +///û +#define THOST_FTDC_BFC_UserPasswordUpdate '2' +///ͬ͹˾ +#define THOST_FTDC_BFC_SyncBrokerData '3' +///ͬ͹˾ +#define THOST_FTDC_BFC_BachSyncBrokerData '4' +/// +#define THOST_FTDC_BFC_OrderInsert '5' +/// +#define THOST_FTDC_BFC_OrderAction '6' +///ȫѯ +#define THOST_FTDC_BFC_AllQuery '7' +///ϵͳܣ/dz/޸ +#define THOST_FTDC_BFC_log 'a' +///ѯѯݣԼȳ +#define THOST_FTDC_BFC_BaseQry 'b' +///ײѯɽί +#define THOST_FTDC_BFC_TradeQry 'c' +///׹ܣ +#define THOST_FTDC_BFC_Trade 'd' +///ת +#define THOST_FTDC_BFC_Virement 'e' +///ռ +#define THOST_FTDC_BFC_Risk 'f' +///ѯ/ѯỰ˵ +#define THOST_FTDC_BFC_Session 'g' +///֪ͨ +#define THOST_FTDC_BFC_RiskNoticeCtl 'h' +///֪ͨ +#define THOST_FTDC_BFC_RiskNotice 'i' +///쿴͹˾ʽȨ +#define THOST_FTDC_BFC_BrokerDeposit 'j' +///ʽѯ +#define THOST_FTDC_BFC_QueryFund 'k' +///ѯ +#define THOST_FTDC_BFC_QueryOrder 'l' +///ɽѯ +#define THOST_FTDC_BFC_QueryTrade 'm' +///ֲֲѯ +#define THOST_FTDC_BFC_QueryPosition 'n' +///ѯ +#define THOST_FTDC_BFC_QueryMarketData 'o' +///û¼ѯ +#define THOST_FTDC_BFC_QueryUserEvent 'p' +///֪ͨѯ +#define THOST_FTDC_BFC_QueryRiskNotify 'q' +///ѯ +#define THOST_FTDC_BFC_QueryFundChange 'r' +///ͶϢѯ +#define THOST_FTDC_BFC_QueryInvestor 's' +///ױѯ +#define THOST_FTDC_BFC_QueryTradingCode 't' +///ǿƽ +#define THOST_FTDC_BFC_ForceClose 'u' +///ѹ +#define THOST_FTDC_BFC_PressTest 'v' +///Ȩ淴 +#define THOST_FTDC_BFC_RemainCalc 'w' +///ֱֲָ֤ +#define THOST_FTDC_BFC_NetPositionInd 'x' +///Ԥ +#define THOST_FTDC_BFC_RiskPredict 'y' +///ݵ +#define THOST_FTDC_BFC_DataExport 'z' +///ָ +#define THOST_FTDC_BFC_RiskTargetSetup 'A' +///Ԥ +#define THOST_FTDC_BFC_MarketDataWarn 'B' +///ҵ֪ͨѯ +#define THOST_FTDC_BFC_QryBizNotice 'C' +///ҵ֪ͨģ +#define THOST_FTDC_BFC_CfgBizNotice 'D' +///̬ͬ +#define THOST_FTDC_BFC_SyncOTP 'E' +///ҵ֪ͨ +#define THOST_FTDC_BFC_SendBizNotice 'F' +///ռ׼ +#define THOST_FTDC_BFC_CfgRiskLevelStd 'G' +///նӦ +#define THOST_FTDC_BFC_TbCommand 'H' +///ɾδ֪ +#define THOST_FTDC_BFC_DeleteOrder 'J' +///Ԥ񱨵 +#define THOST_FTDC_BFC_ParkedOrderInsert 'K' +///Ԥ񱨵 +#define THOST_FTDC_BFC_ParkedOrderAction 'L' +///ʽ𲻹Ȩ +#define THOST_FTDC_BFC_ExecOrderNoCheck 'M' + +typedef char TThostFtdcBrokerFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_OAS_Submitted 'a' +///Ѿ +#define THOST_FTDC_OAS_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_OAS_Rejected 'c' + +typedef char TThostFtdcOrderActionStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ȫɽ +#define THOST_FTDC_OST_AllTraded '0' +///ֳɽڶ +#define THOST_FTDC_OST_PartTradedQueueing '1' +///ֳɽڶ +#define THOST_FTDC_OST_PartTradedNotQueueing '2' +///δɽڶ +#define THOST_FTDC_OST_NoTradeQueueing '3' +///δɽڶ +#define THOST_FTDC_OST_NoTradeNotQueueing '4' +/// +#define THOST_FTDC_OST_Canceled '5' +///δ֪ +#define THOST_FTDC_OST_Unknown 'a' +///δ +#define THOST_FTDC_OST_NotTouched 'b' +///Ѵ +#define THOST_FTDC_OST_Touched 'c' + +typedef char TThostFtdcOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSubmitStatusTypeһύ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_OSS_InsertSubmitted '0' +///Ѿύ +#define THOST_FTDC_OSS_CancelSubmitted '1' +///޸Ѿύ +#define THOST_FTDC_OSS_ModifySubmitted '2' +///Ѿ +#define THOST_FTDC_OSS_Accepted '3' +///Ѿܾ +#define THOST_FTDC_OSS_InsertRejected '4' +///Ѿܾ +#define THOST_FTDC_OSS_CancelRejected '5' +///ĵѾܾ +#define THOST_FTDC_OSS_ModifyRejected '6' + +typedef char TThostFtdcOrderSubmitStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ճֲ +#define THOST_FTDC_PSD_Today '1' +///ʷֲ +#define THOST_FTDC_PSD_History '2' + +typedef char TThostFtdcPositionDateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ʹʷֲ +#define THOST_FTDC_PDT_UseHistory '1' +///ʹʷֲ +#define THOST_FTDC_PDT_NoUseHistory '2' + +typedef char TThostFtdcPositionDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRoleTypeһ׽ɫ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ER_Broker '1' +///Ӫ +#define THOST_FTDC_ER_Host '2' +/// +#define THOST_FTDC_ER_Maker '3' + +typedef char TThostFtdcTradingRoleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_PC_Futures '1' +///ڻȨ +#define THOST_FTDC_PC_Options '2' +/// +#define THOST_FTDC_PC_Combination '3' +/// +#define THOST_FTDC_PC_Spot '4' +///ת +#define THOST_FTDC_PC_EFP '5' +///ֻȨ +#define THOST_FTDC_PC_SpotOption '6' +///Ȩ +#define THOST_FTDC_PC_ETFOption '7' +///֤ȯ +#define THOST_FTDC_PC_Stock '8' + +typedef char TThostFtdcProductClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_IP_NotStart '0' +/// +#define THOST_FTDC_IP_Started '1' +///ͣ +#define THOST_FTDC_IP_Pause '2' +/// +#define THOST_FTDC_IP_Expired '3' + +typedef char TThostFtdcInstLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_D_Buy '0' +/// +#define THOST_FTDC_D_Sell '1' + +typedef char TThostFtdcDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ֲ +#define THOST_FTDC_PT_Net '1' +///ۺϳֲ +#define THOST_FTDC_PT_Gross '2' + +typedef char TThostFtdcPositionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosiDirectionTypeһֲֶշ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PD_Net '1' +///ͷ +#define THOST_FTDC_PD_Long '2' +///ͷ +#define THOST_FTDC_PD_Short '3' + +typedef char TThostFtdcPosiDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysSettlementStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_SS_NonActive '1' +/// +#define THOST_FTDC_SS_Startup '2' +/// +#define THOST_FTDC_SS_Operating '3' +/// +#define THOST_FTDC_SS_Settlement '4' +/// +#define THOST_FTDC_SS_SettlementFinished '5' + +typedef char TThostFtdcSysSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioAttrTypeһ +///////////////////////////////////////////////////////////////////////// +///׷ +#define THOST_FTDC_RA_Trade '0' +/// +#define THOST_FTDC_RA_Settlement '1' + +typedef char TThostFtdcRatioAttrType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_HF_Speculation '1' +/// +#define THOST_FTDC_HF_Arbitrage '2' +///ױ +#define THOST_FTDC_HF_Hedge '3' +/// +#define THOST_FTDC_HF_Covered '4' +/// +#define THOST_FTDC_HF_MarketMaker '5' + +typedef char TThostFtdcHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_BHF_Speculation '1' +/// +#define THOST_FTDC_BHF_Arbitrage '2' +///ױ +#define THOST_FTDC_BHF_Hedge '3' + +typedef char TThostFtdcBillHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_CIDT_Speculation '1' +/// +#define THOST_FTDC_CIDT_Arbitrage '2' +///ױ +#define THOST_FTDC_CIDT_Hedge '3' +/// +#define THOST_FTDC_CIDT_MarketMaker '5' + +typedef char TThostFtdcClientIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderPriceTypeTypeһ۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OPT_AnyPrice '1' +///޼ +#define THOST_FTDC_OPT_LimitPrice '2' +///ż +#define THOST_FTDC_OPT_BestPrice '3' +///¼ +#define THOST_FTDC_OPT_LastPrice '4' +///¼۸ϸ1ticks +#define THOST_FTDC_OPT_LastPricePlusOneTicks '5' +///¼۸ϸ2ticks +#define THOST_FTDC_OPT_LastPricePlusTwoTicks '6' +///¼۸ϸ3ticks +#define THOST_FTDC_OPT_LastPricePlusThreeTicks '7' +///һ +#define THOST_FTDC_OPT_AskPrice1 '8' +///һ۸ϸ1ticks +#define THOST_FTDC_OPT_AskPrice1PlusOneTicks '9' +///һ۸ϸ2ticks +#define THOST_FTDC_OPT_AskPrice1PlusTwoTicks 'A' +///һ۸ϸ3ticks +#define THOST_FTDC_OPT_AskPrice1PlusThreeTicks 'B' +///һ +#define THOST_FTDC_OPT_BidPrice1 'C' +///һ۸ϸ1ticks +#define THOST_FTDC_OPT_BidPrice1PlusOneTicks 'D' +///һ۸ϸ2ticks +#define THOST_FTDC_OPT_BidPrice1PlusTwoTicks 'E' +///һ۸ϸ3ticks +#define THOST_FTDC_OPT_BidPrice1PlusThreeTicks 'F' +///嵵 +#define THOST_FTDC_OPT_FiveLevelPrice 'G' +///ż +#define THOST_FTDC_OPT_BestPriceThisSide 'H' + +typedef char TThostFtdcOrderPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OF_Open '0' +///ƽ +#define THOST_FTDC_OF_Close '1' +///ǿƽ +#define THOST_FTDC_OF_ForceClose '2' +///ƽ +#define THOST_FTDC_OF_CloseToday '3' +///ƽ +#define THOST_FTDC_OF_CloseYesterday '4' +///ǿ +#define THOST_FTDC_OF_ForceOff '5' +///ǿƽ +#define THOST_FTDC_OF_LocalForceClose '6' + +typedef char TThostFtdcOffsetFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseReasonTypeһǿƽԭ +///////////////////////////////////////////////////////////////////////// +///ǿƽ +#define THOST_FTDC_FCC_NotForceClose '0' +///ʽ +#define THOST_FTDC_FCC_LackDeposit '1' +///ͻ +#define THOST_FTDC_FCC_ClientOverPositionLimit '2' +///Ա +#define THOST_FTDC_FCC_MemberOverPositionLimit '3' +///ֲַ +#define THOST_FTDC_FCC_NotMultiple '4' +///Υ +#define THOST_FTDC_FCC_Violation '5' +/// +#define THOST_FTDC_FCC_Other '6' +///Ȼٽ +#define THOST_FTDC_FCC_PersonDeliv '7' + +typedef char TThostFtdcForceCloseReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ORDT_Normal '0' +/// +#define THOST_FTDC_ORDT_DeriveFromQuote '1' +/// +#define THOST_FTDC_ORDT_DeriveFromCombination '2' +///ϱ +#define THOST_FTDC_ORDT_Combination '3' +/// +#define THOST_FTDC_ORDT_ConditionalOrder '4' +/// +#define THOST_FTDC_ORDT_Swap '5' + +typedef char TThostFtdcOrderTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeConditionTypeһЧ +///////////////////////////////////////////////////////////////////////// +///ɣ +#define THOST_FTDC_TC_IOC '1' +///Ч +#define THOST_FTDC_TC_GFS '2' +///Ч +#define THOST_FTDC_TC_GFD '3' +///ָǰЧ +#define THOST_FTDC_TC_GTD '4' +///ǰЧ +#define THOST_FTDC_TC_GTC '5' +///ϾЧ +#define THOST_FTDC_TC_GFA '6' + +typedef char TThostFtdcTimeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeConditionTypeһɽ +///////////////////////////////////////////////////////////////////////// +///κ +#define THOST_FTDC_VC_AV '1' +///С +#define THOST_FTDC_VC_MV '2' +///ȫ +#define THOST_FTDC_VC_CV '3' + +typedef char TThostFtdcVolumeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContingentConditionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CC_Immediately '1' +///ֹ +#define THOST_FTDC_CC_Touch '2' +///ֹӮ +#define THOST_FTDC_CC_TouchProfit '3' +///Ԥ +#define THOST_FTDC_CC_ParkedOrder '4' +///¼۴ +#define THOST_FTDC_CC_LastPriceGreaterThanStopPrice '5' +///¼۴ڵ +#define THOST_FTDC_CC_LastPriceGreaterEqualStopPrice '6' +///¼С +#define THOST_FTDC_CC_LastPriceLesserThanStopPrice '7' +///¼Сڵ +#define THOST_FTDC_CC_LastPriceLesserEqualStopPrice '8' +///һ۴ +#define THOST_FTDC_CC_AskPriceGreaterThanStopPrice '9' +///һ۴ڵ +#define THOST_FTDC_CC_AskPriceGreaterEqualStopPrice 'A' +///һС +#define THOST_FTDC_CC_AskPriceLesserThanStopPrice 'B' +///һСڵ +#define THOST_FTDC_CC_AskPriceLesserEqualStopPrice 'C' +///һ۴ +#define THOST_FTDC_CC_BidPriceGreaterThanStopPrice 'D' +///һ۴ڵ +#define THOST_FTDC_CC_BidPriceGreaterEqualStopPrice 'E' +///һС +#define THOST_FTDC_CC_BidPriceLesserThanStopPrice 'F' +///һСڵ +#define THOST_FTDC_CC_BidPriceLesserEqualStopPrice 'H' + +typedef char TThostFtdcContingentConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +///ɾ +#define THOST_FTDC_AF_Delete '0' +///޸ +#define THOST_FTDC_AF_Modify '3' + +typedef char TThostFtdcActionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRightTypeһȨ +///////////////////////////////////////////////////////////////////////// +///Խ +#define THOST_FTDC_TR_Allow '0' +///ֻƽ +#define THOST_FTDC_TR_CloseOnly '1' +///ܽ +#define THOST_FTDC_TR_Forbidden '2' + +typedef char TThostFtdcTradingRightType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///Բ +#define THOST_FTDC_OSRC_Participant '0' +///ԹԱ +#define THOST_FTDC_OSRC_Administrator '1' + +typedef char TThostFtdcOrderSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTypeTypeһɽ +///////////////////////////////////////////////////////////////////////// +///ϳֲֲΪһֲ,ʼӦ͵ijֲ +#define THOST_FTDC_TRDT_SplitCombination '#' +///ͨɽ +#define THOST_FTDC_TRDT_Common '0' +///Ȩִ +#define THOST_FTDC_TRDT_OptionsExecution '1' +///OTCɽ +#define THOST_FTDC_TRDT_OTC '2' +///תɽ +#define THOST_FTDC_TRDT_EFPDerived '3' +///ɽ +#define THOST_FTDC_TRDT_CombinationDerived '4' + +typedef char TThostFtdcTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///ǰɽ +#define THOST_FTDC_PSRC_LastPrice '0' +///ίм +#define THOST_FTDC_PSRC_Buy '1' +///ίм +#define THOST_FTDC_PSRC_Sell '2' + +typedef char TThostFtdcPriceSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentStatusTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define THOST_FTDC_IS_BeforeTrading '0' +///ǽ +#define THOST_FTDC_IS_NoTrading '1' +/// +#define THOST_FTDC_IS_Continous '2' +///Ͼ۱ +#define THOST_FTDC_IS_AuctionOrdering '3' +///Ͼۼ۸ƽ +#define THOST_FTDC_IS_AuctionBalance '4' +///Ͼ۴ +#define THOST_FTDC_IS_AuctionMatch '5' +/// +#define THOST_FTDC_IS_Closed '6' + +typedef char TThostFtdcInstrumentStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstStatusEnterReasonTypeһƷֽ뽻״̬ԭ +///////////////////////////////////////////////////////////////////////// +///Զл +#define THOST_FTDC_IER_Automatic '1' +///ֶл +#define THOST_FTDC_IER_Manual '2' +///۶ +#define THOST_FTDC_IER_Fuse '3' + +typedef char TThostFtdcInstStatusEnterReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcOrderActionRefType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallCountTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcInstallCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallIDTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcInstallIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcErrorIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSettlementIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFrontIDTypeһǰñ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFrontIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSessionIDTypeһỰ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSessionIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSequenceNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandNoTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCommandNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMillisecTypeһʱ䣨룩 +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMillisecType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeMultipleTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcVolumeMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingSegmentSNTypeһ׽׶α +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradingSegmentSNType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRequestIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYearTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcYearType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMonthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBoolTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBoolType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombOffsetFlagTypeһϿƽ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombOffsetFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombHedgeFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcRatioType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLargeVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcLargeVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceSeriesTypeһϵк +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcSequenceSeriesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommPhaseNoTypeһͨѶʱα +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcCommPhaseNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceLabelTypeһб +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSequenceLabelType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUnderlyingMultipleTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcUnderlyingMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContractCodeTypeһͬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcContractCodeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCityTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCityType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsStockTypeһǷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIsStockType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcChannelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcChannelType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddressTypeһͨѶַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAddressType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcZipCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcZipCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTelephoneTypeһϵ绰 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTelephoneType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFaxTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFaxType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobileTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMobileType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEMailTypeһʼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEMailType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMemoTypeһע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMemoType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyCodeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCompanyCodeType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWebsiteTypeһվַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWebsiteType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTaxNoTypeһ˰ǼǺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTaxNoType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBatchStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δϴ +#define THOST_FTDC_BS_NoUpload '1' +///ϴ +#define THOST_FTDC_BS_Uploaded '2' +///ʧ +#define THOST_FTDC_BS_Failed '3' + +typedef char TThostFtdcBatchStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyIDTypeһԴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNoTypeһӪҵִպ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLicenseNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentIDTypeһ˴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentGroupIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStyleTypeһƷַʽ +///////////////////////////////////////////////////////////////////////// +///Ʒ +#define THOST_FTDC_RS_All '1' +///Ʒ +#define THOST_FTDC_RS_ByProduct '2' + +typedef char TThostFtdcReturnStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnPatternTypeһģʽ +///////////////////////////////////////////////////////////////////////// +///ɽ +#define THOST_FTDC_RP_ByVolume '1' +/// +#define THOST_FTDC_RP_ByFeeOnHand '2' + +typedef char TThostFtdcReturnPatternType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///1 +#define THOST_FTDC_RL_Level1 '1' +///2 +#define THOST_FTDC_RL_Level2 '2' +///3 +#define THOST_FTDC_RL_Level3 '3' +///4 +#define THOST_FTDC_RL_Level4 '4' +///5 +#define THOST_FTDC_RL_Level5 '5' +///6 +#define THOST_FTDC_RL_Level6 '6' +///7 +#define THOST_FTDC_RL_Level7 '7' +///8 +#define THOST_FTDC_RL_Level8 '8' +///9 +#define THOST_FTDC_RL_Level9 '9' + +typedef char TThostFtdcReturnLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStandardTypeһ׼ +///////////////////////////////////////////////////////////////////////// +///ֽ׶η +#define THOST_FTDC_RSD_ByPeriod '1' +///ijһ׼ +#define THOST_FTDC_RSD_ByStandard '2' + +typedef char TThostFtdcReturnStandardType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMortgageTypeTypeһѺ +///////////////////////////////////////////////////////////////////////// +///ʳ +#define THOST_FTDC_MT_Out '0' +/// +#define THOST_FTDC_MT_In '1' + +typedef char TThostFtdcMortgageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorSettlementParamIDTypeһͶ߽ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_ISPI_MortgageRatio '4' +///֤㷨 +#define THOST_FTDC_ISPI_MarginWay '5' +///㵥ǷѺ +#define THOST_FTDC_ISPI_BillDeposit '9' + +typedef char TThostFtdcInvestorSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeSettlementParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_ESPI_MortgageRatio '1' +///ʽ +#define THOST_FTDC_ESPI_OtherFundItem '2' +///ʽ뽻 +#define THOST_FTDC_ESPI_OtherFundImport '3' +///нͿý +#define THOST_FTDC_ESPI_CFFEXMinPrepa '6' +///֣㷽ʽ +#define THOST_FTDC_ESPI_CZCESettlementType '7' +///ȡʽ +#define THOST_FTDC_ESPI_ExchDelivFeeMode '9' +///Ͷ߽ȡʽ +#define THOST_FTDC_ESPI_DelivFeeMode '0' +///֣ϳֱֲ֤ȡʽ +#define THOST_FTDC_ESPI_CZCEComMarginType 'A' +///֤ǷŻ +#define THOST_FTDC_ESPI_DceComMarginType 'B' +///ֵȨ֤Żݱ +#define THOST_FTDC_ESPI_OptOutDisCountRate 'a' +///ͱϵ +#define THOST_FTDC_ESPI_OptMiniGuarantee 'b' + +typedef char TThostFtdcExchangeSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ͶߴС +#define THOST_FTDC_SPI_InvestorIDMinLength '1' +///ͶʺŴС +#define THOST_FTDC_SPI_AccountIDMinLength '2' +///Ͷ߿Ĭϵ¼Ȩ +#define THOST_FTDC_SPI_UserRightLogon '3' +///Ͷ߽׽㵥ɽܷʽ +#define THOST_FTDC_SPI_SettlementBillTrade '4' +///ͳһ½ױ뷽ʽ +#define THOST_FTDC_SPI_TradingCode '5' +///Ƿжϴδ˵ijͷʽ +#define THOST_FTDC_SPI_CheckFund '6' +///ǷģȨ +#define THOST_FTDC_SPI_CommModelRight '7' +///Ƿñ֤ģȨ +#define THOST_FTDC_SPI_MarginModelRight '9' +///Ƿ淶ûܼ +#define THOST_FTDC_SPI_IsStandardActive '8' +///ϴĽļ· +#define THOST_FTDC_SPI_UploadSettlementFile 'U' +///ϱ֤ļ· +#define THOST_FTDC_SPI_DownloadCSRCFile 'D' +///ɵĽ㵥ļ· +#define THOST_FTDC_SPI_SettlementBillFile 'S' +///֤ļʶ +#define THOST_FTDC_SPI_CSRCOthersFile 'C' +///ͶƬ· +#define THOST_FTDC_SPI_InvestorPhoto 'P' +///ȫᾭ͹˾ϴļ· +#define THOST_FTDC_SPI_CSRCData 'R' +///¼뷽ʽ +#define THOST_FTDC_SPI_InvestorPwdModel 'I' +///Ͷнļ· +#define THOST_FTDC_SPI_CFFEXInvestorSettleFile 'F' +///Ͷߴ뷽ʽ +#define THOST_FTDC_SPI_InvestorIDType 'a' +///߻Ȩ +#define THOST_FTDC_SPI_FreezeMaxReMain 'r' +///زʵʱϳ +#define THOST_FTDC_SPI_IsSync 'A' +///Ȩ +#define THOST_FTDC_SPI_RelieveOpenLimit 'O' +///Ƿ淶û +#define THOST_FTDC_SPI_IsStandardFreeze 'X' +///֣Ƿ񿪷Ʒױ +#define THOST_FTDC_SPI_CZCENormalProductHedge 'B' + +typedef char TThostFtdcSystemParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ϵͳ㷨 +#define THOST_FTDC_TPID_EncryptionStandard 'E' +///ϵͳ㷨 +#define THOST_FTDC_TPID_RiskMode 'R' +///ϵͳ㷨Ƿȫ 0- 1- +#define THOST_FTDC_TPID_RiskModeGlobal 'G' +///㷨 +#define THOST_FTDC_TPID_modeEncode 'P' +///۸Сλ +#define THOST_FTDC_TPID_tickMode 'T' +///ûỰ +#define THOST_FTDC_TPID_SingleUserSessionMaxNum 'S' +///¼ʧ +#define THOST_FTDC_TPID_LoginFailMaxNum 'L' +///Ƿǿ֤ +#define THOST_FTDC_TPID_IsAuthForce 'A' +///Ƿ񶳽֤ȯֲ +#define THOST_FTDC_TPID_IsPosiFreeze 'F' +///Ƿ޲ +#define THOST_FTDC_TPID_IsPosiLimit 'M' +///֣ѯʱ +#define THOST_FTDC_TPID_ForQuoteTimeInterval 'Q' +///Ƿڻ޲ +#define THOST_FTDC_TPID_IsFuturePosiLimit 'B' +///ǷڻµƵ +#define THOST_FTDC_TPID_IsFutureOrderFreq 'C' +///Ƿ񱨵 +#define THOST_FTDC_TPID_IsOrderTypeLimit 'D' +///ȨǷӯ +#define THOST_FTDC_TPID_IsExecOrderProfit 'H' + +typedef char TThostFtdcTradeParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettlementParamValueType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCounterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCounterIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorGroupNameTypeһͶ߷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrandCodeTypeһƺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrandCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWarehouseTypeһֿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWarehouseType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductDateType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGradeTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcGradeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClassifyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClassifyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPositionType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYieldlyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcYieldlyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWeightTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWeightType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubEntryFundNoTypeһʽˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSubEntryFundNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileIDTypeһļʶ +///////////////////////////////////////////////////////////////////////// +///ʽ +#define THOST_FTDC_FI_SettlementFund 'F' +///ɽ +#define THOST_FTDC_FI_Trade 'T' +///Ͷֲ߳ +#define THOST_FTDC_FI_InvestorPosition 'P' +///Ͷ߷ʽ +#define THOST_FTDC_FI_SubEntryFund 'O' +///ϳֲ +#define THOST_FTDC_FI_CZCECombinationPos 'C' +///ϱ֤ +#define THOST_FTDC_FI_CSRCData 'R' +///֣ƽ˽ +#define THOST_FTDC_FI_CZCEClose 'L' +///֣ƽ˽ +#define THOST_FTDC_FI_CZCENoClose 'N' +///ֲϸ +#define THOST_FTDC_FI_PositionDtl 'D' +///Ȩִļ +#define THOST_FTDC_FI_OptionStrike 'S' +///۱ȶļ +#define THOST_FTDC_FI_SettlementPriceComparison 'M' +///dzֱֲ䶯ϸ +#define THOST_FTDC_FI_NonTradePosChange 'B' + +typedef char TThostFtdcFileIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileTypeTypeһļϴ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FUT_Settlement '0' +///˶ +#define THOST_FTDC_FUT_Check '1' + +typedef char TThostFtdcFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileFormatTypeһļʽ +///////////////////////////////////////////////////////////////////////// +///ıļ(.txt) +#define THOST_FTDC_FFT_Txt '0' +///ѹļ(.zip) +#define THOST_FTDC_FFT_Zip '1' +///DBFļ(.dbf) +#define THOST_FTDC_FFT_DBF '2' + +typedef char TThostFtdcFileFormatType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileUploadStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///ϴɹ +#define THOST_FTDC_FUS_SucceedUpload '1' +///ϴʧ +#define THOST_FTDC_FUS_FailedUpload '2' +///ɹ +#define THOST_FTDC_FUS_SucceedLoad '3' +///벿ֳɹ +#define THOST_FTDC_FUS_PartSucceedLoad '4' +///ʧ +#define THOST_FTDC_FUS_FailedLoad '5' + +typedef char TThostFtdcFileUploadStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferDirectionTypeһƲַ +///////////////////////////////////////////////////////////////////////// +///Ƴ +#define THOST_FTDC_TD_Out '0' +/// +#define THOST_FTDC_TD_In '1' + +typedef char TThostFtdcTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUploadModeTypeһϴļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUploadModeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountIDTypeһͶʺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAccountIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankFlagTypeһͳһʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankFlagType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenNameTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOpenNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenBankTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOpenBankType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishPathTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPublishPathType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperatorIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthCountTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMonthCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAdvanceMonthArrayTypeһ·ǰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAdvanceMonthArrayType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateExprTypeһڱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDateExprType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDExprTypeһԼʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameExprTypeһԼƱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentNameExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSpecialCreateRuleTypeһĴ +///////////////////////////////////////////////////////////////////////// +///ûⴴ +#define THOST_FTDC_SC_NoSpecialRule '0' +/// +#define THOST_FTDC_SC_NoSpringFestival '1' + +typedef char TThostFtdcSpecialCreateRuleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBasisPriceTypeTypeһƻ׼ +///////////////////////////////////////////////////////////////////////// +///һԼ +#define THOST_FTDC_IPT_LastSettlement '1' +///һԼ̼ +#define THOST_FTDC_IPT_LaseClose '2' + +typedef char TThostFtdcBasisPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductLifePhaseTypeһƷ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_PLP_Active '1' +///Ծ +#define THOST_FTDC_PLP_NonActive '2' +///ע +#define THOST_FTDC_PLP_Canceled '3' + +typedef char TThostFtdcProductLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeliveryModeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ֽ𽻸 +#define THOST_FTDC_DM_CashDeliv '1' +///ʵサ +#define THOST_FTDC_DM_CommodityDeliv '2' + +typedef char TThostFtdcDeliveryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLogLevelTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLogLevelType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessNameTypeһ洢 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperationMemoTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperationMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FIOT_FundIO '1' +///ת +#define THOST_FTDC_FIOT_Transfer '2' +///ڻ +#define THOST_FTDC_FIOT_SwapCurrency '3' + +typedef char TThostFtdcFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_FT_Deposite '1' +///ʽ +#define THOST_FTDC_FT_ItemFund '2' +///˾ +#define THOST_FTDC_FT_Company '3' +///ʽת +#define THOST_FTDC_FT_InnerTransfer '4' + +typedef char TThostFtdcFundTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FD_In '1' +/// +#define THOST_FTDC_FD_Out '2' + +typedef char TThostFtdcFundDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundStatusTypeһʽ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_FS_Record '1' +///Ѹ +#define THOST_FTDC_FS_Check '2' +///ѳ +#define THOST_FTDC_FS_Charge '3' + +typedef char TThostFtdcFundStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNoTypeһƱݺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBillNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNameTypeһƱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBillNameType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PS_None '1' +///ڷ +#define THOST_FTDC_PS_Publishing '2' +///ѷ +#define THOST_FTDC_PS_Published '3' + +typedef char TThostFtdcPublishStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueIDTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueTypeTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueLabelTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueLabelType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueResultTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueResultType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_ES_NonActive '1' +/// +#define THOST_FTDC_ES_Startup '2' +///׿ʼʼ +#define THOST_FTDC_ES_Initialize '3' +///ɳʼ +#define THOST_FTDC_ES_Initialized '4' +///пʼ +#define THOST_FTDC_ES_Close '5' +/// +#define THOST_FTDC_ES_Closed '6' +/// +#define THOST_FTDC_ES_Settlement '7' + +typedef char TThostFtdcSystemStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ʼ +#define THOST_FTDC_STS_Initialize '0' +/// +#define THOST_FTDC_STS_Settlementing '1' +///ѽ +#define THOST_FTDC_STS_Settlemented '2' +/// +#define THOST_FTDC_STS_Finished '3' + +typedef char TThostFtdcSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntTypeTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntFromTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntFromType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntToTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntToType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionIDTypeһܴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionValueCodeTypeһܱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionValueCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleIDTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRoleIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleNameTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRoleNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescriptionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDescriptionType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineIDTypeһϱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombineIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombineTypeType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CT_Person '0' +/// +#define THOST_FTDC_CT_Company '1' +///Ͷʻ +#define THOST_FTDC_CT_Fund '2' +///ⷨ +#define THOST_FTDC_CT_SpecialOrgan '3' +///ʹܻ +#define THOST_FTDC_CT_Asset '4' + +typedef char TThostFtdcInvestorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerTypeTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +///׻Ա +#define THOST_FTDC_BT_Trade '0' +///׽Ա +#define THOST_FTDC_BT_TradeSettle '1' + +typedef char TThostFtdcBrokerTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskLevelTypeһյȼ +///////////////////////////////////////////////////////////////////////// +///ͷտͻ +#define THOST_FTDC_FAS_Low '1' +///ͨͻ +#define THOST_FTDC_FAS_Normal '2' +///עͻ +#define THOST_FTDC_FAS_Focus '3' +///տͻ +#define THOST_FTDC_FAS_Risk '4' + +typedef char TThostFtdcRiskLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeeAcceptStyleTypeһȡʽ +///////////////////////////////////////////////////////////////////////// +///ȡ +#define THOST_FTDC_FAS_ByTrade '1' +///ȡ +#define THOST_FTDC_FAS_ByDeliv '2' +/// +#define THOST_FTDC_FAS_None '3' +///ָȡ +#define THOST_FTDC_FAS_FixFee '4' + +typedef char TThostFtdcFeeAcceptStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PWDT_Trade '1' +///ʽ +#define THOST_FTDC_PWDT_Account '2' + +typedef char TThostFtdcPasswordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgorithmTypeһӯ㷨 +///////////////////////////////////////////////////////////////////////// +///ӯ +#define THOST_FTDC_AG_All '1' +///ӯƣ +#define THOST_FTDC_AG_OnlyLost '2' +///ӯƣ +#define THOST_FTDC_AG_OnlyGain '3' +///ӯ +#define THOST_FTDC_AG_None '4' + +typedef char TThostFtdcAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIncludeCloseProfitTypeһǷƽӯ +///////////////////////////////////////////////////////////////////////// +///ƽӯ +#define THOST_FTDC_ICP_Include '0' +///ƽӯ +#define THOST_FTDC_ICP_NotInclude '2' + +typedef char TThostFtdcIncludeCloseProfitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAllWithoutTradeTypeһǷܿ +///////////////////////////////////////////////////////////////////////// +///޲޳ɽܿ +#define THOST_FTDC_AWT_Enable '0' +///ܿ +#define THOST_FTDC_AWT_Disable '2' +///޲ֲܿ +#define THOST_FTDC_AWT_NoHoldEnable '3' + +typedef char TThostFtdcAllWithoutTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommentTypeһӯ㷨˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommentType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVersionTypeһ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcVersionType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeSerialType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradeSerialNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureIDTypeһڻ˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDTypeһд +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBrchIDTypeһзĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankBrchIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBranchIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankBranchIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperNoTypeһ׹Ա +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperNoType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeviceIDTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDeviceIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordNumTypeһ¼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRecordNumType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountTypeһڻʽ˺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccountType[22]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturePwdFlagTypeһʽ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_FPWD_UnCheck '0' +///˶ +#define THOST_FTDC_FPWD_Check '1' + +typedef char TThostFtdcFuturePwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferTypeTypeһת +///////////////////////////////////////////////////////////////////////// +///תڻ +#define THOST_FTDC_TT_BankToFuture '0' +///ڻת +#define THOST_FTDC_TT_FutureToBank '1' + +typedef char TThostFtdcTransferTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccPwdTypeһڻʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccPwdType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyCodeType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetCodeTypeһӦ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRetCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetInfoTypeһӦϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRetInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmtTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUseAmtTypeһп +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUseAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFetchAmtTypeһпȡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFetchAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferValidFlagTypeһתЧ־ +///////////////////////////////////////////////////////////////////////// +///Чʧ +#define THOST_FTDC_TVF_Invalid '0' +///Ч +#define THOST_FTDC_TVF_Valid '1' +/// +#define THOST_FTDC_TVF_Reverse '2' + +typedef char TThostFtdcTransferValidFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertCodeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCertCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReasonTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_RN_CD '0' +///ʽ; +#define THOST_FTDC_RN_ZT '1' +/// +#define THOST_FTDC_RN_QT '2' + +typedef char TThostFtdcReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundProjectIDTypeһʽĿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFundProjectIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSexTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_SEX_None '0' +/// +#define THOST_FTDC_SEX_Man '1' +///Ů +#define THOST_FTDC_SEX_Woman '2' + +typedef char TThostFtdcSexType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProfessionTypeһְҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProfessionType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNationalTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNationalType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProvinceTypeһʡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProvinceType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRegionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRegionType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCountryType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNOTypeһӪҵִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLicenseNOType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCompanyTypeType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessScopeTypeһӪΧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessScopeType[1001]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCapitalCurrencyTypeһעʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCapitalCurrencyType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserTypeTypeһû +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_UT_Investor '0' +///Ա +#define THOST_FTDC_UT_Operator '1' +///Ա +#define THOST_FTDC_UT_SuperUser '2' + +typedef char TThostFtdcUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchIDTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_RATETYPE_MarginRate '2' + +typedef char TThostFtdcRateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNoteTypeTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +///׽㵥 +#define THOST_FTDC_NOTETYPE_TradeSettleBill '1' +///׽± +#define THOST_FTDC_NOTETYPE_TradeSettleMonth '2' +///׷ӱ֤֪ͨ +#define THOST_FTDC_NOTETYPE_CallMarginNotes '3' +///ǿƽ֪ͨ +#define THOST_FTDC_NOTETYPE_ForceCloseNotes '4' +///ɽ֪ͨ +#define THOST_FTDC_NOTETYPE_TradeNotes '5' +///֪ͨ +#define THOST_FTDC_NOTETYPE_DelivNotes '6' + +typedef char TThostFtdcNoteTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStyleTypeһ㵥ʽ +///////////////////////////////////////////////////////////////////////// +///ն +#define THOST_FTDC_SBS_Day '1' +///ʶԳ +#define THOST_FTDC_SBS_Volume '2' + +typedef char TThostFtdcSettlementStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDNSTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerDNSType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSentenceTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSentenceType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementBillTypeTypeһ㵥 +///////////////////////////////////////////////////////////////////////// +///ձ +#define THOST_FTDC_ST_Day '0' +///± +#define THOST_FTDC_ST_Month '1' + +typedef char TThostFtdcSettlementBillTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRightTypeTypeһͻȨ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_URT_Logon '1' +///ת +#define THOST_FTDC_URT_Transfer '2' +///ʼĽ㵥 +#define THOST_FTDC_URT_EMail '3' +///㵥 +#define THOST_FTDC_URT_Fax '4' +/// +#define THOST_FTDC_URT_ConditionOrder '5' + +typedef char TThostFtdcUserRightTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginPriceTypeTypeһ֤۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_MPT_PreSettlementPrice '1' +///¼ +#define THOST_FTDC_MPT_SettlementPrice '2' +///ɽ +#define THOST_FTDC_MPT_AveragePrice '3' +///ּ +#define THOST_FTDC_MPT_OpenPrice '4' + +typedef char TThostFtdcMarginPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillGenStatusTypeһ㵥״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_BGS_None '0' +/// +#define THOST_FTDC_BGS_NoGenerated '1' +/// +#define THOST_FTDC_BGS_Generated '2' + +typedef char TThostFtdcBillGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgoTypeTypeһ㷨 +///////////////////////////////////////////////////////////////////////// +///ֲִ㷨 +#define THOST_FTDC_AT_HandlePositionAlgo '1' +///Ѱұ֤㷨 +#define THOST_FTDC_AT_FindMarginRateAlgo '2' + +typedef char TThostFtdcAlgoTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandlePositionAlgoIDTypeһֲִ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HPA_Base '1' +///Ʒ +#define THOST_FTDC_HPA_DCE '2' +///֣Ʒ +#define THOST_FTDC_HPA_CZCE '3' + +typedef char TThostFtdcHandlePositionAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFindMarginRateAlgoIDTypeһѰұ֤㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FMRA_Base '1' +///Ʒ +#define THOST_FTDC_FMRA_DCE '2' +///֣Ʒ +#define THOST_FTDC_FMRA_CZCE '3' + +typedef char TThostFtdcFindMarginRateAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandleTradingAccountAlgoIDTypeһʽ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HTAA_Base '1' +///Ʒ +#define THOST_FTDC_HTAA_DCE '2' +///֣Ʒ +#define THOST_FTDC_HTAA_CZCE '3' + +typedef char TThostFtdcHandleTradingAccountAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPersonTypeTypeһϵ +///////////////////////////////////////////////////////////////////////// +///ָµ +#define THOST_FTDC_PST_Order '1' +///Ȩ +#define THOST_FTDC_PST_Open '2' +///ʽ +#define THOST_FTDC_PST_Fund '3' +///㵥ȷ +#define THOST_FTDC_PST_Settlement '4' +/// +#define THOST_FTDC_PST_Company '5' +///˴ +#define THOST_FTDC_PST_Corporation '6' +///Ͷϵ +#define THOST_FTDC_PST_LinkMan '7' +///ֻʲ +#define THOST_FTDC_PST_Ledger '8' +///У +#define THOST_FTDC_PST_Trustee '9' +///Уܻ˴ +#define THOST_FTDC_PST_TrusteeCorporation 'A' +///УܻȨ +#define THOST_FTDC_PST_TrusteeOpen 'B' +///Уܻϵ +#define THOST_FTDC_PST_TrusteeContact 'C' +///Ȼ˲ο֤ +#define THOST_FTDC_PST_ForeignerRefer 'D' +///˴ο֤ +#define THOST_FTDC_PST_CorporationRefer 'E' + +typedef char TThostFtdcPersonTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryInvestorRangeTypeһѯΧ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_QIR_All '1' +///ѯ +#define THOST_FTDC_QIR_Group '2' +///һͶ +#define THOST_FTDC_QIR_Single '3' + +typedef char TThostFtdcQueryInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRiskStatusTypeһͶ߷״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IRS_Normal '1' +/// +#define THOST_FTDC_IRS_Warn '2' +///׷ +#define THOST_FTDC_IRS_Call '3' +///ǿƽ +#define THOST_FTDC_IRS_Force '4' +///쳣 +#define THOST_FTDC_IRS_Exception '5' + +typedef char TThostFtdcInvestorRiskStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegIDTypeһȱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLegIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegMultipleTypeһȳ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLegMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImplyLevelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcImplyLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearAccountType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNOTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganNOType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearbarchIDTypeһ˻к +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearbarchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventTypeTypeһû¼ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_UET_Login '1' +///dz +#define THOST_FTDC_UET_Logout '2' +///׳ɹ +#define THOST_FTDC_UET_Trading '3' +///ʧ +#define THOST_FTDC_UET_TradingError '4' +///޸ +#define THOST_FTDC_UET_UpdatePassword '5' +///ͻ֤ +#define THOST_FTDC_UET_Authenticate '6' +/// +#define THOST_FTDC_UET_Other '9' + +typedef char TThostFtdcUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventInfoTypeһû¼Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserEventInfoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseStyleTypeһƽַʽ +///////////////////////////////////////////////////////////////////////// +///ȿƽ +#define THOST_FTDC_ICS_Close '0' +///ƽƽ +#define THOST_FTDC_ICS_CloseToday '1' + +typedef char TThostFtdcCloseStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStatModeTypeһͳƷʽ +///////////////////////////////////////////////////////////////////////// +///---- +#define THOST_FTDC_SM_Non '0' +///Լͳ +#define THOST_FTDC_SM_Instrument '1' +///Ʒͳ +#define THOST_FTDC_SM_Product '2' +///Ͷͳ +#define THOST_FTDC_SM_Investor '3' + +typedef char TThostFtdcStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderStatusTypeһԤ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PAOS_NotSend '1' +///ѷ +#define THOST_FTDC_PAOS_Send '2' +///ɾ +#define THOST_FTDC_PAOS_Deleted '3' + +typedef char TThostFtdcParkedOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderIDTypeһԤ񱨵 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParkedOrderIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderActionIDTypeһԤ񳷵 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParkedOrderActionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirDealStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ڴ +#define THOST_FTDC_VDS_Dealing '1' +///ɹ +#define THOST_FTDC_VDS_DeaclSucceed '2' + +typedef char TThostFtdcVirDealStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrgSystemIDTypeһԭϵͳ +///////////////////////////////////////////////////////////////////////// +///ۺϽƽ̨ +#define THOST_FTDC_ORGS_Standard '0' +///ʢϵͳ +#define THOST_FTDC_ORGS_ESunny '1' +///˴V6ϵͳ +#define THOST_FTDC_ORGS_KingStarV6 '2' + +typedef char TThostFtdcOrgSystemIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirTradeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VTS_NaturalDeal '0' +///ɹ +#define THOST_FTDC_VTS_SucceedEnd '1' +///ʧܽ +#define THOST_FTDC_VTS_FailedEND '2' +///쳣 +#define THOST_FTDC_VTS_Exception '3' +///˹쳣 +#define THOST_FTDC_VTS_ManualDeal '4' +///ͨѶ쳣 ˹ +#define THOST_FTDC_VTS_MesException '5' +///ϵͳ˹ +#define THOST_FTDC_VTS_SysException '6' + +typedef char TThostFtdcVirTradeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirBankAccTypeTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VBAT_BankBook '1' +/// +#define THOST_FTDC_VBAT_BankCard '2' +///ÿ +#define THOST_FTDC_VBAT_CreditCard '3' + +typedef char TThostFtdcVirBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementStatusTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VMS_Natural '0' +/// +#define THOST_FTDC_VMS_Canceled '9' + +typedef char TThostFtdcVirementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementAvailAbilityTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define THOST_FTDC_VAA_NoAvailAbility '0' +///Ч +#define THOST_FTDC_VAA_AvailAbility '1' +/// +#define THOST_FTDC_VAA_Repeal '2' + +typedef char TThostFtdcVirementAvailAbilityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +///зʽתڻ +#define THOST_FTDC_VTC_BankBankToFuture '102001' +///зڻʽת +#define THOST_FTDC_VTC_BankFutureToBank '102002' +///ڻʽתڻ +#define THOST_FTDC_VTC_FutureBankToFuture '202001' +///ڻڻʽת +#define THOST_FTDC_VTC_FutureFutureToBank '202002' + +typedef char TThostFtdcVirementTradeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoTypeNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeIDTypeһӰʹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoTypeIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTopicIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTopicIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportTypeIDTypeһױͱʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcReportTypeIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCharacterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCharacterIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInvestorTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLIdCardTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeDirectTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradeDirectType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeModelTypeһʽʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradeModelType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLOpParamValueTypeһҵֵ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcAMLOpParamValueType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCustomerCardTypeTypeһͻ֤/֤ļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCustomerCardTypeType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionNameTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLDistrictIDTypeһڻڵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLDistrictIDType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLRelationShipTypeһڻ׵Ĺϵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLRelationShipType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionIDTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLAccountTypeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradingTypeTypeһ׷ʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradingTypeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTransactClassTypeһ֧׷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTransactClassType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalIOTypeһʽոʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCapitalIOType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSiteTypeһ׵ص +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSiteType[10]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalPurposeTypeһʽ; +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCapitalPurposeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLReportTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSerialNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSerialNoType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLGenStatusTypeһAmlɷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_GEN_Program '0' +///˹ +#define THOST_FTDC_GEN_HandWork '1' + +typedef char TThostFtdcAMLGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSeqCodeTypeһҵʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSeqCodeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileNameTypeһAMLļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLMoneyTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcAMLMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileAmountTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcAMLFileAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCKeyTypeһԿ(֤) +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCFMMCKeyType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCTokenTypeһ(֤) +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCFMMCTokenType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCKeyKindTypeһ̬Կ(֤) +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CFMMCKK_REQUEST 'R' +///CFMMCԶ +#define THOST_FTDC_CFMMCKK_AUTO 'A' +///CFMMCֶ +#define THOST_FTDC_CFMMCKK_MANUAL 'M' + +typedef char TThostFtdcCFMMCKeyKindType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLReportNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFComdTypeTypeһDBF +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFComdTypeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFComTimeTypeһDBFʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFComTimeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFComNoTypeһDBFˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFComNoType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFFdNameTypeһDBFֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFFdNameType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFFdContentTypeһDBFֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFFdContentType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndividualNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIndividualNameType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyIDTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustNumberTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCustNumberType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganCodeType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSuperOrganCodeTypeһϼ,ڻ˾ܲ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSuperOrganCodeType[12]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchIDTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchNameTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSubBranchNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchNetCodeType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchNetNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganFlagTypeһʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCodingForFutureTypeһжڻ˾ı +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankCodingForFutureType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankReturnCodeTypeһжԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateReturnCodeTypeһתƽ̨ԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPlateReturnCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSubBranchIDTypeһз֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureBranchIDTypeһڻ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnCodeTypeһش +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorCodeTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperatorCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearDepIDTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearBrchIDTypeһʻк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvDepIDTypeһͶ˺Ż +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvBrchIDTypeһͶк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMessageFormatVersionTypeһϢʽ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMessageFormatVersionType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDigestTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDigestType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthenticDataTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthenticDataType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPasswordKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountNameTypeһڻʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccountNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobilePhoneTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMobilePhoneType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureMainKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureWorkKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTransKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankMainKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankWorkKeyTypeһйԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankTransKeyTypeһдԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankServerDescriptionTypeһзϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankServerDescriptionType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddInfoTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAddInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescrInfoForReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDescrInfoForReturnCodeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCountryCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateSerialTypeһƽ̨ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcPlateSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankSerialType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorrectSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCorrectSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureSerialTypeһڻ˾ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFutureSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplicationIDTypeһӦñʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcApplicationIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankProxyIDTypeһдʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBankProxyIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTCoreIDTypeһתʺϵͳʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBTCoreIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServerPortTypeһ˿ں +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServerPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealedTimesTypeһѾ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRepealedTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealTimeIntervalTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRepealTimeIntervalType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalTimesTypeһÿۼתʴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTotalTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTRequestIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBTRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmountTypeһ׽Ԫ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcTradeAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustFeeTypeһӦտͻãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCustFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureFeeTypeһӦڻ˾ãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcFutureFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMaxAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcSingleMaxAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMinAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcSingleMinAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalAmtTypeһÿۼתʶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcTotalAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertificationTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_CFT_IDCard '0' +/// +#define THOST_FTDC_CFT_Passport '1' +///֤ +#define THOST_FTDC_CFT_OfficerIDCard '2' +///ʿ֤ +#define THOST_FTDC_CFT_SoldierIDCard '3' +///֤ +#define THOST_FTDC_CFT_HomeComingCard '4' +///ڲ +#define THOST_FTDC_CFT_HouseholdRegister '5' +///Ӫҵִպ +#define THOST_FTDC_CFT_LicenseNo '6' +///֤֯ +#define THOST_FTDC_CFT_InstitutionCodeCard '7' +///ʱӪҵִպ +#define THOST_FTDC_CFT_TempLicenseNo '8' +///ҵǼ֤ +#define THOST_FTDC_CFT_NoEnterpriseLicenseNo '9' +///֤ +#define THOST_FTDC_CFT_OtherCard 'x' +///ܲ +#define THOST_FTDC_CFT_SuperDepAgree 'a' + +typedef char TThostFtdcCertificationTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileBusinessCodeTypeһļҵ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBC_Others '0' +///ת˽ϸ +#define THOST_FTDC_FBC_TransferDetails '1' +///ͻ˻״̬ +#define THOST_FTDC_FBC_CustAccStatus '2' +///˻ཻϸ +#define THOST_FTDC_FBC_AccountTradeDetails '3' +///ڻ˻Ϣϸ +#define THOST_FTDC_FBC_FutureAccountChangeInfoDetails '4' +///ͻʽ̨ϸ +#define THOST_FTDC_FBC_CustMoneyDetail '5' +///ͻϢϸ +#define THOST_FTDC_FBC_CustCancelAccountInfo '6' +///ͻʽ˽ +#define THOST_FTDC_FBC_CustMoneyResult '7' +///쳣ļ +#define THOST_FTDC_FBC_OthersExceptionResult '8' +///ͻϢϸ +#define THOST_FTDC_FBC_CustInterestNetMoneyDetails '9' +///ͻʽϸ +#define THOST_FTDC_FBC_CustMoneySendAndReceiveDetails 'a' +///˴ʽջ +#define THOST_FTDC_FBC_CorporationMoneyTotal 'b' +///ʽջ +#define THOST_FTDC_FBC_MainbodyMoneyTotal 'c' +///ܷƽ +#define THOST_FTDC_FBC_MainPartMonitorData 'd' +///б +#define THOST_FTDC_FBC_PreparationMoney 'e' +///Эʽ +#define THOST_FTDC_FBC_BankMoneyMonitorData 'f' + +typedef char TThostFtdcFileBusinessCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCashExchangeCodeTypeһ㳮־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CEC_Exchange '1' +/// +#define THOST_FTDC_CEC_Cash '2' + +typedef char TThostFtdcCashExchangeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYesNoIndicatorTypeһǻʶ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_YNI_Yes '0' +/// +#define THOST_FTDC_YNI_No '1' + +typedef char TThostFtdcYesNoIndicatorType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBanlanceTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define THOST_FTDC_BLT_CurrentMoney '0' +/// +#define THOST_FTDC_BLT_UsableMoney '1' +///ȡ +#define THOST_FTDC_BLT_FetchableMoney '2' +/// +#define THOST_FTDC_BLT_FreezeMoney '3' + +typedef char TThostFtdcBanlanceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGenderTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪״̬ +#define THOST_FTDC_GD_Unknown '0' +/// +#define THOST_FTDC_GD_Male '1' +///Ů +#define THOST_FTDC_GD_Female '2' + +typedef char TThostFtdcGenderType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeePayFlagTypeһ֧־ +///////////////////////////////////////////////////////////////////////// +///淽֧ +#define THOST_FTDC_FPF_BEN '0' +///ɷͷ֧ +#define THOST_FTDC_FPF_OUR '1' +///ɷͷ֧ķã淽֧ܵķ +#define THOST_FTDC_FPF_SHA '2' + +typedef char TThostFtdcFeePayFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPassWordKeyTypeTypeһԿ +///////////////////////////////////////////////////////////////////////// +///Կ +#define THOST_FTDC_PWKT_ExchangeKey '0' +///Կ +#define THOST_FTDC_PWKT_PassWordKey '1' +///MACԿ +#define THOST_FTDC_PWKT_MACKey '2' +///Կ +#define THOST_FTDC_PWKT_MessageKey '3' + +typedef char TThostFtdcPassWordKeyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTPassWordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ѯ +#define THOST_FTDC_PWT_Query '0' +///ȡ +#define THOST_FTDC_PWT_Fetch '1' +///ת +#define THOST_FTDC_PWT_Transfer '2' +/// +#define THOST_FTDC_PWT_Trade '3' + +typedef char TThostFtdcFBTPassWordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTEncryModeTypeһܷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EM_NoEncry '0' +///DES +#define THOST_FTDC_EM_DES '1' +///3DES +#define THOST_FTDC_EM_3DES '2' + +typedef char TThostFtdcFBTEncryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankRepealFlagTypeһг־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define THOST_FTDC_BRF_BankNotNeedRepeal '0' +///дԶ +#define THOST_FTDC_BRF_BankWaitingRepeal '1' +///Զ +#define THOST_FTDC_BRF_BankBeenRepealed '2' + +typedef char TThostFtdcBankRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerRepealFlagTypeһ̳־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define THOST_FTDC_BRORF_BrokerNotNeedRepeal '0' +///̴Զ +#define THOST_FTDC_BRORF_BrokerWaitingRepeal '1' +///Զ +#define THOST_FTDC_BRORF_BrokerBeenRepealed '2' + +typedef char TThostFtdcBrokerRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstitutionTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TS_Bank '0' +/// +#define THOST_FTDC_TS_Future '1' +///ȯ +#define THOST_FTDC_TS_Store '2' + +typedef char TThostFtdcInstitutionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastFragmentTypeһƬ־ +///////////////////////////////////////////////////////////////////////// +///Ƭ +#define THOST_FTDC_LF_Yes '0' +///Ƭ +#define THOST_FTDC_LF_No '1' + +typedef char TThostFtdcLastFragmentType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccStatusTypeһ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_BAS_Normal '0' +/// +#define THOST_FTDC_BAS_Freeze '1' +///ʧ +#define THOST_FTDC_BAS_ReportLoss '2' + +typedef char TThostFtdcBankAccStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyAccountStatusTypeһʽ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_MAS_Normal '0' +/// +#define THOST_FTDC_MAS_Cancel '1' + +typedef char TThostFtdcMoneyAccountStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcManageStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ָ +#define THOST_FTDC_MSS_Point '0' +///Ԥָ +#define THOST_FTDC_MSS_PrePoint '1' +///ָ +#define THOST_FTDC_MSS_CancelPoint '2' + +typedef char TThostFtdcManageStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemTypeTypeһӦϵͳ +///////////////////////////////////////////////////////////////////////// +///ת +#define THOST_FTDC_SYT_FutureBankTransfer '0' +///֤ת +#define THOST_FTDC_SYT_StockBankTransfer '1' +/// +#define THOST_FTDC_SYT_TheThirdPartStore '2' + +typedef char TThostFtdcSystemTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTxnEndFlagTypeһתʻת־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TEF_NormalProcessing '0' +///ɹ +#define THOST_FTDC_TEF_Success '1' +///ʧܽ +#define THOST_FTDC_TEF_Failed '2' +///쳣 +#define THOST_FTDC_TEF_Abnormal '3' +///˹쳣 +#define THOST_FTDC_TEF_ManualProcessedForException '4' +///ͨѶ쳣 ˹ +#define THOST_FTDC_TEF_CommuFailedNeedManualProcess '5' +///ϵͳ˹ +#define THOST_FTDC_TEF_SysErrorNeedManualProcess '6' + +typedef char TThostFtdcTxnEndFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessStatusTypeһתʷ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PSS_NotProcess '0' +///ʼ +#define THOST_FTDC_PSS_StartProcess '1' +/// +#define THOST_FTDC_PSS_Finished '2' + +typedef char TThostFtdcProcessStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CUSTT_Person '0' +/// +#define THOST_FTDC_CUSTT_Institution '1' + +typedef char TThostFtdcCustTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTransferDirectionTypeһתʷ +///////////////////////////////////////////////////////////////////////// +///תڻ +#define THOST_FTDC_FBTTD_FromBankToFuture '1' +///ڻת +#define THOST_FTDC_FBTTD_FromFutureToBank '2' + +typedef char TThostFtdcFBTTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenOrDestroyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OOD_Open '1' +/// +#define THOST_FTDC_OOD_Destroy '0' + +typedef char TThostFtdcOpenOrDestroyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAvailabilityFlagTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define THOST_FTDC_AVAF_Invalid '0' +///Ч +#define THOST_FTDC_AVAF_Valid '1' +/// +#define THOST_FTDC_AVAF_Repeal '2' + +typedef char TThostFtdcAvailabilityFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_OT_Bank '1' +///ǰ +#define THOST_FTDC_OT_Future '2' +///תƽ̨ +#define THOST_FTDC_OT_PlateForm '9' + +typedef char TThostFtdcOrganTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///лܲ +#define THOST_FTDC_OL_HeadQuarters '1' +///зĻڻ˾Ӫҵ +#define THOST_FTDC_OL_Branch '2' + +typedef char TThostFtdcOrganLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocalIDTypeһЭ +///////////////////////////////////////////////////////////////////////// +///Э +#define THOST_FTDC_PID_FutureProtocal '0' +///Э +#define THOST_FTDC_PID_ICBCProtocal '1' +///ũЭ +#define THOST_FTDC_PID_ABCProtocal '2' +///йЭ +#define THOST_FTDC_PID_CBCProtocal '3' +///Э +#define THOST_FTDC_PID_CCBProtocal '4' +///Э +#define THOST_FTDC_PID_BOCOMProtocal '5' +///תƽ̨Э +#define THOST_FTDC_PID_FBTPlateFormProtocal 'X' + +typedef char TThostFtdcProtocalIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConnectModeTypeһ׽ӷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CM_ShortConnect '0' +/// +#define THOST_FTDC_CM_LongConnect '1' + +typedef char TThostFtdcConnectModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncModeTypeһ׽ͨŷʽ +///////////////////////////////////////////////////////////////////////// +///첽 +#define THOST_FTDC_SRM_ASync '0' +///ͬ +#define THOST_FTDC_SRM_Sync '1' + +typedef char TThostFtdcSyncModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccTypeTypeһʺ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_BAT_BankBook '1' +/// +#define THOST_FTDC_BAT_SavingCard '2' +///ÿ +#define THOST_FTDC_BAT_CreditCard '3' + +typedef char TThostFtdcBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccTypeTypeһڻ˾ʺ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_FAT_BankBook '1' +/// +#define THOST_FTDC_FAT_SavingCard '2' +///ÿ +#define THOST_FTDC_FAT_CreditCard '3' + +typedef char TThostFtdcFutureAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OS_Ready '0' +///ǩ +#define THOST_FTDC_OS_CheckIn '1' +///ǩ +#define THOST_FTDC_OS_CheckOut '2' +///ļ +#define THOST_FTDC_OS_CheckFileArrived '3' +/// +#define THOST_FTDC_OS_CheckDetail '4' +/// +#define THOST_FTDC_OS_DayEndClean '5' +///ע +#define THOST_FTDC_OS_Invalid '9' + +typedef char TThostFtdcOrganStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCCBFeeModeTypeһշģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CCBFM_ByAmount '1' +///¿ +#define THOST_FTDC_CCBFM_ByMonth '2' + +typedef char TThostFtdcCCBFeeModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiTypeTypeһͨѶAPI +///////////////////////////////////////////////////////////////////////// +///ͻ +#define THOST_FTDC_CAPIT_Client '1' +/// +#define THOST_FTDC_CAPIT_Server '2' +///ϵͳUserApi +#define THOST_FTDC_CAPIT_UserApi '3' + +typedef char TThostFtdcCommApiTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServiceIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceLineNoTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServiceLineNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcServiceNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLinkStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿ +#define THOST_FTDC_LS_Connected '1' +///û +#define THOST_FTDC_LS_Disconnected '2' + +typedef char TThostFtdcLinkStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiPointerTypeһͨѶAPIָ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCommApiPointerType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPwdFlagTypeһ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_BPWDF_NoCheck '0' +///ĺ˶ +#define THOST_FTDC_BPWDF_BlankCheck '1' +///ĺ˶ +#define THOST_FTDC_BPWDF_EncryptCheck '2' + +typedef char TThostFtdcPwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSecuAccTypeTypeһڻʺ +///////////////////////////////////////////////////////////////////////// +///ʽʺ +#define THOST_FTDC_SAT_AccountID '1' +///ʽ𿨺 +#define THOST_FTDC_SAT_CardID '2' +///Ϻɶʺ +#define THOST_FTDC_SAT_SHStockholderID '3' +///ڹɶʺ +#define THOST_FTDC_SAT_SZStockholderID '4' + +typedef char TThostFtdcSecuAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferStatusTypeһת˽״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TRFS_Normal '0' +/// +#define THOST_FTDC_TRFS_Repealed '1' + +typedef char TThostFtdcTransferStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSponsorTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SPTYPE_Broker '0' +/// +#define THOST_FTDC_SPTYPE_Bank '1' + +typedef char TThostFtdcSponsorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReqRspTypeTypeһӦ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_REQRSP_Request '0' +///Ӧ +#define THOST_FTDC_REQRSP_Response '1' + +typedef char TThostFtdcReqRspTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTUserEventTypeTypeһתû¼ +///////////////////////////////////////////////////////////////////////// +///ǩ +#define THOST_FTDC_FBTUET_SignIn '0' +///תڻ +#define THOST_FTDC_FBTUET_FromBankToFuture '1' +///ڻת +#define THOST_FTDC_FBTUET_FromFutureToBank '2' +/// +#define THOST_FTDC_FBTUET_OpenAccount '3' +/// +#define THOST_FTDC_FBTUET_CancelAccount '4' +///˻ +#define THOST_FTDC_FBTUET_ChangeAccount '5' +///תڻ +#define THOST_FTDC_FBTUET_RepealFromBankToFuture '6' +///ڻת +#define THOST_FTDC_FBTUET_RepealFromFutureToBank '7' +///ѯ˻ +#define THOST_FTDC_FBTUET_QueryBankAccount '8' +///ѯڻ˻ +#define THOST_FTDC_FBTUET_QueryFutureAccount '9' +///ǩ +#define THOST_FTDC_FBTUET_SignOut 'A' +///Կͬ +#define THOST_FTDC_FBTUET_SyncKey 'B' +/// +#define THOST_FTDC_FBTUET_Other 'Z' + +typedef char TThostFtdcFBTUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDByBankTypeһԼı +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankIDByBankType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankOperNoTypeһвԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankOperNoType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCustNoTypeһпͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankCustNoType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBOPSeqNoTypeһк +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDBOPSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTableNameTypeһFBT +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTableNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPKNameTypeһFBT +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPKNameType[201]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPKValueTypeһFBTֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPKValueType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBOperationTypeһ¼ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_DBOP_Insert '0' +/// +#define THOST_FTDC_DBOP_Update '1' +///ɾ +#define THOST_FTDC_DBOP_Delete '2' + +typedef char TThostFtdcDBOperationType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncFlagTypeһͬ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_SYNF_Yes '0' +///δͬ +#define THOST_FTDC_SYNF_No '1' + +typedef char TThostFtdcSyncFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTargetIDTypeһͬĿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTargetIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncTypeTypeһͬ +///////////////////////////////////////////////////////////////////////// +///һͬ +#define THOST_FTDC_SYNT_OneOffSync '0' +///ʱͬ +#define THOST_FTDC_SYNT_TimerSync '1' +///ʱȫͬ +#define THOST_FTDC_SYNT_TimerFullSync '2' + +typedef char TThostFtdcSyncTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBETimeTypeһֻʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBETimeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankNoTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBECertNoTypeһƾ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBECertNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExDirectionTypeһ㷽 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBEDIR_Settlement '0' +///ۻ +#define THOST_FTDC_FBEDIR_Sale '1' + +typedef char TThostFtdcExDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankAccountType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankAccountNameTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankAccountNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEAmtTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcFBEAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBusinessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEPostScriptTypeһ㸽 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEPostScriptType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBERemarkTypeһ㱸ע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBERemarkType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExRateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcExRateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEResultFlagTypeһɹ־ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_FBERES_Success '0' +///˻ +#define THOST_FTDC_FBERES_InsufficientBalance '1' +///׽δ֪ +#define THOST_FTDC_FBERES_UnknownTrading '8' +///ʧ +#define THOST_FTDC_FBERES_Fail 'x' + +typedef char TThostFtdcFBEResultFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBERtnMsgTypeһ㷵Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBERtnMsgType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEExtendMsgTypeһչϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEExtendMsgType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBusinessSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBusinessSerialType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBESystemSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBESystemSerialType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBETotalExCntTypeһ㽻ܱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBETotalExCntType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEExchStatusTypeһ㽻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBEES_Normal '0' +///ط +#define THOST_FTDC_FBEES_ReExchange '1' + +typedef char TThostFtdcFBEExchStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEFileFlagTypeһļ־ +///////////////////////////////////////////////////////////////////////// +///ݰ +#define THOST_FTDC_FBEFG_DataPackage '0' +///ļ +#define THOST_FTDC_FBEFG_File '1' + +typedef char TThostFtdcFBEFileFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEAlreadyTradeTypeһѽױ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FBEAT_NotTrade '0' +///ѽ +#define THOST_FTDC_FBEAT_Trade '1' + +typedef char TThostFtdcFBEAlreadyTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEOpenBankTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEOpenBankType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEUserEventTypeTypeһڻû¼ +///////////////////////////////////////////////////////////////////////// +///ǩ +#define THOST_FTDC_FBEUET_SignIn '0' +/// +#define THOST_FTDC_FBEUET_Exchange '1' +///ط +#define THOST_FTDC_FBEUET_ReExchange '2' +///˻ѯ +#define THOST_FTDC_FBEUET_QueryBankAccount '3' +///ϸѯ +#define THOST_FTDC_FBEUET_QueryExchDetial '4' +///ܲѯ +#define THOST_FTDC_FBEUET_QueryExchSummary '5' +///ʲѯ +#define THOST_FTDC_FBEUET_QueryExchRate '6' +///ļ֪ͨ +#define THOST_FTDC_FBEUET_CheckBankAccount '7' +///ǩ +#define THOST_FTDC_FBEUET_SignOut '8' +/// +#define THOST_FTDC_FBEUET_Other 'Z' + +typedef char TThostFtdcFBEUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEFileNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBatchSerialTypeһκ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBatchSerialType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEReqFlagTypeһ㷢ͱ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FBERF_UnProcessed '0' +///ȴ +#define THOST_FTDC_FBERF_WaitSend '1' +///ͳɹ +#define THOST_FTDC_FBERF_SendSuccess '2' +///ʧ +#define THOST_FTDC_FBERF_SendFailed '3' +///ȴط +#define THOST_FTDC_FBERF_WaitReSend '4' + +typedef char TThostFtdcFBEReqFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNotifyClassTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_NC_NOERROR '0' +///ʾ +#define THOST_FTDC_NC_Warn '1' +///׷ +#define THOST_FTDC_NC_Call '2' +///ǿƽ +#define THOST_FTDC_NC_Force '3' +/// +#define THOST_FTDC_NC_CHUANCANG '4' +///쳣 +#define THOST_FTDC_NC_Exception '5' + +typedef char TThostFtdcNotifyClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNofityInfoTypeһͻ֪ͨϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRiskNofityInfoType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseSceneIdTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcForceCloseSceneIdType[24]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseTypeTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +///ֹǿƽ +#define THOST_FTDC_FCT_Manual '0' +///һͶ߸ǿƽ +#define THOST_FTDC_FCT_Single '1' +///Ͷ߸ǿƽ +#define THOST_FTDC_FCT_Group '2' + +typedef char TThostFtdcForceCloseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDsTypeһƷ,+ָ,cu+zn +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDsType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyMethodTypeһ֪ͨ; +///////////////////////////////////////////////////////////////////////// +///ϵͳ֪ͨ +#define THOST_FTDC_RNM_System '0' +///֪ͨ +#define THOST_FTDC_RNM_SMS '1' +///ʼ֪ͨ +#define THOST_FTDC_RNM_EMail '2' +///˹֪ͨ +#define THOST_FTDC_RNM_Manual '3' + +typedef char TThostFtdcRiskNotifyMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyStatusTypeһ֪ͨ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_RNS_NotGen '0' +///δ +#define THOST_FTDC_RNS_Generated '1' +///ʧ +#define THOST_FTDC_RNS_SendError '2' +///ѷδ +#define THOST_FTDC_RNS_SendOk '3' +///ѽδȷ +#define THOST_FTDC_RNS_Received '4' +///ȷ +#define THOST_FTDC_RNS_Confirmed '5' + +typedef char TThostFtdcRiskNotifyStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskUserEventTypeһû¼ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_RUE_ExportData '0' + +typedef char TThostFtdcRiskUserEventType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParamNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParamValueType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConditionalOrderSortTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ʹ¼ +#define THOST_FTDC_COST_LastPriceAsc '0' +///ʹ¼۽ +#define THOST_FTDC_COST_LastPriceDesc '1' +///ʹ +#define THOST_FTDC_COST_AskPriceAsc '2' +///ʹ۽ +#define THOST_FTDC_COST_AskPriceDesc '3' +///ʹ +#define THOST_FTDC_COST_BidPriceAsc '4' +///ʹ۽ +#define THOST_FTDC_COST_BidPriceDesc '5' + +typedef char TThostFtdcConditionalOrderSortTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendTypeTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UOAST_NoSend '0' +///ѷ +#define THOST_FTDC_UOAST_Sended '1' +/// +#define THOST_FTDC_UOAST_Generated '2' +///ʧ +#define THOST_FTDC_UOAST_SendFail '3' +///ճɹ +#define THOST_FTDC_UOAST_Success '4' +///ʧ +#define THOST_FTDC_UOAST_Fail '5' +///ȡ +#define THOST_FTDC_UOAST_Cancel '6' + +typedef char TThostFtdcSendTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDStatusTypeһױ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UOACS_NoApply '1' +///ύ +#define THOST_FTDC_UOACS_Submited '2' +///ѷ +#define THOST_FTDC_UOACS_Sended '3' +/// +#define THOST_FTDC_UOACS_Success '4' +///ܾ +#define THOST_FTDC_UOACS_Refuse '5' +///ѳ +#define THOST_FTDC_UOACS_Cancel '6' + +typedef char TThostFtdcClientIDStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndustryIDTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIndustryIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionIDTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcQuestionIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionContentTypeһϢ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcQuestionContentType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionIDTypeһѡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOptionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionContentTypeһѡ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOptionContentType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionTypeTypeһϢ +///////////////////////////////////////////////////////////////////////// +///ѡ +#define THOST_FTDC_QT_Radio '1' +///ѡ +#define THOST_FTDC_QT_Option '2' +/// +#define THOST_FTDC_QT_Blank '3' + +typedef char TThostFtdcQuestionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessIDTypeһҵˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAProcessStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAProcessStatusType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessTypeTypeһ̹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_BT_Request '1' +///Ӧ +#define THOST_FTDC_BT_Response '2' +///֪ͨ +#define THOST_FTDC_BT_Notice '3' + +typedef char TThostFtdcBusinessTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCfmmcReturnCodeTypeһķ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_CRC_Success '0' +///ÿͻѾڴ +#define THOST_FTDC_CRC_Working '1' +///пͻϼʧ +#define THOST_FTDC_CRC_InfoFail '2' +///ʵƼʧ +#define THOST_FTDC_CRC_IDCardFail '3' +/// +#define THOST_FTDC_CRC_OtherFail '4' + +typedef char TThostFtdcCfmmcReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcExReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CfMMCCT_All '0' +/// +#define THOST_FTDC_CfMMCCT_Person '1' +///λ +#define THOST_FTDC_CfMMCCT_Company '2' +/// +#define THOST_FTDC_CfMMCCT_Other '3' +///ⷨ +#define THOST_FTDC_CfMMCCT_SpecialOrgan '4' +///ʹܻ +#define THOST_FTDC_CfMMCCT_Asset '5' + +typedef char TThostFtdcClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///Ϻڻ +#define THOST_FTDC_EIDT_SHFE 'S' +///֣Ʒ +#define THOST_FTDC_EIDT_CZCE 'Z' +///Ʒ +#define THOST_FTDC_EIDT_DCE 'D' +///йڻ +#define THOST_FTDC_EIDT_CFFEX 'J' +///ϺԴĹɷ޹˾ +#define THOST_FTDC_EIDT_INE 'N' +///Ϻ֤ȯ +#define THOST_FTDC_EIDT_SSE 'A' +///֤ȯ +#define THOST_FTDC_EIDT_SZSE 'E' + +typedef char TThostFtdcExchangeIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExClientIDTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///ױ +#define THOST_FTDC_ECIDT_Hedge '1' +/// +#define THOST_FTDC_ECIDT_Arbitrage '2' +///Ͷ +#define THOST_FTDC_ECIDT_Speculation '3' + +typedef char TThostFtdcExClientIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientClassifyTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientClassifyType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAOrganTypeTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAOrganTypeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOACountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOACountryCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAreaCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAreaCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturesIDTypeһΪͻĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFuturesIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffmcDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffmcTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNocIDTypeһ֯ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNocIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUpdateFlagTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UF_NoUpdate '0' +///ȫϢɹ +#define THOST_FTDC_UF_Success '1' +///ȫϢʧ +#define THOST_FTDC_UF_Fail '2' +///½ױɹ +#define THOST_FTDC_UF_TCSuccess '3' +///½ױʧ +#define THOST_FTDC_UF_TCFail '4' +///Ѷ +#define THOST_FTDC_UF_Cancel '5' + +typedef char TThostFtdcUpdateFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyOperateIDTypeһ붯 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AOID_OpenInvestor '1' +///޸Ϣ +#define THOST_FTDC_AOID_ModifyIDCard '2' +///޸һϢ +#define THOST_FTDC_AOID_ModifyNoIDCard '3' +///뽻ױ +#define THOST_FTDC_AOID_ApplyTradingCode '4' +///ױ +#define THOST_FTDC_AOID_CancelTradingCode '5' +/// +#define THOST_FTDC_AOID_CancelInvestor '6' +///˻ +#define THOST_FTDC_AOID_FreezeAccount '8' +///˻ +#define THOST_FTDC_AOID_ActiveFreezeAccount '9' + +typedef char TThostFtdcApplyOperateIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyStatusIDTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δȫ +#define THOST_FTDC_ASID_NoComplete '1' +///ύ +#define THOST_FTDC_ASID_Submited '2' +/// +#define THOST_FTDC_ASID_Checked '3' +///Ѿܾ +#define THOST_FTDC_ASID_Refused '4' +///ɾ +#define THOST_FTDC_ASID_Deleted '5' + +typedef char TThostFtdcApplyStatusIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendMethodTypeһͷʽ +///////////////////////////////////////////////////////////////////////// +///ļ +#define THOST_FTDC_UOASM_ByAPI '1' +///ӷ +#define THOST_FTDC_UOASM_ByFile '2' + +typedef char TThostFtdcSendMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEventTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventModeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EvM_ADD '1' +///޸ +#define THOST_FTDC_EvM_UPDATE '2' +///ɾ +#define THOST_FTDC_EvM_DELETE '3' +/// +#define THOST_FTDC_EvM_CHECK '4' +/// +#define THOST_FTDC_EvM_COPY '5' +///ע +#define THOST_FTDC_EvM_CANCEL '6' +/// +#define THOST_FTDC_EvM_Reverse '7' + +typedef char TThostFtdcEventModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAAutoSendTypeһͳһԶ +///////////////////////////////////////////////////////////////////////// +///ԶͲ +#define THOST_FTDC_UOAA_ASR '1' +///ԶͣԶ +#define THOST_FTDC_UOAA_ASNR '2' +///ԶͣԶ +#define THOST_FTDC_UOAA_NSAR '3' +///ԶͣҲԶ +#define THOST_FTDC_UOAA_NSR '4' + +typedef char TThostFtdcUOAAutoSendType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryDepthTypeһѯ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcQueryDepthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataCenterIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDataCenterIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFlowIDTypeһID +///////////////////////////////////////////////////////////////////////// +///Ͷ߶ӦͶ +#define THOST_FTDC_EvM_InvestorGroupFlow '1' +///Ͷ +#define THOST_FTDC_EvM_InvestorRate '2' +///Ͷģϵ +#define THOST_FTDC_EvM_InvestorCommRateModel '3' + +typedef char TThostFtdcFlowIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define THOST_FTDC_CL_Zero '0' +///һ +#define THOST_FTDC_CL_One '1' +/// +#define THOST_FTDC_CL_Two '2' + +typedef char TThostFtdcCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCheckNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckStatusTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_CHS_Init '0' +/// +#define THOST_FTDC_CHS_Checking '1' +///Ѹ +#define THOST_FTDC_CHS_Checked '2' +///ܾ +#define THOST_FTDC_CHS_Refuse '3' +/// +#define THOST_FTDC_CHS_Cancel '4' + +typedef char TThostFtdcCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUsedStatusTypeһЧ״̬ +///////////////////////////////////////////////////////////////////////// +///δЧ +#define THOST_FTDC_CHU_Unused '0' +///Ч +#define THOST_FTDC_CHU_Used '1' +///Чʧ +#define THOST_FTDC_CHU_Fail '2' + +typedef char TThostFtdcUsedStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRateTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyStringTypeһڲѯͶֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyStringType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAcountOriginTypeһ˻Դ +///////////////////////////////////////////////////////////////////////// +///ֹ¼ +#define THOST_FTDC_BAO_ByAccProperty '0' +///ת +#define THOST_FTDC_BAO_ByFBTransfer '1' + +typedef char TThostFtdcBankAcountOriginType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthBillTradeSumTypeһ㵥±ɽܷʽ +///////////////////////////////////////////////////////////////////////// +///ͬͬԼ +#define THOST_FTDC_MBTS_ByInstrument '0' +///ͬͬԼͬ۸ +#define THOST_FTDC_MBTS_ByDayInsPrc '1' +///ͬԼ +#define THOST_FTDC_MBTS_ByDayIns '2' + +typedef char TThostFtdcMonthBillTradeSumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTradeCodeEnumTypeһڽ״ö +///////////////////////////////////////////////////////////////////////// +///зתڻ +#define THOST_FTDC_FTC_BankLaunchBankToBroker '102001' +///ڻתڻ +#define THOST_FTDC_FTC_BrokerLaunchBankToBroker '202001' +///зڻת +#define THOST_FTDC_FTC_BankLaunchBrokerToBank '102002' +///ڻڻת +#define THOST_FTDC_FTC_BrokerLaunchBrokerToBank '202002' + +typedef char TThostFtdcFBTTradeCodeEnumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateIDTypeһģʹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRateTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimestampTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTimestampType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleNameTypeһŶι +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDRuleNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleExprTypeһŶιʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDRuleExprType[513]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastDriftTypeһϴOTPƯֵ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLastDriftType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastSuccessTypeһϴOTPɹֵ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLastSuccessType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthKeyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialNumberTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSerialNumberType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPTypeTypeһ̬ +///////////////////////////////////////////////////////////////////////// +///޶̬ +#define THOST_FTDC_OTP_NONE '0' +///ʱ +#define THOST_FTDC_OTP_TOTP '1' + +typedef char TThostFtdcOTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsIDTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOTPVendorsIDType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsNameTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOTPVendorsNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPStatusTypeһ̬״̬ +///////////////////////////////////////////////////////////////////////// +///δʹ +#define THOST_FTDC_OTPS_Unused '0' +///ʹ +#define THOST_FTDC_OTPS_Used '1' +///ע +#define THOST_FTDC_OTPS_Disuse '2' + +typedef char TThostFtdcOTPStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerUserTypeTypeһù˾û +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_BUT_Investor '1' +///Ա +#define THOST_FTDC_BUT_BrokerUser '2' + +typedef char TThostFtdcBrokerUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +///Ʒڻ +#define THOST_FTDC_FUTT_Commodity '1' +///ڻ +#define THOST_FTDC_FUTT_Financial '2' + +typedef char TThostFtdcFutureTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundEventTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ת޶ +#define THOST_FTDC_FET_Restriction '0' +///ת޶ +#define THOST_FTDC_FET_TodayRestriction '1' +///ˮ +#define THOST_FTDC_FET_Transfer '2' +///ʽ𶳽 +#define THOST_FTDC_FET_Credit '3' +///Ͷ߿ʽ +#define THOST_FTDC_FET_InvestorWithdrawAlm '4' +///ʻת޶ +#define THOST_FTDC_FET_BankRestriction '5' +///ǩԼ˻ +#define THOST_FTDC_FET_Accountregister '6' +/// +#define THOST_FTDC_FET_ExchangeFundIO '7' +///Ͷ߳ +#define THOST_FTDC_FET_InvestorFundIO '8' + +typedef char TThostFtdcFundEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountSourceTypeTypeһʽ˻Դ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_AST_FBTransfer '0' +///ֹ¼ +#define THOST_FTDC_AST_ManualEntry '1' + +typedef char TThostFtdcAccountSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCodeSourceTypeTypeһױԴ +///////////////////////////////////////////////////////////////////////// +///ͳһ(ѹ淶) +#define THOST_FTDC_CST_UnifyAccount '0' +///ֹ¼(δ淶) +#define THOST_FTDC_CST_ManualEntry '1' + +typedef char TThostFtdcCodeSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRangeTypeһԱΧ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_UR_All '0' +///һԱ +#define THOST_FTDC_UR_Single '1' + +typedef char TThostFtdcUserRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeSpanTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTimeSpanType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImportSequenceIDTypeһ̬Ƶα +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcImportSequenceIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByGroupTypeһͳƱͻͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ͷͳ +#define THOST_FTDC_BG_Investor '2' +///ͳ +#define THOST_FTDC_BG_Group '1' + +typedef char TThostFtdcByGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSumStatModeTypeһͳƱΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Լͳ +#define THOST_FTDC_TSSM_Instrument '1' +///Ʒͳ +#define THOST_FTDC_TSSM_Product '2' +///ͳ +#define THOST_FTDC_TSSM_Exchange '3' + +typedef char TThostFtdcTradeSumStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcComTypeTypeһϳɽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcComTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductIDTypeһƷʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductMemoTypeһƷ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductMemoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCCancelFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCCancelFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorNameTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCInvestorNameType[201]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOpenInvestorNameTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOpenInvestorNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorIDTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankFlagTypeһбʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCBankFlagType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCBankAccountType[23]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOpenNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOpenNameType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMemoTypeһ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMemoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTradeIDTypeһɽˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCExchangeInstIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMortgageNameTypeһѺƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMortgageNameType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCReasonTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCReasonType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsSettlementTypeһǷΪǽԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIsSettlementType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOptionsTypeTypeһȨ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOptionsTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCStrikePriceTypeһִм +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCStrikePriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTargetProductIDTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTargetProductIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTargetInstrIDTypeһĺԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTargetInstrIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommModelNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelMemoTypeһģ屸ע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommModelMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExprSetModeTypeһڱʽ +///////////////////////////////////////////////////////////////////////// +///й +#define THOST_FTDC_ESM_Relative '1' +/// +#define THOST_FTDC_ESM_Typical '2' + +typedef char TThostFtdcExprSetModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +///˾׼ +#define THOST_FTDC_RIR_All '1' +///ģ +#define THOST_FTDC_RIR_Model '2' +///һͶ +#define THOST_FTDC_RIR_Single '3' + +typedef char TThostFtdcRateInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentBrokerIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDRIdentityIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDRIdentityNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBLinkIDTypeһDBLinkʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBLinkIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncDataStatusTypeһϵͳͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define THOST_FTDC_SDS_Initialize '0' +///ͬ +#define THOST_FTDC_SDS_Settlementing '1' +///ͬ +#define THOST_FTDC_SDS_Settlemented '2' + +typedef char TThostFtdcSyncDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///Խͨر +#define THOST_FTDC_TSRC_NORMAL '0' +///Բѯ +#define THOST_FTDC_TSRC_QUERY '1' + +typedef char TThostFtdcTradeSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFlexStatModeTypeһƷԼͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ʒͳ +#define THOST_FTDC_FSM_Product '1' +///ͳ +#define THOST_FTDC_FSM_Exchange '2' +///ͳ +#define THOST_FTDC_FSM_All '3' + +typedef char TThostFtdcFlexStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByInvestorRangeTypeһͶ߷ΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///ͳ +#define THOST_FTDC_BIR_Property '1' +///ͳ +#define THOST_FTDC_BIR_All '2' + +typedef char TThostFtdcByInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNo12Typeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSequenceNo12Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PIR_All '1' +///Ͷ +#define THOST_FTDC_PIR_Property '2' +///һͶ +#define THOST_FTDC_PIR_Single '3' + +typedef char TThostFtdcPropertyInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FIS_NoCreate '0' +/// +#define THOST_FTDC_FIS_Created '1' +///ʧ +#define THOST_FTDC_FIS_Failed '2' + +typedef char TThostFtdcFileStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileGenStyleTypeһļɷʽ +///////////////////////////////////////////////////////////////////////// +///· +#define THOST_FTDC_FGS_FileTransmit '0' +/// +#define THOST_FTDC_FGS_FileGen '1' + +typedef char TThostFtdcFileGenStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperModeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SoM_Add '1' +///޸ +#define THOST_FTDC_SoM_Update '2' +///ɾ +#define THOST_FTDC_SoM_Delete '3' +/// +#define THOST_FTDC_SoM_Copy '4' +/// +#define THOST_FTDC_SoM_AcTive '5' +///ע +#define THOST_FTDC_SoM_CanCel '6' +/// +#define THOST_FTDC_SoM_ReSet '7' + +typedef char TThostFtdcSysOperModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperTypeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +///޸IJԱ +#define THOST_FTDC_SoT_UpdatePassword '0' +///Աܹ֯ϵ +#define THOST_FTDC_SoT_UserDepartment '1' +///ɫ +#define THOST_FTDC_SoT_RoleManager '2' +///ɫ +#define THOST_FTDC_SoT_RoleFunction '3' +/// +#define THOST_FTDC_SoT_BaseParam '4' +///òԱ +#define THOST_FTDC_SoT_SetUserID '5' +///ûɫ +#define THOST_FTDC_SoT_SetUserRole '6' +///ûIP +#define THOST_FTDC_SoT_UserIpRestriction '7' +///ܹ֯ +#define THOST_FTDC_SoT_DepartmentManager '8' +///ܹ֯ѯิ +#define THOST_FTDC_SoT_DepartmentCopy '9' +///ױ +#define THOST_FTDC_SoT_Tradingcode 'A' +///Ͷ״̬ά +#define THOST_FTDC_SoT_InvestorStatus 'B' +///ͶȨ޹ +#define THOST_FTDC_SoT_InvestorAuthority 'C' +/// +#define THOST_FTDC_SoT_PropertySet 'D' +///Ͷ +#define THOST_FTDC_SoT_ReSetInvestorPasswd 'E' +///Ͷ߸Ϣά +#define THOST_FTDC_SoT_InvestorPersonalityInfo 'F' + +typedef char TThostFtdcSysOperTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDataQueyTypeTypeһϱݲѯ +///////////////////////////////////////////////////////////////////////// +///ѯǰձ͵ +#define THOST_FTDC_CSRCQ_Current '0' +///ѯʷ͵Ĵ͹˾ +#define THOST_FTDC_CSRCQ_History '1' + +typedef char TThostFtdcCSRCDataQueyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_FRS_Normal '1' +/// +#define THOST_FTDC_FRS_Freeze '0' + +typedef char TThostFtdcFreezeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStandardStatusTypeһ淶״̬ +///////////////////////////////////////////////////////////////////////// +///ѹ淶 +#define THOST_FTDC_STST_Standard '0' +///δ淶 +#define THOST_FTDC_STST_NonStandard '1' + +typedef char TThostFtdcStandardStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCFreezeStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightParamTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///߻ +#define THOST_FTDC_RPT_Freeze '1' +///߻ +#define THOST_FTDC_RPT_FreezeActive '2' +///Ȩ +#define THOST_FTDC_RPT_OpenLimit '3' +///Ȩ +#define THOST_FTDC_RPT_RelieveOpenLimit '4' + +typedef char TThostFtdcRightParamTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateIDTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRightTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRightTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataStatusTypeһϴǮ˱״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMLDS_Normal '0' +///ɾ +#define THOST_FTDC_AMLDS_Deleted '1' + +typedef char TThostFtdcDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCheckStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_AMLCHS_Init '0' +/// +#define THOST_FTDC_AMLCHS_Checking '1' +///Ѹ +#define THOST_FTDC_AMLCHS_Checked '2' +///ܾϱ +#define THOST_FTDC_AMLCHS_RefuseReport '3' + +typedef char TThostFtdcAMLCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlDateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMLDT_DrawDay '0' +/// +#define THOST_FTDC_AMLDT_TouchDay '1' + +typedef char TThostFtdcAmlDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define THOST_FTDC_AMLCL_CheckLevel0 '0' +///һ +#define THOST_FTDC_AMLCL_CheckLevel1 '1' +/// +#define THOST_FTDC_AMLCL_CheckLevel2 '2' +/// +#define THOST_FTDC_AMLCL_CheckLevel3 '3' + +typedef char TThostFtdcAmlCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckFlowTypeһϴǮݳȡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAmlCheckFlowType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDataTypeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExportFileTypeTypeһļ +///////////////////////////////////////////////////////////////////////// +///CSV +#define THOST_FTDC_EFT_CSV '0' +///Excel +#define THOST_FTDC_EFT_EXCEL '1' +///DBF +#define THOST_FTDC_EFT_DBF '2' + +typedef char TThostFtdcExportFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ׼ +#define THOST_FTDC_SMT_Before '1' +/// +#define THOST_FTDC_SMT_Settlement '2' +///˶ +#define THOST_FTDC_SMT_After '3' +/// +#define THOST_FTDC_SMT_Settlemented '4' + +typedef char TThostFtdcSettleManagerTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerIDTypeһô +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettleManagerIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettleManagerNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerLevelTypeһõȼ +///////////////////////////////////////////////////////////////////////// +///Ҫ +#define THOST_FTDC_SML_Must '1' +/// +#define THOST_FTDC_SML_Alarm '2' +///ʾ +#define THOST_FTDC_SML_Prompt '3' +/// +#define THOST_FTDC_SML_Ignore '4' + +typedef char TThostFtdcSettleManagerLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerGroupTypeһģ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_SMG_Exhcange '1' +///ڲ˶ +#define THOST_FTDC_SMG_ASP '2' +///ϱݺ˶ +#define THOST_FTDC_SMG_CSRC '3' + +typedef char TThostFtdcSettleManagerGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckResultMemoTypeһ˶Խ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCheckResultMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionUrlTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionUrlType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthInfoTypeһͻ֤Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthCodeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLimitUseTypeTypeһֵʹ +///////////////////////////////////////////////////////////////////////// +///ظʹ +#define THOST_FTDC_LUT_Repeatable '1' +///ظʹ +#define THOST_FTDC_LUT_Unrepeatable '2' + +typedef char TThostFtdcLimitUseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataResourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define THOST_FTDC_DAR_Settle '1' +/// +#define THOST_FTDC_DAR_Exchange '2' +/// +#define THOST_FTDC_DAR_CSRC '3' + +typedef char TThostFtdcDataResourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_MGT_ExchMarginRate '0' +///Ͷ֤߱ +#define THOST_FTDC_MGT_InstrMarginRate '1' +///Ͷ߽ױ֤ +#define THOST_FTDC_MGT_InstrMarginRateTrade '2' + +typedef char TThostFtdcMarginTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActiveTypeTypeһЧ +///////////////////////////////////////////////////////////////////////// +///Ч +#define THOST_FTDC_ACT_Intraday '1' +///Ч +#define THOST_FTDC_ACT_Long '2' + +typedef char TThostFtdcActiveTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginRateTypeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_MRT_Exchange '1' +///Ͷ֤߱ +#define THOST_FTDC_MRT_Investor '2' +///Ͷ߽ױ֤ +#define THOST_FTDC_MRT_InvestorTrade '3' + +typedef char TThostFtdcMarginRateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBackUpStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δɱ +#define THOST_FTDC_BUS_UnBak '0' +/// +#define THOST_FTDC_BUS_BakUp '1' +///ɱ +#define THOST_FTDC_BUS_BakUped '2' +///ʧ +#define THOST_FTDC_BUS_BakFail '3' + +typedef char TThostFtdcBackUpStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInitSettlementTypeһʼ״̬ +///////////////////////////////////////////////////////////////////////// +///ʼδʼ +#define THOST_FTDC_SIS_UnInitialize '0' +///ʼ +#define THOST_FTDC_SIS_Initialize '1' +///ʼ +#define THOST_FTDC_SIS_Initialized '2' + +typedef char TThostFtdcInitSettlementType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δɱ +#define THOST_FTDC_SRS_NoCreate '0' +/// +#define THOST_FTDC_SRS_Create '1' +///ɱ +#define THOST_FTDC_SRS_Created '2' +///ɱʧ +#define THOST_FTDC_SRS_CreateFail '3' + +typedef char TThostFtdcReportStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSaveStatusTypeһݹ鵵״̬ +///////////////////////////////////////////////////////////////////////// +///鵵δ +#define THOST_FTDC_SSS_UnSaveData '0' +///鵵 +#define THOST_FTDC_SSS_SaveDatad '1' + +typedef char TThostFtdcSaveStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettArchiveStatusTypeһȷݹ鵵״̬ +///////////////////////////////////////////////////////////////////////// +///δ鵵 +#define THOST_FTDC_SAS_UnArchived '0' +///ݹ鵵 +#define THOST_FTDC_SAS_Archiving '1' +///ѹ鵵 +#define THOST_FTDC_SAS_Archived '2' +///鵵ʧ +#define THOST_FTDC_SAS_ArchiveFail '3' + +typedef char TThostFtdcSettArchiveStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCTPTypeTypeһCTPϵͳ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_CTPT_Unkown '0' +/// +#define THOST_FTDC_CTPT_MainCenter '1' +/// +#define THOST_FTDC_CTPT_BackUp '2' + +typedef char TThostFtdcCTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcToolIDTypeһߴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcToolIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcToolNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcToolNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseDealTypeTypeһƽִ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CDT_Normal '0' +///Ͷƽ +#define THOST_FTDC_CDT_SpecFirst '1' + +typedef char TThostFtdcCloseDealTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMortgageFundUseRangeTypeһѺʽ÷Χ +///////////////////////////////////////////////////////////////////////// +///ʹ +#define THOST_FTDC_MFUR_None '0' +///ڱ֤ +#define THOST_FTDC_MFUR_Margin '1' +///ѡӯ֤ +#define THOST_FTDC_MFUR_All '2' + +typedef char TThostFtdcMortgageFundUseRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyUnitTypeһֵλ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCurrencyUnitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeRateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcExchangeRateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSpecProductTypeTypeһƷ +///////////////////////////////////////////////////////////////////////// +///֣ױƷ +#define THOST_FTDC_SPT_CzceHedge '1' +///ѺƷ +#define THOST_FTDC_SPT_IneForeignCurrency '2' +///߿ƽֲƷ +#define THOST_FTDC_SPT_DceOpenClose '3' + +typedef char TThostFtdcSpecProductTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortgageTypeTypeһѺ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_FMT_Mortgage '1' +/// +#define THOST_FTDC_FMT_Redemption '2' + +typedef char TThostFtdcFundMortgageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountSettlementParamIDTypeһͶ˻ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_ASPI_BaseMargin '1' +///Ȩ׼ +#define THOST_FTDC_ASPI_LowestInterest '2' + +typedef char TThostFtdcAccountSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyNameType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySignTypeһַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencySignType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortDirectionTypeһѺ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FMD_In '1' +///ʳ +#define THOST_FTDC_FMD_Out '2' + +typedef char TThostFtdcFundMortDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessClassTypeһ +///////////////////////////////////////////////////////////////////////// +///ӯ +#define THOST_FTDC_BT_Profit '0' +/// +#define THOST_FTDC_BT_Loss '1' +/// +#define THOST_FTDC_BT_Other 'Z' + +typedef char TThostFtdcBusinessClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSwapSourceTypeTypeһԴ +///////////////////////////////////////////////////////////////////////// +///ֹ +#define THOST_FTDC_SST_Manual '0' +///Զ +#define THOST_FTDC_SST_Automatic '1' + +typedef char TThostFtdcSwapSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrExDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CED_Settlement '0' +///ۻ +#define THOST_FTDC_CED_Sale '1' + +typedef char TThostFtdcCurrExDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySwapStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_CSS_Entry '1' +/// +#define THOST_FTDC_CSS_Approve '2' +///Ѿܾ +#define THOST_FTDC_CSS_Refuse '3' +///ѳ +#define THOST_FTDC_CSS_Revoke '4' +///ѷ +#define THOST_FTDC_CSS_Send '5' +///ɹ +#define THOST_FTDC_CSS_Success '6' +///ʧ +#define THOST_FTDC_CSS_Failure '7' + +typedef char TThostFtdcCurrencySwapStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrExchCertNoTypeһƾ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrExchCertNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBatchSerialNoTypeһκ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBatchSerialNoType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReqFlagTypeһ㷢ͱ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_REQF_NoSend '0' +///ͳɹ +#define THOST_FTDC_REQF_SendSuccess '1' +///ʧ +#define THOST_FTDC_REQF_SendFailed '2' +///ȴط +#define THOST_FTDC_REQF_WaitReSend '3' + +typedef char TThostFtdcReqFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcResFlagTypeһ㷵سɹ־ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_RESF_Success '0' +///˻ +#define THOST_FTDC_RESF_InsuffiCient '1' +///׽δ֪ +#define THOST_FTDC_RESF_UnKnown '8' + +typedef char TThostFtdcResFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPageControlTypeһҳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPageControlType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordCountTypeһ¼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRecordCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySwapMemoTypeһȷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencySwapMemoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExStatusTypeһ޸״̬ +///////////////////////////////////////////////////////////////////////// +///޸ǰ +#define THOST_FTDC_EXS_Before '0' +///޸ĺ +#define THOST_FTDC_EXS_After '1' + +typedef char TThostFtdcExStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientRegionTypeһͻ +///////////////////////////////////////////////////////////////////////// +///ڿͻ +#define THOST_FTDC_CR_Domestic '1' +///۰̨ͻ +#define THOST_FTDC_CR_GMT '2' +///ͻ +#define THOST_FTDC_CR_Foreign '3' + +typedef char TThostFtdcClientRegionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWorkPlaceTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWorkPlaceType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessPeriodTypeһӪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessPeriodType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWebSiteTypeһַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWebSiteType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAIdCardTypeTypeһͳһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAIdCardTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientModeTypeһģʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientModeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorFullNameTypeһͶȫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorFullNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOABrokerIDTypeһнID +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOABrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAZipCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAZipCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAEMailTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAEMailType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOldCityTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOldCityType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorporateIdentifiedCardNoTypeһ˴֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCorporateIdentifiedCardNoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHasBoardTypeһǷж» +///////////////////////////////////////////////////////////////////////// +///û +#define THOST_FTDC_HB_No '0' +/// +#define THOST_FTDC_HB_Yes '1' + +typedef char TThostFtdcHasBoardType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStartModeTypeһģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SM_Normal '1' +///Ӧ +#define THOST_FTDC_SM_Emerge '2' +///ָ +#define THOST_FTDC_SM_Restore '3' + +typedef char TThostFtdcStartModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTemplateTypeTypeһģ +///////////////////////////////////////////////////////////////////////// +///ȫ +#define THOST_FTDC_TPT_Full '1' +/// +#define THOST_FTDC_TPT_Increment '2' +/// +#define THOST_FTDC_TPT_BackUp '3' + +typedef char TThostFtdcTemplateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLoginModeTypeһ¼ģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LM_Trade '0' +///ת +#define THOST_FTDC_LM_Transfer '1' + +typedef char TThostFtdcLoginModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPromptTypeTypeһʾ +///////////////////////////////////////////////////////////////////////// +///Լ +#define THOST_FTDC_CPT_Instrument '1' +///ֶ֤Ч +#define THOST_FTDC_CPT_Margin '2' + +typedef char TThostFtdcPromptTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLedgerManageIDTypeһֻʲ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLedgerManageIDType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestVarietyTypeһͶƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestVarietyType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLedgerManageBankTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLedgerManageBankType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffexDepartmentNameTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffexDepartmentNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffexDepartmentCodeTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffexDepartmentCodeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHasTrusteeTypeһǷй +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HT_Yes '1' +///û +#define THOST_FTDC_HT_No '0' + +typedef char TThostFtdcHasTrusteeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMemo1Typeһ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMemo1Type[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrCFullNameTypeһʲҵڻ˾ȫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrCFullNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrApprovalNOTypeһʲҵĺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrApprovalNOType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrMgrNameTypeһʲҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrMgrNameType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMT_Bank '1' +///֤ȯ˾ +#define THOST_FTDC_AMT_Securities '2' +///˾ +#define THOST_FTDC_AMT_Fund '3' +///չ˾ +#define THOST_FTDC_AMT_Insurance '4' +///й˾ +#define THOST_FTDC_AMT_Trust '5' +/// +#define THOST_FTDC_AMT_Other '9' + +typedef char TThostFtdcAmTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCAmTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCAmTypeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CFIOT_FundIO '0' +///ڻ +#define THOST_FTDC_CFIOT_SwapCurrency '1' + +typedef char TThostFtdcCSRCFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCusAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +///ڻ˻ +#define THOST_FTDC_CAT_Futures '1' +///ڻʹҵµʹܽ˻ +#define THOST_FTDC_CAT_AssetmgrFuture '2' +///ۺʹҵµڻʹй˻ +#define THOST_FTDC_CAT_AssetmgrTrustee '3' +///ۺʹҵµʽת˻ +#define THOST_FTDC_CAT_AssetmgrTransfer '4' + +typedef char TThostFtdcCusAccountTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCNationalTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCNationalType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCSecAgentIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCSecAgentIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLanguageTypeTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LT_Chinese '1' +///Ӣ +#define THOST_FTDC_LT_English '2' + +typedef char TThostFtdcLanguageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmAccountTypeһͶ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAmAccountType[23]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrClientTypeTypeһʲͻ +///////////////////////////////////////////////////////////////////////// +///ʹܿͻ +#define THOST_FTDC_AMCT_Person '1' +///λʹܿͻ +#define THOST_FTDC_AMCT_Organ '2' +///ⵥλʹܿͻ +#define THOST_FTDC_AMCT_SpecialOrgan '4' + +typedef char TThostFtdcAssetmgrClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_ASST_Futures '3' +///ۺ +#define THOST_FTDC_ASST_SpecialOrgan '4' + +typedef char TThostFtdcAssetmgrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOMTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOMType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSHFEInstLifePhaseType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSHFEProductClassType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceDecimalTypeһ۸Сλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPriceDecimalType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInTheMoneyFlagTypeһƽֵȨ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInTheMoneyFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckInstrTypeTypeһԼȽ +///////////////////////////////////////////////////////////////////////// +///Լ +#define THOST_FTDC_CIT_HasExch '0' +///Լϵͳ +#define THOST_FTDC_CIT_HasATP '1' +///ԼȽϲһ +#define THOST_FTDC_CIT_HasDiff '2' + +typedef char TThostFtdcCheckInstrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeliveryTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ֹ +#define THOST_FTDC_DT_HandDeliv '1' +///ڽ +#define THOST_FTDC_DT_PersonDeliv '2' + +typedef char TThostFtdcDeliveryTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBigMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcBigMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMaxMarginSideAlgorithmTypeһ֤߱㷨 +///////////////////////////////////////////////////////////////////////// +///ʹô֤߱㷨 +#define THOST_FTDC_MMSA_NO '0' +///ʹô֤߱㷨 +#define THOST_FTDC_MMSA_YES '1' + +typedef char TThostFtdcMaxMarginSideAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDAClientTypeTypeһʲͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CACT_Person '0' +/// +#define THOST_FTDC_CACT_Company '1' +/// +#define THOST_FTDC_CACT_Other '2' + +typedef char TThostFtdcDAClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinInstrIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombinInstrIDType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinSettlePriceTypeһȽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombinSettlePriceType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDCEPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDCEPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeGroupIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradeGroupIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsCheckPrepaTypeһǷУ鿪ʽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcIsCheckPrepaType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAAssetmgrTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_UOAAT_Futures '1' +///ۺ +#define THOST_FTDC_UOAAT_SpecialOrgan '2' + +typedef char TThostFtdcUOAAssetmgrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Buy +#define THOST_FTDC_DEN_Buy '0' +///Sell +#define THOST_FTDC_DEN_Sell '1' + +typedef char TThostFtdcDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagEnTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +///Position Opening +#define THOST_FTDC_OFEN_Open '0' +///Position Close +#define THOST_FTDC_OFEN_Close '1' +///Forced Liquidation +#define THOST_FTDC_OFEN_ForceClose '2' +///Close Today +#define THOST_FTDC_OFEN_CloseToday '3' +///Close Prev. +#define THOST_FTDC_OFEN_CloseYesterday '4' +///Forced Reduction +#define THOST_FTDC_OFEN_ForceOff '5' +///Local Forced Liquidation +#define THOST_FTDC_OFEN_LocalForceClose '6' + +typedef char TThostFtdcOffsetFlagEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagEnTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Speculation +#define THOST_FTDC_HFEN_Speculation '1' +///Arbitrage +#define THOST_FTDC_HFEN_Arbitrage '2' +///Hedge +#define THOST_FTDC_HFEN_Hedge '3' + +typedef char TThostFtdcHedgeFlagEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Deposit/Withdrawal +#define THOST_FTDC_FIOTEN_FundIO '1' +///Bank-Futures Transfer +#define THOST_FTDC_FIOTEN_Transfer '2' +///Bank-Futures FX Exchange +#define THOST_FTDC_FIOTEN_SwapCurrency '3' + +typedef char TThostFtdcFundIOTypeEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeEnTypeһʽ +///////////////////////////////////////////////////////////////////////// +///Bank Deposit +#define THOST_FTDC_FTEN_Deposite '1' +///Payment/Fee +#define THOST_FTDC_FTEN_ItemFund '2' +///Brokerage Adj +#define THOST_FTDC_FTEN_Company '3' +///Internal Transfer +#define THOST_FTDC_FTEN_InnerTransfer '4' + +typedef char TThostFtdcFundTypeEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Deposit +#define THOST_FTDC_FDEN_In '1' +///Withdrawal +#define THOST_FTDC_FDEN_Out '2' + +typedef char TThostFtdcFundDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortDirectionEnTypeһѺ +///////////////////////////////////////////////////////////////////////// +///Pledge +#define THOST_FTDC_FMDEN_In '1' +///Redemption +#define THOST_FTDC_FMDEN_Out '2' + +typedef char TThostFtdcFundMortDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSwapBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSwapBusinessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionsTypeTypeһȨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CP_CallOptions '1' +/// +#define THOST_FTDC_CP_PutOptions '2' + +typedef char TThostFtdcOptionsTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeModeTypeһִзʽ +///////////////////////////////////////////////////////////////////////// +///ŷʽ +#define THOST_FTDC_STM_Continental '0' +///ʽ +#define THOST_FTDC_STM_American '1' +///Ľ +#define THOST_FTDC_STM_Bermuda '2' + +typedef char TThostFtdcStrikeModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeTypeTypeһִ +///////////////////////////////////////////////////////////////////////// +///Գ +#define THOST_FTDC_STT_Hedge '0' +///ƥִ +#define THOST_FTDC_STT_Match '1' + +typedef char TThostFtdcStrikeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyTypeTypeһнȨִ +///////////////////////////////////////////////////////////////////////// +///ִ +#define THOST_FTDC_APPT_NotStrikeNum '4' + +typedef char TThostFtdcApplyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGiveUpDataSourceTypeһִԴ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define THOST_FTDC_GUDS_Gen '0' +///ֹ +#define THOST_FTDC_GUDS_Hand '1' + +typedef char TThostFtdcGiveUpDataSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderSysIDTypeһִϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExecOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecResultTypeһִн +///////////////////////////////////////////////////////////////////////// +///ûִ +#define THOST_FTDC_OER_NoExec 'n' +///Ѿȡ +#define THOST_FTDC_OER_Canceled 'c' +///ִгɹ +#define THOST_FTDC_OER_OK '0' +///Ȩֲֲ +#define THOST_FTDC_OER_NoPosition '1' +///ʽ𲻹 +#define THOST_FTDC_OER_NoDeposit '2' +///Ա +#define THOST_FTDC_OER_NoParticipant '3' +///ͻ +#define THOST_FTDC_OER_NoClient '4' +///Լ +#define THOST_FTDC_OER_NoInstrument '6' +///ûִȨ +#define THOST_FTDC_OER_NoRight '7' +/// +#define THOST_FTDC_OER_InvalidVolume '8' +///û㹻ʷɽ +#define THOST_FTDC_OER_NoEnoughHistoryTrade '9' +///δ֪ +#define THOST_FTDC_OER_Unknown 'a' + +typedef char TThostFtdcExecResultType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeSequenceTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcStrikeSequenceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeTimeTypeһִʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcStrikeTimeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinationTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_COMBT_Future '0' +///ֱ۲BUL +#define THOST_FTDC_COMBT_BUL '1' +///ֱ۲BER +#define THOST_FTDC_COMBT_BER '2' +///ʽ +#define THOST_FTDC_COMBT_STD '3' +///ʽ +#define THOST_FTDC_COMBT_STG '4' +/// +#define THOST_FTDC_COMBT_PRT '5' +///ʱ۲ +#define THOST_FTDC_COMBT_CLD '6' + +typedef char TThostFtdcCombinationTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionRoyaltyPriceTypeTypeһȨȨ۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ORPT_PreSettlementPrice '1' +///ּ +#define THOST_FTDC_ORPT_OpenPrice '4' + +typedef char TThostFtdcOptionRoyaltyPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBalanceAlgorithmTypeһȨ㷨 +///////////////////////////////////////////////////////////////////////// +///Ȩֵӯ +#define THOST_FTDC_BLAG_Default '1' +///Ȩֵ +#define THOST_FTDC_BLAG_IncludeOptValLost '2' + +typedef char TThostFtdcBalanceAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionTypeTypeһִ +///////////////////////////////////////////////////////////////////////// +///ִ +#define THOST_FTDC_ACTP_Exec '1' +/// +#define THOST_FTDC_ACTP_Abandon '2' + +typedef char TThostFtdcActionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForQuoteStatusTypeһѯ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_FQST_Submitted 'a' +///Ѿ +#define THOST_FTDC_FQST_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_FQST_Rejected 'c' + +typedef char TThostFtdcForQuoteStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcValueMethodTypeһȡֵʽ +///////////////////////////////////////////////////////////////////////// +///ֵ +#define THOST_FTDC_VM_Absolute '0' +/// +#define THOST_FTDC_VM_Ratio '1' + +typedef char TThostFtdcValueMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderPositionFlagTypeһȨȨǷڻͷı +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EOPF_Reserve '0' +/// +#define THOST_FTDC_EOPF_UnReserve '1' + +typedef char TThostFtdcExecOrderPositionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderCloseFlagTypeһȨȨɵͷǷԶƽ +///////////////////////////////////////////////////////////////////////// +///Զƽ +#define THOST_FTDC_EOCF_AutoClose '0' +///Զƽ +#define THOST_FTDC_EOCF_NotToClose '1' + +typedef char TThostFtdcExecOrderCloseFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductTypeTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_PTE_Futures '1' +///Ȩ +#define THOST_FTDC_PTE_Options '2' + +typedef char TThostFtdcProductTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCZCEUploadFileNameTypeһ֣ļ +///////////////////////////////////////////////////////////////////////// +///^\d{8}_zz_\d{4} +#define THOST_FTDC_CUFN_CUFN_O 'O' +///^\d{8}ɽ +#define THOST_FTDC_CUFN_CUFN_T 'T' +///^\d{8}ȳֱֲnew +#define THOST_FTDC_CUFN_CUFN_P 'P' +///^\d{8}ƽ˽ +#define THOST_FTDC_CUFN_CUFN_N 'N' +///^\d{8}ƽֱ +#define THOST_FTDC_CUFN_CUFN_L 'L' +///^\d{8}ʽ +#define THOST_FTDC_CUFN_CUFN_F 'F' +///^\d{8}ϳֱֲ +#define THOST_FTDC_CUFN_CUFN_C 'C' +///^\d{8}֤ +#define THOST_FTDC_CUFN_CUFN_M 'M' + +typedef char TThostFtdcCZCEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDCEUploadFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +///^\d{8}_dl_\d{3} +#define THOST_FTDC_DUFN_DUFN_O 'O' +///^\d{8}_ɽ +#define THOST_FTDC_DUFN_DUFN_T 'T' +///^\d{8}_ֱֲ +#define THOST_FTDC_DUFN_DUFN_P 'P' +///^\d{8}_ʽ +#define THOST_FTDC_DUFN_DUFN_F 'F' +///^\d{8}_Żϳֲϸ +#define THOST_FTDC_DUFN_DUFN_C 'C' +///^\d{8}_ֲϸ +#define THOST_FTDC_DUFN_DUFN_D 'D' +///^\d{8}_֤ +#define THOST_FTDC_DUFN_DUFN_M 'M' +///^\d{8}_Ȩִб +#define THOST_FTDC_DUFN_DUFN_S 'S' + +typedef char TThostFtdcDCEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEUploadFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +///^\d{4}_\d{8}_\d{8}_DailyFundChg +#define THOST_FTDC_SUFN_SUFN_O 'O' +///^\d{4}_\d{8}_\d{8}_Trade +#define THOST_FTDC_SUFN_SUFN_T 'T' +///^\d{4}_\d{8}_\d{8}_SettlementDetail +#define THOST_FTDC_SUFN_SUFN_P 'P' +///^\d{4}_\d{8}_\d{8}_Capital +#define THOST_FTDC_SUFN_SUFN_F 'F' + +typedef char TThostFtdcSHFEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFFEXUploadFileNameTypeһнļ +///////////////////////////////////////////////////////////////////////// +///^\d{4}_SG\d{1}_\d{8}_\d{1}_Trade +#define THOST_FTDC_CFUFN_SUFN_T 'T' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_SettlementDetail +#define THOST_FTDC_CFUFN_SUFN_P 'P' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_Capital +#define THOST_FTDC_CFUFN_SUFN_F 'F' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_OptionExec +#define THOST_FTDC_CFUFN_SUFN_S 'S' + +typedef char TThostFtdcCFFEXUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombDirectionTypeһָ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CMDR_Comb '0' +/// +#define THOST_FTDC_CMDR_UnComb '1' + +typedef char TThostFtdcCombDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLockTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LCKT_Lock '1' +/// +#define THOST_FTDC_LCKT_Unlock '2' + +typedef char TThostFtdcLockTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBizTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_BZTP_Future '1' +///֤ȯ +#define THOST_FTDC_BZTP_Stock '2' + +typedef char TThostFtdcBizTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDesignateTypeTypeһָ +///////////////////////////////////////////////////////////////////////// +///ָǼ +#define THOST_FTDC_DSTP_Register '1' +///ָ +#define THOST_FTDC_DSTP_Cancel '2' + +typedef char TThostFtdcDesignateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeReasonTypeTypeһԭ +///////////////////////////////////////////////////////////////////////// +///ʼ +#define THOST_FTDC_FRTP_Init '1' +/// +#define THOST_FTDC_FRTP_Lock '2' +///ִ +#define THOST_FTDC_FRTP_Exec '3' +///λУ +#define THOST_FTDC_FRTP_Check '4' +///E+1ִж +#define THOST_FTDC_FRTP_ExecFreeze '5' + +typedef char TThostFtdcFreezeReasonTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FZTP_Freeze '1' +///ⶳ +#define THOST_FTDC_FZTP_Unfreeze '2' +///ǿִ +#define THOST_FTDC_FZTP_Force '3' + +typedef char TThostFtdcFreezeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSystemTypeTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///δ֪ϵͳ +#define THOST_FTDC_TSTP_Unknow '0' +///ڻϵͳ +#define THOST_FTDC_TSTP_Future '1' +///ϵͳ +#define THOST_FTDC_TSTP_IShare '2' + +typedef char TThostFtdcTradeSystemTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockDisposalTypeTypeһ֤ȯ÷ +///////////////////////////////////////////////////////////////////////// +///뾭͹˾˻ +#define THOST_FTDC_STPT_ToBroker '1' +///Ͷ˻ +#define THOST_FTDC_STPT_ToInvestor '2' + +typedef char TThostFtdcStockDisposalTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockDisposalSysIDTypeһ֤ȯñ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcStockDisposalSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockDisposalStatusTypeһ֤ȯ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_SDPS_Submitted 'a' +///Ѿ +#define THOST_FTDC_SDPS_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_SDPS_Rejected 'c' +///Ѿ +#define THOST_FTDC_SDPS_Cancelled 'd' + +typedef char TThostFtdcStockDisposalStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstructionRightTypeTypeһָȨ +///////////////////////////////////////////////////////////////////////// +///޼۵ +#define THOST_FTDC_ISTR_Limit '1' +///޼ȫɽȡ +#define THOST_FTDC_ISTR_Limit_FOK '2' +///м۶ʣת޼ +#define THOST_FTDC_ISTR_Market_RemainLimit '3' +///м۶ʣ೷ +#define THOST_FTDC_ISTR_Market_FAK '4' +///мȫɽȡ +#define THOST_FTDC_ISTR_Market_FOK '5' +///֤ȯ +#define THOST_FTDC_ISTR_Lock '6' +///֤ȯ +#define THOST_FTDC_ISTR_Unlock '7' + +typedef char TThostFtdcInstructionRightTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLevelTypeTypeһͶ߷ּ +///////////////////////////////////////////////////////////////////////// +///һͶ +#define THOST_FTDC_IVLV_FirstLevel '1' +///Ͷ +#define THOST_FTDC_IVLV_SecondLevel '2' +///Ͷ +#define THOST_FTDC_IVLV_ThirdLevel '3' + +typedef char TThostFtdcLevelTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeOffsetTypeTypeһȨƫ +///////////////////////////////////////////////////////////////////////// +///ʵֵ +#define THOST_FTDC_STOV_RealValue '1' +///ӯ +#define THOST_FTDC_STOV_ProfitValue '2' +///ʵֵ +#define THOST_FTDC_STOV_RealRatio '3' +///ӯ +#define THOST_FTDC_STOV_ProfitRatio '4' + +typedef char TThostFtdcStrikeOffsetTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLoginRemarkTypeһ¼ע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLoginRemarkType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestUnitIDTypeһͶʵԪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestUnitIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBulletinIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBulletinIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNewsTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNewsTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNewsUrgencyTypeһ̶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNewsUrgencyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAbstractTypeһϢժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAbstractType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcComeFromTypeһϢԴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcComeFromType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcURLLinkTypeһWEBַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcURLLinkType[201]; + +#endif diff --git a/include/CTP_SOPT/ThostFtdcUserApiStruct.h b/include/CTP_SOPT/ThostFtdcUserApiStruct.h new file mode 100644 index 0000000..3240012 --- /dev/null +++ b/include/CTP_SOPT/ThostFtdcUserApiStruct.h @@ -0,0 +1,9447 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcUserApiStruct.h +///@brief ˿ͻ˽ӿʹõҵݽṹ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCSTRUCT_H) +#define THOST_FTDCSTRUCT_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiDataType.h" + +///Ϣַ +struct CThostFtdcDisseminationField +{ + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///к + TThostFtdcSequenceNoType SequenceNo; +}; + +///û¼ +struct CThostFtdcReqUserLoginField +{ + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///նIPַ + TThostFtdcIPAddressType ClientIPAddress; + ///¼ע + TThostFtdcLoginRemarkType LoginRemark; +}; + +///û¼Ӧ +struct CThostFtdcRspUserLoginField +{ + /// + TThostFtdcDateType TradingDay; + ///¼ɹʱ + TThostFtdcTimeType LoginTime; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Դʱ + TThostFtdcTimeType INETime; +}; + +///ûdz +struct CThostFtdcUserLogoutField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ǿƽԱ˳ +struct CThostFtdcForceUserLogoutField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ͻ֤ +struct CThostFtdcReqAuthenticateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤ + TThostFtdcAuthCodeType AuthCode; +}; + +///ͻ֤Ӧ +struct CThostFtdcRspAuthenticateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; +}; + +///ͻ֤Ϣ +struct CThostFtdcAuthenticationInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤Ϣ + TThostFtdcAuthInfoType AuthInfo; + ///ǷΪ֤ + TThostFtdcBoolType IsResult; +}; + +///תʱͷ +struct CThostFtdcTransferHeaderField +{ + ///汾ţ1.0 + TThostFtdcVersionType Version; + ///״룬 + TThostFtdcTradeCodeType TradeCode; + ///ڣʽyyyymmdd + TThostFtdcTradeDateType TradeDate; + ///ʱ䣬ʽhhmmss + TThostFtdcTradeTimeType TradeTime; + ///ˮţN/A + TThostFtdcTradeSerialType TradeSerial; + ///ڻ˾룬 + TThostFtdcFutureIDType FutureID; + ///д룬ݲѯеõ + TThostFtdcBankIDType BankID; + ///зĴ룬ݲѯеõ + TThostFtdcBankBrchIDType BankBrchID; + ///ԱN/A + TThostFtdcOperNoType OperNo; + ///豸ͣN/A + TThostFtdcDeviceIDType DeviceID; + ///¼N/A + TThostFtdcRecordNumType RecordNum; + ///ỰţN/A + TThostFtdcSessionIDType SessionID; + ///ţN/A + TThostFtdcRequestIDType RequestID; +}; + +///ʽתڻTradeCode=202001 +struct CThostFtdcTransferBankToFutureReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ʽתڻӦ +struct CThostFtdcTransferBankToFutureRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ڻʽתTradeCode=202002 +struct CThostFtdcTransferFutureToBankReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ڻʽתӦ +struct CThostFtdcTransferFutureToBankRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯʽTradeCode=204002 +struct CThostFtdcTransferQryBankReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯʽӦ +struct CThostFtdcTransferQryBankRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + /// + TThostFtdcMoneyType TradeAmt; + ///п + TThostFtdcMoneyType UseAmt; + ///пȡ + TThostFtdcMoneyType FetchAmt; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯнϸTradeCode=204999 +struct CThostFtdcTransferQryDetailReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; +}; + +///ѯнϸӦ +struct CThostFtdcTransferQryDetailRspField +{ + /// + TThostFtdcDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///ڻˮ + TThostFtdcTradeSerialNoType FutureSerial; + ///ڻ˾ + TThostFtdcFutureIDType FutureID; + ///ʽʺ + TThostFtdcFutureAccountType FutureAccount; + ///ˮ + TThostFtdcTradeSerialNoType BankSerial; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + ///˺ + TThostFtdcBankAccountType BankAccount; + ///֤ + TThostFtdcCertCodeType CertCode; + ///Ҵ + TThostFtdcCurrencyCodeType CurrencyCode; + /// + TThostFtdcMoneyType TxAmount; + ///Ч־ + TThostFtdcTransferValidFlagType Flag; +}; + +///ӦϢ +struct CThostFtdcRspInfoField +{ + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CThostFtdcExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcExchangeNameType ExchangeName; + /// + TThostFtdcExchangePropertyType ExchangeProperty; +}; + +///Ʒ +struct CThostFtdcProductField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductNameType ProductName; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceType PriceTick; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///ֲ + TThostFtdcPositionTypeType PositionType; + ///ֲ + TThostFtdcPositionDateTypeType PositionDateType; + ///ƽִ + TThostFtdcCloseDealTypeType CloseDealType; + ///ױ + TThostFtdcCurrencyIDType TradeCurrencyID; + ///Ѻʽ÷Χ + TThostFtdcMortgageFundUseRangeType MortgageFundUseRange; + ///Ʒ + TThostFtdcInstrumentIDType ExchangeProductID; + ///ԼƷ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; +}; + +///Լ +struct CThostFtdcInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentNameType InstrumentName; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcYearType DeliveryYear; + /// + TThostFtdcMonthType DeliveryMonth; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceType PriceTick; + /// + TThostFtdcDateType CreateDate; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcDateType ExpireDate; + ///ʼ + TThostFtdcDateType StartDelivDate; + /// + TThostFtdcDateType EndDelivDate; + ///Լ״̬ + TThostFtdcInstLifePhaseType InstLifePhase; + ///ǰǷ + TThostFtdcBoolType IsTrading; + ///ֲ + TThostFtdcPositionTypeType PositionType; + ///ֲ + TThostFtdcPositionDateTypeType PositionDateType; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatio; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatio; + ///Ƿʹô֤߱㷨 + TThostFtdcMaxMarginSideAlgorithmType MaxMarginSideAlgorithm; + ///Ʒ + TThostFtdcInstrumentIDType UnderlyingInstrID; + ///ִм + TThostFtdcPriceType StrikePrice; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + ///ԼƷ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; + /// + TThostFtdcCombinationTypeType CombinationType; + ///Сµλ + TThostFtdcVolumeType MinBuyVolume; + ///Сµλ + TThostFtdcVolumeType MinSellVolume; + ///Լʶ + TThostFtdcInstrumentCodeType InstrumentCode; +}; + +///͹˾ +struct CThostFtdcBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ + TThostFtdcBrokerAbbrType BrokerAbbr; + ///͹˾ + TThostFtdcBrokerNameType BrokerName; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///Ա +struct CThostFtdcTraderField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallCountType InstallCount; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///Ͷ +struct CThostFtdcInvestorField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcDateType OpenDate; + ///ֻ + TThostFtdcMobileType Mobile; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ױ +struct CThostFtdcTradingCodeField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///Ա;͹˾ձ +struct CThostFtdcPartBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///û +struct CThostFtdcSuperUserField +{ + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + /// + TThostFtdcPasswordType Password; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///ûȨ +struct CThostFtdcSuperUserFunctionField +{ + ///û + TThostFtdcUserIDType UserID; + ///ܴ + TThostFtdcFunctionCodeType FunctionCode; +}; + +///Ͷ +struct CThostFtdcInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TThostFtdcInvestorGroupNameType InvestorGroupName; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ϴѺ + TThostFtdcMoneyType PreMortgage; + ///ϴö + TThostFtdcMoneyType PreCredit; + ///ϴδ + TThostFtdcMoneyType PreDeposit; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///Ϣ + TThostFtdcMoneyType InterestBase; + ///Ϣ + TThostFtdcMoneyType Interest; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + ///ʽ + TThostFtdcMoneyType Available; + ///ȡʽ + TThostFtdcMoneyType WithdrawQuota; + ///׼ + TThostFtdcMoneyType Reserve; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ö + TThostFtdcMoneyType Credit; + ///Ѻ + TThostFtdcMoneyType Mortgage; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TThostFtdcMoneyType DeliveryMargin; + ///֤ + TThostFtdcMoneyType ExchangeDeliveryMargin; + ///ڻ׼ + TThostFtdcMoneyType ReserveBalance; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ϴλ + TThostFtdcMoneyType PreFundMortgageIn; + ///ϴλʳ + TThostFtdcMoneyType PreFundMortgageOut; + /// + TThostFtdcMoneyType FundMortgageIn; + ///ʳ + TThostFtdcMoneyType FundMortgageOut; + ///Ѻ + TThostFtdcMoneyType FundMortgageAvailable; + ///Ѻҽ + TThostFtdcMoneyType MortgageableFund; + ///Ʒռñ֤ + TThostFtdcMoneyType SpecProductMargin; + ///Ʒᱣ֤ + TThostFtdcMoneyType SpecProductFrozenMargin; + ///Ʒ + TThostFtdcMoneyType SpecProductCommission; + ///Ʒ + TThostFtdcMoneyType SpecProductFrozenCommission; + ///Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfit; + ///Ʒƽӯ + TThostFtdcMoneyType SpecProductCloseProfit; + ///ݳֲӯ㷨Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfitByAlg; + ///Ʒ֤ + TThostFtdcMoneyType SpecProductExchangeMargin; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///Ͷֲ߳ +struct CThostFtdcInvestorPositionField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcPositionDateType PositionDate; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ճֲ + TThostFtdcVolumeType Position; + ///ͷ + TThostFtdcVolumeType LongFrozen; + ///ͷ + TThostFtdcVolumeType ShortFrozen; + ///ֶ + TThostFtdcMoneyType LongFrozenAmount; + ///ֶ + TThostFtdcMoneyType ShortFrozenAmount; + /// + TThostFtdcVolumeType OpenVolume; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ֽ + TThostFtdcMoneyType OpenAmount; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ֲֳɱ + TThostFtdcMoneyType PositionCost; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ֳɱ + TThostFtdcMoneyType OpenCost; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TThostFtdcVolumeType CombPosition; + ///϶ͷ + TThostFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TThostFtdcVolumeType CombShortFrozen; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TThostFtdcVolumeType TodayPosition; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ִж + TThostFtdcVolumeType StrikeFrozen; + ///ִж + TThostFtdcMoneyType StrikeFrozenAmount; + ///ִж + TThostFtdcVolumeType AbandonFrozen; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִж + TThostFtdcVolumeType YdStrikeFrozen; +}; + +///Լ֤ +struct CThostFtdcInstrumentMarginRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///Լ +struct CThostFtdcInstrumentCommissionRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +/// +struct CThostFtdcDepthMarketDataField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; + ///վ + TThostFtdcPriceType AveragePrice; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +///ͶߺԼȨ +struct CThostFtdcInstrumentTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///͹˾û +struct CThostFtdcBrokerUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + ///û + TThostFtdcUserTypeType UserType; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///Ƿʹ + TThostFtdcBoolType IsUsingOTP; +}; + +///͹˾û +struct CThostFtdcBrokerUserPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; +}; + +///͹˾ûȨ +struct CThostFtdcBrokerUserFunctionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///͹˾ܴ + TThostFtdcBrokerFunctionCodeType BrokerFunctionCode; +}; + +///Ա̻ +struct CThostFtdcTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ϯλɽ + TThostFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TThostFtdcReturnCodeType MaxOrderMessageReference; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///Ͷ߽ +struct CThostFtdcSettlementInfoField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType Content; +}; + +///Լ֤ʵ +struct CThostFtdcInstrumentMarginRateAdjustField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///֤ +struct CThostFtdcExchangeMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; +}; + +///֤ʵ +struct CThostFtdcExchangeMarginRateAdjustField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///潻Ͷ߶ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ExchLongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ExchLongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ExchShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ExchShortMarginRatioByVolume; + ///潻Ͷ߶ͷ֤ + TThostFtdcRatioType NoLongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TThostFtdcMoneyType NoLongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TThostFtdcRatioType NoShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TThostFtdcMoneyType NoShortMarginRatioByVolume; +}; + +/// +struct CThostFtdcExchangeRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Դֵλ + TThostFtdcCurrencyUnitType FromCurrencyUnit; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; +}; + +/// +struct CThostFtdcSettlementRefField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; +}; + +///ǰʱ +struct CThostFtdcCurrentTimeField +{ + ///ǰ + TThostFtdcDateType CurrDate; + ///ǰʱ + TThostFtdcTimeType CurrTime; + ///ǰʱ䣨룩 + TThostFtdcMillisecType CurrMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +///ͨѶ׶ +struct CThostFtdcCommPhaseField +{ + /// + TThostFtdcDateType TradingDay; + ///ͨѶʱα + TThostFtdcCommPhaseNoType CommPhaseNo; + ///ϵͳ + TThostFtdcSystemIDType SystemID; +}; + +///¼Ϣ +struct CThostFtdcLoginInfoField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + /// + TThostFtdcPasswordType Password; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///Դʱ + TThostFtdcTimeType INETime; + ///¼ע + TThostFtdcLoginRemarkType LoginRemark; +}; + +///¼Ϣ +struct CThostFtdcLogoutAllField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; +}; + +///ǰ״̬ +struct CThostFtdcFrontStatusField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///û +struct CThostFtdcUserPasswordUpdateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; +}; + +///뱨 +struct CThostFtdcInputOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///־ + TThostFtdcBoolType IsSwapOrder; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +/// +struct CThostFtdcOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ + TThostFtdcVolumeType ZCETotalTradedVolume; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +/// +struct CThostFtdcExchangeOrderField +{ + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ʧ +struct CThostFtdcExchangeOrderInsertErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///뱨 +struct CThostFtdcInputOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +/// +struct CThostFtdcOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +/// +struct CThostFtdcExchangeOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ʧ +struct CThostFtdcExchangeOrderActionErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ɽ +struct CThostFtdcExchangeTradeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ɽԴ + TThostFtdcTradeSourceType TradeSource; +}; + +///ɽ +struct CThostFtdcTradeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ɽԴ + TThostFtdcTradeSourceType TradeSource; +}; + +///ûỰ +struct CThostFtdcUserSessionField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///¼ע + TThostFtdcLoginRemarkType LoginRemark; +}; + +///ѯ󱨵 +struct CThostFtdcQueryMaxOrderVolumeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷ߽ȷϢ +struct CThostFtdcSettlementInfoConfirmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ȷ + TThostFtdcDateType ConfirmDate; + ///ȷʱ + TThostFtdcTimeType ConfirmTime; +}; + +///ͬ +struct CThostFtdcSyncDepositField +{ + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcMoneyType Deposit; + ///Ƿǿƽ + TThostFtdcBoolType IsForce; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///Ѻͬ +struct CThostFtdcSyncFundMortgageField +{ + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Ѻ + TThostFtdcMoneyType MortgageAmount; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; +}; + +///͹˾ͬ +struct CThostFtdcBrokerSyncField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ͬеͶ +struct CThostFtdcSyncingInvestorField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcDateType OpenDate; + ///ֻ + TThostFtdcMobileType Mobile; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ͬеĽ״ +struct CThostFtdcSyncingTradingCodeField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ͬеͶ߷ +struct CThostFtdcSyncingInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TThostFtdcInvestorGroupNameType InvestorGroupName; +}; + +///ͬеĽ˺ +struct CThostFtdcSyncingTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ϴѺ + TThostFtdcMoneyType PreMortgage; + ///ϴö + TThostFtdcMoneyType PreCredit; + ///ϴδ + TThostFtdcMoneyType PreDeposit; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///Ϣ + TThostFtdcMoneyType InterestBase; + ///Ϣ + TThostFtdcMoneyType Interest; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + ///ʽ + TThostFtdcMoneyType Available; + ///ȡʽ + TThostFtdcMoneyType WithdrawQuota; + ///׼ + TThostFtdcMoneyType Reserve; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ö + TThostFtdcMoneyType Credit; + ///Ѻ + TThostFtdcMoneyType Mortgage; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TThostFtdcMoneyType DeliveryMargin; + ///֤ + TThostFtdcMoneyType ExchangeDeliveryMargin; + ///ڻ׼ + TThostFtdcMoneyType ReserveBalance; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ϴλ + TThostFtdcMoneyType PreFundMortgageIn; + ///ϴλʳ + TThostFtdcMoneyType PreFundMortgageOut; + /// + TThostFtdcMoneyType FundMortgageIn; + ///ʳ + TThostFtdcMoneyType FundMortgageOut; + ///Ѻ + TThostFtdcMoneyType FundMortgageAvailable; + ///Ѻҽ + TThostFtdcMoneyType MortgageableFund; + ///Ʒռñ֤ + TThostFtdcMoneyType SpecProductMargin; + ///Ʒᱣ֤ + TThostFtdcMoneyType SpecProductFrozenMargin; + ///Ʒ + TThostFtdcMoneyType SpecProductCommission; + ///Ʒ + TThostFtdcMoneyType SpecProductFrozenCommission; + ///Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfit; + ///Ʒƽӯ + TThostFtdcMoneyType SpecProductCloseProfit; + ///ݳֲӯ㷨Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfitByAlg; + ///Ʒ֤ + TThostFtdcMoneyType SpecProductExchangeMargin; +}; + +///ͬеͶֲ߳ +struct CThostFtdcSyncingInvestorPositionField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcPositionDateType PositionDate; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ճֲ + TThostFtdcVolumeType Position; + ///ͷ + TThostFtdcVolumeType LongFrozen; + ///ͷ + TThostFtdcVolumeType ShortFrozen; + ///ֶ + TThostFtdcMoneyType LongFrozenAmount; + ///ֶ + TThostFtdcMoneyType ShortFrozenAmount; + /// + TThostFtdcVolumeType OpenVolume; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ֽ + TThostFtdcMoneyType OpenAmount; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ֲֳɱ + TThostFtdcMoneyType PositionCost; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ֳɱ + TThostFtdcMoneyType OpenCost; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TThostFtdcVolumeType CombPosition; + ///϶ͷ + TThostFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TThostFtdcVolumeType CombShortFrozen; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TThostFtdcVolumeType TodayPosition; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ִж + TThostFtdcVolumeType StrikeFrozen; + ///ִж + TThostFtdcMoneyType StrikeFrozenAmount; + ///ִж + TThostFtdcVolumeType AbandonFrozen; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִж + TThostFtdcVolumeType YdStrikeFrozen; +}; + +///ͬеĺԼ֤ +struct CThostFtdcSyncingInstrumentMarginRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///ͬеĺԼ +struct CThostFtdcSyncingInstrumentCommissionRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ͬеĺԼȨ +struct CThostFtdcSyncingInstrumentTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcQryOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ѯɽ +struct CThostFtdcQryTradeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + ///ʼʱ + TThostFtdcTimeType TradeTimeStart; + ///ʱ + TThostFtdcTimeType TradeTimeEnd; +}; + +///ѯͶֲ߳ +struct CThostFtdcQryInvestorPositionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯʽ˻ +struct CThostFtdcQryTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///ѯͶ +struct CThostFtdcQryInvestorField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ѯױ +struct CThostFtdcQryTradingCodeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; +}; + +///ѯͶ +struct CThostFtdcQryInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯԼ֤ +struct CThostFtdcQryInstrumentMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ +struct CThostFtdcQryInstrumentCommissionRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯԼȨ +struct CThostFtdcQryInstrumentTradingRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ͹˾ +struct CThostFtdcQryBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯԱ +struct CThostFtdcQryTraderField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯûȨ +struct CThostFtdcQrySuperUserFunctionField +{ + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯûỰ +struct CThostFtdcQryUserSessionField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ͹˾Ա +struct CThostFtdcQryPartBrokerField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; +}; + +///ѯǰ״̬ +struct CThostFtdcQryFrontStatusField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; +}; + +///ѯ +struct CThostFtdcQryExchangeOrderField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯ +struct CThostFtdcQryOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcQryExchangeOrderActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯû +struct CThostFtdcQrySuperUserField +{ + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ +struct CThostFtdcQryExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯƷ +struct CThostFtdcQryProductField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯԼ +struct CThostFtdcQryInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; +}; + +///ѯ +struct CThostFtdcQryDepthMarketDataField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ͹˾û +struct CThostFtdcQryBrokerUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ͹˾ûȨ +struct CThostFtdcQryBrokerUserFunctionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯԱ̻ +struct CThostFtdcQryTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯˮ +struct CThostFtdcQrySyncDepositField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; +}; + +///ѯͶ߽ +struct CThostFtdcQrySettlementInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; +}; + +///ѯ֤ +struct CThostFtdcQryExchangeMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ֤ +struct CThostFtdcQryExchangeMarginRateAdjustField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ +struct CThostFtdcQryExchangeRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; +}; + +///ѯѺˮ +struct CThostFtdcQrySyncFundMortgageField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; +}; + +///ѯ +struct CThostFtdcQryHisOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; +}; + +///ǰȨԼС֤ +struct CThostFtdcOptionInstrMiniMarginField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///λ֣ȨԼС֤ + TThostFtdcMoneyType MinMargin; + ///ȡֵʽ + TThostFtdcValueMethodType ValueMethod; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰȨԼ֤ϵ +struct CThostFtdcOptionInstrMarginAdjustField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷͷ֤ϵ + TThostFtdcRatioType SShortMarginRatioByMoney; + ///Ͷͷ֤ϵ + TThostFtdcMoneyType SShortMarginRatioByVolume; + ///ֵͷ֤ϵ + TThostFtdcRatioType HShortMarginRatioByMoney; + ///ֵͷ֤ϵ + TThostFtdcMoneyType HShortMarginRatioByVolume; + ///ͷ֤ϵ + TThostFtdcRatioType AShortMarginRatioByMoney; + ///ͷ֤ϵ + TThostFtdcMoneyType AShortMarginRatioByVolume; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; + ///̿ͷ֤ϵ + TThostFtdcRatioType MShortMarginRatioByMoney; + ///̿ͷ֤ϵ + TThostFtdcMoneyType MShortMarginRatioByVolume; +}; + +///ǰȨԼѵϸ +struct CThostFtdcOptionInstrCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩ׳ɱ +struct CThostFtdcOptionInstrTradeCostField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType FixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType MiniMargin; + ///ȨԼȨ + TThostFtdcMoneyType Royalty; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType ExchFixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType ExchMiniMargin; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩ׳ɱѯ +struct CThostFtdcQryOptionInstrTradeCostField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ + TThostFtdcPriceType InputPrice; + ///ļ۸,0 + TThostFtdcPriceType UnderlyingPrice; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩʲѯ +struct CThostFtdcQryOptionInstrCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָָֻ +struct CThostFtdcIndexPriceField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ָֻ̼ + TThostFtdcPriceType ClosePrice; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ִ +struct CThostFtdcInputExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ִ +struct CThostFtdcInputExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ִ +struct CThostFtdcExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerExecOrderSeq; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ִ +struct CThostFtdcExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ִѯ +struct CThostFtdcQryExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ִϢ +struct CThostFtdcExchangeExecOrderField +{ + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ִѯ +struct CThostFtdcQryExchangeExecOrderField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ִѯ +struct CThostFtdcQryExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ִ +struct CThostFtdcExchangeExecOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ִѯ +struct CThostFtdcQryExchangeExecOrderActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ִ +struct CThostFtdcErrExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯִ +struct CThostFtdcQryErrExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ִ +struct CThostFtdcErrExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯִ +struct CThostFtdcQryErrExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ͶȨԼȨ +struct CThostFtdcOptionInstrTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDirectionType Direction; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯȨԼȨ +struct CThostFtdcQryOptionInstrTradingRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcInputForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ѯ +struct CThostFtdcForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ѯ۱ + TThostFtdcSequenceNoType BrokerForQutoSeq; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ѯ۲ѯ +struct CThostFtdcQryForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ѯϢ +struct CThostFtdcExchangeForQuoteField +{ + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ѯ۲ѯ +struct CThostFtdcQryExchangeForQuoteField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ı +struct CThostFtdcInputQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///뱨۲ +struct CThostFtdcInputQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +/// +struct CThostFtdcQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾۱ + TThostFtdcSequenceNoType BrokerQuoteSeq; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///۲ +struct CThostFtdcQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///۲ѯ +struct CThostFtdcQryQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///Ϣ +struct CThostFtdcExchangeQuoteField +{ + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///۲ѯ +struct CThostFtdcQryExchangeQuoteField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///۲ѯ +struct CThostFtdcQryQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///۲ +struct CThostFtdcExchangeQuoteActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///۲ѯ +struct CThostFtdcQryExchangeQuoteActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ȨԼdeltaֵ +struct CThostFtdcOptionInstrDeltaField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Deltaֵ + TThostFtdcRatioType Delta; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///̵ѯ +struct CThostFtdcForQuoteRspField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///ѯʱ + TThostFtdcTimeType ForQuoteTime; + ///ҵ + TThostFtdcDateType ActionDay; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰȨԼִƫֵϸ +struct CThostFtdcStrikeOffsetField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִƫֵ + TThostFtdcMoneyType Offset; + ///Ȩƫ + TThostFtdcStrikeOffsetTypeType OffsetType; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩִƫֵѯ +struct CThostFtdcQryStrikeOffsetField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///¼ +struct CThostFtdcInputLockField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType LockRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcExchangeIDType ExchangeID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +/// +struct CThostFtdcLockField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType LockRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcOrderLocalIDType LockLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType LockSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderActionStatusType LockStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerLockSeq; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ѯ +struct CThostFtdcQryLockField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType LockSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///֤ȯλ +struct CThostFtdcLockPositionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcVolumeType FrozenVolume; +}; + +///ѯ֤ȯλ +struct CThostFtdcQryLockPositionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰETFȨԼѵϸ +struct CThostFtdcETFOptionInstrCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲַ + TThostFtdcPosiDirectionType PosiDirection; +}; + +///ETFȨʲѯ +struct CThostFtdcQryETFOptionInstrCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ijֲֶ +struct CThostFtdcPosiFreezeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcVolumeType Volume; + ///ԭ + TThostFtdcFreezeReasonTypeType FreezeReasonType; + /// + TThostFtdcFreezeTypeType FreezeType; +}; + +///ѯ +struct CThostFtdcQryExchangeLockField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +/// +struct CThostFtdcExchangeLockField +{ + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcOrderLocalIDType LockLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType LockSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderActionStatusType LockStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +/// +struct CThostFtdcExchangeExecOrderActionErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +/// +struct CThostFtdcInputBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///û + TThostFtdcUserIDType UserID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +/// +struct CThostFtdcBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +/// +struct CThostFtdcExchangeBatchOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ѯ +struct CThostFtdcQryBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷֲ߳ +struct CThostFtdcLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///ͷ + TThostFtdcVolumeType LongVolume; + ///նͷ + TThostFtdcVolumeType OpenVolume; + ///ͷֲֽ,ʹ + TThostFtdcMoneyType LongAmount; + /// + TThostFtdcVolumeType TotalVolumeFrozen; + ///ͷ + TThostFtdcVolumeType LongVolumeFrozen; + ///տ + TThostFtdcVolumeType OpenVolumeFrozen; + ///ͷֲֽ,ʹ + TThostFtdcMoneyType LongAmountFrozen; +}; + +///ѯͶֲ߳ +struct CThostFtdcQryLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///͹˾ֲ +struct CThostFtdcBrokerLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcLargeVolumeType TotalVolume; + ///ͷ + TThostFtdcLargeVolumeType LongVolume; + /// + TThostFtdcLargeVolumeType TotalVolumeFrozen; + ///ͷ + TThostFtdcLargeVolumeType LongVolumeFrozen; +}; + +///ѯ͹˾ֲ +struct CThostFtdcQryBrokerLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷ֤ȯֲ +struct CThostFtdcLimitPosiSField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///տ + TThostFtdcVolumeType OpenVolume; + /// + TThostFtdcVolumeType TotalVolumeFrozen; + ///տ + TThostFtdcVolumeType OpenVolumeFrozen; +}; + +///ѯͶ֤ȯֲ +struct CThostFtdcQryLimitPosiSField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷֲ߳Ʋ +struct CThostFtdcLimitPosiParamField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///ͷ + TThostFtdcVolumeType LongVolume; + ///տ + TThostFtdcVolumeType OpenVolume; + ///ͷֲֽ,ʹ + TThostFtdcMoneyType LongAmount; +}; + +///͹˾ֲƲ +struct CThostFtdcBrokerLimitPosiParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcLargeVolumeType TotalVolume; + ///ͷ + TThostFtdcLargeVolumeType LongVolume; +}; + +///Ͷ֤ȯֲƲ +struct CThostFtdcLimitPosiParamSField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///տ + TThostFtdcVolumeType OpenVolume; +}; + +///֤ȯò +struct CThostFtdcInputStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///֤ȯò +struct CThostFtdcStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///֤ȯòѯ +struct CThostFtdcQryStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///֤ȯò +struct CThostFtdcExchangeStockDisposalActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///֤ȯò +struct CThostFtdcQryExchangeStockDisposalActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯ֤ȯò +struct CThostFtdcQryErrStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///֤ȯò +struct CThostFtdcExchangeStockDisposalActionErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯñ + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///֤ȯò +struct CThostFtdcErrStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///Ͷ߷ּ +struct CThostFtdcInvestorLevelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷ߷ּ + TThostFtdcLevelTypeType LevelType; +}; + +///ϺԼȫϵ +struct CThostFtdcCombInstrumentGuardField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcRatioType GuarantRatio; +}; + +///ϺԼȫϵѯ +struct CThostFtdcQryCombInstrumentGuardField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CThostFtdcInputCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +/// +struct CThostFtdcCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ϲѯ +struct CThostFtdcQryCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ϣ +struct CThostFtdcExchangeCombActionField +{ + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ϲѯ +struct CThostFtdcQryExchangeCombActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///Ʒۻ +struct CThostFtdcProductExchRateField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///۱ + TThostFtdcCurrencyIDType QuoteCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; +}; + +///Ʒۻʲѯ +struct CThostFtdcQryProductExchRateField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; +}; + +///ָ +struct CThostFtdcInputDesignateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ָǼ + TThostFtdcOrderRefType DesignateRef; + ///û + TThostFtdcUserIDType UserID; + ///ָ + TThostFtdcDesignateTypeType DesignateType; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָ +struct CThostFtdcDesignateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ָǼ + TThostFtdcOrderRefType DesignateRef; + ///û + TThostFtdcUserIDType UserID; + ///ָ + TThostFtdcDesignateTypeType DesignateType; + ///ָ + TThostFtdcOrderLocalIDType DesignateLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ָ״̬ + TThostFtdcOrderActionStatusType DesignateStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ָ +struct CThostFtdcQryDesignateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָϢ +struct CThostFtdcExchangeDesignateField +{ + ///ָ + TThostFtdcDesignateTypeType DesignateType; + ///ָ + TThostFtdcOrderLocalIDType DesignateLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ָ״̬ + TThostFtdcOrderActionStatusType DesignateStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///֤ȯ +struct CThostFtdcInputStockDisposalField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯõǼ + TThostFtdcOrderRefType StockDisposalRef; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///֤ȯ +struct CThostFtdcStockDisposalField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯõǼ + TThostFtdcOrderRefType StockDisposalRef; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯ״̬ + TThostFtdcStockDisposalStatusType StockDisposalStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; +}; + +///֤ȯ +struct CThostFtdcQryStockDisposalField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///֤ȯϢ +struct CThostFtdcExchangeStockDisposalField +{ + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯ״̬ + TThostFtdcStockDisposalStatusType StockDisposalStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; +}; + +///ѯͶ߷ּ +struct CThostFtdcQryInvestorLevelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯѯۼ۲ +struct CThostFtdcQryForQuoteParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯۼ۲ +struct CThostFtdcForQuoteParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///¼ + TThostFtdcPriceType LastPrice; + ///۲ + TThostFtdcPriceType PriceInterval; +}; + +///ѯȨ +struct CThostFtdcQryExecFreezeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩ +struct CThostFtdcExecFreezeField +{ + ///ĺԼ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + ///_λ + TThostFtdcVolumeType Volume; + /// + TThostFtdcMoneyType FrozenAmount; +}; + +///ǰȨԼѵϸ +struct CThostFtdcMMOptionInstrCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩʲѯ +struct CThostFtdcQryMMOptionInstrCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///̺Լ +struct CThostFtdcMMInstrumentCommissionRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ̺Լ +struct CThostFtdcQryMMInstrumentCommissionRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰѵϸ +struct CThostFtdcInstrumentOrderCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcRatioType OrderCommByVolume; + /// + TThostFtdcRatioType OrderActionCommByVolume; +}; + +///ʲѯ +struct CThostFtdcQryInstrumentOrderCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷ߽ +struct CThostFtdcLimitAmountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͷֲֽ + TThostFtdcMoneyType LongAmount; + ///ͷֲֽ + TThostFtdcMoneyType LongAmountFrozen; +}; + +///ѯͶ߽ +struct CThostFtdcQryLimitAmountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷ߽Ʋ +struct CThostFtdcLimitAmountParamField +{ + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͷֲֽ + TThostFtdcMoneyType LongAmount; +}; + +///ǰȨԼ֤ϵ +struct CThostFtdcOptionInstrMarginGuardField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷͷ֤ϵ + TThostFtdcRatioType SShortMarginRatioByMoney; + ///Ͷͷ֤ϵ + TThostFtdcMoneyType SShortMarginRatioByVolume; + ///ֵͷ֤ϵ + TThostFtdcRatioType HShortMarginRatioByMoney; + ///ֵͷ֤ϵ + TThostFtdcMoneyType HShortMarginRatioByVolume; + ///ͷ֤ϵ + TThostFtdcRatioType AShortMarginRatioByMoney; + ///ͷ֤ϵ + TThostFtdcMoneyType AShortMarginRatioByVolume; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///г +struct CThostFtdcMarketDataField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +/// +struct CThostFtdcMarketDataBaseField +{ + /// + TThostFtdcDateType TradingDay; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + ///ʵ + TThostFtdcRatioType PreDelta; +}; + +///龲̬ +struct CThostFtdcMarketDataStaticField +{ + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcPriceType ClosePrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ʵ + TThostFtdcRatioType CurrDelta; +}; + +///³ɽ +struct CThostFtdcMarketDataLastMatchField +{ + ///¼ + TThostFtdcPriceType LastPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; +}; + +///ż +struct CThostFtdcMarketDataBestPriceField +{ + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; +}; + +/// +struct CThostFtdcMarketDataBid23Field +{ + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; +}; + +/// +struct CThostFtdcMarketDataAsk23Field +{ + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; +}; + +///ġ +struct CThostFtdcMarketDataBid45Field +{ + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; +}; + +///ġ +struct CThostFtdcMarketDataAsk45Field +{ + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; +}; + +///ʱ +struct CThostFtdcMarketDataUpdateTimeField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///齻 +struct CThostFtdcMarketDataExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָĺԼ +struct CThostFtdcSpecificInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///Լ״̬ +struct CThostFtdcInstrumentStatusField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcSettlementGroupIDType SettlementGroupID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Լ״̬ + TThostFtdcInstrumentStatusType InstrumentStatus; + ///׽׶α + TThostFtdcTradingSegmentSNType TradingSegmentSN; + ///뱾״̬ʱ + TThostFtdcTimeType EnterTime; + ///뱾״̬ԭ + TThostFtdcInstStatusEnterReasonType EnterReason; +}; + +///ѯԼ״̬ +struct CThostFtdcQryInstrumentStatusField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; +}; + +///Ͷ˻ +struct CThostFtdcInvestorAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///ӯ㷨 +struct CThostFtdcPositionProfitAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///ע + TThostFtdcMemoType Memo; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///Աʽۿ +struct CThostFtdcDiscountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʽۿ۱ + TThostFtdcRatioType Discount; +}; + +///ѯת +struct CThostFtdcQryTransferBankField +{ + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; +}; + +///ת +struct CThostFtdcTransferBankField +{ + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///ѯͶֲ߳ϸ +struct CThostFtdcQryInvestorPositionDetailField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷֲ߳ϸ +struct CThostFtdcInvestorPositionDetailField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcDateType OpenDate; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcVolumeType Volume; + ///ּ + TThostFtdcPriceType OpenPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///նгֲӯ + TThostFtdcMoneyType PositionProfitByDate; + ///ʶԳֲӯ + TThostFtdcMoneyType PositionProfitByTrade; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + /// + TThostFtdcPriceType LastSettlementPrice; + /// + TThostFtdcPriceType SettlementPrice; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///鱨̻ +struct CThostFtdcMDTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ϯλɽ + TThostFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TThostFtdcReturnCodeType MaxOrderMessageReference; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///ѯ鱨̻ +struct CThostFtdcQryMDTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯͻ֪ͨ +struct CThostFtdcQryNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ͻ֪ͨ +struct CThostFtdcNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ϣ + TThostFtdcContentType Content; + ///͹˾֪ͨк + TThostFtdcSequenceLabelType SequenceLabel; +}; + +///ûȨ +struct CThostFtdcUserRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ͻȨ + TThostFtdcUserRightTypeType UserRightType; + ///Ƿֹ + TThostFtdcBoolType IsForbidden; +}; + +///ѯϢȷ +struct CThostFtdcQrySettlementInfoConfirmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///װؽϢ +struct CThostFtdcLoadSettlementInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///͹˾ʽ㷨 +struct CThostFtdcBrokerWithdrawAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ㷨 + TThostFtdcAlgorithmType WithdrawAlgorithm; + ///ʽʹ + TThostFtdcRatioType UsingRatio; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType IncludeCloseProfit; + ///޲޳ɽͻǷܿ + TThostFtdcAllWithoutTradeType AllWithoutTrade; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///Ƿû¼ + TThostFtdcBoolType IsBrokerUserEvent; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; + ///Ȩ㷨 + TThostFtdcBalanceAlgorithmType BalanceAlgorithm; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordUpdateV1Field +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordUpdateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯϺԼ +struct CThostFtdcQryCombinationLegField +{ + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; +}; + +///ѯϺԼ +struct CThostFtdcQrySyncStatusField +{ + /// + TThostFtdcDateType TradingDay; +}; + +///Ͻ׺Լĵ +struct CThostFtdcCombinationLegField +{ + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + /// + TThostFtdcImplyLevelType ImplyLevel; +}; + +///ͬ״̬ +struct CThostFtdcSyncStatusField +{ + /// + TThostFtdcDateType TradingDay; + ///ͬ״̬ + TThostFtdcDataSyncStatusType DataSyncStatus; +}; + +///ѯϵ +struct CThostFtdcQryLinkManField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ϵ +struct CThostFtdcLinkManField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵ + TThostFtdcPersonTypeType PersonType; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + /// + TThostFtdcPartyNameType PersonName; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcZipCodeType ZipCode; + ///ȼ + TThostFtdcPriorityType Priority; + /// + TThostFtdcUOAZipCodeType UOAZipCode; + ///ȫ + TThostFtdcInvestorFullNameType PersonFullName; +}; + +///ѯ͹˾û¼ +struct CThostFtdcQryBrokerUserEventField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; +}; + +///ѯ͹˾û¼ +struct CThostFtdcBrokerUserEventField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; + ///û¼ + TThostFtdcSequenceNoType EventSequenceNo; + ///¼ + TThostFtdcDateType EventDate; + ///¼ʱ + TThostFtdcTimeType EventTime; + ///û¼Ϣ + TThostFtdcUserEventInfoType UserEventInfo; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯǩԼ +struct CThostFtdcQryContractBankField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; +}; + +///ѯǩԼӦ +struct CThostFtdcContractBankField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; +}; + +///Ͷϳֲϸ +struct CThostFtdcInvestorPositionCombineDetailField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + ///ϱ + TThostFtdcTradeIDType TradeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + ///ֲ + TThostFtdcVolumeType TotalAmt; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ɽ + TThostFtdcTradeGroupIDType TradeGroupID; +}; + +///Ԥ +struct CThostFtdcParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ԥ񱨵 + TThostFtdcParkedOrderIDType ParkedOrderID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ״̬ + TThostFtdcParkedOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///Ԥ񵥲 +struct CThostFtdcParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ԥ񳷵 + TThostFtdcParkedOrderActionIDType ParkedOrderActionID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ񳷵״̬ + TThostFtdcParkedOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ѯԤ +struct CThostFtdcQryParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯԤ񳷵 +struct CThostFtdcQryParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ɾԤ +struct CThostFtdcRemoveParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񱨵 + TThostFtdcParkedOrderIDType ParkedOrderID; +}; + +///ɾԤ񳷵 +struct CThostFtdcRemoveParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񳷵 + TThostFtdcParkedOrderActionIDType ParkedOrderActionID; +}; + +///͹˾ʽ㷨 +struct CThostFtdcInvestorWithdrawAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʽ + TThostFtdcRatioType UsingRatio; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; +}; + +///ѯϳֲϸ +struct CThostFtdcQryInvestorPositionCombineDetailField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; +}; + +///ɽ +struct CThostFtdcMarketDataAveragePriceField +{ + ///վ + TThostFtdcPriceType AveragePrice; +}; + +///УͶ +struct CThostFtdcVerifyInvestorPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcPasswordType Password; +}; + +///ûIP +struct CThostFtdcUserIPField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///IPַ + TThostFtdcIPAddressType IPMask; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///û¼֪ͨϢ +struct CThostFtdcTradingNoticeInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʱ + TThostFtdcTimeType SendTime; + ///Ϣ + TThostFtdcContentType FieldContent; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///к + TThostFtdcSequenceNoType SequenceNo; +}; + +///û¼֪ͨ +struct CThostFtdcTradingNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///û + TThostFtdcUserIDType UserID; + ///ʱ + TThostFtdcTimeType SendTime; + ///к + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType FieldContent; +}; + +///ѯ¼֪ͨ +struct CThostFtdcQryTradingNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ѯ󱨵 +struct CThostFtdcQryErrOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///󱨵 +struct CThostFtdcErrOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ױ + TThostFtdcClientIDType ClientID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ѯ󱨵 +struct CThostFtdcErrorConditionalOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ + TThostFtdcVolumeType ZCETotalTradedVolume; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///ʽ˺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ѯ󱨵 +struct CThostFtdcQryErrOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///󱨵 +struct CThostFtdcErrOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ͶʵԪ + TThostFtdcInvestUnitIDType InvestUnitID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///Macַ + TThostFtdcMacAddressType MacAddress; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ״̬ +struct CThostFtdcQryExchangeSequenceField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///״̬ +struct CThostFtdcExchangeSequenceField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Լ״̬ + TThostFtdcInstrumentStatusType MarketStatus; +}; + +///ݼ۸ѯ󱨵 +struct CThostFtdcQueryMaxOrderVolumeWithPriceField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ͹˾ײ +struct CThostFtdcQryBrokerTradingParamsField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///͹˾ײ +struct CThostFtdcBrokerTradingParamsField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤۸ + TThostFtdcMarginPriceTypeType MarginPriceType; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ȨȨ۸ + TThostFtdcOptionRoyaltyPriceTypeType OptionRoyaltyPriceType; +}; + +///ѯ͹˾㷨 +struct CThostFtdcQryBrokerTradingAlgosField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///͹˾㷨 +struct CThostFtdcBrokerTradingAlgosField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ֲִ㷨 + TThostFtdcHandlePositionAlgoIDType HandlePositionAlgoID; + ///Ѱұ֤㷨 + TThostFtdcFindMarginRateAlgoIDType FindMarginRateAlgoID; + ///ʽ㷨 + TThostFtdcHandleTradingAccountAlgoIDType HandleTradingAccountAlgoID; +}; + +///ѯ͹˾ʽ +struct CThostFtdcQueryBrokerDepositField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///͹˾ʽ +struct CThostFtdcBrokerDepositField +{ + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ʽ + TThostFtdcMoneyType Available; + ///׼ + TThostFtdcMoneyType Reserve; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; +}; + +///ѯ֤ϵͳ͹˾Կ +struct CThostFtdcQryCFMMCBrokerKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///֤ϵͳ͹˾Կ +struct CThostFtdcCFMMCBrokerKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Կ + TThostFtdcDateType CreateDate; + ///Կʱ + TThostFtdcTimeType CreateTime; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬Կ + TThostFtdcCFMMCKeyType CurrentKey; + ///̬Կ + TThostFtdcCFMMCKeyKindType KeyKind; +}; + +///֤ϵͳ͹˾ʽ˻Կ +struct CThostFtdcCFMMCTradingAccountKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬Կ + TThostFtdcCFMMCKeyType CurrentKey; +}; + +///ѯ֤ϵͳ͹˾ʽ˻Կ +struct CThostFtdcQryCFMMCTradingAccountKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///û̬Ʋ +struct CThostFtdcBrokerUserOTPParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ṩ + TThostFtdcOTPVendorsIDType OTPVendorsID; + ///̬к + TThostFtdcSerialNumberType SerialNumber; + ///Կ + TThostFtdcAuthKeyType AuthKey; + ///Ưֵ + TThostFtdcLastDriftType LastDrift; + ///ɹֵ + TThostFtdcLastSuccessType LastSuccess; + ///̬ + TThostFtdcOTPTypeType OTPType; +}; + +///ֹͬû̬ +struct CThostFtdcManualSyncBrokerUserOTPField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ + TThostFtdcOTPTypeType OTPType; + ///һ̬ + TThostFtdcPasswordType FirstOTP; + ///ڶ̬ + TThostFtdcPasswordType SecondOTP; +}; + +///Ͷģ +struct CThostFtdcCommRateModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///ģ + TThostFtdcCommModelNameType CommModelName; +}; + +///ѯͶģ +struct CThostFtdcQryCommRateModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; +}; + +///Ͷ֤߱ģ +struct CThostFtdcMarginModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; + ///ģ + TThostFtdcCommModelNameType MarginModelName; +}; + +///ѯͶ֤߱ģ +struct CThostFtdcQryMarginModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ֵ۵Ϣ +struct CThostFtdcEWarrantOffsetField +{ + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType Volume; +}; + +///ѯֵ۵Ϣ +struct CThostFtdcQryEWarrantOffsetField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ѯͶƷ/Ʒֱ֤ +struct CThostFtdcQryInvestorProductGroupMarginField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ͶƷ/Ʒֱ֤ +struct CThostFtdcInvestorProductGroupMarginField +{ + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType LongFrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType ShortFrozenMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ͷ֤ + TThostFtdcMoneyType LongUseMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortUseMargin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///ͷ֤ + TThostFtdcMoneyType LongExchMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortExchMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + /// + TThostFtdcMoneyType FrozenCommission; + /// + TThostFtdcMoneyType Commission; + ///ʽ + TThostFtdcMoneyType FrozenCash; + ///ʽ + TThostFtdcMoneyType CashIn; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///۵ܽ + TThostFtdcMoneyType OffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortOffsetAmount; + ///۵ܽ + TThostFtdcMoneyType ExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortExchOffsetAmount; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯû +struct CThostFtdcQueryCFMMCTradingAccountTokenField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///û +struct CThostFtdcCFMMCTradingAccountTokenField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬ + TThostFtdcCFMMCTokenType Token; +}; + +///ͶָȨ +struct CThostFtdcInstructionRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ָȨ + TThostFtdcInstructionRightTypeType InstructionRight; + ///Ƿֹ + TThostFtdcBoolType IsForbidden; +}; + +///ѯƷ +struct CThostFtdcQryProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ͶƷ/Ʒֱ֤Ʒ +struct CThostFtdcProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductGroupID; +}; + +/// +struct CThostFtdcBulletinField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcBulletinIDType BulletinID; + ///к + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcNewsTypeType NewsType; + ///̶ + TThostFtdcNewsUrgencyType NewsUrgency; + ///ʱ + TThostFtdcTimeType SendTime; + ///ϢժҪ + TThostFtdcAbstractType Abstract; + ///ϢԴ + TThostFtdcComeFromType ComeFrom; + ///Ϣ + TThostFtdcContentType Content; + ///WEBַ + TThostFtdcURLLinkType URLLink; + ///г + TThostFtdcMarketIDType MarketID; +}; + +///ѯ +struct CThostFtdcQryBulletinField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcBulletinIDType BulletinID; + ///к + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcNewsTypeType NewsType; + ///̶ + TThostFtdcNewsUrgencyType NewsUrgency; +}; + +///תʿ +struct CThostFtdcReqOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; +}; + +///ת +struct CThostFtdcReqCancelAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; +}; + +///˻ +struct CThostFtdcReqChangeAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ת +struct CThostFtdcReqTransferField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; +}; + +///зʽתڻӦ +struct CThostFtdcRspTransferField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CThostFtdcReqRepealField +{ + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; +}; + +///Ӧ +struct CThostFtdcRspRepealField +{ + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ +struct CThostFtdcReqQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ѯ˻ϢӦ +struct CThostFtdcRspQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; +}; + +///ǩǩ +struct CThostFtdcFutureSignIOField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ǩӦ +struct CThostFtdcRspFutureSignInField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; +}; + +///ǩ +struct CThostFtdcReqFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ǩӦ +struct CThostFtdcRspFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯָˮŵĽ׽ +struct CThostFtdcReqQueryTradeResultBySerialField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ˮ + TThostFtdcSerialType Reference; + ///ˮŷߵĻ + TThostFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TThostFtdcOrganCodeType RefrenceIssure; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ѯָˮŵĽ׽Ӧ +struct CThostFtdcRspQueryTradeResultBySerialField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///ˮ + TThostFtdcSerialType Reference; + ///ˮŷߵĻ + TThostFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TThostFtdcOrganCodeType RefrenceIssure; + ///ԭʼش + TThostFtdcReturnCodeType OriginReturnCode; + ///ԭʼ + TThostFtdcDescrInfoForReturnCodeType OriginDescrInfoForReturnCode; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ļ +struct CThostFtdcReqDayEndFileReadyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ļҵ + TThostFtdcFileBusinessCodeType FileBusinessCode; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ؽ +struct CThostFtdcReturnResultField +{ + ///ش + TThostFtdcReturnCodeType ReturnCode; + /// + TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; +}; + +///֤ڻʽ +struct CThostFtdcVerifyFuturePasswordField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///װ + TThostFtdcInstallIDType InstallID; + ///ID + TThostFtdcTIDType TID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///֤ͻϢ +struct CThostFtdcVerifyCustInfoField +{ + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; +}; + +///֤ڻʽͿͻϢ +struct CThostFtdcVerifyFuturePasswordAndCustInfoField +{ + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///֤ڻʽͿͻϢ +struct CThostFtdcDepositResultInformField +{ + ///ˮţˮΪڱ̷صˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcRequestIDType RequestID; + ///ش + TThostFtdcReturnCodeType ReturnCode; + /// + TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; +}; + +///׺ڱ̷Կͬ +struct CThostFtdcReqSyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///׺ڱ̷ԿͬӦ +struct CThostFtdcRspSyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ֪ͨ +struct CThostFtdcNotifyQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ת˽ˮ +struct CThostFtdcTransferSerialField +{ + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateSerial; + ///׷ + TThostFtdcTradeDateType TradeDate; + /// + TThostFtdcDateType TradingDay; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///Ự + TThostFtdcSessionIDType SessionID; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///ڻ˾ʺ + TThostFtdcFutureAccTypeType FutureAccType; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///׽ + TThostFtdcTradeAmountType TradeAmount; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///Ч־ + TThostFtdcAvailabilityFlagType AvailabilityFlag; + ///Ա + TThostFtdcOperatorCodeType OperatorCode; + ///ʺ + TThostFtdcBankAccountType BankNewAccount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯתˮ +struct CThostFtdcQryTransferSerialField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ǩ֪ͨ +struct CThostFtdcNotifyFutureSignInField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; +}; + +///ǩ֪ͨ +struct CThostFtdcNotifyFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///׺ڱ̷Կ֪ͬͨ +struct CThostFtdcNotifySyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯǩԼϵ +struct CThostFtdcQryAccountregisterField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ͻϢ +struct CThostFtdcAccountregisterField +{ + /// + TThostFtdcTradeDateType TradeDay; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///ڻ˾֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + /// + TThostFtdcOpenOrDestroyType OpenOrDestroy; + ///ǩԼ + TThostFtdcTradeDateType RegDate; + ///Լ + TThostFtdcTradeDateType OutDate; + ///ID + TThostFtdcTIDType TID; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; +}; + +///ڿϢ +struct CThostFtdcOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///Ϣ +struct CThostFtdcCancelAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ڱ˺Ϣ +struct CThostFtdcChangeAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ԱȨ +struct CThostFtdcSecAgentACIDMapField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcCurrencyIDType CurrencyID; + ///нʽʺ + TThostFtdcAccountIDType BrokerSecAgentID; +}; + +///ԱȨ޲ѯ +struct CThostFtdcQrySecAgentACIDMapField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ֱĽȨ +struct CThostFtdcUserRightsAssignField +{ + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; +}; + +///ù˾ǷڱʾĽȨ +struct CThostFtdcBrokerUserRightAssignField +{ + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; + ///ܷ + TThostFtdcBoolType Tradeable; +}; + +///ֱת +struct CThostFtdcDRTransferField +{ + ///ԭĴ + TThostFtdcDRIdentityIDType OrigDRIdentityID; + ///Ŀ꽻Ĵ + TThostFtdcDRIdentityIDType DestDRIdentityID; + ///ԭӦõԪ + TThostFtdcBrokerIDType OrigBrokerID; + ///ĿõԪ + TThostFtdcBrokerIDType DestBrokerID; +}; + +///FensûϢ +struct CThostFtdcFensUserInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ģʽ + TThostFtdcLoginModeType LoginMode; +}; + +///ǰ +struct CThostFtdcCurrTransferIdentityField +{ + ///Ĵ + TThostFtdcDRIdentityIDType IdentityID; +}; + +///ֹ¼û +struct CThostFtdcLoginForbiddenUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; +}; + +///ѯֹ¼û +struct CThostFtdcQryLoginForbiddenUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///UDP鲥Ϣ +struct CThostFtdcMulticastGroupInfoField +{ + ///鲥IPַ + TThostFtdcIPAddressType GroupIP; + ///鲥IP˿ + TThostFtdcIPPortType GroupPort; + ///Դַ + TThostFtdcIPAddressType SourceIP; +}; + +///ʽ˻׼ +struct CThostFtdcTradingAccountReserveField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///׼ + TThostFtdcMoneyType Reserve; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///DBF¼ +struct CThostFtdcDBFRecordField +{ + ///DBF + TThostFtdcDBFComdTypeType DBFComdType; + ///DBFʱ + TThostFtdcDBFComTimeType DBFComTime; + ///DBFԭʼˮ + TThostFtdcDBFComNoType DBFOComNo; + ///DBFˮ + TThostFtdcDBFComNoType DBFComNo; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName1; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent1; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName2; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent2; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName3; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent3; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName4; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent4; +}; + + + +#endif diff --git a/include/CTP_SOPT/error.dtd b/include/CTP_SOPT/error.dtd new file mode 100644 index 0000000..15e50b7 --- /dev/null +++ b/include/CTP_SOPT/error.dtd @@ -0,0 +1,9 @@ + + + + + diff --git a/include/CTP_SOPT/error.xml b/include/CTP_SOPT/error.xml new file mode 100644 index 0000000..00ba65e --- /dev/null +++ b/include/CTP_SOPT/error.xml @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/CTP_SOPT/win32/thostmduserapi.dll b/include/CTP_SOPT/win32/thostmduserapi.dll new file mode 100644 index 0000000..752f259 Binary files /dev/null and b/include/CTP_SOPT/win32/thostmduserapi.dll differ diff --git a/include/CTP_SOPT/win32/thostmduserapi.lib b/include/CTP_SOPT/win32/thostmduserapi.lib new file mode 100644 index 0000000..fc22327 Binary files /dev/null and b/include/CTP_SOPT/win32/thostmduserapi.lib differ diff --git a/include/CTP_SOPT/win32/thosttraderapi.dll b/include/CTP_SOPT/win32/thosttraderapi.dll new file mode 100644 index 0000000..841ac45 Binary files /dev/null and b/include/CTP_SOPT/win32/thosttraderapi.dll differ diff --git a/include/CTP_SOPT/win32/thosttraderapi.lib b/include/CTP_SOPT/win32/thosttraderapi.lib new file mode 100644 index 0000000..cccca3d Binary files /dev/null and b/include/CTP_SOPT/win32/thosttraderapi.lib differ diff --git a/include/ChinaStock.cpp b/include/ChinaStock.cpp index 2b16aa6..3054e2a 100644 --- a/include/ChinaStock.cpp +++ b/include/ChinaStock.cpp @@ -3,10 +3,17 @@ #include +//http://www.jisilu.cn/question/37830 +//提问:如何识别哪些分级是上海分级基金? +//回答:上海分级母基、A和B份额的代码是以50开头的,深交所的分级A和B类的代码以15开头,母基的代码以16开头。 + +//http://www.sse.com.cn/assortment/fund/list/ +//http://lefu.szse.cn/ InstrumentType InstrumentID_2_InstrumentType_SSE(int In) { // 只有6位,8位的期权已经提前过滤 int prefix1 = In / 100000; + int prefix2 = In / 10000; int prefix3 = In / 1000; switch (prefix1) { @@ -32,6 +39,13 @@ InstrumentType InstrumentID_2_InstrumentType_SSE(int In) case 3: return InstrumentType::InstrumentType_Future; case 5: + switch (prefix2) + { + case 50: + return InstrumentType::InstrumentType_LOF; // + case 51: + return InstrumentType::InstrumentType_ETF; // + } switch (prefix3) { case 500: @@ -57,11 +71,12 @@ InstrumentType InstrumentID_2_InstrumentType_SSE(int In) } } -InstrumentType InstrumentID_2_InstrumentType_SZE(int In) +InstrumentType InstrumentID_2_InstrumentType_SZSE(int In) { // 只有6位,取前2 int prefix1 = In / 100000; int prefix2 = In / 10000; + int prefix3 = In / 1000; switch (prefix2) { case 0: @@ -76,6 +91,15 @@ InstrumentType InstrumentID_2_InstrumentType_SZE(int In) case 12: case 13: return InstrumentType::InstrumentType_Bond; + case 15:// AB + switch (prefix3) + { + case 159: + return InstrumentType::InstrumentType_ETF; + } + return InstrumentType::InstrumentType_LOF; + case 16:// 母基 + return InstrumentType::InstrumentType_LOF; case 17: case 18: return InstrumentType::InstrumentType_ETF; @@ -104,6 +128,7 @@ PriceType InstrumentID_2_PriceTick_SSE(int In) { // 只有6位,8位的期权已经提前过滤 int prefix1 = In / 100000; + int prefix2 = In / 10000; int prefix3 = In / 1000; switch (prefix1) { @@ -132,11 +157,12 @@ PriceType InstrumentID_2_PriceTick_SSE(int In) return 0.01; } -PriceType InstrumentID_2_PriceTick_SZE(int In) +PriceType InstrumentID_2_PriceTick_SZSE(int In) { // 只有6位,取前2 int prefix1 = In / 100000; int prefix2 = In / 10000; + int prefix3 = In / 1000; switch (prefix2) { case 0: @@ -151,6 +177,9 @@ PriceType InstrumentID_2_PriceTick_SZE(int In) case 12: case 13: return 0.001; + case 15: + case 16: + return 0.001; case 17: case 18: return 0.001; diff --git a/include/ChinaStock.h b/include/ChinaStock.h index 38dd081..82f0047 100644 --- a/include/ChinaStock.h +++ b/include/ChinaStock.h @@ -11,9 +11,9 @@ InstrumentType InstrumentID_2_InstrumentType_SSE(int In); -InstrumentType InstrumentID_2_InstrumentType_SZE(int In); +InstrumentType InstrumentID_2_InstrumentType_SZSE(int In); InstrumentType InstrumentID_2_InstrumentType_NEEQ(int In); PriceType InstrumentID_2_PriceTick_SSE(int In); -PriceType InstrumentID_2_PriceTick_SZE(int In); +PriceType InstrumentID_2_PriceTick_SZSE(int In); PriceType InstrumentID_2_PriceTick_NEEQ(int In); #endif \ No newline at end of file diff --git a/include/CrossPlatform.h b/include/CrossPlatform.h index ecc29e5..9bdf36a 100644 --- a/include/CrossPlatform.h +++ b/include/CrossPlatform.h @@ -27,5 +27,10 @@ #endif +#ifdef BUILDING_QUEUE_DLL +#define QUEUE_DLL_PUBLIC DLL_PUBLIC +#else +#define QUEUE_DLL_PUBLIC +#endif #endif // _CROSS_PLATFORM_H_ diff --git a/include/Kingstar/IncEx/KSCosApi.h b/include/Kingstar/IncEx/KSCosApi.h new file mode 100644 index 0000000..d58d75c --- /dev/null +++ b/include/Kingstar/IncEx/KSCosApi.h @@ -0,0 +1,118 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSCosApi.h +///@brief ˿ͻӿ +///////////////////////////////////////////////////////////////////////// + +#ifndef __KSCOSAPI_H_INCLUDED_ +#define __KSCOSAPI_H_INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "KSUserApiStructEx.h" +#include "KSVocApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) && !defined(KSTRADEAPI_STATIC_LIB) + +#ifdef LIB_TRADER_API_EXPORT +#define TRADER_COSAPI_EXPORT __declspec(dllexport) +#else +#define TRADER_COSAPI_EXPORT __declspec(dllimport) +#endif +#else +#ifdef WIN32 +#define TRADER_COSAPI_EXPORT +#else +#define TRADER_COSAPI_EXPORT __attribute__((visibility("default"))) +#endif + +#endif + +namespace KingstarAPI +{ + + class CKSCosSpi + { + public: + ///¼Ӧ + virtual void OnRspInitInsertConditionalOrder(CKSConditionalOrderOperResultField *pInitInsertConditionalOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ѯӦ + virtual void OnRspQueryConditionalOrder(CKSConditionalOrderOperResultField *pQueryConditionalOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///޸Ӧ + virtual void OnRspModifyConditionalOrder(CKSConditionalOrderOperResultField *pModifyConditionalOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ͣӦ + virtual void OnRspPauseConditionalOrder(CKSConditionalOrderOperResultField *pPauseConditionalOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ɾӦ + virtual void OnRspRemoveConditionalOrder(CKSConditionalOrderRspResultField *pRemoveConditionalOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ѡӦ + virtual void OnRspSelectConditionalOrder(CKSConditionalOrderRspResultField *pSelectConditionalOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ֹֹӯ¼Ӧ + virtual void OnRspInsertProfitAndLossOrder(CKSProfitAndLossOrderOperResultField *pInsertProfitAndLossOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ֹֹӯ޸Ӧ + virtual void OnRspModifyProfitAndLossOrder(CKSProfitAndLossOrderOperResultField *pModifyProfitAndLossOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ֹֹӯɾӦ + virtual void OnRspRemoveProfitAndLossOrder(CKSProfitAndLossOrderRemoveField *pRemoveProfitAndLossOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ֹֹӯѯӦ + virtual void OnRspQueryProfitAndLossOrder(CKSProfitAndLossOrderOperResultField *pQueryProfitAndLossOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ѡ֪ͨ + virtual void OnRtnCOSAskSelect(CKSCOSAskSelectField *pCOSAskSelect) {}; + + ///״̬֪ͨ + virtual void OnRtnCOSStatus(CKSCOSStatusField *pCOSStatus) {}; + + ///ֹֹӯ״̬֪ͨ + virtual void OnRtnPLStatus(CKSPLStatusField *pPLStatus) {}; + }; + + class TRADER_COSAPI_EXPORT CKSCosApi + { + public: + ///¼ + virtual int ReqInitInsertConditionalOrder(CKSConditionalOrderInitInsert *pConditionalOrderInitInsert, int nRequestID) = 0; + + ///ѯ + virtual int ReqQueryConditionalOrder(CKSConditionalOrderQuery *pConditionalOrderQuery, int nRequestID) = 0; + + ///޸ + virtual int ReqModifyConditionalOrder(CKSConditionalOrderModify *pConditionalOrderModify, int nRequestID) = 0; + + ///ɾ + virtual int ReqRemoveConditionalOrder(CKSConditionalOrderRemove *pConditionalOrderRemove, int nRequestID) = 0; + + ///ͣ򼤻 + virtual int ReqStateAlterConditionalOrder(CKSConditionalOrderStateAlter *pConditionalOrderStateAlter, int nRequestID) = 0; + + ///ѡ + virtual int ReqSelectConditionalOrder(CKSConditionalOrderSelect *pConditionalOrderSelect, int nRequestID) = 0; + + ///ֹֹӯ¼ + virtual int ReqInsertProfitAndLossOrder(CKSProfitAndLossOrderInsert *pProfitAndLossOrderInsert, int nRequestID) = 0; + + ///ֹֹӯ޸ + virtual int ReqModifyProfitAndLossOrder(CKSProfitAndLossOrderModify *pProfitAndLossOrderModify, int nRequestID) = 0; + + ///ֹֹӯɾ + virtual int ReqRemoveProfitAndLossOrder(CKSProfitAndLossOrderRemove *pProfitAndLossOrderRemove, int nRequestID) = 0; + + ///ֹֹӯѯ + virtual int ReqQueryProfitAndLossOrder(CKSProfitAndLossOrderQuery *pProfitAndLossOrderQuery, int nRequestID) = 0; + + protected: + ~CKSCosApi(){}; + }; + +} // end of namespace KingstarAPI +#endif \ No newline at end of file diff --git a/include/Kingstar/IncEx/KSMdApiEx.h b/include/Kingstar/IncEx/KSMdApiEx.h new file mode 100644 index 0000000..deae2f8 --- /dev/null +++ b/include/Kingstar/IncEx/KSMdApiEx.h @@ -0,0 +1,173 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSMdApiEx.h +///@brief ˿ͻ˽ӿ +///////////////////////////////////////////////////////////////////////// + +#if !defined(KINSTARAPI_FTDCMDAPI_H) +#define KINSTARAPI_FTDCMDAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "KSUserApiStructEx.h" +#include "KSVocApiDataType.h" + +#if defined(ISLIB) && defined(WIN32)&& !defined(KSMDAPI_STATIC_LIB) +#ifdef LIB_MD_API_EXPORT +#define MD_API_EXPORT __declspec(dllexport) +#else +#define MD_API_EXPORT __declspec(dllimport) +#endif +#else +#ifdef WIN32 +#define MD_API_EXPORT +#else +#define MD_API_EXPORT __attribute__((visibility("default"))) +#endif +#endif + +namespace KingstarAPI +{ + + class CThostFtdcMdSpi + { + public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + + ///¼Ӧ + virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡӦ + virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡѯӦ + virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData) {}; + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {}; + }; + + class MD_API_EXPORT CThostFtdcMdApi + { + public: + ///MdApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + ///modify for udp marketdata + static CThostFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = "", const bool bIsUsingUdp=false, const bool bIsMulticast=false); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עַַ + ///@param pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcMdSpi *pSpi) = 0; + + ///顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeMarketData(char *ppInstrumentID[], int nCount) = 0; + + ///˶顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeMarketData(char *ppInstrumentID[], int nCount) = 0; + + ///ѯۡ + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0; + + ///˶ѯۡ + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0; + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; + + ///չAPIʵ + virtual void * LoadExtMdApi(void *pSpi, KS_EXTAPI_TYPE nExtApiType) = 0; + + protected: + ~CThostFtdcMdApi(){}; + }; + +} // end of namespace KingstarAPI + +#endif diff --git a/include/Kingstar/IncEx/KSOptionApi.h b/include/Kingstar/IncEx/KSOptionApi.h new file mode 100644 index 0000000..c40b7eb --- /dev/null +++ b/include/Kingstar/IncEx/KSOptionApi.h @@ -0,0 +1,140 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSOptionApi.h +///@brief ˿ͻȨӿ +///////////////////////////////////////////////////////////////////////// + +#ifndef __KSOPTIONAPI_H_INCLUDED__ +#define __KSOPTIONAPI_H_INCLUDED__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "KSVocApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) && !defined(KSTRADEAPI_STATIC_LIB) +#ifdef LIB_TRADER_API_EXPORT +#define TRADER_OPTIONAPI_EXPORT __declspec(dllexport) +#else +#define TRADER_OPTIONAPI_EXPORT __declspec(dllimport) +#endif +#else +#ifdef WIN32 +#define TRADER_OPTIONAPI_EXPORT +#else +#define TRADER_OPTIONAPI_EXPORT __attribute__((visibility("default"))) +#endif + +#endif + +namespace KingstarAPI +{ + + class CKSOptionSpi + { + public: + ///ѯָָֻ + virtual void OnRspQryIndexPrice(CKSIndexPriceField *pIndexPrice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ѯָָֻ + virtual void OnRspQryOptionInstrGuard(CKSOptionInstrGuardField *pOptionInstrGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ѯӦ + virtual void OnRspQryExecOrderVolume(CKSExecOrderVolumeField *pExecOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ѯȨָϢӦ + virtual void OnRspQryStockOptionAssignment(CKSStockOptionAssignmentField *pStockOptionAssignment, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͻ׼Ӧ + virtual void OnRspQryInvestorTradeLevel(CKSInvestorTradeLevelField *pInvestorTradeLevel, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ޹Ӧ + virtual void OnRspQryPurchaseLimitAmt(CKSPurchaseLimitAmtField *pPurchaseLimitAmt, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ޲ֶӦ + virtual void OnRspQryPositionLimitVol(CKSPositionLimitVolField *pPositionLimitVol, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʷӦ + virtual void OnRspQryHistoryOrder(CKSHistoryOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʷɽӦ + virtual void OnRspQryHistoryTrade(CKSHistoryTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʷȨָϸӦ + virtual void OnRspQryStockOptionHistoryAssignment(CKSHistoryAssignmentField *pHistoryAssignment, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨϸӦ + virtual void OnRspQryStockOptionDelivDetail(CKSSODelivDetailField *pSODelivDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ԶȨִвӦ + virtual void OnRspAutoExecOrderAction(CKSAutoExecOrderActionField *pAutoExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspCombActionInsert(CKSInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϳֲϸӦ + virtual void OnRspQryInvestorCombinePosition(CKSInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ɿϿɲӦ + virtual void OnRspQryCombActionVolume(CKSCombActionVolumeField *pCombActionVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ϲί֪ͨ + virtual void OnRtnCombAction(CKSCombActionField *pCombAction) {}; + }; + + class TRADER_OPTIONAPI_EXPORT CKSOptionApi + { + public: + ///ѯָָֻ + virtual int ReqQryIndexPrice(CKSQryIndexPriceField *pIndexPrice, int nRequestID) = 0; + + ///ѯȨԼϵ + virtual int ReqQryOptionInstrGuard(CKSQryOptionInstrGuardField *pQryOptionInstrGuard, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExecOrderVolume(CKSQryExecOrderVolumeField *pQryExecOrderVolume, int nRequestID) = 0; + + ///ѯȨָϢ + virtual int ReqQryStockOptionAssignment(CKSQryStockOptionAssignmentField *pQryStockOptionAssignment, int nRequestID) = 0; + + ///ѯͻ׼ + virtual int ReqQryInvestorTradeLevel(CKSQryInvestorTradeLevelField *pQryInvestorTradeLevel, int nRequestID) = 0; + + ///ѯ޹ + virtual int ReqQryPurchaseLimitAmt(CKSQryPurchaseLimitAmtField *pQryPurchaseLimitAmt, int nRequestID) = 0; + + ///ѯ޲ֶ + virtual int ReqQryPositionLimitVol(CKSQryPositionLimitVolField *pQryPositionLimitVol, int nRequestID) = 0; + + ///ѯʷ + virtual int ReqQryHistoryOrder(CKSQryHistoryOrderField *pQryHistoryOrder, int nRequestID) = 0; + + ///ѯʷɽ + virtual int ReqQryHistoryTrade(CKSQryHistoryTradeField *pQryHistoryTrade, int nRequestID) = 0; + + ///ѯʷȨָϸ + virtual int ReqQryStockOptionHistoryAssignment(CKSQryHistoryAssignmentField *pQryHistoryAssignment, int nRequestID) = 0; + + ///ѯȨϸ + virtual int ReqQryStockOptionDelivDetail(CKSQrySODelivDetailField *pQrySODelivDetail, int nRequestID) = 0; + + ///ԶȨִв + virtual int ReqAutoExecOrderAction(CKSAutoExecOrderActionField *pAutoExecOrderAction, int nRequestID) = 0; + + ///ϲί + virtual int ReqCombActionInsert(CKSInputCombActionField *pInputCombAction, int nRequestID) = 0; + + ///ѯϳֲϸ + virtual int ReqQryInvestorCombinePosition(CKSQryInvestorPositionCombineDetailField *pQryInvestorCombinePosition, int nRequestID) = 0; + + ///ѯɿϿɲ + virtual int ReqQryCombActionVolume(CKSQryCombActionVolumeField *pQryCombActionVolume, int nRequestID) = 0; + + protected: + ~CKSOptionApi(){}; + }; + +} // end of namespace KingstarAPI +#endif \ No newline at end of file diff --git a/include/Kingstar/IncEx/KSPrdApi.h b/include/Kingstar/IncEx/KSPrdApi.h new file mode 100644 index 0000000..3db5e8c --- /dev/null +++ b/include/Kingstar/IncEx/KSPrdApi.h @@ -0,0 +1,53 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSPrdApi.h +///@brief ˿ͻҵӿ +///////////////////////////////////////////////////////////////////////// + +#ifndef __KSPRDAPI_H_INCLUDED__ +#define __KSPRDAPI_H_INCLUDED__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "KSUserApiStructEx.h" +#include "KSVocApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) && !defined(KSTRADEAPI_STATIC_LIB) + +#ifdef LIB_TRADER_API_EXPORT +#define TRADER_PRDAPI_EXPORT __declspec(dllexport) +#else +#define TRADER_PRDAPI_EXPORT __declspec(dllimport) +#endif +#else +#ifdef WIN32 +#define TRADER_PRDAPI_EXPORT +#else +#define TRADER_PRDAPI_EXPORT __attribute__((visibility("default"))) +#endif + +#endif + +namespace KingstarAPI +{ + class CKSPrdSpi + { + public: + ///ҵӦ + virtual void OnRspSubPrimeData(CKSPrimeDataBusinessField *pPrimeDataBusiness, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + }; + + class TRADER_PRDAPI_EXPORT CKSPrdApi + { + ///ҵ + virtual int ReqSubPrimeData(CKSSubPrimeDataBusinessField *pSubPrimeDataBusiness, int nRequestID) = 0; + + protected: + ~CKSPrdApi(){}; + }; + +} // end of namespace KingstarAPI +#endif \ No newline at end of file diff --git a/include/Kingstar/IncEx/KSTraderApiEx.h b/include/Kingstar/IncEx/KSTraderApiEx.h new file mode 100644 index 0000000..2e02643 --- /dev/null +++ b/include/Kingstar/IncEx/KSTraderApiEx.h @@ -0,0 +1,668 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file ThostFtdcTraderApi.h +///@brief ˿ͻ˽ӿ +///////////////////////////////////////////////////////////////////////// + +#if !defined(KINSTARAPI_FTDCTRADERAPI_H) +#define KINSTARAPI_FTDCTRADERAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "KSUserApiStructEx.h" +#include "KSVocApiDataType.h" + +#if defined(ISLIB) && defined(WIN32) && !defined(KSTRADEAPI_STATIC_LIB) + +#ifdef LIB_TRADER_API_EXPORT +#define TRADER_API_EXPORT __declspec(dllexport) +#else +#define TRADER_API_EXPORT __declspec(dllimport) +#endif + +#else +#ifdef WIN32 +#define TRADER_API_EXPORT +#else +#define TRADER_API_EXPORT __attribute__((visibility("default"))) +#endif + +#endif + +namespace KingstarAPI +{ + + class CThostFtdcTraderSpi + { + public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + ///ͻ֤Ӧ + virtual void OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + + ///¼Ӧ + virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ûӦ + virtual void OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽ˻Ӧ + virtual void OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ԥ¼Ӧ + virtual void OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ԥ񳷵¼Ӧ + virtual void OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ󱨵Ӧ + virtual void OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ͷ߽ȷӦ + virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ɾԤӦ + virtual void OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ɾԤ񳷵Ӧ + virtual void OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ִ¼Ӧ + virtual void OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ִӦ + virtual void OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ¼Ӧ + virtual void OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///۲Ӧ + virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯɽӦ + virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳Ӧ + virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʽ˻Ӧ + virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶӦ + virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯױӦ + virtual void OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼ֤Ӧ + virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷӦ + virtual void OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶ߽Ӧ + virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯתӦ + virtual void OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͻ֪ͨӦ + virtual void OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϢȷӦ + virtual void OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤ϵͳ͹˾ʽ˻ԿӦ + virtual void OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯֵ۵ϢӦ + virtual void OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶƷ/Ʒֱ֤Ӧ + virtual void OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԱȨӦ + virtual void OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷۻ + virtual void OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷ + virtual void OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryInstrumentOrderCommRate(CThostFtdcInstrumentOrderCommRateField *pInstrumentOrderCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨ׳ɱӦ + virtual void OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨԼӦ + virtual void OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯִӦ + virtual void OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯѯӦ + virtual void OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryLock(CThostFtdcLockField *pLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤ȯλӦ + virtual void OnRspQryLockPosition(CThostFtdcLockPositionField *pLockPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϺԼȫϵӦ + virtual void OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯתˮӦ + virtual void OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯǩԼϵӦ + virtual void OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnOrder(CThostFtdcOrderField *pOrder) {}; + + ///ɽ֪ͨ + virtual void OnRtnTrade(CThostFtdcTradeField *pTrade) {}; + + ///¼ر + virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ر + virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///Լ״̬֪ͨ + virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {}; + + ///֪ͨ + virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) {}; + + ///ʾУ + virtual void OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) {}; + + ///ִ֪ͨ + virtual void OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder) {}; + + ///ִ¼ر + virtual void OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ִر + virtual void OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯ¼ر + virtual void OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo) {}; + + ///֪ͨ + virtual void OnRtnQuote(CThostFtdcQuoteField *pQuote) {}; + + ///¼ر + virtual void OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) {}; + + ///۲ر + virtual void OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {}; + + ///֤û + virtual void OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) {}; + + ///֪ͨ + virtual void OnRtnLock(CThostFtdcLockField *pLock) {}; + + ///֪ͨ + virtual void OnErrRtnLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo) {}; + + ///֪ͨ + virtual void OnRtnCombAction(CThostFtdcCombActionField *pCombAction) {}; + + ///¼ر + virtual void OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯǩԼӦ + virtual void OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԤӦ + virtual void OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԤ񳷵Ӧ + virtual void OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֪ͨӦ + virtual void OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ͹˾ײӦ + virtual void OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ͹˾㷨Ӧ + virtual void OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯû + virtual void OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///зʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///зڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///зתڻ֪ͨ + virtual void OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///зڻת֪ͨ + virtual void OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///ڻڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///ϵͳʱڻֹתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ϵͳʱڻֹڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻѯ֪ͨ + virtual void OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) {}; + + ///ڻʽתڻر + virtual void OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻڻʽתдر + virtual void OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ϵͳʱڻֹתڻر + virtual void OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ϵͳʱڻֹڻתдر + virtual void OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻѯر + virtual void OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻʽתڻӦ + virtual void OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ڻڻʽתӦ + virtual void OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ڻѯӦ + virtual void OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///зڿ֪ͨ + virtual void OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) {}; + + ///з֪ͨ + virtual void OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) {}; + + ///з˺֪ͨ + virtual void OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) {}; + }; + + class TRADER_API_EXPORT CThostFtdcTraderApi + { + public: + ///TraderApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + static CThostFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = ""); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עַַ + ///@param pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcTraderSpi *pSpi) = 0; + + ///˽ + ///@param nResumeType ˽شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼˽ + ///@remark ÷ҪInitǰá򲻻յ˽ݡ + virtual void SubscribePrivateTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///Ĺ + ///@param nResumeType شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼󹫹 + ///@remark ÷ҪInitǰá򲻻յݡ + virtual void SubscribePublicTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///ͻ֤ + virtual int ReqAuthenticate(CThostFtdcReqAuthenticateField *pReqAuthenticateField, int nRequestID) = 0; + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; + + ///û + virtual int ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0; + + ///ʽ˻ + virtual int ReqTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, int nRequestID) = 0; + + ///¼ + virtual int ReqOrderInsert(CThostFtdcInputOrderField *pInputOrder, int nRequestID) = 0; + + ///Ԥ¼ + virtual int ReqParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, int nRequestID) = 0; + + ///Ԥ񳷵¼ + virtual int ReqParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, int nRequestID) = 0; + + /// + virtual int ReqOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0; + + ///ѯ󱨵 + virtual int ReqQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, int nRequestID) = 0; + + ///Ͷ߽ȷ + virtual int ReqSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, int nRequestID) = 0; + + ///ɾԤ + virtual int ReqRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, int nRequestID) = 0; + + ///ɾԤ񳷵 + virtual int ReqRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, int nRequestID) = 0; + + ///ִ¼ + virtual int ReqExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, int nRequestID) = 0; + + ///ִ + virtual int ReqExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, int nRequestID) = 0; + + ///ѯ¼ + virtual int ReqForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, int nRequestID) = 0; + + ///¼ + virtual int ReqQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, int nRequestID) = 0; + + ///۲ + virtual int ReqQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, int nRequestID) = 0; + + /// + virtual int ReqLockInsert(CThostFtdcInputLockField *pInputLock, int nRequestID) = 0; + + ///¼ + virtual int ReqCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryOrder(CThostFtdcQryOrderField *pQryOrder, int nRequestID) = 0; + + ///ѯɽ + virtual int ReqQryTrade(CThostFtdcQryTradeField *pQryTrade, int nRequestID) = 0; + + ///ѯͶֲ߳ + virtual int ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0; + + ///ѯʽ˻ + virtual int ReqQryTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0; + + ///ѯͶ + virtual int ReqQryInvestor(CThostFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0; + + ///ѯױ + virtual int ReqQryTradingCode(CThostFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0; + + ///ѯԼ֤ + virtual int ReqQryInstrumentMarginRate(CThostFtdcQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrumentCommissionRate(CThostFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchange(CThostFtdcQryExchangeField *pQryExchange, int nRequestID) = 0; + + ///ѯƷ + virtual int ReqQryProduct(CThostFtdcQryProductField *pQryProduct, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrument(CThostFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryDepthMarketData(CThostFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0; + + ///ѯͶ߽ + virtual int ReqQrySettlementInfo(CThostFtdcQrySettlementInfoField *pQrySettlementInfo, int nRequestID) = 0; + + ///ѯת + virtual int ReqQryTransferBank(CThostFtdcQryTransferBankField *pQryTransferBank, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionDetail(CThostFtdcQryInvestorPositionDetailField *pQryInvestorPositionDetail, int nRequestID) = 0; + + ///ѯͻ֪ͨ + virtual int ReqQryNotice(CThostFtdcQryNoticeField *pQryNotice, int nRequestID) = 0; + + ///ѯϢȷ + virtual int ReqQrySettlementInfoConfirm(CThostFtdcQrySettlementInfoConfirmField *pQrySettlementInfoConfirm, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionCombineDetail(CThostFtdcQryInvestorPositionCombineDetailField *pQryInvestorPositionCombineDetail, int nRequestID) = 0; + + ///ѯ֤ϵͳ͹˾ʽ˻Կ + virtual int ReqQryCFMMCTradingAccountKey(CThostFtdcQryCFMMCTradingAccountKeyField *pQryCFMMCTradingAccountKey, int nRequestID) = 0; + + ///ѯֵ۵Ϣ + virtual int ReqQryEWarrantOffset(CThostFtdcQryEWarrantOffsetField *pQryEWarrantOffset, int nRequestID) = 0; + + ///ѯͶƷ/Ʒֱ֤ + virtual int ReqQryInvestorProductGroupMargin(CThostFtdcQryInvestorProductGroupMarginField *pQryInvestorProductGroupMargin, int nRequestID) = 0; + + ///ѯ֤ + virtual int ReqQryExchangeMarginRate(CThostFtdcQryExchangeMarginRateField *pQryExchangeMarginRate, int nRequestID) = 0; + + ///ѯ֤ + virtual int ReqQryExchangeMarginRateAdjust(CThostFtdcQryExchangeMarginRateAdjustField *pQryExchangeMarginRateAdjust, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchangeRate(CThostFtdcQryExchangeRateField *pQryExchangeRate, int nRequestID) = 0; + + ///ѯԱȨ + virtual int ReqQrySecAgentACIDMap(CThostFtdcQrySecAgentACIDMapField *pQrySecAgentACIDMap, int nRequestID) = 0; + + ///ѯƷۻ + virtual int ReqQryProductExchRate(CThostFtdcQryProductExchRateField *pQryProductExchRate, int nRequestID) = 0; + + ///ѯƷ + virtual int ReqQryProductGroup(CThostFtdcQryProductGroupField *pQryProductGroup, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryInstrumentOrderCommRate(CThostFtdcQryInstrumentOrderCommRateField *pQryInstrumentOrderCommRate, int nRequestID) = 0; + + ///ѯȨ׳ɱ + virtual int ReqQryOptionInstrTradeCost(CThostFtdcQryOptionInstrTradeCostField *pQryOptionInstrTradeCost, int nRequestID) = 0; + + ///ѯȨԼ + virtual int ReqQryOptionInstrCommRate(CThostFtdcQryOptionInstrCommRateField *pQryOptionInstrCommRate, int nRequestID) = 0; + + ///ѯִ + virtual int ReqQryExecOrder(CThostFtdcQryExecOrderField *pQryExecOrder, int nRequestID) = 0; + + ///ѯѯ + virtual int ReqQryForQuote(CThostFtdcQryForQuoteField *pQryForQuote, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryQuote(CThostFtdcQryQuoteField *pQryQuote, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryLock(CThostFtdcQryLockField *pQryLock, int nRequestID) = 0; + + ///ѯ֤ȯλ + virtual int ReqQryLockPosition(CThostFtdcQryLockPositionField *pQryLockPosition, int nRequestID) = 0; + + ///ѯϺԼȫϵ + virtual int ReqQryCombInstrumentGuard(CThostFtdcQryCombInstrumentGuardField *pQryCombInstrumentGuard, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryCombAction(CThostFtdcQryCombActionField *pQryCombAction, int nRequestID) = 0; + + ///ѯתˮ + virtual int ReqQryTransferSerial(CThostFtdcQryTransferSerialField *pQryTransferSerial, int nRequestID) = 0; + + ///ѯǩԼϵ + virtual int ReqQryAccountregister(CThostFtdcQryAccountregisterField *pQryAccountregister, int nRequestID) = 0; + + ///ѯǩԼ + virtual int ReqQryContractBank(CThostFtdcQryContractBankField *pQryContractBank, int nRequestID) = 0; + + ///ѯԤ + virtual int ReqQryParkedOrder(CThostFtdcQryParkedOrderField *pQryParkedOrder, int nRequestID) = 0; + + ///ѯԤ񳷵 + virtual int ReqQryParkedOrderAction(CThostFtdcQryParkedOrderActionField *pQryParkedOrderAction, int nRequestID) = 0; + + ///ѯ֪ͨ + virtual int ReqQryTradingNotice(CThostFtdcQryTradingNoticeField *pQryTradingNotice, int nRequestID) = 0; + + ///ѯ͹˾ײ + virtual int ReqQryBrokerTradingParams(CThostFtdcQryBrokerTradingParamsField *pQryBrokerTradingParams, int nRequestID) = 0; + + ///ѯ͹˾㷨 + virtual int ReqQryBrokerTradingAlgos(CThostFtdcQryBrokerTradingAlgosField *pQryBrokerTradingAlgos, int nRequestID) = 0; + + ///ѯû + virtual int ReqQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, int nRequestID) = 0; + + ///ڻʽתڻ + virtual int ReqFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0; + + ///ڻڻʽת + virtual int ReqFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0; + + ///ڻѯ + virtual int ReqQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, int nRequestID) = 0; + + ///չAPIʵ + virtual void * LoadExtApi(void *pSpi, KS_EXTAPI_TYPE nExtApiType) = 0; + + protected: + ~CThostFtdcTraderApi(){}; + }; + +} // end of namespace KingstarAPI + +#endif diff --git a/include/Kingstar/IncEx/KSUserApiDataTypeEx.h b/include/Kingstar/IncEx/KSUserApiDataTypeEx.h new file mode 100644 index 0000000..a5c0138 --- /dev/null +++ b/include/Kingstar/IncEx/KSUserApiDataTypeEx.h @@ -0,0 +1,6420 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSUserApiDataTypeEx.h +///@brief ˿ͻ˽ӿʹõҵ +///////////////////////////////////////////////////////////////////////// + +#ifndef KINSTARAPI_FTDCDATATYPE_H + #define KINSTARAPI_FTDCDATATYPE_H + +namespace KingstarAPI +{ + + enum THOST_TE_RESUME_TYPE + { + THOST_TERT_RESTART = 0, + THOST_TERT_RESUME, + THOST_TERT_QUICK + }; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTraderIDTypeһԱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTraderIDType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvestorIDTypeһͶߴ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInvestorIDType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBrokerIDTypeһ͹˾ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBrokerIDType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBrokerAbbrTypeһ͹˾ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBrokerAbbrType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBrokerNameTypeһ͹˾ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBrokerNameType[81]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExchangeInstIDTypeһԼڽĴ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcExchangeInstIDType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrderRefTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOrderRefType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcParticipantIDTypeһԱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcParticipantIDType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUserIDTypeһû + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUserIDType[16]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPasswordTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPasswordType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClientIDTypeһױ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcClientIDType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstrumentIDTypeһԼ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInstrumentIDType[81]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstrumentCodeTypeһԼʶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInstrumentCodeType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMarketIDTypeһг + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcMarketIDType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProductNameTypeһƷ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcProductNameType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExchangeIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcExchangeIDType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExchangeNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcExchangeNameType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExchangeAbbrTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcExchangeAbbrType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExchangeFlagTypeһ־ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcExchangeFlagType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMacAddressTypeһMacַ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcMacAddressType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSystemIDTypeһϵͳ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSystemIDType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExchangePropertyTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_EXP_Normal '0' + ///ݳɽɱ + #define THOST_FTDC_EXP_GenOrderByTrade '1' + + typedef char TThostFtdcExchangePropertyType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDateTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDateType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTimeTypeһʱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTimeType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLongTimeTypeһʱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcLongTimeType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstrumentNameTypeһԼ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInstrumentNameType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettlementGroupIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSettlementGroupIDType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrderSysIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOrderSysIDType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeIDTypeһɽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTradeIDType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCommandTypeTypeһDB + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCommandTypeType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcIPAddressTypeһIPַ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcIPAddressType[16]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcIPPortTypeһIP˿ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcIPPortType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProductInfoTypeһƷϢ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcProductInfoType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProtocolInfoTypeһЭϢ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcProtocolInfoType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBusinessUnitTypeһҵԪ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBusinessUnitType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDepositSeqNoTypeһˮ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDepositSeqNoType[15]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcIdentifiedCardNoTypeһ֤ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcIdentifiedCardNoType[51]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcIdCardTypeTypeһ֤ + ///////////////////////////////////////////////////////////////////////// + ///֯ + #define THOST_FTDC_ICT_EID '0' + ///й֤ + #define THOST_FTDC_ICT_IDCard '1' + ///֤ + #define THOST_FTDC_ICT_OfficerIDCard '2' + ///֤ + #define THOST_FTDC_ICT_PoliceIDCard '3' + ///ʿ֤ + #define THOST_FTDC_ICT_SoldierIDCard '4' + ///ڲ + #define THOST_FTDC_ICT_HouseholdRegister '5' + /// + #define THOST_FTDC_ICT_Passport '6' + ///̨֤ + #define THOST_FTDC_ICT_TaiwanCompatriotIDCard '7' + ///֤ + #define THOST_FTDC_ICT_HomeComingCard '8' + ///Ӫҵִպ + #define THOST_FTDC_ICT_LicenseNo '9' + ///˰ǼǺ/˰ID + #define THOST_FTDC_ICT_TaxNo 'A' + ///۰ľڵ֤ͨ + #define THOST_FTDC_ICT_HMMainlandTravelPermit 'B' + ///̨½֤ͨ + #define THOST_FTDC_ICT_TwMainlandTravelPermit 'C' + /// + #define THOST_FTDC_ICT_DrivingLicense 'D' + ///籣ID + #define THOST_FTDC_ICT_SocialID 'F' + ///֤ + #define THOST_FTDC_ICT_LocalID 'G' + ///ҵǼ֤ + #define THOST_FTDC_ICT_BusinessRegistration 'H' + ///۰Ծ֤ + #define THOST_FTDC_ICT_HKMCIDCard 'I' + ///п֤ + #define THOST_FTDC_ICT_AccountsPermits 'J' + ///֤ + #define THOST_FTDC_ICT_OtherCard 'x' + + typedef char TThostFtdcIdCardTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrderLocalIDTypeһر + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOrderLocalIDType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUserNameTypeһû + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUserNameType[81]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPartyNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPartyNameType[81]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcErrorMsgTypeһϢ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcErrorMsgType[256]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFieldNameTypeһֶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFieldNameType[2049]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFieldContentTypeһֶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFieldContentType[2049]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSystemNameTypeһϵͳ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSystemNameType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcContentTypeһϢ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcContentType[501]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvestorRangeTypeһͶ߷Χ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_IR_All '1' + ///Ͷ + #define THOST_FTDC_IR_Group '2' + ///һͶ + #define THOST_FTDC_IR_Single '3' + + typedef char TThostFtdcInvestorRangeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDepartmentRangeTypeһͶ߷Χ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_DR_All '1' + ///ܹ֯ + #define THOST_FTDC_DR_Group '2' + ///һͶ + #define THOST_FTDC_DR_Single '3' + + typedef char TThostFtdcDepartmentRangeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDataSyncStatusTypeһͬ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δͬ + #define THOST_FTDC_DS_Asynchronous '1' + ///ͬ + #define THOST_FTDC_DS_Synchronizing '2' + ///ͬ + #define THOST_FTDC_DS_Synchronized '3' + + typedef char TThostFtdcDataSyncStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBrokerDataSyncStatusTypeһ͹˾ͬ״̬ + ///////////////////////////////////////////////////////////////////////// + ///ͬ + #define THOST_FTDC_BDS_Synchronized '1' + ///ͬ + #define THOST_FTDC_BDS_Synchronizing '2' + + typedef char TThostFtdcBrokerDataSyncStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExchangeConnectStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///ûκ + #define THOST_FTDC_ECS_NoConnection '1' + ///ѾԼѯ + #define THOST_FTDC_ECS_QryInstrumentSent '2' + ///ѾȡϢ + #define THOST_FTDC_ECS_GotInformation '9' + + typedef char TThostFtdcExchangeConnectStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTraderConnectStatusTypeһԱ״̬ + ///////////////////////////////////////////////////////////////////////// + ///ûκ + #define THOST_FTDC_TCS_NotConnected '1' + ///Ѿ + #define THOST_FTDC_TCS_Connected '2' + ///ѾԼѯ + #define THOST_FTDC_TCS_QryInstrumentSent '3' + ///˽ + #define THOST_FTDC_TCS_SubPrivateFlow '4' + + typedef char TThostFtdcTraderConnectStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFunctionCodeTypeһܴ + ///////////////////////////////////////////////////////////////////////// + ///첽 + #define THOST_FTDC_FC_DataAsync '1' + ///ǿûdz + #define THOST_FTDC_FC_ForceUserLogout '2' + ///û + #define THOST_FTDC_FC_UserPasswordUpdate '3' + ///͹˾ + #define THOST_FTDC_FC_BrokerPasswordUpdate '4' + ///Ͷ߿ + #define THOST_FTDC_FC_InvestorPasswordUpdate '5' + /// + #define THOST_FTDC_FC_OrderInsert '6' + /// + #define THOST_FTDC_FC_OrderAction '7' + ///ͬϵͳ + #define THOST_FTDC_FC_SyncSystemData '8' + ///ͬ͹˾ + #define THOST_FTDC_FC_SyncBrokerData '9' + ///ͬ͹˾ + #define THOST_FTDC_FC_BachSyncBrokerData 'A' + ///ѯ + #define THOST_FTDC_FC_SuperQuery 'B' + ///Ԥ񱨵 + #define THOST_FTDC_FC_ParkedOrderInsert 'C' + ///Ԥ񱨵 + #define THOST_FTDC_FC_ParkedOrderAction 'D' + ///̬ͬ + #define THOST_FTDC_FC_SyncOTP 'E' + ///ɾδ֪ + #define THOST_FTDC_FC_DeleteOrder 'F' + ///Ȩ + #define THOST_FTDC_FC_LockInsert 'G' + + typedef char TThostFtdcFunctionCodeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBrokerFunctionCodeTypeһ͹˾ܴ + ///////////////////////////////////////////////////////////////////////// + ///ǿûdz + #define THOST_FTDC_BFC_ForceUserLogout '1' + ///û + #define THOST_FTDC_BFC_UserPasswordUpdate '2' + ///ͬ͹˾ + #define THOST_FTDC_BFC_SyncBrokerData '3' + ///ͬ͹˾ + #define THOST_FTDC_BFC_BachSyncBrokerData '4' + /// + #define THOST_FTDC_BFC_OrderInsert '5' + /// + #define THOST_FTDC_BFC_OrderAction '6' + ///ȫѯ + #define THOST_FTDC_BFC_AllQuery '7' + ///ϵͳܣ/dz/޸ + #define THOST_FTDC_BFC_log 'a' + ///ѯѯݣԼȳ + #define THOST_FTDC_BFC_BaseQry 'b' + ///ײѯɽί + #define THOST_FTDC_BFC_TradeQry 'c' + ///׹ܣ + #define THOST_FTDC_BFC_Trade 'd' + ///ת + #define THOST_FTDC_BFC_Virement 'e' + ///ռ + #define THOST_FTDC_BFC_Risk 'f' + ///ѯ/ѯỰ˵ + #define THOST_FTDC_BFC_Session 'g' + ///֪ͨ + #define THOST_FTDC_BFC_RiskNoticeCtl 'h' + ///֪ͨ + #define THOST_FTDC_BFC_RiskNotice 'i' + ///쿴͹˾ʽȨ + #define THOST_FTDC_BFC_BrokerDeposit 'j' + ///ʽѯ + #define THOST_FTDC_BFC_QueryFund 'k' + ///ѯ + #define THOST_FTDC_BFC_QueryOrder 'l' + ///ɽѯ + #define THOST_FTDC_BFC_QueryTrade 'm' + ///ֲֲѯ + #define THOST_FTDC_BFC_QueryPosition 'n' + ///ѯ + #define THOST_FTDC_BFC_QueryMarketData 'o' + ///û¼ѯ + #define THOST_FTDC_BFC_QueryUserEvent 'p' + ///֪ͨѯ + #define THOST_FTDC_BFC_QueryRiskNotify 'q' + ///ѯ + #define THOST_FTDC_BFC_QueryFundChange 'r' + ///ͶϢѯ + #define THOST_FTDC_BFC_QueryInvestor 's' + ///ױѯ + #define THOST_FTDC_BFC_QueryTradingCode 't' + ///ǿƽ + #define THOST_FTDC_BFC_ForceClose 'u' + ///ѹ + #define THOST_FTDC_BFC_PressTest 'v' + ///Ȩ淴 + #define THOST_FTDC_BFC_RemainCalc 'w' + ///ֱֲָ֤ + #define THOST_FTDC_BFC_NetPositionInd 'x' + ///Ԥ + #define THOST_FTDC_BFC_RiskPredict 'y' + ///ݵ + #define THOST_FTDC_BFC_DataExport 'z' + ///ָ + #define THOST_FTDC_BFC_RiskTargetSetup 'A' + ///Ԥ + #define THOST_FTDC_BFC_MarketDataWarn 'B' + ///ҵ֪ͨѯ + #define THOST_FTDC_BFC_QryBizNotice 'C' + ///ҵ֪ͨģ + #define THOST_FTDC_BFC_CfgBizNotice 'D' + ///̬ͬ + #define THOST_FTDC_BFC_SyncOTP 'E' + ///ҵ֪ͨ + #define THOST_FTDC_BFC_SendBizNotice 'F' + ///ռ׼ + #define THOST_FTDC_BFC_CfgRiskLevelStd 'G' + ///նӦ + #define THOST_FTDC_BFC_TbCommand 'H' + ///ɾδ֪ + #define THOST_FTDC_BFC_DeleteOrder 'J' + ///Ԥ񱨵 + #define THOST_FTDC_BFC_ParkedOrderInsert 'K' + ///Ԥ񱨵 + #define THOST_FTDC_BFC_ParkedOrderAction 'L' + ///Ȩ + #define THOST_FTDC_BFC_LockInsert 'M' + + typedef char TThostFtdcBrokerFunctionCodeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrderActionStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///Ѿύ + #define THOST_FTDC_OAS_Submitted 'a' + ///Ѿ + #define THOST_FTDC_OAS_Accepted 'b' + ///Ѿܾ + #define THOST_FTDC_OAS_Rejected 'c' + + typedef char TThostFtdcOrderActionStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrderStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///ȫɽ + #define THOST_FTDC_OST_AllTraded '0' + ///ֳɽڶ + #define THOST_FTDC_OST_PartTradedQueueing '1' + ///ֳɽڶ + #define THOST_FTDC_OST_PartTradedNotQueueing '2' + ///δɽڶ + #define THOST_FTDC_OST_NoTradeQueueing '3' + ///δɽڶ + #define THOST_FTDC_OST_NoTradeNotQueueing '4' + /// + #define THOST_FTDC_OST_Canceled '5' + ///δ֪ + #define THOST_FTDC_OST_Unknown 'a' + ///δ + #define THOST_FTDC_OST_NotTouched 'b' + ///Ѵ + #define THOST_FTDC_OST_Touched 'c' + + typedef char TThostFtdcOrderStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrderSubmitStatusTypeһύ״̬ + ///////////////////////////////////////////////////////////////////////// + ///Ѿύ + #define THOST_FTDC_OSS_InsertSubmitted '0' + ///Ѿύ + #define THOST_FTDC_OSS_CancelSubmitted '1' + ///޸Ѿύ + #define THOST_FTDC_OSS_ModifySubmitted '2' + ///Ѿ + #define THOST_FTDC_OSS_Accepted '3' + ///Ѿܾ + #define THOST_FTDC_OSS_InsertRejected '4' + ///Ѿܾ + #define THOST_FTDC_OSS_CancelRejected '5' + ///ĵѾܾ + #define THOST_FTDC_OSS_ModifyRejected '6' + + typedef char TThostFtdcOrderSubmitStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPositionDateTypeһֲ + ///////////////////////////////////////////////////////////////////////// + ///ճֲ + #define THOST_FTDC_PSD_Today '1' + ///ʷֲ + #define THOST_FTDC_PSD_History '2' + + typedef char TThostFtdcPositionDateType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPositionDateTypeTypeһֲ + ///////////////////////////////////////////////////////////////////////// + ///ʹʷֲ + #define THOST_FTDC_PDT_UseHistory '1' + ///ʹʷֲ + #define THOST_FTDC_PDT_NoUseHistory '2' + + typedef char TThostFtdcPositionDateTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradingRoleTypeһ׽ɫ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_ER_Broker '1' + ///Ӫ + #define THOST_FTDC_ER_Host '2' + /// + #define THOST_FTDC_ER_Maker '3' + + typedef char TThostFtdcTradingRoleType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProductClassTypeһƷ + ///////////////////////////////////////////////////////////////////////// + ///ڻ + #define THOST_FTDC_PC_Futures '1' + ///ڻȨ + #define THOST_FTDC_PC_Options '2' + /// + #define THOST_FTDC_PC_Combination '3' + /// + #define THOST_FTDC_PC_Spot '4' + ///ת + #define THOST_FTDC_PC_EFP '5' + ///ֻȨ + #define THOST_FTDC_PC_SpotOption '6' + ///Ȩ + #define THOST_FTDC_PC_ETFOption '7' + ///֤ȯ + #define THOST_FTDC_PC_Stock '8' + + typedef char TThostFtdcProductClassType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstLifePhaseTypeһԼ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_IP_NotStart '0' + /// + #define THOST_FTDC_IP_Started '1' + ///ͣ + #define THOST_FTDC_IP_Pause '2' + /// + #define THOST_FTDC_IP_Expired '3' + + typedef char TThostFtdcInstLifePhaseType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDirectionTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_D_Buy '0' + /// + #define THOST_FTDC_D_Sell '1' + + typedef char TThostFtdcDirectionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPositionTypeTypeһֲ + ///////////////////////////////////////////////////////////////////////// + ///ֲ + #define THOST_FTDC_PT_Net '1' + ///ۺϳֲ + #define THOST_FTDC_PT_Gross '2' + + typedef char TThostFtdcPositionTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPosiDirectionTypeһֲֶշ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_PD_Net '1' + ///ͷ + #define THOST_FTDC_PD_Long '2' + ///ͷ + #define THOST_FTDC_PD_Short '3' + + typedef char TThostFtdcPosiDirectionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSysSettlementStatusTypeһϵͳ״̬ + ///////////////////////////////////////////////////////////////////////// + ///Ծ + #define THOST_FTDC_SS_NonActive '1' + /// + #define THOST_FTDC_SS_Startup '2' + /// + #define THOST_FTDC_SS_Operating '3' + /// + #define THOST_FTDC_SS_Settlement '4' + /// + #define THOST_FTDC_SS_SettlementFinished '5' + + typedef char TThostFtdcSysSettlementStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRatioAttrTypeһ + ///////////////////////////////////////////////////////////////////////// + ///׷ + #define THOST_FTDC_RA_Trade '0' + /// + #define THOST_FTDC_RA_Settlement '1' + + typedef char TThostFtdcRatioAttrType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcHedgeFlagTypeһͶױ־ + ///////////////////////////////////////////////////////////////////////// + ///Ͷ + #define THOST_FTDC_HF_Speculation '1' + /// + #define THOST_FTDC_HF_Arbitrage '2' + ///ױ + #define THOST_FTDC_HF_Hedge '3' + /// + #define THOST_FTDC_HF_Covered '4' + + typedef char TThostFtdcHedgeFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBillHedgeFlagTypeһͶױ־ + ///////////////////////////////////////////////////////////////////////// + ///Ͷ + #define THOST_FTDC_BHF_Speculation '1' + /// + #define THOST_FTDC_BHF_Arbitrage '2' + ///ױ + #define THOST_FTDC_BHF_Hedge '3' + + typedef char TThostFtdcBillHedgeFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClientIDTypeTypeһױ + ///////////////////////////////////////////////////////////////////////// + ///Ͷ + #define THOST_FTDC_CIDT_Speculation '1' + /// + #define THOST_FTDC_CIDT_Arbitrage '2' + ///ױ + #define THOST_FTDC_CIDT_Hedge '3' + + typedef char TThostFtdcClientIDTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrderPriceTypeTypeһ۸ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_OPT_AnyPrice '1' + ///޼ + #define THOST_FTDC_OPT_LimitPrice '2' + ///ż + #define THOST_FTDC_OPT_BestPrice '3' + ///¼ + #define THOST_FTDC_OPT_LastPrice '4' + ///¼۸ϸ1ticks + #define THOST_FTDC_OPT_LastPricePlusOneTicks '5' + ///¼۸ϸ2ticks + #define THOST_FTDC_OPT_LastPricePlusTwoTicks '6' + ///¼۸ϸ3ticks + #define THOST_FTDC_OPT_LastPricePlusThreeTicks '7' + ///һ + #define THOST_FTDC_OPT_AskPrice1 '8' + ///һ۸ϸ1ticks + #define THOST_FTDC_OPT_AskPrice1PlusOneTicks '9' + ///һ۸ϸ2ticks + #define THOST_FTDC_OPT_AskPrice1PlusTwoTicks 'A' + ///һ۸ϸ3ticks + #define THOST_FTDC_OPT_AskPrice1PlusThreeTicks 'B' + ///һ + #define THOST_FTDC_OPT_BidPrice1 'C' + ///һ۸ϸ1ticks + #define THOST_FTDC_OPT_BidPrice1PlusOneTicks 'D' + ///һ۸ϸ2ticks + #define THOST_FTDC_OPT_BidPrice1PlusTwoTicks 'E' + ///һ۸ϸ3ticks + #define THOST_FTDC_OPT_BidPrice1PlusThreeTicks 'F' + ///嵵 + #define THOST_FTDC_OPT_FiveLevelPrice 'G' + + typedef char TThostFtdcOrderPriceTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOffsetFlagTypeһƽ־ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_OF_Open '0' + ///ƽ + #define THOST_FTDC_OF_Close '1' + ///ǿƽ + #define THOST_FTDC_OF_ForceClose '2' + ///ƽ + #define THOST_FTDC_OF_CloseToday '3' + ///ƽ + #define THOST_FTDC_OF_CloseYesterday '4' + ///ǿ + #define THOST_FTDC_OF_ForceOff '5' + ///ǿƽ + #define THOST_FTDC_OF_LocalForceClose '6' + + typedef char TThostFtdcOffsetFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcForceCloseReasonTypeһǿƽԭ + ///////////////////////////////////////////////////////////////////////// + ///ǿƽ + #define THOST_FTDC_FCC_NotForceClose '0' + ///ʽ + #define THOST_FTDC_FCC_LackDeposit '1' + ///ͻ + #define THOST_FTDC_FCC_ClientOverPositionLimit '2' + ///Ա + #define THOST_FTDC_FCC_MemberOverPositionLimit '3' + ///ֲַ + #define THOST_FTDC_FCC_NotMultiple '4' + ///Υ + #define THOST_FTDC_FCC_Violation '5' + /// + #define THOST_FTDC_FCC_Other '6' + ///Ȼٽ + #define THOST_FTDC_FCC_PersonDeliv '7' + + typedef char TThostFtdcForceCloseReasonType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrderTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_ORDT_Normal '0' + /// + #define THOST_FTDC_ORDT_DeriveFromQuote '1' + /// + #define THOST_FTDC_ORDT_DeriveFromCombination '2' + ///ϱ + #define THOST_FTDC_ORDT_Combination '3' + /// + #define THOST_FTDC_ORDT_ConditionalOrder '4' + /// + #define THOST_FTDC_ORDT_Swap '5' + + typedef char TThostFtdcOrderTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTimeConditionTypeһЧ + ///////////////////////////////////////////////////////////////////////// + ///ɣ + #define THOST_FTDC_TC_IOC '1' + ///Ч + #define THOST_FTDC_TC_GFS '2' + ///Ч + #define THOST_FTDC_TC_GFD '3' + ///ָǰЧ + #define THOST_FTDC_TC_GTD '4' + ///ǰЧ + #define THOST_FTDC_TC_GTC '5' + ///ϾЧ + #define THOST_FTDC_TC_GFA '6' + + typedef char TThostFtdcTimeConditionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcVolumeConditionTypeһɽ + ///////////////////////////////////////////////////////////////////////// + ///κ + #define THOST_FTDC_VC_AV '1' + ///С + #define THOST_FTDC_VC_MV '2' + ///ȫ + #define THOST_FTDC_VC_CV '3' + + typedef char TThostFtdcVolumeConditionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcContingentConditionTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_CC_Immediately '1' + ///ֹ + #define THOST_FTDC_CC_Touch '2' + ///ֹӮ + #define THOST_FTDC_CC_TouchProfit '3' + ///Ԥ + #define THOST_FTDC_CC_ParkedOrder '4' + ///¼۴ + #define THOST_FTDC_CC_LastPriceGreaterThanStopPrice '5' + ///¼۴ڵ + #define THOST_FTDC_CC_LastPriceGreaterEqualStopPrice '6' + ///¼С + #define THOST_FTDC_CC_LastPriceLesserThanStopPrice '7' + ///¼Сڵ + #define THOST_FTDC_CC_LastPriceLesserEqualStopPrice '8' + ///һ۴ + #define THOST_FTDC_CC_AskPriceGreaterThanStopPrice '9' + ///һ۴ڵ + #define THOST_FTDC_CC_AskPriceGreaterEqualStopPrice 'A' + ///һС + #define THOST_FTDC_CC_AskPriceLesserThanStopPrice 'B' + ///һСڵ + #define THOST_FTDC_CC_AskPriceLesserEqualStopPrice 'C' + ///һ۴ + #define THOST_FTDC_CC_BidPriceGreaterThanStopPrice 'D' + ///һ۴ڵ + #define THOST_FTDC_CC_BidPriceGreaterEqualStopPrice 'E' + ///һС + #define THOST_FTDC_CC_BidPriceLesserThanStopPrice 'F' + ///һСڵ + #define THOST_FTDC_CC_BidPriceLesserEqualStopPrice 'H' + + typedef char TThostFtdcContingentConditionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcActionFlagTypeһ־ + ///////////////////////////////////////////////////////////////////////// + ///ɾ + #define THOST_FTDC_AF_Delete '0' + ///޸ + #define THOST_FTDC_AF_Modify '3' + + typedef char TThostFtdcActionFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradingRightTypeһȨ + ///////////////////////////////////////////////////////////////////////// + ///Խ + #define THOST_FTDC_TR_Allow '0' + ///ֻƽ + #define THOST_FTDC_TR_CloseOnly '1' + ///ܽ + #define THOST_FTDC_TR_Forbidden '2' + + typedef char TThostFtdcTradingRightType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrderSourceTypeһԴ + ///////////////////////////////////////////////////////////////////////// + ///Բ + #define THOST_FTDC_OSRC_Participant '0' + ///ԹԱ + #define THOST_FTDC_OSRC_Administrator '1' + + typedef char TThostFtdcOrderSourceType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeTypeTypeһɽ + ///////////////////////////////////////////////////////////////////////// + ///ϳֲֲΪһֲ,ʼӦ͵ijֲ + #define THOST_FTDC_TRDT_SplitCombination '#' + ///ͨɽ + #define THOST_FTDC_TRDT_Common '0' + ///Ȩִ + #define THOST_FTDC_TRDT_OptionsExecution '1' + ///OTCɽ + #define THOST_FTDC_TRDT_OTC '2' + ///תɽ + #define THOST_FTDC_TRDT_EFPDerived '3' + ///ɽ + #define THOST_FTDC_TRDT_CombinationDerived '4' + + typedef char TThostFtdcTradeTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPriceSourceTypeһɽԴ + ///////////////////////////////////////////////////////////////////////// + ///ǰɽ + #define THOST_FTDC_PSRC_LastPrice '0' + ///ίм + #define THOST_FTDC_PSRC_Buy '1' + ///ίм + #define THOST_FTDC_PSRC_Sell '2' + + typedef char TThostFtdcPriceSourceType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstrumentStatusTypeһԼ״̬ + ///////////////////////////////////////////////////////////////////////// + ///ǰ + #define THOST_FTDC_IS_BeforeTrading '0' + ///ǽ + #define THOST_FTDC_IS_NoTrading '1' + /// + #define THOST_FTDC_IS_Continous '2' + ///Ͼ۱ + #define THOST_FTDC_IS_AuctionOrdering '3' + ///Ͼۼ۸ƽ + #define THOST_FTDC_IS_AuctionBalance '4' + ///Ͼ۴ + #define THOST_FTDC_IS_AuctionMatch '5' + /// + #define THOST_FTDC_IS_Closed '6' + + typedef char TThostFtdcInstrumentStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstStatusEnterReasonTypeһƷֽ뽻״̬ԭ + ///////////////////////////////////////////////////////////////////////// + ///Զл + #define THOST_FTDC_IER_Automatic '1' + ///ֶл + #define THOST_FTDC_IER_Manual '2' + ///۶ + #define THOST_FTDC_IER_Fuse '3' + + typedef char TThostFtdcInstStatusEnterReasonType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrderActionRefTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcOrderActionRefType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstallCountTypeһװ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcInstallCountType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstallIDTypeһװ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcInstallIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcErrorIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcErrorIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettlementIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcSettlementIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcVolumeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcVolumeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFrontIDTypeһǰñ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcFrontIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSessionIDTypeһỰ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcSessionIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSequenceNoTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcSequenceNoType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCommandNoTypeһDB + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcCommandNoType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMillisecTypeһʱ䣨룩 + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcMillisecType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcVolumeMultipleTypeһԼ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcVolumeMultipleType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradingSegmentSNTypeһ׽׶α + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcTradingSegmentSNType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRequestIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcRequestIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcYearTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcYearType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMonthTypeһ· + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcMonthType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBoolTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcBoolType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPriceTypeһ۸ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcPriceType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCombOffsetFlagTypeһϿƽ־ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCombOffsetFlagType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCombHedgeFlagTypeһͶױ־ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCombHedgeFlagType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRatioTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcRatioType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMoneyTypeһʽ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcMoneyType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLargeVolumeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcLargeVolumeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSequenceSeriesTypeһϵк + ///////////////////////////////////////////////////////////////////////// + typedef short TThostFtdcSequenceSeriesType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCommPhaseNoTypeһͨѶʱα + ///////////////////////////////////////////////////////////////////////// + typedef short TThostFtdcCommPhaseNoType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSequenceLabelTypeһб + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSequenceLabelType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUnderlyingMultipleTypeһƷ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcUnderlyingMultipleType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPriorityTypeһȼ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcPriorityType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcContractCodeTypeһͬ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcContractCodeType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCityTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCityType[51]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcIsStockTypeһǷ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcIsStockType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcChannelTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcChannelType[51]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAddressTypeһͨѶַ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAddressType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcZipCodeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcZipCodeType[7]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTelephoneTypeһϵ绰 + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTelephoneType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFaxTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFaxType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMobileTypeһֻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcMobileType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcEMailTypeһʼ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcEMailType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMemoTypeһע + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcMemoType[161]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCompanyCodeTypeһҵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCompanyCodeType[51]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcWebsiteTypeһվַ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcWebsiteType[51]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTaxNoTypeһ˰ǼǺ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTaxNoType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBatchStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δϴ + #define THOST_FTDC_BS_NoUpload '1' + ///ϴ + #define THOST_FTDC_BS_Uploaded '2' + ///ʧ + #define THOST_FTDC_BS_Failed '3' + + typedef char TThostFtdcBatchStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPropertyIDTypeһԴ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPropertyIDType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPropertyNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPropertyNameType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLicenseNoTypeһӪҵִպ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcLicenseNoType[51]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAgentIDTypeһ˴ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAgentIDType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAgentNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAgentNameType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAgentGroupIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAgentGroupIDType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAgentGroupNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAgentGroupNameType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcReturnStyleTypeһƷַʽ + ///////////////////////////////////////////////////////////////////////// + ///Ʒ + #define THOST_FTDC_RS_All '1' + ///Ʒ + #define THOST_FTDC_RS_ByProduct '2' + + typedef char TThostFtdcReturnStyleType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcReturnPatternTypeһģʽ + ///////////////////////////////////////////////////////////////////////// + ///ɽ + #define THOST_FTDC_RP_ByVolume '1' + /// + #define THOST_FTDC_RP_ByFeeOnHand '2' + + typedef char TThostFtdcReturnPatternType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcReturnLevelTypeһ + ///////////////////////////////////////////////////////////////////////// + ///1 + #define THOST_FTDC_RL_Level1 '1' + ///2 + #define THOST_FTDC_RL_Level2 '2' + ///3 + #define THOST_FTDC_RL_Level3 '3' + ///4 + #define THOST_FTDC_RL_Level4 '4' + ///5 + #define THOST_FTDC_RL_Level5 '5' + ///6 + #define THOST_FTDC_RL_Level6 '6' + ///7 + #define THOST_FTDC_RL_Level7 '7' + ///8 + #define THOST_FTDC_RL_Level8 '8' + ///9 + #define THOST_FTDC_RL_Level9 '9' + + typedef char TThostFtdcReturnLevelType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcReturnStandardTypeһ׼ + ///////////////////////////////////////////////////////////////////////// + ///ֽ׶η + #define THOST_FTDC_RSD_ByPeriod '1' + ///ijһ׼ + #define THOST_FTDC_RSD_ByStandard '2' + + typedef char TThostFtdcReturnStandardType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMortgageTypeTypeһѺ + ///////////////////////////////////////////////////////////////////////// + ///ʳ + #define THOST_FTDC_MT_Out '0' + /// + #define THOST_FTDC_MT_In '1' + + typedef char TThostFtdcMortgageTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvestorSettlementParamIDTypeһͶ߽ + ///////////////////////////////////////////////////////////////////////// + ///Ѻ + #define THOST_FTDC_ISPI_MortgageRatio '4' + ///֤㷨 + #define THOST_FTDC_ISPI_MarginWay '5' + ///㵥ǷѺ + #define THOST_FTDC_ISPI_BillDeposit '9' + + typedef char TThostFtdcInvestorSettlementParamIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExchangeSettlementParamIDTypeһ + ///////////////////////////////////////////////////////////////////////// + ///Ѻ + #define THOST_FTDC_ESPI_MortgageRatio '1' + ///ʽ + #define THOST_FTDC_ESPI_OtherFundItem '2' + ///ʽ뽻 + #define THOST_FTDC_ESPI_OtherFundImport '3' + ///нͿý + #define THOST_FTDC_ESPI_CFFEXMinPrepa '6' + ///֣㷽ʽ + #define THOST_FTDC_ESPI_CZCESettlementType '7' + ///ȡʽ + #define THOST_FTDC_ESPI_ExchDelivFeeMode '9' + ///Ͷ߽ȡʽ + #define THOST_FTDC_ESPI_DelivFeeMode '0' + ///֣ϳֱֲ֤ȡʽ + #define THOST_FTDC_ESPI_CZCEComMarginType 'A' + ///֤ǷŻ + #define THOST_FTDC_ESPI_DceComMarginType 'B' + ///ֵȨ֤Żݱ + #define THOST_FTDC_ESPI_OptOutDisCountRate 'a' + ///ͱϵ + #define THOST_FTDC_ESPI_OptMiniGuarantee 'b' + + typedef char TThostFtdcExchangeSettlementParamIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSystemParamIDTypeһϵͳ + ///////////////////////////////////////////////////////////////////////// + ///ͶߴС + #define THOST_FTDC_SPI_InvestorIDMinLength '1' + ///ͶʺŴС + #define THOST_FTDC_SPI_AccountIDMinLength '2' + ///Ͷ߿Ĭϵ¼Ȩ + #define THOST_FTDC_SPI_UserRightLogon '3' + ///Ͷ߽׽㵥ɽܷʽ + #define THOST_FTDC_SPI_SettlementBillTrade '4' + ///ͳһ½ױ뷽ʽ + #define THOST_FTDC_SPI_TradingCode '5' + ///Ƿжϴδ˵ijͷʽ + #define THOST_FTDC_SPI_CheckFund '6' + ///ǷģȨ + #define THOST_FTDC_SPI_CommModelRight '7' + ///Ƿñ֤ģȨ + #define THOST_FTDC_SPI_MarginModelRight '9' + ///Ƿ淶ûܼ + #define THOST_FTDC_SPI_IsStandardActive '8' + ///ϴĽļ· + #define THOST_FTDC_SPI_UploadSettlementFile 'U' + ///ϱ֤ļ· + #define THOST_FTDC_SPI_DownloadCSRCFile 'D' + ///ɵĽ㵥ļ· + #define THOST_FTDC_SPI_SettlementBillFile 'S' + ///֤ļʶ + #define THOST_FTDC_SPI_CSRCOthersFile 'C' + ///ͶƬ· + #define THOST_FTDC_SPI_InvestorPhoto 'P' + ///ȫᾭ͹˾ϴļ· + #define THOST_FTDC_SPI_CSRCData 'R' + ///¼뷽ʽ + #define THOST_FTDC_SPI_InvestorPwdModel 'I' + ///Ͷнļ· + #define THOST_FTDC_SPI_CFFEXInvestorSettleFile 'F' + ///Ͷߴ뷽ʽ + #define THOST_FTDC_SPI_InvestorIDType 'a' + ///߻Ȩ + #define THOST_FTDC_SPI_FreezeMaxReMain 'r' + ///زʵʱϳ + #define THOST_FTDC_SPI_IsSync 'A' + ///Ȩ + #define THOST_FTDC_SPI_RelieveOpenLimit 'O' + ///Ƿ淶û + #define THOST_FTDC_SPI_IsStandardFreeze 'X' + ///֣Ƿ񿪷Ʒױ + #define THOST_FTDC_SPI_CZCENormalProductHedge 'B' + + typedef char TThostFtdcSystemParamIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeParamIDTypeһϵͳ + ///////////////////////////////////////////////////////////////////////// + ///ϵͳ㷨 + #define THOST_FTDC_TPID_EncryptionStandard 'E' + ///ϵͳ㷨 + #define THOST_FTDC_TPID_RiskMode 'R' + ///ϵͳ㷨Ƿȫ 0- 1- + #define THOST_FTDC_TPID_RiskModeGlobal 'G' + ///㷨 + #define THOST_FTDC_TPID_modeEncode 'P' + ///۸Сλ + #define THOST_FTDC_TPID_tickMode 'T' + ///ûỰ + #define THOST_FTDC_TPID_SingleUserSessionMaxNum 'S' + ///¼ʧ + #define THOST_FTDC_TPID_LoginFailMaxNum 'L' + ///Ƿǿ֤ + #define THOST_FTDC_TPID_IsAuthForce 'A' + ///ǷǮͬ + #define THOST_FTDC_TPID_IsPositionInOut 'I' + + typedef char TThostFtdcTradeParamIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettlementParamValueTypeһֵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSettlementParamValueType[256]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCounterIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCounterIDType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvestorGroupNameTypeһͶ߷ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInvestorGroupNameType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBrandCodeTypeһƺ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBrandCodeType[257]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcWarehouseTypeһֿ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcWarehouseType[257]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProductDateTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcProductDateType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcGradeTypeһȼ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcGradeType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClassifyTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcClassifyType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPositionTypeһλ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPositionType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcYieldlyTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcYieldlyType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcWeightTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcWeightType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSubEntryFundNoTypeһʽˮ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcSubEntryFundNoType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFileIDTypeһļʶ + ///////////////////////////////////////////////////////////////////////// + ///ʽ + #define THOST_FTDC_FI_SettlementFund 'F' + ///ɽ + #define THOST_FTDC_FI_Trade 'T' + ///Ͷֲ߳ + #define THOST_FTDC_FI_InvestorPosition 'P' + ///Ͷ߷ʽ + #define THOST_FTDC_FI_SubEntryFund 'O' + ///ϳֲ + #define THOST_FTDC_FI_CZCECombinationPos 'C' + ///ϱ֤ + #define THOST_FTDC_FI_CSRCData 'R' + ///֣ƽ˽ + #define THOST_FTDC_FI_CZCEClose 'L' + ///֣ƽ˽ + #define THOST_FTDC_FI_CZCENoClose 'N' + ///ֲϸ + #define THOST_FTDC_FI_PositionDtl 'D' + ///Ȩִļ + #define THOST_FTDC_FI_OptionStrike 'S' + ///۱ȶļ + #define THOST_FTDC_FI_SettlementPriceComparison 'M' + ///dzֱֲ䶯ϸ + #define THOST_FTDC_FI_NonTradePosChange 'B' + + typedef char TThostFtdcFileIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFileNameTypeһļ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFileNameType[257]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFileTypeTypeһļϴ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_FUT_Settlement '0' + ///˶ + #define THOST_FTDC_FUT_Check '1' + + typedef char TThostFtdcFileTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFileFormatTypeһļʽ + ///////////////////////////////////////////////////////////////////////// + ///ıļ(.txt) + #define THOST_FTDC_FFT_Txt '0' + ///ѹļ(.zip) + #define THOST_FTDC_FFT_Zip '1' + ///DBFļ(.dbf) + #define THOST_FTDC_FFT_DBF '2' + + typedef char TThostFtdcFileFormatType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFileUploadStatusTypeһļ״̬ + ///////////////////////////////////////////////////////////////////////// + ///ϴɹ + #define THOST_FTDC_FUS_SucceedUpload '1' + ///ϴʧ + #define THOST_FTDC_FUS_FailedUpload '2' + ///ɹ + #define THOST_FTDC_FUS_SucceedLoad '3' + ///벿ֳɹ + #define THOST_FTDC_FUS_PartSucceedLoad '4' + ///ʧ + #define THOST_FTDC_FUS_FailedLoad '5' + + typedef char TThostFtdcFileUploadStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTransferDirectionTypeһƲַ + ///////////////////////////////////////////////////////////////////////// + ///Ƴ + #define THOST_FTDC_TD_Out '0' + /// + #define THOST_FTDC_TD_In '1' + + typedef char TThostFtdcTransferDirectionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUploadModeTypeһϴļ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUploadModeType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAccountIDTypeһͶʺ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAccountIDType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankFlagTypeһͳһʶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankFlagType[4]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankAccountTypeһ˻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankAccountType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOpenNameTypeһ˻Ŀ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOpenNameType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOpenBankTypeһ˻Ŀ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOpenBankType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankNameType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPublishPathTypeһ· + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPublishPathType[257]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOperatorIDTypeһԱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOperatorIDType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMonthCountTypeһ· + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcMonthCountType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAdvanceMonthArrayTypeһ·ǰ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAdvanceMonthArrayType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDateExprTypeһڱʽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDateExprType[1025]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstrumentIDExprTypeһԼʽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInstrumentIDExprType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstrumentNameExprTypeһԼƱʽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInstrumentNameExprType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSpecialCreateRuleTypeһĴ + ///////////////////////////////////////////////////////////////////////// + ///ûⴴ + #define THOST_FTDC_SC_NoSpecialRule '0' + /// + #define THOST_FTDC_SC_NoSpringFestival '1' + + typedef char TThostFtdcSpecialCreateRuleType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBasisPriceTypeTypeһƻ׼ + ///////////////////////////////////////////////////////////////////////// + ///һԼ + #define THOST_FTDC_IPT_LastSettlement '1' + ///һԼ̼ + #define THOST_FTDC_IPT_LaseClose '2' + + typedef char TThostFtdcBasisPriceTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProductLifePhaseTypeһƷ״̬ + ///////////////////////////////////////////////////////////////////////// + ///Ծ + #define THOST_FTDC_PLP_Active '1' + ///Ծ + #define THOST_FTDC_PLP_NonActive '2' + ///ע + #define THOST_FTDC_PLP_Canceled '3' + + typedef char TThostFtdcProductLifePhaseType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDeliveryModeTypeһʽ + ///////////////////////////////////////////////////////////////////////// + ///ֽ𽻸 + #define THOST_FTDC_DM_CashDeliv '1' + ///ʵサ + #define THOST_FTDC_DM_CommodityDeliv '2' + + typedef char TThostFtdcDeliveryModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLogLevelTypeһ־ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcLogLevelType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProcessNameTypeһ洢 + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcProcessNameType[257]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOperationMemoTypeһժҪ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOperationMemoType[1025]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundIOTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_FIOT_FundIO '1' + ///ת + #define THOST_FTDC_FIOT_Transfer '2' + ///ڻ + #define THOST_FTDC_FIOT_SwapCurrency '3' + + typedef char TThostFtdcFundIOTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundTypeTypeһʽ + ///////////////////////////////////////////////////////////////////////// + ///д + #define THOST_FTDC_FT_Deposite '1' + ///ʽ + #define THOST_FTDC_FT_ItemFund '2' + ///˾ + #define THOST_FTDC_FT_Company '3' + ///ʽת + #define THOST_FTDC_FT_InnerTransfer '4' + + typedef char TThostFtdcFundTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundDirectionTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_FD_In '1' + /// + #define THOST_FTDC_FD_Out '2' + + typedef char TThostFtdcFundDirectionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundStatusTypeһʽ״̬ + ///////////////////////////////////////////////////////////////////////// + ///¼ + #define THOST_FTDC_FS_Record '1' + ///Ѹ + #define THOST_FTDC_FS_Check '2' + ///ѳ + #define THOST_FTDC_FS_Charge '3' + + typedef char TThostFtdcFundStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBillNoTypeһƱݺ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBillNoType[15]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBillNameTypeһƱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBillNameType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPublishStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_PS_None '1' + ///ڷ + #define THOST_FTDC_PS_Publishing '2' + ///ѷ + #define THOST_FTDC_PS_Published '3' + + typedef char TThostFtdcPublishStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcEnumValueIDTypeһöֵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcEnumValueIDType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcEnumValueTypeTypeһöֵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcEnumValueTypeType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcEnumValueLabelTypeһöֵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcEnumValueLabelType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcEnumValueResultTypeһöֵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcEnumValueResultType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSystemStatusTypeһϵͳ״̬ + ///////////////////////////////////////////////////////////////////////// + ///Ծ + #define THOST_FTDC_ES_NonActive '1' + /// + #define THOST_FTDC_ES_Startup '2' + ///׿ʼʼ + #define THOST_FTDC_ES_Initialize '3' + ///ɳʼ + #define THOST_FTDC_ES_Initialized '4' + ///пʼ + #define THOST_FTDC_ES_Close '5' + /// + #define THOST_FTDC_ES_Closed '6' + /// + #define THOST_FTDC_ES_Settlement '7' + + typedef char TThostFtdcSystemStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettlementStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///ʼ + #define THOST_FTDC_STS_Initialize '0' + /// + #define THOST_FTDC_STS_Settlementing '1' + ///ѽ + #define THOST_FTDC_STS_Settlemented '2' + /// + #define THOST_FTDC_STS_Finished '3' + + typedef char TThostFtdcSettlementStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRangeIntTypeTypeһ޶ֵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRangeIntTypeType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRangeIntFromTypeһ޶ֵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRangeIntFromType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRangeIntToTypeһ޶ֵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRangeIntToType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFunctionIDTypeһܴ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFunctionIDType[25]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFunctionValueCodeTypeһܱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFunctionValueCodeType[257]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFunctionNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFunctionNameType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRoleIDTypeһɫ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRoleIDType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRoleNameTypeһɫ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRoleNameType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDescriptionTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDescriptionType[401]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCombineIDTypeһϱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCombineIDType[25]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCombineTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCombineTypeType[25]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvestorTypeTypeһͶ + ///////////////////////////////////////////////////////////////////////// + ///Ȼ + #define THOST_FTDC_CT_Person '0' + /// + #define THOST_FTDC_CT_Company '1' + ///Ͷʻ + #define THOST_FTDC_CT_Fund '2' + ///ⷨ + #define THOST_FTDC_CT_SpecialOrgan '3' + ///ʹܻ + #define THOST_FTDC_CT_Asset '4' + + typedef char TThostFtdcInvestorTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBrokerTypeTypeһ͹˾ + ///////////////////////////////////////////////////////////////////////// + ///׻Ա + #define THOST_FTDC_BT_Trade '0' + ///׽Ա + #define THOST_FTDC_BT_TradeSettle '1' + + typedef char TThostFtdcBrokerTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRiskLevelTypeһյȼ + ///////////////////////////////////////////////////////////////////////// + ///ͷտͻ + #define THOST_FTDC_FAS_Low '1' + ///ͨͻ + #define THOST_FTDC_FAS_Normal '2' + ///עͻ + #define THOST_FTDC_FAS_Focus '3' + ///տͻ + #define THOST_FTDC_FAS_Risk '4' + + typedef char TThostFtdcRiskLevelType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFeeAcceptStyleTypeһȡʽ + ///////////////////////////////////////////////////////////////////////// + ///ȡ + #define THOST_FTDC_FAS_ByTrade '1' + ///ȡ + #define THOST_FTDC_FAS_ByDeliv '2' + /// + #define THOST_FTDC_FAS_None '3' + ///ָȡ + #define THOST_FTDC_FAS_FixFee '4' + + typedef char TThostFtdcFeeAcceptStyleType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPasswordTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_PWDT_Trade '1' + ///ʽ + #define THOST_FTDC_PWDT_Account '2' + + typedef char TThostFtdcPasswordTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAlgorithmTypeһӯ㷨 + ///////////////////////////////////////////////////////////////////////// + ///ӯ + #define THOST_FTDC_AG_All '1' + ///ӯƣ + #define THOST_FTDC_AG_OnlyLost '2' + ///ӯƣ + #define THOST_FTDC_AG_OnlyGain '3' + ///ӯ + #define THOST_FTDC_AG_None '4' + + typedef char TThostFtdcAlgorithmType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcIncludeCloseProfitTypeһǷƽӯ + ///////////////////////////////////////////////////////////////////////// + ///ƽӯ + #define THOST_FTDC_ICP_Include '0' + ///ƽӯ + #define THOST_FTDC_ICP_NotInclude '2' + + typedef char TThostFtdcIncludeCloseProfitType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAllWithoutTradeTypeһǷܿ + ///////////////////////////////////////////////////////////////////////// + ///޲޳ɽܿ + #define THOST_FTDC_AWT_Enable '0' + ///ܿ + #define THOST_FTDC_AWT_Disable '2' + ///޲ֲܿ + #define THOST_FTDC_AWT_NoHoldEnable '3' + + typedef char TThostFtdcAllWithoutTradeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCommentTypeһӯ㷨˵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCommentType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcVersionTypeһ汾 + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcVersionType[4]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeCodeTypeһ״ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTradeCodeType[7]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeDateTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTradeDateType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeTimeTypeһʱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTradeTimeType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeSerialTypeһˮ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTradeSerialType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeSerialNoTypeһˮ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcTradeSerialNoType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureIDTypeһڻ˾ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFutureIDType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankIDTypeһд + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankIDType[4]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankBrchIDTypeһзĴ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankBrchIDType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankBranchIDTypeһĴ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankBranchIDType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOperNoTypeһ׹Ա + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOperNoType[17]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDeviceIDTypeһ־ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDeviceIDType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRecordNumTypeһ¼ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRecordNumType[7]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureAccountTypeһڻʽ˺ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFutureAccountType[22]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFuturePwdFlagTypeһʽ˶Ա־ + ///////////////////////////////////////////////////////////////////////// + ///˶ + #define THOST_FTDC_FPWD_UnCheck '0' + ///˶ + #define THOST_FTDC_FPWD_Check '1' + + typedef char TThostFtdcFuturePwdFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTransferTypeTypeһת + ///////////////////////////////////////////////////////////////////////// + ///תڻ + #define THOST_FTDC_TT_BankToFuture '0' + ///ڻת + #define THOST_FTDC_TT_FutureToBank '1' + + typedef char TThostFtdcTransferTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureAccPwdTypeһڻʽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFutureAccPwdType[17]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCurrencyCodeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCurrencyCodeType[4]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRetCodeTypeһӦ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRetCodeType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRetInfoTypeһӦϢ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRetInfoType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeAmtTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTradeAmtType[20]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUseAmtTypeһп + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUseAmtType[20]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFetchAmtTypeһпȡ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFetchAmtType[20]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTransferValidFlagTypeһתЧ־ + ///////////////////////////////////////////////////////////////////////// + ///Чʧ + #define THOST_FTDC_TVF_Invalid '0' + ///Ч + #define THOST_FTDC_TVF_Valid '1' + /// + #define THOST_FTDC_TVF_Reverse '2' + + typedef char TThostFtdcTransferValidFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCertCodeTypeһ֤ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCertCodeType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcReasonTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_RN_CD '0' + ///ʽ; + #define THOST_FTDC_RN_ZT '1' + /// + #define THOST_FTDC_RN_QT '2' + + typedef char TThostFtdcReasonType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundProjectIDTypeһʽĿ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFundProjectIDType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSexTypeһԱ + ///////////////////////////////////////////////////////////////////////// + ///δ֪ + #define THOST_FTDC_SEX_None '0' + /// + #define THOST_FTDC_SEX_Man '1' + ///Ů + #define THOST_FTDC_SEX_Woman '2' + + typedef char TThostFtdcSexType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProfessionTypeһְҵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcProfessionType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcNationalTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcNationalType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProvinceTypeһʡ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcProvinceType[51]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRegionTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRegionType[16]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCountryTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCountryType[16]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLicenseNOTypeһӪҵִ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcLicenseNOType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCompanyTypeTypeһҵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCompanyTypeType[16]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBusinessScopeTypeһӪΧ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBusinessScopeType[1001]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCapitalCurrencyTypeһעʱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCapitalCurrencyType[4]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUserTypeTypeһû + ///////////////////////////////////////////////////////////////////////// + ///Ͷ + #define THOST_FTDC_UT_Investor '0' + ///Ա + #define THOST_FTDC_UT_Operator '1' + ///Ա + #define THOST_FTDC_UT_SuperUser '2' + + typedef char TThostFtdcUserTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBranchIDTypeһӪҵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBranchIDType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRateTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + ///֤ + #define THOST_FTDC_RATETYPE_MarginRate '2' + + typedef char TThostFtdcRateTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcNoteTypeTypeһ֪ͨ + ///////////////////////////////////////////////////////////////////////// + ///׽㵥 + #define THOST_FTDC_NOTETYPE_TradeSettleBill '1' + ///׽± + #define THOST_FTDC_NOTETYPE_TradeSettleMonth '2' + ///׷ӱ֤֪ͨ + #define THOST_FTDC_NOTETYPE_CallMarginNotes '3' + ///ǿƽ֪ͨ + #define THOST_FTDC_NOTETYPE_ForceCloseNotes '4' + ///ɽ֪ͨ + #define THOST_FTDC_NOTETYPE_TradeNotes '5' + ///֪ͨ + #define THOST_FTDC_NOTETYPE_DelivNotes '6' + + typedef char TThostFtdcNoteTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettlementStyleTypeһ㵥ʽ + ///////////////////////////////////////////////////////////////////////// + ///ն + #define THOST_FTDC_SBS_Day '1' + ///ʶԳ + #define THOST_FTDC_SBS_Volume '2' + + typedef char TThostFtdcSettlementStyleType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBrokerDNSTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBrokerDNSType[256]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSentenceTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSentenceType[501]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettlementBillTypeTypeһ㵥 + ///////////////////////////////////////////////////////////////////////// + ///ձ + #define THOST_FTDC_ST_Day '0' + ///± + #define THOST_FTDC_ST_Month '1' + + typedef char TThostFtdcSettlementBillTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUserRightTypeTypeһͻȨ + ///////////////////////////////////////////////////////////////////////// + ///¼ + #define THOST_FTDC_URT_Logon '1' + ///ת + #define THOST_FTDC_URT_Transfer '2' + ///ʼĽ㵥 + #define THOST_FTDC_URT_EMail '3' + ///㵥 + #define THOST_FTDC_URT_Fax '4' + /// + #define THOST_FTDC_URT_ConditionOrder '5' + + typedef char TThostFtdcUserRightTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMarginPriceTypeTypeһ֤۸ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_MPT_PreSettlementPrice '1' + ///¼ + #define THOST_FTDC_MPT_SettlementPrice '2' + ///ɽ + #define THOST_FTDC_MPT_AveragePrice '3' + ///ּ + #define THOST_FTDC_MPT_OpenPrice '4' + + typedef char TThostFtdcMarginPriceTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBillGenStatusTypeһ㵥״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_BGS_None '0' + /// + #define THOST_FTDC_BGS_NoGenerated '1' + /// + #define THOST_FTDC_BGS_Generated '2' + + typedef char TThostFtdcBillGenStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAlgoTypeTypeһ㷨 + ///////////////////////////////////////////////////////////////////////// + ///ֲִ㷨 + #define THOST_FTDC_AT_HandlePositionAlgo '1' + ///Ѱұ֤㷨 + #define THOST_FTDC_AT_FindMarginRateAlgo '2' + + typedef char TThostFtdcAlgoTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcHandlePositionAlgoIDTypeһֲִ㷨 + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_HPA_Base '1' + ///Ʒ + #define THOST_FTDC_HPA_DCE '2' + ///֣Ʒ + #define THOST_FTDC_HPA_CZCE '3' + + typedef char TThostFtdcHandlePositionAlgoIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFindMarginRateAlgoIDTypeһѰұ֤㷨 + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_FMRA_Base '1' + ///Ʒ + #define THOST_FTDC_FMRA_DCE '2' + ///֣Ʒ + #define THOST_FTDC_FMRA_CZCE '3' + + typedef char TThostFtdcFindMarginRateAlgoIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcHandleTradingAccountAlgoIDTypeһʽ㷨 + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_HTAA_Base '1' + ///Ʒ + #define THOST_FTDC_HTAA_DCE '2' + ///֣Ʒ + #define THOST_FTDC_HTAA_CZCE '3' + + typedef char TThostFtdcHandleTradingAccountAlgoIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPersonTypeTypeһϵ + ///////////////////////////////////////////////////////////////////////// + ///ָµ + #define THOST_FTDC_PST_Order '1' + ///Ȩ + #define THOST_FTDC_PST_Open '2' + ///ʽ + #define THOST_FTDC_PST_Fund '3' + ///㵥ȷ + #define THOST_FTDC_PST_Settlement '4' + /// + #define THOST_FTDC_PST_Company '5' + ///˴ + #define THOST_FTDC_PST_Corporation '6' + ///Ͷϵ + #define THOST_FTDC_PST_LinkMan '7' + ///ֻʲ + #define THOST_FTDC_PST_Ledger '8' + ///У + #define THOST_FTDC_PST_Trustee '9' + ///Уܻ˴ + #define THOST_FTDC_PST_TrusteeCorporation 'A' + ///УܻȨ + #define THOST_FTDC_PST_TrusteeOpen 'B' + ///Уܻϵ + #define THOST_FTDC_PST_TrusteeContact 'C' + ///Ȼ˲ο֤ + #define THOST_FTDC_PST_ForeignerRefer 'D' + ///˴ο֤ + #define THOST_FTDC_PST_CorporationRefer 'E' + + typedef char TThostFtdcPersonTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcQueryInvestorRangeTypeһѯΧ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_QIR_All '1' + ///ѯ + #define THOST_FTDC_QIR_Group '2' + ///һͶ + #define THOST_FTDC_QIR_Single '3' + + typedef char TThostFtdcQueryInvestorRangeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvestorRiskStatusTypeһͶ߷״̬ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_IRS_Normal '1' + /// + #define THOST_FTDC_IRS_Warn '2' + ///׷ + #define THOST_FTDC_IRS_Call '3' + ///ǿƽ + #define THOST_FTDC_IRS_Force '4' + ///쳣 + #define THOST_FTDC_IRS_Exception '5' + + typedef char TThostFtdcInvestorRiskStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLegIDTypeһȱ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcLegIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLegMultipleTypeһȳ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcLegMultipleType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcImplyLevelTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcImplyLevelType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClearAccountTypeһ˻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcClearAccountType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrganNOTypeһ˻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOrganNOType[6]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClearbarchIDTypeһ˻к + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcClearbarchIDType[6]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUserEventTypeTypeһû¼ + ///////////////////////////////////////////////////////////////////////// + ///¼ + #define THOST_FTDC_UET_Login '1' + ///dz + #define THOST_FTDC_UET_Logout '2' + ///׳ɹ + #define THOST_FTDC_UET_Trading '3' + ///ʧ + #define THOST_FTDC_UET_TradingError '4' + ///޸ + #define THOST_FTDC_UET_UpdatePassword '5' + ///ͻ֤ + #define THOST_FTDC_UET_Authenticate '6' + /// + #define THOST_FTDC_UET_Other '9' + + typedef char TThostFtdcUserEventTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUserEventInfoTypeһû¼Ϣ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUserEventInfoType[1025]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCloseStyleTypeһƽַʽ + ///////////////////////////////////////////////////////////////////////// + ///ȿƽ + #define THOST_FTDC_ICS_Close '0' + ///ƽƽ + #define THOST_FTDC_ICS_CloseToday '1' + + typedef char TThostFtdcCloseStyleType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcStatModeTypeһͳƷʽ + ///////////////////////////////////////////////////////////////////////// + ///---- + #define THOST_FTDC_SM_Non '0' + ///Լͳ + #define THOST_FTDC_SM_Instrument '1' + ///Ʒͳ + #define THOST_FTDC_SM_Product '2' + ///Ͷͳ + #define THOST_FTDC_SM_Investor '3' + + typedef char TThostFtdcStatModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcParkedOrderStatusTypeһԤ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_PAOS_NotSend '1' + ///ѷ + #define THOST_FTDC_PAOS_Send '2' + ///ɾ + #define THOST_FTDC_PAOS_Deleted '3' + + typedef char TThostFtdcParkedOrderStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcParkedOrderIDTypeһԤ񱨵 + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcParkedOrderIDType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcParkedOrderActionIDTypeһԤ񳷵 + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcParkedOrderActionIDType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcVirDealStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///ڴ + #define THOST_FTDC_VDS_Dealing '1' + ///ɹ + #define THOST_FTDC_VDS_DeaclSucceed '2' + + typedef char TThostFtdcVirDealStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrgSystemIDTypeһԭϵͳ + ///////////////////////////////////////////////////////////////////////// + ///ۺϽƽ̨ + #define THOST_FTDC_ORGS_Standard '0' + ///ʢϵͳ + #define THOST_FTDC_ORGS_ESunny '1' + ///˴V6ϵͳ + #define THOST_FTDC_ORGS_KingStarV6 '2' + + typedef char TThostFtdcOrgSystemIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcVirTradeStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_VTS_NaturalDeal '0' + ///ɹ + #define THOST_FTDC_VTS_SucceedEnd '1' + ///ʧܽ + #define THOST_FTDC_VTS_FailedEND '2' + ///쳣 + #define THOST_FTDC_VTS_Exception '3' + ///˹쳣 + #define THOST_FTDC_VTS_ManualDeal '4' + ///ͨѶ쳣 ˹ + #define THOST_FTDC_VTS_MesException '5' + ///ϵͳ˹ + #define THOST_FTDC_VTS_SysException '6' + + typedef char TThostFtdcVirTradeStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcVirBankAccTypeTypeһʻ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_VBAT_BankBook '1' + /// + #define THOST_FTDC_VBAT_BankCard '2' + ///ÿ + #define THOST_FTDC_VBAT_CreditCard '3' + + typedef char TThostFtdcVirBankAccTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcVirementStatusTypeһʻ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_VMS_Natural '0' + /// + #define THOST_FTDC_VMS_Canceled '9' + + typedef char TThostFtdcVirementStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcVirementAvailAbilityTypeһЧ־ + ///////////////////////////////////////////////////////////////////////// + ///δȷ + #define THOST_FTDC_VAA_NoAvailAbility '0' + ///Ч + #define THOST_FTDC_VAA_AvailAbility '1' + /// + #define THOST_FTDC_VAA_Repeal '2' + + typedef char TThostFtdcVirementAvailAbilityType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcVirementTradeCodeTypeһ״ + ///////////////////////////////////////////////////////////////////////// + ///зʽתڻ + #define THOST_FTDC_VTC_BankBankToFuture '102001' + ///зڻʽת + #define THOST_FTDC_VTC_BankFutureToBank '102002' + ///ڻʽתڻ + #define THOST_FTDC_VTC_FutureBankToFuture '202001' + ///ڻڻʽת + #define THOST_FTDC_VTC_FutureFutureToBank '202002' + + typedef char TThostFtdcVirementTradeCodeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPhotoTypeNameTypeһӰ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPhotoTypeNameType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPhotoTypeIDTypeһӰʹ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPhotoTypeIDType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPhotoNameTypeһӰ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPhotoNameType[161]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTopicIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcTopicIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcReportTypeIDTypeһױͱʶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcReportTypeIDType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCharacterIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCharacterIDType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLParamIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLParamIDType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLInvestorTypeTypeһͶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLInvestorTypeType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLIdCardTypeTypeһ֤ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLIdCardTypeType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLTradeDirectTypeһʽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLTradeDirectType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLTradeModelTypeһʽʽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLTradeModelType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLParamIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLParamIDType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLOpParamValueTypeһҵֵ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcAMLOpParamValueType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLCustomerCardTypeTypeһͻ֤/֤ļ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLCustomerCardTypeType[81]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLInstitutionNameTypeһڻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLInstitutionNameType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLDistrictIDTypeһڻڵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLDistrictIDType[7]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLRelationShipTypeһڻ׵Ĺϵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLRelationShipType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLInstitutionTypeTypeһڻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLInstitutionTypeType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLInstitutionIDTypeһڻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLInstitutionIDType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLAccountTypeTypeһ˻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLAccountTypeType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLTradingTypeTypeһ׷ʽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLTradingTypeType[7]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLTransactClassTypeһ֧׷ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLTransactClassType[7]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLCapitalIOTypeһʽոʶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLCapitalIOType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLSiteTypeһ׵ص + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLSiteType[10]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLCapitalPurposeTypeһʽ; + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLCapitalPurposeType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLReportTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLReportTypeType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLSerialNoTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLSerialNoType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLStatusType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLGenStatusTypeһAmlɷʽ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_GEN_Program '0' + ///˹ + #define THOST_FTDC_GEN_HandWork '1' + + typedef char TThostFtdcAMLGenStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLSeqCodeTypeһҵʶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLSeqCodeType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLFileNameTypeһAMLļ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLFileNameType[257]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLMoneyTypeһϴǮʽ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcAMLMoneyType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLFileAmountTypeһϴǮʽ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcAMLFileAmountType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCFMMCKeyTypeһԿ(֤) + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCFMMCKeyType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCFMMCTokenTypeһ(֤) + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCFMMCTokenType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCFMMCKeyKindTypeһ̬Կ(֤) + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_CFMMCKK_REQUEST 'R' + ///CFMMCԶ + #define THOST_FTDC_CFMMCKK_AUTO 'A' + ///CFMMCֶ + #define THOST_FTDC_CFMMCKK_MANUAL 'M' + + typedef char TThostFtdcCFMMCKeyKindType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLReportNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAMLReportNameType[81]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDBFComdTypeTypeһDBF + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDBFComdTypeType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDBFComTimeTypeһDBFʱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDBFComTimeType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDBFComNoTypeһDBFˮ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDBFComNoType[17]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDBFFdNameTypeһDBFֶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDBFFdNameType[256]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDBFFdContentTypeһDBFֶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDBFFdContentType[256]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcIndividualNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcIndividualNameType[51]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCurrencyIDTypeһִ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCurrencyIDType[4]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCustNumberTypeһͻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCustNumberType[36]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrganCodeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOrganCodeType[36]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrganNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOrganNameType[71]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSuperOrganCodeTypeһϼ,ڻ˾ܲ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSuperOrganCodeType[12]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSubBranchIDTypeһ֧ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSubBranchIDType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSubBranchNameTypeһ֧ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSubBranchNameType[71]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBranchNetCodeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBranchNetCodeType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBranchNetNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBranchNetNameType[71]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrganFlagTypeһʶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOrganFlagType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankCodingForFutureTypeһжڻ˾ı + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankCodingForFutureType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankReturnCodeTypeһжԷĶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankReturnCodeType[7]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPlateReturnCodeTypeһתƽ̨ԷĶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPlateReturnCodeType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankSubBranchIDTypeһз֧ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankSubBranchIDType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureBranchIDTypeһڻ֧ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFutureBranchIDType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcReturnCodeTypeһش + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcReturnCodeType[7]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOperatorCodeTypeһԱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOperatorCodeType[17]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClearDepIDTypeһʻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcClearDepIDType[6]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClearBrchIDTypeһʻк + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcClearBrchIDType[6]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClearNameTypeһʻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcClearNameType[71]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankAccountNameTypeһʻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankAccountNameType[71]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvDepIDTypeһͶ˺Ż + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInvDepIDType[6]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvBrchIDTypeһͶк + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInvBrchIDType[6]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMessageFormatVersionTypeһϢʽ汾 + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcMessageFormatVersionType[36]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDigestTypeһժҪ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDigestType[36]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAuthenticDataTypeһ֤ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAuthenticDataType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPasswordKeyTypeһԿ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPasswordKeyType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureAccountNameTypeһڻʻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFutureAccountNameType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMobilePhoneTypeһֻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcMobilePhoneType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureMainKeyTypeһڻ˾Կ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFutureMainKeyType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureWorkKeyTypeһڻ˾Կ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFutureWorkKeyType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureTransKeyTypeһڻ˾Կ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFutureTransKeyType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankMainKeyTypeһԿ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankMainKeyType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankWorkKeyTypeһйԿ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankWorkKeyType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankTransKeyTypeһдԿ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankTransKeyType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankServerDescriptionTypeһзϢ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankServerDescriptionType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAddInfoTypeһϢ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAddInfoType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDescrInfoForReturnCodeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDescrInfoForReturnCodeType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCountryCodeTypeһҴ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCountryCodeType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSerialTypeһˮ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcSerialType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPlateSerialTypeһƽ̨ˮ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcPlateSerialType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankSerialTypeһˮ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankSerialType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCorrectSerialTypeһˮ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcCorrectSerialType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureSerialTypeһڻ˾ˮ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcFutureSerialType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcApplicationIDTypeһӦñʶ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcApplicationIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankProxyIDTypeһдʶ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcBankProxyIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBTCoreIDTypeһתʺϵͳʶ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcFBTCoreIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcServerPortTypeһ˿ں + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcServerPortType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRepealedTimesTypeһѾ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcRepealedTimesType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRepealTimeIntervalTypeһʱ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcRepealTimeIntervalType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTotalTimesTypeһÿۼתʴ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcTotalTimesType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBTRequestIDTypeһID + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcFBTRequestIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTIDTypeһID + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcTIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeAmountTypeһ׽Ԫ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcTradeAmountType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCustFeeTypeһӦտͻãԪ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcCustFeeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureFeeTypeһӦڻ˾ãԪ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcFutureFeeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSingleMaxAmtTypeһ޶ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcSingleMaxAmtType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSingleMinAmtTypeһ޶ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcSingleMinAmtType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTotalAmtTypeһÿۼתʶ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcTotalAmtType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCertificationTypeTypeһ֤ + ///////////////////////////////////////////////////////////////////////// + ///֤ + #define THOST_FTDC_CFT_IDCard '0' + /// + #define THOST_FTDC_CFT_Passport '1' + ///֤ + #define THOST_FTDC_CFT_OfficerIDCard '2' + ///ʿ֤ + #define THOST_FTDC_CFT_SoldierIDCard '3' + ///֤ + #define THOST_FTDC_CFT_HomeComingCard '4' + ///ڲ + #define THOST_FTDC_CFT_HouseholdRegister '5' + ///Ӫҵִպ + #define THOST_FTDC_CFT_LicenseNo '6' + ///֤֯ + #define THOST_FTDC_CFT_InstitutionCodeCard '7' + ///ʱӪҵִպ + #define THOST_FTDC_CFT_TempLicenseNo '8' + ///ҵǼ֤ + #define THOST_FTDC_CFT_NoEnterpriseLicenseNo '9' + ///֤ + #define THOST_FTDC_CFT_OtherCard 'x' + ///ܲ + #define THOST_FTDC_CFT_SuperDepAgree 'a' + + typedef char TThostFtdcCertificationTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFileBusinessCodeTypeһļҵ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_FBC_Others '0' + ///ת˽ϸ + #define THOST_FTDC_FBC_TransferDetails '1' + ///ͻ˻״̬ + #define THOST_FTDC_FBC_CustAccStatus '2' + ///˻ཻϸ + #define THOST_FTDC_FBC_AccountTradeDetails '3' + ///ڻ˻Ϣϸ + #define THOST_FTDC_FBC_FutureAccountChangeInfoDetails '4' + ///ͻʽ̨ϸ + #define THOST_FTDC_FBC_CustMoneyDetail '5' + ///ͻϢϸ + #define THOST_FTDC_FBC_CustCancelAccountInfo '6' + ///ͻʽ˽ + #define THOST_FTDC_FBC_CustMoneyResult '7' + ///쳣ļ + #define THOST_FTDC_FBC_OthersExceptionResult '8' + ///ͻϢϸ + #define THOST_FTDC_FBC_CustInterestNetMoneyDetails '9' + ///ͻʽϸ + #define THOST_FTDC_FBC_CustMoneySendAndReceiveDetails 'a' + ///˴ʽջ + #define THOST_FTDC_FBC_CorporationMoneyTotal 'b' + ///ʽջ + #define THOST_FTDC_FBC_MainbodyMoneyTotal 'c' + ///ܷƽ + #define THOST_FTDC_FBC_MainPartMonitorData 'd' + ///б + #define THOST_FTDC_FBC_PreparationMoney 'e' + ///Эʽ + #define THOST_FTDC_FBC_BankMoneyMonitorData 'f' + + typedef char TThostFtdcFileBusinessCodeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCashExchangeCodeTypeһ㳮־ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_CEC_Exchange '1' + /// + #define THOST_FTDC_CEC_Cash '2' + + typedef char TThostFtdcCashExchangeCodeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcYesNoIndicatorTypeһǻʶ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_YNI_Yes '0' + /// + #define THOST_FTDC_YNI_No '1' + + typedef char TThostFtdcYesNoIndicatorType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBanlanceTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + ///ǰ + #define THOST_FTDC_BLT_CurrentMoney '0' + /// + #define THOST_FTDC_BLT_UsableMoney '1' + ///ȡ + #define THOST_FTDC_BLT_FetchableMoney '2' + /// + #define THOST_FTDC_BLT_FreezeMoney '3' + + typedef char TThostFtdcBanlanceTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcGenderTypeһԱ + ///////////////////////////////////////////////////////////////////////// + ///δ֪״̬ + #define THOST_FTDC_GD_Unknown '0' + /// + #define THOST_FTDC_GD_Male '1' + ///Ů + #define THOST_FTDC_GD_Female '2' + + typedef char TThostFtdcGenderType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFeePayFlagTypeһ֧־ + ///////////////////////////////////////////////////////////////////////// + ///淽֧ + #define THOST_FTDC_FPF_BEN '0' + ///ɷͷ֧ + #define THOST_FTDC_FPF_OUR '1' + ///ɷͷ֧ķã淽֧ܵķ + #define THOST_FTDC_FPF_SHA '2' + + typedef char TThostFtdcFeePayFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPassWordKeyTypeTypeһԿ + ///////////////////////////////////////////////////////////////////////// + ///Կ + #define THOST_FTDC_PWKT_ExchangeKey '0' + ///Կ + #define THOST_FTDC_PWKT_PassWordKey '1' + ///MACԿ + #define THOST_FTDC_PWKT_MACKey '2' + ///Կ + #define THOST_FTDC_PWKT_MessageKey '3' + + typedef char TThostFtdcPassWordKeyTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBTPassWordTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + ///ѯ + #define THOST_FTDC_PWT_Query '0' + ///ȡ + #define THOST_FTDC_PWT_Fetch '1' + ///ת + #define THOST_FTDC_PWT_Transfer '2' + /// + #define THOST_FTDC_PWT_Trade '3' + + typedef char TThostFtdcFBTPassWordTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBTEncryModeTypeһܷʽ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_EM_NoEncry '0' + ///DES + #define THOST_FTDC_EM_DES '1' + ///3DES + #define THOST_FTDC_EM_3DES '2' + + typedef char TThostFtdcFBTEncryModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankRepealFlagTypeһг־ + ///////////////////////////////////////////////////////////////////////// + ///Զ + #define THOST_FTDC_BRF_BankNotNeedRepeal '0' + ///дԶ + #define THOST_FTDC_BRF_BankWaitingRepeal '1' + ///Զ + #define THOST_FTDC_BRF_BankBeenRepealed '2' + + typedef char TThostFtdcBankRepealFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBrokerRepealFlagTypeһ̳־ + ///////////////////////////////////////////////////////////////////////// + ///Զ + #define THOST_FTDC_BRORF_BrokerNotNeedRepeal '0' + ///̴Զ + #define THOST_FTDC_BRORF_BrokerWaitingRepeal '1' + ///Զ + #define THOST_FTDC_BRORF_BrokerBeenRepealed '2' + + typedef char TThostFtdcBrokerRepealFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstitutionTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_TS_Bank '0' + /// + #define THOST_FTDC_TS_Future '1' + ///ȯ + #define THOST_FTDC_TS_Store '2' + + typedef char TThostFtdcInstitutionTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLastFragmentTypeһƬ־ + ///////////////////////////////////////////////////////////////////////// + ///Ƭ + #define THOST_FTDC_LF_Yes '0' + ///Ƭ + #define THOST_FTDC_LF_No '1' + + typedef char TThostFtdcLastFragmentType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankAccStatusTypeһ˻״̬ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_BAS_Normal '0' + /// + #define THOST_FTDC_BAS_Freeze '1' + ///ʧ + #define THOST_FTDC_BAS_ReportLoss '2' + + typedef char TThostFtdcBankAccStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMoneyAccountStatusTypeһʽ˻״̬ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_MAS_Normal '0' + /// + #define THOST_FTDC_MAS_Cancel '1' + + typedef char TThostFtdcMoneyAccountStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcManageStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///ָ + #define THOST_FTDC_MSS_Point '0' + ///Ԥָ + #define THOST_FTDC_MSS_PrePoint '1' + ///ָ + #define THOST_FTDC_MSS_CancelPoint '2' + + typedef char TThostFtdcManageStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSystemTypeTypeһӦϵͳ + ///////////////////////////////////////////////////////////////////////// + ///ת + #define THOST_FTDC_SYT_FutureBankTransfer '0' + ///֤ת + #define THOST_FTDC_SYT_StockBankTransfer '1' + /// + #define THOST_FTDC_SYT_TheThirdPartStore '2' + + typedef char TThostFtdcSystemTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTxnEndFlagTypeһתʻת־ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_TEF_NormalProcessing '0' + ///ɹ + #define THOST_FTDC_TEF_Success '1' + ///ʧܽ + #define THOST_FTDC_TEF_Failed '2' + ///쳣 + #define THOST_FTDC_TEF_Abnormal '3' + ///˹쳣 + #define THOST_FTDC_TEF_ManualProcessedForException '4' + ///ͨѶ쳣 ˹ + #define THOST_FTDC_TEF_CommuFailedNeedManualProcess '5' + ///ϵͳ˹ + #define THOST_FTDC_TEF_SysErrorNeedManualProcess '6' + + typedef char TThostFtdcTxnEndFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProcessStatusTypeһתʷ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_PSS_NotProcess '0' + ///ʼ + #define THOST_FTDC_PSS_StartProcess '1' + /// + #define THOST_FTDC_PSS_Finished '2' + + typedef char TThostFtdcProcessStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCustTypeTypeһͻ + ///////////////////////////////////////////////////////////////////////// + ///Ȼ + #define THOST_FTDC_CUSTT_Person '0' + /// + #define THOST_FTDC_CUSTT_Institution '1' + + typedef char TThostFtdcCustTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBTTransferDirectionTypeһתʷ + ///////////////////////////////////////////////////////////////////////// + ///תڻ + #define THOST_FTDC_FBTTD_FromBankToFuture '1' + ///ڻת + #define THOST_FTDC_FBTTD_FromFutureToBank '2' + + typedef char TThostFtdcFBTTransferDirectionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOpenOrDestroyTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_OOD_Open '1' + /// + #define THOST_FTDC_OOD_Destroy '0' + + typedef char TThostFtdcOpenOrDestroyType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAvailabilityFlagTypeһЧ־ + ///////////////////////////////////////////////////////////////////////// + ///δȷ + #define THOST_FTDC_AVAF_Invalid '0' + ///Ч + #define THOST_FTDC_AVAF_Valid '1' + /// + #define THOST_FTDC_AVAF_Repeal '2' + + typedef char TThostFtdcAvailabilityFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrganTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + ///д + #define THOST_FTDC_OT_Bank '1' + ///ǰ + #define THOST_FTDC_OT_Future '2' + ///תƽ̨ + #define THOST_FTDC_OT_PlateForm '9' + + typedef char TThostFtdcOrganTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrganLevelTypeһ + ///////////////////////////////////////////////////////////////////////// + ///лܲ + #define THOST_FTDC_OL_HeadQuarters '1' + ///зĻڻ˾Ӫҵ + #define THOST_FTDC_OL_Branch '2' + + typedef char TThostFtdcOrganLevelType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProtocalIDTypeһЭ + ///////////////////////////////////////////////////////////////////////// + ///Э + #define THOST_FTDC_PID_FutureProtocal '0' + ///Э + #define THOST_FTDC_PID_ICBCProtocal '1' + ///ũЭ + #define THOST_FTDC_PID_ABCProtocal '2' + ///йЭ + #define THOST_FTDC_PID_CBCProtocal '3' + ///Э + #define THOST_FTDC_PID_CCBProtocal '4' + ///Э + #define THOST_FTDC_PID_BOCOMProtocal '5' + ///תƽ̨Э + #define THOST_FTDC_PID_FBTPlateFormProtocal 'X' + + typedef char TThostFtdcProtocalIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcConnectModeTypeһ׽ӷʽ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_CM_ShortConnect '0' + /// + #define THOST_FTDC_CM_LongConnect '1' + + typedef char TThostFtdcConnectModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSyncModeTypeһ׽ͨŷʽ + ///////////////////////////////////////////////////////////////////////// + ///첽 + #define THOST_FTDC_SRM_ASync '0' + ///ͬ + #define THOST_FTDC_SRM_Sync '1' + + typedef char TThostFtdcSyncModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankAccTypeTypeһʺ + ///////////////////////////////////////////////////////////////////////// + ///д + #define THOST_FTDC_BAT_BankBook '1' + /// + #define THOST_FTDC_BAT_SavingCard '2' + ///ÿ + #define THOST_FTDC_BAT_CreditCard '3' + + typedef char TThostFtdcBankAccTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureAccTypeTypeһڻ˾ʺ + ///////////////////////////////////////////////////////////////////////// + ///д + #define THOST_FTDC_FAT_BankBook '1' + /// + #define THOST_FTDC_FAT_SavingCard '2' + ///ÿ + #define THOST_FTDC_FAT_CreditCard '3' + + typedef char TThostFtdcFutureAccTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOrganStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_OS_Ready '0' + ///ǩ + #define THOST_FTDC_OS_CheckIn '1' + ///ǩ + #define THOST_FTDC_OS_CheckOut '2' + ///ļ + #define THOST_FTDC_OS_CheckFileArrived '3' + /// + #define THOST_FTDC_OS_CheckDetail '4' + /// + #define THOST_FTDC_OS_DayEndClean '5' + ///ע + #define THOST_FTDC_OS_Invalid '9' + + typedef char TThostFtdcOrganStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCCBFeeModeTypeһշģʽ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_CCBFM_ByAmount '1' + ///¿ + #define THOST_FTDC_CCBFM_ByMonth '2' + + typedef char TThostFtdcCCBFeeModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCommApiTypeTypeһͨѶAPI + ///////////////////////////////////////////////////////////////////////// + ///ͻ + #define THOST_FTDC_CAPIT_Client '1' + /// + #define THOST_FTDC_CAPIT_Server '2' + ///ϵͳUserApi + #define THOST_FTDC_CAPIT_UserApi '3' + + typedef char TThostFtdcCommApiTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcServiceIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcServiceIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcServiceLineNoTypeһ· + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcServiceLineNoType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcServiceNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcServiceNameType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLinkStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///Ѿ + #define THOST_FTDC_LS_Connected '1' + ///û + #define THOST_FTDC_LS_Disconnected '2' + + typedef char TThostFtdcLinkStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCommApiPointerTypeһͨѶAPIָ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcCommApiPointerType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPwdFlagTypeһ˶Ա־ + ///////////////////////////////////////////////////////////////////////// + ///˶ + #define THOST_FTDC_BPWDF_NoCheck '0' + ///ĺ˶ + #define THOST_FTDC_BPWDF_BlankCheck '1' + ///ĺ˶ + #define THOST_FTDC_BPWDF_EncryptCheck '2' + + typedef char TThostFtdcPwdFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSecuAccTypeTypeһڻʺ + ///////////////////////////////////////////////////////////////////////// + ///ʽʺ + #define THOST_FTDC_SAT_AccountID '1' + ///ʽ𿨺 + #define THOST_FTDC_SAT_CardID '2' + ///Ϻɶʺ + #define THOST_FTDC_SAT_SHStockholderID '3' + ///ڹɶʺ + #define THOST_FTDC_SAT_SZStockholderID '4' + + typedef char TThostFtdcSecuAccTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTransferStatusTypeһת˽״̬ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_TRFS_Normal '0' + /// + #define THOST_FTDC_TRFS_Repealed '1' + + typedef char TThostFtdcTransferStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSponsorTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_SPTYPE_Broker '0' + /// + #define THOST_FTDC_SPTYPE_Bank '1' + + typedef char TThostFtdcSponsorTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcReqRspTypeTypeһӦ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_REQRSP_Request '0' + ///Ӧ + #define THOST_FTDC_REQRSP_Response '1' + + typedef char TThostFtdcReqRspTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBTUserEventTypeTypeһתû¼ + ///////////////////////////////////////////////////////////////////////// + ///ǩ + #define THOST_FTDC_FBTUET_SignIn '0' + ///תڻ + #define THOST_FTDC_FBTUET_FromBankToFuture '1' + ///ڻת + #define THOST_FTDC_FBTUET_FromFutureToBank '2' + /// + #define THOST_FTDC_FBTUET_OpenAccount '3' + /// + #define THOST_FTDC_FBTUET_CancelAccount '4' + ///˻ + #define THOST_FTDC_FBTUET_ChangeAccount '5' + ///תڻ + #define THOST_FTDC_FBTUET_RepealFromBankToFuture '6' + ///ڻת + #define THOST_FTDC_FBTUET_RepealFromFutureToBank '7' + ///ѯ˻ + #define THOST_FTDC_FBTUET_QueryBankAccount '8' + ///ѯڻ˻ + #define THOST_FTDC_FBTUET_QueryFutureAccount '9' + ///ǩ + #define THOST_FTDC_FBTUET_SignOut 'A' + ///Կͬ + #define THOST_FTDC_FBTUET_SyncKey 'B' + /// + #define THOST_FTDC_FBTUET_Other 'Z' + + typedef char TThostFtdcFBTUserEventTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankIDByBankTypeһԼı + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankIDByBankType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankOperNoTypeһвԱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankOperNoType[4]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankCustNoTypeһпͻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankCustNoType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDBOPSeqNoTypeһк + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcDBOPSeqNoType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTableNameTypeһFBT + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTableNameType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPKNameTypeһFBT + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPKNameType[201]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPKValueTypeһFBTֵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPKValueType[501]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDBOperationTypeһ¼ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_DBOP_Insert '0' + /// + #define THOST_FTDC_DBOP_Update '1' + ///ɾ + #define THOST_FTDC_DBOP_Delete '2' + + typedef char TThostFtdcDBOperationType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSyncFlagTypeһͬ + ///////////////////////////////////////////////////////////////////////// + ///ͬ + #define THOST_FTDC_SYNF_Yes '0' + ///δͬ + #define THOST_FTDC_SYNF_No '1' + + typedef char TThostFtdcSyncFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTargetIDTypeһͬĿ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTargetIDType[4]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSyncTypeTypeһͬ + ///////////////////////////////////////////////////////////////////////// + ///һͬ + #define THOST_FTDC_SYNT_OneOffSync '0' + ///ʱͬ + #define THOST_FTDC_SYNT_TimerSync '1' + ///ʱȫͬ + #define THOST_FTDC_SYNT_TimerFullSync '2' + + typedef char TThostFtdcSyncTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBETimeTypeһֻʱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBETimeType[7]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEBankNoTypeһк + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBEBankNoType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBECertNoTypeһƾ֤ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBECertNoType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExDirectionTypeһ㷽 + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_FBEDIR_Settlement '0' + ///ۻ + #define THOST_FTDC_FBEDIR_Sale '1' + + typedef char TThostFtdcExDirectionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEBankAccountTypeһ˻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBEBankAccountType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEBankAccountNameTypeһ˻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBEBankAccountNameType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEAmtTypeһֻ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcFBEAmtType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEBusinessTypeTypeһҵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBEBusinessTypeType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEPostScriptTypeһ㸽 + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBEPostScriptType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBERemarkTypeһ㱸ע + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBERemarkType[71]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExRateTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcExRateType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEResultFlagTypeһɹ־ + ///////////////////////////////////////////////////////////////////////// + ///ɹ + #define THOST_FTDC_FBERES_Success '0' + ///˻ + #define THOST_FTDC_FBERES_InsufficientBalance '1' + ///׽δ֪ + #define THOST_FTDC_FBERES_UnknownTrading '8' + ///ʧ + #define THOST_FTDC_FBERES_Fail 'x' + + typedef char TThostFtdcFBEResultFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBERtnMsgTypeһ㷵Ϣ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBERtnMsgType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEExtendMsgTypeһչϢ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBEExtendMsgType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEBusinessSerialTypeһˮ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBEBusinessSerialType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBESystemSerialTypeһˮ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBESystemSerialType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBETotalExCntTypeһ㽻ܱ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcFBETotalExCntType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEExchStatusTypeһ㽻״̬ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_FBEES_Normal '0' + ///ط + #define THOST_FTDC_FBEES_ReExchange '1' + + typedef char TThostFtdcFBEExchStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEFileFlagTypeһļ־ + ///////////////////////////////////////////////////////////////////////// + ///ݰ + #define THOST_FTDC_FBEFG_DataPackage '0' + ///ļ + #define THOST_FTDC_FBEFG_File '1' + + typedef char TThostFtdcFBEFileFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEAlreadyTradeTypeһѽױ־ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_FBEAT_NotTrade '0' + ///ѽ + #define THOST_FTDC_FBEAT_Trade '1' + + typedef char TThostFtdcFBEAlreadyTradeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEOpenBankTypeһ˻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBEOpenBankType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEUserEventTypeTypeһڻû¼ + ///////////////////////////////////////////////////////////////////////// + ///ǩ + #define THOST_FTDC_FBEUET_SignIn '0' + /// + #define THOST_FTDC_FBEUET_Exchange '1' + ///ط + #define THOST_FTDC_FBEUET_ReExchange '2' + ///˻ѯ + #define THOST_FTDC_FBEUET_QueryBankAccount '3' + ///ϸѯ + #define THOST_FTDC_FBEUET_QueryExchDetial '4' + ///ܲѯ + #define THOST_FTDC_FBEUET_QueryExchSummary '5' + ///ʲѯ + #define THOST_FTDC_FBEUET_QueryExchRate '6' + ///ļ֪ͨ + #define THOST_FTDC_FBEUET_CheckBankAccount '7' + ///ǩ + #define THOST_FTDC_FBEUET_SignOut '8' + /// + #define THOST_FTDC_FBEUET_Other 'Z' + + typedef char TThostFtdcFBEUserEventTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEFileNameTypeһļ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBEFileNameType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEBatchSerialTypeһκ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFBEBatchSerialType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBEReqFlagTypeһ㷢ͱ־ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_FBERF_UnProcessed '0' + ///ȴ + #define THOST_FTDC_FBERF_WaitSend '1' + ///ͳɹ + #define THOST_FTDC_FBERF_SendSuccess '2' + ///ʧ + #define THOST_FTDC_FBERF_SendFailed '3' + ///ȴط + #define THOST_FTDC_FBERF_WaitReSend '4' + + typedef char TThostFtdcFBEReqFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcNotifyClassTypeһ֪ͨ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_NC_NOERROR '0' + ///ʾ + #define THOST_FTDC_NC_Warn '1' + ///׷ + #define THOST_FTDC_NC_Call '2' + ///ǿƽ + #define THOST_FTDC_NC_Force '3' + /// + #define THOST_FTDC_NC_CHUANCANG '4' + ///쳣 + #define THOST_FTDC_NC_Exception '5' + + typedef char TThostFtdcNotifyClassType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRiskNofityInfoTypeһͻ֪ͨϢ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRiskNofityInfoType[257]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcForceCloseSceneIdTypeһǿƽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcForceCloseSceneIdType[24]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcForceCloseTypeTypeһǿƽ + ///////////////////////////////////////////////////////////////////////// + ///ֹǿƽ + #define THOST_FTDC_FCT_Manual '0' + ///һͶ߸ǿƽ + #define THOST_FTDC_FCT_Single '1' + ///Ͷ߸ǿƽ + #define THOST_FTDC_FCT_Group '2' + + typedef char TThostFtdcForceCloseTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInstrumentIDsTypeһƷ,+ָ,cu+zn + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInstrumentIDsType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRiskNotifyMethodTypeһ֪ͨ; + ///////////////////////////////////////////////////////////////////////// + ///ϵͳ֪ͨ + #define THOST_FTDC_RNM_System '0' + ///֪ͨ + #define THOST_FTDC_RNM_SMS '1' + ///ʼ֪ͨ + #define THOST_FTDC_RNM_EMail '2' + ///˹֪ͨ + #define THOST_FTDC_RNM_Manual '3' + + typedef char TThostFtdcRiskNotifyMethodType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRiskNotifyStatusTypeһ֪ͨ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_RNS_NotGen '0' + ///δ + #define THOST_FTDC_RNS_Generated '1' + ///ʧ + #define THOST_FTDC_RNS_SendError '2' + ///ѷδ + #define THOST_FTDC_RNS_SendOk '3' + ///ѽδȷ + #define THOST_FTDC_RNS_Received '4' + ///ȷ + #define THOST_FTDC_RNS_Confirmed '5' + + typedef char TThostFtdcRiskNotifyStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRiskUserEventTypeһû¼ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_RUE_ExportData '0' + + typedef char TThostFtdcRiskUserEventType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcParamIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcParamIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcParamNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcParamNameType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcParamValueTypeһֵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcParamValueType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcConditionalOrderSortTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + ///ʹ¼ + #define THOST_FTDC_COST_LastPriceAsc '0' + ///ʹ¼۽ + #define THOST_FTDC_COST_LastPriceDesc '1' + ///ʹ + #define THOST_FTDC_COST_AskPriceAsc '2' + ///ʹ۽ + #define THOST_FTDC_COST_AskPriceDesc '3' + ///ʹ + #define THOST_FTDC_COST_BidPriceAsc '4' + ///ʹ۽ + #define THOST_FTDC_COST_BidPriceDesc '5' + + typedef char TThostFtdcConditionalOrderSortTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSendTypeTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_UOAST_NoSend '0' + ///ѷ + #define THOST_FTDC_UOAST_Sended '1' + /// + #define THOST_FTDC_UOAST_Generated '2' + ///ʧ + #define THOST_FTDC_UOAST_SendFail '3' + ///ճɹ + #define THOST_FTDC_UOAST_Success '4' + ///ʧ + #define THOST_FTDC_UOAST_Fail '5' + ///ȡ + #define THOST_FTDC_UOAST_Cancel '6' + + typedef char TThostFtdcSendTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClientIDStatusTypeһױ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_UOACS_NoApply '1' + ///ύ + #define THOST_FTDC_UOACS_Submited '2' + ///ѷ + #define THOST_FTDC_UOACS_Sended '3' + /// + #define THOST_FTDC_UOACS_Success '4' + ///ܾ + #define THOST_FTDC_UOACS_Refuse '5' + ///ѳ + #define THOST_FTDC_UOACS_Cancel '6' + + typedef char TThostFtdcClientIDStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcIndustryIDTypeһҵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcIndustryIDType[17]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcQuestionIDTypeһϢ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcQuestionIDType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcQuestionContentTypeһϢ˵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcQuestionContentType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOptionIDTypeһѡ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOptionIDType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOptionContentTypeһѡ˵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOptionContentType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcQuestionTypeTypeһϢ + ///////////////////////////////////////////////////////////////////////// + ///ѡ + #define THOST_FTDC_QT_Radio '1' + ///ѡ + #define THOST_FTDC_QT_Option '2' + /// + #define THOST_FTDC_QT_Blank '3' + + typedef char TThostFtdcQuestionTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProcessIDTypeһҵˮ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcProcessIDType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSeqNoTypeһˮ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcSeqNoType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUOAProcessStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUOAProcessStatusType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProcessTypeTypeһ̹ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcProcessTypeType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBusinessTypeTypeһҵ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_BT_Request '1' + ///Ӧ + #define THOST_FTDC_BT_Response '2' + ///֪ͨ + #define THOST_FTDC_BT_Notice '3' + + typedef char TThostFtdcBusinessTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCfmmcReturnCodeTypeһķ + ///////////////////////////////////////////////////////////////////////// + ///ɹ + #define THOST_FTDC_CRC_Success '0' + ///ÿͻѾڴ + #define THOST_FTDC_CRC_Working '1' + ///пͻϼʧ + #define THOST_FTDC_CRC_InfoFail '2' + ///ʵƼʧ + #define THOST_FTDC_CRC_IDCardFail '3' + /// + #define THOST_FTDC_CRC_OtherFail '4' + + typedef char TThostFtdcCfmmcReturnCodeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExReturnCodeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcExReturnCodeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClientTypeTypeһͻ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_CfMMCCT_All '0' + /// + #define THOST_FTDC_CfMMCCT_Person '1' + ///λ + #define THOST_FTDC_CfMMCCT_Company '2' + /// + #define THOST_FTDC_CfMMCCT_Other '3' + ///ⷨ + #define THOST_FTDC_CfMMCCT_SpecialOrgan '4' + ///ʹܻ + #define THOST_FTDC_CfMMCCT_Asset '5' + + typedef char TThostFtdcClientTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExchangeIDTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + ///Ϻڻ + #define THOST_FTDC_EIDT_SHFE 'S' + ///֣Ʒ + #define THOST_FTDC_EIDT_CZCE 'Z' + ///Ʒ + #define THOST_FTDC_EIDT_DCE 'D' + ///йڻ + #define THOST_FTDC_EIDT_CFFEX 'J' + ///ϺԴĹɷ޹˾ + #define THOST_FTDC_EIDT_INE 'N' + + typedef char TThostFtdcExchangeIDTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExClientIDTypeTypeһױ + ///////////////////////////////////////////////////////////////////////// + ///ױ + #define THOST_FTDC_ECIDT_Hedge '1' + /// + #define THOST_FTDC_ECIDT_Arbitrage '2' + ///Ͷ + #define THOST_FTDC_ECIDT_Speculation '3' + + typedef char TThostFtdcExClientIDTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClientClassifyTypeһͻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcClientClassifyType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUOAOrganTypeTypeһλ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUOAOrganTypeType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUOACountryCodeTypeһҴ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUOACountryCodeType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAreaCodeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAreaCodeType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFuturesIDTypeһΪͻĴ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFuturesIDType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCffmcDateTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCffmcDateType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCffmcTimeTypeһʱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCffmcTimeType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcNocIDTypeһ֯ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcNocIDType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUpdateFlagTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_UF_NoUpdate '0' + ///ȫϢɹ + #define THOST_FTDC_UF_Success '1' + ///ȫϢʧ + #define THOST_FTDC_UF_Fail '2' + ///½ױɹ + #define THOST_FTDC_UF_TCSuccess '3' + ///½ױʧ + #define THOST_FTDC_UF_TCFail '4' + ///Ѷ + #define THOST_FTDC_UF_Cancel '5' + + typedef char TThostFtdcUpdateFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcApplyOperateIDTypeһ붯 + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_AOID_OpenInvestor '1' + ///޸Ϣ + #define THOST_FTDC_AOID_ModifyIDCard '2' + ///޸һϢ + #define THOST_FTDC_AOID_ModifyNoIDCard '3' + ///뽻ױ + #define THOST_FTDC_AOID_ApplyTradingCode '4' + ///ױ + #define THOST_FTDC_AOID_CancelTradingCode '5' + /// + #define THOST_FTDC_AOID_CancelInvestor '6' + ///˻ + #define THOST_FTDC_AOID_FreezeAccount '8' + ///˻ + #define THOST_FTDC_AOID_ActiveFreezeAccount '9' + + typedef char TThostFtdcApplyOperateIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcApplyStatusIDTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δȫ + #define THOST_FTDC_ASID_NoComplete '1' + ///ύ + #define THOST_FTDC_ASID_Submited '2' + /// + #define THOST_FTDC_ASID_Checked '3' + ///Ѿܾ + #define THOST_FTDC_ASID_Refused '4' + ///ɾ + #define THOST_FTDC_ASID_Deleted '5' + + typedef char TThostFtdcApplyStatusIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSendMethodTypeһͷʽ + ///////////////////////////////////////////////////////////////////////// + ///ļ + #define THOST_FTDC_UOASM_ByAPI '1' + ///ӷ + #define THOST_FTDC_UOASM_ByFile '2' + + typedef char TThostFtdcSendMethodType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcEventTypeTypeһҵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcEventTypeType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcEventModeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_EvM_ADD '1' + ///޸ + #define THOST_FTDC_EvM_UPDATE '2' + ///ɾ + #define THOST_FTDC_EvM_DELETE '3' + /// + #define THOST_FTDC_EvM_CHECK '4' + /// + #define THOST_FTDC_EvM_COPY '5' + ///ע + #define THOST_FTDC_EvM_CANCEL '6' + /// + #define THOST_FTDC_EvM_Reverse '7' + + typedef char TThostFtdcEventModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUOAAutoSendTypeһͳһԶ + ///////////////////////////////////////////////////////////////////////// + ///ԶͲ + #define THOST_FTDC_UOAA_ASR '1' + ///ԶͣԶ + #define THOST_FTDC_UOAA_ASNR '2' + ///ԶͣԶ + #define THOST_FTDC_UOAA_NSAR '3' + ///ԶͣҲԶ + #define THOST_FTDC_UOAA_NSR '4' + + typedef char TThostFtdcUOAAutoSendType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcQueryDepthTypeһѯ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcQueryDepthType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDataCenterIDTypeһĴ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcDataCenterIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFlowIDTypeһID + ///////////////////////////////////////////////////////////////////////// + ///Ͷ߶ӦͶ + #define THOST_FTDC_EvM_InvestorGroupFlow '1' + ///Ͷ + #define THOST_FTDC_EvM_InvestorRate '2' + ///Ͷģϵ + #define THOST_FTDC_EvM_InvestorCommRateModel '3' + + typedef char TThostFtdcFlowIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCheckLevelTypeһ˼ + ///////////////////////////////////////////////////////////////////////// + ///㼶 + #define THOST_FTDC_CL_Zero '0' + ///һ + #define THOST_FTDC_CL_One '1' + /// + #define THOST_FTDC_CL_Two '2' + + typedef char TThostFtdcCheckLevelType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCheckNoTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcCheckNoType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCheckStatusTypeһ˼ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_CHS_Init '0' + /// + #define THOST_FTDC_CHS_Checking '1' + ///Ѹ + #define THOST_FTDC_CHS_Checked '2' + ///ܾ + #define THOST_FTDC_CHS_Refuse '3' + /// + #define THOST_FTDC_CHS_Cancel '4' + + typedef char TThostFtdcCheckStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUsedStatusTypeһЧ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δЧ + #define THOST_FTDC_CHU_Unused '0' + ///Ч + #define THOST_FTDC_CHU_Used '1' + ///Чʧ + #define THOST_FTDC_CHU_Fail '2' + + typedef char TThostFtdcUsedStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRateTemplateNameTypeһģ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRateTemplateNameType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPropertyStringTypeһڲѯͶֶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPropertyStringType[2049]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankAcountOriginTypeһ˻Դ + ///////////////////////////////////////////////////////////////////////// + ///ֹ¼ + #define THOST_FTDC_BAO_ByAccProperty '0' + ///ת + #define THOST_FTDC_BAO_ByFBTransfer '1' + + typedef char TThostFtdcBankAcountOriginType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMonthBillTradeSumTypeһ㵥±ɽܷʽ + ///////////////////////////////////////////////////////////////////////// + ///ͬͬԼ + #define THOST_FTDC_MBTS_ByInstrument '0' + ///ͬͬԼͬ۸ + #define THOST_FTDC_MBTS_ByDayInsPrc '1' + ///ͬԼ + #define THOST_FTDC_MBTS_ByDayIns '2' + + typedef char TThostFtdcMonthBillTradeSumType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFBTTradeCodeEnumTypeһڽ״ö + ///////////////////////////////////////////////////////////////////////// + ///зתڻ + #define THOST_FTDC_FTC_BankLaunchBankToBroker '102001' + ///ڻתڻ + #define THOST_FTDC_FTC_BrokerLaunchBankToBroker '202001' + ///зڻת + #define THOST_FTDC_FTC_BankLaunchBrokerToBank '102002' + ///ڻڻת + #define THOST_FTDC_FTC_BrokerLaunchBrokerToBank '202002' + + typedef char TThostFtdcFBTTradeCodeEnumType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRateTemplateIDTypeһģʹ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRateTemplateIDType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRiskRateTypeһն + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRiskRateType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTimestampTypeһʱ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcTimestampType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvestorIDRuleNameTypeһŶι + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInvestorIDRuleNameType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvestorIDRuleExprTypeһŶιʽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInvestorIDRuleExprType[513]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLastDriftTypeһϴOTPƯֵ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcLastDriftType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLastSuccessTypeһϴOTPɹֵ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcLastSuccessType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAuthKeyTypeһԿ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAuthKeyType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSerialNumberTypeһк + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSerialNumberType[17]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOTPTypeTypeһ̬ + ///////////////////////////////////////////////////////////////////////// + ///޶̬ + #define THOST_FTDC_OTP_NONE '0' + ///ʱ + #define THOST_FTDC_OTP_TOTP '1' + + typedef char TThostFtdcOTPTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOTPVendorsIDTypeһ̬ṩ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOTPVendorsIDType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOTPVendorsNameTypeһ̬ṩ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOTPVendorsNameType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOTPStatusTypeһ̬״̬ + ///////////////////////////////////////////////////////////////////////// + ///δʹ + #define THOST_FTDC_OTPS_Unused '0' + ///ʹ + #define THOST_FTDC_OTPS_Used '1' + ///ע + #define THOST_FTDC_OTPS_Disuse '2' + + typedef char TThostFtdcOTPStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBrokerUserTypeTypeһù˾û + ///////////////////////////////////////////////////////////////////////// + ///Ͷ + #define THOST_FTDC_BUT_Investor '1' + ///Ա + #define THOST_FTDC_BUT_BrokerUser '2' + + typedef char TThostFtdcBrokerUserTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFutureTypeTypeһڻ + ///////////////////////////////////////////////////////////////////////// + ///Ʒڻ + #define THOST_FTDC_FUTT_Commodity '1' + ///ڻ + #define THOST_FTDC_FUTT_Financial '2' + + typedef char TThostFtdcFutureTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundEventTypeTypeһʽ + ///////////////////////////////////////////////////////////////////////// + ///ת޶ + #define THOST_FTDC_FET_Restriction '0' + ///ת޶ + #define THOST_FTDC_FET_TodayRestriction '1' + ///ˮ + #define THOST_FTDC_FET_Transfer '2' + ///ʽ𶳽 + #define THOST_FTDC_FET_Credit '3' + ///Ͷ߿ʽ + #define THOST_FTDC_FET_InvestorWithdrawAlm '4' + ///ʻת޶ + #define THOST_FTDC_FET_BankRestriction '5' + ///ǩԼ˻ + #define THOST_FTDC_FET_Accountregister '6' + /// + #define THOST_FTDC_FET_ExchangeFundIO '7' + ///Ͷ߳ + #define THOST_FTDC_FET_InvestorFundIO '8' + + typedef char TThostFtdcFundEventTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAccountSourceTypeTypeһʽ˻Դ + ///////////////////////////////////////////////////////////////////////// + ///ͬ + #define THOST_FTDC_AST_FBTransfer '0' + ///ֹ¼ + #define THOST_FTDC_AST_ManualEntry '1' + + typedef char TThostFtdcAccountSourceTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCodeSourceTypeTypeһױԴ + ///////////////////////////////////////////////////////////////////////// + ///ͳһ(ѹ淶) + #define THOST_FTDC_CST_UnifyAccount '0' + ///ֹ¼(δ淶) + #define THOST_FTDC_CST_ManualEntry '1' + + typedef char TThostFtdcCodeSourceTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUserRangeTypeһԱΧ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_UR_All '0' + ///һԱ + #define THOST_FTDC_UR_Single '1' + + typedef char TThostFtdcUserRangeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTimeSpanTypeһʱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcTimeSpanType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcImportSequenceIDTypeһ̬Ƶα + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcImportSequenceIDType[17]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcByGroupTypeһͳƱͻͳƷʽ + ///////////////////////////////////////////////////////////////////////// + ///Ͷͳ + #define THOST_FTDC_BG_Investor '2' + ///ͳ + #define THOST_FTDC_BG_Group '1' + + typedef char TThostFtdcByGroupType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeSumStatModeTypeһͳƱΧͳƷʽ + ///////////////////////////////////////////////////////////////////////// + ///Լͳ + #define THOST_FTDC_TSSM_Instrument '1' + ///Ʒͳ + #define THOST_FTDC_TSSM_Product '2' + ///ͳ + #define THOST_FTDC_TSSM_Exchange '3' + + typedef char TThostFtdcTradeSumStatModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcComTypeTypeһϳɽ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcComTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUserProductIDTypeһƷʶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUserProductIDType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUserProductNameTypeһƷ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUserProductNameType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUserProductMemoTypeһƷ˵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUserProductMemoType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCCancelFlagTypeһ־ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCCancelFlagType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCDateTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCDateType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCInvestorNameTypeһͻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCInvestorNameType[201]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCOpenInvestorNameTypeһͻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCOpenInvestorNameType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCInvestorIDTypeһͻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCInvestorIDType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCIdentifiedCardNoTypeһ֤ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCIdentifiedCardNoType[51]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCClientIDTypeһױ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCClientIDType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCBankFlagTypeһбʶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCBankFlagType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCBankAccountTypeһ˻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCBankAccountType[23]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCOpenNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCOpenNameType[401]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCMemoTypeһ˵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCMemoType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCTimeTypeһʱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCTimeType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCTradeIDTypeһɽˮ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCTradeIDType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCExchangeInstIDTypeһԼ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCExchangeInstIDType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCMortgageNameTypeһѺƷ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCMortgageNameType[7]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCReasonTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCReasonType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcIsSettlementTypeһǷΪǽԱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcIsSettlementType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCMoneyTypeһʽ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcCSRCMoneyType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCPriceTypeһ۸ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcCSRCPriceType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCOptionsTypeTypeһȨ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCOptionsTypeType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCStrikePriceTypeһִм + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcCSRCStrikePriceType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCTargetProductIDTypeһƷ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCTargetProductIDType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCTargetInstrIDTypeһĺԼ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCTargetInstrIDType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCommModelNameTypeһģ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCommModelNameType[161]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCommModelMemoTypeһģ屸ע + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCommModelMemoType[1025]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExprSetModeTypeһڱʽ + ///////////////////////////////////////////////////////////////////////// + ///й + #define THOST_FTDC_ESM_Relative '1' + /// + #define THOST_FTDC_ESM_Typical '2' + + typedef char TThostFtdcExprSetModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRateInvestorRangeTypeһͶ߷Χ + ///////////////////////////////////////////////////////////////////////// + ///˾׼ + #define THOST_FTDC_RIR_All '1' + ///ģ + #define THOST_FTDC_RIR_Model '2' + ///һͶ + #define THOST_FTDC_RIR_Single '3' + + typedef char TThostFtdcRateInvestorRangeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAgentBrokerIDTypeһ͹˾ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAgentBrokerIDType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDRIdentityIDTypeһĴ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcDRIdentityIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDRIdentityNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDRIdentityNameType[65]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDBLinkIDTypeһDBLinkʶ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDBLinkIDType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSyncDataStatusTypeһϵͳͬ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δͬ + #define THOST_FTDC_SDS_Initialize '0' + ///ͬ + #define THOST_FTDC_SDS_Settlementing '1' + ///ͬ + #define THOST_FTDC_SDS_Settlemented '2' + + typedef char TThostFtdcSyncDataStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeSourceTypeһɽԴ + ///////////////////////////////////////////////////////////////////////// + ///Խͨر + #define THOST_FTDC_TSRC_NORMAL '0' + ///Բѯ + #define THOST_FTDC_TSRC_QUERY '1' + + typedef char TThostFtdcTradeSourceType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFlexStatModeTypeһƷԼͳƷʽ + ///////////////////////////////////////////////////////////////////////// + ///Ʒͳ + #define THOST_FTDC_FSM_Product '1' + ///ͳ + #define THOST_FTDC_FSM_Exchange '2' + ///ͳ + #define THOST_FTDC_FSM_All '3' + + typedef char TThostFtdcFlexStatModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcByInvestorRangeTypeһͶ߷ΧͳƷʽ + ///////////////////////////////////////////////////////////////////////// + ///ͳ + #define THOST_FTDC_BIR_Property '1' + ///ͳ + #define THOST_FTDC_BIR_All '2' + + typedef char TThostFtdcByInvestorRangeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSRiskRateTypeһն + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSRiskRateType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSequenceNo12Typeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcSequenceNo12Type; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPropertyInvestorRangeTypeһͶ߷Χ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_PIR_All '1' + ///Ͷ + #define THOST_FTDC_PIR_Property '2' + ///һͶ + #define THOST_FTDC_PIR_Single '3' + + typedef char TThostFtdcPropertyInvestorRangeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFileStatusTypeһļ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_FIS_NoCreate '0' + /// + #define THOST_FTDC_FIS_Created '1' + ///ʧ + #define THOST_FTDC_FIS_Failed '2' + + typedef char TThostFtdcFileStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFileGenStyleTypeһļɷʽ + ///////////////////////////////////////////////////////////////////////// + ///· + #define THOST_FTDC_FGS_FileTransmit '0' + /// + #define THOST_FTDC_FGS_FileGen '1' + + typedef char TThostFtdcFileGenStyleType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSysOperModeTypeһϵͳ־ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_SoM_Add '1' + ///޸ + #define THOST_FTDC_SoM_Update '2' + ///ɾ + #define THOST_FTDC_SoM_Delete '3' + /// + #define THOST_FTDC_SoM_Copy '4' + /// + #define THOST_FTDC_SoM_AcTive '5' + ///ע + #define THOST_FTDC_SoM_CanCel '6' + /// + #define THOST_FTDC_SoM_ReSet '7' + + typedef char TThostFtdcSysOperModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSysOperTypeTypeһϵͳ־ + ///////////////////////////////////////////////////////////////////////// + ///޸IJԱ + #define THOST_FTDC_SoT_UpdatePassword '0' + ///Աܹ֯ϵ + #define THOST_FTDC_SoT_UserDepartment '1' + ///ɫ + #define THOST_FTDC_SoT_RoleManager '2' + ///ɫ + #define THOST_FTDC_SoT_RoleFunction '3' + /// + #define THOST_FTDC_SoT_BaseParam '4' + ///òԱ + #define THOST_FTDC_SoT_SetUserID '5' + ///ûɫ + #define THOST_FTDC_SoT_SetUserRole '6' + ///ûIP + #define THOST_FTDC_SoT_UserIpRestriction '7' + ///ܹ֯ + #define THOST_FTDC_SoT_DepartmentManager '8' + ///ܹ֯ѯิ + #define THOST_FTDC_SoT_DepartmentCopy '9' + ///ױ + #define THOST_FTDC_SoT_Tradingcode 'A' + ///Ͷ״̬ά + #define THOST_FTDC_SoT_InvestorStatus 'B' + ///ͶȨ޹ + #define THOST_FTDC_SoT_InvestorAuthority 'C' + /// + #define THOST_FTDC_SoT_PropertySet 'D' + ///Ͷ + #define THOST_FTDC_SoT_ReSetInvestorPasswd 'E' + ///Ͷ߸Ϣά + #define THOST_FTDC_SoT_InvestorPersonalityInfo 'F' + + typedef char TThostFtdcSysOperTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCDataQueyTypeTypeһϱݲѯ + ///////////////////////////////////////////////////////////////////////// + ///ѯǰձ͵ + #define THOST_FTDC_CSRCQ_Current '0' + ///ѯʷ͵Ĵ͹˾ + #define THOST_FTDC_CSRCQ_History '1' + + typedef char TThostFtdcCSRCDataQueyTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFreezeStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///Ծ + #define THOST_FTDC_FRS_Normal '1' + /// + #define THOST_FTDC_FRS_Freeze '0' + + typedef char TThostFtdcFreezeStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcStandardStatusTypeһ淶״̬ + ///////////////////////////////////////////////////////////////////////// + ///ѹ淶 + #define THOST_FTDC_STST_Standard '0' + ///δ淶 + #define THOST_FTDC_STST_NonStandard '1' + + typedef char TThostFtdcStandardStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCFreezeStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCFreezeStatusType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRightParamTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + ///߻ + #define THOST_FTDC_RPT_Freeze '1' + ///߻ + #define THOST_FTDC_RPT_FreezeActive '2' + ///Ȩ + #define THOST_FTDC_RPT_OpenLimit '3' + ///Ȩ + #define THOST_FTDC_RPT_RelieveOpenLimit '4' + + typedef char TThostFtdcRightParamTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRightTemplateIDTypeһģ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRightTemplateIDType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRightTemplateNameTypeһģ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcRightTemplateNameType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDataStatusTypeһϴǮ˱״̬ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_AMLDS_Normal '0' + ///ɾ + #define THOST_FTDC_AMLDS_Deleted '1' + + typedef char TThostFtdcDataStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAMLCheckStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_AMLCHS_Init '0' + /// + #define THOST_FTDC_AMLCHS_Checking '1' + ///Ѹ + #define THOST_FTDC_AMLCHS_Checked '2' + ///ܾϱ + #define THOST_FTDC_AMLCHS_RefuseReport '3' + + typedef char TThostFtdcAMLCheckStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAmlDateTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_AMLDT_DrawDay '0' + /// + #define THOST_FTDC_AMLDT_TouchDay '1' + + typedef char TThostFtdcAmlDateTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAmlCheckLevelTypeһ˼ + ///////////////////////////////////////////////////////////////////////// + ///㼶 + #define THOST_FTDC_AMLCL_CheckLevel0 '0' + ///һ + #define THOST_FTDC_AMLCL_CheckLevel1 '1' + /// + #define THOST_FTDC_AMLCL_CheckLevel2 '2' + /// + #define THOST_FTDC_AMLCL_CheckLevel3 '3' + + typedef char TThostFtdcAmlCheckLevelType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAmlCheckFlowTypeһϴǮݳȡ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAmlCheckFlowType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDataTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcDataTypeType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExportFileTypeTypeһļ + ///////////////////////////////////////////////////////////////////////// + ///CSV + #define THOST_FTDC_EFT_CSV '0' + ///Excel + #define THOST_FTDC_EFT_EXCEL '1' + ///DBF + #define THOST_FTDC_EFT_DBF '2' + + typedef char TThostFtdcExportFileTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettleManagerTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + ///ǰ׼ + #define THOST_FTDC_SMT_Before '1' + /// + #define THOST_FTDC_SMT_Settlement '2' + ///˶ + #define THOST_FTDC_SMT_After '3' + /// + #define THOST_FTDC_SMT_Settlemented '4' + + typedef char TThostFtdcSettleManagerTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettleManagerIDTypeһô + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSettleManagerIDType[33]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettleManagerNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSettleManagerNameType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettleManagerLevelTypeһõȼ + ///////////////////////////////////////////////////////////////////////// + ///Ҫ + #define THOST_FTDC_SML_Must '1' + /// + #define THOST_FTDC_SML_Alarm '2' + ///ʾ + #define THOST_FTDC_SML_Prompt '3' + /// + #define THOST_FTDC_SML_Ignore '4' + + typedef char TThostFtdcSettleManagerLevelType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettleManagerGroupTypeһģ + ///////////////////////////////////////////////////////////////////////// + ///˶ + #define THOST_FTDC_SMG_Exhcange '1' + ///ڲ˶ + #define THOST_FTDC_SMG_ASP '2' + ///ϱݺ˶ + #define THOST_FTDC_SMG_CSRC '3' + + typedef char TThostFtdcSettleManagerGroupType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCheckResultMemoTypeһ˶Խ˵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCheckResultMemoType[1025]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFunctionUrlTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcFunctionUrlType[1025]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAuthInfoTypeһͻ֤Ϣ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAuthInfoType[129]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAuthCodeTypeһͻ֤ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAuthCodeType[17]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLimitUseTypeTypeһֵʹ + ///////////////////////////////////////////////////////////////////////// + ///ظʹ + #define THOST_FTDC_LUT_Repeatable '1' + ///ظʹ + #define THOST_FTDC_LUT_Unrepeatable '2' + + typedef char TThostFtdcLimitUseTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDataResourceTypeһԴ + ///////////////////////////////////////////////////////////////////////// + ///ϵͳ + #define THOST_FTDC_DAR_Settle '1' + /// + #define THOST_FTDC_DAR_Exchange '2' + /// + #define THOST_FTDC_DAR_CSRC '3' + + typedef char TThostFtdcDataResourceType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMarginTypeTypeһ֤ + ///////////////////////////////////////////////////////////////////////// + ///֤ + #define THOST_FTDC_MGT_ExchMarginRate '0' + ///Ͷ֤߱ + #define THOST_FTDC_MGT_InstrMarginRate '1' + ///Ͷ߽ױ֤ + #define THOST_FTDC_MGT_InstrMarginRateTrade '2' + + typedef char TThostFtdcMarginTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcActiveTypeTypeһЧ + ///////////////////////////////////////////////////////////////////////// + ///Ч + #define THOST_FTDC_ACT_Intraday '1' + ///Ч + #define THOST_FTDC_ACT_Long '2' + + typedef char TThostFtdcActiveTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMarginRateTypeTypeһͻ֤ + ///////////////////////////////////////////////////////////////////////// + ///֤ + #define THOST_FTDC_MRT_Exchange '1' + ///Ͷ֤߱ + #define THOST_FTDC_MRT_Investor '2' + ///Ͷ߽ױ֤ + #define THOST_FTDC_MRT_InvestorTrade '3' + + typedef char TThostFtdcMarginRateTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBackUpStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δɱ + #define THOST_FTDC_BUS_UnBak '0' + /// + #define THOST_FTDC_BUS_BakUp '1' + ///ɱ + #define THOST_FTDC_BUS_BakUped '2' + ///ʧ + #define THOST_FTDC_BUS_BakFail '3' + + typedef char TThostFtdcBackUpStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInitSettlementTypeһʼ״̬ + ///////////////////////////////////////////////////////////////////////// + ///ʼδʼ + #define THOST_FTDC_SIS_UnInitialize '0' + ///ʼ + #define THOST_FTDC_SIS_Initialize '1' + ///ʼ + #define THOST_FTDC_SIS_Initialized '2' + + typedef char TThostFtdcInitSettlementType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcReportStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///δɱ + #define THOST_FTDC_SRS_NoCreate '0' + /// + #define THOST_FTDC_SRS_Create '1' + ///ɱ + #define THOST_FTDC_SRS_Created '2' + ///ɱʧ + #define THOST_FTDC_SRS_CreateFail '3' + + typedef char TThostFtdcReportStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSaveStatusTypeһݹ鵵״̬ + ///////////////////////////////////////////////////////////////////////// + ///鵵δ + #define THOST_FTDC_SSS_UnSaveData '0' + ///鵵 + #define THOST_FTDC_SSS_SaveDatad '1' + + typedef char TThostFtdcSaveStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSettArchiveStatusTypeһȷݹ鵵״̬ + ///////////////////////////////////////////////////////////////////////// + ///δ鵵 + #define THOST_FTDC_SAS_UnArchived '0' + ///ݹ鵵 + #define THOST_FTDC_SAS_Archiving '1' + ///ѹ鵵 + #define THOST_FTDC_SAS_Archived '2' + ///鵵ʧ + #define THOST_FTDC_SAS_ArchiveFail '3' + + typedef char TThostFtdcSettArchiveStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCTPTypeTypeһCTPϵͳ + ///////////////////////////////////////////////////////////////////////// + ///δ֪ + #define THOST_FTDC_CTPT_Unkown '0' + /// + #define THOST_FTDC_CTPT_MainCenter '1' + /// + #define THOST_FTDC_CTPT_BackUp '2' + + typedef char TThostFtdcCTPTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcToolIDTypeһߴ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcToolIDType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcToolNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcToolNameType[81]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCloseDealTypeTypeһƽִ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_CDT_Normal '0' + ///Ͷƽ + #define THOST_FTDC_CDT_SpecFirst '1' + + typedef char TThostFtdcCloseDealTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMortgageFundUseRangeTypeһѺʽ÷Χ + ///////////////////////////////////////////////////////////////////////// + ///ʹ + #define THOST_FTDC_MFUR_None '0' + ///ڱ֤ + #define THOST_FTDC_MFUR_Margin '1' + ///ѡӯ֤ + #define THOST_FTDC_MFUR_All '2' + + typedef char TThostFtdcMortgageFundUseRangeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCurrencyUnitTypeһֵλ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcCurrencyUnitType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExchangeRateTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcExchangeRateType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSpecProductTypeTypeһƷ + ///////////////////////////////////////////////////////////////////////// + ///֣ױƷ + #define THOST_FTDC_SPT_CzceHedge '1' + ///ѺƷ + #define THOST_FTDC_SPT_IneForeignCurrency '2' + ///߿ƽֲƷ + #define THOST_FTDC_SPT_DceOpenClose '3' + + typedef char TThostFtdcSpecProductTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundMortgageTypeTypeһѺ + ///////////////////////////////////////////////////////////////////////// + ///Ѻ + #define THOST_FTDC_FMT_Mortgage '1' + /// + #define THOST_FTDC_FMT_Redemption '2' + + typedef char TThostFtdcFundMortgageTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAccountSettlementParamIDTypeһͶ˻ + ///////////////////////////////////////////////////////////////////////// + ///֤ + #define THOST_FTDC_ASPI_BaseMargin '1' + ///Ȩ׼ + #define THOST_FTDC_ASPI_LowestInterest '2' + + typedef char TThostFtdcAccountSettlementParamIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCurrencyNameTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCurrencyNameType[31]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCurrencySignTypeһַ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCurrencySignType[4]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundMortDirectionTypeһѺ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_FMD_In '1' + ///ʳ + #define THOST_FTDC_FMD_Out '2' + + typedef char TThostFtdcFundMortDirectionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBusinessClassTypeһ + ///////////////////////////////////////////////////////////////////////// + ///ӯ + #define THOST_FTDC_BT_Profit '0' + /// + #define THOST_FTDC_BT_Loss '1' + /// + #define THOST_FTDC_BT_Other 'Z' + + typedef char TThostFtdcBusinessClassType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSwapSourceTypeTypeһԴ + ///////////////////////////////////////////////////////////////////////// + ///ֹ + #define THOST_FTDC_SST_Manual '0' + ///Զ + #define THOST_FTDC_SST_Automatic '1' + + typedef char TThostFtdcSwapSourceTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCurrExDirectionTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_CED_Settlement '0' + ///ۻ + #define THOST_FTDC_CED_Sale '1' + + typedef char TThostFtdcCurrExDirectionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCurrencySwapStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///¼ + #define THOST_FTDC_CSS_Entry '1' + /// + #define THOST_FTDC_CSS_Approve '2' + ///Ѿܾ + #define THOST_FTDC_CSS_Refuse '3' + ///ѳ + #define THOST_FTDC_CSS_Revoke '4' + ///ѷ + #define THOST_FTDC_CSS_Send '5' + ///ɹ + #define THOST_FTDC_CSS_Success '6' + ///ʧ + #define THOST_FTDC_CSS_Failure '7' + + typedef char TThostFtdcCurrencySwapStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCurrExchCertNoTypeһƾ֤ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCurrExchCertNoType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBatchSerialNoTypeһκ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBatchSerialNoType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcReqFlagTypeһ㷢ͱ־ + ///////////////////////////////////////////////////////////////////////// + ///δ + #define THOST_FTDC_REQF_NoSend '0' + ///ͳɹ + #define THOST_FTDC_REQF_SendSuccess '1' + ///ʧ + #define THOST_FTDC_REQF_SendFailed '2' + ///ȴط + #define THOST_FTDC_REQF_WaitReSend '3' + + typedef char TThostFtdcReqFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcResFlagTypeһ㷵سɹ־ + ///////////////////////////////////////////////////////////////////////// + ///ɹ + #define THOST_FTDC_RESF_Success '0' + ///˻ + #define THOST_FTDC_RESF_InsuffiCient '1' + ///׽δ֪ + #define THOST_FTDC_RESF_UnKnown '8' + + typedef char TThostFtdcResFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPageControlTypeһҳ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPageControlType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcRecordCountTypeһ¼ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcRecordCountType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCurrencySwapMemoTypeһȷϢ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCurrencySwapMemoType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExStatusTypeһ޸״̬ + ///////////////////////////////////////////////////////////////////////// + ///޸ǰ + #define THOST_FTDC_EXS_Before '0' + ///޸ĺ + #define THOST_FTDC_EXS_After '1' + + typedef char TThostFtdcExStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClientRegionTypeһͻ + ///////////////////////////////////////////////////////////////////////// + ///ڿͻ + #define THOST_FTDC_CR_Domestic '1' + ///۰̨ͻ + #define THOST_FTDC_CR_GMT '2' + ///ͻ + #define THOST_FTDC_CR_Foreign '3' + + typedef char TThostFtdcClientRegionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcWorkPlaceTypeһλ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcWorkPlaceType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBusinessPeriodTypeһӪ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBusinessPeriodType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcWebSiteTypeһַ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcWebSiteType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUOAIdCardTypeTypeһͳһ֤ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUOAIdCardTypeType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcClientModeTypeһģʽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcClientModeType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvestorFullNameTypeһͶȫ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInvestorFullNameType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUOABrokerIDTypeһнID + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUOABrokerIDType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUOAZipCodeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUOAZipCodeType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUOAEMailTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUOAEMailType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOldCityTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcOldCityType[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCorporateIdentifiedCardNoTypeһ˴֤ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCorporateIdentifiedCardNoType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcHasBoardTypeһǷж» + ///////////////////////////////////////////////////////////////////////// + ///û + #define THOST_FTDC_HB_No '0' + /// + #define THOST_FTDC_HB_Yes '1' + + typedef char TThostFtdcHasBoardType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcStartModeTypeһģʽ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_SM_Normal '1' + ///Ӧ + #define THOST_FTDC_SM_Emerge '2' + ///ָ + #define THOST_FTDC_SM_Restore '3' + + typedef char TThostFtdcStartModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTemplateTypeTypeһģ + ///////////////////////////////////////////////////////////////////////// + ///ȫ + #define THOST_FTDC_TPT_Full '1' + /// + #define THOST_FTDC_TPT_Increment '2' + /// + #define THOST_FTDC_TPT_BackUp '3' + + typedef char TThostFtdcTemplateTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLoginModeTypeһ¼ģʽ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_LM_Trade '0' + ///ת + #define THOST_FTDC_LM_Transfer '1' + + typedef char TThostFtdcLoginModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPromptTypeTypeһʾ + ///////////////////////////////////////////////////////////////////////// + ///Լ + #define THOST_FTDC_CPT_Instrument '1' + ///ֶ֤Ч + #define THOST_FTDC_CPT_Margin '2' + + typedef char TThostFtdcPromptTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLedgerManageIDTypeһֻʲ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcLedgerManageIDType[51]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInvestVarietyTypeһͶƷ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInvestVarietyType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBankAccountTypeTypeһ˻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcBankAccountTypeType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLedgerManageBankTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcLedgerManageBankType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCffexDepartmentNameTypeһӪҵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCffexDepartmentNameType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCffexDepartmentCodeTypeһӪҵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCffexDepartmentCodeType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcHasTrusteeTypeһǷй + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_HT_Yes '1' + ///û + #define THOST_FTDC_HT_No '0' + + typedef char TThostFtdcHasTrusteeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCMemo1Typeһ˵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCMemo1Type[41]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAssetmgrCFullNameTypeһʲҵڻ˾ȫ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAssetmgrCFullNameType[101]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAssetmgrApprovalNOTypeһʲҵĺ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAssetmgrApprovalNOType[51]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAssetmgrMgrNameTypeһʲҵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAssetmgrMgrNameType[401]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAmTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_AMT_Bank '1' + ///֤ȯ˾ + #define THOST_FTDC_AMT_Securities '2' + ///˾ + #define THOST_FTDC_AMT_Fund '3' + ///չ˾ + #define THOST_FTDC_AMT_Insurance '4' + ///й˾ + #define THOST_FTDC_AMT_Trust '5' + /// + #define THOST_FTDC_AMT_Other '9' + + typedef char TThostFtdcAmTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCAmTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCAmTypeType[5]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCFundIOTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_CFIOT_FundIO '0' + ///ڻ + #define THOST_FTDC_CFIOT_SwapCurrency '1' + + typedef char TThostFtdcCSRCFundIOTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCusAccountTypeTypeһ˻ + ///////////////////////////////////////////////////////////////////////// + ///ڻ˻ + #define THOST_FTDC_CAT_Futures '1' + ///ڻʹҵµʹܽ˻ + #define THOST_FTDC_CAT_AssetmgrFuture '2' + ///ۺʹҵµڻʹй˻ + #define THOST_FTDC_CAT_AssetmgrTrustee '3' + ///ۺʹҵµʽת˻ + #define THOST_FTDC_CAT_AssetmgrTransfer '4' + + typedef char TThostFtdcCusAccountTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCNationalTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCNationalType[4]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCSRCSecAgentIDTypeһID + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCSRCSecAgentIDType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLanguageTypeTypeһ֪ͨ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_LT_Chinese '1' + ///Ӣ + #define THOST_FTDC_LT_English '2' + + typedef char TThostFtdcLanguageTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAmAccountTypeһͶ˻ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcAmAccountType[23]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAssetmgrClientTypeTypeһʲͻ + ///////////////////////////////////////////////////////////////////////// + ///ʹܿͻ + #define THOST_FTDC_AMCT_Person '1' + ///λʹܿͻ + #define THOST_FTDC_AMCT_Organ '2' + ///ⵥλʹܿͻ + #define THOST_FTDC_AMCT_SpecialOrgan '4' + + typedef char TThostFtdcAssetmgrClientTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcAssetmgrTypeTypeһͶ + ///////////////////////////////////////////////////////////////////////// + ///ڻ + #define THOST_FTDC_ASST_Futures '3' + ///ۺ + #define THOST_FTDC_ASST_SpecialOrgan '4' + + typedef char TThostFtdcAssetmgrTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUOMTypeһλ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcUOMType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSHFEInstLifePhaseTypeһԼ״̬ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSHFEInstLifePhaseType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSHFEProductClassTypeһƷ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSHFEProductClassType[11]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcPriceDecimalTypeһ۸Сλ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcPriceDecimalType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcInTheMoneyFlagTypeһƽֵȨ־ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcInTheMoneyFlagType[2]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCheckInstrTypeTypeһԼȽ + ///////////////////////////////////////////////////////////////////////// + ///Լ + #define THOST_FTDC_CIT_HasExch '0' + ///Լϵͳ + #define THOST_FTDC_CIT_HasATP '1' + ///ԼȽϲһ + #define THOST_FTDC_CIT_HasDiff '2' + + typedef char TThostFtdcCheckInstrTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDeliveryTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + ///ֹ + #define THOST_FTDC_DT_HandDeliv '1' + ///ڽ + #define THOST_FTDC_DT_PersonDeliv '2' + + typedef char TThostFtdcDeliveryTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBigMoneyTypeһʽ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcBigMoneyType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcMaxMarginSideAlgorithmTypeһ֤߱㷨 + ///////////////////////////////////////////////////////////////////////// + ///ʹô֤߱㷨 + #define THOST_FTDC_MMSA_NO '0' + ///ʹô֤߱㷨 + #define THOST_FTDC_MMSA_YES '1' + + typedef char TThostFtdcMaxMarginSideAlgorithmType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDAClientTypeTypeһʲͻ + ///////////////////////////////////////////////////////////////////////// + ///Ȼ + #define THOST_FTDC_CACT_Person '0' + /// + #define THOST_FTDC_CACT_Company '1' + /// + #define THOST_FTDC_CACT_Other '2' + + typedef char TThostFtdcDAClientTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCombinInstrIDTypeһԼ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCombinInstrIDType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCombinSettlePriceTypeһȽ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcCombinSettlePriceType[61]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDCEPriorityTypeһȼ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcDCEPriorityType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeGroupIDTypeһɽ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcTradeGroupIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcIsCheckPrepaTypeһǷУ鿪ʽ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcIsCheckPrepaType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcUOAAssetmgrTypeTypeһͶ + ///////////////////////////////////////////////////////////////////////// + ///ڻ + #define THOST_FTDC_UOAAT_Futures '1' + ///ۺ + #define THOST_FTDC_UOAAT_SpecialOrgan '2' + + typedef char TThostFtdcUOAAssetmgrTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDirectionEnTypeһ + ///////////////////////////////////////////////////////////////////////// + ///Buy + #define THOST_FTDC_DEN_Buy '0' + ///Sell + #define THOST_FTDC_DEN_Sell '1' + + typedef char TThostFtdcDirectionEnType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOffsetFlagEnTypeһƽ־ + ///////////////////////////////////////////////////////////////////////// + ///Position Opening + #define THOST_FTDC_OFEN_Open '0' + ///Position Close + #define THOST_FTDC_OFEN_Close '1' + ///Forced Liquidation + #define THOST_FTDC_OFEN_ForceClose '2' + ///Close Today + #define THOST_FTDC_OFEN_CloseToday '3' + ///Close Prev. + #define THOST_FTDC_OFEN_CloseYesterday '4' + ///Forced Reduction + #define THOST_FTDC_OFEN_ForceOff '5' + ///Local Forced Liquidation + #define THOST_FTDC_OFEN_LocalForceClose '6' + + typedef char TThostFtdcOffsetFlagEnType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcHedgeFlagEnTypeһͶױ־ + ///////////////////////////////////////////////////////////////////////// + ///Speculation + #define THOST_FTDC_HFEN_Speculation '1' + ///Arbitrage + #define THOST_FTDC_HFEN_Arbitrage '2' + ///Hedge + #define THOST_FTDC_HFEN_Hedge '3' + + typedef char TThostFtdcHedgeFlagEnType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundIOTypeEnTypeһ + ///////////////////////////////////////////////////////////////////////// + ///Deposit/Withdrawal + #define THOST_FTDC_FIOTEN_FundIO '1' + ///Bank-Futures Transfer + #define THOST_FTDC_FIOTEN_Transfer '2' + ///Bank-Futures FX Exchange + #define THOST_FTDC_FIOTEN_SwapCurrency '3' + + typedef char TThostFtdcFundIOTypeEnType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundTypeEnTypeһʽ + ///////////////////////////////////////////////////////////////////////// + ///Bank Deposit + #define THOST_FTDC_FTEN_Deposite '1' + ///Payment/Fee + #define THOST_FTDC_FTEN_ItemFund '2' + ///Brokerage Adj + #define THOST_FTDC_FTEN_Company '3' + ///Internal Transfer + #define THOST_FTDC_FTEN_InnerTransfer '4' + + typedef char TThostFtdcFundTypeEnType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundDirectionEnTypeһ + ///////////////////////////////////////////////////////////////////////// + ///Deposit + #define THOST_FTDC_FDEN_In '1' + ///Withdrawal + #define THOST_FTDC_FDEN_Out '2' + + typedef char TThostFtdcFundDirectionEnType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFundMortDirectionEnTypeһѺ + ///////////////////////////////////////////////////////////////////////// + ///Pledge + #define THOST_FTDC_FMDEN_In '1' + ///Redemption + #define THOST_FTDC_FMDEN_Out '2' + + typedef char TThostFtdcFundMortDirectionEnType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSwapBusinessTypeTypeһҵ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcSwapBusinessTypeType[3]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOptionsTypeTypeһȨ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_CP_CallOptions '1' + /// + #define THOST_FTDC_CP_PutOptions '2' + + typedef char TThostFtdcOptionsTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcStrikeModeTypeһִзʽ + ///////////////////////////////////////////////////////////////////////// + ///ŷʽ + #define THOST_FTDC_STM_Continental '0' + ///ʽ + #define THOST_FTDC_STM_American '1' + ///Ľ + #define THOST_FTDC_STM_Bermuda '2' + + typedef char TThostFtdcStrikeModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcStrikeTypeTypeһִ + ///////////////////////////////////////////////////////////////////////// + ///Գ + #define THOST_FTDC_STT_Hedge '0' + ///ƥִ + #define THOST_FTDC_STT_Match '1' + + typedef char TThostFtdcStrikeTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcApplyTypeTypeһнȨִ + ///////////////////////////////////////////////////////////////////////// + ///ִ + #define THOST_FTDC_APPT_NotStrikeNum '4' + + typedef char TThostFtdcApplyTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcGiveUpDataSourceTypeһִԴ + ///////////////////////////////////////////////////////////////////////// + ///ϵͳ + #define THOST_FTDC_GUDS_Gen '0' + ///ֹ + #define THOST_FTDC_GUDS_Hand '1' + + typedef char TThostFtdcGiveUpDataSourceType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExecOrderSysIDTypeһִϵͳ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcExecOrderSysIDType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExecResultTypeһִн + ///////////////////////////////////////////////////////////////////////// + ///ûִ + #define THOST_FTDC_OER_NoExec 'n' + ///Ѿȡ + #define THOST_FTDC_OER_Canceled 'c' + ///ִгɹ + #define THOST_FTDC_OER_OK '0' + ///Ȩֲֲ + #define THOST_FTDC_OER_NoPosition '1' + ///ʽ𲻹 + #define THOST_FTDC_OER_NoDeposit '2' + ///Ա + #define THOST_FTDC_OER_NoParticipant '3' + ///ͻ + #define THOST_FTDC_OER_NoClient '4' + ///Լ + #define THOST_FTDC_OER_NoInstrument '6' + ///ûִȨ + #define THOST_FTDC_OER_NoRight '7' + /// + #define THOST_FTDC_OER_InvalidVolume '8' + ///û㹻ʷɽ + #define THOST_FTDC_OER_NoEnoughHistoryTrade '9' + ///δ֪ + #define THOST_FTDC_OER_Unknown 'a' + + typedef char TThostFtdcExecResultType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcStrikeSequenceTypeһִ + ///////////////////////////////////////////////////////////////////////// + typedef int TThostFtdcStrikeSequenceType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcStrikeTimeTypeһִʱ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcStrikeTimeType[13]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCombinationTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + ///ڻ + #define THOST_FTDC_COMBT_Future '0' + ///ֱ۲BUL + #define THOST_FTDC_COMBT_BUL '1' + ///ֱ۲BER + #define THOST_FTDC_COMBT_BER '2' + ///ʽ + #define THOST_FTDC_COMBT_STD '3' + ///ʽ + #define THOST_FTDC_COMBT_STG '4' + /// + #define THOST_FTDC_COMBT_PRT '5' + ///ʱ۲ + #define THOST_FTDC_COMBT_CLD '6' + + typedef char TThostFtdcCombinationTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcOptionRoyaltyPriceTypeTypeһȨȨ۸ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_ORPT_PreSettlementPrice '1' + ///ּ + #define THOST_FTDC_ORPT_OpenPrice '4' + + typedef char TThostFtdcOptionRoyaltyPriceTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBalanceAlgorithmTypeһȨ㷨 + ///////////////////////////////////////////////////////////////////////// + ///Ȩֵӯ + #define THOST_FTDC_BLAG_Default '1' + ///Ȩֵ + #define THOST_FTDC_BLAG_IncludeOptValLost '2' + + typedef char TThostFtdcBalanceAlgorithmType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcActionTypeTypeһִ + ///////////////////////////////////////////////////////////////////////// + ///ִ + #define THOST_FTDC_ACTP_Exec '1' + /// + #define THOST_FTDC_ACTP_Abandon '2' + + typedef char TThostFtdcActionTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcForQuoteStatusTypeһѯ״̬ + ///////////////////////////////////////////////////////////////////////// + ///Ѿύ + #define THOST_FTDC_FQST_Submitted 'a' + ///Ѿ + #define THOST_FTDC_FQST_Accepted 'b' + ///Ѿܾ + #define THOST_FTDC_FQST_Rejected 'c' + + typedef char TThostFtdcForQuoteStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcValueMethodTypeһȡֵʽ + ///////////////////////////////////////////////////////////////////////// + ///ֵ + #define THOST_FTDC_VM_Absolute '0' + /// + #define THOST_FTDC_VM_Ratio '1' + + typedef char TThostFtdcValueMethodType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExecOrderPositionFlagTypeһȨȨǷڻͷı + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_EOPF_Reserve '0' + /// + #define THOST_FTDC_EOPF_UnReserve '1' + + typedef char TThostFtdcExecOrderPositionFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcExecOrderCloseFlagTypeһȨȨɵͷǷԶƽ + ///////////////////////////////////////////////////////////////////////// + ///Զƽ + #define THOST_FTDC_EOCF_AutoClose '0' + ///Զƽ + #define THOST_FTDC_EOCF_NotToClose '1' + + typedef char TThostFtdcExecOrderCloseFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcProductTypeTypeһƷ + ///////////////////////////////////////////////////////////////////////// + ///ڻ + #define THOST_FTDC_PTE_Futures '1' + ///Ȩ + #define THOST_FTDC_PTE_Options '2' + + typedef char TThostFtdcProductTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCZCEUploadFileNameTypeһ֣ļ + ///////////////////////////////////////////////////////////////////////// + ///^\d{8}_zz_\d{4} + #define THOST_FTDC_CUFN_CUFN_O 'O' + ///^\d{8}ɽ + #define THOST_FTDC_CUFN_CUFN_T 'T' + ///^\d{8}ȳֱֲnew + #define THOST_FTDC_CUFN_CUFN_P 'P' + ///^\d{8}ƽ˽ + #define THOST_FTDC_CUFN_CUFN_N 'N' + ///^\d{8}ƽֱ + #define THOST_FTDC_CUFN_CUFN_L 'L' + ///^\d{8}ʽ + #define THOST_FTDC_CUFN_CUFN_F 'F' + ///^\d{8}ϳֱֲ + #define THOST_FTDC_CUFN_CUFN_C 'C' + ///^\d{8}֤ + #define THOST_FTDC_CUFN_CUFN_M 'M' + + typedef char TThostFtdcCZCEUploadFileNameType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDCEUploadFileNameTypeһļ + ///////////////////////////////////////////////////////////////////////// + ///^\d{8}_dl_\d{3} + #define THOST_FTDC_DUFN_DUFN_O 'O' + ///^\d{8}_ɽ + #define THOST_FTDC_DUFN_DUFN_T 'T' + ///^\d{8}_ֱֲ + #define THOST_FTDC_DUFN_DUFN_P 'P' + ///^\d{8}_ʽ + #define THOST_FTDC_DUFN_DUFN_F 'F' + ///^\d{8}_Żϳֲϸ + #define THOST_FTDC_DUFN_DUFN_C 'C' + ///^\d{8}_ֲϸ + #define THOST_FTDC_DUFN_DUFN_D 'D' + ///^\d{8}_֤ + #define THOST_FTDC_DUFN_DUFN_M 'M' + ///^\d{8}_Ȩִб + #define THOST_FTDC_DUFN_DUFN_S 'S' + + typedef char TThostFtdcDCEUploadFileNameType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcSHFEUploadFileNameTypeһļ + ///////////////////////////////////////////////////////////////////////// + ///^\d{4}_\d{8}_\d{8}_DailyFundChg + #define THOST_FTDC_SUFN_SUFN_O 'O' + ///^\d{4}_\d{8}_\d{8}_Trade + #define THOST_FTDC_SUFN_SUFN_T 'T' + ///^\d{4}_\d{8}_\d{8}_SettlementDetail + #define THOST_FTDC_SUFN_SUFN_P 'P' + ///^\d{4}_\d{8}_\d{8}_Capital + #define THOST_FTDC_SUFN_SUFN_F 'F' + + typedef char TThostFtdcSHFEUploadFileNameType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCFFEXUploadFileNameTypeһнļ + ///////////////////////////////////////////////////////////////////////// + ///^\d{4}_SG\d{1}_\d{8}_\d{1}_Trade + #define THOST_FTDC_CFUFN_SUFN_T 'T' + ///^\d{4}_SG\d{1}_\d{8}_\d{1}_SettlementDetail + #define THOST_FTDC_CFUFN_SUFN_P 'P' + ///^\d{4}_SG\d{1}_\d{8}_\d{1}_Capital + #define THOST_FTDC_CFUFN_SUFN_F 'F' + ///^\d{4}_SG\d{1}_\d{8}_\d{1}_OptionExec + #define THOST_FTDC_CFUFN_SUFN_S 'S' + + typedef char TThostFtdcCFFEXUploadFileNameType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcCombDirectionTypeһָ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_CMDR_Comb '0' + /// + #define THOST_FTDC_CMDR_UnComb '1' + + typedef char TThostFtdcCombDirectionType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcLockTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// + #define THOST_FTDC_LCKT_Lock '1' + /// + #define THOST_FTDC_LCKT_Unlock '2' + + typedef char TThostFtdcLockTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcBizTypeTypeһҵ + ///////////////////////////////////////////////////////////////////////// + ///ڻ + #define THOST_FTDC_BZTP_Future '1' + ///֤ȯ + #define THOST_FTDC_BZTP_Stock '2' + + typedef char TThostFtdcBizTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcDesignateTypeTypeһָ + ///////////////////////////////////////////////////////////////////////// + ///ָǼ + #define THOST_FTDC_DSTP_Register '1' + ///ָ + #define THOST_FTDC_DSTP_Cancel '2' + + typedef char TThostFtdcDesignateTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFreezeReasonTypeTypeһԭ + ///////////////////////////////////////////////////////////////////////// + ///ʼ +#define THOST_FTDC_FRTP_Init '1' + /// +#define THOST_FTDC_FRTP_Lock '2' + ///ִ +#define THOST_FTDC_FRTP_Exec '3' + + typedef char TThostFtdcFreezeReasonTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcFreezeTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// +#define THOST_FTDC_FZTP_Freeze '1' + ///ⶳ +#define THOST_FTDC_FZTP_Unfreeze '2' + ///ǿִ +#define THOST_FTDC_FZTP_Force '3' + + typedef char TThostFtdcFreezeTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcTradeSystemTypeTypeһϵͳ + ///////////////////////////////////////////////////////////////////////// + ///δ֪ϵͳ +#define THOST_FTDC_TSTP_Unknow '0' + ///ڻϵͳ +#define THOST_FTDC_TSTP_Future '1' + ///ϵͳ +#define THOST_FTDC_TSTP_IShare '2' + + typedef char TThostFtdcTradeSystemTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcStockDisposalTypeTypeһ֤ȯ÷ + ///////////////////////////////////////////////////////////////////////// + ///뾭͹˾˻ +#define THOST_FTDC_STPT_ToBroker '1' + ///Ͷ˻ +#define THOST_FTDC_STPT_ToInvestor '2' + + typedef char TThostFtdcStockDisposalTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcStockDisposalSysIDTypeһ֤ȯñ + ///////////////////////////////////////////////////////////////////////// + typedef char TThostFtdcStockDisposalSysIDType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TFtdcStockDisposalStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + ///Ѿύ +#define THOST_FTDC_SDPS_Submitted 'a' + ///Ѿ +#define THOST_FTDC_SDPS_Accepted 'b' + ///Ѿܾ +#define THOST_FTDC_SDPS_Rejected 'c' + ///Ѿ +#define THOST_FTDC_SDPS_Cancelled 'd' + + typedef char TThostFtdcStockDisposalStatusType; +} // end of namespace KingstarAPI + +#endif diff --git a/include/Kingstar/IncEx/KSUserApiStructEx.h b/include/Kingstar/IncEx/KSUserApiStructEx.h new file mode 100644 index 0000000..ff907e1 --- /dev/null +++ b/include/Kingstar/IncEx/KSUserApiStructEx.h @@ -0,0 +1,8870 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSUserApiStructEx.h +///@brief ˿ͻ˽ӿʹõҵݽṹ +///////////////////////////////////////////////////////////////////////// + +#if !defined(KINSTARAPI_FTDCSTRUCT_H) +#define KINSTARAPI_FTDCSTRUCT_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "KSUserApiDataTypeEx.h" + +namespace KingstarAPI +{ + + ///Ϣַ + struct CThostFtdcDisseminationField + { + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///к + TThostFtdcSequenceNoType SequenceNo; + }; + + ///û¼ + struct CThostFtdcReqUserLoginField + { + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///նIPַ + TThostFtdcIPAddressType ClientIPAddress; + }; + + ///û¼Ӧ + struct CThostFtdcRspUserLoginField + { + /// + TThostFtdcDateType TradingDay; + ///¼ɹʱ + TThostFtdcTimeType LoginTime; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Դʱ + TThostFtdcTimeType INETime; + }; + + ///ûdz + struct CThostFtdcUserLogoutField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + }; + + ///ǿƽԱ˳ + struct CThostFtdcForceUserLogoutField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + }; + + ///ͻ֤ + struct CThostFtdcReqAuthenticateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤ + TThostFtdcAuthCodeType AuthCode; + }; + + ///ͻ֤Ӧ + struct CThostFtdcRspAuthenticateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + }; + + ///ͻ֤Ϣ + struct CThostFtdcAuthenticationInfoField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤Ϣ + TThostFtdcAuthInfoType AuthInfo; + ///ǷΪ֤ + TThostFtdcBoolType IsResult; + }; + + ///תʱͷ + struct CThostFtdcTransferHeaderField + { + ///汾ţ1.0 + TThostFtdcVersionType Version; + ///״룬 + TThostFtdcTradeCodeType TradeCode; + ///ڣʽyyyymmdd + TThostFtdcTradeDateType TradeDate; + ///ʱ䣬ʽhhmmss + TThostFtdcTradeTimeType TradeTime; + ///ˮţN/A + TThostFtdcTradeSerialType TradeSerial; + ///ڻ˾룬 + TThostFtdcFutureIDType FutureID; + ///д룬ݲѯеõ + TThostFtdcBankIDType BankID; + ///зĴ룬ݲѯеõ + TThostFtdcBankBrchIDType BankBrchID; + ///ԱN/A + TThostFtdcOperNoType OperNo; + ///豸ͣN/A + TThostFtdcDeviceIDType DeviceID; + ///¼N/A + TThostFtdcRecordNumType RecordNum; + ///ỰţN/A + TThostFtdcSessionIDType SessionID; + ///ţN/A + TThostFtdcRequestIDType RequestID; + }; + + ///ʽתڻTradeCode=202001 + struct CThostFtdcTransferBankToFutureReqField + { + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; + }; + + ///ʽתڻӦ + struct CThostFtdcTransferBankToFutureRspField + { + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyCodeType CurrencyCode; + }; + + ///ڻʽתTradeCode=202002 + struct CThostFtdcTransferFutureToBankReqField + { + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; + }; + + ///ڻʽתӦ + struct CThostFtdcTransferFutureToBankRspField + { + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyCodeType CurrencyCode; + }; + + ///ѯʽTradeCode=204002 + struct CThostFtdcTransferQryBankReqField + { + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; + }; + + ///ѯʽӦ + struct CThostFtdcTransferQryBankRspField + { + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + /// + TThostFtdcMoneyType TradeAmt; + ///п + TThostFtdcMoneyType UseAmt; + ///пȡ + TThostFtdcMoneyType FetchAmt; + /// + TThostFtdcCurrencyCodeType CurrencyCode; + }; + + ///ѯнϸTradeCode=204999 + struct CThostFtdcTransferQryDetailReqField + { + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + }; + + ///ѯнϸӦ + struct CThostFtdcTransferQryDetailRspField + { + /// + TThostFtdcDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///ڻˮ + TThostFtdcTradeSerialNoType FutureSerial; + ///ڻ˾ + TThostFtdcFutureIDType FutureID; + ///ʽʺ + TThostFtdcFutureAccountType FutureAccount; + ///ˮ + TThostFtdcTradeSerialNoType BankSerial; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + ///˺ + TThostFtdcBankAccountType BankAccount; + ///֤ + TThostFtdcCertCodeType CertCode; + ///Ҵ + TThostFtdcCurrencyCodeType CurrencyCode; + /// + TThostFtdcMoneyType TxAmount; + ///Ч־ + TThostFtdcTransferValidFlagType Flag; + }; + + ///ӦϢ + struct CThostFtdcRspInfoField + { + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + /// + struct CThostFtdcExchangeField + { + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcExchangeNameType ExchangeName; + /// + TThostFtdcExchangePropertyType ExchangeProperty; + }; + + ///Ʒ + struct CThostFtdcProductField + { + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductNameType ProductName; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceType PriceTick; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///ֲ + TThostFtdcPositionTypeType PositionType; + ///ֲ + TThostFtdcPositionDateTypeType PositionDateType; + ///ƽִ + TThostFtdcCloseDealTypeType CloseDealType; + ///ױ + TThostFtdcCurrencyIDType TradeCurrencyID; + ///Ѻʽ÷Χ + TThostFtdcMortgageFundUseRangeType MortgageFundUseRange; + ///Ʒ + TThostFtdcInstrumentIDType ExchangeProductID; + ///ԼƷ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; + }; + + ///Լ + struct CThostFtdcInstrumentField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentNameType InstrumentName; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcYearType DeliveryYear; + /// + TThostFtdcMonthType DeliveryMonth; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceType PriceTick; + /// + TThostFtdcDateType CreateDate; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcDateType ExpireDate; + ///ʼ + TThostFtdcDateType StartDelivDate; + /// + TThostFtdcDateType EndDelivDate; + ///Լ״̬ + TThostFtdcInstLifePhaseType InstLifePhase; + ///ǰǷ + TThostFtdcBoolType IsTrading; + ///ֲ + TThostFtdcPositionTypeType PositionType; + ///ֲ + TThostFtdcPositionDateTypeType PositionDateType; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatio; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatio; + ///Ƿʹô֤߱㷨 + TThostFtdcMaxMarginSideAlgorithmType MaxMarginSideAlgorithm; + ///Ʒ + TThostFtdcInstrumentIDType UnderlyingInstrID; + ///ִм + TThostFtdcPriceType StrikePrice; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + ///ԼƷ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; + /// + TThostFtdcCombinationTypeType CombinationType; + ///Сµλ + TThostFtdcVolumeType MinBuyVolume; + ///Сµλ + TThostFtdcVolumeType MinSellVolume; + ///Լʶ + TThostFtdcInstrumentCodeType InstrumentCode; + }; + + ///͹˾ + struct CThostFtdcBrokerField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ + TThostFtdcBrokerAbbrType BrokerAbbr; + ///͹˾ + TThostFtdcBrokerNameType BrokerName; + ///ǷԾ + TThostFtdcBoolType IsActive; + }; + + ///Ա + struct CThostFtdcTraderField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallCountType InstallCount; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + }; + + ///Ͷ + struct CThostFtdcInvestorField + { + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcDateType OpenDate; + ///ֻ + TThostFtdcMobileType Mobile; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; + }; + + ///ױ + struct CThostFtdcTradingCodeField + { + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ҵ + TThostFtdcBizTypeType BizType; + }; + + ///Ա;͹˾ձ + struct CThostFtdcPartBrokerField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ǷԾ + TThostFtdcBoolType IsActive; + }; + + ///û + struct CThostFtdcSuperUserField + { + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + /// + TThostFtdcPasswordType Password; + ///ǷԾ + TThostFtdcBoolType IsActive; + }; + + ///ûȨ + struct CThostFtdcSuperUserFunctionField + { + ///û + TThostFtdcUserIDType UserID; + ///ܴ + TThostFtdcFunctionCodeType FunctionCode; + }; + + ///Ͷ + struct CThostFtdcInvestorGroupField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TThostFtdcInvestorGroupNameType InvestorGroupName; + }; + + ///ʽ˻ + struct CThostFtdcTradingAccountField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ϴѺ + TThostFtdcMoneyType PreMortgage; + ///ϴö + TThostFtdcMoneyType PreCredit; + ///ϴδ + TThostFtdcMoneyType PreDeposit; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///Ϣ + TThostFtdcMoneyType InterestBase; + ///Ϣ + TThostFtdcMoneyType Interest; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + ///ʽ + TThostFtdcMoneyType Available; + ///ȡʽ + TThostFtdcMoneyType WithdrawQuota; + ///׼ + TThostFtdcMoneyType Reserve; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ö + TThostFtdcMoneyType Credit; + ///Ѻ + TThostFtdcMoneyType Mortgage; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TThostFtdcMoneyType DeliveryMargin; + ///֤ + TThostFtdcMoneyType ExchangeDeliveryMargin; + ///ڻ׼ + TThostFtdcMoneyType ReserveBalance; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ϴλ + TThostFtdcMoneyType PreFundMortgageIn; + ///ϴλʳ + TThostFtdcMoneyType PreFundMortgageOut; + /// + TThostFtdcMoneyType FundMortgageIn; + ///ʳ + TThostFtdcMoneyType FundMortgageOut; + ///Ѻ + TThostFtdcMoneyType FundMortgageAvailable; + ///Ѻҽ + TThostFtdcMoneyType MortgageableFund; + ///Ʒռñ֤ + TThostFtdcMoneyType SpecProductMargin; + ///Ʒᱣ֤ + TThostFtdcMoneyType SpecProductFrozenMargin; + ///Ʒ + TThostFtdcMoneyType SpecProductCommission; + ///Ʒ + TThostFtdcMoneyType SpecProductFrozenCommission; + ///Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfit; + ///Ʒƽӯ + TThostFtdcMoneyType SpecProductCloseProfit; + ///ݳֲӯ㷨Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfitByAlg; + ///Ʒ֤ + TThostFtdcMoneyType SpecProductExchangeMargin; + ///ҵ + TThostFtdcBizTypeType BizType; + }; + + ///Ͷֲ߳ + struct CThostFtdcInvestorPositionField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcPositionDateType PositionDate; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ճֲ + TThostFtdcVolumeType Position; + ///ͷ + TThostFtdcVolumeType LongFrozen; + ///ͷ + TThostFtdcVolumeType ShortFrozen; + ///ֶ + TThostFtdcMoneyType LongFrozenAmount; + ///ֶ + TThostFtdcMoneyType ShortFrozenAmount; + /// + TThostFtdcVolumeType OpenVolume; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ֽ + TThostFtdcMoneyType OpenAmount; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ֲֳɱ + TThostFtdcMoneyType PositionCost; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ֳɱ + TThostFtdcMoneyType OpenCost; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TThostFtdcVolumeType CombPosition; + ///϶ͷ + TThostFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TThostFtdcVolumeType CombShortFrozen; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TThostFtdcVolumeType TodayPosition; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ִж + TThostFtdcVolumeType StrikeFrozen; + ///ִж + TThostFtdcMoneyType StrikeFrozenAmount; + ///ִж + TThostFtdcVolumeType AbandonFrozen; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Լ֤ + struct CThostFtdcInstrumentMarginRateField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; + }; + + ///Լ + struct CThostFtdcInstrumentCommissionRateField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ҵ + TThostFtdcBizTypeType BizType; + }; + + /// + struct CThostFtdcDepthMarketDataField + { + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; + ///վ + TThostFtdcPriceType AveragePrice; + ///ҵ + TThostFtdcDateType ActionDay; + }; + + ///ͶߺԼȨ + struct CThostFtdcInstrumentTradingRightField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ҵ + TThostFtdcBizTypeType BizType; + }; + + ///͹˾û + struct CThostFtdcBrokerUserField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + ///û + TThostFtdcUserTypeType UserType; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///Ƿʹ + TThostFtdcBoolType IsUsingOTP; + }; + + ///͹˾û + struct CThostFtdcBrokerUserPasswordField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; + }; + + ///͹˾ûȨ + struct CThostFtdcBrokerUserFunctionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///͹˾ܴ + TThostFtdcBrokerFunctionCodeType BrokerFunctionCode; + }; + + ///Ա̻ + struct CThostFtdcTraderOfferField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ϯλɽ + TThostFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TThostFtdcReturnCodeType MaxOrderMessageReference; + ///ҵ + TThostFtdcBizTypeType BizType; + }; + + ///Ͷ߽ + struct CThostFtdcSettlementInfoField + { + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType Content; + }; + + ///Լ֤ʵ + struct CThostFtdcInstrumentMarginRateAdjustField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; + }; + + ///֤ + struct CThostFtdcExchangeMarginRateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + }; + + ///֤ʵ + struct CThostFtdcExchangeMarginRateAdjustField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///潻Ͷ߶ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ExchLongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ExchLongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ExchShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ExchShortMarginRatioByVolume; + ///潻Ͷ߶ͷ֤ + TThostFtdcRatioType NoLongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TThostFtdcMoneyType NoLongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TThostFtdcRatioType NoShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TThostFtdcMoneyType NoShortMarginRatioByVolume; + }; + + /// + struct CThostFtdcExchangeRateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Դֵλ + TThostFtdcCurrencyUnitType FromCurrencyUnit; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; + }; + + /// + struct CThostFtdcSettlementRefField + { + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + }; + + ///ǰʱ + struct CThostFtdcCurrentTimeField + { + ///ǰ + TThostFtdcDateType CurrDate; + ///ǰʱ + TThostFtdcTimeType CurrTime; + ///ǰʱ䣨룩 + TThostFtdcMillisecType CurrMillisec; + ///ҵ + TThostFtdcDateType ActionDay; + }; + + ///ͨѶ׶ + struct CThostFtdcCommPhaseField + { + /// + TThostFtdcDateType TradingDay; + ///ͨѶʱα + TThostFtdcCommPhaseNoType CommPhaseNo; + ///ϵͳ + TThostFtdcSystemIDType SystemID; + }; + + ///¼Ϣ + struct CThostFtdcLoginInfoField + { + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + /// + TThostFtdcPasswordType Password; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///Դʱ + TThostFtdcTimeType INETime; + ///ѯʱǷҪ + TThostFtdcBoolType IsQryControl; + }; + + ///¼Ϣ + struct CThostFtdcLogoutAllField + { + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + }; + + ///ǰ״̬ + struct CThostFtdcFrontStatusField + { + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + ///ǷԾ + TThostFtdcBoolType IsActive; + }; + + ///û + struct CThostFtdcUserPasswordUpdateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; + }; + + ///뱨 + struct CThostFtdcInputOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///־ + TThostFtdcBoolType IsSwapOrder; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + /// + struct CThostFtdcOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ + TThostFtdcVolumeType ZCETotalTradedVolume; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + /// + struct CThostFtdcExchangeOrderField + { + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///ʧ + struct CThostFtdcExchangeOrderInsertErrorField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///뱨 + struct CThostFtdcInputOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + /// + struct CThostFtdcOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + /// + struct CThostFtdcExchangeOrderActionField + { + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///ʧ + struct CThostFtdcExchangeOrderActionErrorField + { + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + }; + + ///ɽ + struct CThostFtdcExchangeTradeField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ɽԴ + TThostFtdcTradeSourceType TradeSource; + }; + + ///ɽ + struct CThostFtdcTradeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ɽԴ + TThostFtdcTradeSourceType TradeSource; + }; + + ///ûỰ + struct CThostFtdcUserSessionField + { + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; + }; + + ///ѯ󱨵 + struct CThostFtdcQueryMaxOrderVolumeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Ͷ߽ȷϢ + struct CThostFtdcSettlementInfoConfirmField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ȷ + TThostFtdcDateType ConfirmDate; + ///ȷʱ + TThostFtdcTimeType ConfirmTime; + }; + + ///ͬ + struct CThostFtdcSyncDepositField + { + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcMoneyType Deposit; + ///Ƿǿƽ + TThostFtdcBoolType IsForce; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///Ѻͬ + struct CThostFtdcSyncFundMortgageField + { + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Ѻ + TThostFtdcMoneyType MortgageAmount; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; + }; + + ///͹˾ͬ + struct CThostFtdcBrokerSyncField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + }; + + ///ͬеͶ + struct CThostFtdcSyncingInvestorField + { + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcDateType OpenDate; + ///ֻ + TThostFtdcMobileType Mobile; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; + }; + + ///ͬеĽ״ + struct CThostFtdcSyncingTradingCodeField + { + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///ͬеͶ߷ + struct CThostFtdcSyncingInvestorGroupField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TThostFtdcInvestorGroupNameType InvestorGroupName; + }; + + ///ͬеĽ˺ + struct CThostFtdcSyncingTradingAccountField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ϴѺ + TThostFtdcMoneyType PreMortgage; + ///ϴö + TThostFtdcMoneyType PreCredit; + ///ϴδ + TThostFtdcMoneyType PreDeposit; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///Ϣ + TThostFtdcMoneyType InterestBase; + ///Ϣ + TThostFtdcMoneyType Interest; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + ///ʽ + TThostFtdcMoneyType Available; + ///ȡʽ + TThostFtdcMoneyType WithdrawQuota; + ///׼ + TThostFtdcMoneyType Reserve; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ö + TThostFtdcMoneyType Credit; + ///Ѻ + TThostFtdcMoneyType Mortgage; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TThostFtdcMoneyType DeliveryMargin; + ///֤ + TThostFtdcMoneyType ExchangeDeliveryMargin; + ///ڻ׼ + TThostFtdcMoneyType ReserveBalance; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ϴλ + TThostFtdcMoneyType PreFundMortgageIn; + ///ϴλʳ + TThostFtdcMoneyType PreFundMortgageOut; + /// + TThostFtdcMoneyType FundMortgageIn; + ///ʳ + TThostFtdcMoneyType FundMortgageOut; + ///Ѻ + TThostFtdcMoneyType FundMortgageAvailable; + ///Ѻҽ + TThostFtdcMoneyType MortgageableFund; + ///Ʒռñ֤ + TThostFtdcMoneyType SpecProductMargin; + ///Ʒᱣ֤ + TThostFtdcMoneyType SpecProductFrozenMargin; + ///Ʒ + TThostFtdcMoneyType SpecProductCommission; + ///Ʒ + TThostFtdcMoneyType SpecProductFrozenCommission; + ///Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfit; + ///Ʒƽӯ + TThostFtdcMoneyType SpecProductCloseProfit; + ///ݳֲӯ㷨Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfitByAlg; + ///Ʒ֤ + TThostFtdcMoneyType SpecProductExchangeMargin; + }; + + ///ͬеͶֲ߳ + struct CThostFtdcSyncingInvestorPositionField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcPositionDateType PositionDate; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ճֲ + TThostFtdcVolumeType Position; + ///ͷ + TThostFtdcVolumeType LongFrozen; + ///ͷ + TThostFtdcVolumeType ShortFrozen; + ///ֶ + TThostFtdcMoneyType LongFrozenAmount; + ///ֶ + TThostFtdcMoneyType ShortFrozenAmount; + /// + TThostFtdcVolumeType OpenVolume; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ֽ + TThostFtdcMoneyType OpenAmount; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ֲֳɱ + TThostFtdcMoneyType PositionCost; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ֳɱ + TThostFtdcMoneyType OpenCost; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TThostFtdcVolumeType CombPosition; + ///϶ͷ + TThostFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TThostFtdcVolumeType CombShortFrozen; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TThostFtdcVolumeType TodayPosition; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ִж + TThostFtdcVolumeType StrikeFrozen; + ///ִж + TThostFtdcMoneyType StrikeFrozenAmount; + ///ִж + TThostFtdcVolumeType AbandonFrozen; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ͬеĺԼ֤ + struct CThostFtdcSyncingInstrumentMarginRateField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; + }; + + ///ͬеĺԼ + struct CThostFtdcSyncingInstrumentCommissionRateField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ͬеĺԼȨ + struct CThostFtdcSyncingInstrumentTradingRightField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯ + struct CThostFtdcQryOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + }; + + ///ѯɽ + struct CThostFtdcQryTradeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + ///ʼʱ + TThostFtdcTimeType TradeTimeStart; + ///ʱ + TThostFtdcTimeType TradeTimeEnd; + }; + + ///ѯͶֲ߳ + struct CThostFtdcQryInvestorPositionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯʽ˻ + struct CThostFtdcQryTradingAccountField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ҵ + TThostFtdcBizTypeType BizType; + }; + + ///ѯͶ + struct CThostFtdcQryInvestorField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///ѯױ + struct CThostFtdcQryTradingCodeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; + }; + + ///ѯͶ + struct CThostFtdcQryInvestorGroupField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + }; + + ///ѯԼ֤ + struct CThostFtdcQryInstrumentMarginRateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + }; + + ///ѯ + struct CThostFtdcQryInstrumentCommissionRateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯԼȨ + struct CThostFtdcQryInstrumentTradingRightField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯ͹˾ + struct CThostFtdcQryBrokerField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + }; + + ///ѯԱ + struct CThostFtdcQryTraderField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///ѯûȨ + struct CThostFtdcQrySuperUserFunctionField + { + ///û + TThostFtdcUserIDType UserID; + }; + + ///ѯûỰ + struct CThostFtdcQryUserSessionField + { + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + }; + + ///ѯ͹˾Ա + struct CThostFtdcQryPartBrokerField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + }; + + ///ѯǰ״̬ + struct CThostFtdcQryFrontStatusField + { + ///ǰñ + TThostFtdcFrontIDType FrontID; + }; + + ///ѯ + struct CThostFtdcQryExchangeOrderField + { + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///ѯ + struct CThostFtdcQryOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯ + struct CThostFtdcQryExchangeOrderActionField + { + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///ѯû + struct CThostFtdcQrySuperUserField + { + ///û + TThostFtdcUserIDType UserID; + }; + + ///ѯ + struct CThostFtdcQryExchangeField + { + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯƷ + struct CThostFtdcQryProductField + { + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯԼ + struct CThostFtdcQryInstrumentField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + }; + + ///ѯ + struct CThostFtdcQryDepthMarketDataField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯ͹˾û + struct CThostFtdcQryBrokerUserField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + }; + + ///ѯ͹˾ûȨ + struct CThostFtdcQryBrokerUserFunctionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + }; + + ///ѯԱ̻ + struct CThostFtdcQryTraderOfferField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///ѯˮ + struct CThostFtdcQrySyncDepositField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + }; + + ///ѯͶ߽ + struct CThostFtdcQrySettlementInfoField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; + }; + + ///ѯ֤ + struct CThostFtdcQryExchangeMarginRateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + }; + + ///ѯ֤ + struct CThostFtdcQryExchangeMarginRateAdjustField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + }; + + ///ѯ + struct CThostFtdcQryExchangeRateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; + }; + + ///ѯѺˮ + struct CThostFtdcQrySyncFundMortgageField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; + }; + + ///ѯ + struct CThostFtdcQryHisOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + }; + + ///ǰȨԼС֤ + struct CThostFtdcOptionInstrMiniMarginField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///λ֣ȨԼС֤ + TThostFtdcMoneyType MinMargin; + ///ȡֵʽ + TThostFtdcValueMethodType ValueMethod; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ǰȨԼ֤ϵ + struct CThostFtdcOptionInstrMarginAdjustField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷͷ֤ϵ + TThostFtdcRatioType SShortMarginRatioByMoney; + ///Ͷͷ֤ϵ + TThostFtdcMoneyType SShortMarginRatioByVolume; + ///ֵͷ֤ϵ + TThostFtdcRatioType HShortMarginRatioByMoney; + ///ֵͷ֤ϵ + TThostFtdcMoneyType HShortMarginRatioByVolume; + ///ͷ֤ϵ + TThostFtdcRatioType AShortMarginRatioByMoney; + ///ͷ֤ϵ + TThostFtdcMoneyType AShortMarginRatioByVolume; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ǰȨԼѵϸ + struct CThostFtdcOptionInstrCommRateField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Ȩ׳ɱ + struct CThostFtdcOptionInstrTradeCostField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType FixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType MiniMargin; + ///ȨԼȨ + TThostFtdcMoneyType Royalty; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType ExchFixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType ExchMiniMargin; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Ȩ׳ɱѯ + struct CThostFtdcQryOptionInstrTradeCostField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ + TThostFtdcPriceType InputPrice; + ///ļ۸,0 + TThostFtdcPriceType UnderlyingPrice; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Ȩʲѯ + struct CThostFtdcQryOptionInstrCommRateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ָָֻ + struct CThostFtdcIndexPriceField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ָֻ̼ + TThostFtdcPriceType ClosePrice; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ִ + struct CThostFtdcInputExecOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ִ + struct CThostFtdcInputExecOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + ///ִ + struct CThostFtdcExecOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerExecOrderSeq; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///ִ + struct CThostFtdcExecOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///ִѯ + struct CThostFtdcQryExecOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + }; + + ///ִϢ + struct CThostFtdcExchangeExecOrderField + { + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///ִѯ + struct CThostFtdcQryExchangeExecOrderField + { + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///ִѯ + struct CThostFtdcQryExecOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ִ + struct CThostFtdcExchangeExecOrderActionField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///ִѯ + struct CThostFtdcQryExchangeExecOrderActionField + { + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///ִ + struct CThostFtdcErrExecOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ѯִ + struct CThostFtdcQryErrExecOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///ִ + struct CThostFtdcErrExecOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ѯִ + struct CThostFtdcQryErrExecOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///ͶȨԼȨ + struct CThostFtdcOptionInstrTradingRightField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDirectionType Direction; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + }; + + ///ѯȨԼȨ + struct CThostFtdcQryOptionInstrTradingRightField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯ + struct CThostFtdcInputForQuoteField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯ + struct CThostFtdcForQuoteField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ѯ۱ + TThostFtdcSequenceNoType BrokerForQutoSeq; + }; + + ///ѯ۲ѯ + struct CThostFtdcQryForQuoteField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + }; + + ///ѯϢ + struct CThostFtdcExchangeForQuoteField + { + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; + }; + + ///ѯ۲ѯ + struct CThostFtdcQryExchangeForQuoteField + { + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///ı + struct CThostFtdcInputQuoteField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///뱨۲ + struct CThostFtdcInputQuoteActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + /// + struct CThostFtdcQuoteField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾۱ + TThostFtdcSequenceNoType BrokerQuoteSeq; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///۲ + struct CThostFtdcQuoteActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///۲ѯ + struct CThostFtdcQryQuoteField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + }; + + ///Ϣ + struct CThostFtdcExchangeQuoteField + { + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///۲ѯ + struct CThostFtdcQryExchangeQuoteField + { + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///۲ѯ + struct CThostFtdcQryQuoteActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///۲ + struct CThostFtdcExchangeQuoteActionField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + }; + + ///۲ѯ + struct CThostFtdcQryExchangeQuoteActionField + { + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///ȨԼdeltaֵ + struct CThostFtdcOptionInstrDeltaField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Deltaֵ + TThostFtdcRatioType Delta; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///̵ѯ + struct CThostFtdcForQuoteRspField + { + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///ѯʱ + TThostFtdcTimeType ForQuoteTime; + ///ҵ + TThostFtdcDateType ActionDay; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ǰȨԼִƫֵϸ + struct CThostFtdcStrikeOffsetField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִƫֵ + TThostFtdcMoneyType Offset; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Ȩִƫֵѯ + struct CThostFtdcQryStrikeOffsetField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + ///¼ + struct CThostFtdcInputLockField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType LockRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + /// + struct CThostFtdcLockField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType LockRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcOrderLocalIDType LockLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType LockSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderActionStatusType LockStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerLockSeq; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///ѯ + struct CThostFtdcQryLockField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType LockSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + }; + + ///֤ȯλ + struct CThostFtdcLockPositionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcVolumeType FrozenVolume; + }; + + ///ѯ֤ȯλ + struct CThostFtdcQryLockPositionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ǰETFȨԼѵϸ + struct CThostFtdcETFOptionInstrCommRateField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲַ + TThostFtdcPosiDirectionType PosiDirection; + }; + + ///ETFȨʲѯ + struct CThostFtdcQryETFOptionInstrCommRateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ijֲֶ + struct CThostFtdcPosiFreezeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcVolumeType Volume; + ///ԭ + TThostFtdcFreezeReasonTypeType FreezeReasonType; + /// + TThostFtdcFreezeTypeType FreezeType; + }; + + ///ѯ + struct CThostFtdcQryExchangeLockField + { + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + /// + struct CThostFtdcExchangeLockField + { + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcOrderLocalIDType LockLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType LockSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderActionStatusType LockStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + /// + struct CThostFtdcExchangeExecOrderActionErrorField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + }; + + /// + struct CThostFtdcInputBatchOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///û + TThostFtdcUserIDType UserID; + }; + + /// + struct CThostFtdcBatchOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + }; + + /// + struct CThostFtdcExchangeBatchOrderActionField + { + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + }; + + ///ѯ + struct CThostFtdcQryBatchOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Ͷֲ߳ + struct CThostFtdcLimitPosiField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///ͷ + TThostFtdcVolumeType LongVolume; + ///նͷ + TThostFtdcVolumeType OpenVolume; + ///ͷֲֽ + TThostFtdcMoneyType LongAmount; + /// + TThostFtdcVolumeType TotalVolumeFrozen; + ///ͷ + TThostFtdcVolumeType LongVolumeFrozen; + ///նͷ + TThostFtdcVolumeType OpenVolumeFrozen; + ///ͷֲֽ + TThostFtdcMoneyType LongAmountFrozen; + }; + + ///ѯͶֲ߳ + struct CThostFtdcQryLimitPosiField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///͹˾ֲ + struct CThostFtdcBrokerLimitPosiField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcLargeVolumeType TotalVolume; + ///ͷ + TThostFtdcLargeVolumeType LongVolume; + /// + TThostFtdcLargeVolumeType TotalVolumeFrozen; + ///ͷ + TThostFtdcLargeVolumeType LongVolumeFrozen; + }; + + ///ѯ͹˾ֲ + struct CThostFtdcQryBrokerLimitPosiField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Ͷ֤ȯֲ + struct CThostFtdcLimitPosiSField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///տ + TThostFtdcVolumeType OpenVolume; + /// + TThostFtdcVolumeType TotalVolumeFrozen; + ///տ + TThostFtdcVolumeType OpenVolumeFrozen; + }; + + ///ѯͶ֤ȯֲ + struct CThostFtdcQryLimitPosiSField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Ͷֲ߳Ʋ + struct CThostFtdcLimitPosiParamField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///ͷ + TThostFtdcVolumeType LongVolume; + ///նͷ + TThostFtdcVolumeType OpenVolume; + ///ͷֲֽ + TThostFtdcMoneyType LongAmount; + }; + + ///͹˾ֲƲ + struct CThostFtdcBrokerLimitPosiParamField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcLargeVolumeType TotalVolume; + ///ͷ + TThostFtdcLargeVolumeType LongVolume; + }; + + ///Ͷ֤ȯֲƲ + struct CThostFtdcLimitPosiParamSField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///տ + TThostFtdcVolumeType OpenVolume; + }; + + ///֤ȯò + struct CThostFtdcInputStockDisposalActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + ///֤ȯò + struct CThostFtdcStockDisposalActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///֤ȯòѯ + struct CThostFtdcQryStockDisposalActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///֤ȯò + struct CThostFtdcExchangeStockDisposalActionField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///֤ȯò + struct CThostFtdcQryExchangeStockDisposalActionField + { + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///ѯ֤ȯò + struct CThostFtdcQryErrStockDisposalActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///֤ȯò + struct CThostFtdcExchangeStockDisposalActionErrorField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯñ + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + }; + + ///֤ȯò + struct CThostFtdcErrStockDisposalActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ϺԼȫϵ + struct CThostFtdcCombInstrumentGuardField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ȫϵ + TThostFtdcRatioType GuarantRatio; + }; + + ///ϺԼȫϵѯ + struct CThostFtdcQryCombInstrumentGuardField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + /// + struct CThostFtdcInputCombActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + /// + struct CThostFtdcCombActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + }; + + ///ϲѯ + struct CThostFtdcQryCombActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Ϣ + struct CThostFtdcExchangeCombActionField + { + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; + }; + + ///ϲѯ + struct CThostFtdcQryExchangeCombActionField + { + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///Ʒۻ + struct CThostFtdcProductExchRateField + { + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///۱ + TThostFtdcCurrencyIDType QuoteCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; + }; + + ///Ʒۻʲѯ + struct CThostFtdcQryProductExchRateField + { + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + }; + + ///ָ + struct CThostFtdcInputDesignateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ָǼ + TThostFtdcOrderRefType DesignateRef; + ///û + TThostFtdcUserIDType UserID; + ///ָ + TThostFtdcDesignateTypeType DesignateType; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ָ + struct CThostFtdcDesignateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ָǼ + TThostFtdcOrderRefType DesignateRef; + ///û + TThostFtdcUserIDType UserID; + ///ָ + TThostFtdcDesignateTypeType DesignateType; + ///ָ + TThostFtdcOrderLocalIDType DesignateLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ָ״̬ + TThostFtdcOrderActionStatusType DesignateStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///ָ + struct CThostFtdcQryDesignateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ָϢ + struct CThostFtdcExchangeDesignateField + { + ///ָ + TThostFtdcDesignateTypeType DesignateType; + ///ָ + TThostFtdcOrderLocalIDType DesignateLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ָ״̬ + TThostFtdcOrderActionStatusType DesignateStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///֤ȯ + struct CThostFtdcInputStockDisposalField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯõǼ + TThostFtdcOrderRefType StockDisposalRef; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///֤ȯ + struct CThostFtdcStockDisposalField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯõǼ + TThostFtdcOrderRefType StockDisposalRef; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯ״̬ + TThostFtdcStockDisposalStatusType StockDisposalStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + }; + + ///֤ȯ + struct CThostFtdcQryStockDisposalField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///֤ȯϢ + struct CThostFtdcExchangeStockDisposalField + { + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯ״̬ + TThostFtdcStockDisposalStatusType StockDisposalStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + }; + + ///ǰѵϸ + struct CThostFtdcInstrumentOrderCommRateField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcRatioType OrderCommByVolume; + /// + TThostFtdcRatioType OrderActionCommByVolume; + }; + + ///ʲѯ + struct CThostFtdcQryInstrumentOrderCommRateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + ///г + struct CThostFtdcMarketDataField + { + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; + }; + + /// + struct CThostFtdcMarketDataBaseField + { + /// + TThostFtdcDateType TradingDay; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + ///ʵ + TThostFtdcRatioType PreDelta; + }; + + ///龲̬ + struct CThostFtdcMarketDataStaticField + { + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcPriceType ClosePrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ʵ + TThostFtdcRatioType CurrDelta; + }; + + ///³ɽ + struct CThostFtdcMarketDataLastMatchField + { + ///¼ + TThostFtdcPriceType LastPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + }; + + ///ż + struct CThostFtdcMarketDataBestPriceField + { + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; + }; + + /// + struct CThostFtdcMarketDataBid23Field + { + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; + }; + + /// + struct CThostFtdcMarketDataAsk23Field + { + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; + }; + + ///ġ + struct CThostFtdcMarketDataBid45Field + { + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; + }; + + ///ġ + struct CThostFtdcMarketDataAsk45Field + { + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; + }; + + ///ʱ + struct CThostFtdcMarketDataUpdateTimeField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///齻 + struct CThostFtdcMarketDataExchangeField + { + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ָĺԼ + struct CThostFtdcSpecificInstrumentField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + ///Լ״̬ + struct CThostFtdcInstrumentStatusField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcSettlementGroupIDType SettlementGroupID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Լ״̬ + TThostFtdcInstrumentStatusType InstrumentStatus; + ///׽׶α + TThostFtdcTradingSegmentSNType TradingSegmentSN; + ///뱾״̬ʱ + TThostFtdcTimeType EnterTime; + ///뱾״̬ԭ + TThostFtdcInstStatusEnterReasonType EnterReason; + }; + + ///ѯԼ״̬ + struct CThostFtdcQryInstrumentStatusField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + }; + + ///Ͷ˻ + struct CThostFtdcInvestorAccountField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///ӯ㷨 + struct CThostFtdcPositionProfitAlgorithmField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///ע + TThostFtdcMemoType Memo; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///Աʽۿ + struct CThostFtdcDiscountField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʽۿ۱ + TThostFtdcRatioType Discount; + }; + + ///ѯת + struct CThostFtdcQryTransferBankField + { + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + }; + + ///ת + struct CThostFtdcTransferBankField + { + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; + ///ǷԾ + TThostFtdcBoolType IsActive; + }; + + ///ѯͶֲ߳ϸ + struct CThostFtdcQryInvestorPositionDetailField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Ͷֲ߳ϸ + struct CThostFtdcInvestorPositionDetailField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcDateType OpenDate; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcVolumeType Volume; + ///ּ + TThostFtdcPriceType OpenPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///նгֲӯ + TThostFtdcMoneyType PositionProfitByDate; + ///ʶԳֲӯ + TThostFtdcMoneyType PositionProfitByTrade; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + /// + TThostFtdcPriceType LastSettlementPrice; + /// + TThostFtdcPriceType SettlementPrice; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + }; + + ///ʽ˻ + struct CThostFtdcTradingAccountPasswordField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///鱨̻ + struct CThostFtdcMDTraderOfferField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ϯλɽ + TThostFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TThostFtdcReturnCodeType MaxOrderMessageReference; + ///ҵ + TThostFtdcBizTypeType BizType; + }; + + ///ѯ鱨̻ + struct CThostFtdcQryMDTraderOfferField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + }; + + ///ѯͻ֪ͨ + struct CThostFtdcQryNoticeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + }; + + ///ͻ֪ͨ + struct CThostFtdcNoticeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ϣ + TThostFtdcContentType Content; + ///͹˾֪ͨк + TThostFtdcSequenceLabelType SequenceLabel; + }; + + ///ûȨ + struct CThostFtdcUserRightField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ͻȨ + TThostFtdcUserRightTypeType UserRightType; + ///Ƿֹ + TThostFtdcBoolType IsForbidden; + }; + + ///ѯϢȷ + struct CThostFtdcQrySettlementInfoConfirmField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///װؽϢ + struct CThostFtdcLoadSettlementInfoField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + }; + + ///͹˾ʽ㷨 + struct CThostFtdcBrokerWithdrawAlgorithmField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ㷨 + TThostFtdcAlgorithmType WithdrawAlgorithm; + ///ʽʹ + TThostFtdcRatioType UsingRatio; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType IncludeCloseProfit; + ///޲޳ɽͻǷܿ + TThostFtdcAllWithoutTradeType AllWithoutTrade; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///Ƿû¼ + TThostFtdcBoolType IsBrokerUserEvent; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; + ///Ȩ㷨 + TThostFtdcBalanceAlgorithmType BalanceAlgorithm; + }; + + ///ʽ˻ + struct CThostFtdcTradingAccountPasswordUpdateV1Field + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; + }; + + ///ʽ˻ + struct CThostFtdcTradingAccountPasswordUpdateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///ѯϺԼ + struct CThostFtdcQryCombinationLegField + { + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; + }; + + ///ѯϺԼ + struct CThostFtdcQrySyncStatusField + { + /// + TThostFtdcDateType TradingDay; + }; + + ///Ͻ׺Լĵ + struct CThostFtdcCombinationLegField + { + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + /// + TThostFtdcImplyLevelType ImplyLevel; + }; + + ///ͬ״̬ + struct CThostFtdcSyncStatusField + { + /// + TThostFtdcDateType TradingDay; + ///ͬ״̬ + TThostFtdcDataSyncStatusType DataSyncStatus; + }; + + ///ѯϵ + struct CThostFtdcQryLinkManField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///ϵ + struct CThostFtdcLinkManField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵ + TThostFtdcPersonTypeType PersonType; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + /// + TThostFtdcPartyNameType PersonName; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcZipCodeType ZipCode; + ///ȼ + TThostFtdcPriorityType Priority; + /// + TThostFtdcUOAZipCodeType UOAZipCode; + ///ȫ + TThostFtdcInvestorFullNameType PersonFullName; + }; + + ///ѯ͹˾û¼ + struct CThostFtdcQryBrokerUserEventField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; + }; + + ///ѯ͹˾û¼ + struct CThostFtdcBrokerUserEventField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; + ///û¼ + TThostFtdcSequenceNoType EventSequenceNo; + ///¼ + TThostFtdcDateType EventDate; + ///¼ʱ + TThostFtdcTimeType EventTime; + ///û¼Ϣ + TThostFtdcUserEventInfoType UserEventInfo; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯǩԼ + struct CThostFtdcQryContractBankField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + }; + + ///ѯǩԼӦ + struct CThostFtdcContractBankField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; + }; + + ///Ͷϳֲϸ + struct CThostFtdcInvestorPositionCombineDetailField + { + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + ///ϱ + TThostFtdcTradeIDType TradeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + ///ֲ + TThostFtdcVolumeType TotalAmt; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ɽ + TThostFtdcTradeGroupIDType TradeGroupID; + }; + + ///Ԥ + struct CThostFtdcParkedOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ԥ񱨵 + TThostFtdcParkedOrderIDType ParkedOrderID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ״̬ + TThostFtdcParkedOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + }; + + ///Ԥ񵥲 + struct CThostFtdcParkedOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ԥ񳷵 + TThostFtdcParkedOrderActionIDType ParkedOrderActionID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ񳷵״̬ + TThostFtdcParkedOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ѯԤ + struct CThostFtdcQryParkedOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯԤ񳷵 + struct CThostFtdcQryParkedOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ɾԤ + struct CThostFtdcRemoveParkedOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񱨵 + TThostFtdcParkedOrderIDType ParkedOrderID; + }; + + ///ɾԤ񳷵 + struct CThostFtdcRemoveParkedOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񳷵 + TThostFtdcParkedOrderActionIDType ParkedOrderActionID; + }; + + ///͹˾ʽ㷨 + struct CThostFtdcInvestorWithdrawAlgorithmField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʽ + TThostFtdcRatioType UsingRatio; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; + }; + + ///ѯϳֲϸ + struct CThostFtdcQryInvestorPositionCombineDetailField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + }; + + ///ɽ + struct CThostFtdcMarketDataAveragePriceField + { + ///վ + TThostFtdcPriceType AveragePrice; + }; + + ///УͶ + struct CThostFtdcVerifyInvestorPasswordField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcPasswordType Password; + }; + + ///ûIP + struct CThostFtdcUserIPField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///IPַ + TThostFtdcIPAddressType IPMask; + ///Macַ + TThostFtdcMacAddressType MacAddress; + }; + + ///û¼֪ͨϢ + struct CThostFtdcTradingNoticeInfoField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʱ + TThostFtdcTimeType SendTime; + ///Ϣ + TThostFtdcContentType FieldContent; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///к + TThostFtdcSequenceNoType SequenceNo; + }; + + ///û¼֪ͨ + struct CThostFtdcTradingNoticeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///û + TThostFtdcUserIDType UserID; + ///ʱ + TThostFtdcTimeType SendTime; + ///к + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType FieldContent; + }; + + ///ѯ¼֪ͨ + struct CThostFtdcQryTradingNoticeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///ѯ󱨵 + struct CThostFtdcQryErrOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///󱨵 + struct CThostFtdcErrOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯ󱨵 + struct CThostFtdcErrorConditionalOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ + TThostFtdcVolumeType ZCETotalTradedVolume; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + }; + + ///ѯ󱨵 + struct CThostFtdcQryErrOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///󱨵 + struct CThostFtdcErrOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ѯ״̬ + struct CThostFtdcQryExchangeSequenceField + { + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///״̬ + struct CThostFtdcExchangeSequenceField + { + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Լ״̬ + TThostFtdcInstrumentStatusType MarketStatus; + }; + + ///ݼ۸ѯ󱨵 + struct CThostFtdcQueryMaxOrderVolumeWithPriceField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯ͹˾ײ + struct CThostFtdcQryBrokerTradingParamsField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///͹˾ײ + struct CThostFtdcBrokerTradingParamsField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤۸ + TThostFtdcMarginPriceTypeType MarginPriceType; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ȨȨ۸ + TThostFtdcOptionRoyaltyPriceTypeType OptionRoyaltyPriceType; + }; + + ///ѯ͹˾㷨 + struct CThostFtdcQryBrokerTradingAlgosField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + ///͹˾㷨 + struct CThostFtdcBrokerTradingAlgosField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ֲִ㷨 + TThostFtdcHandlePositionAlgoIDType HandlePositionAlgoID; + ///Ѱұ֤㷨 + TThostFtdcFindMarginRateAlgoIDType FindMarginRateAlgoID; + ///ʽ㷨 + TThostFtdcHandleTradingAccountAlgoIDType HandleTradingAccountAlgoID; + }; + + ///ѯ͹˾ʽ + struct CThostFtdcQueryBrokerDepositField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///͹˾ʽ + struct CThostFtdcBrokerDepositField + { + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ʽ + TThostFtdcMoneyType Available; + ///׼ + TThostFtdcMoneyType Reserve; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + }; + + ///ѯ֤ϵͳ͹˾Կ + struct CThostFtdcQryCFMMCBrokerKeyField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + }; + + ///֤ϵͳ͹˾Կ + struct CThostFtdcCFMMCBrokerKeyField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Կ + TThostFtdcDateType CreateDate; + ///Կʱ + TThostFtdcTimeType CreateTime; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬Կ + TThostFtdcCFMMCKeyType CurrentKey; + ///̬Կ + TThostFtdcCFMMCKeyKindType KeyKind; + }; + + ///֤ϵͳ͹˾ʽ˻Կ + struct CThostFtdcCFMMCTradingAccountKeyField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬Կ + TThostFtdcCFMMCKeyType CurrentKey; + }; + + ///ѯ֤ϵͳ͹˾ʽ˻Կ + struct CThostFtdcQryCFMMCTradingAccountKeyField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///û̬Ʋ + struct CThostFtdcBrokerUserOTPParamField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ṩ + TThostFtdcOTPVendorsIDType OTPVendorsID; + ///̬к + TThostFtdcSerialNumberType SerialNumber; + ///Կ + TThostFtdcAuthKeyType AuthKey; + ///Ưֵ + TThostFtdcLastDriftType LastDrift; + ///ɹֵ + TThostFtdcLastSuccessType LastSuccess; + ///̬ + TThostFtdcOTPTypeType OTPType; + }; + + ///ֹͬû̬ + struct CThostFtdcManualSyncBrokerUserOTPField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ + TThostFtdcOTPTypeType OTPType; + ///һ̬ + TThostFtdcPasswordType FirstOTP; + ///ڶ̬ + TThostFtdcPasswordType SecondOTP; + }; + + ///Ͷģ + struct CThostFtdcCommRateModelField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///ģ + TThostFtdcCommModelNameType CommModelName; + }; + + ///ѯͶģ + struct CThostFtdcQryCommRateModelField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; + }; + + ///Ͷ֤߱ģ + struct CThostFtdcMarginModelField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; + ///ģ + TThostFtdcCommModelNameType MarginModelName; + }; + + ///ѯͶ֤߱ģ + struct CThostFtdcQryMarginModelField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; + }; + + ///ֵ۵Ϣ + struct CThostFtdcEWarrantOffsetField + { + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType Volume; + }; + + ///ѯֵ۵Ϣ + struct CThostFtdcQryEWarrantOffsetField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + ///ѯͶƷ/Ʒֱ֤ + struct CThostFtdcQryInvestorProductGroupMarginField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + }; + + ///ͶƷ/Ʒֱ֤ + struct CThostFtdcInvestorProductGroupMarginField + { + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType LongFrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType ShortFrozenMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ͷ֤ + TThostFtdcMoneyType LongUseMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortUseMargin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///ͷ֤ + TThostFtdcMoneyType LongExchMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortExchMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + /// + TThostFtdcMoneyType FrozenCommission; + /// + TThostFtdcMoneyType Commission; + ///ʽ + TThostFtdcMoneyType FrozenCash; + ///ʽ + TThostFtdcMoneyType CashIn; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///۵ܽ + TThostFtdcMoneyType OffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortOffsetAmount; + ///۵ܽ + TThostFtdcMoneyType ExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortExchOffsetAmount; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + }; + + ///ѯû + struct CThostFtdcQueryCFMMCTradingAccountTokenField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///û + struct CThostFtdcCFMMCTradingAccountTokenField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬ + TThostFtdcCFMMCTokenType Token; + }; + + ///ѯƷ + struct CThostFtdcQryProductGroupField + { + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ͶƷ/Ʒֱ֤Ʒ + struct CThostFtdcProductGroupField + { + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductGroupID; + }; + + ///תʿ + struct CThostFtdcReqOpenAccountField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + }; + + ///ת + struct CThostFtdcReqCancelAccountField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + }; + + ///˻ + struct CThostFtdcReqChangeAccountField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; + }; + + ///ת + struct CThostFtdcReqTransferField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + }; + + ///зʽתڻӦ + struct CThostFtdcRspTransferField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + /// + struct CThostFtdcReqRepealField + { + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + }; + + ///Ӧ + struct CThostFtdcRspRepealField + { + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ѯ˻Ϣ + struct CThostFtdcReqQueryAccountField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + }; + + ///ѯ˻ϢӦ + struct CThostFtdcRspQueryAccountField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; + }; + + ///ǩǩ + struct CThostFtdcFutureSignIOField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + }; + + ///ǩӦ + struct CThostFtdcRspFutureSignInField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; + }; + + ///ǩ + struct CThostFtdcReqFutureSignOutField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + }; + + ///ǩӦ + struct CThostFtdcRspFutureSignOutField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ѯָˮŵĽ׽ + struct CThostFtdcReqQueryTradeResultBySerialField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ˮ + TThostFtdcSerialType Reference; + ///ˮŷߵĻ + TThostFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TThostFtdcOrganCodeType RefrenceIssure; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ժҪ + TThostFtdcDigestType Digest; + }; + + ///ѯָˮŵĽ׽Ӧ + struct CThostFtdcRspQueryTradeResultBySerialField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///ˮ + TThostFtdcSerialType Reference; + ///ˮŷߵĻ + TThostFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TThostFtdcOrganCodeType RefrenceIssure; + ///ԭʼش + TThostFtdcReturnCodeType OriginReturnCode; + ///ԭʼ + TThostFtdcDescrInfoForReturnCodeType OriginDescrInfoForReturnCode; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ժҪ + TThostFtdcDigestType Digest; + }; + + ///ļ + struct CThostFtdcReqDayEndFileReadyField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ļҵ + TThostFtdcFileBusinessCodeType FileBusinessCode; + ///ժҪ + TThostFtdcDigestType Digest; + }; + + ///ؽ + struct CThostFtdcReturnResultField + { + ///ش + TThostFtdcReturnCodeType ReturnCode; + /// + TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; + }; + + ///֤ڻʽ + struct CThostFtdcVerifyFuturePasswordField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///װ + TThostFtdcInstallIDType InstallID; + ///ID + TThostFtdcTIDType TID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///֤ͻϢ + struct CThostFtdcVerifyCustInfoField + { + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + }; + + ///֤ڻʽͿͻϢ + struct CThostFtdcVerifyFuturePasswordAndCustInfoField + { + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///֤ڻʽͿͻϢ + struct CThostFtdcDepositResultInformField + { + ///ˮţˮΪڱ̷صˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcRequestIDType RequestID; + ///ش + TThostFtdcReturnCodeType ReturnCode; + /// + TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; + }; + + ///׺ڱ̷Կͬ + struct CThostFtdcReqSyncKeyField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + }; + + ///׺ڱ̷ԿͬӦ + struct CThostFtdcRspSyncKeyField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ѯ˻Ϣ֪ͨ + struct CThostFtdcNotifyQueryAccountField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ת˽ˮ + struct CThostFtdcTransferSerialField + { + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateSerial; + ///׷ + TThostFtdcTradeDateType TradeDate; + /// + TThostFtdcDateType TradingDay; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///Ự + TThostFtdcSessionIDType SessionID; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///ڻ˾ʺ + TThostFtdcFutureAccTypeType FutureAccType; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///׽ + TThostFtdcTradeAmountType TradeAmount; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///Ч־ + TThostFtdcAvailabilityFlagType AvailabilityFlag; + ///Ա + TThostFtdcOperatorCodeType OperatorCode; + ///ʺ + TThostFtdcBankAccountType BankNewAccount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ѯתˮ + struct CThostFtdcQryTransferSerialField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///ǩ֪ͨ + struct CThostFtdcNotifyFutureSignInField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; + }; + + ///ǩ֪ͨ + struct CThostFtdcNotifyFutureSignOutField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///׺ڱ̷Կ֪ͬͨ + struct CThostFtdcNotifySyncKeyField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ѯǩԼϵ + struct CThostFtdcQryAccountregisterField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///ͻϢ + struct CThostFtdcAccountregisterField + { + /// + TThostFtdcTradeDateType TradeDay; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///ڻ˾֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + /// + TThostFtdcOpenOrDestroyType OpenOrDestroy; + ///ǩԼ + TThostFtdcTradeDateType RegDate; + ///Լ + TThostFtdcTradeDateType OutDate; + ///ID + TThostFtdcTIDType TID; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + }; + + ///ڿϢ + struct CThostFtdcOpenAccountField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///Ϣ + struct CThostFtdcCancelAccountField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ڱ˺Ϣ + struct CThostFtdcChangeAccountField + { + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + }; + + ///ԱȨ + struct CThostFtdcSecAgentACIDMapField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcCurrencyIDType CurrencyID; + ///нʽʺ + TThostFtdcAccountIDType BrokerSecAgentID; + }; + + ///ԱȨ޲ѯ + struct CThostFtdcQrySecAgentACIDMapField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///ֱĽȨ + struct CThostFtdcUserRightsAssignField + { + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; + }; + + ///ù˾ǷڱʾĽȨ + struct CThostFtdcBrokerUserRightAssignField + { + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; + ///ܷ + TThostFtdcBoolType Tradeable; + }; + + ///ֱת + struct CThostFtdcDRTransferField + { + ///ԭĴ + TThostFtdcDRIdentityIDType OrigDRIdentityID; + ///Ŀ꽻Ĵ + TThostFtdcDRIdentityIDType DestDRIdentityID; + ///ԭӦõԪ + TThostFtdcBrokerIDType OrigBrokerID; + ///ĿõԪ + TThostFtdcBrokerIDType DestBrokerID; + }; + + ///FensûϢ + struct CThostFtdcFensUserInfoField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ģʽ + TThostFtdcLoginModeType LoginMode; + }; + + ///ǰ + struct CThostFtdcCurrTransferIdentityField + { + ///Ĵ + TThostFtdcDRIdentityIDType IdentityID; + }; + + ///ֹ¼û + struct CThostFtdcLoginForbiddenUserField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + }; + + ///ѯֹ¼û + struct CThostFtdcQryLoginForbiddenUserField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + }; + + ///UDP鲥Ϣ + struct CThostFtdcMulticastGroupInfoField + { + ///鲥IPַ + TThostFtdcIPAddressType GroupIP; + ///鲥IP˿ + TThostFtdcIPPortType GroupPort; + ///Դַ + TThostFtdcIPAddressType SourceIP; + }; + + ///ʽ˻׼ + struct CThostFtdcTradingAccountReserveField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///׼ + TThostFtdcMoneyType Reserve; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///DBF¼ + struct CThostFtdcDBFRecordField + { + ///DBF + TThostFtdcDBFComdTypeType DBFComdType; + ///DBFʱ + TThostFtdcDBFComTimeType DBFComTime; + ///DBFԭʼˮ + TThostFtdcDBFComNoType DBFOComNo; + ///DBFˮ + TThostFtdcDBFComNoType DBFComNo; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName1; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent1; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName2; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent2; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName3; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent3; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName4; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent4; + }; +} // end of namespace KingstarAPI + +#endif diff --git a/include/Kingstar/IncEx/KSVocApi.h b/include/Kingstar/IncEx/KSVocApi.h new file mode 100644 index 0000000..dbb5e01 --- /dev/null +++ b/include/Kingstar/IncEx/KSVocApi.h @@ -0,0 +1,153 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSVocApi.h +///@brief ˿ͻ˿ͻƽӿ +///////////////////////////////////////////////////////////////////////// + +#ifndef __KSVOCAPI_H_INCLUDED_ +#define __KSVOCAPI_H_INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "KSUserApiStructEx.h" +#include "KSVocApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) && !defined(KSTRADEAPI_STATIC_LIB) +#ifdef LIB_TRADER_API_EXPORT +#define TRADER_VOCAPI_EXPORT __declspec(dllexport) +#else +#define TRADER_VOCAPI_EXPORT __declspec(dllimport) +#endif +#else +#ifdef WIN32 +#define TRADER_VOCAPI_EXPORT +#else +#define TRADER_VOCAPI_EXPORT __attribute__((visibility("default"))) +#endif + +#endif + +namespace KingstarAPI +{ + + class CKSVocSpi + { + public: + ///ѯǰijֲϸӦ + virtual void OnRspQryInvestorOpenPosition(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯǰϳֲϸӦ + virtual void OnRspQryInvestorOpenCombinePosition(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspBulkCancelOrder(CThostFtdcBulkCancelOrderField *pBulkCancelOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ƽֲԲѯӦ + virtual void OnRspQryCloseStrategy(CKSCloseStrategyResultField *pCloseStrategy, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ϲԲѯӦ + virtual void OnRspQryCombStrategy(CKSCombStrategyResultField *pCombStrategy, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ȨϲԲѯӦ + virtual void OnRspQryOptionCombStrategy(CKSOptionCombStrategyResultField *pOptionCombStrategy, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + + ///ѯͻתϢӦ + virtual void OnRspQryTransferInfo(CKSTransferInfoResultField *pResultField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֪ͨӦ + virtual void OnRspQryKSTradingNotice(CKSTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///û˲ƷԴѯӦ + virtual void OnRspQryUserProductUrl(CKSUserProductUrlField *pUserProductUrl, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ϲֵѯӦ + virtual void OnRspQryMaxCombActionVolume(CKSMaxCombActionVolumeField *pMaxCombActionVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnKSTradingNotice(CKSTradingNoticeField *pTradingNoticeInfo) {}; + + ///ѯȨԼӦ + virtual void OnRspQryKSOptionInstrCommRate(CKSOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼ֤Ӧ + virtual void OnRspQryKSInstrumentMarginRate(CKSInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ͻÿճӦ + virtual void OnRspFundOutCreditApply(CKSInputFundOutCreditApplyField *pFundOutCreditApply, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ͻÿճȲѯӦ + virtual void OnRspQryFundOutCredit(CKSRspQryFundOutCreditField *pRspQryFundOutCredit, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ͻÿճѯӦ + virtual void OnRspQryFundOutCreditApply(CKSRspQryFundOutCreditApplyField *pRspQryFundOutCreditApply, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ԤԼȡӦ + virtual void OnRspLargeFundOutApply(CKSLargeFundOutApplyField *pLargeFundOutApply, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ԤԼѯӦ + virtual void OnRspQryLargeFundOutApply(CKSRspLargeFundOutApplyField *pRspLargeFundOutApply, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + }; + + class TRADER_VOCAPI_EXPORT CKSVocApi + { + public: + ///ѯǰijֲϸ + virtual int ReqQueryInvestorOpenPosition(CThostFtdcQryInvestorPositionDetailField *pQryInvestorOpenPosition, int nRequestID) = 0; + + ///ѯǰϳֲϸ + virtual int ReqQueryInvestorOpenCombinePosition(CThostFtdcQryInvestorPositionCombineDetailField *pQryInvestorOpenCombinePosition, int nRequestID) = 0; + + /// + virtual int ReqBulkCancelOrder (CThostFtdcBulkCancelOrderField *pBulkCancelOrder, int nRequestID) = 0; + + ///ƽֲԲѯ + virtual int ReqQryCloseStrategy(CKSCloseStrategy *pCloseStrategy, int nRequestID) = 0; + + ///ϲԲѯ + virtual int ReqQryCombStrategy(CKSCombStrategy *pCombStrategy, int nRequestID) = 0; + + ///ȨϲԲѯ + virtual int ReqQryOptionCombStrategy(CKSOptionCombStrategy *pOptionCombStrategy, int nRequestID) = 0; + + ///ѯͻתϢ + virtual int ReqQryTransferInfo(CKSTransferInfo *pTransferInfo, int nRequestID) = 0; + + ///ѯ֪ͨ + virtual int ReqQryKSTradingNotice(CKSQryTradingNoticeField *pQryTradingNotice, int nRequestID) = 0; + + ///û˲ƷԴѯ + virtual int ReqQryUserProductUrl (CKSQryUserProductUrlField *pQryUserProductUrl, int nRequestID) = 0; + + ///ϲֵѯ + virtual int ReqQryMaxCombActionVolume(CKSQryMaxCombActionVolumeField *pQryMaxCombActionVolume, int nRequestID) = 0; + + ///ѯȨԼ + virtual int ReqQryKSOptionInstrCommRate(CKSQryOptionInstrCommRateField *pQryOptionInstrCommRate, int nRequestID) = 0; + + ///ѯԼ֤ + virtual int ReqQryKSInstrumentMarginRate(CKSQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0; + + ///ͻÿճ + virtual int ReqFundOutCreditApply(CKSInputFundOutCreditApplyField *pFundOutCreditApply, int nRequestID) = 0; + + ///ͻÿճȲѯ + virtual int ReqQryFundOutCredit(CKSQryFundOutCreditField *pQryFundOutCredit, int nRequestID) = 0; + + ///ͻÿճѯ + virtual int ReqQryFundOutCreditApply(CKSQryFundOutCreditApplyField *pQryFundOutCreditApply, int nRequestID) = 0; + + ///ԤԼȡ + virtual int ReqLargeFundOutApply(CKSLargeFundOutApplyField *pLargeFundOutApply, int nRequestID) = 0; + + ///ԤԼѯ + virtual int ReqQryLargeFundOutApply(CKSQryLargeFundOutApplyField *pQryLargeFundOutApply, int nRequestID) = 0; + + protected: + ~CKSVocApi(){}; + }; + +} // end of namespace KingstarAPI +#endif \ No newline at end of file diff --git a/include/Kingstar/IncEx/KSVocApiDataType.h b/include/Kingstar/IncEx/KSVocApiDataType.h new file mode 100644 index 0000000..fb7f0fd --- /dev/null +++ b/include/Kingstar/IncEx/KSVocApiDataType.h @@ -0,0 +1,363 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSVocApiDataType.h +///@brief ˿ͻ˽ӿʹõҵ +///////////////////////////////////////////////////////////////////////// + +#ifndef __KSVOCAPIDATATYPE_H_INCLUDED_ +#define __KSVOCAPIDATATYPE_H_INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +namespace KingstarAPI +{ + //չAPI + enum KS_EXTAPI_TYPE + { + KS_COS_API = 0, + KS_OPT_API, + KS_VOC_API, + KS_VOC_MDAPI, + KS_PRD_API + }; + + ///////////////////////////////////////////////////////////////////////// + ///TKSConditionalTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + ///ڵ +#define KSCOS_GreaterEqualTermPrice '0' + ///Сڵ +#define KSCOS_LesserThanTermPrice '1' + + typedef char TKSConditionalTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSConditionalOrderTypeһ + ///////////////////////////////////////////////////////////////////////// + ///鴥 +#define KSCOS_TRIGGERTYPE_QUOTATION '0' + ///̴ +#define KSCOS_TRIGGERTYPE_OPEN '1' + ///ʱ䴥 +#define KSCOS_TRIGGERTYPE_TIME '2' + ///ʱ䴥 +#define KSCOS_TRIGGERTYPE_QUOTAIONANDTIME '5' + + typedef char TKSConditionalOrderType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSConditionalOrderStateAlterTypeһͣ򼤻־ + ///////////////////////////////////////////////////////////////////////// + ///ͣ +#define KSCOS_State_PAUSE '0' + /// +#define KSCOS_State_ACTIVE '1' + + typedef char TKSConditionalOrderStateAlterType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSConditionalOrderSelectResultTypeһѡ + ///////////////////////////////////////////////////////////////////////// + // +#define KSCOS_Select_AGAIN '0' + // +#define KSCOS_Select_SKIP '1' + // ֹ +#define KSCOS_Select_ABORT '2' + + typedef char TKSConditionalOrderSelectResultType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSOrderPriceTypeTypeһ۸ + ///////////////////////////////////////////////////////////////////////// + // ¼ +#define KSCOS_OrderPrice_LastPrice '0' + // +#define KSCOS_OrderPrice_BidPrice '1' + // +#define KSCOS_OrderPrice_AskPrice '2' + + typedef char TKSOrderPriceTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSCloseModeTypeһƽּ۸ + ///////////////////////////////////////////////////////////////////////// + // м +#define KSPL_Close_MarketPrice '0' + // Ӽ +#define KSPL_Close_SalePrice '1' + //Ӽ¼ +#define KSPL_Close_LastPrice '2' + + typedef char TKSCloseModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSOffsetValueTypeһֹֹӯ۵ķʽ + ///////////////////////////////////////////////////////////////////////// + // ֵָ +#define KSPL_OffsetValue_TermPrice '0' + // ֳɽ۵ƫֵ +#define KSPL_OffsetValue_TradePrice '1' + + typedef char TKSOffsetValueType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSSpringTypeTypeһ۸ + ///////////////////////////////////////////////////////////////////////// + ///¼ +#define KSPL_SPRING_LastPrice '0' + /// +#define KSPL_SPRING_SalePrice '1' + + typedef char TKSSpringTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSConditionalOrderStatusTypeһ״̬ + ///////////////////////////////////////////////////////////////////////// + // ͣ +#define KSCOS_OrderStatus_PAUSENOTOUCHED '0' + // δ +#define KSCOS_OrderStatus_ACTIVENOTOUCHED '1' + //ɾ +#define KSCOS_OrderStatus_Deleted '2' + //Ѵδ +#define KSCOS_OrderStatus_TOUCHEDNOSEND '3' + // ͳʱ +#define KSCOS_OrderStatus_SENDTIMEOUT '4' + //ͳɹ +#define KSCOS_OrderStatus_SENDSUCCESS '5' + // ȴѡ +#define KSCOS_OrderStatus_WAITSELECT '6' + // ѡ +#define KSCOS_OrderStatus_SELECTSKIP '7' + // ѡֹ +#define KSCOS_OrderStatus_SELECTABORT '8' + + typedef char TKSConditionalOrderStatusType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSConditionalOrderIDTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef int TKSConditionalOrderIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSProfitAndLossOrderIDTypeһֹֹӯ + ///////////////////////////////////////////////////////////////////////// + typedef int TKSProfitAndLossOrderIDType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSConditionalOrderSelectTypeTypeһѡʽ + ///////////////////////////////////////////////////////////////////////// + // ȷϡȡ +#define KSCOS_Select_ConfirmORCancel '1' + // ԡֹ +#define KS_Select_AgainOrSkipOrAbort '2' + + typedef char TKSConditionalOrderSelectTypeType; + + + ///////////////////////////////////////////////////////////////////////// + const int MAX_ORDER_COUNT = 20; + + ///////////////////////////////////////////////////////////////////////// + ///TKSCloseStrategyTypeһƽֲ + ///////////////////////////////////////////////////////////////////////// + ///ȿƽͨ +#define KSVOC_OpenFCloseF_OrdiComb '1' + ///ͨϣȿƽ +#define KSVOC_OrdiComb_OpenFCloseF '2' + ///ڵ(ڵijֲƽƽ) +#define KSVOC_TodayF_TIME '3' + + typedef char TKSCloseStrategyType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSStrategyIDTypeһԴ + ///////////////////////////////////////////////////////////////////////// + typedef char TKSStrategyIDType[4]; + + ///////////////////////////////////////////////////////////////////////// + ///TKSCombTypeTypeһ + ///////////////////////////////////////////////////////////////////////// + /// +#define KSVOC_CombType_Arbitrage '0' + /// +#define KSVOC_CombType_Swap '1' + + typedef char TKSCombTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSStrikePriceTypeһִм + ///////////////////////////////////////////////////////////////////////// + // ִм۹ȵͶȸ +#define KSVOC_StrikePrice_Low 'L' + // ִм۹ȸ߶ȵ +#define KSVOC_StrikePrice_High 'H' + // ִм۹ͬ +#define KSVOC_StrikePrice_Minus 'E' + // У۸ϵ +#define KSVOC_StrikePrice_Plus 'N' + + typedef char TKSStrikePriceType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSCalcFlagTypeһ + ///////////////////////////////////////////////////////////////////////// + // +#define KSVOC_CalcFlag_Plus '1' + // +#define KSVOC_CalcFlag_Minus '2' + + typedef char TKSCalcFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TThostFtdcVolRatioTypeһ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcVolRatioType; + + ///////////////////////////////////////////////////////////////////////// + ///TThostFtdcMoneyRatioTypeһʽ + ///////////////////////////////////////////////////////////////////////// + typedef double TThostFtdcMoneyRatioType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSInfoTypeTypeһϢ + ///////////////////////////////////////////////////////////////////////// + // ͨ +#define KSVOC_InfoType_Common '1' + // +#define KSVOC_InfoType_Warn '2' + // Σ +#define KSVOC_InfoType_Risk '3' + // +#define KSVOC_InfoType_Roll '4' + // ǿȷ +#define KSVOC_InfoType_Force '5' + + typedef char TKSInfoTypeType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSConfirmFlagTypeһȷϱ־ + ///////////////////////////////////////////////////////////////////////// + // δȷ +#define KSVOC_ConfirmFlag_UnConfirm '0' + // ȷ +#define KSVOC_ConfirmFlag_Confirmed '1' + + typedef char TKSConfirmFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSProductVersionTypeһ汾 + ///////////////////////////////////////////////////////////////////////// + typedef char TKSProductVersionType[21]; + + ///////////////////////////////////////////////////////////////////////// + ///TKSProtectFlagTypeһԱ־ + ///////////////////////////////////////////////////////////////////////// + // +#define KSVOC_PF_True 'T' + // DZ +#define KSVOC_PF_Flase 'F' + + typedef char TKSProtectFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSControlRangeTypeһƷΧ + ///////////////////////////////////////////////////////////////////////// + // Ʒ +#define KSVOC_CR_Product '0' + // +#define KSVOC_CR_ALL '1' + + typedef char TKSControlRangeType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSTradeLevelTypeһ׼ + ///////////////////////////////////////////////////////////////////////// + // һ +#define KSVOC_TL_Level1 '1' + // +#define KSVOC_TL_Level2 '2' + // +#define KSVOC_TL_Level3 '3' + + typedef char TKSTradeLevelType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSSOPosiDirectionTypeһɳֲַ + ///////////////////////////////////////////////////////////////////////// + // Ȩ +#define KSVOC_SOPD_Buy '1' + // +#define KSVOC_SOPD_Sell '2' + + typedef char TKSSOPosiDirectionType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSSODelivModeTypeһɽղѯ + ///////////////////////////////////////////////////////////////////////// + // Ȩľ +#define KSVOC_SODM_Product '1' + // Ȩֽ㽻ϸ +#define KSVOC_SODM_Cash '2' + // ȨΥԼÿȯ +#define KSVOC_SODM_Dispos '3' + + typedef char TKSSODelivModeType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSCombActionTypeһǿ + ///////////////////////////////////////////////////////////////////////// + ///ǿ +#define KSVOC_CAT_False '0' + ///ǿ +#define KSVOC_CAT_True '1' + + typedef char TKSCombActionType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSCombStrategyIDTypeһϲԴ + ///////////////////////////////////////////////////////////////////////// + typedef char TKSCombStrategyIDType[9]; + + ///////////////////////////////////////////////////////////////////////// + ///TKSProfitAndLossFlagTypeһֹֹӯ־ + ///////////////////////////////////////////////////////////////////////// + // ֹֹӯ +#define KSCOS_PLF_NotProfitNotLoss '0' + // ֹ +#define KSCOS_PLF_Loss '1' + // ֹӯ +#define KSCOS_PLF_Profit '2' + // ֹֹӯ +#define KSCOS_PLF_ProfitAndLoss '3' + + typedef char TKSProfitAndLossFlagType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSFOCreditApplyTypeһճȲ + ///////////////////////////////////////////////////////////////////////// + /// +#define KSVOC_FOCAT_Confirm '0' + ///ȡ +#define KSVOC_FOCAT_NoConfirm '1' + + typedef char TKSFOCreditApplyType; + + ///////////////////////////////////////////////////////////////////////// + ///TKSFOCreditStatusTypeһճȴ״̬ + ///////////////////////////////////////////////////////////////////////// + /// +#define KSVOC_FOCST_SENDING '0' + ///ͨ +#define KSVOC_FOCST_ACCEPTED '1' + ///ѷ +#define KSVOC_FOCST_REJECT '2' + + typedef char TKSFOCreditStatusType; + +} // end of namespace KingstarAPI +#endif \ No newline at end of file diff --git a/include/Kingstar/IncEx/KSVocApiStruct.h b/include/Kingstar/IncEx/KSVocApiStruct.h new file mode 100644 index 0000000..b309ae9 --- /dev/null +++ b/include/Kingstar/IncEx/KSVocApiStruct.h @@ -0,0 +1,1922 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSVocApiStruct.h +///@brief ˿ͻ˽ӿʹõҵݽṹ +///////////////////////////////////////////////////////////////////////// + +#ifndef __KSVOCAPISTRUCT_H_INCLUDED_ +#define __KSVOCAPISTRUCT_H_INCLUDED_ + +#include "KSUserApiDataTypeEx.h" +#include "KSVocApiDataType.h" +#include "KSUserApiStructEx.h" + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +namespace KingstarAPI +{ + + ///ʼ¼ + struct CKSConditionalOrderInitInsert + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType CombHedgeFlag; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///۸ + TThostFtdcPriceType LimitPrice; + ///۸ + TKSOrderPriceTypeType OrderPriceType; + /// + TKSConditionalTypeType ConditionalType; + /// + TThostFtdcPriceType ConditionalPrice; + /// + TKSConditionalOrderIDType ConditionalOrderID; + /// + TThostFtdcVolumeType TriggeredTimes; + /// + TKSConditionalOrderType OrderType; + ///Чʱ + TThostFtdcTimeType ActiveTime; + ///ʧЧʱ + TThostFtdcTimeType InActiveTime; + ///Ҵ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///޸ + struct CKSConditionalOrderModify + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType CombHedgeFlag; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///۸ + TThostFtdcPriceType LimitPrice; + ///۸ + TKSOrderPriceTypeType OrderPriceType; + /// + TKSConditionalTypeType ConditionalType; + /// + TThostFtdcPriceType ConditionalPrice; + /// + TKSConditionalOrderIDType ConditionalOrderID; + /// + TThostFtdcVolumeType TriggeredTimes; + /// + TKSConditionalOrderType OrderType; + ///Чʱ + TThostFtdcTimeType ActiveTime; + ///ʧЧʱ + TThostFtdcTimeType InActiveTime; + ///Ҵ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///ѯ + struct CKSConditionalOrderQuery + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TKSConditionalOrderIDType ConditionalOrderID; + }; + + ///ɾ + struct CKSConditionalOrderRemove + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TKSConditionalOrderIDType ConditionalOrderID; + }; + + ///ͣ򼤻 + struct CKSConditionalOrderStateAlter + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TKSConditionalOrderIDType ConditionalOrderID; + ///ͣ򼤻־ + TKSConditionalOrderStateAlterType ConditionalOrderStateAlter; + }; + + ///ѡ + struct CKSConditionalOrderSelect + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TKSConditionalOrderIDType ConditionalOrderID; + ///ѡ + TKSConditionalOrderSelectResultType SelectResult; + }; + + + ///Ϣ + struct CKSConditionalOrderRspResultField + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TKSConditionalOrderIDType ConditionalOrderID; + }; + + ///Ӧ + struct CKSConditionalOrderOperResultField + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TKSConditionalOrderIDType ConditionalOrderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + ///ƽ־ + TThostFtdcOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType CombHedgeFlag; + /// + TThostFtdcDirectionType Direction; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + /// + TThostFtdcTradeDateType TradingDay; + ///û + TThostFtdcUserIDType UserID; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ͻ + TThostFtdcClientIDType ClientID; + ///״̬ + TKSConditionalOrderStatusType ConditionalOrderStatus; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcVolumeType TriggeredTimes; + /// + TKSConditionalOrderType OrderType; + ///ע + TThostFtdcMemoType Memo; + ///Чʱ + TThostFtdcTimeType ActiveTime; + ///ʧЧʱ + TThostFtdcTimeType InActiveTime; + /// + TKSConditionalTypeType ConditionalType; + /// + TThostFtdcPriceType ConditionalPrice; + }; + + ///¼ֹֹӯ + struct CKSProfitAndLossOrderInsert + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ֹ + TThostFtdcPriceType StopLossPrice; + ///ֹӯ + TThostFtdcPriceType TakeProfitPrice; + ///ƽַʽ + TKSCloseModeType CloseMode; + //ƽַӼλƽַʽ=12ʱЧ + TThostFtdcPriceType FiguresPrice; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ӯ۵ķʽ + TKSOffsetValueType OffsetValue; + ///۸ + TKSSpringTypeType SpringType; + ///ֹ + TThostFtdcPriceType FloatLimitPrice; + ///ֹ𵥴 + TThostFtdcVolumeType TriggeredTimes; + ///Ҵ + TThostFtdcCurrencyIDType CurrencyID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ֹֹӯ־ + TKSProfitAndLossFlagType ProfitAndLossFlag; + }; + + ///ɾֹֹӯ + struct CKSProfitAndLossOrderRemove + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֹֹӯ + TKSProfitAndLossOrderIDType ProfitAndLossOrderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + }; + + ///ѯֹֹӯ + struct CKSProfitAndLossOrderQuery + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֹֹӯ + TKSProfitAndLossOrderIDType ProfitAndLossOrderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + }; + + ///޸ֹֹӯ + struct CKSProfitAndLossOrderModify + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֹֹӯ + TKSProfitAndLossOrderIDType ProfitAndLossOrderID; + ///ֹ + TThostFtdcPriceType StopLossPrice; + ///ֹӯ + TThostFtdcPriceType TakeProfitPrice; + ///ƽַʽ + TKSCloseModeType CloseMode; + //ƽַλƽַʽ=12ʱЧ + TThostFtdcPriceType FiguresPrice; + ///ӯ۵ķʽ + TKSOffsetValueType OffsetValue; + ///۸ + TKSSpringTypeType SpringType; + ///ֹ + TThostFtdcPriceType FloatLimitPrice; + /// + TThostFtdcVolumeType TriggeredTimes; + ///ֹֹӯ־ + TKSProfitAndLossFlagType ProfitAndLossFlag; + }; + + ///ֹֹӯɾ + struct CKSProfitAndLossOrderRemoveField + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֹֹӯ + TKSProfitAndLossOrderIDType ProfitAndLossOrderID; + }; + + ///ֹֹӯ + struct CKSProfitAndLossOrderOperResultField + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֹֹӯ + TKSProfitAndLossOrderIDType ProfitAndLossOrderID; + ///Ա + TThostFtdcUserIDType UserID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ֹ + TThostFtdcPriceType StopLossPrice; + ///ֹӯ + TThostFtdcPriceType TakeProfitPrice; + ///ƽַʽ + TKSCloseModeType CloseMode; + ///ƽַӼλƽַʽ=12ʱЧ + TThostFtdcPriceType Figures; + ///鴥ʱ¼ + TThostFtdcPriceType LastPrice; + ///ֹֹӯʱ + TThostFtdcTimeType ProfitAndLossOrderFormTime; + ///ʱ + TThostFtdcTimeType ConditionalOrderFormTime; + ///ίеʱ + TThostFtdcTimeType OrderFormTime; + ///ֹֹӯ״̬ + TKSConditionalOrderStatusType ProfitAndLossOrderStatus; + /// + TKSConditionalOrderIDType ConditionalOrderID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ƽ־ + TThostFtdcOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType CombHedgeFlag; + /// + TThostFtdcDirectionType Direction; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///ӯ۵ķʽ + TKSOffsetValueType OffsetValue; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///۸ + TKSSpringTypeType SpringType; + ///ֹ + TThostFtdcPriceType FloatLimitPrice; + ///ֳɽ۸ + TThostFtdcPriceType OpenTradePrice; + ///ֹֹӯ־ + TKSProfitAndLossFlagType ProfitAndLossFlag; + }; + + // ѡϢ + struct CKSCOSAskSelectField + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcUserIDType UserID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TKSConditionalOrderIDType ConditionalOrderID; + ///ע + TThostFtdcMemoType Memo; + ///ѡʽ + TKSConditionalOrderSelectTypeType SelectType; + }; + + // ״̬Ϣ + struct CKSCOSStatusField + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcUserIDType UserID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TKSConditionalOrderIDType ConditionalOrderID; + ///״̬ + TKSConditionalOrderStatusType ConditionalOrderStatus; + ///ע + TThostFtdcMemoType Memo; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + ///ƽ־ + TThostFtdcOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType CombHedgeFlag; + /// + TThostFtdcDirectionType Direction; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + /// + TThostFtdcTradeDateType TradingDay; + ///û + TThostFtdcUserIDType CancelUserID; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ɽ۸ + TThostFtdcPriceType TradePrice; + ///Ҵ + TThostFtdcCurrencyIDType CurrencyID; + }; + + // ֹֹӯ״̬Ϣ + struct CKSPLStatusField + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcUserIDType UserID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ֹֹӯ + TKSProfitAndLossOrderIDType ProfitAndLossOrderID; + ///ֹ + TKSConditionalOrderIDType StopLossOrderID; + ///ֹӯ + TKSConditionalOrderIDType TakeProfitOrderID; + ///ӯ״̬ + TKSConditionalOrderStatusType ProfitAndLossOrderStatus; + ///ֹ + TThostFtdcPriceType StopLossPrice; + ///ֹӯ + TThostFtdcPriceType TakeProfitPrice; + ///ӯ۵ķʽ + TKSOffsetValueType OffsetValue; + ///ֳɽ۸ + TThostFtdcPriceType OpenTradePrice; + ///ע + TThostFtdcMemoType Memo; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + ///ƽ־ + TThostFtdcOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType CombHedgeFlag; + /// + TThostFtdcDirectionType Direction; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + /// + TThostFtdcTradeDateType TradingDay; + ///û + TThostFtdcUserIDType CancelUserID; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ɽ۸ + TThostFtdcPriceType TradePrice; + ///Ҵ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///ѯָֻ + struct CKSQryIndexPriceField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + ///ѯָֻ + struct CKSIndexPriceField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ָֻ̼ + TThostFtdcPriceType ClosePrice; + ///ȫϵ + TThostFtdcRatioType GuarantRatio; + }; + + ///ѯȨԼϵ + struct CKSQryOptionInstrGuardField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + }; + + ///ѯȨԼϵ + struct CKSOptionInstrGuardField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͱϵ + TThostFtdcVolumeType MiniNumerator; + ///ͱϵĸ + TThostFtdcVolumeType MiniDenominator ; + ///ȨԼС֤ + TThostFtdcMoneyType MiniMargin; + }; + + ///ѯ + struct CKSQryExecOrderVolumeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///־ + TThostFtdcDirectionType Direction; + }; + + ///ѯ + struct CKSExecOrderVolumeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcVolumeType ExecVolume; + /// + TThostFtdcVolumeType ActionVolume; + ///ִ + TThostFtdcVolumeType ExecedVolume; + /// + TThostFtdcVolumeType ActionedVolume; + ///־ + TThostFtdcDirectionType Direction; + }; + + ///ȨָϢ + struct CKSQryStockOptionAssignmentField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + }; + + ///ȨָϢ + struct CKSStockOptionAssignmentField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentNameType InstrumentName; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ȨָɺԼ + TThostFtdcVolumeType AssInsVo; + ///Ȩ֤ȯ + TThostFtdcVolumeType AssProVol; + ///ȨָӦ + TThostFtdcMoneyType FeePay; + ///ȨC/P־ + TThostFtdcOptionsTypeType OptionsType; + ///Ȩ + TThostFtdcDateType DeliveryDay; + ///ɺԼʶ + TThostFtdcInstrumentIDType StockID; + }; + + ///Key + struct CThostOrderKeyField + { + /// + TThostFtdcOrderRefType OrderRef; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + }; + + /// + struct CThostFtdcBulkCancelOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcOrderTypeType OrderType; + /// + TThostFtdcVolumeType nCount; + /// + CThostOrderKeyField OrderKey[MAX_ORDER_COUNT]; + }; + + ///ƽֲ + struct CKSCloseStrategy + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///ƽֲӦ + struct CKSCloseStrategyResultField + { + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcExchangeNameType ExchangeName; + ///ƽֲ + TKSCloseStrategyType CloseStrategy; + }; + + ///ϲ + struct CKSCombStrategy + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///(1:ڻ;2:Ȩ;:ȫ) + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Դ(SP/SPD) + TKSStrategyIDType StrategyID; + /// + TKSCombTypeType CombType; + }; + + ///ϲӦ + struct CKSCombStrategyResultField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///Դ + TKSStrategyIDType StrategyID; + /// + TKSCombTypeType CombType; + /// + TThostFtdcDirectionType CombDirection; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + /// + TThostFtdcVolumeType Volume; + ///һ + TThostFtdcDirectionType Direction1; + ///ƽ־һ + TThostFtdcOffsetFlagType OffsetFlag1; + ///һ + TThostFtdcVolRatioType VolRatio1; + ///һ + TKSCalcFlagType CalcFlag1; + ///֤һ + TThostFtdcMoneyRatioType MarginRatio1; + /// + TThostFtdcDirectionType Direction2; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag2; + /// + TThostFtdcVolRatioType VolRatio2; + ///Ŷ + TKSCalcFlagType CalcFlag2; + ///֤ + TThostFtdcMoneyRatioType MarginRatio2; + /// + TThostFtdcDirectionType Direction3; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag3; + /// + TThostFtdcVolRatioType VolRatio3; + /// + TKSCalcFlagType CalcFlag3; + ///֤ + TThostFtdcMoneyRatioType MarginRatio3; + /// + TThostFtdcDirectionType Direction4; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag4; + /// + TThostFtdcVolRatioType VolRatio4; + /// + TKSCalcFlagType CalcFlag4; + ///֤ + TThostFtdcMoneyRatioType MarginRatio4; + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + }; + + ///Ȩϲ + struct CKSOptionCombStrategy + { + ///Ӫҵ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Դ + TKSStrategyIDType StrategyID; + /// + TThostFtdcDirectionType CombDirection; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + }; + + ///ȨϲӦ + struct CKSOptionCombStrategyResultField + { + /// + TThostFtdcExchangeIDType ExchangeID; + ///Դ + TKSStrategyIDType StrategyID; + /// + TThostFtdcDirectionType CombDirection; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + /// + TThostFtdcVolumeType Volume; + ///һ + TThostFtdcDirectionType Direction1; + ///Ȩһ + TThostFtdcOptionsTypeType OptionsType1; + ///ִмһ + TKSStrikePriceType StrikeType1; + ///ƽ־һ + TThostFtdcOffsetFlagType OffsetFlag1; + ///һ + TThostFtdcVolRatioType VolRatio1; + ///֤һ + TThostFtdcMoneyRatioType MarginRatio1; + ///һ + TKSCalcFlagType CalcFlag1; + /// + TThostFtdcDirectionType Direction2; + ///ȨͶ + TThostFtdcOptionsTypeType OptionsType2; + ///ִмͶ + TKSStrikePriceType StrikeType2; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag2; + /// + TThostFtdcVolRatioType VolRatio2; + ///֤ + TThostFtdcMoneyRatioType MarginRatio2; + ///Ŷ + TKSCalcFlagType CalcFlag2; + /// + TThostFtdcDirectionType Direction3; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType3; + ///ִм + TKSStrikePriceType StrikeType3; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag3; + /// + TThostFtdcVolRatioType VolRatio3; + ///֤ + TThostFtdcMoneyRatioType MarginRatio3; + /// + TKSCalcFlagType CalcFlag3; + /// + TThostFtdcDirectionType Direction4; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType4; + ///ִм + TKSStrikePriceType StrikeType4; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag4; + /// + TThostFtdcVolRatioType VolRatio4; + ///֤ + TThostFtdcMoneyRatioType MarginRatio4; + /// + TKSCalcFlagType CalcFlag4; + }; + + ///ѯͻתϢ + struct CKSTransferInfo + { + ///д + TThostFtdcBankIDType BankID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///ѯͻתϢӦ + struct CKSTransferInfoResultField + { + ///ʼʱ + TThostFtdcTimeType DepositBegin; + ///ʱ + TThostFtdcTimeType DepositEnd; + ///ʼʱ + TThostFtdcTimeType WithdrawBegin; + ///ʱ + TThostFtdcTimeType WithdrawEnd; + /// + TThostFtdcLargeVolumeType WithdrawVolume; + ///޶ + TThostFtdcMoneyType WithdrawLimit; + ///𵥱޶ + TThostFtdcMoneyType WithdrawLimitByTrade; + ///ʽ + TThostFtdcMoneyType Available; + ///ѳ + TThostFtdcLargeVolumeType WithdrawedVolume; + ///ѳ + TThostFtdcMoneyType WithdrawedAmount; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + }; + + ///ѯKingstar¼֪ͨ + struct CKSQryTradingNoticeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ϣ + TKSInfoTypeType InfoType; + ///ȷϱ־ + TKSConfirmFlagType ConfirmFlag; + ///ʼʱ + TThostFtdcTimeType TimeStart; + ///ʱ + TThostFtdcTimeType TimeEnd; + }; + + ///û¼֪ͨ + struct CKSTradingNoticeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ϣ + TKSInfoTypeType InfoType; + ///ϢժҪ + TThostFtdcDigestType InfoDigest; + ///Ϣ + TThostFtdcContentType FieldContent; + /// + TThostFtdcTimeType SendDate; + ///ʱ + TThostFtdcTimeType SendTime; + ///к + TThostFtdcSequenceNoType SequenceNo; + ///ȷϱ־ + TKSConfirmFlagType ConfirmFlag; + }; + + ///û˲ƷԴѯ + struct CKSQryUserProductUrlField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + }; + + ///û˲ƷԴ + struct CKSUserProductUrlField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///û˲Ʒ°汾 + TKSProductVersionType LastProductVersion; + ///û˲ƷͰ汾 + TKSProductVersionType MinUseProductVersion; + ///û˲ƷͰ汾 + TKSProductVersionType MinUpdateVersion; + ///û˲Ʒ°汾װС + TThostFtdcLargeVolumeType InstallPackSize; + ///û˲Ʒ°汾 + TThostFtdcTradeDateType PublishDate; + ///û˲Ʒ°汾˵ + TThostFtdcUserProductMemoType ProductMemo; + ///û˲ƷԴUrlַ + TThostFtdcFunctionUrlType Url; + }; + + ///ѯͻ׼ + struct CKSQryInvestorTradeLevelField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + }; + + ///ͻ׼ + struct CKSInvestorTradeLevelField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///׼ + TKSTradeLevelType TradeLevel; + }; + + ///ѯ޹ + struct CKSQryPurchaseLimitAmtField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///޹ + struct CKSPurchaseLimitAmtField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///޹ + TThostFtdcMoneyType PurLimitAmt; + }; + + ///ѯ޲ֶ + struct CKSQryPositionLimitVolField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ա־ + TKSProtectFlagType ProtectFlag; + ///ȨC/P־ + TThostFtdcOptionsTypeType OptionsType; + ///ƷΧ + TKSControlRangeType ControlRange; + }; + + ///ѯ޲ֶ + struct CKSPositionLimitVolField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ա־ + TKSProtectFlagType ProtectFlag; + ///ȨC/P־ + TThostFtdcOptionsTypeType OptionsType; + ///ƷΧ + TKSControlRangeType ControlRange; + ///޲ֶ + TThostFtdcVolumeType PosiLimitVol; + }; + + ///ѯʷ + struct CKSQryHistoryOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ʒִ + TThostFtdcInstrumentIDType ProductID; + ///ʼ + TThostFtdcDateType OrderDataStart; + /// + TThostFtdcDateType OrderDataEnd; + }; + + ///ѯʷɽ + struct CKSQryHistoryTradeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ʒִ + TThostFtdcInstrumentIDType ProductID; + ///ʼ + TThostFtdcDateType TradeDataStart; + /// + TThostFtdcDateType TradeDataEnd; + }; + + ///ʷ + struct CKSHistoryOrderField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///걨ʱ + TThostFtdcTimeType InsertTime; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ɽ۸ + TThostFtdcPriceType TradePrice; + ///ɽ + TThostFtdcMoneyType TradeAmount; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ⶳ + TThostFtdcMoneyType FrozenAmount; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcExchangeIDType ExchangeID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + /// + TThostFtdcRequestIDType RequestID; + /// + TThostFtdcOrderRefType OrderRef; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ίм۸ + TThostFtdcPriceType OrderPrice; + ///ίԴ + TThostFtdcOrderSourceType OrderSource; + ///ί + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType OrderTime; + ///ί + TThostFtdcVolumeType VolumeTotalOriginal; + ///ί״̬ + TThostFtdcOrderStatusType OrderStatus; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductNameType ProductName; + ///Ʒ + TThostFtdcProductClassType ProductClass; + ///Ͷƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///ҵ + TThostFtdcFunctionNameType FunctionName; + }; + + ///ʷɽ + struct CKSHistoryTradeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductNameType ProductName; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ɽ + TThostFtdcMoneyType TradeAmount; + ///ɽ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///Ͷƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcMoneyType Commission; + ///ע + TThostFtdcMemoType Memo; + ///ʱ + TThostFtdcTimeType TraderOfferTime; + ///ɽ۸ + TThostFtdcPriceType TradePrice; + ///Ȩױ + TThostFtdcClientIDType ClientID; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + ///ұ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///Ȩ + TThostFtdcVolumeType RoyaltyVolume; + /// + TThostFtdcVolumeType ObligationVolume; + ///Ȩֽ + TThostFtdcMoneyType RoyaltyAmount; + ///ֽ + TThostFtdcMoneyType ObligationAmount; + ///ɽ + TThostFtdcTradeIDType TradeID; + ///ҵ + TThostFtdcFunctionNameType FunctionName; + }; + + ///ϲֵѯ + struct CKSQryMaxCombActionVolumeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + //ϲֱ + TThostFtdcCombDirectionType CombDirection; + }; + + ///ϲֵ + struct CKSMaxCombActionVolumeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcVolumeType MaxCombVolume; + ///ɲ + TThostFtdcVolumeType MaxActionVolume; + }; + + ///ѯȨָϸ + struct CKSQryHistoryAssignmentField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ + TThostFtdcHedgeFlagType HedgeFlag; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + /// + TThostFtdcDateType DeliveryMonth; + ///ֲַ + TKSSOPosiDirectionType PosiDirection; + }; + + ///ѯȨϸ + struct CKSQrySODelivDetailField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcDateType DeliveryMonth; + ///ɽղѯ + TKSSODelivModeType DelivMode; + }; + + ///ԶȨִв + struct CKSAutoExecOrderActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ԶȨֵ(0-ԶȨ,0-ֵԶȨ(2020%)) + TThostFtdcVolumeType RangeVol; + }; + + ///Ȩָϸ + struct CKSHistoryAssignmentField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcTradeDateType TradingDay; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///֤ȯ + TThostFtdcInstrumentIDType StockInstr; + ///Ͷ + TThostFtdcHedgeFlagType HedgeFlag; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + ///ֲַ + TKSSOPosiDirectionType PosiDirection; + ///ִм + TThostFtdcPriceType StrikePrice; + ///Ȩָ + TThostFtdcVolumeType ExecVol; + ///֤ȯӦո + TThostFtdcVolumeType IOVol; + ///Ӧո + TThostFtdcMoneyType IOAmt; + ///Ȩ + TThostFtdcDateType DelivDate; + }; + + ///Ȩϸ + struct CKSSODelivDetailField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯ + TThostFtdcInstrumentIDType StockInstr; + ///Ӧ/Ӧ/ȯ֤ȯ + TThostFtdcVolumeType IOVol; + ///ʵո + TThostFtdcVolumeType IOVolInFact; + /// + TThostFtdcPriceType SettlementPrice; + ///ȯֵ/ + TThostFtdcMoneyType SettlementAmt; + ///Ȩ + TThostFtdcDateType DelivDate; + ///ҵ + TThostFtdcFunctionNameType FunctionName; + }; + + ///ҵ + struct CKSSubPrimeDataBusinessField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + }; + + ///ҵ + struct CKSPrimeDataBusinessField + { + ///洢 + TThostFtdcProcessNameType ProcessName; + ///ܷʽ + TThostFtdcFBTEncryModeType EncryMode; + ///Կ + TThostFtdcPasswordKeyType PasswordKey; + ///ݹ鵵״̬ + TThostFtdcSaveStatusType SaveStatus; + }; + + ///ָĺԼ + struct CKSSpecificInstrumentField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ѯԼ֤ + struct CKSQryInstrumentMarginRateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///Լ֤ + struct CKSInstrumentMarginRateField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ĸϲ + struct CKSInputCombActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Դ + TKSCombStrategyIDType StrategyID; + ///Լ1 + TThostFtdcInstrumentIDType InstrumentID1; + ///Լ2 + TThostFtdcInstrumentIDType InstrumentID2; + ///Լ3 + TThostFtdcInstrumentIDType InstrumentID3; + ///Լ4 + TThostFtdcInstrumentIDType InstrumentID4; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + ///1 + TThostFtdcDirectionType Direction1; + ///2 + TThostFtdcDirectionType Direction2; + ///3 + TThostFtdcDirectionType Direction3; + ///4 + TThostFtdcDirectionType Direction4; + ///ǿ + TKSCombActionType CombActionFlag; + /// + TThostFtdcVolumeType Volume; + ///ϲֱ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + }; + + ///ϲ + struct CKSCombActionField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Դ + TKSCombStrategyIDType StrategyID; + ///Լ1 + TThostFtdcInstrumentIDType InstrumentID1; + ///Լ2 + TThostFtdcInstrumentIDType InstrumentID2; + ///Լ3 + TThostFtdcInstrumentIDType InstrumentID3; + ///Լ4 + TThostFtdcInstrumentIDType InstrumentID4; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + ///1 + TThostFtdcDirectionType Direction1; + ///2 + TThostFtdcDirectionType Direction2; + ///3 + TThostFtdcDirectionType Direction3; + ///4 + TThostFtdcDirectionType Direction4; + ///ǿ + TKSCombActionType CombActionFlag; + /// + TThostFtdcVolumeType Volume; + ///ϲֱ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + }; + + ///ѯϳֲϸ + struct CKSQryInvestorPositionCombineDetailField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + }; + + ///ϳֲϸ + struct CKSInvestorPositionCombineDetailField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ױ + TThostFtdcClientIDType ClientID; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + ///Դ + TKSCombStrategyIDType StrategyID; + ///Լ1 + TThostFtdcInstrumentIDType InstrumentID1; + ///Լ2 + TThostFtdcInstrumentIDType InstrumentID2; + ///Լ3 + TThostFtdcInstrumentIDType InstrumentID3; + ///Լ4 + TThostFtdcInstrumentIDType InstrumentID4; + ///ռñ֤ + TThostFtdcMoneyType Margin; + ///Զ + TThostFtdcVolumeType CombActionVolume; + ///Ͷ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcVolumeType TotalAmt; + ///1 + TThostFtdcDirectionType Direction1; + ///2 + TThostFtdcDirectionType Direction2; + ///3 + TThostFtdcDirectionType Direction3; + ///4 + TThostFtdcDirectionType Direction4; + /// + TThostFtdcDirectionType CombDirection; + }; + + ///ɿϿɲѯ + struct CKSQryCombActionVolumeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Դ + TKSCombStrategyIDType StrategyID; + ///Լ1 + TThostFtdcInstrumentIDType InstrumentID1; + ///Լ2 + TThostFtdcInstrumentIDType InstrumentID2; + ///Լ3 + TThostFtdcInstrumentIDType InstrumentID3; + ///Լ4 + TThostFtdcInstrumentIDType InstrumentID4; + ///Ͷ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϲֱ + TThostFtdcCombDirectionType CombDirection; + ///1 + TThostFtdcDirectionType Direction1; + ///2 + TThostFtdcDirectionType Direction2; + ///3 + TThostFtdcDirectionType Direction3; + ///4 + TThostFtdcDirectionType Direction4; + ///ǿ + TKSCombActionType CombActionFlag; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + }; + + ///ɿϿɲ + struct CKSCombActionVolumeField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcVolumeType MaxCombVolume; + ///ɲ + TThostFtdcVolumeType MaxActionVolume; + }; + + ///ͻÿճ + struct CKSInputFundOutCreditApplyField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ճ + TThostFtdcMoneyType FundOutCredit; + ///ճȲ + TKSFOCreditApplyType CreditApplyFlag; + ///ˮ + TThostFtdcTradeSerialNoType CreditSerial; + }; + + ///ͻÿճȲѯ + struct CKSQryFundOutCreditField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + }; + + ///ͻÿճȲѯ + struct CKSRspQryFundOutCreditField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ճ + TThostFtdcMoneyType FundOutCredit; + ///ѳ + TThostFtdcMoneyType FundOutedCredit; + /// + TThostFtdcDateType UpdateDate; + /// + TThostFtdcDateType SetDate; + ///ʱ + TThostFtdcTimeType SetTime; + }; + + ///ͻÿճѯ + struct CKSQryFundOutCreditApplyField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ѯʼ + TThostFtdcDateType QryCreditStart; + ///ѯ + TThostFtdcDateType QryCreditEnd; + ///ճȴ״̬ + TKSFOCreditStatusType DealStatus; + }; + + ///ͻÿճѯ + struct CKSRspQryFundOutCreditApplyField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ˮ + TThostFtdcTradeSerialNoType CreditSerial; + /// + TThostFtdcMoneyType FundOutCredit; + ///ճȴ״̬ + TKSFOCreditStatusType DealStatus; + /// + TThostFtdcDateType ApplyDate; + ///ʱ + TThostFtdcTimeType ApplyTime; + /// + TThostFtdcDateType ConfirmDate; + ///ʱ + TThostFtdcTimeType ConfirmTime; + }; + + ///ԤԼȡ + struct CKSLargeFundOutApplyField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ԤԼ + TThostFtdcDateType ApplyDate; + /// + TKSFOCreditApplyType ApplyFlag; + ///ˮ + TThostFtdcTradeSerialNoType ApplySerial; + ///ԤԼ + TThostFtdcMoneyType FundOutCredit; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///д + TThostFtdcBankIDType BankID; + }; + + ///ԤԼѯ + struct CKSQryLargeFundOutApplyField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ԤԼ + TThostFtdcDateType ApplyDate; + ///ԤԼ + TThostFtdcDateType FundOutDate; + ///״̬ + TKSFOCreditStatusType ApplyFlag; + ///д + TThostFtdcBankIDType BankID; + }; + + ///ԤԼѯ + struct CKSRspLargeFundOutApplyField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ˮ + TThostFtdcTradeSerialNoType ApplySerial; + ///״̬ + TKSFOCreditStatusType ApplyFlag; + ///д + TThostFtdcBankIDType BankID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ԤԼ + TThostFtdcMoneyType FundOutCredit; + ///ԤԼ + TThostFtdcDateType ApplyDate; + ///ԤԼ + TThostFtdcDateType FundOutDate; + /// + TThostFtdcDateType SetDate; + ///ʱ + TThostFtdcTimeType SetTime; + }; + + ///Ȩʲѯ + struct CKSQryOptionInstrCommRateField + { + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + }; + + ///ǰȨԼѵϸ + struct CKSOptionInstrCommRateField + { + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///򿪲 + TThostFtdcRatioType BuyOpenRatioByMoney; + ///򿪲 + TThostFtdcRatioType BuyOpenRatioByVolume; + ///ƽ + TThostFtdcRatioType BuyCloseRatioByMoney; + ///ƽ + TThostFtdcRatioType BuyCloseRatioByVolume; + ///Ȩ + TThostFtdcRatioType StrikeRatioByMoney; + ///Ȩ + TThostFtdcRatioType StrikeRatioByVolume; + /// + TThostFtdcRatioType SellOpenRatioByMoney; + /// + TThostFtdcRatioType SellOpenRatioByVolume; + ///ƽ + TThostFtdcRatioType SellCloseRatioByMoney; + ///ƽ + TThostFtdcRatioType SellCloseRatioByVolume; + ///ҿ + TThostFtdcRatioType CoveredOpenRatioByMoney; + ///ҿ + TThostFtdcRatioType CoveredOpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CoveredCloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CoveredCloseRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + }; +} // end of namespace KingstarAPI +#endif \ No newline at end of file diff --git a/include/Kingstar/IncEx/KSVocMdApi.h b/include/Kingstar/IncEx/KSVocMdApi.h new file mode 100644 index 0000000..510c564 --- /dev/null +++ b/include/Kingstar/IncEx/KSVocMdApi.h @@ -0,0 +1,67 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSVocMDApi.h +///@brief ˿ͻ˿ͻӿ +///////////////////////////////////////////////////////////////////////// + +#ifndef __KSVOCMDAPI_H_INCLUDED_ +#define __KSVOCMDAPI_H_INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "KSUserApiStructEx.h" +#include "KSVocApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) && !defined(KSMDAPI_STATIC_LIB) +#ifdef LIB_MD_API_EXPORT +#define TRADER_VOCMDAPI_EXPORT __declspec(dllexport) +#else +#define TRADER_VOCMDAPI_EXPORT __declspec(dllimport) +#endif +#else +#ifdef WIN32 +#define TRADER_VOCMDAPI_EXPORT +#else +#define TRADER_VOCMDAPI_EXPORT __attribute__((visibility("default"))) +#endif + +#endif + +namespace KingstarAPI +{ + + class CKSVocMdSpi + { + public: + ///Ӧ + virtual void OnRspSubKSMarketData(CKSSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡӦ + virtual void OnRspUnSubKSMarketData(CKSSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + }; + + class TRADER_VOCMDAPI_EXPORT CKSVocMdApi + { + public: + ///顣 + ///@param ppInstrumentID Լ + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeKSMarketData(CKSSpecificInstrumentField *ppInstrumentID[], int nCount) = 0; + + ///˶顣 + ///@param ppInstrumentID Լ + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeKSMarketData(CKSSpecificInstrumentField *ppInstrumentID[], int nCount) = 0; + + protected: + ~CKSVocMdApi(){}; + }; + +} // end of namespace KingstarAPI +#endif \ No newline at end of file diff --git a/include/Kingstar/inc/KSMarketDataAPI.h b/include/Kingstar/inc/KSMarketDataAPI.h new file mode 100644 index 0000000..58297d8 --- /dev/null +++ b/include/Kingstar/inc/KSMarketDataAPI.h @@ -0,0 +1,34 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSMarketDataAPI.h +///@brief ˿ͻ˽ӿʹõҵͨѶӿ +///@history +///20140801 Kingstar IRDG ļ +///////////////////////////////////////////////////////////////////////// + +#ifndef __KSFMDUSER_API_H__ +#define __KSFMDUSER_API_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#ifdef WIN32 +#ifdef KSFMDUSERAPI_EXPORTS +#define KSFMDUSERAPI __declspec(dllexport) +#else +#define KSFMDUSERAPI __declspec(dllimport) +#endif +#else +#ifdef KSFMDUSERAPI_EXPORTS +#define KSFMDUSERAPI __attribute__ ((visibility ("default"))) +#else +#define KSFMDUSERAPI +#endif +#endif + +#include "../IncEx/KSMdApiEx.h" +#include "../IncEx/KSVocMdApi.h" + +#endif \ No newline at end of file diff --git a/include/Kingstar/inc/KSTradeAPI.h b/include/Kingstar/inc/KSTradeAPI.h new file mode 100644 index 0000000..4b14c60 --- /dev/null +++ b/include/Kingstar/inc/KSTradeAPI.h @@ -0,0 +1,36 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company SunGard China +///@file KSTradeAPI.h +///@brief ˿ͻ˽ӿʹõҵͨѶӿ +///@history +///20140801 Kingstar IRDG ļ +///////////////////////////////////////////////////////////////////////// + +#ifndef __KSFTRADER_API_H__ +#define __KSFTRADER_API_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#ifdef WIN32 +#ifdef KSFTRADERAPI_EXPORTS +#define KSFTRADERAPI __declspec(dllexport) +#else +#define KSFTRADERAPI __declspec(dllimport) +#endif +#else +#ifdef KSFTRADERAPI_EXPORTS +#define KSFTRADERAPI __attribute__ ((visibility ("default"))) +#else +#define KSFTRADERAPI +#endif +#endif + +#include "../IncEx/KSTraderApiEx.h" +#include "../IncEx/KSCosApi.h" +#include "../IncEx/KSOptionApi.h" +#include "../IncEx/KSVocApi.h" + +#endif \ No newline at end of file diff --git a/include/Kingstar/version.txt b/include/Kingstar/version.txt new file mode 100644 index 0000000..e2abbe4 --- /dev/null +++ b/include/Kingstar/version.txt @@ -0,0 +1 @@ +20150813 \ No newline at end of file diff --git a/include/Kingstar/win32/KSInterB2C.lkc b/include/Kingstar/win32/KSInterB2C.lkc new file mode 100644 index 0000000..bd9f49d Binary files /dev/null and b/include/Kingstar/win32/KSInterB2C.lkc differ diff --git a/include/Kingstar/win32/KSMarketDataAPI.dll b/include/Kingstar/win32/KSMarketDataAPI.dll new file mode 100644 index 0000000..df9eab9 Binary files /dev/null and b/include/Kingstar/win32/KSMarketDataAPI.dll differ diff --git a/include/Kingstar/win32/KSMarketDataAPI.lib b/include/Kingstar/win32/KSMarketDataAPI.lib new file mode 100644 index 0000000..46006df Binary files /dev/null and b/include/Kingstar/win32/KSMarketDataAPI.lib differ diff --git a/include/Kingstar/win32/KSTradeAPI.dll b/include/Kingstar/win32/KSTradeAPI.dll new file mode 100644 index 0000000..12a1fc6 Binary files /dev/null and b/include/Kingstar/win32/KSTradeAPI.dll differ diff --git a/include/Kingstar/win32/KSTradeAPI.lib b/include/Kingstar/win32/KSTradeAPI.lib new file mode 100644 index 0000000..86508ee Binary files /dev/null and b/include/Kingstar/win32/KSTradeAPI.lib differ diff --git a/include/Kingstar/win32/SSPXEncode.dll b/include/Kingstar/win32/SSPXEncode.dll new file mode 100644 index 0000000..1e2cb6a Binary files /dev/null and b/include/Kingstar/win32/SSPXEncode.dll differ diff --git a/include/Kingstar/win32/ksPortalAPI.dll b/include/Kingstar/win32/ksPortalAPI.dll new file mode 100644 index 0000000..0fec8a7 Binary files /dev/null and b/include/Kingstar/win32/ksPortalAPI.dll differ diff --git a/include/Kingstar/win32/lkcdll.dll b/include/Kingstar/win32/lkcdll.dll new file mode 100644 index 0000000..d860ef3 Binary files /dev/null and b/include/Kingstar/win32/lkcdll.dll differ diff --git a/include/QueueEnum.h b/include/QueueEnum.h index e5d3cda..299bea8 100644 --- a/include/QueueEnum.h +++ b/include/QueueEnum.h @@ -1,86 +1,86 @@ -#ifndef _QUEUE_ENUM_H_ +#ifndef _QUEUE_ENUM_H_ #define _QUEUE_ENUM_H_ -/// +/// 基本请求 enum RequestType :char { - GetApiType = 0, - GetApiVersion, - GetApiName, + RequestType_GetApiTypes = 0, + RequestType_GetApiVersion, + RequestType_GetApiName, - Create, // - Release, // - Register, // עնлص - Config, // ò + RequestType_Create, // 创建 + RequestType_Release, // 销毁 + RequestType_Register, // 注册接收队列回调 + RequestType_Config, // 配置参数 - Connect, // ʼ/ - Disconnect, // ֹͣ/Ͽ + RequestType_Connect, // 开始/连接 + RequestType_Disconnect, // 停止/断开 - Clear, // - Process, // + RequestType_Clear, // 清理 + RequestType_Process, // 处理 - Subscribe, // - Unsubscribe, // ȡ + RequestType_Subscribe, // 订阅 + RequestType_Unsubscribe, // 取消订阅 - SubscribeQuote, // ѯ - UnsubscribeQuote, // ȡѯ + RequestType_SubscribeQuote, // 订阅询价 + RequestType_UnsubscribeQuote, // 取消订阅询价 - ReqOrderInsert, - ReqQuoteInsert, - ReqOrderAction, - ReqQuoteAction, + RequestType_ReqOrderInsert, + RequestType_ReqQuoteInsert, + RequestType_ReqOrderAction, + RequestType_ReqQuoteAction, }; -///ѯ +///查询 enum QueryType :char { - ReqQryInstrument = 32, - ReqQryTradingAccount, - ReqQryInvestorPosition, + QueryType_ReqQryInstrument = 32, + QueryType_ReqQryTradingAccount, + QueryType_ReqQryInvestorPosition, - ReqQryOrder, - ReqQryTrade, - ReqQryQuote, + QueryType_ReqQryOrder, + QueryType_ReqQryTrade, + QueryType_ReqQryQuote, - ReqQryInstrumentCommissionRate, - ReqQryInstrumentMarginRate, - ReqQrySettlementInfo, - ReqQryInvestor, + QueryType_ReqQryInstrumentCommissionRate, + QueryType_ReqQryInstrumentMarginRate, + QueryType_ReqQrySettlementInfo, + QueryType_ReqQryInvestor, - ReqQryHistoricalTicks, - ReqQryHistoricalBars, + QueryType_ReqQryHistoricalTicks, + QueryType_ReqQryHistoricalBars, }; -///Ӧ -enum ResponeType :char +///响应 +enum ResponseType :char { - OnConnectionStatus = 64, - OnRtnError, - OnLog, + ResponseType_OnConnectionStatus = 64, + ResponseType_OnRtnError, + ResponseType_OnLog, - OnRtnDepthMarketData, - OnRspQryInstrument, - OnRspQryTradingAccount, - OnRspQryInvestorPosition, - OnRspQrySettlementInfo, + ResponseType_OnRtnDepthMarketData, + ResponseType_OnRspQryInstrument, + ResponseType_OnRspQryTradingAccount, + ResponseType_OnRspQryInvestorPosition, + ResponseType_OnRspQrySettlementInfo, - OnRspQryOrder, - OnRspQryTrade, - OnRspQryQuote, + ResponseType_OnRspQryOrder, + ResponseType_OnRspQryTrade, + ResponseType_OnRspQryQuote, - OnRtnOrder, - OnRtnTrade, - OnRtnQuote, + ResponseType_OnRtnOrder, + ResponseType_OnRtnTrade, + ResponseType_OnRtnQuote, - OnRtnQuoteRequest, + ResponseType_OnRtnQuoteRequest, - OnRspQryHistoricalTicks, - OnRspQryHistoricalBars, - OnRspQryInvestor, + ResponseType_OnRspQryHistoricalTicks, + ResponseType_OnRspQryHistoricalBars, + ResponseType_OnRspQryInvestor, - OnFilterSubscribe, + ResponseType_OnFilterSubscribe, }; -// >=100ʾAPIԶ +// >=100表示API自定义 #endif diff --git a/include/QueueHeader.h b/include/QueueHeader.h index 0730eb8..640e261 100644 --- a/include/QueueHeader.h +++ b/include/QueueHeader.h @@ -1,15 +1,15 @@ #ifndef _QUEUE_HEADER_H_ #define _QUEUE_HEADER_H_ -#include "../include/CrossPlatform.h" +//#include "CrossPlatform.h" #ifdef __cplusplus extern "C" { #endif - typedef void* (__stdcall *fnOnRespone) (char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1,int size1, void* ptr2,int size2, void* ptr3,int size3); + typedef void* (__stdcall *fnOnResponse) (char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1,int size1, void* ptr2,int size2, void* ptr3,int size3); - //DLL_PUBLIC void* __stdcall XRespone(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + //DLL_PUBLIC void* __stdcall XResponse(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); #ifdef __cplusplus } #endif diff --git a/include/Sgit/SgitFtdcMdApi.h b/include/Sgit/SgitFtdcMdApi.h new file mode 100644 index 0000000..5777e4e --- /dev/null +++ b/include/Sgit/SgitFtdcMdApi.h @@ -0,0 +1,167 @@ +///////////////////////////////////////////////////////////////////////// +///@system +///@company +///@file ThostFtdcMdApi.h +///@brief ˿ͻ˽ӿ +///@history +///20060106 +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCMDAPI_H) +#define THOST_FTDCMDAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "SgitFtdcUserApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) +#ifdef LIB_FS_MD_API_EXPORT +#define FS_MD_API_EXPORT __declspec(dllexport) +#else +#define FS_MD_API_EXPORT __declspec(dllimport) +#endif +#else +#define FS_MD_API_EXPORT +#endif +namespace fstech{ +class CThostFtdcMdSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + + ///¼Ӧ + virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡӦ + virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡѯӦ + virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData) {}; + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {}; + + ///ӽ + virtual void OnRtnDeferDeliveryQuot(CThostDeferDeliveryQuot* pQuot){}; + +}; + +class FS_MD_API_EXPORT CThostFtdcMdApi +{ +public: + ///MdApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + ///modify for udp marketdata + static CThostFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = "", const bool bIsUsingUdp=false, const bool bIsMulticast=false); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עַַ + ///@param pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcMdSpi *pSpi) = 0; + + ///顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeMarketData(char *ppInstrumentID[], int nCount) = 0; + + ///˶顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeMarketData(char *ppInstrumentID[], int nCount) = 0; + + ///ѯۡ + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0; + + ///˶ѯۡ + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0; + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; +protected: + ~CThostFtdcMdApi(){}; +}; + +} +#endif diff --git a/include/Sgit/SgitFtdcTraderApi.h b/include/Sgit/SgitFtdcTraderApi.h new file mode 100644 index 0000000..2e1ede3 --- /dev/null +++ b/include/Sgit/SgitFtdcTraderApi.h @@ -0,0 +1,645 @@ +///////////////////////////////////////////////////////////////////////// +///@system +///@company +///@file SgitFtdcTraderApi.h +///@brief ˿ͻ˽ӿ +///@history +///20150810 +///////////////////////////////////////////////////////////////////////// + +#if !defined(SGIT_FTDCTRADERAPI_H) +#define SGIT_FTDCTRADERAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "SgitFtdcUserApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) +#ifdef LIB_FS_TRADER_API_EXPORT +#define FS_TRADER_API_EXPORT __declspec(dllexport) +#else +#define FS_TRADER_API_EXPORT __declspec(dllimport) +#endif +#else +#define FS_TRADER_API_EXPORT +#endif +namespace fstech{ +// +class CThostFtdcTraderSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + ///ͻ֤Ӧ + virtual void OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + + ///¼Ӧ + virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ûӦ + virtual void OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽ˻Ӧ + virtual void OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ԥ¼Ӧ + virtual void OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ԥ񳷵¼Ӧ + virtual void OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ󱨵Ӧ + virtual void OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ͷ߽ȷӦ + virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ɾԤӦ + virtual void OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ɾԤ񳷵Ӧ + virtual void OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ִ¼Ӧ + virtual void OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ִӦ + virtual void OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ¼Ӧ + virtual void OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///۲Ӧ + virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯɽӦ + virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳Ӧ + virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʽ˻Ӧ + virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶӦ + virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯױӦ + virtual void OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼ֤Ӧ + virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷӦ + virtual void OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶ߽Ӧ + virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯתӦ + virtual void OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͻ֪ͨӦ + virtual void OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϢȷӦ + virtual void OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤ϵͳ͹˾ʽ˻ԿӦ + virtual void OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯֵ۵ϢӦ + virtual void OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶƷ/Ʒֱ֤Ӧ + virtual void OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԱȨӦ + virtual void OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷۻ + virtual void OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷ + virtual void OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨ׳ɱӦ + virtual void OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨԼӦ + virtual void OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯִӦ + virtual void OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯѯӦ + virtual void OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϺԼȫϵӦ + virtual void OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯתˮӦ + virtual void OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯǩԼϵӦ + virtual void OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnOrder(CThostFtdcOrderField *pOrder) {}; + + ///ɽ֪ͨ + virtual void OnRtnTrade(CThostFtdcTradeField *pTrade) {}; + + ///¼ر + virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ر + virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///Լ״̬֪ͨ + virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {}; + + ///֪ͨ + virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) {}; + + ///ʾУ + virtual void OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) {}; + + ///ִ֪ͨ + virtual void OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder) {}; + + ///ִ¼ر + virtual void OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ִر + virtual void OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯ¼ر + virtual void OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo) {}; + + ///֪ͨ + virtual void OnRtnQuote(CThostFtdcQuoteField *pQuote) {}; + + ///¼ر + virtual void OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) {}; + + ///۲ر + virtual void OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {}; + + ///֤û + virtual void OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) {}; + + ///ر + virtual void OnErrRtnBatchOrderAction(CThostFtdcBatchOrderActionField *pBatchOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///֪ͨ + virtual void OnRtnCombAction(CThostFtdcCombActionField *pCombAction) {}; + + ///¼ر + virtual void OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯǩԼӦ + virtual void OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԤӦ + virtual void OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԤ񳷵Ӧ + virtual void OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֪ͨӦ + virtual void OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ͹˾ײӦ + virtual void OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ͹˾㷨Ӧ + virtual void OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯû + virtual void OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///зʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///зڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///зתڻ֪ͨ + virtual void OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///зڻת֪ͨ + virtual void OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///ڻڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///ϵͳʱڻֹתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ϵͳʱڻֹڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻѯ֪ͨ + virtual void OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) {}; + + ///ڻʽתڻر + virtual void OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻڻʽתдر + virtual void OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ϵͳʱڻֹתڻر + virtual void OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ϵͳʱڻֹڻתдر + virtual void OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻѯر + virtual void OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻʽתڻӦ + virtual void OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ڻڻʽתӦ + virtual void OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ڻѯӦ + virtual void OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///зڿ֪ͨ + virtual void OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) {}; + + ///з֪ͨ + virtual void OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) {}; + + ///з˺֪ͨ + virtual void OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) {}; + + /// յԼλѯӦʱصú + virtual void onRspMBLQuot(CThostMBLQuotData *pMBLQuotData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast){}; + +}; + +class FS_TRADER_API_EXPORT CThostFtdcTraderApi +{ +public: + ///TraderApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + static CThostFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = ""); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עַַ + ///@param pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcTraderSpi *pSpi) = 0; + + ///˽ + ///@param nResumeType ˽شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼˽ + ///@remark ÷ҪInitǰá򲻻յ˽ݡ + virtual void SubscribePrivateTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///Ĺ + ///@param nResumeType شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼󹫹 + ///@remark ÷ҪInitǰá򲻻յݡ + virtual void SubscribePublicTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///ͻ֤ + virtual int ReqAuthenticate(CThostFtdcReqAuthenticateField *pReqAuthenticateField, int nRequestID) = 0; + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; + + ///û + virtual int ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0; + + ///ʽ˻ + virtual int ReqTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, int nRequestID) = 0; + + ///¼ + virtual int ReqOrderInsert(CThostFtdcInputOrderField *pInputOrder, int nRequestID) = 0; + + ///Ԥ¼ + virtual int ReqParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, int nRequestID) = 0; + + ///Ԥ񳷵¼ + virtual int ReqParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, int nRequestID) = 0; + + /// + virtual int ReqOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0; + + ///ѯ󱨵 + virtual int ReqQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, int nRequestID) = 0; + + ///Ͷ߽ȷ + virtual int ReqSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, int nRequestID) = 0; + + ///ɾԤ + virtual int ReqRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, int nRequestID) = 0; + + ///ɾԤ񳷵 + virtual int ReqRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, int nRequestID) = 0; + + ///ִ¼ + virtual int ReqExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, int nRequestID) = 0; + + ///ִ + virtual int ReqExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, int nRequestID) = 0; + + ///ѯ¼ + virtual int ReqForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, int nRequestID) = 0; + + ///¼ + virtual int ReqQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, int nRequestID) = 0; + + ///۲ + virtual int ReqQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, int nRequestID) = 0; + + /// + virtual int ReqBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, int nRequestID) = 0; + + ///¼ + virtual int ReqCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryOrder(CThostFtdcQryOrderField *pQryOrder, int nRequestID) = 0; + + ///ѯɽ + virtual int ReqQryTrade(CThostFtdcQryTradeField *pQryTrade, int nRequestID) = 0; + + ///ѯͶֲ߳ + virtual int ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0; + + ///ѯʽ˻ + virtual int ReqQryTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0; + + ///ѯͶ + virtual int ReqQryInvestor(CThostFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0; + + ///ѯױ + virtual int ReqQryTradingCode(CThostFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0; + + ///ѯԼ֤ + virtual int ReqQryInstrumentMarginRate(CThostFtdcQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrumentCommissionRate(CThostFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchange(CThostFtdcQryExchangeField *pQryExchange, int nRequestID) = 0; + + ///ѯƷ + virtual int ReqQryProduct(CThostFtdcQryProductField *pQryProduct, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrument(CThostFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryDepthMarketData(CThostFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0; + + ///ѯͶ߽ + virtual int ReqQrySettlementInfo(CThostFtdcQrySettlementInfoField *pQrySettlementInfo, int nRequestID) = 0; + + ///ѯת + virtual int ReqQryTransferBank(CThostFtdcQryTransferBankField *pQryTransferBank, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionDetail(CThostFtdcQryInvestorPositionDetailField *pQryInvestorPositionDetail, int nRequestID) = 0; + + ///ѯͻ֪ͨ + virtual int ReqQryNotice(CThostFtdcQryNoticeField *pQryNotice, int nRequestID) = 0; + + ///ѯϢȷ + virtual int ReqQrySettlementInfoConfirm(CThostFtdcQrySettlementInfoConfirmField *pQrySettlementInfoConfirm, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionCombineDetail(CThostFtdcQryInvestorPositionCombineDetailField *pQryInvestorPositionCombineDetail, int nRequestID) = 0; + + ///ѯ֤ϵͳ͹˾ʽ˻Կ + virtual int ReqQryCFMMCTradingAccountKey(CThostFtdcQryCFMMCTradingAccountKeyField *pQryCFMMCTradingAccountKey, int nRequestID) = 0; + + ///ѯֵ۵Ϣ + virtual int ReqQryEWarrantOffset(CThostFtdcQryEWarrantOffsetField *pQryEWarrantOffset, int nRequestID) = 0; + + ///ѯͶƷ/Ʒֱ֤ + virtual int ReqQryInvestorProductGroupMargin(CThostFtdcQryInvestorProductGroupMarginField *pQryInvestorProductGroupMargin, int nRequestID) = 0; + + ///ѯ֤ + virtual int ReqQryExchangeMarginRate(CThostFtdcQryExchangeMarginRateField *pQryExchangeMarginRate, int nRequestID) = 0; + + ///ѯ֤ + virtual int ReqQryExchangeMarginRateAdjust(CThostFtdcQryExchangeMarginRateAdjustField *pQryExchangeMarginRateAdjust, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchangeRate(CThostFtdcQryExchangeRateField *pQryExchangeRate, int nRequestID) = 0; + + ///ѯԱȨ + virtual int ReqQrySecAgentACIDMap(CThostFtdcQrySecAgentACIDMapField *pQrySecAgentACIDMap, int nRequestID) = 0; + + ///ѯƷۻ + virtual int ReqQryProductExchRate(CThostFtdcQryProductExchRateField *pQryProductExchRate, int nRequestID) = 0; + + ///ѯƷ + virtual int ReqQryProductGroup(CThostFtdcQryProductGroupField *pQryProductGroup, int nRequestID) = 0; + + ///ѯȨ׳ɱ + virtual int ReqQryOptionInstrTradeCost(CThostFtdcQryOptionInstrTradeCostField *pQryOptionInstrTradeCost, int nRequestID) = 0; + + ///ѯȨԼ + virtual int ReqQryOptionInstrCommRate(CThostFtdcQryOptionInstrCommRateField *pQryOptionInstrCommRate, int nRequestID) = 0; + + ///ѯִ + virtual int ReqQryExecOrder(CThostFtdcQryExecOrderField *pQryExecOrder, int nRequestID) = 0; + + ///ѯѯ + virtual int ReqQryForQuote(CThostFtdcQryForQuoteField *pQryForQuote, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryQuote(CThostFtdcQryQuoteField *pQryQuote, int nRequestID) = 0; + + ///ѯϺԼȫϵ + virtual int ReqQryCombInstrumentGuard(CThostFtdcQryCombInstrumentGuardField *pQryCombInstrumentGuard, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryCombAction(CThostFtdcQryCombActionField *pQryCombAction, int nRequestID) = 0; + + ///ѯתˮ + virtual int ReqQryTransferSerial(CThostFtdcQryTransferSerialField *pQryTransferSerial, int nRequestID) = 0; + + ///ѯǩԼϵ + virtual int ReqQryAccountregister(CThostFtdcQryAccountregisterField *pQryAccountregister, int nRequestID) = 0; + + ///ѯǩԼ + virtual int ReqQryContractBank(CThostFtdcQryContractBankField *pQryContractBank, int nRequestID) = 0; + + ///ѯԤ + virtual int ReqQryParkedOrder(CThostFtdcQryParkedOrderField *pQryParkedOrder, int nRequestID) = 0; + + ///ѯԤ񳷵 + virtual int ReqQryParkedOrderAction(CThostFtdcQryParkedOrderActionField *pQryParkedOrderAction, int nRequestID) = 0; + + ///ѯ֪ͨ + virtual int ReqQryTradingNotice(CThostFtdcQryTradingNoticeField *pQryTradingNotice, int nRequestID) = 0; + + ///ѯ͹˾ײ + virtual int ReqQryBrokerTradingParams(CThostFtdcQryBrokerTradingParamsField *pQryBrokerTradingParams, int nRequestID) = 0; + + ///ѯ͹˾㷨 + virtual int ReqQryBrokerTradingAlgos(CThostFtdcQryBrokerTradingAlgosField *pQryBrokerTradingAlgos, int nRequestID) = 0; + + ///ѯû + virtual int ReqQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, int nRequestID) = 0; + + ///ڻʽתڻ + virtual int ReqFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0; + + ///ڻڻʽת + virtual int ReqFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0; + + ///ڻѯ + virtual int ReqQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, int nRequestID) = 0; + + /// ͺԼλѯ + virtual int ReqMBLQuot(CThostMBLQuotReq *pMBLQuotReq, int nRequest) = 0; + + virtual int InitLog(TThostFtdcBoolType bLog=1) = 0; + virtual int IsReviveNtyCapital(TThostFtdcBoolType bRecive=1) = 0; +protected: + ~CThostFtdcTraderApi(){}; +}; +// +}; +#endif diff --git a/include/Sgit/SgitFtdcUserApiDataType.h b/include/Sgit/SgitFtdcUserApiDataType.h new file mode 100644 index 0000000..3a533cd --- /dev/null +++ b/include/Sgit/SgitFtdcUserApiDataType.h @@ -0,0 +1,6315 @@ +///////////////////////////////////////////////////////////////////////// +///@system +///@company +///@file SgitFtdcUserApiDataType.h +///@brief ˿ͻ˽ӿʹõҵ +///@history +///20150810 +///////////////////////////////////////////////////////////////////////// + +#ifndef SGIT_FTDCDATATYPE_H +#define SGIT_FTDCDATATYPE_H +// +namespace fstech{ +// +enum THOST_TE_RESUME_TYPE +{ + THOST_TERT_RESTART = 0, + THOST_TERT_RESUME, + THOST_TERT_QUICK +}; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTraderIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDTypeһͶߴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerAbbrTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerNameTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeInstIDTypeһԼڽĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderRefType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParticipantIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParticipantIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserIDTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserIDType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPasswordType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarketIDTypeһг +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMarketIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeAbbrTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMacAddressTypeһMacַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMacAddressType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSystemIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangePropertyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EXP_Normal '0' +///ݳɽɱ +#define THOST_FTDC_EXP_GenOrderByTrade '1' + +typedef char TThostFtdcExchangePropertyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLongTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLongTimeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettlementGroupIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSysIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeIDType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandTypeTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommandTypeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPAddressTypeһIPַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIPAddressType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPPortTypeһIP˿ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcIPPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductInfoTypeһƷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocolInfoTypeһЭϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProtocolInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessUnitTypeһҵԪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessUnitType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepositSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDepositSeqNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֯ +#define THOST_FTDC_ICT_EID '0' +///й֤ +#define THOST_FTDC_ICT_IDCard '1' +///֤ +#define THOST_FTDC_ICT_OfficerIDCard '2' +///֤ +#define THOST_FTDC_ICT_PoliceIDCard '3' +///ʿ֤ +#define THOST_FTDC_ICT_SoldierIDCard '4' +///ڲ +#define THOST_FTDC_ICT_HouseholdRegister '5' +/// +#define THOST_FTDC_ICT_Passport '6' +///̨֤ +#define THOST_FTDC_ICT_TaiwanCompatriotIDCard '7' +///֤ +#define THOST_FTDC_ICT_HomeComingCard '8' +///Ӫҵִպ +#define THOST_FTDC_ICT_LicenseNo '9' +///˰ǼǺ/˰ID +#define THOST_FTDC_ICT_TaxNo 'A' +///۰ľڵ֤ͨ +#define THOST_FTDC_ICT_HMMainlandTravelPermit 'B' +///̨½֤ͨ +#define THOST_FTDC_ICT_TwMainlandTravelPermit 'C' +/// +#define THOST_FTDC_ICT_DrivingLicense 'D' +///籣ID +#define THOST_FTDC_ICT_SocialID 'F' +///֤ +#define THOST_FTDC_ICT_LocalID 'G' +///ҵǼ֤ +#define THOST_FTDC_ICT_BusinessRegistration 'H' +///۰Ծ֤ +#define THOST_FTDC_ICT_HKMCIDCard 'I' +///п֤ +#define THOST_FTDC_ICT_AccountsPermits 'J' +///֤ +#define THOST_FTDC_ICT_OtherCard 'x' + +typedef char TThostFtdcIdCardTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderLocalIDTypeһر +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderLocalIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserNameTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPartyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPartyNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorMsgTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcErrorMsgType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldNameTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFieldNameType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldContentTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFieldContentType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemNameTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSystemNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContentTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcContentType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IR_All '1' +///Ͷ +#define THOST_FTDC_IR_Group '2' +///һͶ +#define THOST_FTDC_IR_Single '3' + +typedef char TThostFtdcInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepartmentRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_DR_All '1' +///ܹ֯ +#define THOST_FTDC_DR_Group '2' +///һͶ +#define THOST_FTDC_DR_Single '3' + +typedef char TThostFtdcDepartmentRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataSyncStatusTypeһͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define THOST_FTDC_DS_Asynchronous '1' +///ͬ +#define THOST_FTDC_DS_Synchronizing '2' +///ͬ +#define THOST_FTDC_DS_Synchronized '3' + +typedef char TThostFtdcDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDataSyncStatusTypeһ͹˾ͬ״̬ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_BDS_Synchronized '1' +///ͬ +#define THOST_FTDC_BDS_Synchronizing '2' + +typedef char TThostFtdcBrokerDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeConnectStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_ECS_NoConnection '1' +///ѾԼѯ +#define THOST_FTDC_ECS_QryInstrumentSent '2' +///ѾȡϢ +#define THOST_FTDC_ECS_GotInformation '9' + +typedef char TThostFtdcExchangeConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderConnectStatusTypeһԱ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_TCS_NotConnected '1' +///Ѿ +#define THOST_FTDC_TCS_Connected '2' +///ѾԼѯ +#define THOST_FTDC_TCS_QryInstrumentSent '3' +///˽ +#define THOST_FTDC_TCS_SubPrivateFlow '4' + +typedef char TThostFtdcTraderConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionCodeTypeһܴ +///////////////////////////////////////////////////////////////////////// +///첽 +#define THOST_FTDC_FC_DataAsync '1' +///ǿûdz +#define THOST_FTDC_FC_ForceUserLogout '2' +///û +#define THOST_FTDC_FC_UserPasswordUpdate '3' +///͹˾ +#define THOST_FTDC_FC_BrokerPasswordUpdate '4' +///Ͷ߿ +#define THOST_FTDC_FC_InvestorPasswordUpdate '5' +/// +#define THOST_FTDC_FC_OrderInsert '6' +/// +#define THOST_FTDC_FC_OrderAction '7' +///ͬϵͳ +#define THOST_FTDC_FC_SyncSystemData '8' +///ͬ͹˾ +#define THOST_FTDC_FC_SyncBrokerData '9' +///ͬ͹˾ +#define THOST_FTDC_FC_BachSyncBrokerData 'A' +///ѯ +#define THOST_FTDC_FC_SuperQuery 'B' +///Ԥ񱨵 +#define THOST_FTDC_FC_ParkedOrderInsert 'C' +///Ԥ񱨵 +#define THOST_FTDC_FC_ParkedOrderAction 'D' +///̬ͬ +#define THOST_FTDC_FC_SyncOTP 'E' +///ɾδ֪ +#define THOST_FTDC_FC_DeleteOrder 'F' + +typedef char TThostFtdcFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerFunctionCodeTypeһ͹˾ܴ +///////////////////////////////////////////////////////////////////////// +///ǿûdz +#define THOST_FTDC_BFC_ForceUserLogout '1' +///û +#define THOST_FTDC_BFC_UserPasswordUpdate '2' +///ͬ͹˾ +#define THOST_FTDC_BFC_SyncBrokerData '3' +///ͬ͹˾ +#define THOST_FTDC_BFC_BachSyncBrokerData '4' +/// +#define THOST_FTDC_BFC_OrderInsert '5' +/// +#define THOST_FTDC_BFC_OrderAction '6' +///ȫѯ +#define THOST_FTDC_BFC_AllQuery '7' +///ϵͳܣ/dz/޸ +#define THOST_FTDC_BFC_log 'a' +///ѯѯݣԼȳ +#define THOST_FTDC_BFC_BaseQry 'b' +///ײѯɽί +#define THOST_FTDC_BFC_TradeQry 'c' +///׹ܣ +#define THOST_FTDC_BFC_Trade 'd' +///ת +#define THOST_FTDC_BFC_Virement 'e' +///ռ +#define THOST_FTDC_BFC_Risk 'f' +///ѯ/ѯỰ˵ +#define THOST_FTDC_BFC_Session 'g' +///֪ͨ +#define THOST_FTDC_BFC_RiskNoticeCtl 'h' +///֪ͨ +#define THOST_FTDC_BFC_RiskNotice 'i' +///쿴͹˾ʽȨ +#define THOST_FTDC_BFC_BrokerDeposit 'j' +///ʽѯ +#define THOST_FTDC_BFC_QueryFund 'k' +///ѯ +#define THOST_FTDC_BFC_QueryOrder 'l' +///ɽѯ +#define THOST_FTDC_BFC_QueryTrade 'm' +///ֲֲѯ +#define THOST_FTDC_BFC_QueryPosition 'n' +///ѯ +#define THOST_FTDC_BFC_QueryMarketData 'o' +///û¼ѯ +#define THOST_FTDC_BFC_QueryUserEvent 'p' +///֪ͨѯ +#define THOST_FTDC_BFC_QueryRiskNotify 'q' +///ѯ +#define THOST_FTDC_BFC_QueryFundChange 'r' +///ͶϢѯ +#define THOST_FTDC_BFC_QueryInvestor 's' +///ױѯ +#define THOST_FTDC_BFC_QueryTradingCode 't' +///ǿƽ +#define THOST_FTDC_BFC_ForceClose 'u' +///ѹ +#define THOST_FTDC_BFC_PressTest 'v' +///Ȩ淴 +#define THOST_FTDC_BFC_RemainCalc 'w' +///ֱֲָ֤ +#define THOST_FTDC_BFC_NetPositionInd 'x' +///Ԥ +#define THOST_FTDC_BFC_RiskPredict 'y' +///ݵ +#define THOST_FTDC_BFC_DataExport 'z' +///ָ +#define THOST_FTDC_BFC_RiskTargetSetup 'A' +///Ԥ +#define THOST_FTDC_BFC_MarketDataWarn 'B' +///ҵ֪ͨѯ +#define THOST_FTDC_BFC_QryBizNotice 'C' +///ҵ֪ͨģ +#define THOST_FTDC_BFC_CfgBizNotice 'D' +///̬ͬ +#define THOST_FTDC_BFC_SyncOTP 'E' +///ҵ֪ͨ +#define THOST_FTDC_BFC_SendBizNotice 'F' +///ռ׼ +#define THOST_FTDC_BFC_CfgRiskLevelStd 'G' +///նӦ +#define THOST_FTDC_BFC_TbCommand 'H' +///ɾδ֪ +#define THOST_FTDC_BFC_DeleteOrder 'J' +///Ԥ񱨵 +#define THOST_FTDC_BFC_ParkedOrderInsert 'K' +///Ԥ񱨵 +#define THOST_FTDC_BFC_ParkedOrderAction 'L' + +typedef char TThostFtdcBrokerFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_OAS_Submitted 'a' +///Ѿ +#define THOST_FTDC_OAS_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_OAS_Rejected 'c' + +typedef char TThostFtdcOrderActionStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ȫɽ +#define THOST_FTDC_OST_AllTraded '0' +///ֳɽڶ +#define THOST_FTDC_OST_PartTradedQueueing '1' +///ֳɽڶ +#define THOST_FTDC_OST_PartTradedNotQueueing '2' +///δɽڶ +#define THOST_FTDC_OST_NoTradeQueueing '3' +///δɽڶ +#define THOST_FTDC_OST_NoTradeNotQueueing '4' +/// +#define THOST_FTDC_OST_Canceled '5' +///δ֪ +#define THOST_FTDC_OST_Unknown 'a' +///δ +#define THOST_FTDC_OST_NotTouched 'b' +///Ѵ +#define THOST_FTDC_OST_Touched 'c' + +typedef char TThostFtdcOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSubmitStatusTypeһύ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_OSS_InsertSubmitted '0' +///Ѿύ +#define THOST_FTDC_OSS_CancelSubmitted '1' +///޸Ѿύ +#define THOST_FTDC_OSS_ModifySubmitted '2' +///Ѿ +#define THOST_FTDC_OSS_Accepted '3' +///Ѿܾ +#define THOST_FTDC_OSS_InsertRejected '4' +///Ѿܾ +#define THOST_FTDC_OSS_CancelRejected '5' +///ĵѾܾ +#define THOST_FTDC_OSS_ModifyRejected '6' + +typedef char TThostFtdcOrderSubmitStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ճֲ +#define THOST_FTDC_PSD_Today '1' +///ʷֲ +#define THOST_FTDC_PSD_History '2' + +typedef char TThostFtdcPositionDateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ʹʷֲ +#define THOST_FTDC_PDT_UseHistory '1' +///ʹʷֲ +#define THOST_FTDC_PDT_NoUseHistory '2' + +typedef char TThostFtdcPositionDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRoleTypeһ׽ɫ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ER_Broker '1' +///Ӫ +#define THOST_FTDC_ER_Host '2' +/// +#define THOST_FTDC_ER_Maker '3' + +typedef char TThostFtdcTradingRoleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_PC_Futures '1' +///ڻȨ +#define THOST_FTDC_PC_Options '2' +/// +#define THOST_FTDC_PC_Combination '3' +/// +#define THOST_FTDC_PC_Spot '4' +///ת +#define THOST_FTDC_PC_EFP '5' +///ֻȨ +#define THOST_FTDC_PC_SpotOption '6' +//ֻ +#define THOST_FTDC_PC_Defer '7' +typedef char TThostFtdcProductClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_IP_NotStart '0' +/// +#define THOST_FTDC_IP_Started '1' +///ͣ +#define THOST_FTDC_IP_Pause '2' +/// +#define THOST_FTDC_IP_Expired '3' + +typedef char TThostFtdcInstLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_D_Buy '0' +/// +#define THOST_FTDC_D_Sell '1' + +typedef char TThostFtdcDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ֲ +#define THOST_FTDC_PT_Net '1' +///ۺϳֲ +#define THOST_FTDC_PT_Gross '2' + +typedef char TThostFtdcPositionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosiDirectionTypeһֲֶշ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PD_Net '1' +///ͷ +#define THOST_FTDC_PD_Long '2' +///ͷ +#define THOST_FTDC_PD_Short '3' + +typedef char TThostFtdcPosiDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysSettlementStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_SS_NonActive '1' +/// +#define THOST_FTDC_SS_Startup '2' +/// +#define THOST_FTDC_SS_Operating '3' +/// +#define THOST_FTDC_SS_Settlement '4' +/// +#define THOST_FTDC_SS_SettlementFinished '5' + +typedef char TThostFtdcSysSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioAttrTypeһ +///////////////////////////////////////////////////////////////////////// +///׷ +#define THOST_FTDC_RA_Trade '0' +/// +#define THOST_FTDC_RA_Settlement '1' + +typedef char TThostFtdcRatioAttrType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_HF_Speculation '1' +/// +#define THOST_FTDC_HF_Arbitrage '2' +///ױ +#define THOST_FTDC_HF_Hedge '3' +//ӽ걨 +#define THOST_FTDC_HF_DEFER '4' +//걨 +#define THOST_FTDC_HF_MID '5' + +typedef char TThostFtdcHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_BHF_Speculation '1' +/// +#define THOST_FTDC_BHF_Arbitrage '2' +///ױ +#define THOST_FTDC_BHF_Hedge '3' + +typedef char TThostFtdcBillHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_CIDT_Speculation '1' +/// +#define THOST_FTDC_CIDT_Arbitrage '2' +///ױ +#define THOST_FTDC_CIDT_Hedge '3' + +typedef char TThostFtdcClientIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderPriceTypeTypeһ۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OPT_AnyPrice '1' +///޼ +#define THOST_FTDC_OPT_LimitPrice '2' +///ż +#define THOST_FTDC_OPT_BestPrice '3' +///¼ +#define THOST_FTDC_OPT_LastPrice '4' +///¼۸ϸ1ticks +#define THOST_FTDC_OPT_LastPricePlusOneTicks '5' +///¼۸ϸ2ticks +#define THOST_FTDC_OPT_LastPricePlusTwoTicks '6' +///¼۸ϸ3ticks +#define THOST_FTDC_OPT_LastPricePlusThreeTicks '7' +///һ +#define THOST_FTDC_OPT_AskPrice1 '8' +///һ۸ϸ1ticks +#define THOST_FTDC_OPT_AskPrice1PlusOneTicks '9' +///һ۸ϸ2ticks +#define THOST_FTDC_OPT_AskPrice1PlusTwoTicks 'A' +///һ۸ϸ3ticks +#define THOST_FTDC_OPT_AskPrice1PlusThreeTicks 'B' +///һ +#define THOST_FTDC_OPT_BidPrice1 'C' +///һ۸ϸ1ticks +#define THOST_FTDC_OPT_BidPrice1PlusOneTicks 'D' +///һ۸ϸ2ticks +#define THOST_FTDC_OPT_BidPrice1PlusTwoTicks 'E' +///һ۸ϸ3ticks +#define THOST_FTDC_OPT_BidPrice1PlusThreeTicks 'F' +///嵵 +#define THOST_FTDC_OPT_FiveLevelPrice 'G' + +typedef char TThostFtdcOrderPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OF_Open '0' +///ƽ +#define THOST_FTDC_OF_Close '1' +///ǿƽ +#define THOST_FTDC_OF_ForceClose '2' +///ƽ +#define THOST_FTDC_OF_CloseToday '3' +///ƽ +#define THOST_FTDC_OF_CloseYesterday '4' +///ǿ +#define THOST_FTDC_OF_ForceOff '5' +///ǿƽ +#define THOST_FTDC_OF_LocalForceClose '6' + +typedef char TThostFtdcOffsetFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseReasonTypeһǿƽԭ +///////////////////////////////////////////////////////////////////////// +///ǿƽ +#define THOST_FTDC_FCC_NotForceClose '0' +///ʽ +#define THOST_FTDC_FCC_LackDeposit '1' +///ͻ +#define THOST_FTDC_FCC_ClientOverPositionLimit '2' +///Ա +#define THOST_FTDC_FCC_MemberOverPositionLimit '3' +///ֲַ +#define THOST_FTDC_FCC_NotMultiple '4' +///Υ +#define THOST_FTDC_FCC_Violation '5' +/// +#define THOST_FTDC_FCC_Other '6' +///Ȼٽ +#define THOST_FTDC_FCC_PersonDeliv '7' + +typedef char TThostFtdcForceCloseReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ORDT_Normal '0' +/// +#define THOST_FTDC_ORDT_DeriveFromQuote '1' +/// +#define THOST_FTDC_ORDT_DeriveFromCombination '2' +///ϱ +#define THOST_FTDC_ORDT_Combination '3' +/// +#define THOST_FTDC_ORDT_ConditionalOrder '4' +/// +#define THOST_FTDC_ORDT_Swap '5' + +typedef char TThostFtdcOrderTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeConditionTypeһЧ +///////////////////////////////////////////////////////////////////////// +///ɣ +#define THOST_FTDC_TC_IOC '1' +///Ч +#define THOST_FTDC_TC_GFS '2' +///Ч +#define THOST_FTDC_TC_GFD '3' +///ָǰЧ +#define THOST_FTDC_TC_GTD '4' +///ǰЧ +#define THOST_FTDC_TC_GTC '5' +///ϾЧ +#define THOST_FTDC_TC_GFA '6' + +typedef char TThostFtdcTimeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeConditionTypeһɽ +///////////////////////////////////////////////////////////////////////// +///κ +#define THOST_FTDC_VC_AV '1' +///С +#define THOST_FTDC_VC_MV '2' +///ȫ +#define THOST_FTDC_VC_CV '3' + +typedef char TThostFtdcVolumeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContingentConditionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CC_Immediately '1' +///ֹ +#define THOST_FTDC_CC_Touch '2' +///ֹӮ +#define THOST_FTDC_CC_TouchProfit '3' +///Ԥ +#define THOST_FTDC_CC_ParkedOrder '4' +///¼۴ +#define THOST_FTDC_CC_LastPriceGreaterThanStopPrice '5' +///¼۴ڵ +#define THOST_FTDC_CC_LastPriceGreaterEqualStopPrice '6' +///¼С +#define THOST_FTDC_CC_LastPriceLesserThanStopPrice '7' +///¼Сڵ +#define THOST_FTDC_CC_LastPriceLesserEqualStopPrice '8' +///һ۴ +#define THOST_FTDC_CC_AskPriceGreaterThanStopPrice '9' +///һ۴ڵ +#define THOST_FTDC_CC_AskPriceGreaterEqualStopPrice 'A' +///һС +#define THOST_FTDC_CC_AskPriceLesserThanStopPrice 'B' +///һСڵ +#define THOST_FTDC_CC_AskPriceLesserEqualStopPrice 'C' +///һ۴ +#define THOST_FTDC_CC_BidPriceGreaterThanStopPrice 'D' +///һ۴ڵ +#define THOST_FTDC_CC_BidPriceGreaterEqualStopPrice 'E' +///һС +#define THOST_FTDC_CC_BidPriceLesserThanStopPrice 'F' +///һСڵ +#define THOST_FTDC_CC_BidPriceLesserEqualStopPrice 'H' + +typedef char TThostFtdcContingentConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +///ɾ +#define THOST_FTDC_AF_Delete '0' +///޸ +#define THOST_FTDC_AF_Modify '3' + +typedef char TThostFtdcActionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRightTypeһȨ +///////////////////////////////////////////////////////////////////////// +///Խ +#define THOST_FTDC_TR_Allow '0' +///ֻƽ +#define THOST_FTDC_TR_CloseOnly '1' +///ܽ +#define THOST_FTDC_TR_Forbidden '2' + +typedef char TThostFtdcTradingRightType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///Բ +#define THOST_FTDC_OSRC_Participant '0' +///ԹԱ +#define THOST_FTDC_OSRC_Administrator '1' + +typedef char TThostFtdcOrderSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTypeTypeһɽ +///////////////////////////////////////////////////////////////////////// +///ϳֲֲΪһֲ,ʼӦ͵ijֲ +#define THOST_FTDC_TRDT_SplitCombination '#' +///ͨɽ +#define THOST_FTDC_TRDT_Common '0' +///Ȩִ +#define THOST_FTDC_TRDT_OptionsExecution '1' +///OTCɽ +#define THOST_FTDC_TRDT_OTC '2' +///תɽ +#define THOST_FTDC_TRDT_EFPDerived '3' +///ɽ +#define THOST_FTDC_TRDT_CombinationDerived '4' + +typedef char TThostFtdcTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///ǰɽ +#define THOST_FTDC_PSRC_LastPrice '0' +///ίм +#define THOST_FTDC_PSRC_Buy '1' +///ίм +#define THOST_FTDC_PSRC_Sell '2' + +typedef char TThostFtdcPriceSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentStatusTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define THOST_FTDC_IS_BeforeTrading '0' +///ǽ +#define THOST_FTDC_IS_NoTrading '1' +/// +#define THOST_FTDC_IS_Continous '2' +///Ͼ۱ +#define THOST_FTDC_IS_AuctionOrdering '3' +///Ͼۼ۸ƽ +#define THOST_FTDC_IS_AuctionBalance '4' +///Ͼ۴ +#define THOST_FTDC_IS_AuctionMatch '5' +/// +#define THOST_FTDC_IS_Closed '6' + +typedef char TThostFtdcInstrumentStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstStatusEnterReasonTypeһƷֽ뽻״̬ԭ +///////////////////////////////////////////////////////////////////////// +///Զл +#define THOST_FTDC_IER_Automatic '1' +///ֶл +#define THOST_FTDC_IER_Manual '2' +///۶ +#define THOST_FTDC_IER_Fuse '3' + +typedef char TThostFtdcInstStatusEnterReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcOrderActionRefType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallCountTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcInstallCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallIDTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcInstallIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcErrorIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSettlementIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFrontIDTypeһǰñ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFrontIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSessionIDTypeһỰ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSessionIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSequenceNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandNoTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCommandNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMillisecTypeһʱ䣨룩 +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMillisecType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeMultipleTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcVolumeMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingSegmentSNTypeһ׽׶α +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradingSegmentSNType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRequestIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYearTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcYearType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMonthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBoolTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBoolType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombOffsetFlagTypeһϿƽ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombOffsetFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombHedgeFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcRatioType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLargeVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcLargeVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceSeriesTypeһϵк +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcSequenceSeriesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommPhaseNoTypeһͨѶʱα +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcCommPhaseNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceLabelTypeһб +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSequenceLabelType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUnderlyingMultipleTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcUnderlyingMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContractCodeTypeһͬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcContractCodeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCityTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCityType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsStockTypeһǷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIsStockType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcChannelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcChannelType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddressTypeһͨѶַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAddressType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcZipCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcZipCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTelephoneTypeһϵ绰 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTelephoneType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFaxTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFaxType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobileTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMobileType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEMailTypeһʼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEMailType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMemoTypeһע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMemoType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyCodeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCompanyCodeType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWebsiteTypeһվַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWebsiteType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTaxNoTypeһ˰ǼǺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTaxNoType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBatchStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δϴ +#define THOST_FTDC_BS_NoUpload '1' +///ϴ +#define THOST_FTDC_BS_Uploaded '2' +///ʧ +#define THOST_FTDC_BS_Failed '3' + +typedef char TThostFtdcBatchStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyIDTypeһԴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNoTypeһӪҵִպ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLicenseNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentIDTypeһ˴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentGroupIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStyleTypeһƷַʽ +///////////////////////////////////////////////////////////////////////// +///Ʒ +#define THOST_FTDC_RS_All '1' +///Ʒ +#define THOST_FTDC_RS_ByProduct '2' + +typedef char TThostFtdcReturnStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnPatternTypeһģʽ +///////////////////////////////////////////////////////////////////////// +///ɽ +#define THOST_FTDC_RP_ByVolume '1' +/// +#define THOST_FTDC_RP_ByFeeOnHand '2' + +typedef char TThostFtdcReturnPatternType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///1 +#define THOST_FTDC_RL_Level1 '1' +///2 +#define THOST_FTDC_RL_Level2 '2' +///3 +#define THOST_FTDC_RL_Level3 '3' +///4 +#define THOST_FTDC_RL_Level4 '4' +///5 +#define THOST_FTDC_RL_Level5 '5' +///6 +#define THOST_FTDC_RL_Level6 '6' +///7 +#define THOST_FTDC_RL_Level7 '7' +///8 +#define THOST_FTDC_RL_Level8 '8' +///9 +#define THOST_FTDC_RL_Level9 '9' + +typedef char TThostFtdcReturnLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStandardTypeһ׼ +///////////////////////////////////////////////////////////////////////// +///ֽ׶η +#define THOST_FTDC_RSD_ByPeriod '1' +///ijһ׼ +#define THOST_FTDC_RSD_ByStandard '2' + +typedef char TThostFtdcReturnStandardType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMortgageTypeTypeһѺ +///////////////////////////////////////////////////////////////////////// +///ʳ +#define THOST_FTDC_MT_Out '0' +/// +#define THOST_FTDC_MT_In '1' + +typedef char TThostFtdcMortgageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorSettlementParamIDTypeһͶ߽ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_ISPI_BaseMargin '1' +///Ȩ׼ +#define THOST_FTDC_ISPI_LowestInterest '2' +///Ѻ +#define THOST_FTDC_ISPI_MortgageRatio '4' +///֤㷨 +#define THOST_FTDC_ISPI_MarginWay '5' +///ctp :㵥ǷѺ +///sgit:㵥()Ȩڽ +#define THOST_FTDC_ISPI_BillDeposit '9' + +typedef char TThostFtdcInvestorSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeSettlementParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_ESPI_MortgageRatio '1' +///ʽ +#define THOST_FTDC_ESPI_OtherFundItem '2' +///ʽ뽻 +#define THOST_FTDC_ESPI_OtherFundImport '3' +///ȡʽ +#define THOST_FTDC_ESPI_SHFEDelivFee '4' +///ȡʽ +#define THOST_FTDC_ESPI_DCEDelivFee '5' +///нͿý +#define THOST_FTDC_ESPI_CFFEXMinPrepa '6' +///֣㷽ʽ +#define THOST_FTDC_ESPI_CZCESettlementType '7' +///ȡʽ +#define THOST_FTDC_ESPI_ExchDelivFeeMode '9' +///Ͷ߽ȡʽ +#define THOST_FTDC_ESPI_DelivFeeMode '0' +///֣ϳֱֲ֤ȡʽ +#define THOST_FTDC_ESPI_CZCEComMarginType 'A' +///֤ǷŻ +#define THOST_FTDC_ESPI_DceComMarginType 'B' +///ֵȨ֤Żݱ +#define THOST_FTDC_ESPI_OptOutDisCountRate 'a' +///ͱϵ +#define THOST_FTDC_ESPI_OptMiniGuarantee 'b' + +typedef char TThostFtdcExchangeSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ͶߴС +#define THOST_FTDC_SPI_InvestorIDMinLength '1' +///ͶʺŴС +#define THOST_FTDC_SPI_AccountIDMinLength '2' +///Ͷ߿Ĭϵ¼Ȩ +#define THOST_FTDC_SPI_UserRightLogon '3' +///Ͷ߽׽㵥ɽܷʽ +#define THOST_FTDC_SPI_SettlementBillTrade '4' +///ͳһ½ױ뷽ʽ +#define THOST_FTDC_SPI_TradingCode '5' +///Ƿжϴδ˵ijͷʽ +#define THOST_FTDC_SPI_CheckFund '6' +///ǷģȨ +#define THOST_FTDC_SPI_CommModelRight '7' +///Ƿñ֤ģȨ +#define THOST_FTDC_SPI_MarginModelRight '9' +///Ƿ淶ûܼ +#define THOST_FTDC_SPI_IsStandardActive '8' +///ϴĽļ· +#define THOST_FTDC_SPI_UploadSettlementFile 'U' +///ϱ֤ļ· +#define THOST_FTDC_SPI_DownloadCSRCFile 'D' +///ɵĽ㵥ļ· +#define THOST_FTDC_SPI_SettlementBillFile 'S' +///֤ļʶ +#define THOST_FTDC_SPI_CSRCOthersFile 'C' +///ͶƬ· +#define THOST_FTDC_SPI_InvestorPhoto 'P' +///ȫᾭ͹˾ϴļ· +#define THOST_FTDC_SPI_CSRCData 'R' +///¼뷽ʽ +#define THOST_FTDC_SPI_InvestorPwdModel 'I' +///Ͷнļ· +#define THOST_FTDC_SPI_CFFEXInvestorSettleFile 'F' +///Ͷߴ뷽ʽ +#define THOST_FTDC_SPI_InvestorIDType 'a' +///߻Ȩ +#define THOST_FTDC_SPI_FreezeMaxReMain 'r' +///زʵʱϳ +#define THOST_FTDC_SPI_IsSync 'A' +///Ȩ +#define THOST_FTDC_SPI_RelieveOpenLimit 'O' +///Ƿ淶û +#define THOST_FTDC_SPI_IsStandardFreeze 'X' +///֣Ƿ񿪷Ʒױ +#define THOST_FTDC_SPI_CZCENormalProductHedge 'B' + +typedef char TThostFtdcSystemParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ϵͳ㷨 +#define THOST_FTDC_TPID_EncryptionStandard 'E' +///ϵͳ㷨 +#define THOST_FTDC_TPID_RiskMode 'R' +///ϵͳ㷨Ƿȫ 0- 1- +#define THOST_FTDC_TPID_RiskModeGlobal 'G' +///㷨 +#define THOST_FTDC_TPID_modeEncode 'P' +///۸Сλ +#define THOST_FTDC_TPID_tickMode 'T' +///ûỰ +#define THOST_FTDC_TPID_SingleUserSessionMaxNum 'S' +///¼ʧ +#define THOST_FTDC_TPID_LoginFailMaxNum 'L' +///Ƿǿ֤ +#define THOST_FTDC_TPID_IsAuthForce 'A' +///Ƿ񶳽֤ȯֲ +#define THOST_FTDC_TPID_IsPosiFreeze 'F' +///Ƿ޲ +#define THOST_FTDC_TPID_IsPosiLimit 'M' +///֣ѯʱ +#define THOST_FTDC_TPID_ForQuoteTimeInterval 'Q' + +typedef char TThostFtdcTradeParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettlementParamValueType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCounterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCounterIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorGroupNameTypeһͶ߷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrandCodeTypeһƺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrandCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWarehouseTypeһֿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWarehouseType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductDateType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGradeTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcGradeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClassifyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClassifyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPositionType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYieldlyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcYieldlyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWeightTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWeightType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubEntryFundNoTypeһʽˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSubEntryFundNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileIDTypeһļʶ +///////////////////////////////////////////////////////////////////////// +///ʽ +#define THOST_FTDC_FI_SettlementFund 'F' +///ɽ +#define THOST_FTDC_FI_Trade 'T' +///Ͷֲ߳ +#define THOST_FTDC_FI_InvestorPosition 'P' +///Ͷ߷ʽ +#define THOST_FTDC_FI_SubEntryFund 'O' +///ctp :ϳֲ +///sgit:֣ϳֲ +#define THOST_FTDC_FI_CZCECombinationPos 'C' +///ϱ֤ +#define THOST_FTDC_FI_CSRCData 'R' +///֣ƽ˽ +#define THOST_FTDC_FI_CZCEClose 'L' +///֣ƽ˽ +#define THOST_FTDC_FI_CZCENoClose 'N' +///ֲϸ +#define THOST_FTDC_FI_PositionDtl 'D' +///Ȩִļ +#define THOST_FTDC_FI_OptionStrike 'S' +///۱ȶļ +#define THOST_FTDC_FI_SettlementPriceComparison 'M' +///dzֱֲ䶯ϸ +#define THOST_FTDC_FI_NonTradePosChange 'B' + +typedef char TThostFtdcFileIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileTypeTypeһļϴ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FUT_Settlement '0' +///˶ +#define THOST_FTDC_FUT_Check '1' + +typedef char TThostFtdcFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileFormatTypeһļʽ +///////////////////////////////////////////////////////////////////////// +///ıļ(.txt) +#define THOST_FTDC_FFT_Txt '0' +///ѹļ(.zip) +#define THOST_FTDC_FFT_Zip '1' +///DBFļ(.dbf) +#define THOST_FTDC_FFT_DBF '2' + +typedef char TThostFtdcFileFormatType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileUploadStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///ϴɹ +#define THOST_FTDC_FUS_SucceedUpload '1' +///ϴʧ +#define THOST_FTDC_FUS_FailedUpload '2' +///ɹ +#define THOST_FTDC_FUS_SucceedLoad '3' +///벿ֳɹ +#define THOST_FTDC_FUS_PartSucceedLoad '4' +///ʧ +#define THOST_FTDC_FUS_FailedLoad '5' + +typedef char TThostFtdcFileUploadStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferDirectionTypeһƲַ +///////////////////////////////////////////////////////////////////////// +///Ƴ +#define THOST_FTDC_TD_Out '0' +/// +#define THOST_FTDC_TD_In '1' + +typedef char TThostFtdcTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUploadModeTypeһϴļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUploadModeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountIDTypeһͶʺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAccountIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankFlagTypeһͳһʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankFlagType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenNameTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOpenNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenBankTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOpenBankType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishPathTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPublishPathType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperatorIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthCountTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMonthCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAdvanceMonthArrayTypeһ·ǰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAdvanceMonthArrayType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateExprTypeһڱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDateExprType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDExprTypeһԼʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameExprTypeһԼƱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentNameExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSpecialCreateRuleTypeһĴ +///////////////////////////////////////////////////////////////////////// +///ûⴴ +#define THOST_FTDC_SC_NoSpecialRule '0' +/// +#define THOST_FTDC_SC_NoSpringFestival '1' + +typedef char TThostFtdcSpecialCreateRuleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBasisPriceTypeTypeһƻ׼ +///////////////////////////////////////////////////////////////////////// +///һԼ +#define THOST_FTDC_IPT_LastSettlement '1' +///һԼ̼ +#define THOST_FTDC_IPT_LaseClose '2' + +typedef char TThostFtdcBasisPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductLifePhaseTypeһƷ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_PLP_Active '1' +///Ծ +#define THOST_FTDC_PLP_NonActive '2' +///ע +#define THOST_FTDC_PLP_Canceled '3' + +typedef char TThostFtdcProductLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeliveryModeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ֽ𽻸 +#define THOST_FTDC_DM_CashDeliv '1' +///ʵサ +#define THOST_FTDC_DM_CommodityDeliv '2' + +typedef char TThostFtdcDeliveryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLogLevelTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLogLevelType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessNameTypeһ洢 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperationMemoTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperationMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FIOT_FundIO '1' +///ת +#define THOST_FTDC_FIOT_Transfer '2' +///ڻ +#define THOST_FTDC_FIOT_SwapCurrency '3'//sgit + +typedef char TThostFtdcFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_FT_Deposite '1' +///ʽ +#define THOST_FTDC_FT_ItemFund '2' +///˾ +#define THOST_FTDC_FT_Company '3' +///ʽת +#define THOST_FTDC_FT_InnerTransfer '4'//sgit: + +typedef char TThostFtdcFundTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FD_In '1' +/// +#define THOST_FTDC_FD_Out '2' + +typedef char TThostFtdcFundDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundStatusTypeһʽ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_FS_Record '1' +///Ѹ +#define THOST_FTDC_FS_Check '2' +///ѳ +#define THOST_FTDC_FS_Charge '3' + +typedef char TThostFtdcFundStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNoTypeһƱݺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBillNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNameTypeһƱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBillNameType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PS_None '1' +///ڷ +#define THOST_FTDC_PS_Publishing '2' +///ѷ +#define THOST_FTDC_PS_Published '3' + +typedef char TThostFtdcPublishStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueIDTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueTypeTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueLabelTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueLabelType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueResultTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueResultType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_ES_NonActive '1' +/// +#define THOST_FTDC_ES_Startup '2' +///׿ʼʼ +#define THOST_FTDC_ES_Initialize '3' +///ɳʼ +#define THOST_FTDC_ES_Initialized '4' +///пʼ +#define THOST_FTDC_ES_Close '5' +/// +#define THOST_FTDC_ES_Closed '6' +/// +#define THOST_FTDC_ES_Settlement '7' + +typedef char TThostFtdcSystemStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ʼ +#define THOST_FTDC_STS_Initialize '0' +/// +#define THOST_FTDC_STS_Settlementing '1' +///ѽ +#define THOST_FTDC_STS_Settlemented '2' +/// +#define THOST_FTDC_STS_Finished '3' + +typedef char TThostFtdcSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntTypeTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntFromTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntFromType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntToTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntToType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionIDTypeһܴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionValueCodeTypeһܱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionValueCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleIDTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRoleIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleNameTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRoleNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescriptionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDescriptionType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineIDTypeһϱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombineIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombineTypeType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CT_Person '0' +/// +#define THOST_FTDC_CT_Company '1' +///Ͷʻ +#define THOST_FTDC_CT_Fund '2' +///ⷨ +#define THOST_FTDC_CT_SpecialOrgan '3'//sgit +///ʹܻ +#define THOST_FTDC_CT_Asset '4'//sgit + +typedef char TThostFtdcInvestorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerTypeTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +///׻Ա +#define THOST_FTDC_BT_Trade '0' +///׽Ա +#define THOST_FTDC_BT_TradeSettle '1' + +typedef char TThostFtdcBrokerTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskLevelTypeһյȼ +///////////////////////////////////////////////////////////////////////// +///ͷտͻ +#define THOST_FTDC_FAS_Low '1' +///ͨͻ +#define THOST_FTDC_FAS_Normal '2' +///עͻ +#define THOST_FTDC_FAS_Focus '3' +///տͻ +#define THOST_FTDC_FAS_Risk '4' + +typedef char TThostFtdcRiskLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeeAcceptStyleTypeһȡʽ +///////////////////////////////////////////////////////////////////////// +///ȡ +#define THOST_FTDC_FAS_ByTrade '1' +///ȡ +#define THOST_FTDC_FAS_ByDeliv '2' +/// +#define THOST_FTDC_FAS_None '3' +///ָȡ +#define THOST_FTDC_FAS_FixFee '4' + +typedef char TThostFtdcFeeAcceptStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PWDT_Trade '1' +///ʽ +#define THOST_FTDC_PWDT_Account '2' + +typedef char TThostFtdcPasswordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgorithmTypeһӯ㷨 +///////////////////////////////////////////////////////////////////////// +///ӯ +#define THOST_FTDC_AG_All '1' +///ӯƣ +#define THOST_FTDC_AG_OnlyLost '2' +///ӯƣ +#define THOST_FTDC_AG_OnlyGain '3' +///ӯ +#define THOST_FTDC_AG_None '4' + +typedef char TThostFtdcAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIncludeCloseProfitTypeһǷƽӯ +///////////////////////////////////////////////////////////////////////// +///ƽӯ +#define THOST_FTDC_ICP_Include '0' +///ƽӯ +#define THOST_FTDC_ICP_NotInclude '2' + +typedef char TThostFtdcIncludeCloseProfitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAllWithoutTradeTypeһǷܿ +///////////////////////////////////////////////////////////////////////// +///޲޳ɽܿ +#define THOST_FTDC_AWT_Enable '0' +///ܿ +#define THOST_FTDC_AWT_Disable '2' +///޲ֲܿ +#define THOST_FTDC_AWT_NoHoldEnable '3'//sgit + +typedef char TThostFtdcAllWithoutTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommentTypeһӯ㷨˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommentType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVersionTypeһ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcVersionType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeSerialType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradeSerialNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureIDTypeһڻ˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDTypeһд +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBrchIDTypeһзĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankBrchIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBranchIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankBranchIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperNoTypeһ׹Ա +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperNoType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeviceIDTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDeviceIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordNumTypeһ¼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRecordNumType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountTypeһڻʽ˺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccountType[22]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturePwdFlagTypeһʽ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_FPWD_UnCheck '0' +///˶ +#define THOST_FTDC_FPWD_Check '1' + +typedef char TThostFtdcFuturePwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferTypeTypeһת +///////////////////////////////////////////////////////////////////////// +///תڻ +#define THOST_FTDC_TT_BankToFuture '0' +///ڻת +#define THOST_FTDC_TT_FutureToBank '1' + +typedef char TThostFtdcTransferTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccPwdTypeһڻʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccPwdType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyCodeType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetCodeTypeһӦ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRetCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetInfoTypeһӦϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRetInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmtTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUseAmtTypeһп +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUseAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFetchAmtTypeһпȡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFetchAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferValidFlagTypeһתЧ־ +///////////////////////////////////////////////////////////////////////// +///Чʧ +#define THOST_FTDC_TVF_Invalid '0' +///Ч +#define THOST_FTDC_TVF_Valid '1' +/// +#define THOST_FTDC_TVF_Reverse '2' + +typedef char TThostFtdcTransferValidFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertCodeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCertCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReasonTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_RN_CD '0' +///ʽ; +#define THOST_FTDC_RN_ZT '1' +/// +#define THOST_FTDC_RN_QT '2' + +typedef char TThostFtdcReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundProjectIDTypeһʽĿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFundProjectIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSexTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_SEX_None '0' +/// +#define THOST_FTDC_SEX_Man '1' +///Ů +#define THOST_FTDC_SEX_Woman '2' + +typedef char TThostFtdcSexType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProfessionTypeһְҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProfessionType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNationalTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNationalType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProvinceTypeһʡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProvinceType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRegionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRegionType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCountryType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNOTypeһӪҵִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLicenseNOType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCompanyTypeType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessScopeTypeһӪΧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessScopeType[1001]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCapitalCurrencyTypeһעʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCapitalCurrencyType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserTypeTypeһû +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_UT_Investor '0' +///Ա +#define THOST_FTDC_UT_Operator '1' +///Ա +#define THOST_FTDC_UT_SuperUser '2' + +typedef char TThostFtdcUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_RATETYPE_MarginRate '2' + +typedef char TThostFtdcRateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNoteTypeTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +///׽㵥 +#define THOST_FTDC_NOTETYPE_TradeSettleBill '1' +///׽± +#define THOST_FTDC_NOTETYPE_TradeSettleMonth '2' +///׷ӱ֤֪ͨ +#define THOST_FTDC_NOTETYPE_CallMarginNotes '3' +///ǿƽ֪ͨ +#define THOST_FTDC_NOTETYPE_ForceCloseNotes '4' +///ɽ֪ͨ +#define THOST_FTDC_NOTETYPE_TradeNotes '5' +///֪ͨ +#define THOST_FTDC_NOTETYPE_DelivNotes '6' + +typedef char TThostFtdcNoteTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStyleTypeһ㵥ʽ +///////////////////////////////////////////////////////////////////////// +///ն +#define THOST_FTDC_SBS_Day '1' +///ʶԳ +#define THOST_FTDC_SBS_Volume '2' + +typedef char TThostFtdcSettlementStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDNSTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerDNSType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSentenceTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSentenceType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementBillTypeTypeһ㵥 +///////////////////////////////////////////////////////////////////////// +///ձ +#define THOST_FTDC_ST_Day '0' +///± +#define THOST_FTDC_ST_Month '1' + +typedef char TThostFtdcSettlementBillTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRightTypeTypeһͻȨ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_URT_Logon '1' +///ת +#define THOST_FTDC_URT_Transfer '2' +///ʼĽ㵥 +#define THOST_FTDC_URT_EMail '3' +///㵥 +#define THOST_FTDC_URT_Fax '4' +/// +#define THOST_FTDC_URT_ConditionOrder '5' + +typedef char TThostFtdcUserRightTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginPriceTypeTypeһ֤۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_MPT_PreSettlementPrice '1' +///¼ +#define THOST_FTDC_MPT_SettlementPrice '2' +///ɽ +#define THOST_FTDC_MPT_AveragePrice '3' +///ּ +#define THOST_FTDC_MPT_OpenPrice '4' + +typedef char TThostFtdcMarginPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillGenStatusTypeһ㵥״̬ +///////////////////////////////////////////////////////////////////////// +///δ +//sgit: +#define THOST_FTDC_BGS_None '0' +/// +//sigt:δ +#define THOST_FTDC_BGS_NoGenerated '1' +/// +#define THOST_FTDC_BGS_Generated '2' + +typedef char TThostFtdcBillGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgoTypeTypeһ㷨 +///////////////////////////////////////////////////////////////////////// +///ֲִ㷨 +#define THOST_FTDC_AT_HandlePositionAlgo '1' +///Ѱұ֤㷨 +#define THOST_FTDC_AT_FindMarginRateAlgo '2' + +typedef char TThostFtdcAlgoTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandlePositionAlgoIDTypeһֲִ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HPA_Base '1' +///Ʒ +#define THOST_FTDC_HPA_DCE '2' +///֣Ʒ +#define THOST_FTDC_HPA_CZCE '3' + +typedef char TThostFtdcHandlePositionAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFindMarginRateAlgoIDTypeһѰұ֤㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FMRA_Base '1' +///Ʒ +#define THOST_FTDC_FMRA_DCE '2' +///֣Ʒ +#define THOST_FTDC_FMRA_CZCE '3' + +typedef char TThostFtdcFindMarginRateAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandleTradingAccountAlgoIDTypeһʽ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HTAA_Base '1' +///Ʒ +#define THOST_FTDC_HTAA_DCE '2' +///֣Ʒ +#define THOST_FTDC_HTAA_CZCE '3' + +typedef char TThostFtdcHandleTradingAccountAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPersonTypeTypeһϵ +///////////////////////////////////////////////////////////////////////// +///ָµ +#define THOST_FTDC_PST_Order '1' +///Ȩ +#define THOST_FTDC_PST_Open '2' +///ʽ +#define THOST_FTDC_PST_Fund '3' +///㵥ȷ +#define THOST_FTDC_PST_Settlement '4' +/// +#define THOST_FTDC_PST_Company '5' +///˴ +#define THOST_FTDC_PST_Corporation '6' +///Ͷϵ +#define THOST_FTDC_PST_LinkMan '7' +///ֻʲ +#define THOST_FTDC_PST_Ledger '8'//,sgit +///У +#define THOST_FTDC_PST_Trustee '9' +///Уܻ˴ +#define THOST_FTDC_PST_TrusteeCorporation 'A' +///УܻȨ +#define THOST_FTDC_PST_TrusteeOpen 'B' +///Уܻϵ +#define THOST_FTDC_PST_TrusteeContact 'C' +///Ȼ˲ο֤ +#define THOST_FTDC_PST_ForeignerRefer 'D' +///˴ο֤ +#define THOST_FTDC_PST_CorporationRefer 'E' + +typedef char TThostFtdcPersonTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryInvestorRangeTypeһѯΧ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_QIR_All '1' +///ѯ +#define THOST_FTDC_QIR_Group '2' +///һͶ +#define THOST_FTDC_QIR_Single '3' + +typedef char TThostFtdcQueryInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRiskStatusTypeһͶ߷״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IRS_Normal '1' +/// +#define THOST_FTDC_IRS_Warn '2' +///׷ +#define THOST_FTDC_IRS_Call '3' +///ǿƽ +#define THOST_FTDC_IRS_Force '4' +///쳣 +#define THOST_FTDC_IRS_Exception '5' + +typedef char TThostFtdcInvestorRiskStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegIDTypeһȱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLegIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegMultipleTypeһȳ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLegMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImplyLevelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcImplyLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearAccountType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNOTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganNOType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearbarchIDTypeһ˻к +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearbarchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventTypeTypeһû¼ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_UET_Login '1' +///dz +#define THOST_FTDC_UET_Logout '2' +///׳ɹ +#define THOST_FTDC_UET_Trading '3' +///ʧ +#define THOST_FTDC_UET_TradingError '4' +///޸ +#define THOST_FTDC_UET_UpdatePassword '5' +///ͻ֤ +#define THOST_FTDC_UET_Authenticate '6' +/// +#define THOST_FTDC_UET_Other '9' + +typedef char TThostFtdcUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventInfoTypeһû¼Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserEventInfoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseStyleTypeһƽַʽ +///////////////////////////////////////////////////////////////////////// +///ȿƽ +#define THOST_FTDC_ICS_Close '0' +///ƽƽ +#define THOST_FTDC_ICS_CloseToday '1' + +typedef char TThostFtdcCloseStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStatModeTypeһͳƷʽ +///////////////////////////////////////////////////////////////////////// +///---- +#define THOST_FTDC_SM_Non '0' +///Լͳ +#define THOST_FTDC_SM_Instrument '1' +///Ʒͳ +#define THOST_FTDC_SM_Product '2' +///Ͷͳ +#define THOST_FTDC_SM_Investor '3' + +typedef char TThostFtdcStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderStatusTypeһԤ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PAOS_NotSend '1' +///ѷ +#define THOST_FTDC_PAOS_Send '2' +///ɾ +#define THOST_FTDC_PAOS_Deleted '3' + +typedef char TThostFtdcParkedOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderIDTypeһԤ񱨵 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParkedOrderIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderActionIDTypeһԤ񳷵 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParkedOrderActionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirDealStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ڴ +#define THOST_FTDC_VDS_Dealing '1' +///ɹ +#define THOST_FTDC_VDS_DeaclSucceed '2' + +typedef char TThostFtdcVirDealStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrgSystemIDTypeһԭϵͳ +///////////////////////////////////////////////////////////////////////// +///ۺϽƽ̨ +#define THOST_FTDC_ORGS_Standard '0' +///ʢϵͳ +#define THOST_FTDC_ORGS_ESunny '1' +///˴V6ϵͳ +#define THOST_FTDC_ORGS_KingStarV6 '2' + +typedef char TThostFtdcOrgSystemIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirTradeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VTS_NaturalDeal '0' +///ɹ +#define THOST_FTDC_VTS_SucceedEnd '1' +///ʧܽ +#define THOST_FTDC_VTS_FailedEND '2' +///쳣 +#define THOST_FTDC_VTS_Exception '3' +///˹쳣 +#define THOST_FTDC_VTS_ManualDeal '4' +///ͨѶ쳣 ˹ +#define THOST_FTDC_VTS_MesException '5' +///ϵͳ˹ +#define THOST_FTDC_VTS_SysException '6' + +typedef char TThostFtdcVirTradeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirBankAccTypeTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VBAT_BankBook '1' +/// +#define THOST_FTDC_VBAT_BankCard '2' +///ÿ +#define THOST_FTDC_VBAT_CreditCard '3' + +typedef char TThostFtdcVirBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementStatusTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VMS_Natural '0' +/// +#define THOST_FTDC_VMS_Canceled '9' + +typedef char TThostFtdcVirementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementAvailAbilityTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define THOST_FTDC_VAA_NoAvailAbility '0' +///Ч +#define THOST_FTDC_VAA_AvailAbility '1' +/// +#define THOST_FTDC_VAA_Repeal '2' + +typedef char TThostFtdcVirementAvailAbilityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +///зʽתڻ +#define THOST_FTDC_VTC_BankBankToFuture '102001' +///зڻʽת +#define THOST_FTDC_VTC_BankFutureToBank '102002' +///ڻʽתڻ +#define THOST_FTDC_VTC_FutureBankToFuture '202001' +///ڻڻʽת +#define THOST_FTDC_VTC_FutureFutureToBank '202002' + +typedef char TThostFtdcVirementTradeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoTypeNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeIDTypeһӰʹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoTypeIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTopicIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTopicIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportTypeIDTypeһױͱʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcReportTypeIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCharacterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCharacterIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInvestorTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLIdCardTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeDirectTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradeDirectType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeModelTypeһʽʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradeModelType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLOpParamValueTypeһҵֵ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcAMLOpParamValueType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCustomerCardTypeTypeһͻ֤/֤ļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCustomerCardTypeType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionNameTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLDistrictIDTypeһڻڵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLDistrictIDType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLRelationShipTypeһڻ׵Ĺϵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLRelationShipType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionIDTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLAccountTypeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradingTypeTypeһ׷ʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradingTypeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTransactClassTypeһ֧׷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTransactClassType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalIOTypeһʽոʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCapitalIOType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSiteTypeһ׵ص +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSiteType[10]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalPurposeTypeһʽ; +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCapitalPurposeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLReportTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSerialNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSerialNoType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLGenStatusTypeһAmlɷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_GEN_Program '0' +///˹ +#define THOST_FTDC_GEN_HandWork '1' + +typedef char TThostFtdcAMLGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSeqCodeTypeһҵʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSeqCodeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileNameTypeһAMLļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLMoneyTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcAMLMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileAmountTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcAMLFileAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCKeyTypeһԿ(֤) +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCFMMCKeyType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCTokenTypeһ(֤) +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCFMMCTokenType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCKeyKindTypeһ̬Կ(֤) +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CFMMCKK_REQUEST 'R' +///CFMMCԶ +#define THOST_FTDC_CFMMCKK_AUTO 'A' +///CFMMCֶ +#define THOST_FTDC_CFMMCKK_MANUAL 'M' + +typedef char TThostFtdcCFMMCKeyKindType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLReportNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndividualNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIndividualNameType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyIDTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustNumberTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCustNumberType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganCodeType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSuperOrganCodeTypeһϼ,ڻ˾ܲ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSuperOrganCodeType[12]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchIDTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchNameTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSubBranchNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchNetCodeType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchNetNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganFlagTypeһʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCodingForFutureTypeһжڻ˾ı +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankCodingForFutureType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankReturnCodeTypeһжԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateReturnCodeTypeһתƽ̨ԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPlateReturnCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSubBranchIDTypeһз֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureBranchIDTypeһڻ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnCodeTypeһش +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorCodeTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperatorCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearDepIDTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearBrchIDTypeһʻк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvDepIDTypeһͶ˺Ż +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvBrchIDTypeһͶк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMessageFormatVersionTypeһϢʽ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMessageFormatVersionType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDigestTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDigestType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthenticDataTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthenticDataType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPasswordKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountNameTypeһڻʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccountNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobilePhoneTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMobilePhoneType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureMainKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureWorkKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTransKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankMainKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankWorkKeyTypeһйԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankTransKeyTypeһдԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankServerDescriptionTypeһзϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankServerDescriptionType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddInfoTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAddInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescrInfoForReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDescrInfoForReturnCodeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCountryCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateSerialTypeһƽ̨ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcPlateSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankSerialType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorrectSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCorrectSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureSerialTypeһڻ˾ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFutureSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplicationIDTypeһӦñʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcApplicationIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankProxyIDTypeһдʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBankProxyIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTCoreIDTypeһתʺϵͳʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBTCoreIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServerPortTypeһ˿ں +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServerPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealedTimesTypeһѾ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRepealedTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealTimeIntervalTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRepealTimeIntervalType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalTimesTypeһÿۼתʴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTotalTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTRequestIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBTRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmountTypeһ׽Ԫ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcTradeAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustFeeTypeһӦտͻãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCustFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureFeeTypeһӦڻ˾ãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcFutureFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMaxAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcSingleMaxAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMinAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcSingleMinAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalAmtTypeһÿۼתʶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcTotalAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertificationTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_CFT_IDCard '0' +/// +#define THOST_FTDC_CFT_Passport '1' +///֤ +#define THOST_FTDC_CFT_OfficerIDCard '2' +///ʿ֤ +#define THOST_FTDC_CFT_SoldierIDCard '3' +///֤ +#define THOST_FTDC_CFT_HomeComingCard '4' +///ڲ +#define THOST_FTDC_CFT_HouseholdRegister '5' +///Ӫҵִպ +#define THOST_FTDC_CFT_LicenseNo '6' +///֤֯ +#define THOST_FTDC_CFT_InstitutionCodeCard '7' +///ʱӪҵִպ +#define THOST_FTDC_CFT_TempLicenseNo '8' +///ҵǼ֤ +#define THOST_FTDC_CFT_NoEnterpriseLicenseNo '9' +///֤ +#define THOST_FTDC_CFT_OtherCard 'x' +///ܲ +#define THOST_FTDC_CFT_SuperDepAgree 'a' + +typedef char TThostFtdcCertificationTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileBusinessCodeTypeһļҵ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBC_Others '0' +///ת˽ϸ +#define THOST_FTDC_FBC_TransferDetails '1' +///ͻ˻״̬ +#define THOST_FTDC_FBC_CustAccStatus '2' +///˻ཻϸ +#define THOST_FTDC_FBC_AccountTradeDetails '3' +///ڻ˻Ϣϸ +#define THOST_FTDC_FBC_FutureAccountChangeInfoDetails '4' +///ͻʽ̨ϸ +#define THOST_FTDC_FBC_CustMoneyDetail '5' +///ͻϢϸ +#define THOST_FTDC_FBC_CustCancelAccountInfo '6' +///ͻʽ˽ +#define THOST_FTDC_FBC_CustMoneyResult '7' +///쳣ļ +#define THOST_FTDC_FBC_OthersExceptionResult '8' +///ͻϢϸ +#define THOST_FTDC_FBC_CustInterestNetMoneyDetails '9' +///ͻʽϸ +#define THOST_FTDC_FBC_CustMoneySendAndReceiveDetails 'a' +///˴ʽջ +#define THOST_FTDC_FBC_CorporationMoneyTotal 'b' +///ʽջ +#define THOST_FTDC_FBC_MainbodyMoneyTotal 'c' +///ܷƽ +#define THOST_FTDC_FBC_MainPartMonitorData 'd' +///б +#define THOST_FTDC_FBC_PreparationMoney 'e' +///Эʽ +#define THOST_FTDC_FBC_BankMoneyMonitorData 'f' + +typedef char TThostFtdcFileBusinessCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCashExchangeCodeTypeһ㳮־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CEC_Exchange '1' +/// +#define THOST_FTDC_CEC_Cash '2' + +typedef char TThostFtdcCashExchangeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYesNoIndicatorTypeһǻʶ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_YNI_Yes '0' +/// +#define THOST_FTDC_YNI_No '1' + +typedef char TThostFtdcYesNoIndicatorType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBanlanceTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define THOST_FTDC_BLT_CurrentMoney '0' +/// +#define THOST_FTDC_BLT_UsableMoney '1' +///ȡ +#define THOST_FTDC_BLT_FetchableMoney '2' +/// +#define THOST_FTDC_BLT_FreezeMoney '3' + +typedef char TThostFtdcBanlanceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGenderTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪״̬ +#define THOST_FTDC_GD_Unknown '0' +/// +#define THOST_FTDC_GD_Male '1' +///Ů +#define THOST_FTDC_GD_Female '2' + +typedef char TThostFtdcGenderType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeePayFlagTypeһ֧־ +///////////////////////////////////////////////////////////////////////// +///淽֧ +#define THOST_FTDC_FPF_BEN '0' +///ɷͷ֧ +#define THOST_FTDC_FPF_OUR '1' +///ɷͷ֧ķã淽֧ܵķ +#define THOST_FTDC_FPF_SHA '2' + +typedef char TThostFtdcFeePayFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPassWordKeyTypeTypeһԿ +///////////////////////////////////////////////////////////////////////// +///Կ +#define THOST_FTDC_PWKT_ExchangeKey '0' +///Կ +#define THOST_FTDC_PWKT_PassWordKey '1' +///MACԿ +#define THOST_FTDC_PWKT_MACKey '2' +///Կ +#define THOST_FTDC_PWKT_MessageKey '3' + +typedef char TThostFtdcPassWordKeyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTPassWordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ѯ +#define THOST_FTDC_PWT_Query '0' +///ȡ +#define THOST_FTDC_PWT_Fetch '1' +///ת +#define THOST_FTDC_PWT_Transfer '2' +/// +#define THOST_FTDC_PWT_Trade '3' + +typedef char TThostFtdcFBTPassWordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTEncryModeTypeһܷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EM_NoEncry '0' +///DES +#define THOST_FTDC_EM_DES '1' +///3DES +#define THOST_FTDC_EM_3DES '2' + +typedef char TThostFtdcFBTEncryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankRepealFlagTypeһг־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define THOST_FTDC_BRF_BankNotNeedRepeal '0' +///дԶ +#define THOST_FTDC_BRF_BankWaitingRepeal '1' +///Զ +#define THOST_FTDC_BRF_BankBeenRepealed '2' + +typedef char TThostFtdcBankRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerRepealFlagTypeһ̳־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define THOST_FTDC_BRORF_BrokerNotNeedRepeal '0' +///̴Զ +#define THOST_FTDC_BRORF_BrokerWaitingRepeal '1' +///Զ +#define THOST_FTDC_BRORF_BrokerBeenRepealed '2' + +typedef char TThostFtdcBrokerRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstitutionTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TS_Bank '0' +/// +#define THOST_FTDC_TS_Future '1' +///ȯ +#define THOST_FTDC_TS_Store '2' + +typedef char TThostFtdcInstitutionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastFragmentTypeһƬ־ +///////////////////////////////////////////////////////////////////////// +///Ƭ +#define THOST_FTDC_LF_Yes '0' +///Ƭ +#define THOST_FTDC_LF_No '1' + +typedef char TThostFtdcLastFragmentType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccStatusTypeһ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_BAS_Normal '0' +/// +#define THOST_FTDC_BAS_Freeze '1' +///ʧ +#define THOST_FTDC_BAS_ReportLoss '2' + +typedef char TThostFtdcBankAccStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyAccountStatusTypeһʽ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_MAS_Normal '0' +/// +#define THOST_FTDC_MAS_Cancel '1' + +typedef char TThostFtdcMoneyAccountStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcManageStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ָ +#define THOST_FTDC_MSS_Point '0' +///Ԥָ +#define THOST_FTDC_MSS_PrePoint '1' +///ָ +#define THOST_FTDC_MSS_CancelPoint '2' + +typedef char TThostFtdcManageStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemTypeTypeһӦϵͳ +///////////////////////////////////////////////////////////////////////// +///ת +#define THOST_FTDC_SYT_FutureBankTransfer '0' +///֤ת +#define THOST_FTDC_SYT_StockBankTransfer '1' +/// +#define THOST_FTDC_SYT_TheThirdPartStore '2' + +typedef char TThostFtdcSystemTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTxnEndFlagTypeһתʻת־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TEF_NormalProcessing '0' +///ɹ +#define THOST_FTDC_TEF_Success '1' +///ʧܽ +#define THOST_FTDC_TEF_Failed '2' +///쳣 +#define THOST_FTDC_TEF_Abnormal '3' +///˹쳣 +#define THOST_FTDC_TEF_ManualProcessedForException '4' +///ͨѶ쳣 ˹ +#define THOST_FTDC_TEF_CommuFailedNeedManualProcess '5' +///ϵͳ˹ +#define THOST_FTDC_TEF_SysErrorNeedManualProcess '6' + +typedef char TThostFtdcTxnEndFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessStatusTypeһתʷ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PSS_NotProcess '0' +///ʼ +#define THOST_FTDC_PSS_StartProcess '1' +/// +#define THOST_FTDC_PSS_Finished '2' + +typedef char TThostFtdcProcessStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CUSTT_Person '0' +/// +#define THOST_FTDC_CUSTT_Institution '1' + +typedef char TThostFtdcCustTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTransferDirectionTypeһתʷ +///////////////////////////////////////////////////////////////////////// +///תڻ +#define THOST_FTDC_FBTTD_FromBankToFuture '1' +///ڻת +#define THOST_FTDC_FBTTD_FromFutureToBank '2' + +typedef char TThostFtdcFBTTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenOrDestroyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OOD_Open '1' +/// +#define THOST_FTDC_OOD_Destroy '0' + +typedef char TThostFtdcOpenOrDestroyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAvailabilityFlagTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define THOST_FTDC_AVAF_Invalid '0' +///Ч +#define THOST_FTDC_AVAF_Valid '1' +/// +#define THOST_FTDC_AVAF_Repeal '2' + +typedef char TThostFtdcAvailabilityFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_OT_Bank '1' +///ǰ +#define THOST_FTDC_OT_Future '2' +///תƽ̨ +#define THOST_FTDC_OT_PlateForm '9' + +typedef char TThostFtdcOrganTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///лܲ +#define THOST_FTDC_OL_HeadQuarters '1' +///зĻڻ˾Ӫҵ +#define THOST_FTDC_OL_Branch '2' + +typedef char TThostFtdcOrganLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocalIDTypeһЭ +///////////////////////////////////////////////////////////////////////// +///Э +#define THOST_FTDC_PID_FutureProtocal '0' +///Э +#define THOST_FTDC_PID_ICBCProtocal '1' +///ũЭ +#define THOST_FTDC_PID_ABCProtocal '2' +///йЭ +#define THOST_FTDC_PID_CBCProtocal '3' +///Э +#define THOST_FTDC_PID_CCBProtocal '4' +///Э +#define THOST_FTDC_PID_BOCOMProtocal '5' +///תƽ̨Э +#define THOST_FTDC_PID_FBTPlateFormProtocal 'X' + +typedef char TThostFtdcProtocalIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConnectModeTypeһ׽ӷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CM_ShortConnect '0' +/// +#define THOST_FTDC_CM_LongConnect '1' + +typedef char TThostFtdcConnectModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncModeTypeһ׽ͨŷʽ +///////////////////////////////////////////////////////////////////////// +///첽 +#define THOST_FTDC_SRM_ASync '0' +///ͬ +#define THOST_FTDC_SRM_Sync '1' + +typedef char TThostFtdcSyncModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccTypeTypeһʺ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_BAT_BankBook '1' +/// +#define THOST_FTDC_BAT_SavingCard '2' +///ÿ +#define THOST_FTDC_BAT_CreditCard '3' + +typedef char TThostFtdcBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccTypeTypeһڻ˾ʺ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_FAT_BankBook '1' +/// +#define THOST_FTDC_FAT_SavingCard '2' +///ÿ +#define THOST_FTDC_FAT_CreditCard '3' + +typedef char TThostFtdcFutureAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OS_Ready '0' +///ǩ +#define THOST_FTDC_OS_CheckIn '1' +///ǩ +#define THOST_FTDC_OS_CheckOut '2' +///ļ +#define THOST_FTDC_OS_CheckFileArrived '3' +/// +#define THOST_FTDC_OS_CheckDetail '4' +/// +#define THOST_FTDC_OS_DayEndClean '5' +///ע +#define THOST_FTDC_OS_Invalid '9' + +typedef char TThostFtdcOrganStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCCBFeeModeTypeһշģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CCBFM_ByAmount '1' +///¿ +#define THOST_FTDC_CCBFM_ByMonth '2' + +typedef char TThostFtdcCCBFeeModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiTypeTypeһͨѶAPI +///////////////////////////////////////////////////////////////////////// +///ͻ +#define THOST_FTDC_CAPIT_Client '1' +/// +#define THOST_FTDC_CAPIT_Server '2' +///ϵͳUserApi +#define THOST_FTDC_CAPIT_UserApi '3' + +typedef char TThostFtdcCommApiTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServiceIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceLineNoTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServiceLineNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcServiceNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLinkStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿ +#define THOST_FTDC_LS_Connected '1' +///û +#define THOST_FTDC_LS_Disconnected '2' + +typedef char TThostFtdcLinkStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiPointerTypeһͨѶAPIָ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCommApiPointerType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPwdFlagTypeһ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_BPWDF_NoCheck '0' +///ĺ˶ +#define THOST_FTDC_BPWDF_BlankCheck '1' +///ĺ˶ +#define THOST_FTDC_BPWDF_EncryptCheck '2' + +typedef char TThostFtdcPwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSecuAccTypeTypeһڻʺ +///////////////////////////////////////////////////////////////////////// +///ʽʺ +#define THOST_FTDC_SAT_AccountID '1' +///ʽ𿨺 +#define THOST_FTDC_SAT_CardID '2' +///Ϻɶʺ +#define THOST_FTDC_SAT_SHStockholderID '3' +///ڹɶʺ +#define THOST_FTDC_SAT_SZStockholderID '4' + +typedef char TThostFtdcSecuAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferStatusTypeһת˽״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TRFS_Normal '0' +/// +#define THOST_FTDC_TRFS_Repealed '1' + +typedef char TThostFtdcTransferStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSponsorTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SPTYPE_Broker '0' +/// +#define THOST_FTDC_SPTYPE_Bank '1' + +typedef char TThostFtdcSponsorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReqRspTypeTypeһӦ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_REQRSP_Request '0' +///Ӧ +#define THOST_FTDC_REQRSP_Response '1' + +typedef char TThostFtdcReqRspTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTUserEventTypeTypeһתû¼ +///////////////////////////////////////////////////////////////////////// +///ǩ +#define THOST_FTDC_FBTUET_SignIn '0' +///תڻ +#define THOST_FTDC_FBTUET_FromBankToFuture '1' +///ڻת +#define THOST_FTDC_FBTUET_FromFutureToBank '2' +/// +#define THOST_FTDC_FBTUET_OpenAccount '3' +/// +#define THOST_FTDC_FBTUET_CancelAccount '4' +///˻ +#define THOST_FTDC_FBTUET_ChangeAccount '5' +///תڻ +#define THOST_FTDC_FBTUET_RepealFromBankToFuture '6' +///ڻת +#define THOST_FTDC_FBTUET_RepealFromFutureToBank '7' +///ѯ˻ +#define THOST_FTDC_FBTUET_QueryBankAccount '8' +///ѯڻ˻ +#define THOST_FTDC_FBTUET_QueryFutureAccount '9' +///ǩ +#define THOST_FTDC_FBTUET_SignOut 'A' +///Կͬ +#define THOST_FTDC_FBTUET_SyncKey 'B' +/// +#define THOST_FTDC_FBTUET_Other 'Z' + +typedef char TThostFtdcFBTUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDByBankTypeһԼı +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankIDByBankType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankOperNoTypeһвԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankOperNoType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCustNoTypeһпͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankCustNoType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBOPSeqNoTypeһк +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDBOPSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTableNameTypeһFBT +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTableNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPKNameTypeһFBT +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPKNameType[201]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPKValueTypeһFBTֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPKValueType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBOperationTypeһ¼ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_DBOP_Insert '0' +/// +#define THOST_FTDC_DBOP_Update '1' +///ɾ +#define THOST_FTDC_DBOP_Delete '2' + +typedef char TThostFtdcDBOperationType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncFlagTypeһͬ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_SYNF_Yes '0' +///δͬ +#define THOST_FTDC_SYNF_No '1' + +typedef char TThostFtdcSyncFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTargetIDTypeһͬĿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTargetIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncTypeTypeһͬ +///////////////////////////////////////////////////////////////////////// +///һͬ +#define THOST_FTDC_SYNT_OneOffSync '0' +///ʱͬ +#define THOST_FTDC_SYNT_TimerSync '1' +///ʱȫͬ +#define THOST_FTDC_SYNT_TimerFullSync '2' + +typedef char TThostFtdcSyncTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBETimeTypeһֻʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBETimeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankNoTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBECertNoTypeһƾ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBECertNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExDirectionTypeһ㷽 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBEDIR_Settlement '0' +///ۻ +#define THOST_FTDC_FBEDIR_Sale '1' + +typedef char TThostFtdcExDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankAccountType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankAccountNameTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankAccountNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEAmtTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcFBEAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBusinessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEPostScriptTypeһ㸽 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEPostScriptType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBERemarkTypeһ㱸ע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBERemarkType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExRateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcExRateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEResultFlagTypeһɹ־ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_FBERES_Success '0' +///˻ +#define THOST_FTDC_FBERES_InsufficientBalance '1' +///׽δ֪ +#define THOST_FTDC_FBERES_UnknownTrading '8' +///ʧ +#define THOST_FTDC_FBERES_Fail 'x' + +typedef char TThostFtdcFBEResultFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBERtnMsgTypeһ㷵Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBERtnMsgType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEExtendMsgTypeһչϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEExtendMsgType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBusinessSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBusinessSerialType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBESystemSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBESystemSerialType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBETotalExCntTypeһ㽻ܱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBETotalExCntType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEExchStatusTypeһ㽻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBEES_Normal '0' +///ط +#define THOST_FTDC_FBEES_ReExchange '1' + +typedef char TThostFtdcFBEExchStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEFileFlagTypeһļ־ +///////////////////////////////////////////////////////////////////////// +///ݰ +#define THOST_FTDC_FBEFG_DataPackage '0' +///ļ +#define THOST_FTDC_FBEFG_File '1' + +typedef char TThostFtdcFBEFileFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEAlreadyTradeTypeһѽױ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FBEAT_NotTrade '0' +///ѽ +#define THOST_FTDC_FBEAT_Trade '1' + +typedef char TThostFtdcFBEAlreadyTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEOpenBankTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEOpenBankType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEUserEventTypeTypeһڻû¼ +///////////////////////////////////////////////////////////////////////// +///ǩ +#define THOST_FTDC_FBEUET_SignIn '0' +/// +#define THOST_FTDC_FBEUET_Exchange '1' +///ط +#define THOST_FTDC_FBEUET_ReExchange '2' +///˻ѯ +#define THOST_FTDC_FBEUET_QueryBankAccount '3' +///ϸѯ +#define THOST_FTDC_FBEUET_QueryExchDetial '4' +///ܲѯ +#define THOST_FTDC_FBEUET_QueryExchSummary '5' +///ʲѯ +#define THOST_FTDC_FBEUET_QueryExchRate '6' +///ļ֪ͨ +#define THOST_FTDC_FBEUET_CheckBankAccount '7' +///ǩ +#define THOST_FTDC_FBEUET_SignOut '8' +/// +#define THOST_FTDC_FBEUET_Other 'Z' + +typedef char TThostFtdcFBEUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEFileNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBatchSerialTypeһκ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBatchSerialType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEReqFlagTypeһ㷢ͱ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FBERF_UnProcessed '0' +///ȴ +#define THOST_FTDC_FBERF_WaitSend '1' +///ͳɹ +#define THOST_FTDC_FBERF_SendSuccess '2' +///ʧ +#define THOST_FTDC_FBERF_SendFailed '3' +///ȴط +#define THOST_FTDC_FBERF_WaitReSend '4' + +typedef char TThostFtdcFBEReqFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNotifyClassTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_NC_NOERROR '0' +///ʾ +#define THOST_FTDC_NC_Warn '1' +///׷ +#define THOST_FTDC_NC_Call '2' +///ǿƽ +#define THOST_FTDC_NC_Force '3' +/// +#define THOST_FTDC_NC_CHUANCANG '4' +///쳣 +#define THOST_FTDC_NC_Exception '5' + +typedef char TThostFtdcNotifyClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNofityInfoTypeһͻ֪ͨϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRiskNofityInfoType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseSceneIdTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcForceCloseSceneIdType[24]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseTypeTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +///ֹǿƽ +#define THOST_FTDC_FCT_Manual '0' +///һͶ߸ǿƽ +#define THOST_FTDC_FCT_Single '1' +///Ͷ߸ǿƽ +#define THOST_FTDC_FCT_Group '2' + +typedef char TThostFtdcForceCloseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDsTypeһƷ,+ָ,cu+zn +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDsType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyMethodTypeһ֪ͨ; +///////////////////////////////////////////////////////////////////////// +///ϵͳ֪ͨ +#define THOST_FTDC_RNM_System '0' +///֪ͨ +#define THOST_FTDC_RNM_SMS '1' +///ʼ֪ͨ +#define THOST_FTDC_RNM_EMail '2' +///˹֪ͨ +#define THOST_FTDC_RNM_Manual '3' + +typedef char TThostFtdcRiskNotifyMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyStatusTypeһ֪ͨ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_RNS_NotGen '0' +///δ +#define THOST_FTDC_RNS_Generated '1' +///ʧ +#define THOST_FTDC_RNS_SendError '2' +///ѷδ +#define THOST_FTDC_RNS_SendOk '3' +///ѽδȷ +#define THOST_FTDC_RNS_Received '4' +///ȷ +#define THOST_FTDC_RNS_Confirmed '5' + +typedef char TThostFtdcRiskNotifyStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskUserEventTypeһû¼ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_RUE_ExportData '0' + +typedef char TThostFtdcRiskUserEventType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParamNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParamValueType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConditionalOrderSortTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ʹ¼ +#define THOST_FTDC_COST_LastPriceAsc '0' +///ʹ¼۽ +#define THOST_FTDC_COST_LastPriceDesc '1' +///ʹ +#define THOST_FTDC_COST_AskPriceAsc '2' +///ʹ۽ +#define THOST_FTDC_COST_AskPriceDesc '3' +///ʹ +#define THOST_FTDC_COST_BidPriceAsc '4' +///ʹ۽ +#define THOST_FTDC_COST_BidPriceDesc '5' + +typedef char TThostFtdcConditionalOrderSortTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendTypeTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UOAST_NoSend '0' +///ѷ +#define THOST_FTDC_UOAST_Sended '1' +/// +#define THOST_FTDC_UOAST_Generated '2' +///ʧ +#define THOST_FTDC_UOAST_SendFail '3' +///ճɹ +#define THOST_FTDC_UOAST_Success '4' +///ʧ +#define THOST_FTDC_UOAST_Fail '5' +///ȡ +#define THOST_FTDC_UOAST_Cancel '6' + +typedef char TThostFtdcSendTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDStatusTypeһױ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UOACS_NoApply '1' +///ύ +#define THOST_FTDC_UOACS_Submited '2' +///ѷ +#define THOST_FTDC_UOACS_Sended '3' +/// +#define THOST_FTDC_UOACS_Success '4' +///ܾ +#define THOST_FTDC_UOACS_Refuse '5' +///ѳ +#define THOST_FTDC_UOACS_Cancel '6' + +typedef char TThostFtdcClientIDStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndustryIDTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIndustryIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionIDTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcQuestionIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionContentTypeһϢ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcQuestionContentType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionIDTypeһѡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOptionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionContentTypeһѡ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOptionContentType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionTypeTypeһϢ +///////////////////////////////////////////////////////////////////////// +///ѡ +#define THOST_FTDC_QT_Radio '1' +///ѡ +#define THOST_FTDC_QT_Option '2' +/// +#define THOST_FTDC_QT_Blank '3' + +typedef char TThostFtdcQuestionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessIDTypeһҵˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAProcessStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAProcessStatusType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessTypeTypeһ̹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_BT_Request '1' +///Ӧ +#define THOST_FTDC_BT_Response '2' +///֪ͨ +#define THOST_FTDC_BT_Notice '3' + +typedef char TThostFtdcBusinessTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCfmmcReturnCodeTypeһķ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_CRC_Success '0' +///ÿͻѾڴ +#define THOST_FTDC_CRC_Working '1' +///пͻϼʧ +#define THOST_FTDC_CRC_InfoFail '2' +///ʵƼʧ +#define THOST_FTDC_CRC_IDCardFail '3' +/// +#define THOST_FTDC_CRC_OtherFail '4' + +typedef char TThostFtdcCfmmcReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcExReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CfMMCCT_All '0' +/// +#define THOST_FTDC_CfMMCCT_Person '1' +///λ +#define THOST_FTDC_CfMMCCT_Company '2' +/// +#define THOST_FTDC_CfMMCCT_Other '3'//sgit +///ⷨ +#define THOST_FTDC_CfMMCCT_SpecialOrgan '4' +///ʹܻ +#define THOST_FTDC_CfMMCCT_Asset '5' + +typedef char TThostFtdcClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///Ϻڻ +#define THOST_FTDC_EIDT_SHFE 'S' +///֣Ʒ +#define THOST_FTDC_EIDT_CZCE 'Z' +///Ʒ +#define THOST_FTDC_EIDT_DCE 'D' +///йڻ +#define THOST_FTDC_EIDT_CFFEX 'J' +///ϺԴĹɷ޹˾ +#define THOST_FTDC_EIDT_INE 'N'//sgit +///ƽ +#define THOST_FTDC_EIDT_GOLD 'G'// sgit +///PAT +#define THOST_FTDC_EIDT_PAT 'P' +/// +#define THOST_FTDC_EIDT_LTS 'L' + +typedef char TThostFtdcExchangeIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExClientIDTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///ױ +#define THOST_FTDC_ECIDT_Hedge '1' +/// +#define THOST_FTDC_ECIDT_Arbitrage '2' +///Ͷ +#define THOST_FTDC_ECIDT_Speculation '3' + +typedef char TThostFtdcExClientIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientClassifyTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientClassifyType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAOrganTypeTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAOrganTypeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOACountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOACountryCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAreaCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAreaCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturesIDTypeһΪͻĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFuturesIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffmcDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffmcTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNocIDTypeһ֯ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNocIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUpdateFlagTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UF_NoUpdate '0' +///ȫϢɹ +#define THOST_FTDC_UF_Success '1' +///ȫϢʧ +#define THOST_FTDC_UF_Fail '2' +///½ױɹ +#define THOST_FTDC_UF_TCSuccess '3' +///½ױʧ +#define THOST_FTDC_UF_TCFail '4' +///Ѷ +#define THOST_FTDC_UF_Cancel '5' + +typedef char TThostFtdcUpdateFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyOperateIDTypeһ붯 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AOID_OpenInvestor '1' +///޸Ϣ +#define THOST_FTDC_AOID_ModifyIDCard '2' +///޸һϢ +#define THOST_FTDC_AOID_ModifyNoIDCard '3' +///뽻ױ +#define THOST_FTDC_AOID_ApplyTradingCode '4' +///ױ +#define THOST_FTDC_AOID_CancelTradingCode '5' +/// +#define THOST_FTDC_AOID_CancelInvestor '6' +///˻ +#define THOST_FTDC_AOID_FreezeAccount '8' +///˻ +#define THOST_FTDC_AOID_ActiveFreezeAccount '9' + +typedef char TThostFtdcApplyOperateIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyStatusIDTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δȫ +#define THOST_FTDC_ASID_NoComplete '1' +///ύ +#define THOST_FTDC_ASID_Submited '2' +/// +#define THOST_FTDC_ASID_Checked '3' +///Ѿܾ +#define THOST_FTDC_ASID_Refused '4' +///ɾ +#define THOST_FTDC_ASID_Deleted '5' + +typedef char TThostFtdcApplyStatusIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendMethodTypeһͷʽ +///////////////////////////////////////////////////////////////////////// +///ļ +#define THOST_FTDC_UOASM_ByAPI '1' +///ӷ +#define THOST_FTDC_UOASM_ByFile '2' + +typedef char TThostFtdcSendMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEventTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventModeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EvM_ADD '1' +///޸ +#define THOST_FTDC_EvM_UPDATE '2' +///ɾ +#define THOST_FTDC_EvM_DELETE '3' +/// +#define THOST_FTDC_EvM_CHECK '4' +/// +#define THOST_FTDC_EvM_COPY '5' +///ע +#define THOST_FTDC_EvM_CANCEL '6' +/// +#define THOST_FTDC_EvM_Reverse '7' + +typedef char TThostFtdcEventModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAAutoSendTypeһͳһԶ +///////////////////////////////////////////////////////////////////////// +///ԶͲ +#define THOST_FTDC_UOAA_ASR '1' +///ԶͣԶ +#define THOST_FTDC_UOAA_ASNR '2' +///ԶͣԶ +#define THOST_FTDC_UOAA_NSAR '3' +///ԶͣҲԶ +#define THOST_FTDC_UOAA_NSR '4' + +typedef char TThostFtdcUOAAutoSendType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryDepthTypeһѯ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcQueryDepthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataCenterIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDataCenterIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFlowIDTypeһID +///////////////////////////////////////////////////////////////////////// +///Ͷ߶ӦͶ +#define THOST_FTDC_EvM_InvestorGroupFlow '1' +///Ͷ +#define THOST_FTDC_EvM_InvestorRate '2' +///Ͷģϵ +#define THOST_FTDC_EvM_InvestorCommRateModel '3' + +typedef char TThostFtdcFlowIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define THOST_FTDC_CL_Zero '0' +///һ +#define THOST_FTDC_CL_One '1' +/// +#define THOST_FTDC_CL_Two '2' + +typedef char TThostFtdcCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCheckNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckStatusTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_CHS_Init '0' +/// +#define THOST_FTDC_CHS_Checking '1' +///Ѹ +#define THOST_FTDC_CHS_Checked '2' +///ܾ +#define THOST_FTDC_CHS_Refuse '3' +/// +#define THOST_FTDC_CHS_Cancel '4' + +typedef char TThostFtdcCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUsedStatusTypeһЧ״̬ +///////////////////////////////////////////////////////////////////////// +///δЧ +#define THOST_FTDC_CHU_Unused '0' +///Ч +#define THOST_FTDC_CHU_Used '1' +///Чʧ +#define THOST_FTDC_CHU_Fail '2' + +typedef char TThostFtdcUsedStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRateTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyStringTypeһڲѯͶֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyStringType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAcountOriginTypeһ˻Դ +///////////////////////////////////////////////////////////////////////// +///ֹ¼ +#define THOST_FTDC_BAO_ByAccProperty '0' +///ת +#define THOST_FTDC_BAO_ByFBTransfer '1' + +typedef char TThostFtdcBankAcountOriginType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthBillTradeSumTypeһ㵥±ɽܷʽ +///////////////////////////////////////////////////////////////////////// +///ͬͬԼ +#define THOST_FTDC_MBTS_ByInstrument '0' +///ͬͬԼͬ۸ +#define THOST_FTDC_MBTS_ByDayInsPrc '1' +///ͬԼ +#define THOST_FTDC_MBTS_ByDayIns '2' + +typedef char TThostFtdcMonthBillTradeSumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTradeCodeEnumTypeһڽ״ö +///////////////////////////////////////////////////////////////////////// +///зתڻ +#define THOST_FTDC_FTC_BankLaunchBankToBroker '102001' +///ڻתڻ +#define THOST_FTDC_FTC_BrokerLaunchBankToBroker '202001' +///зڻת +#define THOST_FTDC_FTC_BankLaunchBrokerToBank '102002' +///ڻڻת +#define THOST_FTDC_FTC_BrokerLaunchBrokerToBank '202002' + +typedef char TThostFtdcFBTTradeCodeEnumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateIDTypeһģʹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRateTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimestampTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTimestampType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleNameTypeһŶι +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDRuleNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleExprTypeһŶιʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDRuleExprType[513]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastDriftTypeһϴOTPƯֵ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLastDriftType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastSuccessTypeһϴOTPɹֵ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLastSuccessType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthKeyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialNumberTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSerialNumberType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPTypeTypeһ̬ +///////////////////////////////////////////////////////////////////////// +///޶̬ +#define THOST_FTDC_OTP_NONE '0' +///ʱ +#define THOST_FTDC_OTP_TOTP '1' + +typedef char TThostFtdcOTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsIDTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOTPVendorsIDType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsNameTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOTPVendorsNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPStatusTypeһ̬״̬ +///////////////////////////////////////////////////////////////////////// +///δʹ +#define THOST_FTDC_OTPS_Unused '0' +///ʹ +#define THOST_FTDC_OTPS_Used '1' +///ע +#define THOST_FTDC_OTPS_Disuse '2' + +typedef char TThostFtdcOTPStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerUserTypeTypeһù˾û +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_BUT_Investor '1' +///Ա +#define THOST_FTDC_BUT_BrokerUser '2' + +typedef char TThostFtdcBrokerUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +///Ʒڻ +#define THOST_FTDC_FUTT_Commodity '1' +///ڻ +#define THOST_FTDC_FUTT_Financial '2' + +typedef char TThostFtdcFutureTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundEventTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ת޶ +#define THOST_FTDC_FET_Restriction '0' +///ת޶ +#define THOST_FTDC_FET_TodayRestriction '1' +///ˮ +#define THOST_FTDC_FET_Transfer '2' +///ʽ𶳽 +#define THOST_FTDC_FET_Credit '3' +///Ͷ߿ʽ +#define THOST_FTDC_FET_InvestorWithdrawAlm '4' +///ʻת޶ +#define THOST_FTDC_FET_BankRestriction '5' +///ǩԼ˻ +#define THOST_FTDC_FET_Accountregister '6' +/// +#define THOST_FTDC_FET_ExchangeFundIO '7' +///Ͷ߳ +#define THOST_FTDC_FET_InvestorFundIO '8' + +typedef char TThostFtdcFundEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountSourceTypeTypeһʽ˻Դ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_AST_FBTransfer '0' +///ֹ¼ +#define THOST_FTDC_AST_ManualEntry '1' + +typedef char TThostFtdcAccountSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCodeSourceTypeTypeһױԴ +///////////////////////////////////////////////////////////////////////// +///ͳһ(ѹ淶) +#define THOST_FTDC_CST_UnifyAccount '0' +///ֹ¼(δ淶) +#define THOST_FTDC_CST_ManualEntry '1' + +typedef char TThostFtdcCodeSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRangeTypeһԱΧ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_UR_All '0' +///һԱ +#define THOST_FTDC_UR_Single '1' + +typedef char TThostFtdcUserRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeSpanTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTimeSpanType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImportSequenceIDTypeһ̬Ƶα +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcImportSequenceIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByGroupTypeһͳƱͻͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ͷͳ +#define THOST_FTDC_BG_Investor '2' +///ͳ +#define THOST_FTDC_BG_Group '1' + +typedef char TThostFtdcByGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSumStatModeTypeһͳƱΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Լͳ +#define THOST_FTDC_TSSM_Instrument '1' +///Ʒͳ +#define THOST_FTDC_TSSM_Product '2' +///ͳ +#define THOST_FTDC_TSSM_Exchange '3' + +typedef char TThostFtdcTradeSumStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcComTypeTypeһϳɽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcComTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductIDTypeһƷʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductMemoTypeһƷ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductMemoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCCancelFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCCancelFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorNameTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCInvestorNameType[201]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOpenInvestorNameTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOpenInvestorNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorIDTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankFlagTypeһбʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCBankFlagType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCBankAccountType[23]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOpenNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOpenNameType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMemoTypeһ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMemoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTradeIDTypeһɽˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCExchangeInstIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMortgageNameTypeһѺƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMortgageNameType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCReasonTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCReasonType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsSettlementTypeһǷΪǽԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIsSettlementType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOptionsTypeTypeһȨ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOptionsTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCStrikePriceTypeһִм +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCStrikePriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTargetProductIDTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTargetProductIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTargetInstrIDTypeһĺԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTargetInstrIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommModelNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelMemoTypeһģ屸ע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommModelMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExprSetModeTypeһڱʽ +///////////////////////////////////////////////////////////////////////// +///й +#define THOST_FTDC_ESM_Relative '1' +/// +#define THOST_FTDC_ESM_Typical '2' + +typedef char TThostFtdcExprSetModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +///˾׼ +//sgit: +#define THOST_FTDC_RIR_All '1' +///ģ +#define THOST_FTDC_RIR_Model '2' +///һͶ +#define THOST_FTDC_RIR_Single '3' + +typedef char TThostFtdcRateInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentBrokerIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDRIdentityIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDRIdentityNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBLinkIDTypeһDBLinkʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBLinkIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncDataStatusTypeһϵͳͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define THOST_FTDC_SDS_Initialize '0' +///ͬ +#define THOST_FTDC_SDS_Settlementing '1' +///ͬ +#define THOST_FTDC_SDS_Settlemented '2' + +typedef char TThostFtdcSyncDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///Խͨر +#define THOST_FTDC_TSRC_NORMAL '0' +///Բѯ +#define THOST_FTDC_TSRC_QUERY '1' + +typedef char TThostFtdcTradeSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFlexStatModeTypeһƷԼͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ʒͳ +#define THOST_FTDC_FSM_Product '1' +///ͳ +#define THOST_FTDC_FSM_Exchange '2' +///ͳ +#define THOST_FTDC_FSM_All '3' + +typedef char TThostFtdcFlexStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByInvestorRangeTypeһͶ߷ΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///ͳ +#define THOST_FTDC_BIR_Property '1' +///ͳ +#define THOST_FTDC_BIR_All '2' + +typedef char TThostFtdcByInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNo12Typeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSequenceNo12Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PIR_All '1' +///Ͷ +#define THOST_FTDC_PIR_Property '2' +///һͶ +#define THOST_FTDC_PIR_Single '3' + +typedef char TThostFtdcPropertyInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FIS_NoCreate '0' +/// +#define THOST_FTDC_FIS_Created '1' +///ʧ +#define THOST_FTDC_FIS_Failed '2' + +typedef char TThostFtdcFileStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileGenStyleTypeһļɷʽ +///////////////////////////////////////////////////////////////////////// +///· +#define THOST_FTDC_FGS_FileTransmit '0' +/// +#define THOST_FTDC_FGS_FileGen '1' + +typedef char TThostFtdcFileGenStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperModeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SoM_Add '1' +///޸ +#define THOST_FTDC_SoM_Update '2' +///ɾ +#define THOST_FTDC_SoM_Delete '3' +/// +#define THOST_FTDC_SoM_Copy '4' +/// +#define THOST_FTDC_SoM_AcTive '5' +///ע +#define THOST_FTDC_SoM_CanCel '6' +/// +#define THOST_FTDC_SoM_ReSet '7' + +typedef char TThostFtdcSysOperModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperTypeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +///޸IJԱ +#define THOST_FTDC_SoT_UpdatePassword '0' +///Աܹ֯ϵ +#define THOST_FTDC_SoT_UserDepartment '1' +///ɫ +#define THOST_FTDC_SoT_RoleManager '2' +///ɫ +#define THOST_FTDC_SoT_RoleFunction '3' +/// +#define THOST_FTDC_SoT_BaseParam '4' +///òԱ +#define THOST_FTDC_SoT_SetUserID '5' +///ûɫ +#define THOST_FTDC_SoT_SetUserRole '6' +///ûIP +#define THOST_FTDC_SoT_UserIpRestriction '7' +///ܹ֯ +#define THOST_FTDC_SoT_DepartmentManager '8' +///ܹ֯ѯิ +#define THOST_FTDC_SoT_DepartmentCopy '9' +///ױ +#define THOST_FTDC_SoT_Tradingcode 'A' +///Ͷ״̬ά +#define THOST_FTDC_SoT_InvestorStatus 'B' +///ͶȨ޹ +#define THOST_FTDC_SoT_InvestorAuthority 'C' +/// +#define THOST_FTDC_SoT_PropertySet 'D' +///Ͷ +#define THOST_FTDC_SoT_ReSetInvestorPasswd 'E' +///Ͷ߸Ϣά +#define THOST_FTDC_SoT_InvestorPersonalityInfo 'F' + +typedef char TThostFtdcSysOperTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDataQueyTypeTypeһϱݲѯ +///////////////////////////////////////////////////////////////////////// +///ѯǰձ͵ +#define THOST_FTDC_CSRCQ_Current '0' +///ѯʷ͵Ĵ͹˾ +#define THOST_FTDC_CSRCQ_History '1' + +typedef char TThostFtdcCSRCDataQueyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_FRS_Normal '1' +/// +#define THOST_FTDC_FRS_Freeze '0' + +typedef char TThostFtdcFreezeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStandardStatusTypeһ淶״̬ +///////////////////////////////////////////////////////////////////////// +///ѹ淶 +#define THOST_FTDC_STST_Standard '0' +///δ淶 +#define THOST_FTDC_STST_NonStandard '1' + +typedef char TThostFtdcStandardStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCFreezeStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightParamTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///߻ +#define THOST_FTDC_RPT_Freeze '1' +///߻ +#define THOST_FTDC_RPT_FreezeActive '2' +///Ȩ +#define THOST_FTDC_RPT_OpenLimit '3'//sgit +///Ȩ +#define THOST_FTDC_RPT_RelieveOpenLimit '4' + +typedef char TThostFtdcRightParamTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateIDTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRightTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRightTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataStatusTypeһϴǮ˱״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMLDS_Normal '0' +///ɾ +#define THOST_FTDC_AMLDS_Deleted '1' + +typedef char TThostFtdcDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCheckStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_AMLCHS_Init '0' +/// +#define THOST_FTDC_AMLCHS_Checking '1' +///Ѹ +#define THOST_FTDC_AMLCHS_Checked '2' +///ܾϱ +#define THOST_FTDC_AMLCHS_RefuseReport '3' + +typedef char TThostFtdcAMLCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlDateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMLDT_DrawDay '0' +/// +#define THOST_FTDC_AMLDT_TouchDay '1' + +typedef char TThostFtdcAmlDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define THOST_FTDC_AMLCL_CheckLevel0 '0' +///һ +#define THOST_FTDC_AMLCL_CheckLevel1 '1' +/// +#define THOST_FTDC_AMLCL_CheckLevel2 '2' +/// +#define THOST_FTDC_AMLCL_CheckLevel3 '3' + +typedef char TThostFtdcAmlCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckFlowTypeһϴǮݳȡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAmlCheckFlowType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDataTypeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExportFileTypeTypeһļ +///////////////////////////////////////////////////////////////////////// +///CSV +#define THOST_FTDC_EFT_CSV '0' +///Excel +#define THOST_FTDC_EFT_EXCEL '1' +///DBF +#define THOST_FTDC_EFT_DBF '2' + +typedef char TThostFtdcExportFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ׼ +#define THOST_FTDC_SMT_Before '1' +/// +#define THOST_FTDC_SMT_Settlement '2' +///˶ +#define THOST_FTDC_SMT_After '3' +/// +#define THOST_FTDC_SMT_Settlemented '4' + +typedef char TThostFtdcSettleManagerTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerIDTypeһô +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettleManagerIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettleManagerNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerLevelTypeһõȼ +///////////////////////////////////////////////////////////////////////// +///Ҫ +#define THOST_FTDC_SML_Must '1' +/// +#define THOST_FTDC_SML_Alarm '2' +///ʾ +#define THOST_FTDC_SML_Prompt '3' +/// +#define THOST_FTDC_SML_Ignore '4' + +typedef char TThostFtdcSettleManagerLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerGroupTypeһģ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_SMG_Exhcange '1' +///ڲ˶ +#define THOST_FTDC_SMG_ASP '2' +///ϱݺ˶ +#define THOST_FTDC_SMG_CSRC '3' + +typedef char TThostFtdcSettleManagerGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckResultMemoTypeһ˶Խ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCheckResultMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionUrlTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionUrlType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthInfoTypeһͻ֤Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthCodeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLimitUseTypeTypeһֵʹ +///////////////////////////////////////////////////////////////////////// +///ظʹ +#define THOST_FTDC_LUT_Repeatable '1' +///ظʹ +#define THOST_FTDC_LUT_Unrepeatable '2' + +typedef char TThostFtdcLimitUseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataResourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define THOST_FTDC_DAR_Settle '1' +/// +#define THOST_FTDC_DAR_Exchange '2' +/// +#define THOST_FTDC_DAR_CSRC '3' + +typedef char TThostFtdcDataResourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_MGT_ExchMarginRate '0' +///Ͷ֤߱ +#define THOST_FTDC_MGT_InstrMarginRate '1' +///Ͷ߽ױ֤ +#define THOST_FTDC_MGT_InstrMarginRateTrade '2' + +typedef char TThostFtdcMarginTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActiveTypeTypeһЧ +///////////////////////////////////////////////////////////////////////// +///Ч +#define THOST_FTDC_ACT_Intraday '1' +///Ч +#define THOST_FTDC_ACT_Long '2' + +typedef char TThostFtdcActiveTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginRateTypeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_MRT_Exchange '1' +///Ͷ֤߱ +#define THOST_FTDC_MRT_Investor '2' +///Ͷ߽ױ֤ +#define THOST_FTDC_MRT_InvestorTrade '3' + +typedef char TThostFtdcMarginRateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBackUpStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δɱ +#define THOST_FTDC_BUS_UnBak '0' +/// +#define THOST_FTDC_BUS_BakUp '1' +///ɱ +#define THOST_FTDC_BUS_BakUped '2' +///ʧ +#define THOST_FTDC_BUS_BakFail '3' + +typedef char TThostFtdcBackUpStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInitSettlementTypeһʼ״̬ +///////////////////////////////////////////////////////////////////////// +///ʼδʼ +#define THOST_FTDC_SIS_UnInitialize '0' +///ʼ +#define THOST_FTDC_SIS_Initialize '1' +///ʼ +#define THOST_FTDC_SIS_Initialized '2' + +typedef char TThostFtdcInitSettlementType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δɱ +#define THOST_FTDC_SRS_NoCreate '0' +/// +#define THOST_FTDC_SRS_Create '1' +///ɱ +#define THOST_FTDC_SRS_Created '2' +///ɱʧ +#define THOST_FTDC_SRS_CreateFail '3' + +typedef char TThostFtdcReportStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSaveStatusTypeһݹ鵵״̬ +///////////////////////////////////////////////////////////////////////// +///鵵δ +#define THOST_FTDC_SSS_UnSaveData '0' +///鵵 +#define THOST_FTDC_SSS_SaveDatad '1' + +typedef char TThostFtdcSaveStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettArchiveStatusTypeһȷݹ鵵״̬ +///////////////////////////////////////////////////////////////////////// +///δ鵵 +#define THOST_FTDC_SAS_UnArchived '0' +///ݹ鵵 +#define THOST_FTDC_SAS_Archiving '1' +///ѹ鵵 +#define THOST_FTDC_SAS_Archived '2' +///鵵ʧ +#define THOST_FTDC_SAS_ArchiveFail '3' + +typedef char TThostFtdcSettArchiveStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCTPTypeTypeһCTPϵͳ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_CTPT_Unkown '0' +/// +#define THOST_FTDC_CTPT_MainCenter '1' +/// +#define THOST_FTDC_CTPT_BackUp '2' + +typedef char TThostFtdcCTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcToolIDTypeһߴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcToolIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcToolNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcToolNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseDealTypeTypeһƽִ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CDT_Normal '0' +///Ͷƽ +#define THOST_FTDC_CDT_SpecFirst '1' + +typedef char TThostFtdcCloseDealTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMortgageFundUseRangeTypeһѺʽ÷Χ +///////////////////////////////////////////////////////////////////////// +///ʹ +#define THOST_FTDC_MFUR_None '0' +///ڱ֤ +#define THOST_FTDC_MFUR_Margin '1' +///ѡӯ֤ +#define THOST_FTDC_MFUR_All '2' + +typedef char TThostFtdcMortgageFundUseRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyUnitTypeһֵλ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCurrencyUnitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeRateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcExchangeRateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSpecProductTypeTypeһƷ +///////////////////////////////////////////////////////////////////////// +///֣ױƷ +#define THOST_FTDC_SPT_CzceHedge '1' +///ѺƷ +#define THOST_FTDC_SPT_IneForeignCurrency '2' +///߿ƽֲƷ +#define THOST_FTDC_SPT_DceOpenClose '3' + +typedef char TThostFtdcSpecProductTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortgageTypeTypeһѺ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_FMT_Mortgage '1' +/// +#define THOST_FTDC_FMT_Redemption '2' + +typedef char TThostFtdcFundMortgageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountSettlementParamIDTypeһͶ˻ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_ASPI_BaseMargin '1' +///Ȩ׼ +#define THOST_FTDC_ASPI_LowestInterest '2' + +typedef char TThostFtdcAccountSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyNameType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySignTypeһַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencySignType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortDirectionTypeһѺ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FMD_In '1' +///ʳ +#define THOST_FTDC_FMD_Out '2' + +typedef char TThostFtdcFundMortDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessClassTypeһ +///////////////////////////////////////////////////////////////////////// +///ӯ +#define THOST_FTDC_BT_Profit '0' +/// +#define THOST_FTDC_BT_Loss '1' +/// +#define THOST_FTDC_BT_Other 'Z' + +typedef char TThostFtdcBusinessClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSwapSourceTypeTypeһԴ +///////////////////////////////////////////////////////////////////////// +///ֹ +#define THOST_FTDC_SST_Manual '0' +///Զ +#define THOST_FTDC_SST_Automatic '1' + +typedef char TThostFtdcSwapSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrExDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CED_Settlement '0' +///ۻ +#define THOST_FTDC_CED_Sale '1' + +typedef char TThostFtdcCurrExDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySwapStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_CSS_Entry '1' +/// +#define THOST_FTDC_CSS_Approve '2' +///Ѿܾ +#define THOST_FTDC_CSS_Refuse '3' +///ѳ +#define THOST_FTDC_CSS_Revoke '4' +///ѷ +#define THOST_FTDC_CSS_Send '5' +///ɹ +#define THOST_FTDC_CSS_Success '6' +///ʧ +#define THOST_FTDC_CSS_Failure '7' + +typedef char TThostFtdcCurrencySwapStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrExchCertNoTypeһƾ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrExchCertNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBatchSerialNoTypeһκ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBatchSerialNoType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReqFlagTypeһ㷢ͱ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_REQF_NoSend '0' +///ͳɹ +#define THOST_FTDC_REQF_SendSuccess '1' +///ʧ +#define THOST_FTDC_REQF_SendFailed '2' +///ȴط +#define THOST_FTDC_REQF_WaitReSend '3' + +typedef char TThostFtdcReqFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcResFlagTypeһ㷵سɹ־ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_RESF_Success '0' +///˻ +#define THOST_FTDC_RESF_InsuffiCient '1' +///׽δ֪ +#define THOST_FTDC_RESF_UnKnown '8' + +typedef char TThostFtdcResFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPageControlTypeһҳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPageControlType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordCountTypeһ¼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRecordCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySwapMemoTypeһȷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencySwapMemoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExStatusTypeһ޸״̬ +///////////////////////////////////////////////////////////////////////// +///޸ǰ +#define THOST_FTDC_EXS_Before '0' +///޸ĺ +#define THOST_FTDC_EXS_After '1' + +typedef char TThostFtdcExStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientRegionTypeһͻ +///////////////////////////////////////////////////////////////////////// +///ڿͻ +#define THOST_FTDC_CR_Domestic '1' +///۰̨ͻ +#define THOST_FTDC_CR_GMT '2' +///ͻ +#define THOST_FTDC_CR_Foreign '3' + +typedef char TThostFtdcClientRegionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWorkPlaceTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWorkPlaceType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessPeriodTypeһӪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessPeriodType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWebSiteTypeһַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWebSiteType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAIdCardTypeTypeһͳһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAIdCardTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientModeTypeһģʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientModeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorFullNameTypeһͶȫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorFullNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOABrokerIDTypeһнID +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOABrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAZipCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAZipCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAEMailTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAEMailType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOldCityTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOldCityType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorporateIdentifiedCardNoTypeһ˴֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCorporateIdentifiedCardNoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHasBoardTypeһǷж» +///////////////////////////////////////////////////////////////////////// +///û +#define THOST_FTDC_HB_No '0' +/// +#define THOST_FTDC_HB_Yes '1' + +typedef char TThostFtdcHasBoardType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStartModeTypeһģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SM_Normal '1' +///Ӧ +#define THOST_FTDC_SM_Emerge '2' +///ָ +#define THOST_FTDC_SM_Restore '3' + +typedef char TThostFtdcStartModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTemplateTypeTypeһģ +///////////////////////////////////////////////////////////////////////// +///ȫ +#define THOST_FTDC_TPT_Full '1' +/// +#define THOST_FTDC_TPT_Increment '2' +/// +#define THOST_FTDC_TPT_BackUp '3' + +typedef char TThostFtdcTemplateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLoginModeTypeһ¼ģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LM_Trade '0' +///ת +#define THOST_FTDC_LM_Transfer '1' + +typedef char TThostFtdcLoginModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPromptTypeTypeһʾ +///////////////////////////////////////////////////////////////////////// +///Լ +#define THOST_FTDC_CPT_Instrument '1' +///ֶ֤Ч +#define THOST_FTDC_CPT_Margin '2' + +typedef char TThostFtdcPromptTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLedgerManageIDTypeһֻʲ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLedgerManageIDType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestVarietyTypeһͶƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestVarietyType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLedgerManageBankTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLedgerManageBankType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffexDepartmentNameTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffexDepartmentNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffexDepartmentCodeTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffexDepartmentCodeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHasTrusteeTypeһǷй +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HT_Yes '1' +///û +#define THOST_FTDC_HT_No '0' + +typedef char TThostFtdcHasTrusteeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMemo1Typeһ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMemo1Type[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrCFullNameTypeһʲҵڻ˾ȫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrCFullNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrApprovalNOTypeһʲҵĺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrApprovalNOType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrMgrNameTypeһʲҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrMgrNameType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMT_Bank '1' +///֤ȯ˾ +#define THOST_FTDC_AMT_Securities '2' +///˾ +#define THOST_FTDC_AMT_Fund '3' +///չ˾ +#define THOST_FTDC_AMT_Insurance '4' +///й˾ +#define THOST_FTDC_AMT_Trust '5' +/// +#define THOST_FTDC_AMT_Other '9' + +typedef char TThostFtdcAmTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCAmTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCAmTypeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CFIOT_FundIO '0' +///ڻ +#define THOST_FTDC_CFIOT_SwapCurrency '1' + +typedef char TThostFtdcCSRCFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCusAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +///ڻ˻ +#define THOST_FTDC_CAT_Futures '1' +///ڻʹҵµʹܽ˻ +#define THOST_FTDC_CAT_AssetmgrFuture '2' +///ۺʹҵµڻʹй˻ +#define THOST_FTDC_CAT_AssetmgrTrustee '3' +///ۺʹҵµʽת˻ +#define THOST_FTDC_CAT_AssetmgrTransfer '4' + +typedef char TThostFtdcCusAccountTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCNationalTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCNationalType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCSecAgentIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCSecAgentIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLanguageTypeTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LT_Chinese '1' +///Ӣ +#define THOST_FTDC_LT_English '2' + +typedef char TThostFtdcLanguageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmAccountTypeһͶ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAmAccountType[23]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrClientTypeTypeһʲͻ +///////////////////////////////////////////////////////////////////////// +///ʹܿͻ +#define THOST_FTDC_AMCT_Person '1' +///λʹܿͻ +#define THOST_FTDC_AMCT_Organ '2' +///ⵥλʹܿͻ +#define THOST_FTDC_AMCT_SpecialOrgan '4' + +typedef char TThostFtdcAssetmgrClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_ASST_Futures '3' +///ۺ +#define THOST_FTDC_ASST_SpecialOrgan '4' + +typedef char TThostFtdcAssetmgrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOMTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOMType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSHFEInstLifePhaseType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSHFEProductClassType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceDecimalTypeһ۸Сλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPriceDecimalType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInTheMoneyFlagTypeһƽֵȨ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInTheMoneyFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckInstrTypeTypeһԼȽ +///////////////////////////////////////////////////////////////////////// +///Լ +#define THOST_FTDC_CIT_HasExch '0' +///Լϵͳ +#define THOST_FTDC_CIT_HasATP '1' +///ԼȽϲһ +#define THOST_FTDC_CIT_HasDiff '2' + +typedef char TThostFtdcCheckInstrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeliveryTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ֹ +#define THOST_FTDC_DT_HandDeliv '1' +///ڽ +#define THOST_FTDC_DT_PersonDeliv '2' + +typedef char TThostFtdcDeliveryTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBigMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcBigMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMaxMarginSideAlgorithmTypeһ֤߱㷨 +///////////////////////////////////////////////////////////////////////// +///ʹô֤߱㷨 +#define THOST_FTDC_MMSA_NO '0' +///ʹô֤߱㷨 +#define THOST_FTDC_MMSA_YES '1' + +typedef char TThostFtdcMaxMarginSideAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDAClientTypeTypeһʲͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CACT_Person '0' +/// +#define THOST_FTDC_CACT_Company '1' +/// +#define THOST_FTDC_CACT_Other '2' + +typedef char TThostFtdcDAClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinInstrIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombinInstrIDType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinSettlePriceTypeһȽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombinSettlePriceType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDCEPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDCEPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeGroupIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradeGroupIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsCheckPrepaTypeһǷУ鿪ʽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcIsCheckPrepaType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAAssetmgrTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_UOAAT_Futures '1' +///ۺ +#define THOST_FTDC_UOAAT_SpecialOrgan '2' + +typedef char TThostFtdcUOAAssetmgrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Buy +#define THOST_FTDC_DEN_Buy '0' +///Sell +#define THOST_FTDC_DEN_Sell '1' + +typedef char TThostFtdcDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagEnTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +///Position Opening +#define THOST_FTDC_OFEN_Open '0' +///Position Close +#define THOST_FTDC_OFEN_Close '1' +///Forced Liquidation +#define THOST_FTDC_OFEN_ForceClose '2' +///Close Today +#define THOST_FTDC_OFEN_CloseToday '3' +///Close Prev. +#define THOST_FTDC_OFEN_CloseYesterday '4' +///Forced Reduction +#define THOST_FTDC_OFEN_ForceOff '5' +///Local Forced Liquidation +#define THOST_FTDC_OFEN_LocalForceClose '6' + +typedef char TThostFtdcOffsetFlagEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagEnTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Speculation +#define THOST_FTDC_HFEN_Speculation '1' +///Arbitrage +#define THOST_FTDC_HFEN_Arbitrage '2' +///Hedge +#define THOST_FTDC_HFEN_Hedge '3' + +typedef char TThostFtdcHedgeFlagEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Deposit/Withdrawal +#define THOST_FTDC_FIOTEN_FundIO '1' +///Bank-Futures Transfer +#define THOST_FTDC_FIOTEN_Transfer '2' +///Bank-Futures FX Exchange +#define THOST_FTDC_FIOTEN_SwapCurrency '3' + +typedef char TThostFtdcFundIOTypeEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeEnTypeһʽ +///////////////////////////////////////////////////////////////////////// +///Bank Deposit +#define THOST_FTDC_FTEN_Deposite '1' +///Payment/Fee +#define THOST_FTDC_FTEN_ItemFund '2' +///Brokerage Adj +#define THOST_FTDC_FTEN_Company '3' +///Internal Transfer +#define THOST_FTDC_FTEN_InnerTransfer '4' + +typedef char TThostFtdcFundTypeEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Deposit +#define THOST_FTDC_FDEN_In '1' +///Withdrawal +#define THOST_FTDC_FDEN_Out '2' + +typedef char TThostFtdcFundDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortDirectionEnTypeһѺ +///////////////////////////////////////////////////////////////////////// +///Pledge +#define THOST_FTDC_FMDEN_In '1' +///Redemption +#define THOST_FTDC_FMDEN_Out '2' + +typedef char TThostFtdcFundMortDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSwapBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSwapBusinessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionsTypeTypeһȨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CP_CallOptions '1' +/// +#define THOST_FTDC_CP_PutOptions '2' + +typedef char TThostFtdcOptionsTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeModeTypeһִзʽ +///////////////////////////////////////////////////////////////////////// +///ŷʽ +#define THOST_FTDC_STM_Continental '0' +///ʽ +#define THOST_FTDC_STM_American '1' +///Ľ +#define THOST_FTDC_STM_Bermuda '2' + +typedef char TThostFtdcStrikeModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeTypeTypeһִ +///////////////////////////////////////////////////////////////////////// +///Գ +#define THOST_FTDC_STT_Hedge '0' +///ƥִ +#define THOST_FTDC_STT_Match '1' + +typedef char TThostFtdcStrikeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyTypeTypeһнȨִ +///////////////////////////////////////////////////////////////////////// +///ִ +#define THOST_FTDC_APPT_NotStrikeNum '4' + +typedef char TThostFtdcApplyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGiveUpDataSourceTypeһִԴ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define THOST_FTDC_GUDS_Gen '0' +///ֹ +#define THOST_FTDC_GUDS_Hand '1' + +typedef char TThostFtdcGiveUpDataSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderSysIDTypeһִϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExecOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecResultTypeһִн +///////////////////////////////////////////////////////////////////////// +///ûִ +#define THOST_FTDC_OER_NoExec 'n' +///Ѿȡ +#define THOST_FTDC_OER_Canceled 'c' +///ִгɹ +#define THOST_FTDC_OER_OK '0' +///Ȩֲֲ +#define THOST_FTDC_OER_NoPosition '1' +///ʽ𲻹 +#define THOST_FTDC_OER_NoDeposit '2' +///Ա +#define THOST_FTDC_OER_NoParticipant '3' +///ͻ +#define THOST_FTDC_OER_NoClient '4' +///Լ +#define THOST_FTDC_OER_NoInstrument '6' +///ûִȨ +#define THOST_FTDC_OER_NoRight '7' +/// +#define THOST_FTDC_OER_InvalidVolume '8' +///û㹻ʷɽ +#define THOST_FTDC_OER_NoEnoughHistoryTrade '9' +///δ֪ +#define THOST_FTDC_OER_Unknown 'a' + +typedef char TThostFtdcExecResultType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeSequenceTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcStrikeSequenceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeTimeTypeһִʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcStrikeTimeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinationTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_COMBT_Future '0' +///ֱ۲BUL +#define THOST_FTDC_COMBT_BUL '1' +///ֱ۲BER +#define THOST_FTDC_COMBT_BER '2' +///ʽ +#define THOST_FTDC_COMBT_STD '3' +///ʽ +#define THOST_FTDC_COMBT_STG '4' +/// +#define THOST_FTDC_COMBT_PRT '5' +///ʱ۲ +#define THOST_FTDC_COMBT_CLD '6' + +typedef char TThostFtdcCombinationTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionRoyaltyPriceTypeTypeһȨȨ۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ORPT_PreSettlementPrice '1' +///ּ +#define THOST_FTDC_ORPT_OpenPrice '4' + +typedef char TThostFtdcOptionRoyaltyPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBalanceAlgorithmTypeһȨ㷨 +///////////////////////////////////////////////////////////////////////// +///Ȩֵӯ +#define THOST_FTDC_BLAG_Default '1' +///Ȩֵ +#define THOST_FTDC_BLAG_IncludeOptValLost '2' + +typedef char TThostFtdcBalanceAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionTypeTypeһִ +///////////////////////////////////////////////////////////////////////// +///ִ +#define THOST_FTDC_ACTP_Exec '1' +/// +#define THOST_FTDC_ACTP_Abandon '2' + +typedef char TThostFtdcActionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForQuoteStatusTypeһѯ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_FQST_Submitted 'a' +///Ѿ +#define THOST_FTDC_FQST_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_FQST_Rejected 'c' + +typedef char TThostFtdcForQuoteStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcValueMethodTypeһȡֵʽ +///////////////////////////////////////////////////////////////////////// +///ֵ +#define THOST_FTDC_VM_Absolute '0' +/// +#define THOST_FTDC_VM_Ratio '1' + +typedef char TThostFtdcValueMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderPositionFlagTypeһȨȨǷڻͷı +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EOPF_Reserve '0' +/// +#define THOST_FTDC_EOPF_UnReserve '1' + +typedef char TThostFtdcExecOrderPositionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderCloseFlagTypeһȨȨɵͷǷԶƽ +///////////////////////////////////////////////////////////////////////// +///Զƽ +#define THOST_FTDC_EOCF_AutoClose '0' +///Զƽ +#define THOST_FTDC_EOCF_NotToClose '1' + +typedef char TThostFtdcExecOrderCloseFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductTypeTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_PTE_Futures '1' +///Ȩ +#define THOST_FTDC_PTE_Options '2' + +typedef char TThostFtdcProductTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCZCEUploadFileNameTypeһ֣ļ +///////////////////////////////////////////////////////////////////////// +///^\d{8}_zz_\d{4} +#define THOST_FTDC_CUFN_CUFN_O 'O' +///^\d{8}ɽ +#define THOST_FTDC_CUFN_CUFN_T 'T' +///^\d{8}ȳֱֲnew +#define THOST_FTDC_CUFN_CUFN_P 'P' +///^\d{8}ƽ˽ +#define THOST_FTDC_CUFN_CUFN_N 'N' +///^\d{8}ƽֱ +#define THOST_FTDC_CUFN_CUFN_L 'L' +///^\d{8}ʽ +#define THOST_FTDC_CUFN_CUFN_F 'F' +///^\d{8}ϳֱֲ +#define THOST_FTDC_CUFN_CUFN_C 'C' +///^\d{8}֤ +#define THOST_FTDC_CUFN_CUFN_M 'M' + +typedef char TThostFtdcCZCEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDCEUploadFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +///^\d{8}_dl_\d{3} +#define THOST_FTDC_DUFN_DUFN_O 'O' +///^\d{8}_ɽ +#define THOST_FTDC_DUFN_DUFN_T 'T' +///^\d{8}_ֱֲ +#define THOST_FTDC_DUFN_DUFN_P 'P' +///^\d{8}_ʽ +#define THOST_FTDC_DUFN_DUFN_F 'F' +///^\d{8}_Żϳֲϸ +#define THOST_FTDC_DUFN_DUFN_C 'C' +///^\d{8}_ֲϸ +#define THOST_FTDC_DUFN_DUFN_D 'D' +///^\d{8}_֤ +#define THOST_FTDC_DUFN_DUFN_M 'M' +///^\d{8}_Ȩִб +#define THOST_FTDC_DUFN_DUFN_S 'S' + +typedef char TThostFtdcDCEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEUploadFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +///^\d{4}_\d{8}_\d{8}_DailyFundChg +#define THOST_FTDC_SUFN_SUFN_O 'O' +///^\d{4}_\d{8}_\d{8}_Trade +#define THOST_FTDC_SUFN_SUFN_T 'T' +///^\d{4}_\d{8}_\d{8}_SettlementDetail +#define THOST_FTDC_SUFN_SUFN_P 'P' +///^\d{4}_\d{8}_\d{8}_Capital +#define THOST_FTDC_SUFN_SUFN_F 'F' + +typedef char TThostFtdcSHFEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFFEXUploadFileNameTypeһнļ +///////////////////////////////////////////////////////////////////////// +///^\d{4}_SG\d{1}_\d{8}_\d{1}_Trade +#define THOST_FTDC_CFUFN_SUFN_T 'T' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_SettlementDetail +#define THOST_FTDC_CFUFN_SUFN_P 'P' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_Capital +#define THOST_FTDC_CFUFN_SUFN_F 'F' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_OptionExec +#define THOST_FTDC_CFUFN_SUFN_S 'S' + +typedef char TThostFtdcCFFEXUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombDirectionTypeһָ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CMDR_Comb '0' +/// +#define THOST_FTDC_CMDR_UnComb '1' + +typedef char TThostFtdcCombDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTBankIDTypeһбʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBTBankIDType[2]; + +/// +}; +#endif diff --git a/include/Sgit/SgitFtdcUserApiStruct.h b/include/Sgit/SgitFtdcUserApiStruct.h new file mode 100644 index 0000000..058f8ab --- /dev/null +++ b/include/Sgit/SgitFtdcUserApiStruct.h @@ -0,0 +1,7837 @@ + ///////////////////////////////////////////////////////////////////////// +///@system +///@company +///@file SgitFtdcUserApiStruct.h +///@brief ˿ͻ˽ӿʹõҵݽṹ +///@history +///20150810 +///////////////////////////////////////////////////////////////////////// + +#if !defined(SGIT_FTDCSTRUCT_H) +#define SGIT_FTDCSTRUCT_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "SgitFtdcUserApiDataType.h" +// +namespace fstech{ +/// +///Ϣַ +struct CThostFtdcDisseminationField +{ + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///к + TThostFtdcSequenceNoType SequenceNo; +}; + +///û¼ +struct CThostFtdcReqUserLoginField +{ + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///նIPַ + TThostFtdcIPAddressType ClientIPAddress; +}; + +///û¼Ӧ +struct CThostFtdcRspUserLoginField +{ + /// + TThostFtdcDateType TradingDay; + ///¼ɹʱ + TThostFtdcTimeType LoginTime; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Դʱ + TThostFtdcTimeType INETime; +}; + +///ûdz +struct CThostFtdcUserLogoutField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ǿƽԱ˳ +struct CThostFtdcForceUserLogoutField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ͻ֤ +struct CThostFtdcReqAuthenticateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤ + TThostFtdcAuthCodeType AuthCode; +}; + +///ͻ֤Ӧ +struct CThostFtdcRspAuthenticateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; +}; + +///ͻ֤Ϣ +struct CThostFtdcAuthenticationInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤Ϣ + TThostFtdcAuthInfoType AuthInfo; + ///ǷΪ֤ + TThostFtdcBoolType IsResult; +}; + +///תʱͷ +struct CThostFtdcTransferHeaderField +{ + ///汾ţ1.0 + TThostFtdcVersionType Version; + ///״룬 + TThostFtdcTradeCodeType TradeCode; + ///ڣʽyyyymmdd + TThostFtdcTradeDateType TradeDate; + ///ʱ䣬ʽhhmmss + TThostFtdcTradeTimeType TradeTime; + ///ˮţN/A + TThostFtdcTradeSerialType TradeSerial; + ///ڻ˾룬 + TThostFtdcFutureIDType FutureID; + ///д룬ݲѯеõ + TThostFtdcBankIDType BankID; + ///зĴ룬ݲѯеõ + TThostFtdcBankBrchIDType BankBrchID; + ///ԱN/A + TThostFtdcOperNoType OperNo; + ///豸ͣN/A + TThostFtdcDeviceIDType DeviceID; + ///¼N/A + TThostFtdcRecordNumType RecordNum; + ///ỰţN/A + TThostFtdcSessionIDType SessionID; + ///ţN/A + TThostFtdcRequestIDType RequestID; +}; + +///ʽתڻTradeCode=202001 +struct CThostFtdcTransferBankToFutureReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ʽתڻӦ +struct CThostFtdcTransferBankToFutureRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ڻʽתTradeCode=202002 +struct CThostFtdcTransferFutureToBankReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ڻʽתӦ +struct CThostFtdcTransferFutureToBankRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯʽTradeCode=204002 +struct CThostFtdcTransferQryBankReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯʽӦ +struct CThostFtdcTransferQryBankRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + /// + TThostFtdcMoneyType TradeAmt; + ///п + TThostFtdcMoneyType UseAmt; + ///пȡ + TThostFtdcMoneyType FetchAmt; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯнϸTradeCode=204999 +struct CThostFtdcTransferQryDetailReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; +}; + +///ѯнϸӦ +struct CThostFtdcTransferQryDetailRspField +{ + /// + TThostFtdcDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///ڻˮ + TThostFtdcTradeSerialNoType FutureSerial; + ///ڻ˾ + TThostFtdcFutureIDType FutureID; + ///ʽʺ + TThostFtdcFutureAccountType FutureAccount; + ///ˮ + TThostFtdcTradeSerialNoType BankSerial; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + ///˺ + TThostFtdcBankAccountType BankAccount; + ///֤ + TThostFtdcCertCodeType CertCode; + ///Ҵ + TThostFtdcCurrencyCodeType CurrencyCode; + /// + TThostFtdcMoneyType TxAmount; + ///Ч־ + TThostFtdcTransferValidFlagType Flag; +}; + +///ӦϢ +struct CThostFtdcRspInfoField +{ + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CThostFtdcExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcExchangeNameType ExchangeName; + /// + TThostFtdcExchangePropertyType ExchangeProperty; +}; + +///Ʒ +struct CThostFtdcProductField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductNameType ProductName; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceType PriceTick; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///ֲ + TThostFtdcPositionTypeType PositionType; + ///ֲ + TThostFtdcPositionDateTypeType PositionDateType; + ///ƽִ + TThostFtdcCloseDealTypeType CloseDealType; + ///ױ + TThostFtdcCurrencyIDType TradeCurrencyID; + ///Ѻʽ÷Χ + TThostFtdcMortgageFundUseRangeType MortgageFundUseRange; + ///Ʒ + TThostFtdcInstrumentIDType ExchangeProductID; + ///ԼƷ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; +}; + +///Լ +struct CThostFtdcInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentNameType InstrumentName; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcYearType DeliveryYear; + /// + TThostFtdcMonthType DeliveryMonth; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceType PriceTick; + /// + TThostFtdcDateType CreateDate; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcDateType ExpireDate; + ///ʼ + TThostFtdcDateType StartDelivDate; + /// + TThostFtdcDateType EndDelivDate; + ///Լ״̬ + TThostFtdcInstLifePhaseType InstLifePhase; + ///ǰǷ + TThostFtdcBoolType IsTrading; + ///ֲ + TThostFtdcPositionTypeType PositionType; + ///ֲ + TThostFtdcPositionDateTypeType PositionDateType; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatio; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatio; + ///Ƿʹô֤߱㷨 + TThostFtdcMaxMarginSideAlgorithmType MaxMarginSideAlgorithm; + ///Ʒ + TThostFtdcInstrumentIDType UnderlyingInstrID; + ///ִм + TThostFtdcPriceType StrikePrice; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + ///ԼƷ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; + /// + TThostFtdcCombinationTypeType CombinationType; +}; + +///͹˾ +struct CThostFtdcBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ + TThostFtdcBrokerAbbrType BrokerAbbr; + ///͹˾ + TThostFtdcBrokerNameType BrokerName; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///Ա +struct CThostFtdcTraderField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallCountType InstallCount; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///Ͷ +struct CThostFtdcInvestorField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcDateType OpenDate; + ///ֻ + TThostFtdcMobileType Mobile; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ױ +struct CThostFtdcTradingCodeField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; +}; + +///Ա;͹˾ձ +struct CThostFtdcPartBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///û +struct CThostFtdcSuperUserField +{ + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + /// + TThostFtdcPasswordType Password; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///ûȨ +struct CThostFtdcSuperUserFunctionField +{ + ///û + TThostFtdcUserIDType UserID; + ///ܴ + TThostFtdcFunctionCodeType FunctionCode; +}; + +///Ͷ +struct CThostFtdcInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TThostFtdcInvestorGroupNameType InvestorGroupName; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ϴѺ + TThostFtdcMoneyType PreMortgage; + ///ϴö + TThostFtdcMoneyType PreCredit; + ///ϴδ + TThostFtdcMoneyType PreDeposit; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///Ϣ + TThostFtdcMoneyType InterestBase; + ///Ϣ + TThostFtdcMoneyType Interest; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + ///ʽ + TThostFtdcMoneyType Available; + ///ȡʽ + TThostFtdcMoneyType WithdrawQuota; + ///׼ + TThostFtdcMoneyType Reserve; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ö + TThostFtdcMoneyType Credit; + ///Ѻ + TThostFtdcMoneyType Mortgage; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TThostFtdcMoneyType DeliveryMargin; + ///֤ + TThostFtdcMoneyType ExchangeDeliveryMargin; + ///ڻ׼ + TThostFtdcMoneyType ReserveBalance; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ϴλ + TThostFtdcMoneyType PreFundMortgageIn; + ///ϴλʳ + TThostFtdcMoneyType PreFundMortgageOut; + /// + TThostFtdcMoneyType FundMortgageIn; + ///ʳ + TThostFtdcMoneyType FundMortgageOut; + ///Ѻ + TThostFtdcMoneyType FundMortgageAvailable; + ///Ѻҽ + TThostFtdcMoneyType MortgageableFund; + ///Ʒռñ֤ + TThostFtdcMoneyType SpecProductMargin; + ///Ʒᱣ֤ + TThostFtdcMoneyType SpecProductFrozenMargin; + ///Ʒ + TThostFtdcMoneyType SpecProductCommission; + ///Ʒ + TThostFtdcMoneyType SpecProductFrozenCommission; + ///Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfit; + ///Ʒƽӯ + TThostFtdcMoneyType SpecProductCloseProfit; + ///ݳֲӯ㷨Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfitByAlg; + ///Ʒ֤ + TThostFtdcMoneyType SpecProductExchangeMargin; +}; + +///Ͷֲ߳ +struct CThostFtdcInvestorPositionField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcPositionDateType PositionDate; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ճֲ + TThostFtdcVolumeType Position; + ///ͷ + TThostFtdcVolumeType LongFrozen; + ///ͷ + TThostFtdcVolumeType ShortFrozen; + ///ֶ + TThostFtdcMoneyType LongFrozenAmount; + ///ֶ + TThostFtdcMoneyType ShortFrozenAmount; + /// + TThostFtdcVolumeType OpenVolume; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ֽ + TThostFtdcMoneyType OpenAmount; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ֲֳɱ + TThostFtdcMoneyType PositionCost; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ֳɱ + TThostFtdcMoneyType OpenCost; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TThostFtdcVolumeType CombPosition; + ///϶ͷ + TThostFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TThostFtdcVolumeType CombShortFrozen; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TThostFtdcVolumeType TodayPosition; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ִж//sgit + TThostFtdcVolumeType StrikeFrozen; + ///ִж + TThostFtdcMoneyType StrikeFrozenAmount; + ///ִж + TThostFtdcVolumeType AbandonFrozen; +}; + +///Լ֤ +struct CThostFtdcInstrumentMarginRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///Լ +struct CThostFtdcInstrumentCommissionRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; +}; + +/// +struct CThostFtdcDepthMarketDataField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; + ///վ + TThostFtdcPriceType AveragePrice; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +///ͶߺԼȨ +struct CThostFtdcInstrumentTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ȩ + TThostFtdcTradingRightType TradingRight; +}; + +///͹˾û +struct CThostFtdcBrokerUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + ///û + TThostFtdcUserTypeType UserType; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///Ƿʹ + TThostFtdcBoolType IsUsingOTP; +}; + +///͹˾û +struct CThostFtdcBrokerUserPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; +}; + +///͹˾ûȨ +struct CThostFtdcBrokerUserFunctionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///͹˾ܴ + TThostFtdcBrokerFunctionCodeType BrokerFunctionCode; +}; + +///Ա̻ +struct CThostFtdcTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ϯλɽ + TThostFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TThostFtdcReturnCodeType MaxOrderMessageReference; +}; + +///Ͷ߽ +struct CThostFtdcSettlementInfoField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType Content; +}; + +///Լ֤ʵ +struct CThostFtdcInstrumentMarginRateAdjustField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///֤ +struct CThostFtdcExchangeMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; +}; + +///֤ʵ +struct CThostFtdcExchangeMarginRateAdjustField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///潻Ͷ߶ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ExchLongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ExchLongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ExchShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ExchShortMarginRatioByVolume; + ///潻Ͷ߶ͷ֤ + TThostFtdcRatioType NoLongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TThostFtdcMoneyType NoLongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TThostFtdcRatioType NoShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TThostFtdcMoneyType NoShortMarginRatioByVolume; +}; + +/// +struct CThostFtdcExchangeRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Դֵλ + TThostFtdcCurrencyUnitType FromCurrencyUnit; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; +}; + +/// +struct CThostFtdcSettlementRefField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; +}; + +///ǰʱ +struct CThostFtdcCurrentTimeField +{ + ///ǰ + TThostFtdcDateType CurrDate; + ///ǰʱ + TThostFtdcTimeType CurrTime; + ///ǰʱ䣨룩 + TThostFtdcMillisecType CurrMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +///ͨѶ׶ +struct CThostFtdcCommPhaseField +{ + /// + TThostFtdcDateType TradingDay; + ///ͨѶʱα + TThostFtdcCommPhaseNoType CommPhaseNo; + ///ϵͳ + TThostFtdcSystemIDType SystemID; +}; + +///¼Ϣ +struct CThostFtdcLoginInfoField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + /// + TThostFtdcPasswordType Password; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///Դʱ + TThostFtdcTimeType INETime; +}; + +///¼Ϣ +struct CThostFtdcLogoutAllField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; +}; + +///ǰ״̬ +struct CThostFtdcFrontStatusField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///û +struct CThostFtdcUserPasswordUpdateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; +}; + +///뱨 +struct CThostFtdcInputOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///־ + TThostFtdcBoolType IsSwapOrder; + // + ///onRspOrderInsertʹ,ReqOrderInsertвд. + TThostFtdcOrderSysIDType OrderSysID; + TThostFtdcExchangeIDType ExchangeID; + +}; + +/// +struct CThostFtdcOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ//sigt + TThostFtdcVolumeType ZCETotalTradedVolume; + ///־ + TThostFtdcBoolType IsSwapOrder; +}; + +/// +struct CThostFtdcExchangeOrderField +{ + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; +}; + +///ʧ +struct CThostFtdcExchangeOrderInsertErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///뱨 +struct CThostFtdcInputOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ױ + //TThostFtdcClientIDType ClientID; +}; + +/// +struct CThostFtdcOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CThostFtdcExchangeOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; +}; + +///ʧ +struct CThostFtdcExchangeOrderActionErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ɽ +struct CThostFtdcExchangeTradeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ɽԴ + TThostFtdcTradeSourceType TradeSource; +}; + +///ɽ +struct CThostFtdcTradeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ɽԴ + TThostFtdcTradeSourceType TradeSource; +}; + +///ûỰ +struct CThostFtdcUserSessionField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ѯ󱨵 +struct CThostFtdcQueryMaxOrderVolumeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; +}; + +///Ͷ߽ȷϢ +struct CThostFtdcSettlementInfoConfirmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ȷ + TThostFtdcDateType ConfirmDate; + ///ȷʱ + TThostFtdcTimeType ConfirmTime; +}; + +///ͬ +struct CThostFtdcSyncDepositField +{ + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcMoneyType Deposit; + ///Ƿǿƽ + TThostFtdcBoolType IsForce; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///Ѻͬ +struct CThostFtdcSyncFundMortgageField +{ + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Ѻ + TThostFtdcMoneyType MortgageAmount; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; +}; + +///͹˾ͬ +struct CThostFtdcBrokerSyncField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ͬеͶ +struct CThostFtdcSyncingInvestorField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcDateType OpenDate; + ///ֻ + TThostFtdcMobileType Mobile; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ͬеĽ״ +struct CThostFtdcSyncingTradingCodeField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; +}; + +///ͬеͶ߷ +struct CThostFtdcSyncingInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TThostFtdcInvestorGroupNameType InvestorGroupName; +}; + +///ͬеĽ˺ +struct CThostFtdcSyncingTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ϴѺ + TThostFtdcMoneyType PreMortgage; + ///ϴö + TThostFtdcMoneyType PreCredit; + ///ϴδ + TThostFtdcMoneyType PreDeposit; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///Ϣ + TThostFtdcMoneyType InterestBase; + ///Ϣ + TThostFtdcMoneyType Interest; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + ///ʽ + TThostFtdcMoneyType Available; + ///ȡʽ + TThostFtdcMoneyType WithdrawQuota; + ///׼ + TThostFtdcMoneyType Reserve; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ö + TThostFtdcMoneyType Credit; + ///Ѻ + TThostFtdcMoneyType Mortgage; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TThostFtdcMoneyType DeliveryMargin; + ///֤ + TThostFtdcMoneyType ExchangeDeliveryMargin; + ///ڻ׼//sgit + TThostFtdcMoneyType ReserveBalance; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ϴλ + TThostFtdcMoneyType PreFundMortgageIn; + ///ϴλʳ + TThostFtdcMoneyType PreFundMortgageOut; + /// + TThostFtdcMoneyType FundMortgageIn; + ///ʳ + TThostFtdcMoneyType FundMortgageOut; + ///Ѻ + TThostFtdcMoneyType FundMortgageAvailable; + ///Ѻҽ + TThostFtdcMoneyType MortgageableFund; + ///Ʒռñ֤ + TThostFtdcMoneyType SpecProductMargin; + ///Ʒᱣ֤ + TThostFtdcMoneyType SpecProductFrozenMargin; + ///Ʒ + TThostFtdcMoneyType SpecProductCommission; + ///Ʒ + TThostFtdcMoneyType SpecProductFrozenCommission; + ///Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfit; + ///Ʒƽӯ + TThostFtdcMoneyType SpecProductCloseProfit; + ///ݳֲӯ㷨Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfitByAlg; + ///Ʒ֤ + TThostFtdcMoneyType SpecProductExchangeMargin; +}; + +///ͬеͶֲ߳ +struct CThostFtdcSyncingInvestorPositionField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcPositionDateType PositionDate; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ճֲ + TThostFtdcVolumeType Position; + ///ͷ + TThostFtdcVolumeType LongFrozen; + ///ͷ + TThostFtdcVolumeType ShortFrozen; + ///ֶ + TThostFtdcMoneyType LongFrozenAmount; + ///ֶ + TThostFtdcMoneyType ShortFrozenAmount; + /// + TThostFtdcVolumeType OpenVolume; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ֽ + TThostFtdcMoneyType OpenAmount; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ֲֳɱ + TThostFtdcMoneyType PositionCost; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ֳɱ + TThostFtdcMoneyType OpenCost; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TThostFtdcVolumeType CombPosition; + ///϶ͷ + TThostFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TThostFtdcVolumeType CombShortFrozen; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TThostFtdcVolumeType TodayPosition; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ִж//sgit + TThostFtdcVolumeType StrikeFrozen; + ///ִж + TThostFtdcMoneyType StrikeFrozenAmount; + ///ִж + TThostFtdcVolumeType AbandonFrozen; +}; + +///ͬеĺԼ֤ +struct CThostFtdcSyncingInstrumentMarginRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///ͬеĺԼ +struct CThostFtdcSyncingInstrumentCommissionRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; +}; + +///ͬеĺԼȨ +struct CThostFtdcSyncingInstrumentTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ȩ + TThostFtdcTradingRightType TradingRight; +}; + +///ѯ +struct CThostFtdcQryOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ѯɽ +struct CThostFtdcQryTradeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + ///ʼʱ + TThostFtdcTimeType TradeTimeStart; + ///ʱ + TThostFtdcTimeType TradeTimeEnd; +}; + +///ѯͶֲ߳ +struct CThostFtdcQryInvestorPositionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ѯʽ˻ +struct CThostFtdcQryTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯͶ +struct CThostFtdcQryInvestorField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ѯױ +struct CThostFtdcQryTradingCodeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; +}; + +///ѯͶ +struct CThostFtdcQryInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯԼ֤ +struct CThostFtdcQryInstrumentMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ +struct CThostFtdcQryInstrumentCommissionRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ѯԼȨ +struct CThostFtdcQryInstrumentTradingRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ѯ͹˾ +struct CThostFtdcQryBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯԱ +struct CThostFtdcQryTraderField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯûȨ +struct CThostFtdcQrySuperUserFunctionField +{ + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯûỰ +struct CThostFtdcQryUserSessionField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ͹˾Ա +struct CThostFtdcQryPartBrokerField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; +}; + +///ѯǰ״̬ +struct CThostFtdcQryFrontStatusField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; +}; + +///ѯ +struct CThostFtdcQryExchangeOrderField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯ +struct CThostFtdcQryOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcQryExchangeOrderActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯû +struct CThostFtdcQrySuperUserField +{ + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ +struct CThostFtdcQryExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯƷ +struct CThostFtdcQryProductField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; +}; + +///ѯԼ +struct CThostFtdcQryInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; +}; + +///ѯ +struct CThostFtdcQryDepthMarketDataField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ѯ͹˾û +struct CThostFtdcQryBrokerUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ͹˾ûȨ +struct CThostFtdcQryBrokerUserFunctionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯԱ̻ +struct CThostFtdcQryTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯˮ +struct CThostFtdcQrySyncDepositField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; +}; + +///ѯͶ߽ +struct CThostFtdcQrySettlementInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; +}; + +///ѯ֤ +struct CThostFtdcQryExchangeMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ֤ +struct CThostFtdcQryExchangeMarginRateAdjustField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ +struct CThostFtdcQryExchangeRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; +}; + +///ѯѺˮ +struct CThostFtdcQrySyncFundMortgageField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; +}; + +///ѯ +struct CThostFtdcQryHisOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; +}; + +///ǰȨԼС֤ +struct CThostFtdcOptionInstrMiniMarginField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///λ֣ȨԼС֤ + TThostFtdcMoneyType MinMargin; + ///ȡֵʽ + TThostFtdcValueMethodType ValueMethod; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; +}; + +///ǰȨԼ֤ϵ +struct CThostFtdcOptionInstrMarginAdjustField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷͷ֤ϵ + TThostFtdcRatioType SShortMarginRatioByMoney; + ///Ͷͷ֤ϵ + TThostFtdcMoneyType SShortMarginRatioByVolume; + ///ֵͷ֤ϵ + TThostFtdcRatioType HShortMarginRatioByMoney; + ///ֵͷ֤ϵ + TThostFtdcMoneyType HShortMarginRatioByVolume; + ///ͷ֤ϵ + TThostFtdcRatioType AShortMarginRatioByMoney; + ///ͷ֤ϵ + TThostFtdcMoneyType AShortMarginRatioByVolume; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; +}; + +///ǰȨԼѵϸ +struct CThostFtdcOptionInstrCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; +}; + +///Ȩ׳ɱ +struct CThostFtdcOptionInstrTradeCostField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType FixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType MiniMargin; + ///ȨԼȨ + TThostFtdcMoneyType Royalty; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType ExchFixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType ExchMiniMargin; +}; + +///Ȩ׳ɱѯ +struct CThostFtdcQryOptionInstrTradeCostField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ + TThostFtdcPriceType InputPrice; + ///ļ۸,0 + TThostFtdcPriceType UnderlyingPrice; +}; + +///Ȩʲѯ +struct CThostFtdcQryOptionInstrCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ָָֻ +struct CThostFtdcIndexPriceField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ָֻ̼ + TThostFtdcPriceType ClosePrice; +}; + +///ִ +struct CThostFtdcInputExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; +}; + +///ִ +struct CThostFtdcInputExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ִ +struct CThostFtdcExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerExecOrderSeq; +}; + +///ִ +struct CThostFtdcExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ִѯ +struct CThostFtdcQryExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ִϢ +struct CThostFtdcExchangeExecOrderField +{ + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; +}; + +///ִѯ +struct CThostFtdcQryExchangeExecOrderField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ִѯ +struct CThostFtdcQryExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ִ +struct CThostFtdcExchangeExecOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; +}; + +///ִѯ +struct CThostFtdcQryExchangeExecOrderActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ִ +struct CThostFtdcErrExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯִ +struct CThostFtdcQryErrExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ִ +struct CThostFtdcErrExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯִ +struct CThostFtdcQryErrExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ͶȨԼȨ +struct CThostFtdcOptionInstrTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDirectionType Direction; + ///Ȩ + TThostFtdcTradingRightType TradingRight; +}; + +///ѯȨԼȨ +struct CThostFtdcQryOptionInstrTradingRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; +}; + +///ѯ +struct CThostFtdcInputForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ +struct CThostFtdcForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ѯ۱ + TThostFtdcSequenceNoType BrokerForQutoSeq; +}; + +///ѯ۲ѯ +struct CThostFtdcQryForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ѯϢ +struct CThostFtdcExchangeForQuoteField +{ + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; +}; + +///ѯ۲ѯ +struct CThostFtdcQryExchangeForQuoteField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ı +struct CThostFtdcInputQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; +}; + +///뱨۲ +struct CThostFtdcInputQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CThostFtdcQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾۱ + TThostFtdcSequenceNoType BrokerQuoteSeq; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; +}; + +///۲ +struct CThostFtdcQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///۲ѯ +struct CThostFtdcQryQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///Ϣ +struct CThostFtdcExchangeQuoteField +{ + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; +}; + +///۲ѯ +struct CThostFtdcQryExchangeQuoteField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///۲ѯ +struct CThostFtdcQryQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///۲ +struct CThostFtdcExchangeQuoteActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; +}; + +///۲ѯ +struct CThostFtdcQryExchangeQuoteActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ȨԼdeltaֵ +struct CThostFtdcOptionInstrDeltaField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Deltaֵ + TThostFtdcRatioType Delta; +}; + +///̵ѯ +struct CThostFtdcForQuoteRspField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///ѯʱ + TThostFtdcTimeType ForQuoteTime; + ///ҵ + TThostFtdcDateType ActionDay; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰȨԼִƫֵϸ +struct CThostFtdcStrikeOffsetField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִƫֵ + TThostFtdcMoneyType Offset; +}; + +///Ȩִƫֵѯ +struct CThostFtdcQryStrikeOffsetField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CThostFtdcInputBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///û + TThostFtdcUserIDType UserID; +}; + +/// +struct CThostFtdcBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; +}; + +/// +struct CThostFtdcExchangeBatchOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ +struct CThostFtdcQryBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ϺԼȫϵ +struct CThostFtdcCombInstrumentGuardField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcRatioType GuarantRatio; +}; + +///ϺԼȫϵѯ +struct CThostFtdcQryCombInstrumentGuardField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CThostFtdcInputCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +/// +struct CThostFtdcCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; +}; + +///ϲѯ +struct CThostFtdcQryCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ϣ +struct CThostFtdcExchangeCombActionField +{ + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; +}; + +///ϲѯ +struct CThostFtdcQryExchangeCombActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///Ʒۻ +struct CThostFtdcProductExchRateField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///۱ + TThostFtdcCurrencyIDType QuoteCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; +}; + +///Ʒۻʲѯ +struct CThostFtdcQryProductExchRateField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; +}; + +///ѯѯۼ۲ +struct CThostFtdcQryForQuoteParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯۼ۲ +struct CThostFtdcForQuoteParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///¼ + TThostFtdcPriceType LastPrice; + ///۲ + TThostFtdcPriceType PriceInterval; +}; + +///г +struct CThostFtdcMarketDataField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +/// +struct CThostFtdcMarketDataBaseField +{ + /// + TThostFtdcDateType TradingDay; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + ///ʵ + TThostFtdcRatioType PreDelta; +}; + +///龲̬ +struct CThostFtdcMarketDataStaticField +{ + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcPriceType ClosePrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ʵ + TThostFtdcRatioType CurrDelta; +}; + +///³ɽ +struct CThostFtdcMarketDataLastMatchField +{ + ///¼ + TThostFtdcPriceType LastPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; +}; + +///ż +struct CThostFtdcMarketDataBestPriceField +{ + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; +}; + +/// +struct CThostFtdcMarketDataBid23Field +{ + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; +}; + +/// +struct CThostFtdcMarketDataAsk23Field +{ + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; +}; + +///ġ +struct CThostFtdcMarketDataBid45Field +{ + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; +}; + +///ġ +struct CThostFtdcMarketDataAsk45Field +{ + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; +}; + +///ʱ +struct CThostFtdcMarketDataUpdateTimeField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +///齻 +struct CThostFtdcMarketDataExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָĺԼ +struct CThostFtdcSpecificInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///Լ״̬ +struct CThostFtdcInstrumentStatusField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcSettlementGroupIDType SettlementGroupID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Լ״̬ + TThostFtdcInstrumentStatusType InstrumentStatus; + ///׽׶α + TThostFtdcTradingSegmentSNType TradingSegmentSN; + ///뱾״̬ʱ + TThostFtdcTimeType EnterTime; + ///뱾״̬ԭ + TThostFtdcInstStatusEnterReasonType EnterReason; +}; + +///ѯԼ״̬ +struct CThostFtdcQryInstrumentStatusField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; +}; + +///Ͷ˻ +struct CThostFtdcInvestorAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ӯ㷨 +struct CThostFtdcPositionProfitAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///ע + TThostFtdcMemoType Memo; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///Աʽۿ +struct CThostFtdcDiscountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʽۿ۱ + TThostFtdcRatioType Discount; +}; + +///ѯת +struct CThostFtdcQryTransferBankField +{ + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; +}; + +///ת +struct CThostFtdcTransferBankField +{ + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///ѯͶֲ߳ϸ +struct CThostFtdcQryInvestorPositionDetailField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///Ͷֲ߳ϸ +struct CThostFtdcInvestorPositionDetailField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcDateType OpenDate; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcVolumeType Volume; + ///ּ + TThostFtdcPriceType OpenPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///նгֲӯ + TThostFtdcMoneyType PositionProfitByDate; + ///ʶԳֲӯ + TThostFtdcMoneyType PositionProfitByTrade; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + /// + TThostFtdcPriceType LastSettlementPrice; + /// + TThostFtdcPriceType SettlementPrice; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///鱨̻ +struct CThostFtdcMDTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ϯλɽ + TThostFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TThostFtdcReturnCodeType MaxOrderMessageReference; +}; + +///ѯ鱨̻ +struct CThostFtdcQryMDTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯͻ֪ͨ +struct CThostFtdcQryNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ͻ֪ͨ +struct CThostFtdcNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ϣ + TThostFtdcContentType Content; + ///͹˾֪ͨк + TThostFtdcSequenceLabelType SequenceLabel; +}; + +///ûȨ +struct CThostFtdcUserRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ͻȨ + TThostFtdcUserRightTypeType UserRightType; + ///Ƿֹ + TThostFtdcBoolType IsForbidden; +}; + +///ѯϢȷ +struct CThostFtdcQrySettlementInfoConfirmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///װؽϢ +struct CThostFtdcLoadSettlementInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///͹˾ʽ㷨 +struct CThostFtdcBrokerWithdrawAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ㷨 + TThostFtdcAlgorithmType WithdrawAlgorithm; + ///ʽʹ + TThostFtdcRatioType UsingRatio; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType IncludeCloseProfit; + ///޲޳ɽͻǷܿ + TThostFtdcAllWithoutTradeType AllWithoutTrade; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///Ƿû¼ + TThostFtdcBoolType IsBrokerUserEvent; + ///ִ//sgit + TThostFtdcCurrencyIDType CurrencyID; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; + ///Ȩ㷨 + TThostFtdcBalanceAlgorithmType BalanceAlgorithm; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordUpdateV1Field +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordUpdateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; + ///ִ//sgit + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯϺԼ +struct CThostFtdcQryCombinationLegField +{ + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; +}; + +///ѯϺԼ +struct CThostFtdcQrySyncStatusField +{ + /// + TThostFtdcDateType TradingDay; +}; + +///Ͻ׺Լĵ +struct CThostFtdcCombinationLegField +{ + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + /// + TThostFtdcImplyLevelType ImplyLevel; +}; + +///ͬ״̬ +struct CThostFtdcSyncStatusField +{ + /// + TThostFtdcDateType TradingDay; + ///ͬ״̬ + TThostFtdcDataSyncStatusType DataSyncStatus; +}; + +///ѯϵ +struct CThostFtdcQryLinkManField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ϵ +struct CThostFtdcLinkManField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵ + TThostFtdcPersonTypeType PersonType; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + /// + TThostFtdcPartyNameType PersonName; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcZipCodeType ZipCode; + ///ȼ + TThostFtdcPriorityType Priority; + /////sgit + TThostFtdcUOAZipCodeType UOAZipCode; + ///ȫ + TThostFtdcInvestorFullNameType PersonFullName; +}; + +///ѯ͹˾û¼ +struct CThostFtdcQryBrokerUserEventField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; +}; + +///ѯ͹˾û¼ +struct CThostFtdcBrokerUserEventField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; + ///û¼ + TThostFtdcSequenceNoType EventSequenceNo; + ///¼ + TThostFtdcDateType EventDate; + ///¼ʱ + TThostFtdcTimeType EventTime; + ///û¼Ϣ + TThostFtdcUserEventInfoType UserEventInfo; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ѯǩԼ +struct CThostFtdcQryContractBankField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; +}; + +///ѯǩԼӦ +struct CThostFtdcContractBankField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; +}; + +///Ͷϳֲϸ +struct CThostFtdcInvestorPositionCombineDetailField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + ///ϱ + TThostFtdcTradeIDType TradeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + ///ֲ + TThostFtdcVolumeType TotalAmt; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ɽ + TThostFtdcTradeGroupIDType TradeGroupID; +}; + +///Ԥ +struct CThostFtdcParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ԥ񱨵 + TThostFtdcParkedOrderIDType ParkedOrderID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ״̬ + TThostFtdcParkedOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; +}; + +///Ԥ񵥲 +struct CThostFtdcParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ԥ񳷵 + TThostFtdcParkedOrderActionIDType ParkedOrderActionID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ񳷵״̬ + TThostFtdcParkedOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯԤ +struct CThostFtdcQryParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯԤ񳷵 +struct CThostFtdcQryParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ɾԤ +struct CThostFtdcRemoveParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񱨵 + TThostFtdcParkedOrderIDType ParkedOrderID; +}; + +///ɾԤ񳷵 +struct CThostFtdcRemoveParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񳷵 + TThostFtdcParkedOrderActionIDType ParkedOrderActionID; +}; + +///͹˾ʽ㷨 +struct CThostFtdcInvestorWithdrawAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʽ + TThostFtdcRatioType UsingRatio; + ///ִ//sgit + TThostFtdcCurrencyIDType CurrencyID; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; +}; + +///ѯϳֲϸ +struct CThostFtdcQryInvestorPositionCombineDetailField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; +}; + +///ɽ +struct CThostFtdcMarketDataAveragePriceField +{ + ///վ + TThostFtdcPriceType AveragePrice; +}; + +///УͶ +struct CThostFtdcVerifyInvestorPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcPasswordType Password; +}; + +///ûIP +struct CThostFtdcUserIPField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///IPַ + TThostFtdcIPAddressType IPMask; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///û¼֪ͨϢ +struct CThostFtdcTradingNoticeInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʱ + TThostFtdcTimeType SendTime; + ///Ϣ + TThostFtdcContentType FieldContent; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///к + TThostFtdcSequenceNoType SequenceNo; +}; + +///û¼֪ͨ +struct CThostFtdcTradingNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///û + TThostFtdcUserIDType UserID; + ///ʱ + TThostFtdcTimeType SendTime; + ///к + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType FieldContent; +}; + +///ѯ¼֪ͨ +struct CThostFtdcQryTradingNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ѯ󱨵 +struct CThostFtdcQryErrOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///󱨵 +struct CThostFtdcErrOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־//sgit + TThostFtdcBoolType IsSwapOrder; +}; + +///ѯ󱨵 +struct CThostFtdcErrorConditionalOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ + TThostFtdcVolumeType ZCETotalTradedVolume; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; +}; + +///ѯ󱨵 +struct CThostFtdcQryErrOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///󱨵 +struct CThostFtdcErrOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ״̬ +struct CThostFtdcQryExchangeSequenceField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///״̬ +struct CThostFtdcExchangeSequenceField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Լ״̬ + TThostFtdcInstrumentStatusType MarketStatus; +}; + +///ݼ۸ѯ󱨵 +struct CThostFtdcQueryMaxOrderVolumeWithPriceField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; + ///۸ + TThostFtdcPriceType Price; +}; + +///ѯ͹˾ײ +struct CThostFtdcQryBrokerTradingParamsField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///͹˾ײ +struct CThostFtdcBrokerTradingParamsField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤۸ + TThostFtdcMarginPriceTypeType MarginPriceType; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///ִ//sgit + TThostFtdcCurrencyIDType CurrencyID; + ///ȨȨ۸ + TThostFtdcOptionRoyaltyPriceTypeType OptionRoyaltyPriceType; +}; + +///ѯ͹˾㷨 +struct CThostFtdcQryBrokerTradingAlgosField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///͹˾㷨 +struct CThostFtdcBrokerTradingAlgosField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ֲִ㷨 + TThostFtdcHandlePositionAlgoIDType HandlePositionAlgoID; + ///Ѱұ֤㷨 + TThostFtdcFindMarginRateAlgoIDType FindMarginRateAlgoID; + ///ʽ㷨 + TThostFtdcHandleTradingAccountAlgoIDType HandleTradingAccountAlgoID; +}; + +///ѯ͹˾ʽ +struct CThostFtdcQueryBrokerDepositField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///͹˾ʽ +struct CThostFtdcBrokerDepositField +{ + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ʽ + TThostFtdcMoneyType Available; + ///׼ + TThostFtdcMoneyType Reserve; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; +}; + +///ѯ֤ϵͳ͹˾Կ +struct CThostFtdcQryCFMMCBrokerKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///֤ϵͳ͹˾Կ +struct CThostFtdcCFMMCBrokerKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Կ + TThostFtdcDateType CreateDate; + ///Կʱ + TThostFtdcTimeType CreateTime; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬Կ + TThostFtdcCFMMCKeyType CurrentKey; + ///̬Կ + TThostFtdcCFMMCKeyKindType KeyKind; +}; + +///֤ϵͳ͹˾ʽ˻Կ +struct CThostFtdcCFMMCTradingAccountKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬Կ + TThostFtdcCFMMCKeyType CurrentKey; +}; + +///ѯ֤ϵͳ͹˾ʽ˻Կ +struct CThostFtdcQryCFMMCTradingAccountKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///û̬Ʋ +struct CThostFtdcBrokerUserOTPParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ṩ + TThostFtdcOTPVendorsIDType OTPVendorsID; + ///̬к + TThostFtdcSerialNumberType SerialNumber; + ///Կ + TThostFtdcAuthKeyType AuthKey; + ///Ưֵ + TThostFtdcLastDriftType LastDrift; + ///ɹֵ + TThostFtdcLastSuccessType LastSuccess; + ///̬ + TThostFtdcOTPTypeType OTPType; +}; + +///ֹͬû̬ +struct CThostFtdcManualSyncBrokerUserOTPField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ + TThostFtdcOTPTypeType OTPType; + ///һ̬ + TThostFtdcPasswordType FirstOTP; + ///ڶ̬ + TThostFtdcPasswordType SecondOTP; +}; + +///Ͷģ +struct CThostFtdcCommRateModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///ģ + TThostFtdcCommModelNameType CommModelName; +}; + +///ѯͶģ +struct CThostFtdcQryCommRateModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; +}; + +///Ͷ֤߱ģ +struct CThostFtdcMarginModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; + ///ģ + TThostFtdcCommModelNameType MarginModelName; +}; + +///ѯͶ֤߱ģ +struct CThostFtdcQryMarginModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ֵ۵Ϣ +struct CThostFtdcEWarrantOffsetField +{ + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType Volume; +}; + +///ѯֵ۵Ϣ +struct CThostFtdcQryEWarrantOffsetField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ѯͶƷ/Ʒֱ֤ +struct CThostFtdcQryInvestorProductGroupMarginField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ͶƷ/Ʒֱ֤ +struct CThostFtdcInvestorProductGroupMarginField +{ + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType LongFrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType ShortFrozenMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ͷ֤ + TThostFtdcMoneyType LongUseMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortUseMargin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///ͷ֤ + TThostFtdcMoneyType LongExchMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortExchMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + /// + TThostFtdcMoneyType FrozenCommission; + /// + TThostFtdcMoneyType Commission; + ///ʽ + TThostFtdcMoneyType FrozenCash; + ///ʽ + TThostFtdcMoneyType CashIn; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///۵ܽ + TThostFtdcMoneyType OffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortOffsetAmount; + ///۵ܽ + TThostFtdcMoneyType ExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortExchOffsetAmount; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯû +struct CThostFtdcQueryCFMMCTradingAccountTokenField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///û +struct CThostFtdcCFMMCTradingAccountTokenField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬ + TThostFtdcCFMMCTokenType Token; +}; + +///ѯƷ +struct CThostFtdcQryProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ͶƷ/Ʒֱ֤Ʒ +struct CThostFtdcProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductGroupID; +}; + +///תʿ +struct CThostFtdcReqOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; +}; + +///ת +struct CThostFtdcReqCancelAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; +}; + +///˻ +struct CThostFtdcReqChangeAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ת +struct CThostFtdcReqTransferField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; +}; + +///зʽתڻӦ +struct CThostFtdcRspTransferField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CThostFtdcReqRepealField +{ + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; +}; + +///Ӧ +struct CThostFtdcRspRepealField +{ + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ +struct CThostFtdcReqQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ѯ˻ϢӦ +struct CThostFtdcRspQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; +}; + +///ǩǩ +struct CThostFtdcFutureSignIOField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ǩӦ +struct CThostFtdcRspFutureSignInField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; +}; + +///ǩ +struct CThostFtdcReqFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ǩӦ +struct CThostFtdcRspFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯָˮŵĽ׽ +struct CThostFtdcReqQueryTradeResultBySerialField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ˮ + TThostFtdcSerialType Reference; + ///ˮŷߵĻ + TThostFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TThostFtdcOrganCodeType RefrenceIssure; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ѯָˮŵĽ׽Ӧ +struct CThostFtdcRspQueryTradeResultBySerialField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///ˮ + TThostFtdcSerialType Reference; + ///ˮŷߵĻ + TThostFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TThostFtdcOrganCodeType RefrenceIssure; + ///ԭʼش + TThostFtdcReturnCodeType OriginReturnCode; + ///ԭʼ + TThostFtdcDescrInfoForReturnCodeType OriginDescrInfoForReturnCode; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ļ +struct CThostFtdcReqDayEndFileReadyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ļҵ + TThostFtdcFileBusinessCodeType FileBusinessCode; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ؽ +struct CThostFtdcReturnResultField +{ + ///ش + TThostFtdcReturnCodeType ReturnCode; + /// + TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; +}; + +///֤ڻʽ +struct CThostFtdcVerifyFuturePasswordField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///װ + TThostFtdcInstallIDType InstallID; + ///ID + TThostFtdcTIDType TID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///֤ͻϢ +struct CThostFtdcVerifyCustInfoField +{ + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; +}; + +///֤ڻʽͿͻϢ +struct CThostFtdcVerifyFuturePasswordAndCustInfoField +{ + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///֤ڻʽͿͻϢ +struct CThostFtdcDepositResultInformField +{ + ///ˮţˮΪڱ̷صˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcRequestIDType RequestID; + ///ش + TThostFtdcReturnCodeType ReturnCode; + /// + TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; +}; + +///׺ڱ̷Կͬ +struct CThostFtdcReqSyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///׺ڱ̷ԿͬӦ +struct CThostFtdcRspSyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ֪ͨ +struct CThostFtdcNotifyQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ת˽ˮ +struct CThostFtdcTransferSerialField +{ + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateSerial; + ///׷ + TThostFtdcTradeDateType TradeDate; + /// + TThostFtdcDateType TradingDay; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///Ự + TThostFtdcSessionIDType SessionID; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///ڻ˾ʺ + TThostFtdcFutureAccTypeType FutureAccType; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///׽ + TThostFtdcTradeAmountType TradeAmount; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///Ч־ + TThostFtdcAvailabilityFlagType AvailabilityFlag; + ///Ա + TThostFtdcOperatorCodeType OperatorCode; + ///ʺ + TThostFtdcBankAccountType BankNewAccount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯתˮ +struct CThostFtdcQryTransferSerialField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ǩ֪ͨ +struct CThostFtdcNotifyFutureSignInField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; +}; + +///ǩ֪ͨ +struct CThostFtdcNotifyFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///׺ڱ̷Կ֪ͬͨ +struct CThostFtdcNotifySyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯǩԼϵ +struct CThostFtdcQryAccountregisterField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///з֧//sgit + TThostFtdcBankBrchIDType BankBranchID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ͻϢ +struct CThostFtdcAccountregisterField +{ + /// + TThostFtdcTradeDateType TradeDay; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///ڻ˾֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + /// + TThostFtdcOpenOrDestroyType OpenOrDestroy; + ///ǩԼ + TThostFtdcTradeDateType RegDate; + ///Լ + TThostFtdcTradeDateType OutDate; + ///ID + TThostFtdcTIDType TID; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; +}; + +///ڿϢ +struct CThostFtdcOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///Ϣ +struct CThostFtdcCancelAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ڱ˺Ϣ +struct CThostFtdcChangeAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ԱȨ +struct CThostFtdcSecAgentACIDMapField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcCurrencyIDType CurrencyID; + ///нʽʺ + TThostFtdcAccountIDType BrokerSecAgentID; +}; + +///ԱȨ޲ѯ +struct CThostFtdcQrySecAgentACIDMapField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ֱĽȨ +struct CThostFtdcUserRightsAssignField +{ + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; +}; + +///ù˾ǷڱʾĽȨ +struct CThostFtdcBrokerUserRightAssignField +{ + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; + ///ܷ + TThostFtdcBoolType Tradeable; +}; + +///ֱת +struct CThostFtdcDRTransferField +{ + ///ԭĴ + TThostFtdcDRIdentityIDType OrigDRIdentityID; + ///Ŀ꽻Ĵ + TThostFtdcDRIdentityIDType DestDRIdentityID; + ///ԭӦõԪ + TThostFtdcBrokerIDType OrigBrokerID; + ///ĿõԪ + TThostFtdcBrokerIDType DestBrokerID; +}; + +///FensûϢ +struct CThostFtdcFensUserInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ģʽ + TThostFtdcLoginModeType LoginMode; +}; + +///ǰ +struct CThostFtdcCurrTransferIdentityField +{ + ///Ĵ + TThostFtdcDRIdentityIDType IdentityID; +}; + +///ֹ¼û +struct CThostFtdcLoginForbiddenUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; +}; + +///ѯֹ¼û +struct CThostFtdcQryLoginForbiddenUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///UDP鲥Ϣ +struct CThostFtdcMulticastGroupInfoField +{ + ///鲥IPַ + TThostFtdcIPAddressType GroupIP; + ///鲥IP˿ + TThostFtdcIPPortType GroupPort; + ///Դַ + TThostFtdcIPAddressType SourceIP; +}; + +///ʽ˻׼ +struct CThostFtdcTradingAccountReserveField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///׼ + TThostFtdcMoneyType Reserve; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///Լλѯ +struct CThostMBLQuotReq +{ + ///ʼԼ + TThostFtdcInstrumentIDType StartInstrumentID; + ///Լ + TThostFtdcInstrumentIDType EndInstrumentID; + ///־ + TThostFtdcDirectionType Direction; +}; + +///Լλ +struct CThostMBLQuotData +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///־ + TThostFtdcDirectionType Direction; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; +}; + +///ĺԼ +struct CThostSubQuotField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; +/// +struct CThostDeferDeliveryQuot +{ + TThostFtdcInstrumentIDType InstrumentID; //Լ + TThostFtdcVolumeType AskVolume; // + TThostFtdcVolumeType BidVolume; // + TThostFtdcVolumeType MidAskVolume; // + TThostFtdcVolumeType MidBidVolume; // +}; + + +}; + +#endif diff --git "a/include/Sgit/doc/FS\346\216\245\345\217\243\344\275\277\347\224\250\350\257\264\346\230\216_4.2\347\211\210.doc" "b/include/Sgit/doc/FS\346\216\245\345\217\243\344\275\277\347\224\250\350\257\264\346\230\216_4.2\347\211\210.doc" new file mode 100644 index 0000000..f50c82a Binary files /dev/null and "b/include/Sgit/doc/FS\346\216\245\345\217\243\344\275\277\347\224\250\350\257\264\346\230\216_4.2\347\211\210.doc" differ diff --git a/include/Sgit/doc/SgitApi4.2Q&A.pdf b/include/Sgit/doc/SgitApi4.2Q&A.pdf new file mode 100644 index 0000000..a2fe37f Binary files /dev/null and b/include/Sgit/doc/SgitApi4.2Q&A.pdf differ diff --git "a/include/Sgit/doc/SgitApi\345\217\230\346\233\264(4.1-4.2).doc" "b/include/Sgit/doc/SgitApi\345\217\230\346\233\264(4.1-4.2).doc" new file mode 100644 index 0000000..3709de7 Binary files /dev/null and "b/include/Sgit/doc/SgitApi\345\217\230\346\233\264(4.1-4.2).doc" differ diff --git "a/include/Sgit/doc/\344\277\256\346\255\243\345\206\205\345\256\271.txt" "b/include/Sgit/doc/\344\277\256\346\255\243\345\206\205\345\256\271.txt" new file mode 100644 index 0000000..1d6736a --- /dev/null +++ "b/include/Sgit/doc/\344\277\256\346\255\243\345\206\205\345\256\271.txt" @@ -0,0 +1,62 @@ +20160629------------------------------ +1,ÿͻϢѯReqQryInvestorҪ̨60622֮İ汾֧ +2,ֲϸѯ,ֺͽ +3,Ϣȷϲѯ,Ӧ,ԶΪȷ. +4,,μAPIErrorCode.hAPIErrorCode.xml +5,ReqQryInstrumentMarginRate() + OnRspQryInstrumentMarginRate() + ReqQryInstrumentCommissionRate() + OnRspQryInstrumentCommissionRate() + ԭΪѯ֮󷵻ģ,ַغԼľʺͱ֤ + ע:ʱ,ʽ˺ű +6,ӺԼ鶩Ӧ,ͳӦ. +7,ֲֲѯ,ֲַ.. + +20160630------------------------------------ +sgitTradeapi_4.2.12.60630 +1,OnRspOrderInsert,ֶExchangID, + ԭΪ<ַ궨,ƽ"7">,޸Ϊ<ַ,ƽ"SGE"> +2,ͷʽRestart/Quick/ReSume, + ע:̨pg_4.2.15.60630Լ֮İ汾,֮ǰİ汾ֻRestartģʽ. + +20160712------------------------------------ +sgitTradeapi_4.2.13.60712 +1,OnRspQryInstrument()ԼϢCThostFtdcInstrumentField::ProductID +ֻapi + +20160715------------------------------------ +sgitTradeapi_4.2.14.60715 +ֲϸ,ExchangMarginͳһΪ֤,PreSettlePrice. + +20160718------------------------------------ +SgitQuotApi_4.2.4.60718 +1,api־ļƸΪQuotAPIPackage.txt +2,OnRtnDepthMarketData:: CThostFtdcDepthMarketDataField:: UpdateMillisec. +ԭ : Ϊɽ仯,Ϊ0 + : нЧ,Ϊ0 +ע:ӿsgitQuotApi_4.2.4.60718 ,̨qg4.2.6_20160718֮汾Ч + +20160726------------------------------------ +sgitApi4.2.15.60726 +1,Լѯ +2,֤ѯ +3,ϵͳѯ +ע:׺̨pg4.2.19-20160726֮汾Ч +4,Ӻ + virtual int InitLog(TThostFtdcBoolType bLog=TRUE) = 0; + virtual int IsReviveNtyCapital(TThostFtdcBoolType bRecive=TRUE) = 0; +20160817-------------------------------------- +sgitApi4.2.17.60817 +1,ֲϸ. + +20160907-------------------------------------- +sgitquotapi4.2.7.60907 +1,ӽ. +SgitFtdcTraderApi.h +virtual int InitLog(TThostFtdcBoolType bLog=TRUE) = 0; +޸Ϊ +virtual int InitLog(TThostFtdcBoolType bLog=TRUE) = 0; + +virtual int IsReviveNtyCapital(TThostFtdcBoolType bRecive=1) = 0; +޸Ϊ +virtual int IsReviveNtyCapital(TThostFtdcBoolType bRecive=1) = 0; diff --git a/include/Sgit/linux64/libsgitquotapi.so.64 b/include/Sgit/linux64/libsgitquotapi.so.64 new file mode 100644 index 0000000..91dd363 Binary files /dev/null and b/include/Sgit/linux64/libsgitquotapi.so.64 differ diff --git a/include/Sgit/linux64/libsgittradeapi.so.64 b/include/Sgit/linux64/libsgittradeapi.so.64 new file mode 100644 index 0000000..8a5fdac Binary files /dev/null and b/include/Sgit/linux64/libsgittradeapi.so.64 differ diff --git a/include/Sgit/win32/sgitquotapi.dll b/include/Sgit/win32/sgitquotapi.dll new file mode 100644 index 0000000..63a0e93 Binary files /dev/null and b/include/Sgit/win32/sgitquotapi.dll differ diff --git a/include/Sgit/win32/sgitquotapi.lib b/include/Sgit/win32/sgitquotapi.lib new file mode 100644 index 0000000..e21aee8 Binary files /dev/null and b/include/Sgit/win32/sgitquotapi.lib differ diff --git a/include/Sgit/win32/sgittradeapi.dll b/include/Sgit/win32/sgittradeapi.dll new file mode 100644 index 0000000..f4daef8 Binary files /dev/null and b/include/Sgit/win32/sgittradeapi.dll differ diff --git a/include/Sgit/win32/sgittradeapi.lib b/include/Sgit/win32/sgittradeapi.lib new file mode 100644 index 0000000..1ce5887 Binary files /dev/null and b/include/Sgit/win32/sgittradeapi.lib differ diff --git a/include/Tdx/Log.h b/include/Tdx/Log.h new file mode 100644 index 0000000..3e76afb --- /dev/null +++ b/include/Tdx/Log.h @@ -0,0 +1,155 @@ +#pragma once + +#include "stdafx.h" +/** +* 用于输出log文件的类. +*/ + + +#ifndef LOG_H +#define LOG_H + + +//log文件路径 +#define LOG_FILE_NAME "log.txt" + +//启用开关 +#define LOG_ENABLE + +#include +#include +#include +#include + +//#include "Toolkit.h" + +using namespace std; + +class CLog +{ +public: + static void GetLogFilePath(CHAR* szPath) + { + GetModuleFileNameA(NULL, szPath, MAX_PATH); + ZeroMemory(strrchr(szPath, '\\'), strlen(strrchr(szPath, '\\'))*sizeof(CHAR)); + strcat(szPath, "\\"); + strcat(szPath, LOG_FILE_NAME); + + //char szPath[MAX_PATH] = { 0 }; + //char drive[_MAX_DRIVE]; + //char dir[_MAX_DIR]; + //_splitpath(szPath, drive, dir, NULL, NULL); + + //_makepath(szPath, drive, dir, LOG_FILE_NAME, NULL); + } + + static void Reset() + { + CHAR szPath[MAX_PATH] = { 0 }; + GetLogFilePath(szPath); + + ofstream fout(szPath, ios::trunc); + fout.close(); + } + + //输出一个内容,可以是字符串(ascii)、整数、浮点数、布尔、枚举 + //格式为:[2011-11-11 11:11:11] aaaaaaa并换行 + template + static void WriteLog(T x) + { + CHAR szPath[MAX_PATH] = { 0 }; + GetLogFilePath(szPath); + + // 配合一下,输出到DOS中 + cout << GetSystemTime() << x << endl; + + ofstream fout(szPath, ios::app); + fout.seekp(ios::end); + //fout << GetSystemTime() << x << endl; + + // 写文件时使用密文 + //char buf[1024] = { 0 }; + //endecrypt((char*)x, buf, 1); + //fout << buf << endl; + + fout << x << endl; + + fout.close(); + } + + //输出2个内容,以等号连接。一般用于前面是一个变量的描述字符串,后面接这个变量的值 + template + static void WriteLog2(T1 x1, T2 x2) + { + CHAR szPath[MAX_PATH] = { 0 }; + GetLogFilePath(szPath); + ofstream fout(szPath, ios::app); + fout.seekp(ios::end); + fout << GetSystemTime() << x1 << " = " << x2 << endl; + fout.close(); + } + + //输出一行当前函数开始的标志,宏传入__FUNCTION__ + template + static void WriteFuncBegin(T x) + { + CHAR szPath[MAX_PATH] = { 0 }; + GetLogFilePath(szPath); + ofstream fout(szPath, ios::app); + fout.seekp(ios::end); + fout << GetSystemTime() << " --------------------" << x << " Begin--------------------" << endl; + fout.close(); + } + + //输出一行当前函数结束的标志,宏传入__FUNCTION__ + template + static void WriteFuncEnd(T x) + { + CHAR szPath[MAX_PATH] = { 0 }; + GetLogFilePath(szPath); + ofstream fout(szPath, ios::app); + fout.seekp(ios::end); + fout << GetSystemTime() << "--------------------" << x << " End --------------------" << endl; + fout.close(); + } + + +private: + //获取本地时间,格式如"[2011-11-11 11:11:11] "; + static string GetSystemTime() + { + time_t tNowTime; + time(&tNowTime); + tm* tLocalTime = localtime(&tNowTime); + char szTime[30] = { '\0' }; + strftime(szTime, 30, "[%Y-%m-%d %H:%M:%S] ", tLocalTime); + string strTime = szTime; + return strTime; + } + +}; + +#ifdef LOG_ENABLE + +#define LOG_RESET CLog::Reset(); //括号内可以是字符串(ascii)、整数、浮点数、bool等 + +//用下面这些宏来使用本文件 +#define LOG(x) CLog::WriteLog(x); //括号内可以是字符串(ascii)、整数、浮点数、bool等 +#define LOG2(x1,x2) CLog::WriteLog2(x1,x2); +#define LOG_FUNC LOG(__FUNCTION__) //输出当前所在函数名 +#define LOG_LINE LOG(__LINE__) //输出当前行号 +#define LOG_FUNC_BEGIN CLog::WriteFuncBegin(__FUNCTION__); //形式如:[时间]"------------FuncName Begin------------" +#define LOG_FUNC_END CLog::WriteFuncEnd(__FUNCTION__); //形式如:[时间]"------------FuncName End------------" + +#else + +#define LOG(x) +#define LOG2(x1,x2) +#define LOG_FUNC +#define LOG_LINE +#define LOG_FUNC_BEGIN +#define LOG_FUNC_END + +#endif + +#endif \ No newline at end of file diff --git a/include/Tdx/TdxApi.h b/include/Tdx/TdxApi.h index b12d158..44d4e62 100644 --- a/include/Tdx/TdxApi.h +++ b/include/Tdx/TdxApi.h @@ -17,48 +17,50 @@ #include "tdx_request.h" #include "tdx_field.h" + +class CTdxApi; + +class CTdxSpi +{ +public: + virtual void OnResponse(CTdxApi* pApi, RequestResponse_STRUCT* pRespone){}; +}; + +////////////////////////////////////////////////////////////////////////// +//支持同券商多账号登录、下单、撤单 class TDXAPI_API CTdxApi { public: // 创建API - // TdxPath*:通达信安装目录,需以"\\"结束。 - static CTdxApi* CreateApi(const char* TdxPath); + static CTdxApi* CreateApi(); virtual void Release() = 0; public: - virtual void LoadScript(const char* LuaFileOrString, bool bFileOrString, bool bEncrypted) = 0; + virtual void RegisterSpi(CTdxSpi *pSpi) = 0; + virtual void LoadScript(const char* LuaFileOrString, bool bFileOrString, bool bEncrypted) = 0; + // TdxPath*:通达信安装目录,需以"\\"结束。 virtual void Init(const char* TdxPath, Error_STRUCT** ppErr) = 0; virtual void Exit() = 0; - virtual void* Login(const char* szAccount, const char* szPassword, const char* szCode, char*** pppResults, Error_STRUCT** ppErr) = 0; + virtual void* Login(const char* szAccount, const char* szPassword, const char* szCode, Error_STRUCT** ppErr) = 0; virtual void Logout(void* client) = 0; public: // 弹出通达信内部的版本对话框 virtual void Version() = 0; - // 下单时必须指定股东代码,所以需要先查询股东列表才能实现下单。下单时会进行授权查询,失败时不会发单出去 - virtual int SendMultiOrders(Order_STRUCT* pOrders, int count, FieldInfo_STRUCT*** pppFieldInfos, char*** pppResults, Error_STRUCT*** pppErrs) = 0; - virtual int SendMultiOrders(Order_STRUCT** ppOrders, int count, FieldInfo_STRUCT*** pppFieldInfos, char*** pppResults, Error_STRUCT*** pppErrs) = 0; + virtual int GetTableHeader(void* client, int request, FieldInfo_STRUCT*** pppResults) = 0; + virtual bool IsLogined(void* client) = 0; - virtual int CancelMultiOrders(Order_STRUCT* pOrders, int count, FieldInfo_STRUCT*** pppFieldInfos, char*** pppResults, Error_STRUCT*** pppErrs) = 0; - virtual int CancelMultiOrders(Order_STRUCT** ppOrders, int count, FieldInfo_STRUCT*** pppFieldInfos, char*** pppResults, Error_STRUCT*** pppErrs) = 0; - // 发送查询请求 - // 有些请求是当日数据,后面的起始和结束日期自动忽略 - // 对于历史数据,需要查询的区别,格式“yyyyMMdd”,客户端上有60天或90天的时间限制,这里没有,但如果数据太多,间隔设成一周或一月 - // 订阅行情时只需要最后的股票代码 - virtual void* ReqQueryData(int requestType, FieldInfo_STRUCT*** pppFieldInfos, char*** pppResults, Error_STRUCT** ppErr, char * szKSRQ = "", char* szZZRQ = "", char* szZQDM = "") = 0; + virtual int SendRequest(RequestResponse_STRUCT* pRequest) = 0; -public: - // 设置会话 - virtual void SetClient(void* client) = 0; - - virtual void* GetClient() = 0; - // 设置资金账号 - virtual void SetAccount(const char* szAccount) = 0; - // 得到资金账号 - virtual const char* GetAccount() = 0; + virtual RequestResponse_STRUCT* MakeQueryData(ReqQueryData_STRUCT* query) = 0; + + virtual RequestResponse_STRUCT* MakeOrder(Order_STRUCT* pOrder) = 0; + // 撤单 + virtual RequestResponse_STRUCT* MakeCancelOrder(CancelOrder_STRUCT* pCancelOrder) = 0; + virtual RequestResponse_STRUCT* MakeCancelOrder(WTLB_STRUCT* pOrder) = 0; protected: CTdxApi(); diff --git a/include/Tdx/tdx_enum.h b/include/Tdx/tdx_enum.h index 67fa276..9a98152 100644 --- a/include/Tdx/tdx_enum.h +++ b/include/Tdx/tdx_enum.h @@ -3,44 +3,71 @@ #ifndef _TDX_ENUM_H_ #define _TDX_ENUM_H_ -#define COL_EACH_ROW (64) //每行多少例,相当重要 +#include "tdx_request.h" // 125_帐号类别 +// 37 期权 +// 40 沪港通 +// 603_交易类型 +#define JYLX_Creation 0 // ETF申购 +#define JYLX_Redemption 1 // ETF赎回 +#define MMBZ_ETF_Creation JYLX_Creation // ETF申购 +#define MMBZ_ETF_Redemption JYLX_Redemption // ETF赎回 // 130_买卖标志 // 下单时使用买卖标志来指定报单类型 // 查询时,单子只简单的表示了买卖方向,是否要启用委托类别? -#define MMBZ_Buy_Limit 0 // 限价买 -#define MMBZ_Sell_Limit 1 // 限价卖 +#define MMBZ_Buy_Limit 0 // 限价买, 204下:可转债转股 +#define MMBZ_Sell_Limit 1 // 限价卖, 204下:债券回售 #define MMBZ_Cancel 2 // 撤买/撤卖 -#define MMBZ_3 3 // 融券 +#define MMBZ_Buy_Cancel 3 // 撤买,没有测的 +#define MMBZ_Sell_Cancel 4 // 撤卖,信达证券结果 +#define MMBZ_Merge 12 // 基金合并 +#define MMBZ_Split 13 // 基金分拆 +#define MMBZ_Buy_DBP 15 // 担保品买入 +#define MMBZ_Sell_DBP 16 // 担保品卖出 +#define MMBZ_Sell_RQ_ZRT 24 // 转融通融券卖出 +#define MMBZ_Buy_HQ_ZRT 34 // 转融通买券还券 +#define MMBZ_XQ_HQ_ZRT 36 // 转融通现券还券 #define MMBZ_Buy_Market 67 // 市价买 #define MMBZ_Sell_Market 68 // 市价卖 +#define MMBZ_Buy_RZ 69 // 融资买入 +#define MMBZ_Sell_RQ 70 // 融券卖出 +#define MMBZ_Buy_HQ 71 // 买券还券 +#define MMBZ_XQ_HQ 73 // 现券还券 +#define MMBZ_DBP_HZ 74 // 担保品划转 +#define MMBZ_XJ_HK 75 // 现金还款 +#define MMBZ_Sell_HK 76 // 卖券还款 #define MMBZ_Creation 79 // 基金申购 #define MMBZ_Redemption 80 // 基金赎回 -#define MMBZ_Merge 12 // 基金合并 -#define MMBZ_Split 13 // 基金分拆 +#define MMBZ_86 86 // 权证行权 + +// 131_委托类别,这是自己定定义的,用来将字符串转成数字 +#define WTLB_Buy REQUEST_WT*100+ MMBZ_Buy_Limit // 买入 +#define WTLB_Sell REQUEST_WT*100+ MMBZ_Sell_Limit // 卖出 +#define WTLB_Buy_Cancel REQUEST_WT*100+ 2 // 撤买 +#define WTLB_Sell_Cancel REQUEST_WT*100+ 3 // 撤卖 +#define WTLB_LOFCreation REQUEST_WT*100+ MMBZ_Creation // 基金申购 +#define WTLB_LOFRedemption REQUEST_WT*100+ MMBZ_Redemption // 基金赎回 +#define WTLB_ETFCreation REQUEST_ETF_SGSH*100+ MMBZ_ETF_Creation // ETF申购 +#define WTLB_ETFRedemption REQUEST_ETF_SGSH*100+ MMBZ_ETF_Redemption // ETF赎回 +#define WTLB_Merge REQUEST_WT*100+ MMBZ_Merge // 合并 +#define WTLB_Split REQUEST_WT*100+ MMBZ_Split // 分拆 + +#define MMBZ_CB_Conv 0 // 204下:可转债转股 +#define MMBZ_CB_Red 1 // 204下:债券回售 + + + // 5565_委托类别 #define WTLB_MM 0; // 买卖 #define WTLB_CD 1; // 撤单 -// 131_委托类别 -// 3|投票 -// 3|融券 -// 0|买入 -// 1|卖出 // 166_委托方式 // 上海只有046,深圳只有012345,所以市价只发4最简单 -// 0 限1,买卖 -// 1 对 -// 2 本 -// 3 剩 撤 -// 4 五 撤 -// 5 全 撤 -// 6 转 #define WTFS_Limit 0 // 限价,限价委托,买卖 #define WTFS_Best_Reverse 1 // 对手方最优价格委托,对方最优价格,对手方最优价格委托, #define WTFS_Best_Forward 2 // 本方最优价格委托,本方最优价格,本方最优价格委托, @@ -49,7 +76,18 @@ #define WTFS_FOK 5 // 全额成交或撤销委托,全额成交或撤销,全额成交或撤销委托, #define WTFS_Five_Limit 6 // 五档即时成交剩余转限,五档即成转限价,最优五档即时成交剩余转限价委托, +#define WTFS_HRXYZH 0 // 划入信用账户 +#define WTFS_HCXYZH 1 // 划出信用账户 + +#define WTFS_ZQXJP 2 // 增强限价盘 +#define WTFS_JJXJP 3 // 竞价限价盘 +// 113_操作标志 +#define CZBZ_Open 1 // 开仓 +#define CZBZ_Close 2 // 平仓 +#define CZBZ_3 3 // ? +#define CZBZ_Lock 4 // 锁定 +#define CZBZ_Unlock 5 // 解锁 // 281_融资融券标识 #define RZRQBS_NO 0 // 非融资融券 @@ -63,9 +101,10 @@ #define ZTSM_4 4 // #define ZTSM_PartiallyFilled 5 // 5-部分成交 #define ZTSM_AllFilled 6 // 6-全部成交,已成,全部成交 -#define ZTSM_PartiallyCancelled 7 // 部撤,这是猜的,需要以后修正 +#define ZTSM_PartiallyCancelled 7 // 7-部成部撤,部撤 #define ZTSM_AllCancelled 8 // 8-全部撤单,已撤,全部撤单 #define ZTSM_CancelRejected 9 // 9-撤单未成 只会出现撤单记录中 +#define ZTSM_WaitingForReport 10 // 10-等待人工申报 // 已成,部成,废单,已撤,部撤 diff --git a/include/Tdx/tdx_field.h b/include/Tdx/tdx_field.h index 9a4bcf5..9754752 100644 --- a/include/Tdx/tdx_field.h +++ b/include/Tdx/tdx_field.h @@ -7,6 +7,7 @@ ID一样,中文名可能不一样 */ +#define FIELD_CZSJ 50 // 50_(参数)操作数据 #define FIELD_JYSDM 100 // 100_交易所代码 #define FIELD_JYSMC 101 // 101_交易所名称 #define FIELD_WTFS_110 110 // 110_委托方式 @@ -39,13 +40,19 @@ ID一样,中文名可能不一样 #define FIELD_CJSJ 151 // 151_成交时间 #define FIELD_CJSL 152 // 152_成交数量 #define FIELD_CJJG 153 // 153_成交价格 +#define FIELD_CJJE 154 // 154_成交金额 #define FIELD_CJBH 155 // 155_成交编号 #define FIELD_DJSL 160 // 160_冻结数量 #define FIELD_DJZJ 161 // 161_冻结资金 #define FIELD_CDSL 162 // 162_撤单数量 +#define FIELD_164 164 // 164_ +#define FIELD_165 165 // 165_ #define FIELD_WTFS 166 // 166_委托方式 #define FIELD_CDBZ 167 // 167_撤单标志 #define FIELD_168 168 // ? +#define FIELD_PHRQ 170 // 170_配号日期 +#define FIELD_QSPH 171 // 171_起始配号 +#define FIELD_PHSL 172 // 172_配号数量 #define FIELD_XWDM 173 // 173_席位代码 #define FIELD_ZXJYGS 187 // 187_最小交易股数 #define FIELD_BJFS 194 // 194_报价方式 @@ -65,6 +72,8 @@ ID一样,中文名可能不一样 #define FIELD_SXYK 232 // 232_实现盈亏 #define FIELD_LX 234 // 234_类型 #define FIELD_ZHZT 238 // 238_帐户状态 +#define FIELD_DFGDDM 244 // 244_对方股东代码 +#define FIELD_DFZHLB 245 // 245_对方帐号类别 #define FIELD_RZRQBS 281 // 281_融资融券标识 #define FIELD_FJZH 294 // 294_附加账号 #define FIELD_ZJYE 300 // 300_资金余额 @@ -77,6 +86,7 @@ ID一样,中文名可能不一样 #define FIELD_FNLX 333 // 333_方案类型 #define FIELD_ZZC_350 350 // 350_总资产 #define FIELD_CPDM 391 // 391_产品代码 +#define FIELD_FXJG 418 // 418_发行价格 #define FIELD_TJRDM 485 // 485_推荐人代码 #define FIELD_HYDM 510 // 510_合约代码 #define FIELD_HYMC 511 // 511_合约名称 @@ -84,15 +94,23 @@ ID一样,中文名可能不一样 #define FIELD_TBBZ 514 // 514_投保标志 #define FIELD_JGYF 540 // 540_交割月份 #define FIELD_BZJ 541 // 541_保证金 +#define FIELD_ETFDM 601 // 601_ETF代码 +#define FIELD_JYLX 603 // 603_交易类型 +#define FIELD_RGSL 604 // 604_认购数量 #define FIELD_PCH 606 // 606_批次号 #define FIELD_FXD 700 // 700_风险度 #define FIELD_718 718 // ? +#define FIELD_ZGSL 961 // 961_最高数量 +#define FIELD_SGED_961 961 // 961_申购额度,在申万宏源中居然也是961 +#define FIELD_ZDSL 962 // 962_最低数量 #define FIELD_QSXH 1207 // 1207_起始序号 #define FIELD_BLXX 1213 // 1213_保留信息 #define FIELD_JCFXBZ 1223 // 1223_检查风险标志 -#define FIELD_BZ_1217 1217 // 1217_备注 +#define FIELD_BZ_1217 1217 // 1217_备注 感觉是给当成备兑用了 +#define FIELD_FJYZHBZ 1224 // 1224_非交易帐号标志 #define FIELD_CS 1227 // 1227_参数 #define FIELD_XSYS 1231 // 1231_显示颜色 +#define FIELD_JB 1233 // 1233_句柄 #define FIELD_KHQZ 5250 // 5250_客户群组 #define FIELD_KHYYB 5251 // 5251_客户营业部 @@ -102,17 +120,26 @@ ID一样,中文名可能不一样 #define FIELD_HHH 5255 // 5255_会话号 #define FIELD_KHDM 5256 // 5256_客户代码 +#define FIELD_XGSGED_5564 5564 // 5564_新股申购额度 #define FIELD_WTLB_5565 5565 // 5565_委托类别 #define FIELD_JSHL 5599 // 5599_结算汇率 #define FIELD_JYF 5630 // 5630_交易费 #define FIELD_DSGF 5638 // 5638_代收规费 #define FIELD_GYWTBS 5639 // 5639_隔夜委托标识 +#define FIELD_FXRQ_5653 5653 // 5653_发行日期 #define FIELD_ZZHBH 5673 // 5673_子账户编号 #define FIELD_JSJG 5674 // 5674_结算机构 #define FIELD_JSZH 5675 // 5675_结算账号 #define FIELD_DJRQ 5676 // 5676_登记日期 - +#define FIELD_XGSGED_5679 5679 // 5679_新股申购额度 +#define FIELD_XGSGED_5718 5718 // 5718_新股申购额度 +#define FIELD_KHSZED_5759 5759 // 5759_客户市值额度 +#define FIELD_KHSZED 5771 // 5771_客户市值额度 +#define FIELD_ZHED 5772 // 5772_账户额度 +#define FIELD_KSGED 5801 // 5801_可申购额度 +#define FIELD_SGSX 5905 // 5905_申购上限 +#define FIELD_FXRQ_5906 5906 // 5906_发行日期 #define FIELD_YMTZH 5925 // 5925_一码通账号 #define FIELD_MMFX 5935 // 5935_买卖方向 #define FIELD_BJFS_6027 6027 // 6027_报价方式 diff --git a/include/Tdx/tdx_function.cpp b/include/Tdx/tdx_function.cpp index 8118292..7e95b1e 100644 --- a/include/Tdx/tdx_function.cpp +++ b/include/Tdx/tdx_function.cpp @@ -12,7 +12,6 @@ using namespace std; #ifdef TDXAPI_EXPORTS - /* 注意:以下代码只是几个数据表的读写方式,当做示例使用 此cpp请不要添加到项目中,而是只添加h文件 @@ -21,14 +20,6 @@ using namespace std; */ -void GetUpdateTime_HH_mm_ss(char* UpdateTime, int* _HH, int* _mm, int* _ss) -{ - *_HH = atoi(&UpdateTime[0]); - *_mm = atoi(&UpdateTime[3]); - *_ss = atoi(&UpdateTime[6]); -} - - void PrintTableHeader(FieldInfo_STRUCT** ppHeader) { if (ppHeader == nullptr) @@ -48,24 +39,6 @@ void PrintTableHeader(FieldInfo_STRUCT** ppHeader) printf("\n"); } -void OutputCSVTableHeader(FILE* pFile, FieldInfo_STRUCT** ppHeader) -{ - if (ppHeader == nullptr || pFile == nullptr) - return; - - int i = 0; - FieldInfo_STRUCT* pRow = ppHeader[i]; - while (pRow != 0) - { - char buf[512] = { 0 }; - fprintf(pFile,"%d_%s,",//"%d,%s,%d,%d,%d,%d,%d", - pRow->FieldID, pRow->FieldName, pRow->a, pRow->b, pRow->Len, pRow->d, pRow->e); - - ++i; - pRow = ppHeader[i]; - } - fprintf(pFile, "\n"); -} FieldInfo_STRUCT** CopyTableHeader(FieldInfo_STRUCT** ppHeader) { @@ -78,7 +51,6 @@ FieldInfo_STRUCT** CopyTableHeader(FieldInfo_STRUCT** ppHeader) for (int i = 0; i < count;++i) { - //ppNew[i] = ppHeader[i]; ppNew[i] = new FieldInfo_STRUCT; memcpy(ppNew[i], ppHeader[i], sizeof(FieldInfo_STRUCT)); } @@ -90,9 +62,6 @@ void DeleteTableHeader(FieldInfo_STRUCT** ppHeader) if (ppHeader == nullptr) return; - //原有创建方法是一个连续区域,使用时容易出错 - //delete[] ppHeader; - int i = 0; while (ppHeader[i] != 0) { @@ -215,61 +184,6 @@ void PrintTableBody(char** ppTable, int count) return; } -void OutputCSVTableBody(FILE* pFile, char** ppTable) -{ - if (ppTable == nullptr || pFile == nullptr) - return; - - // 如果有数据,第一列就不为空 - int i = 0; - int j = 0; - char* p = ppTable[i * COL_EACH_ROW + j]; - while (p != nullptr) - { - //printf("%d:", i); - for (j = 0; j < COL_EACH_ROW; ++j) - { - p = ppTable[i * COL_EACH_ROW + j]; - if (p) - { - fprintf(pFile, "%s,", p); - } - else - break; - } - fprintf(pFile, "\n"); - j = 0; - ++i; - p = ppTable[i * COL_EACH_ROW + j]; - } - - return; -} - -void OutputCSVTableBody(FILE* pFile, char** ppTable, int count) -{ - if (ppTable == nullptr || pFile == nullptr) - return; - - for (int i = 0; i < count; ++i) - { - //printf("%d:", i); - for (int j = 0; j < COL_EACH_ROW; ++j) - { - char* p = ppTable[i * COL_EACH_ROW + j]; - if (p) - { - fprintf(pFile, "%s,", p); - - } - else - break; - } - fprintf(pFile, "\n"); - } - - return; -} // 得到某一行某一列 char* GetAtTableBody(char** ppTable, int row, int col) @@ -397,50 +311,6 @@ void PrintErrors(Error_STRUCT** pErrs, int count) } } -void OutputCSVError(FILE* pFile, Error_STRUCT* pErr) -{ - if (pErr == nullptr) - { - return; - } - - fprintf(pFile, "%d,%d,%s\n", pErr->ErrType, pErr->ErrCode, pErr->ErrInfo); -} - -void OutputCSVErrors(FILE* pFile, Error_STRUCT** pErrs) -{ - if (pErrs == nullptr) - return; - - int i = 0; - Error_STRUCT* pErr = pErrs[i]; - while (pErr != nullptr) - { - fprintf(pFile, "%d:%d,%d,%s\n", i, pErr->ErrType, pErr->ErrCode, pErr->ErrInfo); - - ++i; - pErr = pErrs[i]; - } -} - -void OutputCSVErrors(FILE* pFile, Error_STRUCT** pErrs, int count) -{ - if (pErrs == nullptr) - { - return; - } - - for (int i = 0; i < count; ++i) - { - Error_STRUCT* pErr = pErrs[i]; - if (pErr) - { - fprintf(pFile, "%d:%d,%d,%s\n", i, pErr->ErrType, pErr->ErrCode, pErr->ErrInfo); - } - else - fprintf(pFile, "\n"); - } -} void DeleteError(Error_STRUCT* pErr) { @@ -493,96 +363,7 @@ int GetCountErrors(Error_STRUCT** pErrs) ////////////////////////////////////////////////////////////////////////// -int ZTSM_str_2_int(char* pIn) -{ - char* pCheng = strstr(pIn, "成"); - char* pChe = strstr(pIn, "撤"); - char* pBu = strstr(pIn, "部"); - - if (pChe) - { - if (pBu) - { - return ZTSM_PartiallyCancelled; - } - return ZTSM_AllCancelled; - } - else if (pCheng) - { - if (pBu) - { - // 部成是啥?这里需要完成 - return ZTSM_PartiallyFilled; - } - return ZTSM_AllFilled; - } - - char* pQ = strstr(pIn, "全"); - char* pY = strstr(pIn, "已"); - char* pBao = strstr(pIn, "报"); - char* pF = strstr(pIn, "废"); - - if (pF) - { - return ZTSM_Illegal; - } - - return ZTSM_New; -} - -// 将中文的报价方式转成委托方式,这是根据字符串的特点进行分类 -int BJFS_2_WTFS(char* pIn) -{ - char* pX1 = strstr(pIn, "限"); - - if (pX1 == pIn) - { - // 第一个字是限价 - return WTFS_Limit; - } - else - { - char* pMM = strstr(pIn, "买卖"); - if (pMM) - { - // 华泰返回买卖是表示限价 - return WTFS_Limit; - } - char* pC = strstr(pIn, "撤"); - if (pC) - { - char* p5 = strstr(pIn, "五"); - if (p5) - { - return WTFS_Five_IOC; - } - char* pQ = strstr(pIn, "全"); - if (pQ) - { - return WTFS_FOK; - } - return WTFS_IOC; // 剩 - } - else - { - char* pZ = strstr(pIn, "转"); - if (pZ) - { - return WTFS_Five_Limit; - } - char* pD = strstr(pIn, "对"); - if (pD) - { - return WTFS_Best_Reverse; - } - return WTFS_Best_Forward; // 本 - } - } -} - -////////////////////////////////////////////////////////////////////////// - -void CharTable2GDLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GDLB_STRUCT*** pppResults) +void CharTable2GDLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GDLB_STRUCT*** pppResults, void* Client) { *pppResults = nullptr; if (ppTable == nullptr) @@ -596,317 +377,573 @@ void CharTable2GDLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GDLB_STRUCT ppResults[count] = nullptr; *pppResults = ppResults; - int col_123 = GetIndexByFieldID(ppFieldInfos, FIELD_GDDM); - int col_124 = GetIndexByFieldID(ppFieldInfos, FIELD_GDMC); - int col_125 = GetIndexByFieldID(ppFieldInfos, FIELD_ZHLB); - int col_121 = GetIndexByFieldID(ppFieldInfos, FIELD_ZJZH); - int col_173 = GetIndexByFieldID(ppFieldInfos, FIELD_XWDM); - int col_281 = GetIndexByFieldID(ppFieldInfos, FIELD_RZRQBS); - int col_1213 = GetIndexByFieldID(ppFieldInfos, FIELD_BLXX); - for (int i = 0; i < count; ++i) { ppResults[i] = new GDLB_STRUCT(); - //if (col_123 >= 0) - strcpy_s(ppResults[i]->GDDM, ppTable[i * COL_EACH_ROW + col_123]); - //if (col_124 >= 0) - strcpy_s(ppResults[i]->GDMC, ppTable[i * COL_EACH_ROW + col_124]); - if (col_121 >= 0) - strcpy_s(ppResults[i]->ZJZH, ppTable[i * COL_EACH_ROW + col_121]); - //if (col_125 >= 0) - strcpy_s(ppResults[i]->ZHLB, ppTable[i * COL_EACH_ROW + col_125]); - if (col_173 >= 0) - strcpy_s(ppResults[i]->XWDM, ppTable[i * COL_EACH_ROW + col_173]); - if (col_281 >= 0) - strcpy_s(ppResults[i]->RZRQBS, ppTable[i * COL_EACH_ROW + col_281]); - if (col_1213 >= 0) - strcpy_s(ppResults[i]->BLXX, ppTable[i * COL_EACH_ROW + col_1213]); + int j = 0; + FieldInfo_STRUCT* pRow = ppFieldInfos[j]; + while (pRow != 0) + { + char* t = ppTable[i * COL_EACH_ROW + j]; + switch (pRow->FieldID) + { + case FIELD_GDDM: + strcpy_s(ppResults[i]->GDDM, t); + break; + case FIELD_GDMC: + strcpy_s(ppResults[i]->GDMC, t); + break; + case FIELD_ZHLB: + strcpy_s(ppResults[i]->ZHLB, t); + break; + case FIELD_ZJZH: + strcpy_s(ppResults[i]->ZJZH, t); + break; + case FIELD_XWDM: + strcpy_s(ppResults[i]->XWDM, t); + break; + case FIELD_RZRQBS: + strcpy_s(ppResults[i]->RZRQBS, t); + break; + case FIELD_BLXX: + strcpy_s(ppResults[i]->BLXX, t); + break; + } + + ++j; + pRow = ppFieldInfos[j]; + } ppResults[i]->ZHLB_ = atoi(ppResults[i]->ZHLB); ppResults[i]->RZRQBS_ = atoi(ppResults[i]->RZRQBS); + + ppResults[i]->Client = Client; } } - - -void CharTable2WTLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, WTLB_STRUCT*** pppResults) +void DeleteStructs(void*** pppStructs) { - *pppResults = nullptr; - if (ppTable == nullptr) + if (pppStructs == nullptr) return; - int count = GetRowCountTableBody(ppTable); - if (count <= 0) + if (*pppStructs == nullptr) return; - WTLB_STRUCT** ppResults = new WTLB_STRUCT*[count + 1](); - ppResults[count] = nullptr; - *pppResults = ppResults; - - int col_142 = GetIndexByFieldID(ppFieldInfos, FIELD_WTRQ); - int col_143 = GetIndexByFieldID(ppFieldInfos, FIELD_WTSJ); - int col_123 = GetIndexByFieldID(ppFieldInfos, FIELD_GDDM); - int col_140 = GetIndexByFieldID(ppFieldInfos, FIELD_ZQDM); - int col_141 = GetIndexByFieldID(ppFieldInfos, FIELD_ZQMC); - int col_130 = GetIndexByFieldID(ppFieldInfos, FIELD_MMBZ); - int col_131 = GetIndexByFieldID(ppFieldInfos, FIELD_WTLB); - int col_100 = GetIndexByFieldID(ppFieldInfos, FIELD_JYSDM); - int col_145 = GetIndexByFieldID(ppFieldInfos, FIELD_WTJG); - int col_144 = GetIndexByFieldID(ppFieldInfos, FIELD_WTSL); - int col_153 = GetIndexByFieldID(ppFieldInfos, FIELD_CJJG); - int col_152 = GetIndexByFieldID(ppFieldInfos, FIELD_CJSL); - int col_162 = GetIndexByFieldID(ppFieldInfos, FIELD_CDSL); - int col_146 = GetIndexByFieldID(ppFieldInfos, FIELD_WTBH); - int col_194 = GetIndexByFieldID(ppFieldInfos, FIELD_BJFS); - int col_147 = GetIndexByFieldID(ppFieldInfos, FIELD_ZTSM); - int col_161 = GetIndexByFieldID(ppFieldInfos, FIELD_DJZJ); - int col_1213 = GetIndexByFieldID(ppFieldInfos, FIELD_BLXX); + void** ppStructs = *pppStructs; - for (int i = 0; i < count; ++i) + int i = 0; + while (ppStructs[i] != 0) { - ppResults[i] = new WTLB_STRUCT(); - - if (col_142 >= 0) - strcpy_s(ppResults[i]->WTRQ, ppTable[i * COL_EACH_ROW + col_142]); - if (col_143 >= 0) - strcpy_s(ppResults[i]->WTSJ, ppTable[i * COL_EACH_ROW + col_143]); - //if (col_123 >= 0) - strcpy_s(ppResults[i]->GDDM, ppTable[i * COL_EACH_ROW + col_123]); - //if (col_140 >= 0) - strcpy_s(ppResults[i]->ZQDM, ppTable[i * COL_EACH_ROW + col_140]); - //if (col_141 >= 0) - strcpy_s(ppResults[i]->ZQMC, ppTable[i * COL_EACH_ROW + col_141]); - //if (col_130 >= 0) - strcpy_s(ppResults[i]->MMBZ, ppTable[i * COL_EACH_ROW + col_130]); - //if (col_131 >= 0) - strcpy_s(ppResults[i]->WTLB, ppTable[i * COL_EACH_ROW + col_131]); - //if (col_100 >= 0) - strcpy_s(ppResults[i]->JYSDM, ppTable[i * COL_EACH_ROW + col_100]); - //if (col_145 >= 0) - strcpy_s(ppResults[i]->WTJG, ppTable[i * COL_EACH_ROW + col_145]); - //if (col_144 >= 0) - strcpy_s(ppResults[i]->WTSL, ppTable[i * COL_EACH_ROW + col_144]); - //if (col_153 >= 0) - strcpy_s(ppResults[i]->CJJG, ppTable[i * COL_EACH_ROW + col_153]); - //if (col_152 >= 0) - strcpy_s(ppResults[i]->CJSL, ppTable[i * COL_EACH_ROW + col_152]); - if (col_162 >= 0) - strcpy_s(ppResults[i]->CDSL, ppTable[i * COL_EACH_ROW + col_162]); - //if (col_146 >= 0) - strcpy_s(ppResults[i]->WTBH, ppTable[i * COL_EACH_ROW + col_146]); - //if (col_194 >= 0) - strcpy_s(ppResults[i]->BJFS, ppTable[i * COL_EACH_ROW + col_194]); - if (col_147 >= 0) - strcpy_s(ppResults[i]->ZTSM, ppTable[i * COL_EACH_ROW + col_147]); - if (col_161 >= 0) - strcpy_s(ppResults[i]->DJZJ, ppTable[i * COL_EACH_ROW + col_161]); - if (col_1213 >= 0) - strcpy_s(ppResults[i]->BLXX, ppTable[i * COL_EACH_ROW + col_1213]); - - ppResults[i]->WTRQ_ = atoi(ppResults[i]->WTRQ); - ppResults[i]->MMBZ_ = atoi(ppResults[i]->MMBZ); - ppResults[i]->JYSDM_ = atoi(ppResults[i]->JYSDM); - ppResults[i]->WTJG_ = atof(ppResults[i]->WTJG); - ppResults[i]->WTSL_ = atoi(ppResults[i]->WTSL); - ppResults[i]->CJJG_ = atof(ppResults[i]->CJJG); - ppResults[i]->CJSL_ = atoi(ppResults[i]->CJSL); - ppResults[i]->DJZJ_ = atof(ppResults[i]->DJZJ); - - // 可能没有,怎么办 - ppResults[i]->CDSL_ = atoi(ppResults[i]->CDSL); - - int HH = 0, mm = 0, ss = 0; - GetUpdateTime_HH_mm_ss(ppResults[i]->WTSJ, &HH, &mm, &ss); - ppResults[i]->WTSJ_ = HH * 10000 + mm * 100 + ss; - - // 第一个的字符,并转成数字 - if (ppResults[i]->ZTSM[1] == '-') - { - ppResults[i]->ZTSM_ = ppResults[i]->ZTSM[0] - '0'; - } - else - { - ppResults[i]->ZTSM_ = ZTSM_str_2_int(ppResults[i]->ZTSM); - } + delete[] ppStructs[i]; + ppStructs[i] = nullptr; - ppResults[i]->BJFS_ = BJFS_2_WTFS(ppResults[i]->BJFS); + ++i; } + + delete[] ppStructs; + *pppStructs = nullptr; } -void CharTable2CJLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, CJLB_STRUCT*** pppResults) -{ - *pppResults = nullptr; - if (ppTable == nullptr) - return; - int count = GetRowCountTableBody(ppTable); - if (count <= 0) - return; +/* +6 +A74168961|WK |05000000100801|1| 0| | +013086113|WK |05000000100801|0| 0| | - CJLB_STRUCT** ppResults = new CJLB_STRUCT*[count + 1](); - ppResults[count] = nullptr; - *pppResults = ppResults; +7 +A12121217|ZHT|1| 40690000|28356| 0|主股东| +015597938|ZHT|0| 40690000|394232|0|主股东| - int col_150 = GetIndexByFieldID(ppFieldInfos, FIELD_CJRQ); - int col_151 = GetIndexByFieldID(ppFieldInfos, FIELD_CJSJ); - int col_123 = GetIndexByFieldID(ppFieldInfos, FIELD_GDDM); - int col_140 = GetIndexByFieldID(ppFieldInfos, FIELD_ZQDM); - int col_141 = GetIndexByFieldID(ppFieldInfos, FIELD_ZQMC); - int col_130 = GetIndexByFieldID(ppFieldInfos, FIELD_MMBZ); - int col_131 = GetIndexByFieldID(ppFieldInfos, FIELD_WTLB); - int col_153 = GetIndexByFieldID(ppFieldInfos, FIELD_CJJG); - int col_152 = GetIndexByFieldID(ppFieldInfos, FIELD_CJSL); - int col_303 = GetIndexByFieldID(ppFieldInfos, FIELD_FSJE); - int col_304 = GetIndexByFieldID(ppFieldInfos, FIELD_SYJE); - int col_206 = GetIndexByFieldID(ppFieldInfos, FIELD_YJ); - int col_210 = GetIndexByFieldID(ppFieldInfos, FIELD_YHS); - int col_207 = GetIndexByFieldID(ppFieldInfos, FIELD_GHF); - int col_208 = GetIndexByFieldID(ppFieldInfos, FIELD_CJF); - int col_155 = GetIndexByFieldID(ppFieldInfos, FIELD_CJBH); - int col_167 = GetIndexByFieldID(ppFieldInfos, FIELD_CDBZ); - int col_146 = GetIndexByFieldID(ppFieldInfos, FIELD_WTBH); +5 +A341083000|LK|1| |主股东| +0189181400|LK|0| |主股东| - for (int i = 0; i < count; ++i) - { - ppResults[i] = new CJLB_STRUCT(); - - if (col_150 >= 0) - strcpy_s(ppResults[i]->CJRQ, ppTable[i * COL_EACH_ROW + col_150]); - if (col_151 >= 0) - strcpy_s(ppResults[i]->CJSJ, ppTable[i * COL_EACH_ROW + col_151]); - //if (col_123 >= 0) - strcpy_s(ppResults[i]->GDDM, ppTable[i * COL_EACH_ROW + col_123]); - //if (col_140 >= 0) - strcpy_s(ppResults[i]->ZQDM, ppTable[i * COL_EACH_ROW + col_140]); - //if (col_141 >= 0) - strcpy_s(ppResults[i]->ZQMC, ppTable[i * COL_EACH_ROW + col_141]); - //if (col_130 >= 0) - strcpy_s(ppResults[i]->MMBZ, ppTable[i * COL_EACH_ROW + col_130]); - //if (col_131 >= 0) - strcpy_s(ppResults[i]->WTLB, ppTable[i * COL_EACH_ROW + col_131]); - //if (col_153 >= 0) - strcpy_s(ppResults[i]->CJJG, ppTable[i * COL_EACH_ROW + col_153]); - //if (col_152 >= 0) - strcpy_s(ppResults[i]->CJSL, ppTable[i * COL_EACH_ROW + col_152]); - if (col_303 >= 0) - strcpy_s(ppResults[i]->FSJE, ppTable[i * COL_EACH_ROW + col_303]); - if (col_304 >= 0) - strcpy_s(ppResults[i]->SYJE, ppTable[i * COL_EACH_ROW + col_304]); - if (col_206 >= 0) - strcpy_s(ppResults[i]->YJ, ppTable[i * COL_EACH_ROW + col_206]); - if (col_210 >= 0) - strcpy_s(ppResults[i]->YHS, ppTable[i * COL_EACH_ROW + col_210]); - if (col_207 >= 0) - strcpy_s(ppResults[i]->GHF, ppTable[i * COL_EACH_ROW + col_207]); - if (col_208 >= 0) - strcpy_s(ppResults[i]->CJF, ppTable[i * COL_EACH_ROW + col_208]); - //if (col_155 >= 0) - strcpy_s(ppResults[i]->CJBH, ppTable[i * COL_EACH_ROW + col_155]); - if (col_167 >= 0) - strcpy_s(ppResults[i]->CDBZ, ppTable[i * COL_EACH_ROW + col_167]); - if (col_146 >= 0) - strcpy_s(ppResults[i]->WTBH, ppTable[i * COL_EACH_ROW + col_146]); - - - ppResults[i]->CJRQ_ = atoi(ppResults[i]->CJRQ); - //ppResults[i]->CJSJ_ = atoi(ppResults[i]->CJSJ); - ppResults[i]->MMBZ_ = atoi(ppResults[i]->MMBZ); - ppResults[i]->WTLB_ = atoi(ppResults[i]->WTLB); - ppResults[i]->CJJG_ = atof(ppResults[i]->CJJG); - ppResults[i]->CJSL_ = atoi(ppResults[i]->CJSL); - ppResults[i]->SYJE_ = atof(ppResults[i]->SYJE); - ppResults[i]->YJ_ = atof(ppResults[i]->YJ); - ppResults[i]->YHS_ = atof(ppResults[i]->YHS); - ppResults[i]->GHF_ = atof(ppResults[i]->GHF); - ppResults[i]->CJF_ = atof(ppResults[i]->CJF); - ppResults[i]->CDBZ_ = atoi(ppResults[i]->CDBZ); - - // 可能没有 - ppResults[i]->FSJE_ = atof(ppResults[i]->FSJE); - - int HH = 0, mm = 0, ss = 0; - GetUpdateTime_HH_mm_ss(ppResults[i]->CJSJ, &HH, &mm, &ss); - ppResults[i]->CJSJ_ = HH * 10000 + mm * 100 + ss; - } -} +8 +E015976151|HT|1|88500918| 12982|1| |主股东| +0601605823|HT|0|88500918| 354000|1| |主股东| -void CharTable2GFLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GFLB_STRUCT*** pppResults) +8 +101313017766|0026087534|ZL|0| 304300|0|0|主股东| +101313017766|A511876656|ZL|1| 55005|0|0|主股东| +*/ +// 发现不准,从登录信息中猜测式解析不准,需要换一种方式 +void String2GDLB1(char* szString, GDLB_STRUCT*** pppResults, void* Client) { *pppResults = nullptr; - if (ppTable == nullptr) - return; - - int count = GetRowCountTableBody(ppTable); - if (count <= 0) + if (szString == nullptr) return; - GFLB_STRUCT** ppResults = new GFLB_STRUCT*[count + 1](); - ppResults[count] = nullptr; - *pppResults = ppResults; + char* pBuf = new char[strlen(szString) + 1]; + strcpy(pBuf, szString); - int col_140 = GetIndexByFieldID(ppFieldInfos, FIELD_ZQDM); - int col_141 = GetIndexByFieldID(ppFieldInfos, FIELD_ZQMC); - int col_200 = GetIndexByFieldID(ppFieldInfos, FIELD_ZQSL); - int col_201 = GetIndexByFieldID(ppFieldInfos, FIELD_KMSL); - int col_202 = GetIndexByFieldID(ppFieldInfos, FIELD_TBCBJ); - int col_949 = GetIndexByFieldID(ppFieldInfos, FIELD_DQJ); - int col_205 = GetIndexByFieldID(ppFieldInfos, FIELD_ZXSZ); - int col_204 = GetIndexByFieldID(ppFieldInfos, FIELD_TBFDYK); - int col_232 = GetIndexByFieldID(ppFieldInfos, FIELD_SXYK); - int col_230 = GetIndexByFieldID(ppFieldInfos, FIELD_CKYKBL); - int col_160 = GetIndexByFieldID(ppFieldInfos, FIELD_DJSL); - int col_123 = GetIndexByFieldID(ppFieldInfos, FIELD_GDDM); - int col_100 = GetIndexByFieldID(ppFieldInfos, FIELD_JYSDM); - int col_101 = GetIndexByFieldID(ppFieldInfos, FIELD_JYSMC); - int col_1213 = GetIndexByFieldID(ppFieldInfos, FIELD_BLXX); + vector vct; - for (int i = 0; i < count; ++i) + // 分好多少列 + char* token = strtok(pBuf, "\r\n"); + int i = 0; + while (token) { - ppResults[i] = new GFLB_STRUCT(); - - //if (col_140 >= 0) - strcpy_s(ppResults[i]->ZQDM, ppTable[i * COL_EACH_ROW + col_140]); - //if (col_141 >= 0) - strcpy_s(ppResults[i]->ZQMC, ppTable[i * COL_EACH_ROW + col_141]); - //if (col_200 >= 0) - strcpy_s(ppResults[i]->ZQSL, ppTable[i * COL_EACH_ROW + col_200]); - //if (col_201 >= 0) - strcpy_s(ppResults[i]->KMSL, ppTable[i * COL_EACH_ROW + col_201]); - //if (col_202 >= 0) - strcpy_s(ppResults[i]->TBCBJ, ppTable[i * COL_EACH_ROW + col_202]); - //if (col_949 >= 0) - strcpy_s(ppResults[i]->DQJ, ppTable[i * COL_EACH_ROW + col_949]); - //if (col_205 >= 0) - strcpy_s(ppResults[i]->ZXSZ, ppTable[i * COL_EACH_ROW + col_205]); - //if (col_204 >= 0) - strcpy_s(ppResults[i]->TBFDYK, ppTable[i * COL_EACH_ROW + col_204]); - if (col_232 >= 0) - strcpy_s(ppResults[i]->SXYK, ppTable[i * COL_EACH_ROW + col_232]); - if (col_230 >= 0) - strcpy_s(ppResults[i]->CKYKBL, ppTable[i * COL_EACH_ROW + col_230]); - if (col_160 >= 0) - strcpy_s(ppResults[i]->DJSL, ppTable[i * COL_EACH_ROW + col_160]); - //if (col_123 >= 0) - strcpy_s(ppResults[i]->GDDM, ppTable[i * COL_EACH_ROW + col_123]); - if (col_100 >= 0) - strcpy_s(ppResults[i]->JYSDM, ppTable[i * COL_EACH_ROW + col_100]); - if (col_101 >= 0) - strcpy_s(ppResults[i]->JYSMC, ppTable[i * COL_EACH_ROW + col_101]); - //if (col_1213 >= 0) - strcpy_s(ppResults[i]->BLXX, ppTable[i * COL_EACH_ROW + col_1213]); - - - ppResults[i]->ZQSL_ = atoi(ppResults[i]->ZQSL); - ppResults[i]->KMSL_ = atoi(ppResults[i]->KMSL); - ppResults[i]->TBCBJ_ = atof(ppResults[i]->TBCBJ); - ppResults[i]->DQJ_ = atof(ppResults[i]->DQJ); - ppResults[i]->ZXSZ_ = atof(ppResults[i]->ZXSZ); - ppResults[i]->DJSL_ = atof(ppResults[i]->DJSL); + if (i>0) + { + vct.push_back(token); + } + token = strtok(nullptr, "\r\n"); + ++i; + } + + int count = vct.size(); + + GDLB_STRUCT** ppResults = new GDLB_STRUCT*[count + 1](); + ppResults[count] = nullptr; + *pppResults = ppResults; + + for (int i = 0; i < count;++i) + { + ppResults[i] = new GDLB_STRUCT(); + + vector v1; + vector v2; + vector v3; + char* t = strtok(vct[i], "|"); + int j = 0; + while (t) + { + int len = strlen(t); + if (len == 1) + { + v2.push_back(t); + } + else if (len>0) + { + if (t[0]>127||t[0]<0) + { + v3.push_back(t); + } + else + { + v1.push_back(t); + } + } + t = strtok(nullptr, "|"); + } + + strcpy_s(ppResults[i]->GDDM, v1[0]); + if (v1.size() > 1) + strcpy_s(ppResults[i]->ZJZH, v1[1]); + if (v1.size() > 2) + strcpy_s(ppResults[i]->XWDM, v1[2]); + + strcpy_s(ppResults[i]->ZHLB, v2[0]); + if (v2.size() > 1) + strcpy_s(ppResults[i]->RZRQBS, v2[1]); + + if (v3.size()>0) + strcpy_s(ppResults[i]->GDMC, v3[0]); + if (v3.size()>1) + strcpy_s(ppResults[i]->BLXX, v3[1]); + + ppResults[i]->ZHLB_ = atoi(ppResults[i]->ZHLB); + ppResults[i]->RZRQBS_ = atoi(ppResults[i]->RZRQBS); + + ppResults[i]->Client = Client; + } + + delete[] pBuf; +} + +// 这种方式假定登录时的格式与直接查询的格式是完全一样的 +void String2GDLB2(FieldInfo_STRUCT** ppFieldInfos, char* szString, GDLB_STRUCT*** pppResults, void* Client, char* ZJZH) +{ + *pppResults = nullptr; + if (szString == nullptr) + return; + + char* pBuf = new char[strlen(szString) + 1]; + strcpy(pBuf, szString); + + vector vct; + + // 分好多少列 + char* token = strtok(pBuf, "\r\n"); + int i = 0; + while (token) + { + if (i>0) + { + vct.push_back(token); + } + token = strtok(nullptr, "\r\n"); + ++i; + } + + int count = vct.size(); + + GDLB_STRUCT** ppResults = new GDLB_STRUCT*[count + 1](); + ppResults[count] = nullptr; + *pppResults = ppResults; + + for (int i = 0; i < count; ++i) + { + ppResults[i] = new GDLB_STRUCT(); + + int header_count = GetCountTableHeader(ppFieldInfos); + + char* pLast = vct[i]; + char* pCurr = strstr(vct[i], "|"); + + for (int j = 0; j < header_count; ++j) + { + if (pCurr == nullptr) + break; + + *pCurr = 0; + char* t = pLast; + + FieldInfo_STRUCT* pRow = ppFieldInfos[j]; + switch (pRow->FieldID) + { + case FIELD_GDDM: + strcpy_s(ppResults[i]->GDDM, t); + break; + case FIELD_GDMC: + strcpy_s(ppResults[i]->GDMC, t); + break; + case FIELD_ZHLB: + strcpy_s(ppResults[i]->ZHLB, t); + break; + case FIELD_ZJZH: + strcpy_s(ppResults[i]->ZJZH, t); + // 银河证券会出现资金账号为空的情况,只能从其它地方获取 + if (strlen(t) <= 0) + { + strcpy_s(ppResults[i]->ZJZH, ZJZH); + } + break; + case FIELD_XWDM: + strcpy_s(ppResults[i]->XWDM, t); + break; + case FIELD_RZRQBS: + strcpy_s(ppResults[i]->RZRQBS, t); + break; + case FIELD_BLXX: + strcpy_s(ppResults[i]->BLXX, t); + break; + case FIELD_JB: + strcpy_s(ppResults[i]->JB, t); + default: + break; + } + + pLast = pCurr + 1; + pCurr = strstr(pLast, "|"); + } + + ppResults[i]->ZHLB_ = atoi(ppResults[i]->ZHLB); + ppResults[i]->RZRQBS_ = atoi(ppResults[i]->RZRQBS); + + ppResults[i]->Client = Client; + } + + delete[] pBuf; +} + +void String_148(FieldInfo_STRUCT** ppFieldInfos, char* szString, REQ148_STRUCT*** pppResults, void* Client) +{ + *pppResults = nullptr; + if (szString == nullptr) + return; + + char* pBuf = new char[strlen(szString) + 1]; + strcpy(pBuf, szString); + + vector vct; + + // 分好多少列 + char* token = strtok(pBuf, "\r\n"); + int i = 0; + while (token) + { + if (i>0) + { + vct.push_back(token); + } + token = strtok(nullptr, "\r\n"); + ++i; + } + + int count = vct.size(); + + REQ148_STRUCT** ppResults = new REQ148_STRUCT*[count + 1](); + ppResults[count] = nullptr; + *pppResults = ppResults; + + for (int i = 0; i < count; ++i) + { + ppResults[i] = new REQ148_STRUCT(); + + // 不用strtok是因为第1位,和空白位会丢失,导致数据处理错误 + int header_count = GetCountTableHeader(ppFieldInfos); + + char* pLast = vct[i]; + char* pCurr = strstr(vct[i], "|"); + + for (int j = 0; j < header_count; ++j) + { + // 国金,取出来的一条记录没有4个,只有3个 + if (pCurr == nullptr) + break; + + *pCurr = 0; + char* t = pLast; + + FieldInfo_STRUCT* pRow = ppFieldInfos[j]; + switch (pRow->FieldID) + { + case FIELD_KHH: + strcpy_s(ppResults[i]->CPZH, t); + break; + case FIELD_ZHLB: + strcpy_s(ppResults[i]->ZHLB, t); + break; + case FIELD_FJYZHBZ: + strcpy_s(ppResults[i]->FJYZHBZ, t); + break; + case FIELD_RZRQBS: + strcpy_s(ppResults[i]->RZRQBS, t); + break; + case FIELD_BLXX: + strcpy_s(ppResults[i]->BLXX, t); + break; + default: + break; + } + + pLast = pCurr + 1; + pCurr = strstr(pLast, "|"); + } + + ppResults[i]->Client = Client; + } + + delete[] pBuf; +} + +void CharTable2GDLB3(char* ppTable, GDLB_STRUCT*** pppResults, void* Client) +{ + *pppResults = nullptr; + if (ppTable == nullptr) + return; + +} + +void CharTable2Login(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GDLB_STRUCT*** pppResults, void* Client, FieldInfo_STRUCT** ppFieldInfos_148,char* CPZH) +{ + *pppResults = nullptr; + if (ppTable == nullptr) + return; + + bool bFind = false; + // 如果有数据,第一列就不为空 + int i = 0; + int j = 0; + char* p = ppTable[i * COL_EACH_ROW + j]; + + // 产品账号,即资金账号 + //char CPZH[32] = { 0 }; + while (p != nullptr) + { + int requstid = atoi(p); + // 银河证券没有资金账号,只有句柄,得想法转成资金账号 + if ((requstid == REQUEST_148 + 1) && (ppFieldInfos_148 != nullptr)) + { + // 这里假定句柄关系可以提前取到 + REQ148_STRUCT** ppRS = nullptr; + String_148(ppFieldInfos_148, ppTable[i * COL_EACH_ROW + 2], &ppRS, Client); + // 复制,然后清理 + int count = GetCountStructs((void**)ppRS); + if (count > 0) + { + strcpy(CPZH, ppRS[0]->CPZH); + } + + DeleteStructs((void***)&ppRS); + } + + if (requstid == REQUEST_GDLB + 1) + { + String2GDLB2(ppFieldInfos, ppTable[i * COL_EACH_ROW + 2], pppResults, Client, CPZH); + bFind = true; + } + + ++i; + p = ppTable[i * COL_EACH_ROW + j]; + } + + // 香港账号可能没有开头的一些数字,只能自己识别 + // 光证国际,登录时的资金帐号,查询股东列表,两个数据完全不一样,再查一次会覆盖 + if (!bFind) + { + int count = 1; + GDLB_STRUCT** ppResults = new GDLB_STRUCT*[count + 1](); + ppResults[count] = nullptr; + *pppResults = ppResults; + + + int i = 0; + int j = 0; + char* p = ppTable[i * COL_EACH_ROW + j]; + int pos = 0; + + while (p != nullptr) + { + char * flag = ppTable[i * COL_EACH_ROW + 10]; + if (flag) + { + if (strcmp(flag, "资金帐号") == 0) + { + ppResults[pos] = new GDLB_STRUCT(); + + strcpy_s(ppResults[pos]->ZJZH, ppTable[i * COL_EACH_ROW + 0]); + strcpy_s(ppResults[pos]->GDMC, ppTable[i * COL_EACH_ROW + 1]); + ++pos; + } + } + + ++i; + p = ppTable[i * COL_EACH_ROW + j]; + } + } + + return; +} + +int GetCountStructs(void** ppResults) +{ + if (ppResults == nullptr) + return -1; + + int i = 0; + void* pRow = ppResults[i]; + while (pRow != 0) + { + ++i; + pRow = ppResults[i]; + } + return i; +} + +void DeleteRequestRespone(RequestResponse_STRUCT* pRespone) +{ + if (pRespone == nullptr) + return; + + DeleteTableBody(pRespone->ppResults); + DeleteError(pRespone->pErr); + // 会不会是由它导致的每次内存没有释放干净? + //delete[] pRespone; +} + +void CharTable2XGSGEDCX(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, XGSGEDCX_STRUCT*** pppResults, void* Client) +{ + *pppResults = nullptr; + if (ppTable == nullptr) + return; + + int count = GetRowCountTableBody(ppTable); + if (count <= 0) + return; + + XGSGEDCX_STRUCT** ppResults = new XGSGEDCX_STRUCT*[count + 1](); + ppResults[count] = nullptr; + *pppResults = ppResults; + + for (int i = 0; i < count; ++i) + { + ppResults[i] = new XGSGEDCX_STRUCT(); + + int j = 0; + FieldInfo_STRUCT* pRow = ppFieldInfos[j]; + while (pRow != 0) + { + char* t = ppTable[i * COL_EACH_ROW + j]; + switch (pRow->FieldID) + { + case FIELD_ZJZH: + strcpy_s(ppResults[i]->ZJZH, t); + break; + case FIELD_CS: + strcpy_s(ppResults[i]->CS, t); + break; + case FIELD_ZHLB: + strcpy_s(ppResults[i]->ZHLB, t); + break; + case FIELD_GDDM: + strcpy_s(ppResults[i]->GDDM, t); + break; + case FIELD_JYSMC: + strcpy_s(ppResults[i]->JYSMC, t); + break; + case FIELD_XGSGED_5679: + strcpy_s(ppResults[i]->XGSGED, t); + break; + case FIELD_KSGED: + strcpy_s(ppResults[i]->KSGED, t); + break; + case FIELD_CZSJ: + strcpy_s(ppResults[i]->CZSJ, t); + break; + case FIELD_JB: + strcpy_s(ppResults[i]->JB, t); + break; + case FIELD_BLXX: + strcpy_s(ppResults[i]->BLXX, t); + break; + case FIELD_SGED_961: + strcpy_s(ppResults[i]->SGED_961, t); + break; + case FIELD_XGSGED_5564: + strcpy_s(ppResults[i]->XGSGED_5564, t); + break; + case FIELD_XGSGED_5718: + strcpy_s(ppResults[i]->XGSGED_5718, t); + break; + case FIELD_KHSZED_5759: + strcpy_s(ppResults[i]->KHSZED_5759, t); + break; + case FIELD_ZHED: + strcpy_s(ppResults[i]->ZHED, t); + break; + } + ++j; + pRow = ppFieldInfos[j]; + } + + + ppResults[i]->CS_ = atof(ppResults[i]->CS); + ppResults[i]->ZHLB_ = atoi(ppResults[i]->ZHLB); + ppResults[i]->XGSGED_ = atof(ppResults[i]->XGSGED); + ppResults[i]->SGED_961_ = atof(ppResults[i]->SGED_961); + ppResults[i]->KSGED_ = atof(ppResults[i]->KSGED); + ppResults[i]->XGSGED_5564_ = atof(ppResults[i]->XGSGED_5564); + ppResults[i]->XGSGED_5718_ = atof(ppResults[i]->XGSGED_5718); + ppResults[i]->ZHED_ = atof(ppResults[i]->ZHED); + ppResults[i]->KHSZED_5759_ = atof(ppResults[i]->KHSZED_5759); + + ppResults[i]->XGSGED_ = max(ppResults[i]->XGSGED_, ppResults[i]->SGED_961_); + ppResults[i]->XGSGED_ = max(ppResults[i]->XGSGED_, ppResults[i]->KSGED_); + ppResults[i]->XGSGED_ = max(ppResults[i]->XGSGED_, ppResults[i]->XGSGED_5564_); + ppResults[i]->XGSGED_ = max(ppResults[i]->XGSGED_, ppResults[i]->XGSGED_5718_); + ppResults[i]->XGSGED_ = max(ppResults[i]->XGSGED_, ppResults[i]->ZHED_); + ppResults[i]->XGSGED_ = max(ppResults[i]->XGSGED_, ppResults[i]->KHSZED_5759_); + + + ppResults[i]->Client = Client; } } -void CharTable2ZJYE(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, ZJYE_STRUCT*** pppResults) + +void CharTable2KSGXGCX(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, KSGXGCX_STRUCT*** pppResults, void* Client) { *pppResults = nullptr; if (ppTable == nullptr) @@ -916,47 +953,90 @@ void CharTable2ZJYE(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, ZJYE_STRUCT if (count <= 0) return; - ZJYE_STRUCT** ppResults = new ZJYE_STRUCT*[count + 1](); + KSGXGCX_STRUCT** ppResults = new KSGXGCX_STRUCT*[count + 1](); ppResults[count] = nullptr; *pppResults = ppResults; - int col_132 = GetIndexByFieldID(ppFieldInfos, FIELD_BZ); - int col_300 = GetIndexByFieldID(ppFieldInfos, FIELD_ZJYE); - int col_301 = GetIndexByFieldID(ppFieldInfos, FIELD_KYZJ); - int col_310 = GetIndexByFieldID(ppFieldInfos, FIELD_ZZC_310); - int col_302 = GetIndexByFieldID(ppFieldInfos, FIELD_KQZJ); - int col_121 = GetIndexByFieldID(ppFieldInfos, FIELD_ZJZH); - int col_205 = GetIndexByFieldID(ppFieldInfos, FIELD_ZXSZ); - for (int i = 0; i < count; ++i) { - ppResults[i] = new ZJYE_STRUCT(); - - //if (col_132 >= 0) - strcpy_s(ppResults[i]->BZ, ppTable[i * COL_EACH_ROW + col_132]); - //if (col_300 >= 0) - strcpy_s(ppResults[i]->ZJYE, ppTable[i * COL_EACH_ROW + col_300]); - //if (col_301 >= 0) - strcpy_s(ppResults[i]->KYZJ, ppTable[i * COL_EACH_ROW + col_301]); - //if (col_310 >= 0) - strcpy_s(ppResults[i]->ZZC, ppTable[i * COL_EACH_ROW + col_310]); - if (col_302 >= 0) - strcpy_s(ppResults[i]->KQZJ, ppTable[i * COL_EACH_ROW + col_302]); - if (col_121 >= 0) - strcpy_s(ppResults[i]->ZJZH, ppTable[i * COL_EACH_ROW + col_121]); - if (col_205 >= 0) - strcpy_s(ppResults[i]->ZXSZ, ppTable[i * COL_EACH_ROW + col_205]); - - - ppResults[i]->ZJYE_ = atof(ppResults[i]->ZJYE); - ppResults[i]->KYZJ_ = atof(ppResults[i]->KYZJ); - ppResults[i]->ZZC_ = atof(ppResults[i]->ZZC); - ppResults[i]->KQZJ_ = atof(ppResults[i]->KQZJ); - ppResults[i]->ZXSZ_ = atof(ppResults[i]->ZXSZ); + ppResults[i] = new KSGXGCX_STRUCT(); + + int j = 0; + FieldInfo_STRUCT* pRow = ppFieldInfos[j]; + while (pRow != 0) + { + char* t = ppTable[i * COL_EACH_ROW + j]; + switch (pRow->FieldID) + { + case FIELD_ZQDM: + strcpy_s(ppResults[i]->ZQDM, t); + break; + case FIELD_ZQMC: + strcpy_s(ppResults[i]->ZQMC, t); + break; + case FIELD_FXJG: + strcpy_s(ppResults[i]->FXJG, t); + break; + case FIELD_ZDSL: + strcpy_s(ppResults[i]->ZDSL, t); + break; + case FIELD_ZGSL: + strcpy_s(ppResults[i]->ZGSL, t); + break; + case FIELD_WTSL: + strcpy_s(ppResults[i]->WTSL, t); + break; + case FIELD_WTRQ: + strcpy_s(ppResults[i]->WTRQ, t); + break; + case FIELD_JYSDM: + strcpy_s(ppResults[i]->JYSDM, t); + break; + case FIELD_JYSMC: + strcpy_s(ppResults[i]->JYSMC, t); + break; + case FIELD_CZSJ: + strcpy_s(ppResults[i]->CZSJ, t); + break; + case FIELD_JB: + strcpy_s(ppResults[i]->JB, t); + break; + case FIELD_BLXX: + strcpy_s(ppResults[i]->BLXX, t); + break; + case FIELD_SGSX: + strcpy_s(ppResults[i]->SGSX, t); + break; + case FIELD_WTJG: + strcpy_s(ppResults[i]->WTJG, t); + break; + case FIELD_ZHLB: + strcpy_s(ppResults[i]->ZHLB, t); + break; + } + ++j; + pRow = ppFieldInfos[j]; + } + + ppResults[i]->FXJG_ = atof(ppResults[i]->FXJG); + ppResults[i]->ZDSL_ = atof(ppResults[i]->ZDSL); + ppResults[i]->ZGSL_ = atof(ppResults[i]->ZGSL); + ppResults[i]->WTSL_ = atof(ppResults[i]->WTSL); + ppResults[i]->WTRQ_ = atoi(ppResults[i]->WTRQ); + ppResults[i]->JYSDM_ = atoi(ppResults[i]->JYSDM); + ppResults[i]->SGSX_ = atof(ppResults[i]->SGSX); + ppResults[i]->WTJG_ = atof(ppResults[i]->WTJG); + ppResults[i]->ZHLB_ = atof(ppResults[i]->ZHLB); + + ppResults[i]->ZGSL_ = max(ppResults[i]->ZGSL_, ppResults[i]->SGSX_); + ppResults[i]->FXJG_ = max(ppResults[i]->FXJG_, ppResults[i]->WTJG_); + ppResults[i]->JYSDM_ = max(ppResults[i]->JYSDM_, ppResults[i]->ZHLB_); + + ppResults[i]->Client = Client; } } -void CharTable2HQ(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, HQ_STRUCT*** pppResults) +void CharTable2HQ(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, HQ_STRUCT*** pppResults, void* Client) { *pppResults = nullptr; if (ppTable == nullptr) @@ -970,120 +1050,129 @@ void CharTable2HQ(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, HQ_STRUCT*** ppResults[count] = nullptr; *pppResults = ppResults; - int col_140 = GetIndexByFieldID(ppFieldInfos, FIELD_ZQDM); - int col_141 = GetIndexByFieldID(ppFieldInfos, FIELD_ZQMC); - int col_946 = GetIndexByFieldID(ppFieldInfos, FIELD_ZSJ); - int col_945 = GetIndexByFieldID(ppFieldInfos, FIELD_JKJ); - int col_948 = GetIndexByFieldID(ppFieldInfos, FIELD_GZLX); - int col_949 = GetIndexByFieldID(ppFieldInfos, FIELD_DQJ); - int col_910 = GetIndexByFieldID(ppFieldInfos, FIELD_BID_PRICE_1); - int col_911 = GetIndexByFieldID(ppFieldInfos, FIELD_BID_PRICE_2); - int col_912 = GetIndexByFieldID(ppFieldInfos, FIELD_BID_PRICE_3); - int col_913 = GetIndexByFieldID(ppFieldInfos, FIELD_BID_PRICE_4); - int col_914 = GetIndexByFieldID(ppFieldInfos, FIELD_BID_PRICE_5); - int col_900 = GetIndexByFieldID(ppFieldInfos, FIELD_BID_SIZE_1); - int col_901 = GetIndexByFieldID(ppFieldInfos, FIELD_BID_SIZE_2); - int col_902 = GetIndexByFieldID(ppFieldInfos, FIELD_BID_SIZE_3); - int col_903 = GetIndexByFieldID(ppFieldInfos, FIELD_BID_SIZE_4); - int col_904 = GetIndexByFieldID(ppFieldInfos, FIELD_BID_SIZE_5); - int col_930 = GetIndexByFieldID(ppFieldInfos, FIELD_ASK_PRICE_1); - int col_931 = GetIndexByFieldID(ppFieldInfos, FIELD_ASK_PRICE_2); - int col_932 = GetIndexByFieldID(ppFieldInfos, FIELD_ASK_PRICE_3); - int col_933 = GetIndexByFieldID(ppFieldInfos, FIELD_ASK_PRICE_4); - int col_934 = GetIndexByFieldID(ppFieldInfos, FIELD_ASK_PRICE_5); - int col_920 = GetIndexByFieldID(ppFieldInfos, FIELD_ASK_SIZE_1); - int col_921 = GetIndexByFieldID(ppFieldInfos, FIELD_ASK_SIZE_2); - int col_922 = GetIndexByFieldID(ppFieldInfos, FIELD_ASK_SIZE_3); - int col_923 = GetIndexByFieldID(ppFieldInfos, FIELD_ASK_SIZE_4); - int col_924 = GetIndexByFieldID(ppFieldInfos, FIELD_ASK_SIZE_5); - int col_100 = GetIndexByFieldID(ppFieldInfos, FIELD_JYSDM); - int col_187 = GetIndexByFieldID(ppFieldInfos, FIELD_ZXJYGS); - int col_226 = GetIndexByFieldID(ppFieldInfos, FIELD_ZXMRBDJW); - int col_227 = GetIndexByFieldID(ppFieldInfos, FIELD_ZXMCBDJW); - int col_125 = GetIndexByFieldID(ppFieldInfos, FIELD_ZHLB); - int col_132 = GetIndexByFieldID(ppFieldInfos, FIELD_BZ); - int col_958 = GetIndexByFieldID(ppFieldInfos, FIELD_GZBS); - int col_940 = GetIndexByFieldID(ppFieldInfos, FIELD_ZTJG); - int col_941 = GetIndexByFieldID(ppFieldInfos, FIELD_DTJG); - int col_1213 = GetIndexByFieldID(ppFieldInfos, FIELD_BLXX); - for (int i = 0; i < count; ++i) { ppResults[i] = new HQ_STRUCT(); - //if (col_140 >= 0) - strcpy_s(ppResults[i]->ZQDM, ppTable[i * COL_EACH_ROW + col_140]); - if (col_141 >= 0) - strcpy_s(ppResults[i]->ZQMC, ppTable[i * COL_EACH_ROW + col_141]); - if (col_946 >= 0) - strcpy_s(ppResults[i]->ZSJ, ppTable[i * COL_EACH_ROW + col_946]); - if (col_945 >= 0) - strcpy_s(ppResults[i]->JKJ, ppTable[i * COL_EACH_ROW + col_945]); - if (col_948 >= 0) - strcpy_s(ppResults[i]->GZLX, ppTable[i * COL_EACH_ROW + col_948]); - //if (col_949 >= 0) - strcpy_s(ppResults[i]->DQJ, ppTable[i * COL_EACH_ROW + col_949]); - //if (col_910 >= 0) - strcpy_s(ppResults[i]->BidPrice1, ppTable[i * COL_EACH_ROW + col_910]); - //if (col_911 >= 0) - strcpy_s(ppResults[i]->BidPrice2, ppTable[i * COL_EACH_ROW + col_911]); - //if (col_912 >= 0) - strcpy_s(ppResults[i]->BidPrice3, ppTable[i * COL_EACH_ROW + col_912]); - //if (col_913 >= 0) - strcpy_s(ppResults[i]->BidPrice4, ppTable[i * COL_EACH_ROW + col_913]); - //if (col_914 >= 0) - strcpy_s(ppResults[i]->BidPrice5, ppTable[i * COL_EACH_ROW + col_914]); - //if (col_900 >= 0) - strcpy_s(ppResults[i]->BidSize1, ppTable[i * COL_EACH_ROW + col_900]); - //if (col_901 >= 0) - strcpy_s(ppResults[i]->BidSize2, ppTable[i * COL_EACH_ROW + col_901]); - //if (col_902 >= 0) - strcpy_s(ppResults[i]->BidSize3, ppTable[i * COL_EACH_ROW + col_902]); - //if (col_903 >= 0) - strcpy_s(ppResults[i]->BidSize4, ppTable[i * COL_EACH_ROW + col_903]); - //if (col_904 >= 0) - strcpy_s(ppResults[i]->BidSize5, ppTable[i * COL_EACH_ROW + col_904]); - //if (col_930 >= 0) - strcpy_s(ppResults[i]->AskPrice1, ppTable[i * COL_EACH_ROW + col_930]); - //if (col_931 >= 0) - strcpy_s(ppResults[i]->AskPrice2, ppTable[i * COL_EACH_ROW + col_931]); - //if (col_932 >= 0) - strcpy_s(ppResults[i]->AskPrice3, ppTable[i * COL_EACH_ROW + col_932]); - //if (col_933 >= 0) - strcpy_s(ppResults[i]->AskPrice4, ppTable[i * COL_EACH_ROW + col_933]); - //if (col_934 >= 0) - strcpy_s(ppResults[i]->AskPrice5, ppTable[i * COL_EACH_ROW + col_934]); - //if (col_920 >= 0) - strcpy_s(ppResults[i]->AskSize1, ppTable[i * COL_EACH_ROW + col_920]); - //if (col_921 >= 0) - strcpy_s(ppResults[i]->AskSize2, ppTable[i * COL_EACH_ROW + col_921]); - //if (col_922 >= 0) - strcpy_s(ppResults[i]->AskSize3, ppTable[i * COL_EACH_ROW + col_922]); - //if (col_923 >= 0) - strcpy_s(ppResults[i]->AskSize4, ppTable[i * COL_EACH_ROW + col_923]); - //if (col_924 >= 0) - strcpy_s(ppResults[i]->AskSize5, ppTable[i * COL_EACH_ROW + col_924]); - //if (col_100 >= 0) - strcpy_s(ppResults[i]->JYSDM, ppTable[i * COL_EACH_ROW + col_100]); - //if (col_187 >= 0) - strcpy_s(ppResults[i]->ZXJYGS, ppTable[i * COL_EACH_ROW + col_187]); - //if (col_226 >= 0) - strcpy_s(ppResults[i]->ZXMRBDJW, ppTable[i * COL_EACH_ROW + col_226]); - //if (col_227 >= 0) - strcpy_s(ppResults[i]->ZXMCBDJW, ppTable[i * COL_EACH_ROW + col_227]); - //if (col_125 >= 0) - strcpy_s(ppResults[i]->ZHLB, ppTable[i * COL_EACH_ROW + col_125]); - //if (col_132 >= 0) - strcpy_s(ppResults[i]->BZ, ppTable[i * COL_EACH_ROW + col_132]); - //if (col_958 >= 0) - strcpy_s(ppResults[i]->GZBS, ppTable[i * COL_EACH_ROW + col_958]); - if (col_940 >= 0) - strcpy_s(ppResults[i]->ZTJG, ppTable[i * COL_EACH_ROW + col_940]); - if (col_941 >= 0) - strcpy_s(ppResults[i]->DTJG, ppTable[i * COL_EACH_ROW + col_941]); - if (col_1213 >= 0) - strcpy_s(ppResults[i]->BLXX, ppTable[i * COL_EACH_ROW + col_1213]); - + int j = 0; + FieldInfo_STRUCT* pRow = ppFieldInfos[j]; + while (pRow != 0) + { + char* t = ppTable[i * COL_EACH_ROW + j]; + switch (pRow->FieldID) + { + case FIELD_ZQDM: + strcpy_s(ppResults[i]->ZQDM, t); + break; + case FIELD_ZQMC: + strcpy_s(ppResults[i]->ZQMC, t); + break; + case FIELD_ZSJ: + strcpy_s(ppResults[i]->ZSJ, t); + break; + case FIELD_JKJ: + strcpy_s(ppResults[i]->JKJ, t); + break; + case FIELD_GZLX: + strcpy_s(ppResults[i]->GZLX, t); + break; + case FIELD_DQJ: + strcpy_s(ppResults[i]->DQJ, t); + break; + case FIELD_BID_PRICE_1: + strcpy_s(ppResults[i]->BidPrice1, t); + break; + case FIELD_BID_PRICE_2: + strcpy_s(ppResults[i]->BidPrice2, t); + break; + case FIELD_BID_PRICE_3: + strcpy_s(ppResults[i]->BidPrice3, t); + break; + case FIELD_BID_PRICE_4: + strcpy_s(ppResults[i]->BidPrice4, t); + break; + case FIELD_BID_PRICE_5: + strcpy_s(ppResults[i]->BidPrice5, t); + break; + case FIELD_BID_SIZE_1: + strcpy_s(ppResults[i]->BidSize1, t); + break; + case FIELD_BID_SIZE_2: + strcpy_s(ppResults[i]->BidSize2, t); + break; + case FIELD_BID_SIZE_3: + strcpy_s(ppResults[i]->BidSize3, t); + break; + case FIELD_BID_SIZE_4: + strcpy_s(ppResults[i]->BidSize4, t); + break; + case FIELD_BID_SIZE_5: + strcpy_s(ppResults[i]->BidSize5, t); + break; + case FIELD_ASK_PRICE_1: + strcpy_s(ppResults[i]->AskPrice1, t); + break; + case FIELD_ASK_PRICE_2: + strcpy_s(ppResults[i]->AskPrice2, t); + break; + case FIELD_ASK_PRICE_3: + strcpy_s(ppResults[i]->AskPrice3, t); + break; + case FIELD_ASK_PRICE_4: + strcpy_s(ppResults[i]->AskPrice4, t); + break; + case FIELD_ASK_PRICE_5: + strcpy_s(ppResults[i]->AskPrice5, t); + break; + case FIELD_ASK_SIZE_1: + strcpy_s(ppResults[i]->AskSize1, t); + break; + case FIELD_ASK_SIZE_2: + strcpy_s(ppResults[i]->AskSize2, t); + break; + case FIELD_ASK_SIZE_3: + strcpy_s(ppResults[i]->AskSize3, t); + break; + case FIELD_ASK_SIZE_4: + strcpy_s(ppResults[i]->AskSize4, t); + break; + case FIELD_ASK_SIZE_5: + strcpy_s(ppResults[i]->AskSize5, t); + break; + case FIELD_JYSDM: + strcpy_s(ppResults[i]->JYSDM, t); + break; + case FIELD_ZXJYGS: + strcpy_s(ppResults[i]->ZXJYGS, t); + break; + case FIELD_ZXMRBDJW: + strcpy_s(ppResults[i]->ZXMRBDJW, t); + break; + case FIELD_ZXMCBDJW: + strcpy_s(ppResults[i]->ZXMCBDJW, t); + break; + case FIELD_ZHLB: + strcpy_s(ppResults[i]->ZHLB, t); + break; + case FIELD_BZ: + strcpy_s(ppResults[i]->BZ, t); + break; + case FIELD_GZBS: + strcpy_s(ppResults[i]->GZBS, t); + break; + case FIELD_ZTJG: + strcpy_s(ppResults[i]->ZTJG, t); + break; + case FIELD_DTJG: + strcpy_s(ppResults[i]->DTJG, t); + break; + case FIELD_BLXX: + strcpy_s(ppResults[i]->BLXX, t); + break; + } + ++j; + pRow = ppFieldInfos[j]; + } ppResults[i]->ZSJ_ = atof(ppResults[i]->ZSJ); ppResults[i]->JKJ_ = atof(ppResults[i]->JKJ); @@ -1115,169 +1204,197 @@ void CharTable2HQ(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, HQ_STRUCT*** ppResults[i]->ZXMCBDJW_ = atof(ppResults[i]->ZXMCBDJW); ppResults[i]->ZTJG_ = atof(ppResults[i]->ZTJG); ppResults[i]->DTJG_ = atof(ppResults[i]->DTJG); + + ppResults[i]->Client = Client; } } +//void CharTable2XGPHCX(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, XGPHCX_STRUCT*** pppResults, void* Client) +//{ +// *pppResults = nullptr; +// if (ppTable == nullptr) +// return; +// +// int count = GetRowCountTableBody(ppTable); +// if (count <= 0) +// return; +// +// XGPHCX_STRUCT** ppResults = new XGPHCX_STRUCT*[count + 1](); +// ppResults[count] = nullptr; +// *pppResults = ppResults; +// +// for (int i = 0; i < count; ++i) +// { +// ppResults[i] = new XGPHCX_STRUCT(); +// +// int j = 0; +// FieldInfo_STRUCT* pRow = ppFieldInfos[j]; +// while (pRow != 0) +// { +// char* t = ppTable[i * COL_EACH_ROW + j]; +// switch (pRow->FieldID) +// { +// case FIELD_PHRQ: +// strcpy_s(ppResults[i]->PHRQ, t); +// break; +// case FIELD_ZQDM: +// strcpy_s(ppResults[i]->ZQDM, t); +// break; +// case FIELD_ZQMC: +// strcpy_s(ppResults[i]->ZQMC, t); +// break; +// case FIELD_QSPH: +// strcpy_s(ppResults[i]->QSPH, t); +// break; +// case FIELD_PHSL: +// strcpy_s(ppResults[i]->PHSL, t); +// break; +// case FIELD_ZHLB: +// strcpy_s(ppResults[i]->ZHLB, t); +// break; +// case FIELD_BLXX: +// strcpy_s(ppResults[i]->BLXX, t); +// break; +// } +// ++j; +// pRow = ppFieldInfos[j]; +// } +// +// ppResults[i]->PHRQ_ = atoi(ppResults[i]->PHRQ); +// ppResults[i]->QSPH_ = atoi(ppResults[i]->QSPH); +// ppResults[i]->PHSL_ = atoi(ppResults[i]->PHSL); +// ppResults[i]->ZHLB_ = atoi(ppResults[i]->ZHLB); +// +// ppResults[i]->Client = Client; +// } +//} -void DeleteStructs(void*** pppStructs) +#else + + +void OutputCSVTableHeader(FILE* pFile, FieldInfo_STRUCT** ppHeader) { - if (*pppStructs == nullptr) + if (ppHeader == nullptr || pFile == nullptr) return; - void** ppStructs = *pppStructs; - int i = 0; - while (ppStructs[i] != 0) + FieldInfo_STRUCT* pRow = ppHeader[i]; + while (pRow != 0) { - delete[] ppStructs[i]; - ppStructs[i] = nullptr; + char buf[512] = { 0 }; + fprintf(pFile, "%d_%s,",//"%d,%s,%d,%d,%d,%d,%d", + pRow->FieldID, pRow->FieldName, pRow->a, pRow->b, pRow->Len, pRow->d, pRow->e); ++i; + pRow = ppHeader[i]; } - - delete[] ppStructs; - *pppStructs = nullptr; + fprintf(pFile, "\n"); } -/* -6 -A74168961|WK |05000000100801|1| 0| | -013086113|WK |05000000100801|0| 0| | - -7 -A12121217|ZHT|1| 40690000|28356| 0|主股东| -015597938|ZHT|0| 40690000|394232|0|主股东| - -5 -A341083000|LK|1| |主股东| -0189181400|LK|0| |主股东| - -8 -E015976151|HT|1|88500918| 12982|1| |主股东| -0601605823|HT|0|88500918| 354000|1| |主股东| -*/ -void String2GDLB(char* szString, GDLB_STRUCT*** pppResults) +void OutputCSVTableBody(FILE* pFile, char** ppTable) { - *pppResults = nullptr; - if (szString == nullptr) + if (ppTable == nullptr || pFile == nullptr) return; - char* pBuf = new char[strlen(szString) + 1]; - strcpy(pBuf, szString); - - vector vct; - - // 分好多少列 - char* token = strtok(pBuf, "\r\n"); + // 如果有数据,第一列就不为空 int i = 0; - while (token) + int j = 0; + char* p = ppTable[i * COL_EACH_ROW + j]; + while (p != nullptr) { - if (i>0) + //printf("%d:", i); + for (j = 0; j < COL_EACH_ROW; ++j) { - vct.push_back(token); + p = ppTable[i * COL_EACH_ROW + j]; + if (p) + { + fprintf(pFile, "%s,", p); + } + else + break; } - token = strtok(nullptr, "\r\n"); + fprintf(pFile, "\n"); + j = 0; ++i; + p = ppTable[i * COL_EACH_ROW + j]; } - int count = vct.size(); + return; +} - GDLB_STRUCT** ppResults = new GDLB_STRUCT*[count + 1](); - ppResults[count] = nullptr; - *pppResults = ppResults; +void OutputCSVTableBody(FILE* pFile, char** ppTable, int count) +{ + if (ppTable == nullptr || pFile == nullptr) + return; - for (int i = 0; i < count;++i) + for (int i = 0; i < count; ++i) { - ppResults[i] = new GDLB_STRUCT(); - - vector v1; - vector v2; - vector v3; - char* t = strtok(vct[i], "|"); - int j = 0; - while (t) + //printf("%d:", i); + for (int j = 0; j < COL_EACH_ROW; ++j) { - int len = strlen(t); - if (len == 1) - { - v2.push_back(t); - } - else if (len>0) + char* p = ppTable[i * COL_EACH_ROW + j]; + if (p) { - if (t[0]>127||t[0]<0) - { - v3.push_back(t); - } - else - { - v1.push_back(t); - } + fprintf(pFile, "%s,", p); + } - t = strtok(nullptr, "|"); + else + break; } + fprintf(pFile, "\n"); + } - strcpy_s(ppResults[i]->GDDM, v1[0]); - if (v1.size() > 1) - strcpy_s(ppResults[i]->ZJZH, v1[1]); - if (v1.size() > 2) - strcpy_s(ppResults[i]->XWDM, v1[2]); - - strcpy_s(ppResults[i]->ZHLB, v2[0]); - if (v2.size() > 1) - strcpy_s(ppResults[i]->RZRQBS, v2[1]); + return; +} - if (v3.size()>0) - strcpy_s(ppResults[i]->GDMC, v3[0]); - if (v3.size()>1) - strcpy_s(ppResults[i]->BLXX, v3[1]); - ppResults[i]->ZHLB_ = atoi(ppResults[i]->ZHLB); - ppResults[i]->RZRQBS_ = atoi(ppResults[i]->RZRQBS); +void OutputCSVError(FILE* pFile, Error_STRUCT* pErr) +{ + if (pErr == nullptr) + { + return; } - delete[] pBuf; + fprintf(pFile, "%d,%d,%s\n", pErr->ErrType, pErr->ErrCode, pErr->ErrInfo); } -void CharTable2Login(char** ppTable, GDLB_STRUCT*** pppResults) +void OutputCSVErrors(FILE* pFile, Error_STRUCT** pErrs) { - *pppResults = nullptr; - if (ppTable == nullptr) + if (pErrs == nullptr) return; - // 如果有数据,第一列就不为空 int i = 0; - int j = 0; - char* p = ppTable[i * COL_EACH_ROW + j]; - while (p != nullptr) + Error_STRUCT* pErr = pErrs[i]; + while (pErr != nullptr) { - int requstid = atoi(p); - if (requstid == REQUEST_GDLB + 1) - { - String2GDLB(ppTable[i * COL_EACH_ROW + 2], pppResults); - } + fprintf(pFile, "%d:%d,%d,%s\n", i, pErr->ErrType, pErr->ErrCode, pErr->ErrInfo); ++i; - p = ppTable[i * COL_EACH_ROW + j]; + pErr = pErrs[i]; } - - return; } -int GetCountStructs(void** ppResults) +void OutputCSVErrors(FILE* pFile, Error_STRUCT** pErrs, int count) { - if (ppResults == nullptr) - return -1; + if (pErrs == nullptr) + { + return; + } - int i = 0; - void* pRow = ppResults[i]; - while (pRow != 0) + for (int i = 0; i < count; ++i) { - ++i; - pRow = ppResults[i]; + Error_STRUCT* pErr = pErrs[i]; + if (pErr) + { + fprintf(pFile, "%d:%d,%d,%s\n", i, pErr->ErrType, pErr->ErrCode, pErr->ErrInfo); + } + else + fprintf(pFile, "\n"); } - return i; } -#else + + + #endif \ No newline at end of file diff --git a/include/Tdx/tdx_function.h b/include/Tdx/tdx_function.h index 1f96d2f..05c0fa7 100644 --- a/include/Tdx/tdx_function.h +++ b/include/Tdx/tdx_function.h @@ -14,18 +14,24 @@ TDXAPI_API FieldInfo_STRUCT** CopyTableHeader(FieldInfo_STRUCT** ppHeader); #else #define TDXAPI_API __declspec(dllimport) -#endif +// 在编写代码时发现FILE不能跨DLL +void OutputCSVTableHeader(FILE* pFile, FieldInfo_STRUCT** ppHeader); + +void OutputCSVTableBody(FILE* pFile, char** ppTable); +void OutputCSVTableBody(FILE* pFile, char** ppTable, int count); -// 得到时间 -//TDXAPI_API void GetUpdateTime_HH_mm_ss(char* UpdateTime, int* _HH, int* _mm, int* _ss); +void OutputCSVError(FILE* pFile, Error_STRUCT* pErr); +void OutputCSVErrors(FILE* pFile, Error_STRUCT** pErrs); +void OutputCSVErrors(FILE* pFile, Error_STRUCT** pErrs, int count); + +#endif ////////////////////////////////////////////////////////////////////////// // 表头处理 // 打印表头信息,实际是一个指针数组,指针指向字段信息,数组最后一个指针为null TDXAPI_API void PrintTableHeader(FieldInfo_STRUCT** ppHeader); -TDXAPI_API void OutputCSVTableHeader(FILE* pFile, FieldInfo_STRUCT** ppHeader); // 根据字段名得到列索引 TDXAPI_API int GetIndexByFieldName(FieldInfo_STRUCT** ppHeader,char* FieldName); @@ -41,9 +47,6 @@ TDXAPI_API int GetCountTableHeader(FieldInfo_STRUCT** ppHeader); TDXAPI_API void PrintTableBody(char** ppTable); TDXAPI_API void PrintTableBody(char** ppTable, int count); -TDXAPI_API void OutputCSVTableBody(FILE* pFile, char** ppTable); -TDXAPI_API void OutputCSVTableBody(FILE* pFile, char** ppTable, int count); - // 取出的数据看情况是否要删除 TDXAPI_API void DeleteTableBody(char** ppTable); TDXAPI_API void DeleteTableBody(char** ppTable, int count); @@ -58,32 +61,35 @@ TDXAPI_API void PrintError(Error_STRUCT* pErr); TDXAPI_API void PrintErrors(Error_STRUCT** pErrs); TDXAPI_API void PrintErrors(Error_STRUCT** pErrs, int count); -TDXAPI_API void OutputCSVError(FILE* pFile, Error_STRUCT* pErr); -TDXAPI_API void OutputCSVErrors(FILE* pFile, Error_STRUCT** pErrs); -TDXAPI_API void OutputCSVErrors(FILE* pFile, Error_STRUCT** pErrs, int count); - TDXAPI_API void DeleteError(Error_STRUCT* pErr); TDXAPI_API void DeleteErrors(Error_STRUCT** pErrs); TDXAPI_API void DeleteErrors(Error_STRUCT** pErrs, int count); // 得到错误数 TDXAPI_API int GetCountErrors(Error_STRUCT** pErrs); - ////////////////////////////////////////////////////////////////////////// -// 将字符串表转成特定对 -TDXAPI_API void CharTable2GDLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GDLB_STRUCT*** pppResults); - -TDXAPI_API void CharTable2WTLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, WTLB_STRUCT*** pppResults); - -TDXAPI_API void CharTable2CJLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, CJLB_STRUCT*** pppResults); - -TDXAPI_API void CharTable2GFLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GFLB_STRUCT*** pppResults); +TDXAPI_API int GetCountStructs(void** ppResults); +// 删除,注意,也存在Debug与Release的问题,所以在别的dll中生成的内存最好也在别的地方删 +TDXAPI_API void DeleteStructs(void*** pppStructs); +////////////////////////////////////////////////////////////////////////// +// 股东列表处理,用于授权部分 +TDXAPI_API void CharTable2GDLB(FieldInfo_STRUCT** ppFieldInfos_1122, char** ppTable, GDLB_STRUCT*** pppResults, void* Client); +// 由于部分券商股东列表中没有资金账号,只能从登录信息中另外获取 +TDXAPI_API void CharTable2Login(FieldInfo_STRUCT** ppFieldInfos_1122, char** ppTable, GDLB_STRUCT*** pppResults, void* Client, FieldInfo_STRUCT** ppFieldInfos_148, char* CPZH); +// 删除请求和响应,进行内存释放 +TDXAPI_API void DeleteRequestRespone(RequestResponse_STRUCT* pRespone); -TDXAPI_API void CharTable2ZJYE(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, ZJYE_STRUCT*** pppResults); +////////////////////////////////////////////////////////////////////////// +// 打新结构体解析 -TDXAPI_API void CharTable2HQ(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, HQ_STRUCT*** pppResults); +// 新股申购额度查询 +TDXAPI_API void CharTable2XGSGEDCX(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, XGSGEDCX_STRUCT*** pppResults, void* Client); +// 可申购新股查询 +TDXAPI_API void CharTable2KSGXGCX(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, KSGXGCX_STRUCT*** pppResults, void* Client); +//// 新股配号查询,只有收盘后或第二天才能查询到 +//TDXAPI_API void CharTable2XGPHCX(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, XGPHCX_STRUCT*** pppResults, void* Client); -TDXAPI_API void CharTable2Login(char** ppTable, GDLB_STRUCT*** pppResults); +////////////////////////////////////////////////////////////////////////// +// 行情解析 +TDXAPI_API void CharTable2HQ(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, HQ_STRUCT*** pppResults, void* Client); -TDXAPI_API int GetCountStructs(void** ppResults); -TDXAPI_API void DeleteStructs(void*** pppStructs); \ No newline at end of file diff --git a/include/Tdx/tdx_request.h b/include/Tdx/tdx_request.h index 270205d..18fbc10 100644 --- a/include/Tdx/tdx_request.h +++ b/include/Tdx/tdx_request.h @@ -28,7 +28,7 @@ _卖一量|921_卖二量|922_卖三量|923_卖四量|924_卖五量|100_交易所 132_币种|300_资金余额|301_可用资金|310_总资产|302_可取资金|121_资金帐号|1213_保 留信息| */ -#define REQUEST_ZJYE 104 // 资金余额 +#define REQUEST_ZJYE 104 // 资金余额,信用与普通的区别是121_资金帐号不同 /* 120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|140_ 证券代码|130_买卖标志|949_当前价|301_可用资金|166_委托方式|510_合约代码|513_开平 @@ -41,7 +41,9 @@ _卖一量|921_卖二量|922_卖三量|923_卖四量|924_卖五量|100_交易所 201_可卖数量|301_可用资金|1163_融资负债|1150_融资利息|1159_融资管理费|251_提示信 息1|1213_保留信息| */ -#define REQUEST_110 110 +#define REQUEST_110 110 // 限额查询,基本就是一个下单指令 + + /* 120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|100_ @@ -69,6 +71,15 @@ UID|5254_信用交易标识|5255_会话号|5256_客户代码| */ #define REQUEST_WT 202 // 委托 /* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|130_ +买卖标志|140_证券代码|144_委托数量|145_委托价格|5250_客户群组|5251_客户营业部|52 +52_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本号 +| +=============== +146_委托编号|1213_保留信息| +*/ +#define REQUEST_ZGHS 204 // 转股回售 +/* 120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207 _起始序号|126_开始日期|127_终止日期|1227_参数|101_交易所名称|5250_客户群组|5251_ 客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代 @@ -131,7 +142,16 @@ _起始序号|140_证券代码|113_操作标志|1228_模式|1299_功能版本|10 5_最新市值|204_摊簿浮动盈亏|232_实现盈亏|230_参考盈亏比例(%)|160_冻结数量|123_股 东代码|100_交易所代码|101_交易所名称|1213_保留信息| */ -#define REQUEST_GFLB 1114 // 股份列表 +#define REQUEST_GFLB 1114 // 股份列表,信用与普通的区别是121_资金帐号不同 + + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|126_开始日期|127_终止日期|1207_起始序号|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本号| +=============== +170_配号日期|123_股东代码|140_证券代码|141_证券名称|171_起始配号|172_配号数量|1213_保留信息| +*/ +#define REQUEST_XGSG_XGPHCX 1116 // 新股配号查询 + /* 120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|113_ 操作标志|299_对方分支代码|298_对方客户代码|243_对方资金帐号|158_对方密码|361_升 @@ -154,13 +174,28 @@ _起始序号|140_证券代码|113_操作标志|1228_模式|1299_功能版本|10 险标志|251_提示信息1|252_提示信息2|397_产品标志|291_字段代码|125_帐号类别|145_委 托价格|241_约定序号|201_可卖数量|144_委托数量|1213_保留信息| */ -#define REQUEST_1124 1124 // +#define REQUEST_1124 1124 // + + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|100_交易所代码|140_证券代码|1207_起始序号|126_开始日期|127_终止日期|1227_参数|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本号| +=============== +176_中签日期|140_证券代码|141_证券名称|152_成交数量|123_股东代码|1213_保留信息| +*/ +#define REQUEST_XGSG_XGZQCX 1126 // 新股中签查询 + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|126_开始日期|127_终止日期|113_操作标志|1207_起始序号|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本 号| +=============== +5850_发行日期|141_证券名称|140_证券代码|418_发行价格|961_最高数量|962_最低数量|142_委托日期|101_交易所名称|1227_参数|125_帐号类别|1213_保留信息| +*/ +#define REQUEST_XGSG_KSGXGCX 1156 // 可申购新股查询 ////////////////////////////////////////////////////////////////////////// // 期权部分 /* */ -#define REQUEST_BDQSD_QQ 1294 // 备兑券锁定/解锁/撤单 +#define REQUEST_WT_QQ 1294 // 备兑券锁定/解锁/撤单 /* 120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|100_ 交易所代码|294_附加账号|234_类型|140_证券代码|391_产品代码|510_合约代码|1207_起 @@ -285,6 +320,126 @@ CPUID|5254_信用交易标识|5255_会话号|5256_客户代码| */ #define REQUEST_CYXYCX_QQ 1320 // 可用合约查询 +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|100_交易所代码|1207_起始序号|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本号| +=============== +120_客户号|100_交易所代码|101_交易所名称|123_股东代码|173_席位代码|5747_申购额度|1227_参数|125_帐号类别|1213_保留信息| +*/ +#define REQUEST_XGSG_XGSGEDCX 1340 // 新股申购额度查询 + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|126_开始日期|127_终止日期|113_操作标志|1207_起始序号|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本 号| +=============== +120_客户号|140_证券代码|141_证券名称|153_成交价格|132_币种|174_中签数|1088_中签金额|5811_已缴款数量|5814_已缴款金额|5812_应补缴数量|5815_应补缴金额|5736_到账日期|123_股东代码|101_交易所名称|1213_保留信息| +*/ +#define REQUEST_XGSG_XGSGDJKCX 1370 // 新股申购待缴款查询,在国信证券中叫 新股中签查询 + +/* +*/ +#define REQUEST_XGSG_LSZQCX 1372 // 历史中签查询,在国信证券中有这个功能 + +#define REQUEST_WT_HGT 1450 // 委托,沪港通 +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|603_ +交易类型|601_ETF代码|140_证券代码|145_委托价格|604_认购数量|245_对方帐号类别|244 +_对方股东代码|485_推荐人代码|234_类型|5250_客户群组|5251_客户营业部|5252_硬盘序 +列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本号| +=============== +146_委托编号|1213_保留信息| +*/ +#define REQUEST_ETF_SGSH 3000 // ETF申购赎回 + +////////////////////////////////////////////////////////////////////////// +// 融资融券 +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|140_证券代码|130_买卖标志|166_委托方式|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本 号| +=============== +5560_信用资金额度|5563_数值|5566_--|5561_融资信息|5564_数值|5567_--|5562_融券信息|5565_数值|1213_保留信息| +*/ +#define REQUEST_XYZCXC 3200 // 信用资产查询 + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|130_买卖标志|166_委托方式|140_证券代码|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本 号| +=============== +140_证券代码|141_证券名称|5982_可融数量|546_保证金比例|1187_股票折算率|5546_融券利率|101_交易所名称|1213_保留信息| +*/ +#define REQUEST_RQBDZQLB 3202 // 融券标的证券列表 + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|130_买卖标志|166_委托方式|140_证券代码|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本 号| +=============== +140_证券代码|141_证券名称|1190_融资保证金比例|1191_融券保证金比例|5545_融资利率|5546_融券利率|1187_股票折算率|125_帐号类别|101_交易所名称|1213_保留信息| +*/ +#define REQUEST_RZBDZQLB 3216 // 融资标的证券列表 + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|140_证券代码|1287_起始行号|1288_请求行数|1286_定位字串|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客 户代码|5257_版本号| +=============== +140_证券代码|141_证券名称|1187_股票折算率|125_帐号类别|101_交易所名称|1213_保留信息| +*/ +#define REQUEST_DBPZQCX 3220 // 担保品证券查询 + +/* +120_客户代码|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|140_证券代码|1287_起始行号|1288_请求行数|1286_定位字串|5251_用户令牌|5252_主(资金)账号|5253_(资金)账号列表|5254_(开户)超过18个月|5255_普通(资金)账号|5256_硬盘代码|5257_实际营业部| +=============== +140_证券代码|141_证券名称|546_保证金比例|1217_备注|1231_显示颜色|1213_保留信息| +*/ +#define REQUEST_RZMRBDCX 3230 // 融资买入标的查询 + +/* +120_客户代码|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|140_证券代码|1287_起始行号|1288_请求行数|1286_定位字串|130_买卖标志|5251_用户令牌|5252_主(资金)账号|5253_(资金)账号列表|5254_(开户)超过18个月|5255_ 普通(资金)账号|5256_硬盘代码|5257_实际营业部| +=============== +140_证券代码|141_证券名称|201_可用股份|546_保证金比例|125_帐号类别|101_交易所名称|1213_保留信息| +*/ +#define REQUEST_RQMCBDCX 3232 // 融券卖出标的查询 + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本号| +=============== +169_流水号|522_开仓日期|1176_平仓日期|130_买卖标志|131_委托类别|140_证券代码|141_证券名称|5584_负债数量|622_保留数量|5549_已还数量|5552_当日已还数量|125_帐号类别|101_交易所名称|123_股东代码|5605_浮动盈亏|1213_保留信息| +*/ +#define REQUEST_MQHQCX 3234 // 买券还券查询,130=71 + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本号| +=============== +169_流水号|522_开仓日期|1176_平仓日期|130_买卖标志|131_委托类别|140_证券代码|141_证券名称|5584_负债数量|622_保留数量|5549_已还数量|5552_当日已还数量|125_帐号类别|101_交易所名称|123_股东代码|5605_浮动盈亏|1213_保留信息| +*/ +#define REQUEST_RQHYXXLB 3238 // 现券还券,融券合约信息列表,130=73 + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|130_买卖标志|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本号| +=============== +169_流水号|522_开仓日期|1176_平仓日期|130_买卖标志|131_委托类别|140_证券代码|141_证券名称|5547_负债金额|5555_尚欠金额|5550_还款金额|5553_当日已还金额|125_帐号类别|101_交易所名称|123_股东代码|5605_浮动盈亏|1213_保留信息| +*/ +#define REQUEST_XJHKLB 3246 // 现金还款,130=75 + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_会话号|5256_客户代码|5257_版本号| +=============== +169_流水号|522_开仓日期|1176_平仓日期|130_买卖标志|131_委托类别|140_证券代码|141_证券名称|5547_负债金额|5555_尚欠金额|5550_还款金额|5553_当日已还金额|125_帐号类别|101_交易所名称|123_股东代码|5605_浮动盈亏|322_所需金额|1213_保留信息| +*/ +#define REQUEST_FZHYXXLB 3248 // 卖券还款,负债合约信息列表,130=76 + +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|5250_CPU|5251_HD|5252_LIP|5253_系统节点编号|5254_真实营业部代码|5255_客户姓名|5256_客户代码|5257_股东代码表|5258_GUID|5261_机器绑定信息|5262_客户权限|5259_认证编号| +=============== +140_证券代码|141_证券名称|201_可卖数量|546_保证金比例|125_帐号类别|100_交易所代码|1213_保留信息| +*/ +#define REQUEST_RQMCBDCX_ZRT 3410 // 转融通融券卖出标的查询,130=24 +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|5250_CPU|5251_HD|5252_LIP|5253_系统节点编号|5254_真实营业部代码|5255_客户姓名|5256_客户代码|5257_股东代码表|5258_GUID|5261_机器绑定信息|5262_客户权限|5259_认证编号| +=============== +522_开仓日期|759_合约编号|140_证券代码|141_证券名称|546_保证金比例|146_委托编号|145_委托价格|144_委托数量|5551_合约开仓 数量|5552_合约开仓金额|5553_合约开仓费用|5541_合约状态|10031_未还金额|10032_未还数量|5554_未还合约费用|5555_未还合约利息|10033_已还利息|10034_已还数量|10035_已还金额|5556_合约总利息|541_保证金|622_保留数量|5557_合约年利率|10036_归还截止日期|5559_了结日期|125_帐号类别|101_交易所名称|322_所需金额|50_(参数)操作数据|1233_句柄|1213_保留信息| +*/ +#define REQUEST_MQHQBDCX_ZRT 3458 // 转融通买券还券标的查询,130=34 +/* +120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1207_起始序号|5250_CPU|5251_HD|5252_LIP|5253_系统节点编号|5254_真实营业部代码|5255_客户姓名|5256_客户代码|5257_股东代码表|5258_GUID|5261_机器绑定信息|5262_客户权限|5259_认证编号| +=============== +522_开仓日期|759_合约编号|140_证券代码|141_证券名称|546_保证金比例|146_委托编号|145_委托价格|144_委托数量|5551_合约开仓 数量|5552_合约开仓金额|5553_合约开仓费用|5541_合约状态|10031_未还金额|10032_未还数量|5554_未还合约费用|5555_未还合约利息|10033_已还利息|10034_已还数量|10035_已还金额|5556_合约总利息|541_保证金|622_保留数量|5557_合约年利率|10036_归还截止日期|5559_了结日期|125_帐号类别|101_交易所名称|322_所需金额|50_(参数)操作数据|1233_句柄|1213_保留信息| +*/ +#define REQUEST_XQHQBDCX_ZRT 3462 // 转融通现券还券标的查询,130=36 + ////////////////////////////////////////////////////////////////////////// // 登录部分 @@ -335,9 +490,12 @@ ID|1218_客户权限|149_返回信息|220_客户权限代码|221_客户权限名 信息1|1210_认证方式|1204_MAC地址|1229_描述|1248_SESSION信息|295_信用交易提示信息 |275_个股期权交易标志|276_OTC交易标志|273_港股通交易标志|250_提示信息0|252_提示 信息2|1217_备注|1213_保留信息| + +120_产品账号|134_交易密码|121_产品账号|125_帐号类别|123_股东代码|1206_客户类别|1210_认证方式|1211_认证信息|122_客户名称|454_证件号码|455_移动电话|128_用户联系方式|129_用户EMAIL|188_上海股东|189_深圳股东|138_通讯密码|1117_银行代码|1118_银行 营业部|1119_银行股东代码登录市场|1234_柜台类别|1214_断线重联标志|1230_查询模式|1216_VIP标志|1235_机器信息|1243_受限模式|1248_SESSION信息|1257_重定向标志|1258_重定向信息|1292_手机机器信息|1297_登录输入参数|1244_机器特征码|1300_客户端内部版本|1301_版本字符串| +=============== +120_产品账号|122_客户名称|110_委托方式|411_开放式基金标识|1212_营业部ID|149_返回信息|1216_VIP标志|125_帐号类别|1224_非交易帐号标志|281_融资融券标识|220_客户权限代码|221_客户权限名称|1247_所需认证方式|1244_机器特征码|295_信用交易提示信息|1264_令牌|1227_是否匹配风险等级|1291_登录返回参数|450_开户类别|251_签署日期|276_OTC交易标志|252_可否转融通|253_签署途径|1233_句柄|1213_保留信息| */ -#define RESPONSE_101 101 -#define REQUEST_100 100 +#define REQUEST_100 100 // 不同的平台返回的不一样,其中 /* 120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|1117 _银行代码|1118_银行营业部|1119_银行股东代码登录市场|1234_柜台类别|138_通讯密码|1 @@ -346,7 +504,6 @@ _银行代码|1118_银行营业部|1119_银行股东代码登录市场|1234_柜 5250_客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用交易标识|5255_ 会话号|5256_客户代码|1213_保留信息| */ -#define RESPONSE_113 113 #define REQUEST_112 112 /* 120_客户号|134_交易密码|121_资金帐号|125_帐号类别|123_股东代码|110_委托方式|5250 @@ -355,8 +512,14 @@ _客户群组|5251_客户营业部|5252_硬盘序列号|5253_CPUID|5254_信用 =============== 120_客户号|281_融资融券标识|411_开放式基金标识|110_委托方式|1213_保留信息| */ -#define RESPONSE_149 149 #define REQUEST_148 148 +/* +120_产品账号|134_交易密码|121_产品账号|125_帐号类别|123_股东代码|110_委托方式|5250_交易资金帐号|5251_多资金帐号|5252_CPUID|5253_HDID|5254_信用股东列表|5255_子系统标识|5256_客户类型|5257_信用标识|5258_客户姓名|5259_GUID|5260_手机缓存| +=============== +120_产品账号|125_帐号类别|1224_非交易帐号标志|281_融资融券标识|1213_保留信息| +*/ +#define REQUEST_148 148 + /* */ diff --git a/include/Tdx/tdx_struct.h b/include/Tdx/tdx_struct.h index b556680..dc65b39 100644 --- a/include/Tdx/tdx_struct.h +++ b/include/Tdx/tdx_struct.h @@ -3,6 +3,7 @@ #ifndef _TDX_STRUCT_H_ #define _TDX_STRUCT_H_ +#define COL_EACH_ROW (64) //每行多少例,相当重要 // 字段信息,通达信内部定义的,非自定义 struct FieldInfo_STRUCT @@ -22,24 +23,99 @@ struct Error_STRUCT int ErrType; int ErrCode; char ErrInfo[256]; + + void* Client; // 多账号 +}; + +// 请求 +// 响应,有两种类型 +// 一个请求只返回一行数据 +// 一个请求返回多行数据 +struct RequestResponse_STRUCT +{ + //请求类型 + int requestType; + int requestID; + // 多行内容 + char pContent[1024]; + // 请求大小 + int size; + + void* Client; // 多账号 + char khh[64]; + + // 表头 + FieldInfo_STRUCT** ppFieldInfo; + // 错误 + Error_STRUCT* pErr; + // 多行内容 + char** ppResults; + + void* pSend; + // API内部使用的字段,请不要动 + void* pUserData_Private; + // API外部使用的字段,用来方便开发 + void* pUserData_Public; + // API外部使用的字段,用来方便开发 + void* pUserData_Public2; }; // 委托 struct Order_STRUCT { + char KHH[32]; // 120_客户号 char ZJZH[32]; // 121_资金帐号 char GDDM[32]; // 123_股东代码 char ZQDM[32]; // 140_证券代码 int ZHLB; // 125_帐号类别 int RZRQBS; // 281_融资融券标识 double Price; // 145_委托价格 - long Qty; // 144_委托数量 + double Qty; // 144_委托数量 long MMBZ; // 130_买卖标志 long WTFS; // 166_委托方式 + int CZBZ; // 113_操作标志 char ZHLB_[2]; // 125_帐号类别 // 下完单后用来回填 char WTBH[32]; // 146_委托编号 + + int requestType; // 请求类型 + + void* Client; // 多账号 +}; + +struct CancelOrder_STRUCT +{ + char KHH[32]; // 120_客户号 + char ZJZH[32]; // 121_资金帐号 + char ZHLB[32]; // 125_帐号类别 + char GDDM[32]; // 123_股东代码 + char ZQDM[32]; // 140_证券代码 + char WTBH[32]; // 146_委托编号 + char JYSDM[32]; // 100_交易所代码 + char XWDM[32]; // 173_席位代码 + // 港股需要委托价格 + char WTJG[32]; // 145_委托价格 + char WTSL[32]; // 144_委托数量 + + void* Client; // 多账号 +}; + +struct ReqQueryData_STRUCT +{ + char KHH[32]; // 120_客户号 + char ZJZH[32]; // 121_资金帐号 + char GDDM[32]; // 123_股东代码 + char KSRQ[32]; + char ZZRQ[32]; + char ZQDM[32]; + int RZRQBS; // 281_融资融券标识 + + bool bAll; + + void* Client; // 多账号 + //请求类型 + int requestType; }; // 股东列表 @@ -53,21 +129,39 @@ struct GDLB_STRUCT char RZRQBS[32]; // 281_融资融券标识 char YMTZH[32]; // 5925_一码通账号 char BLXX[32]; // 1213_保留信息 + char JB[32]; // 1233_句柄 int ZHLB_; // 125_帐号类别 int RZRQBS_; // 281_融资融券标识 + + void* Client; // 多账号 +}; + +// 为了处理银河证券没有资金账号,只有句柄的问题 +// 149和101都会返回资金账号,但149不一定会出现 +struct REQ148_STRUCT +{ + char CPZH[32]; // 120_产品账号 + char ZHLB[32]; // 125_帐号类别 + char FJYZHBZ[32]; // 1224_非交易帐号标志 + char RZRQBS[32]; // 281_融资融券标识 + char BLXX[32]; // 1213_保留信息 + + void* Client; // 多账号 }; // 当日委托/历史委托=委托列表 struct WTLB_STRUCT { + char KHH[32]; // 120_客户号 + char ZJZH[32]; // 121_资金帐号 char WTRQ[32]; // 142_委托日期 char WTSJ[32]; // 143_委托时间 char GDDM[32]; // 123_股东代码 char ZQDM[32]; // 140_证券代码 char ZQMC[32]; // 141_证券名称 - char MMBZ[32]; // 130_买卖标志 - char WTLB[32]; // 131_委托类别 + char MMBZ[32]; // 130_买卖标志 *由于很多特别的指令都是3,只能想法解析中文 + char WTLB[32]; // 131_委托类别 * char JYSDM[32]; // 100_交易所代码 char WTJG[32]; // 145_委托价格 char WTSL[32]; // 144_委托数量 @@ -75,15 +169,23 @@ struct WTLB_STRUCT char CJSL[32]; // 152_成交数量 char CDSL[32]; // 162_撤单数量 char WTBH[32]; // 146_委托编号 - char BJFS[32]; // 194_报价方式 + char WTFS[32]; // 166_委托方式 *有些版本没有此字段,只能想法解析中文 + char BJFS[32]; // 194_报价方式 * char ZTSM[32]; // 147_状态说明 char DJZJ[32]; // 161_冻结资金 char BLXX[32]; // 1213_保留信息 + char JB[32]; // 1233_句柄 + + //char WTJE[32]; // 148_委托金额 + //char CJJE[32]; // 154_成交金额 + char ZHLB[32]; // 125_帐号类别 + int WTRQ_; int WTSJ_; - char MMBZ_; - char JYSDM_; + int MMBZ_; + int WTLB_; + int JYSDM_; double WTJG_; int WTSL_; double CJJG_; @@ -92,6 +194,13 @@ struct WTLB_STRUCT double DJZJ_; int ZTSM_; int BJFS_; + int WTFS_; + + //double WTJE_; + //double CJJE_; + int ZHLB_; + + void* Client; // 多账号 }; // 成交列表 @@ -118,8 +227,8 @@ struct CJLB_STRUCT int CJRQ_; int CJSJ_; - char MMBZ_; - char WTLB_; + int MMBZ_; + int WTLB_; double CJJG_; int CJSL_; double FSJE_; @@ -128,7 +237,9 @@ struct CJLB_STRUCT double YHS_; double GHF_; double CJF_; - char CDBZ_; + int CDBZ_; + + void* Client; // 多账号 }; @@ -150,6 +261,7 @@ struct GFLB_STRUCT char JYSDM[32]; // 100_交易所代码 char JYSMC[32]; // 101_交易所名称 char BLXX[32]; // 1213_保留信息 + char JB[32]; // 1233_句柄 int ZQSL_; int KMSL_; @@ -157,6 +269,8 @@ struct GFLB_STRUCT double DQJ_; double ZXSZ_; double DJSL_; + + void* Client; // 多账号 }; // 资金余额 @@ -175,6 +289,8 @@ struct ZJYE_STRUCT double ZZC_; double KQZJ_; double ZXSZ_; + + void* Client; // 多账号 }; struct HQ_STRUCT @@ -246,6 +362,8 @@ struct HQ_STRUCT double ZXMCBDJW_; // 227_最小卖出变动价位 double ZTJG_; // 940_涨停价格 double DTJG_; // 941_跌停价格 + + void* Client; // 多账号 }; // @@ -253,13 +371,143 @@ struct HQ_STRUCT //// 以下的在整理完后要删除 // +// +//// 登录结果 +//struct DLJG_STRUCT +//{ +// char COL1[128]; +// char COL2[128]; +// char COL3[128]; +// +// void* Client; // 多账号 +//}; + +//////////////////////////////////////////////////////////////////////////// +// 打新相关结构体 + +// 新股配号查询 REQUEST_XGSG_XGPHCX 1116 +struct XGPHCX_STRUCT +{ + char PHRQ[32]; // 170_配号日期 + char ZQDM[32]; // 140_证券代码 + char ZQMC[32]; // 141_证券名称 + char QSPH[32]; // 171_起始配号 + char PHSL[32]; // 172_配号数量 + char ZHLB[32]; // 125_帐号类别 + char BLXX[32]; // 1213_保留信息 + + int PHRQ_; + int QSPH_; + int PHSL_; + int ZHLB_; + + void* Client; // 多账号 +}; + +// 新股中签查询 REQUEST_XGSG_XGZQCX 1126 +struct XGZQCX_STRUCT +{ + char CJRQ[32]; // 150_成交日期 + char ZQDM[32]; // 140_证券代码 + char ZQMC[32]; // 141_证券名称 + char CJJG[32]; // 153_成交价格 + char ZQS[32]; // 174_中签数 + char ZHLB[32]; // 125_帐号类别 + char BLXX[32]; // 1213_保留信息 + + int CJRQ_; + int CJJG_; + int ZQS_; + int ZHLB_; + + void* Client; // 多账号 +}; + +// 可申购新股查询 REQUEST_XGSG_KSGXGCX 1156 +struct KSGXGCX_STRUCT +{ + char ZQDM[32]; // 140_证券代码 + char ZQMC[32]; // 141_证券名称 + char FXJG[32]; // 418_发行价格 + char ZDSL[32]; // 962_最低数量 + char ZGSL[32]; // 961_最高数量 + char WTSL[32]; // 144_委托数量 + char WTRQ[32]; // 142_委托日期 + char JYSDM[32]; // 100_交易所代码 + char JYSMC[32]; // 101_交易所名称 + char CZSJ[32]; // 50_(参数)操作数据 + char JB[32]; // 1233_句柄 + char BLXX[32]; // 1213_保留信息 + + char SGSX[32]; // 5905_申购上限 + char WTJG[32]; // 145_委托价格 + char ZHLB[32]; // 125_帐号类别 -// 登录结果 -struct DLJG_STRUCT + double FXJG_; + double ZDSL_; + double ZGSL_; + double WTSL_; + int WTRQ_; + int JYSDM_; + double SGSX_; + double WTJG_; + int ZHLB_; + + void* Client; // 多账号 +}; + +// 新股申购额度查询 REQUEST_XGSG_XGSGEDCX 1340 +struct XGSGEDCX_STRUCT { - char COL1[128]; - char COL2[128]; - char COL3[128]; + char ZJZH[32]; // 121_资金帐号 + char CS[32]; // 1227_参数 + char ZHLB[32]; // 125_帐号类别 + char GDDM[32]; // 123_股东代码 + char JYSMC[32]; // 101_交易所名称 + char XGSGED[32]; // 5679_新股申购额度 + char KSGED[32]; // 5801_可申购额度,光大证券 + char CZSJ[32]; // 50_(参数)操作数据 + char JB[32]; // 1233_句柄 + char BLXX[32]; // 1213_保留信息 + + char SGED_961[32]; // 961_申购额度,在申万宏源中居然也是961 + char XGSGED_5564[32]; // 5564_新股申购额度 + char XGSGED_5718[32]; // 5718_新股申购额度 + char KHSZED_5759[32]; // 5759_客户市值额度 + char ZHED[32]; // 5772_账户额度 + + + double CS_; + double XGSGED_; + int ZHLB_; + double SGED_961_; + double XGSGED_5564_; + double XGSGED_5718_; + double KSGED_; + double ZHED_; + double KHSZED_5759_; + + void* Client; // 多账号 +}; + +// 新股申购待缴款查询 REQUEST_XGSG_XGSGDJKCX 1370 +struct XGSGDJKCX_STRUCT +{ + char ZQDM[32]; // 140_证券代码 + char ZQS[32]; // 174_中签数 + char FQSL[32]; // 98_放弃数量 + char ZQJE[32]; // 1088_中签金额 + char QKZJ[32]; // 1091_缺口资金 + char GDDM[32]; // 123_股东代码 + char ZHLB[32]; // 125_帐号类别 + char CZSJ[32]; // 50_(参数)操作数据 + char JB[32]; // 1233_句柄 + char BLXX[32]; // 1213_保留信息 + + double CS_; + double XGSGED_; + + void* Client; // 多账号 }; #endif diff --git a/include/Tdx/win32/TdxApi.dll b/include/Tdx/win32/TdxApi.dll index 8dcc513..3522288 100644 Binary files a/include/Tdx/win32/TdxApi.dll and b/include/Tdx/win32/TdxApi.dll differ diff --git a/include/Tdx/win32/TdxApi.lib b/include/Tdx/win32/TdxApi.lib index 6edd127..71ec723 100644 Binary files a/include/Tdx/win32/TdxApi.lib and b/include/Tdx/win32/TdxApi.lib differ diff --git a/include/Tdx/win32/TdxApiDemo.exe b/include/Tdx/win32/TdxApiDemo.exe index 7153582..347e4be 100644 Binary files a/include/Tdx/win32/TdxApiDemo.exe and b/include/Tdx/win32/TdxApiDemo.exe differ diff --git a/include/Tdx/win32/TdxInjector.exe b/include/Tdx/win32/TdxInjector.exe index 66f2dc3..995707a 100644 Binary files a/include/Tdx/win32/TdxInjector.exe and b/include/Tdx/win32/TdxInjector.exe differ diff --git a/include/Tdx/win32/TdxSpoofer.dll b/include/Tdx/win32/TdxSpoofer.dll new file mode 100644 index 0000000..36d14b5 Binary files /dev/null and b/include/Tdx/win32/TdxSpoofer.dll differ diff --git a/include/Tdx/win32/login.ini b/include/Tdx/win32/login.ini index d14350c..4057ad7 100644 --- a/include/Tdx/win32/login.ini +++ b/include/Tdx/win32/login.ini @@ -3,4 +3,6 @@ TdxPath=D:\new_hbzq_qq\ LuaFile=D:\new_hbzq_qq\Login.lua [LOGIN] Account=05000000000 -Password=123456 \ No newline at end of file +Password=123456 +Code= +ZJZH= \ No newline at end of file diff --git "a/include/Tdx/win32/\345\256\242\346\210\267\345\256\232\345\210\266\347\211\210\351\200\232\350\276\276\344\277\241\346\216\245\345\217\243\345\260\201\350\243\205_\344\275\277\347\224\250\346\211\213\345\206\214.doc" "b/include/Tdx/win32/\345\256\242\346\210\267\345\256\232\345\210\266\347\211\210\351\200\232\350\276\276\344\277\241\346\216\245\345\217\243\345\260\201\350\243\205_\344\275\277\347\224\250\346\211\213\345\206\214.doc" new file mode 100644 index 0000000..4647ef7 Binary files /dev/null and "b/include/Tdx/win32/\345\256\242\346\210\267\345\256\232\345\210\266\347\211\210\351\200\232\350\276\276\344\277\241\346\216\245\345\217\243\345\260\201\350\243\205_\344\275\277\347\224\250\346\211\213\345\206\214.doc" differ diff --git a/include/UFX/data_def.h b/include/UFX/data_def.h new file mode 100644 index 0000000..812e313 --- /dev/null +++ b/include/UFX/data_def.h @@ -0,0 +1,147 @@ +#ifndef DATA_DEF_H_ +#define DATA_DEF_H_ + +//33100 (ڲṹ->ģ) +struct CMarketInfo_UFX +{ + char quote_type; //(0-ͨ1-) + int quote_length; //ݳȣӵ3ֶοʼһֶμ㳤ȣ + int update_time; //ʱ(eg:144510500,144510500) + int quote_index; // + char futu_exch_type[5]; // + char commodity_type[7]; //Ʒ + char contract_code[31]; //Լ + double pre_settlement_price; //ս + double pre_close_price; //̼ + double pre_open_interest; //տ + double pre_delta; //ʵ + double futu_open_price; //̼ + double futu_last_price; //¼۸ + double buy_high_price; // + double buy_high_amount; // + double sale_low_price; //ۼ۸ + double sale_low_amount; // + double futu_high_price; //߼ + double futu_low_price; //ͼ + double uplimited_price; //ͣ + double downlimited_price; //ͣ + double average_price; // + double change_direction; // + double business_amount; //ɽ + double open_interest; //ܳ + double business_balance; //ɽ + double futu_close_price; //̼ + double settlement_price; // + int actionday; //ǰ(yyyymmdd) +}; + +//33101 ίлر +struct COrderRspInfo_UFX +{ + char entrust_no[10]; //ίк + char futures_account[13]; //ױ + char futu_exch_type[4]; //F1-֣F2-F3Ϻ-F4н + char contract_code[31]; //Լ + char entrust_bs; //ʶ(1- 2-) + char entrust_direction; //ƽʶ(1-2-ƽ4-ƽ֣Ϊ) + char hedge_type; //ױʶ(0-Ͷ1-ױ2-) + char fund_account[19]; //ʽ˻ + char futu_report_no[22]; //ص + char firm_no[22]; //Ա + char operator_no[19]; //Ա + int client_group; //ͻ + double entrust_amount; //ί + double business_total_amount; //ɽ + double cacel_amount; // + double entrust_price; //ίм۸ + char entrust_status; //ί״̬ + int branch_no; //Ӫҵ + int batch_no; //ί + char futu_entrust_type; //ί + int amount_per_hand; //Լ + char forceclose_reason; //ǿƽԭ + char init_date[9]; // + char curr_time[9]; //ǰʱ + char confirm_no[21]; // + char entrust_occasion[33]; //ίг + double entrust_price2; //ί(ί۸) + char futu_entrust_prop[4]; //ڻί + char arbitrage_code[31]; //ί + char entrust_reference[33]; //ί + char error_message[33]; //˵ + char position_str[33]; //λ + //int request_id; // + //int session_id; //Ự +}; + +//33101 ɽر +struct CRealRspInfo_UFX +{ + char entrust_no[10]; //ίк + char futures_account[13]; //ױ + char futu_exch_type[5]; // + char business_no[10]; //ɽ + char contract_code[31]; //Լ + char entrust_bs; //ʶ(1- 2-) + char entrust_direction; //ƽʶ(1-2-ƽ3-ƽ Ϊ) + double business_price; //ɽ۸ + double business_amount; //ɽ + char hedge_type; //ױʶ(0-Ͷ1-ױ2-) + char fund_account[19]; //ʽ˻ + char futu_report_no[22]; //ص + char firm_no[22]; //Ա + char operator_no[18]; //Ա + int client_group; //ͻ + double entrust_amount; //ί + double business_total_amount; //ɽ + double cacel_amount; // + double entrust_price; //ίм۸ + char entrust_status; //ί״̬ + int branch_no; //Ӫҵ + int batch_no; //ί + char futu_entrust_type; //ί + int amount_per_hand; //Լ + char forceclose_reason; //ǿƽԭ + char init_date[9]; // + char business_time[9]; //ɽʱ + char confirm_no[21]; // + char entrust_occasion[33]; //ίг + double entrust_price2; //ί(ί۸) + char futu_entrust_prop[4]; //ڻί + char arbitrage_code[31]; //ί + char entrust_reference[33]; //ί + char position_str[33]; //λ + //int request_id; //(ʱ) + //int session_id; //Ự(ʱ) +}; + +//33102 (ڲṹ->ģ) +struct CArgMarketInfo_UFX +{ + char arbicontract_id[31]; //Լ + char futu_exch_type[5]; // + char first_code[31]; //һ + char second_code[31]; //ڶ + char weave_type; //1-SPD, 2 -IPS + double buy_price; // + double buy_amount; // + double buy_total_amount; //ȫ + double sale_price; //ۼ۸ + double sale_amount; // + double sale_total_amount; //ȫ + double futu_high_price; //߼ + double futu_low_price; //ͼ + double uplimited_price; //ͣ۸ + double downlimited_price; //ͣ۸ +}; + +//33105 ״̬֪ͨ +struct CExchangeStatus_UFX +{ + char futu_exch_type[5]; //F1-֣F2-F3Ϻ-F4? + char exch_status; //״̬0ӶϿ,1ǰ, 2ϱ + char entrade_flag; //Ƿɽף0ɽף1ɽף +}; + +#endif //DATA_DEF_H_ + diff --git a/include/UFX/t2sdk_interface.h b/include/UFX/t2sdk_interface.h new file mode 100644 index 0000000..eea68e5 --- /dev/null +++ b/include/UFX/t2sdk_interface.h @@ -0,0 +1,1432 @@ +/** @file +* T2_SDKͷļ +* @author T2С +* @author ӹɷ޹˾ +* @version 1.0.0.2 +* @date 20090327 +*/ + +#include +#include + +#ifndef _T2SDK_INTERFACE_H +# define _T2SDK_INTERFACE_H + +#ifdef _WIN32 + #if !defined( FUNCTION_CALL_MODE ) + #define FUNCTION_CALL_MODE __stdcall + #endif +#else + #define FUNCTION_CALL_MODE +#endif + +struct IKnown +{ + virtual unsigned long FUNCTION_CALL_MODE QueryInterface(const char *iid, IKnown **ppv) = 0; + + virtual unsigned long FUNCTION_CALL_MODE AddRef() = 0; + + virtual unsigned long FUNCTION_CALL_MODE Release() = 0; +}; + + +#include + +#ifdef _WIN32 +typedef unsigned int uint32; +#else +#include +#if defined(__linux__) +#include +#endif +typedef uint32_t uint32; +#endif + +///ESBȣΪɼַܰʵָո񡢷ֺ; +#define IDENTITY_NAME_LENGTH 32 +///ʵռλ +#define ID_LENGTH 4 +///ڵȫ,ʱʹchar sName[ID_STR_LEN+1] +#define ID_STR_LEN (IDENTITY_NAME_LENGTH + ID_LENGTH + 1) + + +// ӿ󳤶,ʱʹchar sName[PLUGINID_LENGTH+1] +#define PLUGINID_LENGTH 256 +// ʵ󳤶,ʱʹchar sName[PLUGIN_NAME_LENGTH+1] +#define PLUGIN_NAME_LENGTH (PLUGINID_LENGTH+ID_LENGTH+1) +// 󳤶.ʱʹchar sName[SVR_NAME_LENGTH+1] +#define SVR_NAME_LENGTH 256 +// ʵ󳤶.ʱʹchar sName[PLUGINID_NAME_LENGTH+1] +#define SVRINSTANCE_NAME_LENGTH (SVR_NAME_LENGTH+ID_LENGTH+1) +//ҵϢ + + +// +#define REQUEST_PACKET 0 +//Ӧ +#define ANSWER_PACKET 1 +//20110302 xuxp ·ϢĽṹ嶨 +typedef struct tagRouteInfo +{ + char ospfName[ID_STR_LEN+1]; + char nbrName[ID_STR_LEN+1]; + char svrName[SVRINSTANCE_NAME_LENGTH+1]; + char pluginID[PLUGIN_NAME_LENGTH+1]; + int connectID; + int memberNO; + + tagRouteInfo() + { + memset(this,0,sizeof(tagRouteInfo)); + } +}Route_Info; + + +//20101228 xuxp Ϊ˷ͺͷضϢӵĽṹĶ +typedef struct tagRequestData +{ + int sequeceNo; + int issueType; + void* lpKeyInfo; + int keyInfoLen; + void* lpFileHead; + int fileHeadLen; + int packetType;//20100111 xuxp ¼ӵİ + Route_Info routeInfo;//20110302 xuxp ·Ϣ +}REQ_DATA, *LPREQ_DATA; +typedef struct tagRespondData +{ + int functionID; + int returnCode; + int errorNo; + char* errorInfo; + int issueType; + void* lpKeyInfo; + int keyInfoLen; + Route_Info sendInfo;//20110302 xuxp ӦӷϢ +}RET_DATA, *LPRET_DATA; + + +///ӿ +struct IF2ResultSet : public IKnown +{ + + ///ȡֶ + /**@return ֶ. + */ + virtual int FUNCTION_CALL_MODE GetColCount()=0; + + ///ȡֶ + /** @param column:ֶ(0Ϊ) + * @return ֶ ±Խ NULL + */ + virtual const char * FUNCTION_CALL_MODE GetColName(int column)=0; + + //ȡֶ + /** @param column:ֶ(0Ϊ) + * @return:泣;±Խ -1 + */ + virtual char FUNCTION_CALL_MODE GetColType(int column)=0; + + + ///ȡֶСλ + /** @param column:ֶ(0Ϊ) + * @return int ֶСλ ±Խ -1 + */ + virtual int FUNCTION_CALL_MODE GetColScale(int column)=0; + + //ȡֶݵ. + /** @param column:ֶ(0Ϊ) + * @return int ֶο ±Խ -1 + */ + virtual int FUNCTION_CALL_MODE GetColWidth(int column) = 0; + + ///ȡֶӦֶ + /**@param columnName: ֶ + *@return ֶ. ڷ-1 + */ + virtual int FUNCTION_CALL_MODE FindColIndex(const char * columnName)=0; + + // + //ֶ(0Ϊ)ȡֵֶ(ַ) + /**@param column:ֶ(0Ϊ) + *@return ֵֶַ,±Խ緵NULL + */ + virtual const char * FUNCTION_CALL_MODE GetStrByIndex(int column)=0; + + //ֶȡֵֶ(ַ) + /**@param columnName: ֶ + *@return ֵֶַ,ڷNULL + */ + virtual const char * FUNCTION_CALL_MODE GetStr(const char * columnName)=0; + + //ֶ(0Ϊ)ȡֵֶ + /**@param column:ֶ(0Ϊ) + *@return ֵֶַ,±Խ緵'\0'. + */ + virtual char FUNCTION_CALL_MODE GetCharByIndex(int column)=0; + + //ֶȡֵֶ + /**@param columnName: ֶ + *@return ֵֶַ,ڷ'\0' + */ + virtual char FUNCTION_CALL_MODE GetChar(const char * columnName)=0; + + //ֶţȡֵֶ + /**@param column:ֶ(0Ϊ) + *@return doubleֵֶ,±Խ緵0 + */ + virtual double FUNCTION_CALL_MODE GetDoubleByIndex( int column)=0; + + ///ֶȡֵֶ + /**@param columnName:ֶ + *@return doubleֵֶ,ڷ0 + */ + virtual double FUNCTION_CALL_MODE GetDouble(const char * columnName)=0; + + ///ֶţȡֵֶ + /**@param column:ֶ(0Ϊ) + *@return intֵֶ,±Խ緵0 + */ + virtual int FUNCTION_CALL_MODE GetIntByIndex(int column)=0; + + ///ֶȡֵֶ + /**@param columnName:ֶ + *@return intֵֶ,ڷ0 + */ + virtual int FUNCTION_CALL_MODE GetInt(const char * columnName)=0; + + ///ֶŻֵֶ, + /**@param column: ֶ(0Ϊ) + *@param lpRawLen: [out]ݳ + *@return : ׵ַ + */ + virtual void * FUNCTION_CALL_MODE GetRawByIndex(int column,int * lpRawLen) = 0; + + ///ֶȡֵֶ + /**@param columnName:ֶ + *@param lpRawLen: [out]ݳ + *@return : ׵ַ + */ + virtual void * FUNCTION_CALL_MODE GetRaw(const char * columnName,int * lpRawLen) = 0; + + + ///һȡֵֶǷΪNULL + /**@return 0 ǣ 1 + */ + virtual int FUNCTION_CALL_MODE WasNull()=0; + + ///ȡһ¼ + virtual void FUNCTION_CALL_MODE Next()=0; + + ///жǷΪβ + /**@return 1 ǣ0 ; + */ + virtual int FUNCTION_CALL_MODE IsEOF()=0; + + ///жǷΪ + /**@return 1 ǣ0 ; + */ + virtual int FUNCTION_CALL_MODE IsEmpty()=0; + + virtual void * FUNCTION_CALL_MODE Destroy() = 0; +}; + +struct IF2UnPacker; + +///ӿ(һж칹) +/**ִ: + * + * 0׼(ѡ, иò, IF2Packerڲڴ滺) SetBuffer(),ɵṩ,BeginPack()֮ǰ׼; + * + * 1ʼ: BeginPack(),λ; + * + * 2һ + * + *(a)ֶбAddField() + * + *(b)սά˳ֶΣ¼ֶݣAddStr() {AddInt(), AddDouble(), AddRaw()} + * + * 3ýķ(ѡ, 򷵻Ϊ0) SetReturnCode() + * + * 4һ(ѡ) NewDataSet()˴ͬʱ˸ýķ룻 + * + * 5ο2ʵһ(ѡ) + * + * 6EndPack(),ظûᵼ¼ս; + * + * 7ȡ(Сݳ) + * ҲֱӽUnPack()ؽӿ + * + *ʹע:IF2Packerʹõڴ滺ɵ߸գ + * ķ룬ֻڰʽ汾0x21ʱЧ + */ +struct IF2Packer : public IKnown +{ + ///ʼ(ʹõߵĻ) + /** һʹôʱʹñúû(ݳȱΪiDataLen) + *@param char * pBuf ַ + *@param int iBufSize ռ + *@param int iDataLen ݳȣݼֻ֮V1.0ʽİЧ + */ + virtual void FUNCTION_CALL_MODE SetBuffer(void * pBuf,int iBufSize,int iDataLen=0 )=0; + + ///λ¿ʼһ(ֶ¼Ϊ00) + /** + * ܣʼѰ(ظʹеĻռ) + *@return + */ + virtual void FUNCTION_CALL_MODE BeginPack(void)=0; + + ///ʼһ + /**ڴ򵥽İʱԲñ,ȡĬֵ + *@param const char *szDatasetName 0x20Ҫָ + *@param int iReturnCode 0x20ҪΪÿֵָ + */ + virtual int FUNCTION_CALL_MODE NewDataset(const char *szDatasetName, int iReturnCode = 0)=0; + + /** + * ܣֶ + * + *ִдҪ: NewDataset()Reset(),SetBuffer()֮,ֶΰ˳; + * + *@param szFieldNameֶ + *@param cFieldType ֶ:IFCַSַR + *@param iFieldWidth ֶοȣռֽ + *@param iFieldScale ֶξ,cFieldType='F'ʱСλ(ȱʡΪ4λС) + *@return ʾʧܣΪĿǰij + */ + virtual int FUNCTION_CALL_MODE AddField(const char *szFieldName,char cFieldType ='S',int iFieldWidth=255,int iFieldScale=4)=0; + + /** + * ܣַ + * ִдҪ:ֶ֮,ֶΰ˳; + *@param szValueַ + *@return ʾʧܣΪĿǰij + */ + virtual int FUNCTION_CALL_MODE AddStr(const char *szValue)=0; + + /** + * ܣ + *@param iValue + *@return ʾʧܣΪĿǰij + */ + virtual int FUNCTION_CALL_MODE AddInt(int iValue)=0; + + /** + * ܣӸ + *@param fValue + *@return ʾʧܣΪĿǰij + */ + virtual int FUNCTION_CALL_MODE AddDouble(double fValue)=0; + + /** + * ܣһַ + *@param cValueַ + *@return ʾʧܣΪĿǰij + */ + virtual int FUNCTION_CALL_MODE AddChar(char cValue)=0; + + /** + * ܣһ + *@param void * lpBuff + *@param int iLen ݳ + *@return ʾʧܣΪĿǰij + */ + virtual int FUNCTION_CALL_MODE AddRaw(void * lpBuff,int iLen)=0; + + /// + virtual void FUNCTION_CALL_MODE EndPack()=0; + + /** + * ܣȡָ + *@return ָ + */ + virtual void * FUNCTION_CALL_MODE GetPackBuf(void) = 0; + + /** + * ܣȡ + *@return + */ + virtual int FUNCTION_CALL_MODE GetPackLen(void) = 0; + + /** + * ܣȡС + *@return С + */ + virtual int FUNCTION_CALL_MODE GetPackBufSize(void) = 0; + + /** + * ܣȡʽ汾 + *@return 汾 + */ + virtual int FUNCTION_CALL_MODE GetVersion(void) = 0; + + ///ýķ(0x20Ҫ)Ҫ + /**ȡȱʡֵ0ããEndPack()֮ǰ + *@return 汾 + */ + virtual void FUNCTION_CALL_MODE SetReturnCode(unsigned long dwRetCode) = 0; + + /**ֱӷصǰĽӿ,EndPack()֮ܵ,ڴͷʱӦĽʵҲͷ + *@return ӿڣ˽ӿڲܵ destroy()ͷ + */ + virtual IF2UnPacker * FUNCTION_CALL_MODE UnPack(void) = 0; + + /** + * + */ + virtual void FUNCTION_CALL_MODE FreeMem(void* lpBuf) = 0; + + /** + * + */ + virtual void FUNCTION_CALL_MODE ClearValue() = 0; + + + //20110302 xuxp һӿںݵһ + ///λ¿ʼһ(ֶ¼Ϊ00) + /** + * ܣʼѰ(ظʹеĻռ) + *@return + */ + virtual void FUNCTION_CALL_MODE BeginPackEx(char* szName = NULL) = 0; + + //20110324 dongpf һӿںλǰ + ///λǰ(ֶ¼Ϊ00)Ӱ + /** + * ܣλǰ + *@return + */ + virtual void FUNCTION_CALL_MODE ClearDataSet() = 0; +}; + +///ӿ +struct IF2UnPacker : public IF2ResultSet +{ + /**ȡʽ汾 + *@return 汾 + */ + virtual int FUNCTION_CALL_MODE GetVersion(void) = 0; + + /**ȡݳ + *@return 0 ʾɹ Ϊʧ + */ + virtual int FUNCTION_CALL_MODE Open(void * lpBuffer,unsigned int iLen) = 0; + + ///ȡ(0x20ϰ汾֧) + virtual int FUNCTION_CALL_MODE GetDatasetCount()=0; + + ///õǰ(0x20ϰ汾֧) + /** + *@param int nIndex + *@return int 0ʾɹΪʧ + */ + virtual int FUNCTION_CALL_MODE SetCurrentDatasetByIndex(int nIndex)=0; + + ///õǰ (0x20ϰ汾֧) + /** + *@param const char *szDatasetName + *@return int 0 ʾɹΪʧ + */ + virtual int FUNCTION_CALL_MODE SetCurrentDataset(const char *szDatasetName)=0; + + /** ȡָ + *@return ָ + */ + virtual void * FUNCTION_CALL_MODE GetPackBuf(void) = 0; + + /** ȡݳ + *@return ݳ + */ + virtual unsigned int FUNCTION_CALL_MODE GetPackLen(void) = 0; + + /**ȡݼ¼,20051207Ժ汾֧ + *@return ¼ + */ + virtual unsigned int FUNCTION_CALL_MODE GetRowCount(void) = 0; +}; + +///Ӷ CConnectionInterface IJöCConfigInterface +/** +* ļء浽ļд +*/ +class CConfigInterface: public IKnown +{ +public: + /** + * ļ + * @param szFileName ļʽiniοʾ + * @return 0ʾɹʧ + */ + virtual int FUNCTION_CALL_MODE Load(const char *szFileName) = 0; + + /** + * 浽ļ + * @param szFileName ļ + * @return 0ʾɹʧ + */ + virtual int FUNCTION_CALL_MODE Save(const char *szFileName) = 0; + + /** + * ȡֵַ + * @param szSection + * @param szEntry + * @param szDefault ȱʡֵ + * @return ֵַûҵʱszDefault + */ + virtual const char * FUNCTION_CALL_MODE GetString(const char *szSection, const char *szEntry, const char *szDefault) = 0; + + /** + * ȡֵ + * @param szSection + * @param szEntry + * @param iDefault ȱʡֵ + * @return ֵûҵʱiDefault + */ + virtual int FUNCTION_CALL_MODE GetInt(const char *szSection, const char *szEntry, int iDefault) = 0; + + /** + * ֵַ + * @param szSection + * @param szEntry + * @param szValue ֵ + * @return 0ʾɹʧ + */ + virtual int FUNCTION_CALL_MODE SetString(const char *szSection, const char *szEntry, const char *szValue) = 0; + + /** + * ֵ + * @param szSection + * @param szEntry + * @param iValue ֵ + * @return 0ʾɹʧ + */ + virtual int FUNCTION_CALL_MODE SetInt(const char *szSection, const char *szEntry, int iValue) = 0; +}; + + +typedef struct tagBizRouteInfo +{ + char ospfName[ID_STR_LEN+1];//·Ŀڵм + char nbrName[ID_STR_LEN+1];//мڵھ + char svrName[SVRINSTANCE_NAME_LENGTH+1];//мĽ + char pluginID[PLUGIN_NAME_LENGTH+1];//м + int connectID;//Ӻ + int memberNO;//Ա + + tagBizRouteInfo() + { + memset(this,0,sizeof(tagBizRouteInfo)); + } +}BIZROUTE_INFO; + + +struct IBizMessage : IKnown +{ + //ùܺ + virtual void FUNCTION_CALL_MODE SetFunction(const int nFUnctionNo) = 0; + //ȡܺ + virtual int FUNCTION_CALL_MODE GetFunction() = 0; + + //ð + virtual void FUNCTION_CALL_MODE SetPacketType(const int nPacketType) = 0; + //ȡ + virtual int FUNCTION_CALL_MODE GetPacketType() = 0; + + //Ӫҵ + virtual void FUNCTION_CALL_MODE SetBranchNo(const int nBranchNo) = 0; + //ȡӪҵ + virtual int FUNCTION_CALL_MODE GetBranchNo() = 0; + + //ϵͳ + virtual void FUNCTION_CALL_MODE SetSystemNo(const int nSystemNo) = 0; + //ȡϵͳ + virtual int FUNCTION_CALL_MODE GetSystemNo() = 0; + + //ϵͳ + virtual void FUNCTION_CALL_MODE SetSubSystemNo(const int nSubSystemNo) = 0; + //ȡϵͳ + virtual int FUNCTION_CALL_MODE GetSubSystemNo() = 0; + + //÷߱ + virtual void FUNCTION_CALL_MODE SetSenderId(const int nSenderId) = 0; + //ȡ߱ + virtual int FUNCTION_CALL_MODE GetSenderId() = 0; + + //ð + virtual void FUNCTION_CALL_MODE SetPacketId(const int nPacketId) = 0; + //ȡ + virtual int FUNCTION_CALL_MODE GetPacketId() = 0; + + //Ŀĵ· + virtual void FUNCTION_CALL_MODE SetTargetInfo(const BIZROUTE_INFO targetInfo) = 0; + //ȡĿĵ· + virtual void FUNCTION_CALL_MODE GetTargetInfo(BIZROUTE_INFO& targetInfo) = 0; + + //÷· + virtual void FUNCTION_CALL_MODE SetSendInfo(const BIZROUTE_INFO sendInfo) = 0; + //ȡ· + virtual void FUNCTION_CALL_MODE GetSendInfo(BIZROUTE_INFO& sendInfo) = 0; + + //ô + virtual void FUNCTION_CALL_MODE SetErrorNo(const int nErrorNo) = 0; + //ȡ + virtual int FUNCTION_CALL_MODE GetErrorNo() = 0; + + //ôϢ + virtual void FUNCTION_CALL_MODE SetErrorInfo(const char* strErrorInfo) = 0; + //ȡϢ + virtual const char* FUNCTION_CALL_MODE GetErrorInfo() = 0; + + //÷ + virtual void FUNCTION_CALL_MODE SetReturnCode(const int nReturnCode) = 0; + //ȡ + virtual int FUNCTION_CALL_MODE GetReturnCode() = 0; + + //ҵ + virtual void FUNCTION_CALL_MODE SetContent(void* lpContent,int iLen) = 0; + //ȡҵ + virtual const void* FUNCTION_CALL_MODE GetContent(int& iLen) = 0; + + //½ӿϢ1.0Ķ + //ö + virtual void FUNCTION_CALL_MODE SetIssueType(const int nIssueType) = 0; + //ȡ + virtual int FUNCTION_CALL_MODE GetIssueType() = 0; + + // + virtual void FUNCTION_CALL_MODE SetSequeceNo(const int nSequeceNo) = 0; + //ȡ + virtual int FUNCTION_CALL_MODE GetSequeceNo() = 0; + + //ùؼֶϢ + virtual void FUNCTION_CALL_MODE SetKeyInfo(void* lpKeyData,int iLen) = 0; + //ȡؼֶϢ + virtual const void* FUNCTION_CALL_MODE GetKeyInfo(int& iLen) = 0; + + //øݣʱԭ + virtual void FUNCTION_CALL_MODE SetAppData(const void* lpAppdata,int nAppLen) = 0; + //ȡݣʱԭ + virtual const void* FUNCTION_CALL_MODE GetAppData(int& nAppLen) = 0; + + //תӦ + virtual int FUNCTION_CALL_MODE ChangeReq2AnsMessage() = 0; + + //ȡ + virtual void* FUNCTION_CALL_MODE GetBuff(int& nBuffLen) = 0; + // + virtual int FUNCTION_CALL_MODE SetBuff(const void* lpBuff,int nBuffLen) = 0; +}; + +#define IDENTITY_NAME_LENGTH 32 /**< ͻֳ */ +#define MAX_MACADDRESS_LEN 18 /**< MAC ַ */ +#define MAX_RAND_LEN 4 /**< */ + +/** ͻʶ */ +#define MAX_BIZNAME_LEN \ + IDENTITY_NAME_LENGTH+1+MAX_MACADDRESS_LEN+1+MAX_RAND_LEN+2 + +#define INIT_RECVQ_LEN 256 /**< նгʼ */ +#define STEP_RECVQ_LEN 512 /**< նչ */ +#define SIMPLIFIED_CHINESE 0 /**< Ϣ: */ +#define ENGLISH 1 /**< Ϣ:Ӣ */ +#define MAX_FILTERFIELD_LEN 63 /**< ֶγ */ + +/** ɿȼ */ +enum ReliableLevel +{ + LEVEL_DOBEST = 0, /**< Ϊ */ + LEVEL_DOBEST_BYSEQ = 1, /**< */ + LEVEL_MEM = 2, /**< ڴ */ + LEVEL_FILE = 3, /**< ļ */ + LEVEL_SYSTEM = 4 /**< ϵͳ */ +}; + +/** + * ӿ + */ +class CFilterInterface:public IKnown +{ +public: + /** + * ±ȡ + * @param index Ӧű + * @return ضӦ±֣򷵻NULL. + */ + virtual char* FUNCTION_CALL_MODE GetFilterNameByIndex(int index) = 0; + + /** + * ±ȡֵ + * @param index Ӧű + * @return ضӦ±ֵ򷵻NULL. + */ + virtual char* FUNCTION_CALL_MODE GetFilterValueByIndex(int index)= 0; + + /** + * ݹֻȡֵ + * @param fileName ӦĹ + * @return ضӦĹֵֵ򷵻NULL. + */ + virtual char* FUNCTION_CALL_MODE GetFilterValue(char* fileName)= 0; + + /** + * ȡĸ + * @return ضӦĸûз0 + */ + virtual int FUNCTION_CALL_MODE GetCount() = 0; + + /** + * ùݹֵֺ + * @param filterName ӦĹ + * @param filterValue ӦĹֵֵ + */ + virtual void FUNCTION_CALL_MODE SetFilter(char* filterName,char* filterValue) =0; +}; + +/** + * IJӿ + */ +class CSubscribeParamInterface:public IKnown +{ +public: + + /** + * + * @param szName Ӧ + */ + virtual void FUNCTION_CALL_MODE SetTopicName(char* szName) =0; + + /** + * ø + * @param lpData ݵ׵ַ + * @param iLen ݵij + */ + virtual void FUNCTION_CALL_MODE SetAppData(void* lpData,int iLen)=0; + + /** + * ӹ + * @param filterName + * @param filterValue ֵ + */ + virtual void FUNCTION_CALL_MODE SetFilter(char* filterName,char* filterValue)=0; + + /** + * ӷֶ + * @param filedName Ҫӵķֶ + */ + virtual void FUNCTION_CALL_MODE SetReturnFiled(char* filedName)=0; + + /** + * Ƿȱ־ + * @param bFromNow trueʾҪ֮ǰݣҲDzȱfalseʾҪȱ + */ + virtual void FUNCTION_CALL_MODE SetFromNow(bool bFromNow)=0; + + /** + * øǶı־ + * @param bReplace trueʾǶģȡ֮ǰжģֻǰĶģfalseʾ׷Ӷ + */ + virtual void FUNCTION_CALL_MODE SetReplace(bool bReplace)=0; + + /** + * ÷ͼ + * @param nSendInterval λ + */ + virtual void FUNCTION_CALL_MODE SetSendInterval(int nSendInterval)=0; + + /** + * ȡ + * @return Ϣ + */ + virtual char* FUNCTION_CALL_MODE GetTopicName() =0; + + /** + * ȡ + * @param iLen Σʾݵij + * @return ظ׵ַûзNULL + */ + virtual void* FUNCTION_CALL_MODE GetAppData(int *iLen) =0; + + /** + * ȡӦĹֶε + * @param index Ӧű + * @return ضӦ±֣򷵻NULL. + */ + virtual char* FUNCTION_CALL_MODE GetFilterNameByIndex(int index) = 0; + + /** + * ±ȡֵ + * @param index Ӧű + * @return ضӦ±ֵ򷵻NULL. + */ + virtual char* FUNCTION_CALL_MODE GetFilterValueByIndex(int index)= 0; + + /** + * ݹֻȡֵ + * @param fileName ӦĹ + * @return ضӦĹֵֵ򷵻NULL. + */ + virtual char* FUNCTION_CALL_MODE GetFilterValue(char* fileName)= 0; + + /** + * ȡĸ + * @return ضӦĸûз0 + */ + virtual int FUNCTION_CALL_MODE GetFilterCount() = 0; + + /** + * ȡֶ + * @return ضӦķֶϢ + */ + virtual char* FUNCTION_CALL_MODE GetReturnFiled()=0; + + /** + * ȡǷȱı־ + * @return ضӦIJȱ־ + */ + virtual bool FUNCTION_CALL_MODE GetFromNow()=0 ; + + /** + * ȡǷ񸲸Ƕĵı־ + * @return ضӦĸǶı־ + */ + virtual bool FUNCTION_CALL_MODE GetReplace() =0; + + /** + * ȡӦķƵ + * @return ضӦķͼ + */ + virtual int FUNCTION_CALL_MODE GetSendInterval()=0; +}; + +class CSubscribeInterface; + +/** + * @brief Ļصӿڷصݶ壬˶Ҫҵ֮⣬Ҫص + */ +typedef struct tagSubscribeRecvData +{ + char* lpFilterData; /**< ֶεͷָ룬ý */ + int iFilterDataLen; /**< ֶεݳ */ + char* lpAppData; /**< ݵͷָ */ + int iAppDataLen; /**< ݵij */ + char szTopicName[260]; /**< */ + + /** + * tagSubscribeRecvData 캯 + */ + tagSubscribeRecvData() + { + memset(this,0,sizeof(tagSubscribeRecvData)); + } +}SUBSCRIBE_RECVDATA, *LPSUBSCRIBE_RECVDATA; + +/** + * ĻصӿڣϲӦͨӿڣƹϢ + */ +class CSubCallbackInterface: public IKnown +{ +public: + + /** + * յϢĻص + * @param lpSub صĶָ + * @param subscribeIndex ϢӦĶıʶʶSubscribeTopicķ + * @param lpData ϢĶָ룬һϢҵ + * @param nLength ݵij + * @param lpRecvData ϢֶηأҪ˸ݣϢ֣ϸοǰṹ嶨 + * @return + */ + virtual void FUNCTION_CALL_MODE OnReceived(CSubscribeInterface *lpSub,int subscribeIndex, const void *lpData, int nLength,LPSUBSCRIBE_RECVDATA lpRecvData) = 0; + + /** + * յ޳Ϣصһӵ˲Ե»صӿ,ص治ҪȡģײѾȡģֻһ֪ͨӿ + * @param lpSub صĶָ + * @param subscribeIndex ϢӦĶıʶʶSubscribeTopicķ + * @param TickMsgInfo ˵ĴϢҪǰظĶλϢ + * @return + */ + virtual void FUNCTION_CALL_MODE OnRecvTickMsg(CSubscribeInterface *lpSub,int subscribeIndex,const char* TickMsgInfo) = 0; +}; + + +/** + * ĽӿڵĶ + */ +class CSubscribeInterface: public IKnown +{ +public: + + /** + * + * @param lpSubscribeParamInter 涨ĶIJṹ + * @param uiTimeout ʱʱ + * @param lppBizUnPack ҵУʱʧܷصҵϢijɹûзأҪReleaseͷ + ҵУĴϢд£ + IF2UnPacker* lpBizUnPack =NULL; + SubscribeTopic(...,&lpBizUnPack); + ݷֵʧܵľж lpBizUnPack DzNULL. + Ϣȡ֮,ͷ + lpBizUnPack->Release(); + * @param lpBizPack ҵУҪӵҵֶԼֵûо͸ݹΪҵУֶ + * @return ֵ0ʾǰijɹĶıʶҪסʶͶ֮ӳϵʶҪȡĺͽϢĻص. + * ֵݴŻȡϢ. + */ + virtual int FUNCTION_CALL_MODE SubscribeTopic(CSubscribeParamInterface* lpSubscribeParamInter ,unsigned int uiTimeout,IF2UnPacker** lppBizUnPack=NULL,IF2Packer* lpBizPack=NULL) = 0; + + /** + * ȡ + * @param subscribeIndex ϢӦĶıʶʶSubscribeTopicķ + * @return 0ʾȡijɹֵݴŻȡϢ. + */ + virtual int FUNCTION_CALL_MODE CancelSubscribeTopic(int subscribeIndex) = 0; + + + /** + * ȡ + * @param topicName + * @param lpFilterInterface ӦĹ + * @return 0ʾȡijɹֵݴŻȡϢ. + */ + virtual int FUNCTION_CALL_MODE CancelSubscribeTopicEx(char* topicName,CFilterInterface* lpFilterInterface) = 0; + + + + /** + * ȡǰĽӿѾĵԼϢ + * @param lpPack 洫Ĵ + * @note packerֶ + - SubcribeIndex + - IsBornTopic + - TopicName + - TopicNo + - FilterRaw + - Appdata + - SendInterval + - ReturnFileds + - isReplace + - isFromNow + - Stutas + - QueueCount + */ + virtual void FUNCTION_CALL_MODE GetSubcribeTopic(IF2Packer* lpPack)=0; + + /** + * ȡַ + * @param lpPort ķ˿ڣΪNULL + * @return طַ + */ + virtual const char * FUNCTION_CALL_MODE GetServerAddress(int *lpPort) = 0; +}; + +/** + * ӿ + */ +class CPublishInterface: public IKnown +{ +public: + + /** + * ҵʽݷӿ + * @param topicName ֣֪־ʹNULL + * @param lpUnPacker + * @param iTimeOut ʱʱ + * @param lppBizUnPack ҵУʱʧܷصҵϢɹûзأҪReleaseͷ + ҵУĴϢд£ + IF2UnPacker* lpBizUnPack =NULL; + PubMsgByPacker(...,&lpBizUnPack); + ݷֵʧܵľж lpBizUnPack DzNULL. + Ϣȡ֮,ͷ + lpBizUnPack->Release(); + * @param bAddTimeStamp Ƿʱϵܲ + * @return 0ʾɹֵݴŻȡϢ. + */ + virtual int FUNCTION_CALL_MODE PubMsgByPacker(char* topicName ,IF2UnPacker* lpUnPacker,int iTimeOut=-1, + IF2UnPacker** lppBizUnPack=NULL,bool bAddTimeStamp=false) = 0; + + /** + * ҵʽݷӿڣһƸʽķ + * @param topicName ֣֪־ʹNULL + * @param lpFilterInterface ҪϲԼָĬûй + * @param lpData + * @param nLength ݳ + * @param iTimeOut ʱʱ + * @param lppBizUnPack ҵУʱʧܷصҵϢɹûзأҪReleaseͷ + ҵУĴϢд£ + IF2UnPacker* lpBizUnPack =NULL; + PubMsgByPacker(...,&lpBizUnPack); + ݷֵʧܵľж lpBizUnPack DzNULL. + Ϣȡ֮,ͷ + lpBizUnPack->Release(); + * @param bAddTimeStamp Ƿʱϵܲ + * @return 0ʾɹֵݴŻȡϢ. + */ + virtual int FUNCTION_CALL_MODE PubMsg(char* topicName, CFilterInterface* lpFilterInterface, const void *lpData, int nLength,int iTimeOut=-1, + IF2UnPacker** lppBizUnPack=NULL,bool bAddTimeStamp=false) = 0; + + /** + * صǰķ + * @param topicName + * @return 0ʾûжӦ⣬ֵʾɹ + */ + virtual uint32 FUNCTION_CALL_MODE GetMsgNoByTopicName(char* topicName)=0; + + /** + * ȡַ + * @param lpPort ķ˿ڣΪNULL + * @return طַ + */ + virtual const char * FUNCTION_CALL_MODE GetServerAddress(int *lpPort) = 0; +}; + +class CConnectionInterface; + +///Ӷ CConnectionInterface ҪĻصӿڶ +/** +* ӳɹӶϿɡյݵ¼ +*/ +class CCallbackInterface: public IKnown +{ +public: + /** + * ׽ӳɹ + * @param lpConnection ¼Ӷ + */ + virtual void FUNCTION_CALL_MODE OnConnect(CConnectionInterface *lpConnection) = 0; + + /** + * ɰȫ + * @param lpConnection ¼Ӷ + */ + virtual void FUNCTION_CALL_MODE OnSafeConnect(CConnectionInterface *lpConnection) = 0; + + /** + * ע + * @param lpConnection ¼Ӷ + */ + virtual void FUNCTION_CALL_MODE OnRegister(CConnectionInterface *lpConnection) = 0; + + /** + * ӱϿ + * @param lpConnection ¼Ӷ + */ + virtual void FUNCTION_CALL_MODE OnClose(CConnectionInterface *lpConnection) = 0; + + /** + * + * @param lpConnection ¼Ӷ + * @param hSend ; + * @param reserved1 ֶ + * @param reserved2 ֶ + * @param nQueuingData Ͷʣʹ߿ôֵƷ͵ٶȣСijֵʱз + * @see Send() + */ + virtual void FUNCTION_CALL_MODE OnSent(CConnectionInterface *lpConnection, int hSend, void *reserved1, void *reserved2, int nQueuingData) = 0; + + virtual void FUNCTION_CALL_MODE Reserved1(void *a, void *b, void *c, void *d) = 0; + + virtual void FUNCTION_CALL_MODE Reserved2(void *a, void *b, void *c, void *d) = 0; + + virtual int FUNCTION_CALL_MODE Reserved3() = 0; + + virtual void FUNCTION_CALL_MODE Reserved4() = 0; + + virtual void FUNCTION_CALL_MODE Reserved5() = 0; + + virtual void FUNCTION_CALL_MODE Reserved6() = 0; + + virtual void FUNCTION_CALL_MODE Reserved7() = 0; + + /** + * յSendBiz첽͵Ӧ + * @param lpConnection ¼Ӷ + * @param hSend ; + * @param lpUnPackerOrStr ָָߴϢ + * @param nResult հ + * nResult0ʾҵݽճɹҵɹlpUnPackerOrStrָһʱӦȽָתΪIF2UnPacker * + * nResult1ʾҵݽճɹҵʧˣlpUnPackerOrStrָһʱӦȽָתΪIF2UnPacker * + * nResult2ʾյҵϢlpUnPackerOrStrָһɶַϢ + * nResult3ʾҵʧܡlpUnPackerOrStrָNULL + */ + virtual void FUNCTION_CALL_MODE OnReceivedBiz(CConnectionInterface *lpConnection, int hSend, const void *lpUnPackerOrStr, int nResult) = 0; + + /** + * յSendBiz첽͵Ӧ + * @param lpConnection ¼Ӷ + * @param hSend ; + * @param lpRetData ҪصӦݣҪȡ + * @param lpUnPackerOrStr ָָߴϢ + * @param nResult հ + * nResult0ʾҵݽճɹҵɹlpUnpackerOrStrָһʱӦȽָתΪIF2UnPacker * + * nResult1ʾҵݽճɹҵʧˣlpUnpackerOrStrָһʱӦȽָתΪIF2UnPacker * + * nResult2ʾյҵϢlpUnpackerOrStrָһɶַϢ + * nResult3ʾҵʧܡlpUnpackerOrStrָNULL + */ + virtual void FUNCTION_CALL_MODE OnReceivedBizEx(CConnectionInterface *lpConnection, int hSend, LPRET_DATA lpRetData, const void *lpUnpackerOrStr, int nResult) = 0; + //20130624 xuxp صBizMessageӿ + /** + * յʱָReplyCallbackѡӦûжӦ + * @param lpConnection ¼Ӷ + * @param hSend ; + * @param lpMsg ҵϢָ + */ + virtual void FUNCTION_CALL_MODE OnReceivedBizMsg(CConnectionInterface *lpConnection, int hSend, IBizMessage* lpMsg) = 0; + + + +}; + +///T2_SDKӶӿ +/** +* ӡϿ͡յ +*/ +class CConnectionInterface: public IKnown +{ +public: + ///״̬ + enum ConnectionStatus + { + Disconnected = 0x0000, /**< δ */ + Connecting = 0x0001, /**< socket */ + Connected = 0x0002, /**< socket */ + SafeConnecting = 0x0004, /**< ڽȫ */ + SafeConnected = 0x0008, /**< ѽȫ */ + Registering = 0x0010, /**< ע */ + Registered = 0x0020, /**< ע */ + Rejected = 0x0040 /**< ܾر */ + }; + + ///ѡϣ0ʾճʱʱɾIDԿٴεRecvBizԽգ + enum RecvFlags + { + JustRemoveHandle = 0x0001 /**< ճʱʱpacket_idɾ */ + }; + + /** + * ʼӶ + * @param lpCallback ص + * @return 0ʾɹʾʧܣͨGetErrorMsgԻȡϸϢ + * ӦòҪκλص÷NULLԶصͶ + */ + virtual int FUNCTION_CALL_MODE Create(CCallbackInterface *lpCallback) = 0; + + /** + * ʼ/ע + * @param uiTimeout ʱʱ䣬λ룬0ʾȴʹôӷʱòã + * @return 0ʾɹʾʧܣͨGetErrorMsgԻȡϸϢ + */ + virtual int FUNCTION_CALL_MODE Connect(unsigned int uiTimeout) = 0; + + /** + * Ͽ + * @return 0ʾɹʾʧܣͨGetErrorMsgԻȡϸϢ + */ + virtual int FUNCTION_CALL_MODE Close() = 0; + + virtual int FUNCTION_CALL_MODE Reserved1() = 0; + + virtual int FUNCTION_CALL_MODE Reserved2() = 0; + + virtual int FUNCTION_CALL_MODE Reserved3() = 0; + + virtual int FUNCTION_CALL_MODE Reserved4() = 0; + + virtual int FUNCTION_CALL_MODE Reserved5() = 0; + + virtual int FUNCTION_CALL_MODE Reserved6() = 0; + + /** + * ȡַ + * @param lpPort ķ˿ڣΪNULL + * @return طַ + */ + virtual const char * FUNCTION_CALL_MODE GetServerAddress(int *lpPort) = 0; + + /** + * ȡ״̬ + * @return ״̬ + */ + virtual int FUNCTION_CALL_MODE GetStatus() = 0; + + /** + * ȡأʹ߿ͬʱʵͬʱӲͬķӵʱԼؾʹĸ + * @return طأǸԽʾԽæʾʧܣͨGetErrorMsgԻȡϸϢ + */ + virtual int FUNCTION_CALL_MODE GetServerLoad() = 0; + + /** + * ȡӦĴϢĿǰּ֧ĺӢģ֧ԿͨӶerrormsg + * @param nErrorCode + * @return شϢ + */ + virtual const char * FUNCTION_CALL_MODE GetErrorMsg(int nErrorCode) = 0; + + /** + * ȡӴţ޷עʱȿͨConnectķֵȡţ + * ҲͨñȡţȻøôŵGetErrorMsgɻȡɶĴϢ + * @return Ӵ + */ + virtual int FUNCTION_CALL_MODE GetConnectError() = 0; + + /** + * ҵ + * @param iFunID ܺ + * @param lpPacker ָ + * @param nAsy 0ʾͬʾ첽 + * @param iSystemNo iSystemNo > 0ϵͳ + * @param nCompressID ҵѹѹ㷨IDĿǰֻ֧ID = 1ѹ㷨 + * ID = 0ʾѹע⣬ѹֻSDK飬ǷѹȡڰʵʴС + * ͬ͵İͨRecvBizգ첽͵İյӦԶصOnReceivedBiz + * @return ط;ʾʧܣͨGetErrorMsgԻȡϸϢ + */ + virtual int FUNCTION_CALL_MODE SendBiz(int iFunID, IF2Packer *lpPacker, int nAsy = 0, int iSystemNo = 0, int nCompressID = 1) = 0; + + /** + * ҵ + * @param hSend ;SendBizijɹֵ + * @param lppUnPackerOrStr ֵ0ʾҵݽճɹҵɹ*lppUnPackerOrStrָһʱӦȽָתΪIF2UnPacker * + * ֵ1ʾҵݽճɹҵʧˣ*lppUnPackerOrStrָһʱӦȽָתΪIF2UnPacker * + * ֵ2ʾյҵϢ*lppUnPackerOrStrָһɶַϢ + * ֵ3ʾҵʧܡ*lppUnPackerOrStrԭָݲᱻı䡣 + * @param uiTimeout ʱʱ䣬λ롣 + * @param uiFlag ѡ0ʾճʱԿɼRecvBizգ + * JustRemoveHandleʾճʱ󣬰hSendɾ + * @return С0ʾRecvBizʧܣͨGetErrorMsgԻȡϸϢ + * ע⣡ⲿָָĽڴSDKڲⲿͷţ + */ + virtual int FUNCTION_CALL_MODE RecvBiz(int hSend, void **lppUnPackerOrStr, unsigned uiTimeout = 1000, unsigned uiFlag = 0) = 0; + + //20101228 xuxp ͺͽܵӿںڶĺ + /** + * ҵ + * @param iFunID ܺ + * @param lpPacker ָ + * @param svrName ָмĽڵ + * @param nAsy 0ʾͬʾ첽 + * @param iSystemNo iSystemNo > 0ϵͳ + * @param nCompressID ҵѹѹ㷨IDĿǰֻ֧ID = 1ѹ㷨 + * ID = 0ʾѹע⣬ѹֻSDK飬ǷѹȡڰʵʴС + * ͬ͵İͨRecvBizգ첽͵İյӦԶصOnReceivedBiz + * @param branchNo Ӫҵš + * @param lpRequest ݣݽṹ嶨帳ֵ + * @return ط;ʾʧܣͨGetErrorMsgԻȡϸϢ + */ + virtual int FUNCTION_CALL_MODE SendBizEx(int iFunID, IF2Packer *lpPacker,char* svrName, int nAsy = 0, int iSystemNo = 0, int nCompressID = 1,int branchNo=0,LPREQ_DATA lpRequest=NULL) = 0; + + /** + * ҵ + * @param hSend ;SendBizijɹֵ + * @param lppUnPackerOrStr ֵ0ʾҵݽճɹҵɹ*lppUnPackerOrStrָһʱӦȽָתΪIF2UnPacker * + * ֵ1ʾҵݽճɹҵʧˣ*lppUnPackerOrStrָһʱӦȽָתΪIF2UnPacker * + * ֵ2ʾյҵϢ*lppUnPackerOrStrָһɶַϢ + * ֵ3ʾҵʧܡ*lppUnPackerOrStrԭָݲᱻı䡣 + * @param lpRetData ҪصӦݣҪȡ + * @param uiTimeout ʱʱ䣬λ룬0ʾȴ + * @param uiFlag ѡ0ʾճʱԿɼRecvBizգ + * JustRemoveHandleʾճʱ󣬰hSendɾ + * @return С0ʾRecvBizʧܣͨGetErrorMsgԻȡϸϢ + * ע⣡ⲿָָĽڴSDKڲⲿͷţ + * ע⣡ⲿָָLPRET_DATAڴSDKڲⲿͷţ + */ + virtual int FUNCTION_CALL_MODE RecvBizEx(int hSend, void **lppUnpackerOrStr, LPRET_DATA* lpRetData, unsigned uiTimeout = 1000, unsigned uiFlag = 0) = 0; + + + //20101228 xuxp Create֤صµOnReceivedBizExĽӿ + /** + * ʼӶ + * @param lpCallback ص + * @return 0ʾɹʾʧܣͨGetErrorMsgԻȡϸϢ + * ӦòҪκλص÷NULLԶصͶ + */ + virtual int FUNCTION_CALL_MODE CreateEx(CCallbackInterface *lpCallback) = 0; + + + //20120111 dongpf GetRealAddressȡԼipַͶ˿ + /** + * ȡipַͶ˿ + * @return ȡipַͶ˿ڣʽipַ+˿ + */ + virtual const char* FUNCTION_CALL_MODE GetRealAddress() = 0; + + + virtual int FUNCTION_CALL_MODE Reserved8() = 0; + virtual int FUNCTION_CALL_MODE Reserved9() = 0; + + //20130527 xuxp GetSelfAddressȡԼصIPͶ˿ + /** + * ȡipַͶ˿ + * @return ȡipַͶ˿ڣʽipַ+˿ + */ + virtual const char* FUNCTION_CALL_MODE GetSelfAddress() = 0; + + //20130529 xuxp GetSelfMacȡԼʹõMAC + /** + * ȡMACַ + * @return MACĵַַʽơD067E5556D83,мûзָ + */ + virtual const char* FUNCTION_CALL_MODE GetSelfMac() = 0; + + //20130609 xuxp ķӿ + ///////////////////////////////////ӶķĽӿ/////////////////////////////////////// + + /** + * һ + * @param lpCallback صӿ + * @param SubScribeName ֣ඩߵֱ벻һͬ.󳤶32ֽ + * @param iTimeOut ʱʱ + * @param iInitRecvQLen ʼնеij + * @param iStepRecvQLen ܶеչ + * @return ضĽӿʵһỰӿڶӦһص. + */ + virtual CSubscribeInterface* FUNCTION_CALL_MODE NewSubscriber(CSubCallbackInterface *lpCallback,char* SubScribeName,int iTimeOut, + int iInitRecvQLen=INIT_RECVQ_LEN,int iStepRecvQLen=STEP_RECVQ_LEN) = 0; + + /** + * ȡ + * @param msgCount ػϢĸ + * @param iTimeOut һγʼʱijʱʱ + * @param bResetNo Ƿ + * @return طͽӿʵһѾnewˣֱӷضӦָ + */ + virtual CPublishInterface* FUNCTION_CALL_MODE GetPublisher(int msgCount,int iTimeOut,bool bResetNo = false) = 0; + + + + + /** + * ȡ˵Ϣ + * @param byForce ǷǿƴӺ̨ȡ + * @param iTimeOut ʱʱ + * @return ɹͷϢ + * @note Ҫreleaseӿڽͷ. + * @note packerֶ + * - TopicName + * - TopicNo + * - ReliableLevel + * - IssuePriority + * - MsgLifetime + * - Stutas + * - TickStrategy + * - BusinessVerify + * - Local + * - FilterField1 + * - FilterField2 + * - FilterField3 + * - FilterField4 + * - FilterField5 + * - FilterField6 + * - SubscribeStr + * - PublishStr + */ + virtual IF2UnPacker* FUNCTION_CALL_MODE GetTopic(bool byForce,int iTimeOut) = 0; + + /** + * ȡķ + */ + virtual const char* FUNCTION_CALL_MODE GetMCLastError() = 0; + //////////////////////////////////////////////////////////////////////////////// + + //20130624 xuxp ӽӿӿڣΪ˵Ľӿڣͻ˿ҲƼʹ + ///////////////////////////////////µһײӿ/////////////////////////////////////// + /** + * ʼӶ + * @param lpCallback ص + * @return 0ʾɹʾʧܣͨGetErrorMsgԻȡϸϢ + * ӦòҪκλص÷NULLԶصͶ + */ + virtual int FUNCTION_CALL_MODE Create2BizMsg(CCallbackInterface *lpCallback) = 0; + + /** + * ҵ + * @param lpMsg ҵϢӿָ + * @param nAsy 0ʾͬʾ첽 + * ͬ͵İͨRecvBizMsgգ첽͵İյӦԶصOnReceivedBizMsg + * @return ط;ʾʧܣͨGetErrorMsgԻȡϸϢ + */ + virtual int FUNCTION_CALL_MODE SendBizMsg(IBizMessage* lpMsg,int nAsy = 0) = 0; + + /** + * + * @param hSend ; + * @param lpMsg յҵϢָĵַ + * @param uiTimeout ʱʱ䣬λ룬0ʾȴ + * @param uiFlag ѡ0ʾճʱԿɼReceiveգ + * JustRemoveHandleʾճʱʱpacket_idɾԺյ첽ķʽյ + * @return 0ʾɹʾʧܣͨGetErrorMsgԻȡϸϢ + */ + virtual int FUNCTION_CALL_MODE RecvBizMsg(int hSend, IBizMessage** lpMsg, unsigned uiTimeout = 1000, unsigned uiFlag = 0) = 0; + //////////////////////////////////////////////////////////////////////////////// +}; + +extern "C" +{ + /** + * ȡT2_SDKİ汾 + * @return ǰT2_SDKİ汾ţĿǰ汾Ϊ0x01000002ʾ1.0.0.2 + */ + int FUNCTION_CALL_MODE GetVersionInfo(); + + /** + * ȡһʵCConfigInterfaceӿڵָ + * @return ʵCConfigInterfaceӿڵָ + */ +CConfigInterface* FUNCTION_CALL_MODE NewConfig(); + + /** + * ȡһʵCConnectionInterfaceӿڵָ + * @param CConfigInterface ʵCConfigInterfaceӿڵָ + * @returnʵCConnectionInterfaceӿڵָ + */ +CConnectionInterface* FUNCTION_CALL_MODE NewConnection(CConfigInterface *lpConfig); + +/** +* @param int iVersion ҵʽ汾(ȡֵ:1 ִ,ֵ 0x20) +* Ƽʹ0x20 +* @return IPacker * ӿָ +*/ +IF2Packer * FUNCTION_CALL_MODE NewPacker(int iVersion); + +/** +* @param void * lpBuffer ҪݣARͨŰͷ +* @param unsigned int iLen ݳ +* @return IUnPacker * ӿָ +*/ +IF2UnPacker * FUNCTION_CALL_MODE NewUnPacker(void * lpBuffer, unsigned int iLen); + +/** +* @param char *EncodePass ɢнַȲ16'\0' +* @param const char* Password Ĵɢе +* @param int nReserve Ĭֵ +* @return char * ɢнַͬEncodePass +*/ +char * FUNCTION_CALL_MODE Encode(char *EncodePass, const char* Password, int nReserve = 0 ); + + +/** +*һṩļܺм +* @param const char* pIn Ĵַܵ +* @param const char* pOut ȺʹַСһⲿ +* @return +*/ +int FUNCTION_CALL_MODE EncodeEx(const char *pIn, char *pOut); + + +/** +* һӿָ +* @return NULLʾʧ. +*/ +CFilterInterface* FUNCTION_CALL_MODE NewFilter(); + +/** +* һԽӿָ +* @return NULLʾʧ. +*/ +CSubscribeParamInterface* FUNCTION_CALL_MODE NewSubscribeParam(); + +//20130625 xuxp ҵϢ +IBizMessage* FUNCTION_CALL_MODE NewBizMessage(); + +} + +#endif diff --git a/include/UFX/win32/c20150708.pfx b/include/UFX/win32/c20150708.pfx new file mode 100644 index 0000000..af9de51 Binary files /dev/null and b/include/UFX/win32/c20150708.pfx differ diff --git a/include/UFX/win32/licensehundsun.dat b/include/UFX/win32/licensehundsun.dat new file mode 100644 index 0000000..cbc5699 Binary files /dev/null and b/include/UFX/win32/licensehundsun.dat differ diff --git a/include/UFX/win32/t2sdk.dll b/include/UFX/win32/t2sdk.dll new file mode 100644 index 0000000..3a57ac2 Binary files /dev/null and b/include/UFX/win32/t2sdk.dll differ diff --git a/include/UFX/win32/t2sdk.ini b/include/UFX/win32/t2sdk.ini new file mode 100644 index 0000000..164aaa6 --- /dev/null +++ b/include/UFX/win32/t2sdk.ini @@ -0,0 +1,32 @@ +[t2sdk] +servers=117.78.3.150:6010 +license_file=licensehundsun.dat +license_pwd=888888 +init_recv_buf_size=512 +init_send_buf_size=512 +send_queue_size=100 +heartbeat_time=10 +if_error_log=1 +logdir=logs +if_sendRecv_log=1 +login_name=asyn_send +lan=2052 +addipmac=0 + +[proxy] +proxy_type= +ip=127.0.0.1 +port= +user_name=guest +password=888888 + +[safe] +;safe_level=ssl +safe_level=none +client_id=123456 +comm_pwd=888888 +cert_file=c20150708.pfx +cert_pwd=111111 +[ufx] +fund_account=70000172 +password=111111 \ No newline at end of file diff --git a/include/UFX/win32/t2sdk.lib b/include/UFX/win32/t2sdk.lib new file mode 100644 index 0000000..4a9c217 Binary files /dev/null and b/include/UFX/win32/t2sdk.lib differ diff --git a/include/Wind/WAPIWrapperCpp.h b/include/Wind/WAPIWrapperCpp.h new file mode 100644 index 0000000..8e225ee --- /dev/null +++ b/include/Wind/WAPIWrapperCpp.h @@ -0,0 +1,245 @@ +#ifndef _WAPIWRAPPERCPP_H +#define _WAPIWRAPPERCPP_H + +#include +#include + +#ifdef WAPIWRAPPERCPP_EXPORTS +#define WAPIWRAPPERCPP_EXP __declspec(dllexport) +#else +#define WAPIWRAPPERCPP_EXP __declspec(dllimport) +#endif + +//ؼδע +const LONG noRegErr = -1; + +enum ErrMsgLang //Ϣ +{ + eENG = 0, ///< Ӣ + eCHN, ///< +}; + +class WAPIWRAPPERCPP_EXP WindData +{ +public: + VARIANT data; ///< + VARIANT codes; ///< Codeб + VARIANT fields; ///< ָб + VARIANT times; ///< ʱб + LONG errorCode; ///< +public: + + WindData(); + ~WindData(); + + VOID InitWindData(); + VOID ClearWindData(); + + //ȡϢ + LPCWSTR GetErrorMsg() const; + + //ת(Ҫdelete) + static WCHAR* DateToString(DATE date, LPCWSTR strFormat = L"%Y-%m-%d"); + static VOID FreeString(WCHAR*& pStr); + + ////////////////////////////////////////////////////////////////////////// + //ʹ + + INT GetCodesLength() const; + INT GetFieldsLength() const; + INT GetTimesLength() const; + + LPCWSTR GetCodeByIndex(int index) const; + LPCWSTR GetFieldsByIndex(int index) const; + BOOL GetTimeByIndex(int index, WCHAR timeBuffer[], int& length) const; + DATE GetTimeByIndex(int index) const; + + //ȡݲѯӿOneData + BOOL GetDataItem(int timeIndex, int codesIndex, int fieldsIndex, VARIANT& outItem) const; + + //ȡб + const DATE* GetTDaysInfo(LONG& lDateCount) const; + + ////////////////////////////////////////////////////////////////////////// + //ʹ + + INT GetRecordCount() const; + + //ȡ׽ӿOneData + BOOL GetTradeItem(int recordIndex, int fieldsIndex, VARIANT& outItem) const; + + //ȡ¼ID + LONG GetLogonID() const; + + //ȡOrderId + LONG GetOrderRequestID() const; + + //ȡOrderNumber + LPCWSTR GetOrderNumber(int recordIndex = 0) const; +}; + +// ص +typedef LONG (WINAPI *WsqCallBack)(ULONGLONG reqId, const WindData &windData); + +typedef LONG (WINAPI *TradeCallBack)(LONG LogonID, const WindData &windData); + +// Ǵ WAPIWrapperCpp.dll +class WAPIWRAPPERCPP_EXP CWAPIWrapperCpp { +public: + + // + ////////////////////////////////////////////////////////////////////////// + //Windӿ + static LONG start(LPCWSTR options = NULL, LPCWSTR options2 = NULL, LONG timeout = 5000); + + //Windӿֹ + static LONG stop(); + + //ж״̬ + static LONG isconnected(); + + // requestId Ϊ0 ȡ󣻷ֻȡIDŵ + static VOID cancelRequest(ULONGLONG requestId); + + //ȡ + static VOID cancelAllRequest(); + + //ȡӦĴϢ + static BOOL getErrorMsg(LONG errCode, ErrMsgLang lang, WCHAR msg[], int& /*inout*/msgLength); + + ////////////////////////////////////////////////////////////////////////// + + //ݺ + ////////////////////////////////////////////////////////////////////////// + //ֵwsd + static LONG wsd(WindData& outWindData, LPCWSTR windCodes, LPCWSTR fields, LPCWSTR startTime = NULL, LPCWSTR endTime = NULL, LPCWSTR options = NULL); + + //ֵwssʷ + static LONG wss(WindData& outWindData, LPCWSTR windCodes, LPCWSTR fields, LPCWSTR options = NULL); + + //ֵwsi÷ + static LONG wsi(WindData& outWindData, LPCWSTR windCodes, LPCWSTR fields, LPCWSTR startTime, LPCWSTR endTime, LPCWSTR options = NULL); + + //ֵwst + static LONG wst(WindData& outWindData, LPCWSTR windCodes, LPCWSTR fields, LPCWSTR startTime, LPCWSTR endTime, LPCWSTR options = NULL); + + //ֵwsqʵʱ + //ǶģʽȡһԿ + static LONG wsq(WindData& outWindData, LPCWSTR windCodes, LPCWSTR fields, LPCWSTR options = NULL); + + //ģʽʵʱݣͨص + static LONG wsq(ULONGLONG &reqId, LPCWSTR windCodes, LPCWSTR fields, WsqCallBack callBack, LPCWSTR options = NULL, BOOL updateAllFields = FALSE); + + //ֵtdqʵʱ + //ģʽtdʵʱݣͨص + static LONG tdq(ULONGLONG &reqId, LPCWSTR windCodes, LPCWSTR fields, WsqCallBack callBack, LPCWSTR options = NULL, BOOL updateAllFields = FALSE); + + //ֵbbqʵʱ + //ǶģʽȡһԿ + static LONG bbq(WindData& outWindData, LPCWSTR windCodes, LPCWSTR fields, LPCWSTR options = NULL); + + //ģʽʵʱݣͨص + static LONG bbq(ULONGLONG &reqId, LPCWSTR windCodes, LPCWSTR fields, WsqCallBack callBack, LPCWSTR options = NULL); + + //ֵwsetָݼ + static LONG wset(WindData& outWindData, LPCWSTR reportName, LPCWSTR options = NULL); + + //ֵedbþ + static LONG edb(WindData& outWindData, LPCWSTR windCodes, LPCWSTR startTime = NULL, LPCWSTR endTime = NULL, LPCWSTR options = NULL); + + //ϱ + static LONG wpf(WindData& outWindData, LPCWSTR portfolioName, LPCWSTR viewName, LPCWSTR options = NULL); + + //ϴ + static LONG wupf(WindData& outWindData, LPCWSTR portfolioName, LPCWSTR tradeDate, LPCWSTR windCodes, LPCWSTR quantity, LPCWSTR costPrice, LPCWSTR options = NULL); + + //֤ɸѡ + static LONG weqs(WindData& outWindData, LPCWSTR planName, LPCWSTR options = NULL); + + //աայк + static LONG tdays(WindData& outWindData, LPCWSTR startTime, LPCWSTR endTime, LPCWSTR options = NULL); + + //աայƫƼ + static LONG tdaysoffset(DATE& outDate, LPCWSTR startTime, LONG offset, LPCWSTR options = NULL); + + //աայ + static LONG tdayscount(LONG& outCount, LPCWSTR startTime, LPCWSTR endTime, LPCWSTR options = NULL); + ////////////////////////////////////////////////////////////////////////// + + //׺ + ////////////////////////////////////////////////////////////////////////// + //˺ŵ½ + static LONG tlogon(WindData& outWindData, LPCWSTR brokerID, LPCWSTR departmentID, LPCWSTR accountID, LPCWSTR password, LPCWSTR accountType, LPCWSTR options = NULL,TradeCallBack callBack=0); + + //˺ŵdz, 0:dzȫѵ¼˺ + static LONG tlogout(INT longId=0); + + //µ + static LONG torder(WindData& outWindData, LPCWSTR windCodes, LPCWSTR tradeSide, LPCWSTR orderPrice, LPCWSTR orderVolume, LPCWSTR options = NULL); + static LONG torder(LONG& reqId, LPCWSTR windCodes, LPCWSTR tradeSide, DOUBLE orderPrice, LONG orderVolume, LPCWSTR options = NULL, WCHAR** pErrosMsg = NULL); + + //ȡ + // + static LONG tcovered(WindData& outWindData, LPCWSTR windCodes, LPCWSTR tradeSide, LPCWSTR orderVolume, LPCWSTR options = NULL); + static LONG tcovered(LONG& reqId, LPCWSTR windCodes, LPCWSTR tradeSide, LONG orderVolume, LPCWSTR options = NULL, WCHAR** pErrosMsg = NULL); + + + //ѯ + static LONG tquery(WindData& outWindData, LPCWSTR qryCode, LPCWSTR options = NULL); + + // + static LONG tcancel(LPCWSTR orderNumber, LPCWSTR options = NULL); + ////////////////////////////////////////////////////////////////////////// + + //ز⺯ + ////////////////////////////////////////////////////////////////////////// + //ز⿪ʼ + static LONG bktstart(WindData& outWindData, LPCWSTR strategyName, LPCWSTR startDate, LPCWSTR endDate, LPCWSTR options = NULL); + + //زѯ + static LONG bktquery(WindData& outWindData, LPCWSTR qrycode, LPCWSTR qrytime, LPCWSTR options = NULL); + + //زµ + static LONG bktorder(WindData& outWindData, LPCWSTR tradeTime, LPCWSTR securityCode, LPCWSTR tradeSide, LPCWSTR tradeVol, LPCWSTR options = NULL); + + //ز + static LONG bktend(WindData& outWindData, LPCWSTR options); + + //鿴ز״̬ + static LONG bktstatus(WindData& outWindData, LPCWSTR options); + + //زҪ + static LONG bktsummary(WindData& outWindData, LPCWSTR bktID, LPCWSTR view, LPCWSTR options); + + //زɾ + static LONG bktdelete(WindData& outWindData, LPCWSTR bktID, LPCWSTR options); + + //زб + static LONG bktstrategy(WindData& outWindData, LPCWSTR options); + + ////////////////////////////////////////////////////////////////////////// + //appӦ + /** + * @brief AppȨ֤ + * @param WindData & outWindData: + * @param LPCTSTR appKey: appӴվȡΨһ֤Id + * @param LPCTSTR appSecret:appԿ + * @param LPCTSTR options: + * @return LONG: ɹ\ + */ + static LONG wappAuth(WindData& outWindData, LPCTSTR appKey, LPCTSTR appSecret, LPCTSTR options); + + /** + * @brief Appʹ½ͨѶ + * @param WindData & outWindData: + * @param LPCTSTR type_id: communication type,include:message_put; message_get; app_version; app_fps; app_data_get; app_data_put + * @param LPCTSTR message: communication content + * @param LPCTSTR options: + * @return LONG: ɹ\ + */ + static LONG wappMessage(WindData& outWindData, LPCTSTR type_id, LPCTSTR message, LPCTSTR options); + + ////////////////////////////////////////////////////////////////////////// +}; + +#endif diff --git a/include/Wind/win32/WAPIWrapperCpp.dll b/include/Wind/win32/WAPIWrapperCpp.dll new file mode 100644 index 0000000..03d2f70 Binary files /dev/null and b/include/Wind/win32/WAPIWrapperCpp.dll differ diff --git a/include/Wind/win32/WAPIWrapperCpp.lib b/include/Wind/win32/WAPIWrapperCpp.lib new file mode 100644 index 0000000..a358956 Binary files /dev/null and b/include/Wind/win32/WAPIWrapperCpp.lib differ diff --git a/include/Wind/win64/WAPIWrapperCpp.dll b/include/Wind/win64/WAPIWrapperCpp.dll new file mode 100644 index 0000000..d8402f4 Binary files /dev/null and b/include/Wind/win64/WAPIWrapperCpp.dll differ diff --git a/include/Wind/win64/WAPIWrapperCpp.lib b/include/Wind/win64/WAPIWrapperCpp.lib new file mode 100644 index 0000000..999e02f Binary files /dev/null and b/include/Wind/win64/WAPIWrapperCpp.lib differ diff --git a/include/XApiC.def b/include/XApiC.def index 52240c9..f03781f 100644 --- a/include/XApiC.def +++ b/include/XApiC.def @@ -5,7 +5,7 @@ EXPORTS X_GetFunction @3 X_FreeLib @4 - X_GetApiType @5 + X_GetApiTypes @5 X_GetApiVersion @6 X_GetApiName @7 @@ -13,16 +13,16 @@ EXPORTS X_Register @9 X_Connect @10 X_Disconnect @11 - X_Subscribe @12 + + X_Subscribe @12 X_Unsubscribe @13 X_SubscribeQuote @14 X_UnsubscribeQuote @15 - X_ReqQryInstrument @16 - X_ReqQryInvestorPosition @17 - X_ReqQryTradingAccount @18 - X_SendOrder @19 - X_CancelOrder @20 - X_SendQuote @21 - X_CancelQuote @22 \ No newline at end of file + X_ReqQuery @16 + + X_SendOrder @17 + X_CancelOrder @18 + X_SendQuote @19 + X_CancelQuote @20 \ No newline at end of file diff --git a/include/XApiC.h b/include/XApiC.h index 3e8426e..79ae11a 100644 --- a/include/XApiC.h +++ b/include/XApiC.h @@ -1,40 +1,40 @@ #pragma once -#include "../include/ApiStruct.h" +#include "ApiStruct.h" +#include "QueueEnum.h" +#include "QueueHeader.h" #ifdef __cplusplus extern "C" { #endif -void* X_LoadLib(char* libPath); -char* X_GetLastError(); -void* X_GetFunction(void* lib, char* ProcName = "XRequest"); +void* X_LoadLib(const char* libPath); +const char* X_GetLastError(); +void* X_GetFunction(void* lib, const char* ProcName = "XRequest"); void X_FreeLib(void* lib); -ApiType X_GetApiType(void* pFun); -char* X_GetApiVersion(void* pFun); -char* X_GetApiName(void* pFun); +ApiType X_GetApiTypes(void* pFun); +const char* X_GetApiVersion(void* pFun); +const char* X_GetApiName(void* pFun); void* X_Create(void* pFun); -void X_Register(void* pFun, void* pApi, void* pCallback, void* pClass); +void X_Register(void* pFun, void* pApi, fnOnResponse pCallback, void* pClass); -void X_Connect(void* pFun, void* pApi, char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count); +void X_Connect(void* pFun, void* pApi, const char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count); void X_Disconnect(void* pFun, void* pApi); -void X_Subscribe(void* pFun, void* pApi, char* szInstrument, char* szExchange); -void X_Unsubscribe(void* pFun, void* pApi, char* szInstrument, char* szExchange); -void X_SubscribeQuote(void* pFun, void* pApi, char* szInstrument, char* szExchange); -void X_UnsubscribeQuote(void* pFun, void* pApi, char* szInstrument, char* szExchange); +void X_Subscribe(void* pFun, void* pApi, const char* szInstrument, const char* szExchange); +void X_Unsubscribe(void* pFun, void* pApi, const char* szInstrument, const char* szExchange); +void X_SubscribeQuote(void* pFun, void* pApi, const char* szInstrument, const char* szExchange); +void X_UnsubscribeQuote(void* pFun, void* pApi, const char* szInstrument, const char* szExchange); -void X_ReqQryInstrument(void* pFun, void* pApi, char* szInstrument, char* szExchange); -void X_ReqQryInvestorPosition(void* pFun, void* pApi, char* szInstrument, char* szExchange); -void X_ReqQryTradingAccount(void* pFun, void* pApi); +void X_ReqQuery(void* pFun, void* pApi, QueryType type, ReqQueryField* query); -void X_SendOrder(void* pFun, void* pApi, OrderField* pOrder, OrderIDType* pInOut, int count); -void X_CancelOrder(void* pFun, void* pApi, OrderIDType* pIn, OrderIDType* pOut, int count); +const char* X_SendOrder(void* pFun, void* pApi, OrderField* pOrder, int count, char* pOut); +const char* X_CancelOrder(void* pFun, void* pApi, OrderIDType* pIn, int count, char* pOut); -void X_SendQuote(void* pFun, void* pApi, QuoteField* pQuote, OrderIDType* pAskOut, OrderIDType* pBidOut, int count); -void X_CancelQuote(void* pFun, void* pApi, OrderIDType* pIn, OrderIDType* pOut, int count); +const char* X_SendQuote(void* pFun, void* pApi, QuoteField* pQuote, int count, char* pOut); +const char* X_CancelQuote(void* pFun, void* pApi, OrderIDType* pIn, int count, char* pOut); #ifdef __cplusplus } diff --git a/include/XApiCpp.h b/include/XApiCpp.h index f7578d6..8fb8b4c 100644 --- a/include/XApiCpp.h +++ b/include/XApiCpp.h @@ -5,9 +5,10 @@ #pragma once #endif // _MSC_VER > 1000 -#include "../include/CrossPlatform.h" +#include "CrossPlatform.h" -#include "../include/ApiStruct.h" +#include "ApiStruct.h" +#include "QueueEnum.h" class CXApi; @@ -16,21 +17,26 @@ class CXSpi public: virtual void OnConnectionStatus(CXApi* pApi, ConnectionStatus status, RspUserLoginField* pUserLogin, int size1){}; virtual void OnRtnError(CXApi* pApi, ErrorField* pError){}; + virtual void OnLog(CXApi* pApi, LogField* pLog) {}; virtual void OnRtnDepthMarketDataN(CXApi* pApi, DepthMarketDataNField* pMarketData){}; - virtual void OnRtnQuoteRequest(CXApi* pApi, QuoteRequestField* pQuoteRequest){}; + virtual void OnRspQryInstrument(CXApi* pApi, InstrumentField* pInstrument, int size1, bool bIsLast) {}; + virtual void OnRspQryTradingAccount(CXApi* pApi, AccountField* pAccount, int size1, bool bIsLast) {}; + virtual void OnRspQryInvestorPosition(CXApi* pApi, PositionField* pPosition, int size1, bool bIsLast) {}; + virtual void OnRspQrySettlementInfo(CXApi* pApi, SettlementInfoField* pSettlementInfo, int size1, bool bIsLast) {}; - virtual void OnRspQryInstrument(CXApi* pApi, InstrumentField* pInstrument, int size1, bool bIsLast){}; - virtual void OnRspQryTradingAccount(CXApi* pApi, AccountField* pAccount, int size1, bool bIsLast){}; - virtual void OnRspQryInvestorPosition(CXApi* pApi, PositionField* pPosition, int size1, bool bIsLast){}; - virtual void OnRspQrySettlementInfo(CXApi* pApi, SettlementInfoField* pSettlementInfo, int size1, bool bIsLast){}; - virtual void OnRspQryInvestor(CXApi* pApi, InvestorField* pInvestor, int size1, bool bIsLast){}; - virtual void OnRtnOrder(CXApi* pApi, OrderField* pOrder){}; - virtual void OnRtnTrade(CXApi* pApi, TradeField* pTrade){}; - virtual void OnRtnQuote(CXApi* pApi, QuoteField* pQuote){}; + virtual void OnRspQryOrder(CXApi* pApi, OrderField* pOrder, int size1, bool bIsLast) {}; + virtual void OnRspQryTrade(CXApi* pApi, TradeField* pTrade, int size1, bool bIsLast) {}; + virtual void OnRspQryQuote(CXApi* pApi, QuoteField* pQuote, int size1, bool bIsLast) {}; + + virtual void OnRtnOrder(CXApi* pApi, OrderField* pOrder) {}; + virtual void OnRtnTrade(CXApi* pApi, TradeField* pTrade) {}; + virtual void OnRtnQuote(CXApi* pApi, QuoteField* pQuote) {}; - virtual void OnRspQryHistoricalTicks(CXApi* pApi, TickField* pTicks, int size1, HistoricalDataRequestField* pRequest, int size2, bool bIsLast){}; - virtual void OnRspQryHistoricalBars(CXApi* pApi, BarField* pBars, int size1, HistoricalDataRequestField* pRequest, int size2, bool bIsLast){}; + virtual void OnRtnQuoteRequest(CXApi* pApi, QuoteRequestField* pQuoteRequest){}; + virtual void OnRspQryHistoricalTicks(CXApi* pApi, TickField* pTicks, int size1, HistoricalDataRequestField* pRequest, int size2, bool bIsLast) {}; + virtual void OnRspQryHistoricalBars(CXApi* pApi, BarField* pBars, int size1, HistoricalDataRequestField* pRequest, int size2, bool bIsLast) {}; + virtual void OnRspQryInvestor(CXApi* pApi, InvestorField* pInvestor, int size1, bool bIsLast){}; virtual bool OnFilterSubscribe(CXApi* pApi, ExchangeType exchange, int instrument_part1, int instrument_part2, int instrument_part3, char* pInstrument){ return true; }; }; @@ -38,34 +44,32 @@ class CXSpi class DLL_PUBLIC CXApi { public: - static CXApi* CreateApi(char* libPath); + static CXApi* CreateApi(const char* libPath); virtual bool Init() = 0; - virtual char* GetLastError() = 0; + virtual const char* GetLastError() = 0; - virtual ApiType GetApiType() = 0; - virtual char* GetApiVersion() = 0; - virtual char* GetApiName() = 0; + virtual ApiType GetApiTypes() = 0; + virtual const char* GetApiVersion() = 0; + virtual const char* GetApiName() = 0; virtual void RegisterSpi(CXSpi *pSpi) = 0; - virtual void Connect(char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count) = 0; + virtual void Connect(const char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count) = 0; virtual void Disconnect() = 0; - virtual void Subscribe(char* szInstrument, char* szExchange) = 0; - virtual void Unsubscribe(char* szInstrument, char* szExchange) = 0; + virtual void Subscribe(const char* szInstrument, const char* szExchange) = 0; + virtual void Unsubscribe(const char* szInstrument, const char* szExchange) = 0; - virtual void ReqQryInstrument(char* szInstrument, char* szExchange) = 0; - virtual void ReqQryInvestorPosition(char* szInstrument, char* szExchange) = 0; - virtual void ReqQryTradingAccount() = 0; + virtual void ReqQuery(QueryType type, ReqQueryField* query) = 0; - virtual void SendOrder(OrderField* pOrder, OrderIDType* pInOut, int count) = 0; - virtual void CancelOrder(OrderIDType* pIn, OrderIDType* pOut, int count) = 0; + virtual const char* SendOrder(OrderField* pOrder, int count, char* pOut) = 0; + virtual const char* CancelOrder(OrderIDType* pIn, int count, char* pOut) = 0; - virtual void SendQuote(QuoteField* pQuote, OrderIDType* pAskOut, OrderIDType* pBidOut, int count) = 0; - virtual void CancelQuote(OrderIDType* pIn, OrderIDType* pOut, int count) = 0; + virtual const char* SendQuote(QuoteField* pQuote, int count, char* pOut) = 0; + virtual const char* CancelQuote(OrderIDType* pIn, int count, char* pOut) = 0; protected: CXApi(); - ~CXApi(){}; + ~CXApi(); }; #endif diff --git a/include/cryptopp.zip b/include/cryptopp.zip new file mode 100644 index 0000000..177bec7 Binary files /dev/null and b/include/cryptopp.zip differ diff --git a/include/inirw.cpp b/include/inirw.cpp new file mode 100644 index 0000000..b364749 --- /dev/null +++ b/include/inirw.cpp @@ -0,0 +1,529 @@ +#include "stdafx.h" +#include +#include +#include +#include +#include "inirw.h" + +#define SIZE_LINE 1024 //每行最大长度 +#define SIZE_FILENAME 256 //文件名最大长度 + +#define min(x, y) (x <= y) ? x : y + +typedef enum _ELineType_ { + LINE_IDLE, //未处理行 + LINE_ERROR, //错误行 + LINE_EMPTY, //空白行或注释行 + LINE_SECTION, //节定义行 + LINE_VALUE //值定义行 +} ELineType ; + + +static char gFilename[SIZE_FILENAME]; +static char *gBuffer; +static int gBuflen; + +const char* GetBuffer() +{ + return gBuffer; +} +int GetBufferLen() +{ + return gBuflen; +} + + +//去除串首尾空格,原串被改写 +static char *StrStrip(char *s) +{ + size_t size; + char *p1, *p2; + + size = strlen(s); + if (!size) + return s; + + p2 = s + size - 1; + + while ((p2 >= s) && isspace((unsigned char)*p2)) + p2 --; + *(p2 + 1) = '\0'; + + p1 = s; + while (*p1 && isspace((unsigned char)*p1)) + p1 ++; + if (s != p1) + memmove(s, p1, p2 - p1 + 2); + return s; +} + + +//不区分大小写比较字符串 +static int StriCmp(const char *s1, const char *s2) +{ + int ch1, ch2; + do + { + ch1 = (unsigned char)*(s1++); + if ((ch1 >= 'A') && (ch1 <= 'Z')) + ch1 += 0x20; + + ch2 = (unsigned char)*(s2++); + if ((ch2 >= 'A') && (ch2 <= 'Z')) + ch2 += 0x20; + } while ( ch1 && (ch1 == ch2) ); + return(ch1 - ch2); +} + + +//取一行 +//输入:数据区(指针及长度) +//输出:行类型、有效内容串(去首尾空格)、注释首、注释尾、下一行首(行尾与下一行首间为换行符) +// 有效内容位置为[buf, rem1) +static int GetLine(char *buf, int buflen, char *content, char **rem1, char **rem2, char **nextline) +{ + char *cont1, *cont2; + int cntblank, cntCR, cntLF; //连续空格、换行符数量 + char isQuot1, isQuot2; //引号 + int i; + char *p; + + //首先断行断注释,支持如下换行符:\r、\n、\r\n、\n\r + cntblank = 0; + cntCR = cntLF = 0; + isQuot1 = isQuot2 = 0; + cont1 = *rem1 = 0; + content[0] = 0; + for (i = 0, p = buf; i < buflen; i ++, p ++) + { + if (*p == 0) { + p ++; + break; + } + //2个CR或LF,行结束 + if (cntCR == 2 || cntLF == 2) { + // 这个地方会导致两个LF时前一句读出来的"少一个 + //p --; //回溯1 + break; + } + //CR或LF各1个之后任意字符,行结束 + if (cntCR + cntLF >= 2) { + break; + } + //CR或LF之后出现其它字符,行结束 + if ((cntCR || cntLF) && *p != '\r' && *p != '\n') + break; + + switch (*p) { + case '\r': + cntCR ++; + break; + case '\n': + cntLF ++; + break; + case '\'': + if (!isQuot2) + isQuot1 = 1 - isQuot1; + break; + case '\"': + if (!isQuot1) + isQuot2 = 1 - isQuot2; + break; + case ';': + case '#': + if (isQuot1 || isQuot2) + break; + if (*rem1 == NULL) + *rem1 = p - cntblank; + break; + default: + if (isspace((unsigned char)*p)) { + cntblank ++; + } else { + cntblank = 0; + if ((*rem1 == NULL) && (cont1 == NULL)) + cont1 = p; + } + break; + } + } + + *nextline = p; + *rem2 = p - cntCR - cntLF; + if (*rem1 == NULL) + *rem1 = *rem2; + cont2 = *rem1 - cntblank; + + if (cont1 == NULL) { + cont1 = cont2; + return LINE_EMPTY; + } + + i = (int)(cont2 - cont1); + if (i >= SIZE_LINE) + return LINE_ERROR; + + //内容头尾已无空格 + memcpy(content, cont1, i); + content[i] = 0; + + if (content[0] == '[' && content[i - 1] == ']') + return LINE_SECTION; + if (strchr(content, '=') != NULL) + return LINE_VALUE; + + return LINE_ERROR; +} + + +//取一节section +//输入:节名称 +//输出:成功与否、节名称首、节名称尾、节内容首、节内容尾(含换行)、下一节首(节尾与下一节首间为空行或注释行) +static int FindSection(const char *section, char **sect1, char **sect2, char **cont1, char **cont2, char **nextsect) +{ + int type; + char content[SIZE_LINE]; + char *rem1, *rem2, *nextline = nullptr; + + char *p = nullptr; + char *empty = nullptr; + int uselen = 0; + char found = 0; + + if (gBuffer == NULL) { + return 0; + } + + while (gBuflen - uselen > 0) { + p = gBuffer + uselen; + type = GetLine(p, gBuflen - uselen, content, &rem1, &rem2, &nextline); + uselen += (int)(nextline - p); + + if (LINE_SECTION == type) { + if (found || section == NULL) break; //发现另一section + content[strlen(content) - 1] = 0; //去尾部] + StrStrip(content + 1); //去首尾空格 + if (StriCmp(content + 1, section) == 0) { + found = 1; + *sect1 = p; + *sect2 = rem1; + *cont1 = nextline; + } + empty = nextline; + } else + if (LINE_VALUE == type) { + if (!found && section == NULL) { + found = 1; + *sect1 = p; + *sect2 = p; + *cont1 = p; + } + empty = nextline; + } + } + + if (!found) return 0; + + *cont2 = empty; + *nextsect = nextline; + return 1; +} + + +//从一行取键、值 +//输入:内容串(将被改写) +//输出:键串、值串 +static void GetKeyValue(char *content, char **key, char **value) +{ + char *p; + + p = strchr(content, '='); + *p = 0; + StrStrip(content); + StrStrip(p + 1); + *key = content; + *value = p + 1; +} + + +//释放ini文件所占资源 +void iniFileFree() +{ + if (gBuffer != NULL) { + free(gBuffer); + gBuffer = 0; + gBuflen = 0; + } +} + + +//加载ini文件至内存 +int iniFileLoad(const char *filename) +{ + FILE *file; + int len; + + iniFileFree(); + if (strlen(filename) >= sizeof(gFilename)) + return 0; + strcpy(gFilename, filename); + + file = fopen(gFilename, "rb"); + if (file == NULL) + return 0; + + fseek(file, 0, SEEK_END); + len = ftell(file); + gBuffer = (char*)malloc(len); + if (gBuffer == NULL) { + fclose(file); + return 0; + } + + fseek(file, 0, SEEK_SET); + len = fread(gBuffer, 1, len, file); + fclose(file); + gBuflen = len; + return 1; +} + + +//读取值原始串 +static int iniGetValue(const char *section, const char *key, char *value, int maxlen, const char *defvalue) +{ + int type; + char content[SIZE_LINE]; + char *rem1, *rem2, *nextline; + char *key0, *value0; + + char *p; + int uselen = 0; + char found = 0; + + int len; + + if (gBuffer == NULL || key == NULL) { + if (value != NULL) + value[0] = 0; + return 0; + } + + while (gBuflen - uselen > 0) { + p = gBuffer + uselen; + type = GetLine(p, gBuflen - uselen, content, &rem1, &rem2, &nextline); + uselen += (int)(nextline - p); + + if (LINE_SECTION == type) { + if (found || section == NULL) break; //发现另一section + content[strlen(content) - 1] = 0; //去尾部] + StrStrip(content + 1); //去首尾空格 + if (StriCmp(content + 1, section) == 0) { + found = 1; + } + } else + if (LINE_VALUE == type) { + if (!found && section == NULL) { + found = 1; + } + if (!found) + continue; + GetKeyValue(content, &key0, &value0); + if (StriCmp(key0, key) == 0) { + len = strlen(value0); + if (len == 0) break; //空值视为无效 + if (value != NULL) { + len = min(len, maxlen - 1); + strncpy(value, value0, len); + value[len] = 0; + } + return 1; + } + } + } + + //未发现键值取缺省 + if (value != NULL) { + if (defvalue != NULL) { + len = min(strlen(defvalue), maxlen - 1); + strncpy(value, defvalue, len); + value[len] = 0; + } else { + value[0] = 0; + } + } + return 0; +} + + +//获取字符串,不带引号 +int iniGetString(const char *section, const char *key, char *value, int maxlen, const char *defvalue) +{ + int ret; + int len; + + ret = iniGetValue(section, key, value, maxlen, defvalue); + if (!ret) + return ret; + + //去首尾空格 + len = strlen(value); + if (value[0] == '\'' && value[len - 1] == '\'') { + value[len - 1] = 0; + memmove(value, value + 1, len - 1); + } else + if (value[0] == '\"' && value[len - 1] == '\"') { + value[len - 1] = 0; + memmove(value, value + 1, len - 1); + } + return ret; +} + + +//获取整数值 +int iniGetInt(const char *section, const char *key, int defvalue) +{ + char valstr[64]; + + if (iniGetString(section, key, valstr, sizeof(valstr), "")) + return (int)strtol(valstr, NULL, 0); + return defvalue; +} + + +//获取浮点数 +double iniGetDouble(const char *section, const char *key, double defvalue) +{ + char valstr[64]; + + if (iniGetString(section, key, valstr, sizeof(valstr), "")) + return (int)atof(valstr); + return defvalue; +} + + +//设置字符串:若value为NULL,则删除该key所在行,包括注释 +int iniSetString(const char *section, const char *key, const char *value, bool quote) +{ + FILE *file; + char *sect1, *sect2, *cont1, *cont2, *nextsect; + char *p; + int len, type; + char content[SIZE_LINE]; + char *key0, *value0; + char *rem1, *rem2, *nextline; + + // 注了就可以创建文件了 + //if (gBuffer == NULL) { + // return 0; + //} + + if (FindSection(section, §1, §2, &cont1, &cont2, &nextsect) == 0) + { + //未找到节 + + //value无效则返回 + if (value == NULL) + return 0; + + //在文件尾部添加 + file = fopen(gFilename, "ab"); + if (file == NULL) + return 0; + if (quote) + { + fprintf(file, "\n[%s]\n%s=\"%s\"\n", section, key, value); + } + else + { + fprintf(file, "\n[%s]\n%s=%s\n", section, key, value); + } + fclose(file); + iniFileLoad(gFilename); + return 1; + } + + //找到节,则节内查找key + p = cont1; + len = (int)(cont2 - cont1); + while (len > 0) { + type = GetLine(p, len, content, &rem1, &rem2, &nextline); + + if (LINE_VALUE == type) { + GetKeyValue(content, &key0, &value0); + if (StriCmp(key0, key) == 0) { + //找到key + file = fopen(gFilename, "wb"); + if (file == NULL) + return 0; + len = (int)(p - gBuffer); + fwrite(gBuffer, 1, len, file); //写入key之前部分 + if (value == NULL) { + //value无效,删除 + len = (int)(nextline - gBuffer); //整行连同注释一并删除 + } else { + //value有效,改写 + if (quote) + { + fprintf(file, "%s=\"%s\"", key, value); + } + else + { + fprintf(file, "%s=%s", key, value); + } + len = (int)(rem1 - gBuffer); //保留尾部原注释! + } + fwrite(gBuffer + len, 1, gBuflen - len, file); //写入key所在行含注释之后部分 + fclose(file); + iniFileLoad(gFilename); + return 1; + } + } + + len -= (int)(nextline - p); + p = nextline; + } + + //未找到key + + //value无效则返回 + if (value == NULL) + return 0; + + //在文件尾部添加 + file = fopen(gFilename, "wb"); + if (file == NULL) + return 0; + len = (int)(cont2 - gBuffer); + fwrite(gBuffer, 1, len, file); //写入key之前部分 + if (quote) + { + fprintf(file, "%s=\"%s\"\n", key, value); + } + else + { + fprintf(file, "%s=%s\n", key, value); + } + fwrite(gBuffer + len, 1, gBuflen - len, file); //写入key之后部分 + fclose(file); + iniFileLoad(gFilename); + return 1; +} + + +//设置整数值:base取值10、16、8,分别表示10、16、8进制,缺省为10进制 +int iniSetInt(const char *section, const char *key, int value, int base) +{ + char valstr[64]; + + switch (base) { + case 16: + sprintf(valstr, "0x%x", value); + return iniSetString(section, key, valstr, false); + case 8: + sprintf(valstr, "0%o", value); + return iniSetString(section, key, valstr, false); + default: //10 + sprintf(valstr, "%d", value); + return iniSetString(section, key, valstr, false); + } +} diff --git a/include/inirw.h b/include/inirw.h new file mode 100644 index 0000000..94503bf --- /dev/null +++ b/include/inirw.h @@ -0,0 +1,55 @@ +/** + * 文件:inirw.h + * 版本:1.0 + * 作者:taoyuanmin@gmail.com + * + * 说明:ini配置文件读写 + * 1、支持;和#注释符号,支持行尾注释。 + * 2、支持带引号'或"成对匹配的字符串,提取时自动去引号。引号中可带其它引号或;#注释符。 + * 3、支持无section或空section(名称为空)。 + * 4、支持10、16、8进制数,0x开头为16进制数,0开头为8进制。 + * 5、支持section、key或=号前后带空格。 + * 6、支持\n、\r、\r\n或\n\r换行格式。 + * 7、不区分section、key大小写,但写入时以新串为准,并保持其大小写。 + * 8、新增数据时,若section存在则在该节最后一个有效数据后添加,否则在文件尾部添加。 + * 9、支持指定key所在整行删除,即删除该键值,包括注释。 + * 10、可自动跳过格式错误行,修改时仍然保留。 + * 11、修改时保留原注释:包括整行注释、行尾注释(包括前面空格)。 + * 12、修改时保留原空行。以上三点主要是尽量保留原格式。 + */ + + +#ifndef _INI_RW_H_ +#define _INI_RW_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +//加载ini文件至内存 +int iniFileLoad(const char *filename); +//释放ini文件所占资源 +void iniFileFree(); + +//获取字符串,不带引号 +int iniGetString(const char *section, const char *key, char *value, int size, const char *defvalue); +//获取整数值 +int iniGetInt(const char *section, const char *key, int defvalue); +//获取浮点数 +double iniGetDouble(const char *section, const char *key, double defvalue); + +//设置字符串:若value为NULL,则删除该key所在行,包括注释 +int iniSetString(const char *section, const char *key, const char *value,bool quote = true); +//设置整数值:base取值10、16、8,分别表示10、16、8进制,缺省为10进制 +int iniSetInt(const char *section, const char *key, int value, int base); + +// 以下是用于加载字符串后用于别的用途,因为它所有的写入操作都是写文件 +// 不满足我需要给它添加字符串或加密的需求 +const char* GetBuffer(); +int GetBufferLen(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/toolkit.cpp b/include/toolkit.cpp index 3512727..0d990e9 100644 --- a/include/toolkit.cpp +++ b/include/toolkit.cpp @@ -469,3 +469,44 @@ void GetOnFrontDisconnectedMsg(int ErrorId, char* ErrorMsg) break; } } + +#if defined _WIN32 || WIN32 || _WINDOWS +void GetDllPathByFunctionName(const char* szFunctionName, char* szPath) +{ + HMODULE hModule = nullptr; + GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, szFunctionName, &hModule); + + GetModuleFileNameA(hModule, szPath, MAX_PATH); +} + +void GetExePath(char* szPath) +{ + HMODULE hModule = GetModuleHandleA(nullptr); + //char szPath[MAX_PATH] = { 0 }; + GetModuleFileNameA(hModule, szPath, MAX_PATH); +} + +void GetDirectoryByPath(const char* szPath, char* szDirectory) +{ + //char szPath[_MAX_PATH] = { 0 }; + char drive[_MAX_DRIVE] = { 0 }; + char dir[_MAX_DIR] = { 0 }; + char fname[_MAX_FNAME] = { 0 }; + char ext[_MAX_EXT] = { 0 }; + + _splitpath(szPath, drive, dir, fname, ext); + _makepath(szDirectory, drive, dir, nullptr, nullptr); +} + +void GetNewPathInSameDirectory(const char* szPath, const char* szFname, const char* szExt, char* szFileName) +{ + //char szPath[_MAX_PATH] = { 0 }; + char drive[_MAX_DRIVE] = { 0 }; + char dir[_MAX_DIR] = { 0 }; + char fname[_MAX_FNAME] = { 0 }; + char ext[_MAX_EXT] = { 0 }; + + _splitpath(szPath, drive, dir, fname, ext); + _makepath(szFileName, drive, dir, szFname, szExt); +} +#endif diff --git a/include/toolkit.h b/include/toolkit.h index bea689f..a9e494d 100644 --- a/include/toolkit.h +++ b/include/toolkit.h @@ -23,6 +23,9 @@ void GetExchangeTime_DCE(char* TradingDay, char* ActionDay, char* UpdateTime, in void GetExchangeTime(char* TradingDay, char* ActionDay, char* UpdateTime, int* _TradingDay, int* _ActionDay, int* _UpdateTime, int* UpdateMillisec); void GetExchangeTime(time_t Time, int* _TradingDay, int* _ActionDay, int* _UpdateTime); +void GetUpdateTime_HH_mm_ss(char* UpdateTime, int* _HH, int* _mm, int* _ss); +void GetUpdateTime_HHmmss(char* UpdateTime, int* _HH, int* _mm, int* _ss); + int GetDate(char* TradingDay); int GetTime(char* UpdateTime); @@ -31,4 +34,13 @@ double my_round(float val, int x = 0); //根据OnFrontDisconnected(int nReason)的值填上错误消息 void GetOnFrontDisconnectedMsg(int ErrorId, char* ErrorMsg); +// 通过公开的函数名,得到当前的路径 +void GetDllPathByFunctionName(const char* szFunctionName, char* szPath); +// 得到当前可执行程序的路径 +void GetExePath(char* szPath); +// 传入路径,得到目录 +void GetDirectoryByPath(const char* szPath, char* szDirectory); +// 通过一个路径得到新的路径 +void GetNewPathInSameDirectory(const char* szPath, const char* szFname, const char* szExt, char* szFileName); + #endif \ No newline at end of file diff --git a/QuantBox_XAPI/ReadMe.txt b/languages/CPP/XAPI_CPP/ReadMe.txt similarity index 100% rename from QuantBox_XAPI/ReadMe.txt rename to languages/CPP/XAPI_CPP/ReadMe.txt diff --git a/QuantBox_XAPI/QuantBox_XAPI.cbp b/languages/CPP/XAPI_CPP/XAPI_CPP.cbp similarity index 100% rename from QuantBox_XAPI/QuantBox_XAPI.cbp rename to languages/CPP/XAPI_CPP/XAPI_CPP.cbp diff --git a/QuantBox_XAPI/QuantBox_XAPI.cpp b/languages/CPP/XAPI_CPP/XAPI_CPP.cpp similarity index 100% rename from QuantBox_XAPI/QuantBox_XAPI.cpp rename to languages/CPP/XAPI_CPP/XAPI_CPP.cpp diff --git a/languages/CPP/XAPI_CPP/XAPI_CPP.vcxproj b/languages/CPP/XAPI_CPP/XAPI_CPP.vcxproj new file mode 100644 index 0000000..8794ea6 --- /dev/null +++ b/languages/CPP/XAPI_CPP/XAPI_CPP.vcxproj @@ -0,0 +1,110 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {39599EFE-428F-408F-BF4F-BF462E37C5E8} + Win32Proj + XAPI_CPP + 8.1 + + + + DynamicLibrary + true + v140 + Unicode + false + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + true + ..\..\..\bin\$(Configuration)\$(PlatformTarget)\ + $(ProjectName)_$(PlatformTarget) + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;XAPI_CPP_EXPORTS;_CRT_SECURE_NO_WARNINGS;BUILDING_DLL;%(PreprocessorDefinitions) + true + + + Windows + true + ../../../include/XApiC.def + + + + + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;XAPI_CPP_EXPORTS;_CRT_SECURE_NO_WARNINGS;BUILDING_DLL;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + + + + + + + Create + Create + + + + + + + + + \ No newline at end of file diff --git a/QuantBox_XAPI/QuantBox_XAPI.vcxproj.filters b/languages/CPP/XAPI_CPP/XAPI_CPP.vcxproj.filters similarity index 94% rename from QuantBox_XAPI/QuantBox_XAPI.vcxproj.filters rename to languages/CPP/XAPI_CPP/XAPI_CPP.vcxproj.filters index 49328ae..3067039 100644 --- a/QuantBox_XAPI/QuantBox_XAPI.vcxproj.filters +++ b/languages/CPP/XAPI_CPP/XAPI_CPP.vcxproj.filters @@ -30,10 +30,10 @@ Header Files - + include - + include diff --git a/languages/CPP/XAPI_CPP/XApiC.cpp b/languages/CPP/XAPI_CPP/XApiC.cpp new file mode 100644 index 0000000..598255f --- /dev/null +++ b/languages/CPP/XAPI_CPP/XApiC.cpp @@ -0,0 +1,201 @@ +#include "stdafx.h" + +#include +#include +#include "../../../include/XApiC.h" +#include "../../../include/QueueHeader.h" +#include "../../../include/QueueEnum.h" + +#if defined WINDOWS || WIN32 +#include +#else +#include +#include +#endif + + +void* X_LoadLib(const char* libPath) +{ + if (libPath == nullptr) + return nullptr; + +#if defined WINDOWS || WIN32 + return LoadLibraryExA(libPath, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH); +#else + return dlopen(libPath, RTLD_NOW); +#endif +} + +const char* X_GetLastError() +{ +#if defined WINDOWS || WIN32 + char szBuf[256] = {0}; + LPVOID lpMsgBuf; + DWORD dw = GetLastError(); + FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + dw, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&lpMsgBuf, + 0, NULL); + return (const char*)lpMsgBuf; +#else + extern int errno; + errno = 0; + return dlerror(); +#endif +} + +void* X_GetFunction(void* lib, const char* ProcName) +{ + if (lib == nullptr) + return nullptr; +#if defined WINDOWS || WIN32 + return GetProcAddress((HMODULE)lib, ProcName); +#else + return (dlsym(lib, ProcName)); +#endif +} + +void X_FreeLib(void* lib) +{ + if (lib == nullptr) + return; + +#if defined WINDOWS || WIN32 + FreeLibrary((HMODULE)lib); +#else + dlclose(lib); +#endif +} + +ApiType X_GetApiTypes(void* pFun) +{ + if (pFun == nullptr) + return ApiType::ApiType_Nono; + + void* p = ((fnOnResponse)pFun)(RequestType::RequestType_GetApiTypes, nullptr, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); + + return (ApiType)(char)(long long)(p); +} + +const char* X_GetApiVersion(void* pFun) +{ + if (pFun == nullptr) + return nullptr; + + return (const char*)((fnOnResponse)pFun)(RequestType::RequestType_GetApiVersion, nullptr, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); +} + +const char* X_GetApiName(void* pFun) +{ + if (pFun == nullptr) + return nullptr; + + return (const char*)((fnOnResponse)pFun)(RequestType::RequestType_GetApiName, nullptr, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); +} + +void* X_Create(void* pFun) +{ + if (pFun == nullptr) + return nullptr; + + return ((fnOnResponse)pFun)(RequestType::RequestType_Create, nullptr, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); +} + +void X_Register(void* pFun, void* pApi, fnOnResponse pCallback, void* pClass) +{ + if (pFun == nullptr || pApi == nullptr) + return; + + ((fnOnResponse)pFun)(RequestType::RequestType_Register, pApi, nullptr, 0, 0, (void*)pCallback, 0, pClass, 0, nullptr, 0); +} + +void X_Connect(void* pFun, void* pApi, const char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count) +{ + if (pFun == nullptr || pApi == nullptr) + return; + + ((fnOnResponse)pFun)(RequestType::RequestType_Connect, pApi, nullptr, 0, 0, pServerInfo, 0, pUserInfo, count, (void*)szPath, 0); +} + +void X_Disconnect(void* pFun, void* pApi) +{ + if (pFun == nullptr || pApi == nullptr) + return; + + ((fnOnResponse)pFun)(RequestType::RequestType_Disconnect, pApi, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); +} + +void X_Subscribe(void* pFun, void* pApi, const char* szInstrument, const char* szExchange) +{ + if (pFun == nullptr || pApi == nullptr) + return; + + ((fnOnResponse)pFun)(RequestType::RequestType_Subscribe, pApi, nullptr, 0, 0, (void*)szInstrument, 0, (void*)szExchange, 0, nullptr, 0); +} + +void X_Unsubscribe(void* pFun, void* pApi, const char* szInstrument, const char* szExchange) +{ + if (pFun == nullptr || pApi == nullptr) + return; + + ((fnOnResponse)pFun)(RequestType::RequestType_Unsubscribe, pApi, nullptr, 0, 0, (void*)szInstrument, 0, (void*)szExchange, 0, nullptr, 0); +} + +void X_SubscribeQuote(void* pFun, void* pApi, const char* szInstrument, const char* szExchange) +{ + if (pFun == nullptr || pApi == nullptr) + return; + + ((fnOnResponse)pFun)(RequestType::RequestType_SubscribeQuote, pApi, nullptr, 0, 0, (void*)szInstrument, 0, (void*)szExchange, 0, nullptr, 0); +} + +void X_UnsubscribeQuote(void* pFun, void* pApi, const char* szInstrument, const char* szExchange) +{ + if (pFun == nullptr || pApi == nullptr) + return; + + ((fnOnResponse)pFun)(RequestType::RequestType_UnsubscribeQuote, pApi, nullptr, 0, 0, (void*)szInstrument, 0, (void*)szExchange, 0, nullptr, 0); +} + +void X_ReqQuery(void* pFun, void* pApi, QueryType type, ReqQueryField* query) +{ + if (pFun == nullptr || pApi == nullptr) + return; + + ((fnOnResponse)pFun)(type, pApi, nullptr, 0, 0, query, sizeof(ReqQueryField), nullptr, 0, nullptr, 0); +} + +const char* X_SendOrder(void* pFun, void* pApi, OrderField* pOrder, int count, char* pOut) +{ + if (pFun == nullptr || pApi == nullptr) + return nullptr; + + return (const char*)((fnOnResponse)pFun)(RequestType::RequestType_ReqOrderInsert, pApi, nullptr, 0, 0, pOrder, count, pOut, 0, nullptr, 0); +} + +const char* X_CancelOrder(void* pFun, void* pApi, OrderIDType* pIn, int count, char* pOut) +{ + if (pFun == nullptr || pApi == nullptr) + return nullptr; + + return (const char*)((fnOnResponse)pFun)(RequestType::RequestType_ReqOrderAction, pApi, nullptr, 0, 0, pIn, count, pOut, 0, nullptr, 0); +} + +const char* X_SendQuote(void* pFun, void* pApi, QuoteField* pQuote, int count, char* pOut) +{ + if (pFun == nullptr || pApi == nullptr) + return nullptr; + + return (const char*)((fnOnResponse)pFun)(RequestType::RequestType_ReqQuoteInsert, pApi, nullptr, 0, 0, pQuote, count, pOut, 0, nullptr, 0); +} + +const char* X_CancelQuote(void* pFun, void* pApi, OrderIDType* pIn, int count, char* pOut) +{ + if (pFun == nullptr || pApi == nullptr) + return nullptr; + + return (const char*)((fnOnResponse)pFun)(RequestType::RequestType_ReqQuoteAction, pApi, nullptr, 0, 0, pIn, count, pOut, 0, nullptr, 0); +} diff --git a/languages/CPP/XAPI_CPP/XApiCpp.cpp b/languages/CPP/XAPI_CPP/XApiCpp.cpp new file mode 100644 index 0000000..c12cb90 --- /dev/null +++ b/languages/CPP/XAPI_CPP/XApiCpp.cpp @@ -0,0 +1,17 @@ +#include "stdafx.h" +#include "../../../include/XApiCpp.h" + +#include "XApiImpl.h" + +CXApi::CXApi() +{ +} + +CXApi::~CXApi() +{ +} + +CXApi* CXApi::CreateApi(const char* libPath) +{ + return new CXApiImpl(libPath); +} diff --git a/languages/CPP/XAPI_CPP/XApiImpl.cpp b/languages/CPP/XAPI_CPP/XApiImpl.cpp new file mode 100644 index 0000000..52d4748 --- /dev/null +++ b/languages/CPP/XAPI_CPP/XApiImpl.cpp @@ -0,0 +1,199 @@ +#include "stdafx.h" +#include +#include +#include "XApiImpl.h" + +#include "../../../include/QueueEnum.h" +#include "../../../include/XApiC.h" + +void* __stdcall CXApiImpl::OnResponse(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + if (pApi2 == nullptr) + return nullptr; + + CXApiImpl* pThisClass = (CXApiImpl*)pApi2; + return pThisClass->_OnResponse(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); +} + +void* CXApiImpl::_OnResponse(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3) +{ + if (nullptr == m_pSpi) + return nullptr; + + ResponseType rt = (ResponseType)type; + switch (rt) + { + case ResponseType_OnConnectionStatus: + m_pSpi->OnConnectionStatus(this, (ConnectionStatus)(char)double1, (RspUserLoginField*)ptr1, size1); + break; + case ResponseType_OnRtnError: + m_pSpi->OnRtnError(this, (ErrorField*)ptr1); + break; + case ResponseType_OnLog: + m_pSpi->OnLog(this, (LogField*)ptr1); + break; + case ResponseType_OnRtnDepthMarketData: + m_pSpi->OnRtnDepthMarketDataN(this, (DepthMarketDataNField*)ptr1); + break; + case ResponseType_OnRspQryInstrument: + m_pSpi->OnRspQryInstrument(this, (InstrumentField*)ptr1, size1, double1 != 0); + break; + case ResponseType_OnRspQryTradingAccount: + m_pSpi->OnRspQryTradingAccount(this, (AccountField*)ptr1, size1, double1 != 0); + break; + case ResponseType_OnRspQryInvestorPosition: + m_pSpi->OnRspQryInvestorPosition(this, (PositionField*)ptr1, size1, double1 != 0); + break; + case ResponseType_OnRspQrySettlementInfo: + m_pSpi->OnRspQrySettlementInfo(this, (SettlementInfoField*)ptr1, size1, double1 != 0); + break; + + case ResponseType_OnRspQryOrder: + m_pSpi->OnRspQryOrder(this, (OrderField*)ptr1, size1, double1 != 0); + break; + case ResponseType_OnRspQryTrade: + m_pSpi->OnRspQryTrade(this, (TradeField*)ptr1, size1, double1 != 0); + break; + case ResponseType_OnRspQryQuote: + m_pSpi->OnRspQryQuote(this, (QuoteField*)ptr1, size1, double1 != 0); + break; + + case ResponseType_OnRtnOrder: + m_pSpi->OnRtnOrder(this, (OrderField*)ptr1); + break; + case ResponseType_OnRtnTrade: + m_pSpi->OnRtnTrade(this, (TradeField*)ptr1); + break; + case ResponseType_OnRtnQuote: + m_pSpi->OnRtnQuote(this, (QuoteField*)ptr1); + break; + + case ResponseType_OnRtnQuoteRequest: + m_pSpi->OnRtnQuoteRequest(this, (QuoteRequestField*)ptr1); + break; + + case ResponseType_OnRspQryHistoricalTicks: + m_pSpi->OnRspQryHistoricalTicks(this, (TickField*)ptr1, size1, (HistoricalDataRequestField*)ptr2, size2, double1 != 0); + break; + case ResponseType_OnRspQryHistoricalBars: + m_pSpi->OnRspQryHistoricalBars(this, (BarField*)ptr1, size1, (HistoricalDataRequestField*)ptr2, size2, double1 != 0); + break; + case ResponseType_OnRspQryInvestor: + m_pSpi->OnRspQryInvestor(this, (InvestorField*)ptr1, size1, double1 != 0); + break; + + case ResponseType_OnFilterSubscribe: + return (void*)m_pSpi->OnFilterSubscribe(this, (ExchangeType)(char)double1, (int)size1, (int)size1, (int)size3, (char*)ptr1); + default: + break; + } + return nullptr; +} + +CXApiImpl::CXApiImpl(const char* libPath) :CXApi() +{ + m_pLib = nullptr; + m_pFun = nullptr; + m_pApi = nullptr; + m_pSpi = nullptr; + + strncpy(m_LibPath, libPath, sizeof(m_LibPath)); +} + + +CXApiImpl::~CXApiImpl() +{ + Disconnect(); +} + +ApiType CXApiImpl::GetApiTypes() +{ + return X_GetApiTypes(m_pFun); +} + +const char* CXApiImpl::GetApiVersion() +{ + return X_GetApiVersion(m_pFun); +} + +const char* CXApiImpl::GetApiName() +{ + return X_GetApiName(m_pFun); +} + +void CXApiImpl::RegisterSpi(CXSpi *pSpi) +{ + m_pSpi = pSpi; +} + +bool CXApiImpl::Init() +{ + m_pLib = X_LoadLib(m_LibPath); + if (m_pLib) + { + m_pFun = X_GetFunction(m_pLib); + if (m_pFun) + { + return true; + } + } + return false; +} + +const char* CXApiImpl::GetLastError() +{ + return X_GetLastError(); +} + +void CXApiImpl::Connect(const char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count) +{ + m_pApi = X_Create(m_pFun); + X_Register(m_pFun, m_pApi, (fnOnResponse)OnResponse, this); + X_Connect(m_pFun, m_pApi, szPath, pServerInfo, pUserInfo, count); +} + +void CXApiImpl::Disconnect() +{ + X_Disconnect(m_pFun, m_pApi); + X_FreeLib(m_pLib); + + m_pLib = nullptr; + m_pFun = nullptr; + m_pApi = nullptr; + m_pSpi = nullptr; +} + +void CXApiImpl::Subscribe(const char* szInstrument, const char* szExchange) +{ + X_Subscribe(m_pFun, m_pApi, szInstrument, szExchange); +} + +void CXApiImpl::Unsubscribe(const char* szInstrument, const char* szExchange) +{ + X_Unsubscribe(m_pFun, m_pApi, szInstrument, szExchange); +} + +void CXApiImpl::ReqQuery(QueryType type, ReqQueryField* query) +{ + X_ReqQuery(m_pFun, m_pApi, type, query); +} + +const char* CXApiImpl::SendOrder(OrderField* pOrder, int count, char* pOut) +{ + return X_SendOrder(m_pFun, m_pApi, pOrder, count, pOut); +} + +const char* CXApiImpl::CancelOrder(OrderIDType* pIn, int count, char* pOut) +{ + return X_CancelOrder(m_pFun, m_pApi, pIn, count, pOut); +} + +const char* CXApiImpl::SendQuote(QuoteField* pQuote, int count, char* pOut) +{ + return X_SendQuote(m_pFun, m_pApi, pQuote, count, pOut); +} + +const char* CXApiImpl::CancelQuote(OrderIDType* pIn, int count, char* pOut) +{ + return X_CancelQuote(m_pFun, m_pApi, pIn, count, pOut); +} diff --git a/languages/CPP/XAPI_CPP/XApiImpl.h b/languages/CPP/XAPI_CPP/XApiImpl.h new file mode 100644 index 0000000..75ef541 --- /dev/null +++ b/languages/CPP/XAPI_CPP/XApiImpl.h @@ -0,0 +1,46 @@ +#pragma once +#include "../../../include/XApiCpp.h" + +#include "../../../include/QueueHeader.h" + +class CXApiImpl : + public CXApi +{ +public: + CXApiImpl(const char* libPath); + ~CXApiImpl(); + + virtual ApiType GetApiTypes(); + virtual const char* GetApiVersion(); + virtual const char* GetApiName(); + + virtual bool Init(); + virtual const char* GetLastError(); + virtual void RegisterSpi(CXSpi *pSpi); + + virtual void Connect(const char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count); + virtual void Disconnect(); + + virtual void Subscribe(const char* szInstrument, const char* szExchange); + virtual void Unsubscribe(const char* szInstrument, const char* szExchange); + + virtual void ReqQuery(QueryType type, ReqQueryField* query); + + virtual const char* SendOrder(OrderField* pOrder, int count, char* pOut); + virtual const char* CancelOrder(OrderIDType* pIn, int count, char* pOut); + + virtual const char* SendQuote(QuoteField* pQuote, int count, char* pOut); + virtual const char* CancelQuote(OrderIDType* pIn, int count, char* pOut); +public: + static void* __stdcall OnResponse(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); +private: + void* _OnResponse(char type, void* pApi1, void* pApi2, double double1, double double2, void* ptr1, int size1, void* ptr2, int size2, void* ptr3, int size3); + + void* m_pLib; + void* m_pFun; + void* m_pApi; + + CXSpi *m_pSpi; + char m_LibPath[1024]; +}; + diff --git a/languages/CPP/XAPI_CPP/dllmain.cpp b/languages/CPP/XAPI_CPP/dllmain.cpp new file mode 100644 index 0000000..69b5891 --- /dev/null +++ b/languages/CPP/XAPI_CPP/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/QuantBox_XAPI/stdafx.cpp b/languages/CPP/XAPI_CPP/stdafx.cpp similarity index 100% rename from QuantBox_XAPI/stdafx.cpp rename to languages/CPP/XAPI_CPP/stdafx.cpp diff --git a/QuantBox_XAPI/stdafx.h b/languages/CPP/XAPI_CPP/stdafx.h similarity index 100% rename from QuantBox_XAPI/stdafx.h rename to languages/CPP/XAPI_CPP/stdafx.h diff --git a/languages/CPP/XAPI_CPP/targetver.h b/languages/CPP/XAPI_CPP/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/languages/CPP/XAPI_CPP/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/languages/CSharp/XAPI_CSharp.sln b/languages/CSharp/XAPI_CSharp.sln new file mode 100644 index 0000000..bf2538c --- /dev/null +++ b/languages/CSharp/XAPI_CSharp.sln @@ -0,0 +1,40 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XAPI_CSharp", "XAPI_CSharp\XAPI_CSharp.csproj", "{6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug64|Any CPU = Debug64|Any CPU + Debug64|x64 = Debug64|x64 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release64|Any CPU = Release64|Any CPU + Release64|x64 = Release64|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|x64.ActiveCfg = Debug|x64 + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug|x64.Build.0 = Debug|x64 + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug64|Any CPU.ActiveCfg = Debug64|Any CPU + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug64|Any CPU.Build.0 = Debug64|Any CPU + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug64|x64.ActiveCfg = Debug64|x64 + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Debug64|x64.Build.0 = Debug64|x64 + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|Any CPU.Build.0 = Release|Any CPU + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|x64.ActiveCfg = Release|x64 + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release|x64.Build.0 = Release|x64 + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release64|Any CPU.ActiveCfg = Release64|Any CPU + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release64|Any CPU.Build.0 = Release64|Any CPU + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release64|x64.ActiveCfg = Release64|x64 + {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB}.Release64|x64.Build.0 = Release64|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/languages/CSharp/XAPI_CSharp/COM/ClassFactoryBase.cs b/languages/CSharp/XAPI_CSharp/COM/ClassFactoryBase.cs new file mode 100644 index 0000000..b64ad36 --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/ClassFactoryBase.cs @@ -0,0 +1,152 @@ +using System; +using System.Runtime.InteropServices; + +namespace XAPI.COM +{ + class ClassFactoryBase : IClassFactory + { + // CoRegisterClassObject() is used to register a Class Factory + // into COM's internal table of Class Factories. + [DllImport("ole32.dll")] + static extern int CoRegisterClassObject([In] ref Guid rclsid, + [MarshalAs(UnmanagedType.IUnknown)] object pUnk, uint dwClsContext, + uint flags, out uint lpdwRegister); + + // Called by an COM EXE Server that can register multiple class objects + // to inform COM about all registered classes, and permits activation + // requests for those class objects. + // This function causes OLE to inform the SCM about all the registered + // classes, and begins letting activation requests into the server process. + [DllImport("ole32.dll")] + static extern int CoResumeClassObjects(); + + // CoRevokeClassObject() is used to unregister a Class Factory + // from COM's internal table of Class Factories. + [DllImport("ole32.dll")] + static extern int CoRevokeClassObject(uint dwRegister); + + public ClassFactoryBase() + { + } + + protected UInt32 m_locked = 0; + protected uint m_ClassContext = (uint)CLSCTX.CLSCTX_LOCAL_SERVER; + protected Guid m_ClassId; + protected uint m_Flags; + protected uint m_Cookie; + + public virtual void virtual_CreateInstance(IntPtr pUnkOuter, ref Guid riid, out IntPtr ppvObject) + { + IntPtr nullPtr = new IntPtr(0); + ppvObject = nullPtr; + } + + public uint ClassContext + { + get + { + return m_ClassContext; + } + set + { + m_ClassContext = value; + } + } + + public Guid ClassId + { + get + { + return m_ClassId; + } + set + { + m_ClassId = value; + } + } + + public uint Flags + { + get + { + return m_Flags; + } + set + { + m_Flags = value; + } + } + + public bool RegisterClassObject() + { + // Register the class factory + int i = CoRegisterClassObject + ( + ref m_ClassId, + this, + ClassContext, + Flags, + out m_Cookie + ); + + if (i == 0) + { + return true; + } + else + { + return false; + } + } + + public bool RevokeClassObject() + { + int i = CoRevokeClassObject(m_Cookie); + + if (i == 0) + { + return true; + } + else + { + return false; + } + } + + public static bool ResumeClassObjects() + { + int i = CoResumeClassObjects(); + + if (i == 0) + { + return true; + } + else + { + return false; + } + } + + #region IClassFactory Implementations + public void CreateInstance(IntPtr pUnkOuter, ref Guid riid, out IntPtr ppvObject) + { + virtual_CreateInstance(pUnkOuter, ref riid, out ppvObject); + } + + public void LockServer(bool bLock) + { + if (bLock) + { + ManagedCOMLocalServer.InterlockedIncrementServerLockCount(); + } + else + { + ManagedCOMLocalServer.InterlockedDecrementServerLockCount(); + } + + // Always attempt to see if we need to shutdown this server application. + ManagedCOMLocalServer.AttemptToTerminateServer(); + } + #endregion + } +} diff --git a/languages/CSharp/XAPI_CSharp/COM/Delegate.cs b/languages/CSharp/XAPI_CSharp/COM/Delegate.cs new file mode 100644 index 0000000..587f579 --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/Delegate.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace XAPI.COM +{ + // 中文问题,以及枚举问题,使用新Class来替代Struct + [ComVisible(false)] + public delegate void DelegateOnConnectionStatus(XApiCom sender, int status, string status_String, RspUserLoginClass userLogin, int size1); + [ComVisible(false)] + public delegate void DelegateOnRtnError(XApiCom sender, ErrorClass error); + [ComVisible(false)] + public delegate void DelegateOnLog(XApiCom sender, LogClass log); + + [ComVisible(false)] + public delegate void DelegateOnRtnDepthMarketData(XApiCom sender, DepthMarketDataNClass marketData); + //public delegate void DelegateOnRtnQuoteRequest(object sender, [In]ref QuoteRequestField quoteRequest); + + [ComVisible(false)] + public delegate void DelegateOnRspQryInstrument(XApiCom sender, InstrumentClass instrument, int size1, bool bIsLast); + [ComVisible(false)] + public delegate void DelegateOnRspQryTradingAccount(XApiCom sender, AccountClass account, int size1, bool bIsLast); + [ComVisible(false)] + public delegate void DelegateOnRspQryInvestorPosition(XApiCom sender, PositionClass position, int size1, bool bIsLast); + [ComVisible(false)] + public delegate void DelegateOnRspQrySettlementInfo(object sender, SettlementInfoClass settlementInfo, int size1, bool bIsLast); + //public delegate void DelegateOnRspQryInvestor(object sender, InvestorField investor, int size1, bool bIsLast); + [ComVisible(false)] + public delegate void DelegateOnRtnOrder(XApiCom sender, OrderClass order); + [ComVisible(false)] + public delegate void DelegateOnRtnTrade(XApiCom sender, TradeClass trade); + //public delegate void DelegateOnRtnQuote(object sender, QuoteField quote); + [ComVisible(false)] + public delegate void DelegateOnRspQryOrder(XApiCom sender, OrderClass order, int size1, bool bIsLast); + [ComVisible(false)] + public delegate void DelegateOnRspQryTrade(XApiCom sender, TradeClass trade, int size1, bool bIsLast); + //public delegate void DelegateOnRspQryQuote(object sender, QuoteField quote, int size1, bool bIsLast); + + //public delegate void DelegateOnRspQryHistoricalTicks(object sender, IntPtr pTicks, int size1, HistoricalDataRequestField request, int size2, bool bIsLast); + //public delegate void DelegateOnRspQryHistoricalBars(object sender, IntPtr pBars, int size1, HistoricalDataRequestField request, int size2, bool bIsLast); + + //public delegate bool DelegateOnFilterSubscribe(object sender, ExchangeType exchange, int instrument_part1, int instrument_part2, int instrument_part3, IntPtr pInstrument); +} diff --git a/languages/CSharp/XAPI_CSharp/COM/GarbageCollection.cs b/languages/CSharp/XAPI_CSharp/COM/GarbageCollection.cs new file mode 100644 index 0000000..2aa11ec --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/GarbageCollection.cs @@ -0,0 +1,63 @@ +using System; +using System.Threading; + +namespace XAPI.COM +{ + /// + /// Summary description for GarbageCollection. + /// + class GarbageCollection + { + protected bool m_bContinueThread; + protected bool m_GCWatchStopped; + protected int m_iInterval; + protected ManualResetEvent m_EventThreadEnded; + + public GarbageCollection(int iInterval) + { + m_bContinueThread = true; + m_GCWatchStopped = false; + m_iInterval = iInterval; + m_EventThreadEnded = new ManualResetEvent(false); + } + + public void GCWatch() + { + Console.WriteLine("GarbageCollection.GCWatch() is now running on another thread."); + // Pause for a moment to provide a delay to make threads more apparent. + while (ContinueThread()) + { + GC.Collect(); + Thread.Sleep(m_iInterval); + } + + Console.WriteLine("Goind to call m_EventThreadEnded.Set()."); + m_EventThreadEnded.Set(); + } + + protected bool ContinueThread() + { + lock(this) + { + return m_bContinueThread; + } + } + + public void StopThread() + { + lock(this) + { + Console.WriteLine("StopThread()."); + m_bContinueThread = false; + } + } + + public void WaitForThreadToStop() + { + Console.WriteLine("WaitForThreadToStop()."); + m_EventThreadEnded.WaitOne(); + m_EventThreadEnded.Reset(); + Console.WriteLine("WaitForThreadToStop() exiting."); + } + } +} diff --git a/languages/CSharp/XAPI_CSharp/COM/IClassFactory.cs b/languages/CSharp/XAPI_CSharp/COM/IClassFactory.cs new file mode 100644 index 0000000..1ddae0d --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/IClassFactory.cs @@ -0,0 +1,19 @@ +using System; +using System.Runtime.InteropServices; + +namespace XAPI.COM +{ + // Interface IClassFactory is here to provide a C# definition of the + // COM IClassFactory interface. + [ + ComImport, // This interface originated from COM. + ComVisible(false), // It is not hard to imagine that this interface must not be exposed to COM. + InterfaceType(ComInterfaceType.InterfaceIsIUnknown), // Indicate that this interface is not IDispatch-based. + Guid("00000001-0000-0000-C000-000000000046") // This GUID is the actual GUID of IClassFactory. + ] + public interface IClassFactory + { + void CreateInstance(IntPtr pUnkOuter, ref Guid riid, out IntPtr ppvObject); + void LockServer(bool fLock); + } +} diff --git a/languages/CSharp/XAPI_CSharp/COM/IXApi.cs b/languages/CSharp/XAPI_CSharp/COM/IXApi.cs new file mode 100644 index 0000000..d3016cb --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/IXApi.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace XAPI.COM +{ + [ComVisible(true)] + [Guid("DBCAEFA9-4337-47B8-9B47-66070604CE2C")] + public interface IXApi + { + [DispId(1)] + void SetLibPath(string LibPath); + [DispId(2)] + void SetServerInfo(string key,object value); + [DispId(3)] + void SetUserInfo(string key, object value); + + + [DispId(10)] + void Connect(); + [DispId(11)] + void Disconnect(); + + [DispId(20)] + void Subscribe(string szInstrument, string szExchange); + [DispId(21)] + void Unsubscribe(string szInstrument, string szExchange); + + [DispId(31)] + void NewOrder(); + [DispId(32)] + void SetOrder(string key, object value); + [DispId(33)] + string SendOrder(); + [DispId(34)] + string CancelOrder(string id); + + [DispId(40)] + void NewQuery(); + [DispId(41)] + void SetQuery(string key, object value); + [DispId(42)] + void ReqQuery(string type); + [DispId(50)] + QueueData TryDequeue(); + + [DispId(60)] + void GCCollect(); + } +} diff --git a/languages/CSharp/XAPI_CSharp/COM/IXApiEvents.cs b/languages/CSharp/XAPI_CSharp/COM/IXApiEvents.cs new file mode 100644 index 0000000..522f8b2 --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/IXApiEvents.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace XAPI.COM +{ + /// + /// 将object sender改成XApiCom sender后,在MATLAB下只是OnData事件可以注册后收到消息,而其它的事件都无法直接收到 + /// 如果将OnConnectionStatus这类的事件修改成不带类成员的这种,一些信息又无法传递 + /// + [ComVisible(true)] + [Guid("4D7F9B54-3098-45AE-8EEB-4ED24AC47613")] + [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] + public interface IXApiEvents + { + [DispId(2)] + void OnConnectionStatus(XApiCom sender, int status, string status_String, RspUserLoginClass userLogin, int size1); + [DispId(3)] + void OnRtnError(XApiCom sender, ErrorClass error); + [DispId(4)] + void OnLog(XApiCom sender, LogClass log); + + [DispId(5)] + void OnRtnDepthMarketData(XApiCom sender, DepthMarketDataNClass marketData); + //public delegate void DelegateOnRtnQuoteRequest(object sender, [In]ref QuoteRequestField quoteRequest); + + [DispId(6)] + void OnRspQryInstrument(XApiCom sender, InstrumentClass instrument, int size1, bool bIsLast); + [DispId(7)] + void OnRspQryTradingAccount(XApiCom sender, AccountClass account, int size1, bool bIsLast); + [DispId(8)] + void OnRspQryInvestorPosition(XApiCom sender, PositionClass position, int size1, bool bIsLast); + [DispId(9)] + void OnRspQrySettlementInfo(object sender, SettlementInfoClass settlementInfo, int size1, bool bIsLast); + //public delegate void DelegateOnRspQryInvestor(object sender, InvestorField investor, int size1, bool bIsLast); + [DispId(10)] + void OnRtnOrder(XApiCom sender, OrderClass order); + [DispId(11)] + void OnRtnTrade(XApiCom sender, TradeClass trade); + //public delegate void DelegateOnRtnQuote(object sender, QuoteField quote); + [DispId(12)] + void OnRspQryOrder(XApiCom sender, OrderClass order, int size1, bool bIsLast); + [DispId(13)] + void OnRspQryTrade(XApiCom sender, TradeClass trade, int size1, bool bIsLast); + //public delegate void DelegateOnRspQryQuote(object sender, QuoteField quote, int size1, bool bIsLast); + + //public delegate void DelegateOnRspQryHistoricalTicks(object sender, IntPtr pTicks, int size1, HistoricalDataRequestField request, int size2, bool bIsLast); + //public delegate void DelegateOnRspQryHistoricalBars(object sender, IntPtr pBars, int size1, HistoricalDataRequestField request, int size2, bool bIsLast); + + //public delegate bool DelegateOnFilterSubscribe(object sender, ExchangeType exchange, int instrument_part1, int instrument_part2, int instrument_part3, IntPtr pInstrument); + + } +} diff --git a/languages/CSharp/XAPI_CSharp/COM/ManagedCOMLocalServer.cs b/languages/CSharp/XAPI_CSharp/COM/ManagedCOMLocalServer.cs new file mode 100644 index 0000000..6de3b0f --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/ManagedCOMLocalServer.cs @@ -0,0 +1,385 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.Runtime.InteropServices; +using Microsoft.Win32; +using System.Text; +using System.Threading; + +namespace XAPI.COM +{ + [Flags] + enum COINIT : uint + { + /// Initializes the thread for multi-threaded object concurrency. + COINIT_MULTITHREADED = 0x0, + /// Initializes the thread for apartment-threaded object concurrency. + COINIT_APARTMENTTHREADED = 0x2, + /// Disables DDE for Ole1 support. + COINIT_DISABLE_OLE1DDE = 0x4, + /// Trades memory for speed. + COINIT_SPEED_OVER_MEMORY = 0x8 + } + + [Flags] + enum CLSCTX : uint + { + CLSCTX_INPROC_SERVER = 0x1, + CLSCTX_INPROC_HANDLER = 0x2, + CLSCTX_LOCAL_SERVER = 0x4, + CLSCTX_INPROC_SERVER16 = 0x8, + CLSCTX_REMOTE_SERVER = 0x10, + CLSCTX_INPROC_HANDLER16 = 0x20, + CLSCTX_RESERVED1 = 0x40, + CLSCTX_RESERVED2 = 0x80, + CLSCTX_RESERVED3 = 0x100, + CLSCTX_RESERVED4 = 0x200, + CLSCTX_NO_CODE_DOWNLOAD = 0x400, + CLSCTX_RESERVED5 = 0x800, + CLSCTX_NO_CUSTOM_MARSHAL= 0x1000, + CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000, + CLSCTX_NO_FAILURE_LOG = 0x4000, + CLSCTX_DISABLE_AAA = 0x8000, + CLSCTX_ENABLE_AAA = 0x10000, + CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000, + CLSCTX_INPROC = CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, + CLSCTX_SERVER = CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER|CLSCTX_REMOTE_SERVER, + CLSCTX_ALL = CLSCTX_SERVER|CLSCTX_INPROC_HANDLER + } + + [Flags] + enum REGCLS : uint + { + REGCLS_SINGLEUSE = 0, + REGCLS_MULTIPLEUSE = 1, + REGCLS_MULTI_SEPARATE = 2, + REGCLS_SUSPENDED = 4, + REGCLS_SURROGATE = 8 + } + + // We import the POINT structure because it is referenced + // by the MSG structure. + [ComVisible(false)] + [StructLayout( LayoutKind.Sequential )] + public struct POINT + { + public int X; + public int Y; + + public POINT( int x, int y ) + { + this.X = x; + this.Y = y; + } + + public static implicit operator Point( POINT p ) + { + return new Point( p.X, p.Y ); + } + + public static implicit operator POINT( Point p ) + { + return new POINT( p.X, p.Y ); + } + } + + // We import the MSG structure because it is referenced + // by the GetMessage(), TranslateMessage() and DispatchMessage() + // Win32 APIs. + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential)] + [CLSCompliant(false)] + public struct MSG + { + public IntPtr hwnd; + public uint message; + public IntPtr wParam; + public IntPtr lParam; + public uint time; + public POINT pt; + } + + // Note that ManagedCOMLocalServer_Impl01 is NOT declared as public. + // This is so that it will not be exposed to COM when we call regasm + // or tlbexp. + class ManagedCOMLocalServer + { + // CoInitializeEx() can be used to set the apartment model + // of individual threads. + [DllImport("ole32.dll")] + static extern int CoInitializeEx(IntPtr pvReserved, uint dwCoInit); + + // CoUninitialize() is used to uninitialize a COM thread. + [DllImport("ole32.dll")] + static extern void CoUninitialize(); + + // PostThreadMessage() allows us to post a Windows Message to + // a specific thread (identified by its thread id). + // We will need this API to post a WM_QUIT message to the main + // thread in order to terminate this application. + [DllImport("user32.dll")] + static extern bool PostThreadMessage(uint idThread, uint Msg, UIntPtr wParam, + IntPtr lParam); + + // GetCurrentThreadId() allows us to obtain the thread id of the + // calling thread. This allows us to post the WM_QUIT message to + // the main thread. + [DllImport("kernel32.dll")] + static extern uint GetCurrentThreadId(); + + // We will be manually performing a Message Loop within the main thread + // of this application. Hence we will need to import GetMessage(), + // TranslateMessage() and DispatchMessage(). + [DllImport("user32.dll")] + static extern bool GetMessage(out MSG lpMsg, IntPtr hWnd, uint wMsgFilterMin, + uint wMsgFilterMax); + + [DllImport("user32.dll")] + static extern bool TranslateMessage([In] ref MSG lpMsg); + + [DllImport("user32.dll")] + static extern IntPtr DispatchMessage([In] ref MSG lpmsg); + + // Define two common GUID objects for public usage. + public static Guid IID_IUnknown = new Guid("{00000000-0000-0000-C000-000000000046}"); + public static Guid IID_IDispatch = new Guid("{00020400-0000-0000-C000-000000000046}"); + + protected static uint m_uiMainThreadId; // Stores the main thread's thread id. + protected static int m_iObjsInUse; // Keeps a count on the total number of objects alive. + protected static int m_iServerLocks;// Keeps a lock count on this application. + + // This property returns the main thread's id. + public static uint MainThreadId + { + get + { + return m_uiMainThreadId; + } + } + + // This method performs a thread-safe incrementation of the objects count. + public static int InterlockedIncrementObjectsCount() + { + Console.WriteLine("InterlockedIncrementObjectsCount()"); + // Increment the global count of objects. + return Interlocked.Increment(ref m_iObjsInUse); + } + + // This method performs a thread-safe decrementation the objects count. + public static int InterlockedDecrementObjectsCount() + { + Console.WriteLine("InterlockedDecrementObjectsCount()"); + // Decrement the global count of objects. + return Interlocked.Decrement(ref m_iObjsInUse); + } + + // Returns the total number of objects alive currently. + public static int ObjectsCount + { + get + { + lock(typeof(ManagedCOMLocalServer)) + { + return m_iObjsInUse; + } + } + } + + // This method performs a thread-safe incrementation the + // server lock count. + public static int InterlockedIncrementServerLockCount() + { + Console.WriteLine("InterlockedIncrementServerLockCount()"); + // Increment the global lock count of this server. + return Interlocked.Increment(ref m_iServerLocks); + } + + // This method performs a thread-safe decrementation the + // server lock count. + public static int InterlockedDecrementServerLockCount() + { + Console.WriteLine("InterlockedDecrementServerLockCount()"); + // Decrement the global lock count of this server. + return Interlocked.Decrement(ref m_iServerLocks); + } + + // Returns the current server lock count. + public static int ServerLockCount + { + get + { + lock(typeof(ManagedCOMLocalServer)) + { + return m_iServerLocks; + } + } + } + + // AttemptToTerminateServer() will check to see if + // the objects count and the server lock count has + // both dropped to zero. + // If so, we post a WM_QUIT message to the main thread's + // message loop. This will cause the message loop to + // exit and hence the termination of this application. + public static void AttemptToTerminateServer() + { + lock(typeof(ManagedCOMLocalServer)) + { + Console.WriteLine("AttemptToTerminateServer()"); + + // Get the most up-to-date values of these critical data. + int iObjsInUse = ObjectsCount; + int iServerLocks = ServerLockCount; + + // Print out these info for debug purposes. + StringBuilder sb = new StringBuilder(""); + sb.AppendFormat("m_iObjsInUse : {0}. m_iServerLocks : {1}", iObjsInUse, iServerLocks); + Console.WriteLine(sb.ToString()); + + if ((iObjsInUse > 0) || (iServerLocks > 0)) + { + Console.WriteLine("There are still referenced objects or the server lock count is non-zero."); + } + else + { + UIntPtr wParam = new UIntPtr(0); + IntPtr lParam = new IntPtr(0); + Console.WriteLine("PostThreadMessage(WM_QUIT)"); + PostThreadMessage(MainThreadId, 0x0012, wParam, lParam); + } + } + } + + // ProcessArguments() will process the command-line arguments + // of this application. + // If the return value is true, we carry + // on and start this application. + // If the return value is false, we terminate + // this application immediately. + protected static bool ProcessArguments(string[] args) + { + bool bRet = true; + + if (args.Length > 0) + { + RegistryKey key = null; + RegistryKey key2 = null; + + switch (args[0].ToLower()) + { + case "-embedding": + Console.WriteLine("Request to start as out-of-process COM server."); + break; + + case "-register": + case "/register": + try + { + key = Registry.ClassesRoot.CreateSubKey("CLSID\\" + Marshal.GenerateGuidForType(typeof(XApiCom)).ToString("B")); + key2 = key.CreateSubKey("LocalServer32"); + key2.SetValue(null, Application.ExecutablePath); + } + catch (Exception ex) + { + MessageBox.Show("Error while registering the server:\n"+ex.ToString()); + } + finally + { + if (key != null) + key.Close(); + if (key2 != null) + key2.Close(); + } + bRet = false; + break; + + case "-unregister": + case "/unregister": + try + { + key = Registry.ClassesRoot.OpenSubKey("CLSID\\" + Marshal.GenerateGuidForType(typeof(XApiCom)).ToString("B"), true); + key.DeleteSubKey("LocalServer32"); + } + catch (Exception ex) + { + MessageBox.Show("Error while unregistering the server:\n"+ex.ToString()); + } + finally + { + if (key != null) + key.Close(); + if (key2 != null) + key2.Close(); + } + bRet = false; + break; + + default: + Console.WriteLine("Unknown argument: " + args[0] + "\nValid are : -register, -unregister and -embedding"); + break; + } + } + + return bRet; + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main(string[] args) + { + if (!ProcessArguments(args)) + { + return; + } + + // Initialize critical member variables. + m_iObjsInUse = 0; + m_iServerLocks = 0; + m_uiMainThreadId = GetCurrentThreadId(); + + // Register the SimpleCOMObjectClassFactory. + SimpleCOMObjectClassFactory factory = new SimpleCOMObjectClassFactory(); + factory.ClassContext = (uint)CLSCTX.CLSCTX_LOCAL_SERVER; + factory.ClassId = Marshal.GenerateGuidForType(typeof(XApiCom)); + factory.Flags = (uint)REGCLS.REGCLS_MULTIPLEUSE | (uint)REGCLS.REGCLS_SUSPENDED; + factory.RegisterClassObject(); + ClassFactoryBase.ResumeClassObjects(); + + // Start up the garbage collection thread. + GarbageCollection GarbageCollector = new GarbageCollection(10000); + Thread GarbageCollectionThread = new Thread(new ThreadStart(GarbageCollector.GCWatch)); + + // Set the name of the thread object. + GarbageCollectionThread.Name = "Garbage Collection Thread"; + // Start the thread. + GarbageCollectionThread.Start(); + + // Start the message loop. + MSG msg; + IntPtr null_hwnd = new IntPtr(0); + while (GetMessage(out msg, null_hwnd, 0, 0) != false) + { + TranslateMessage(ref msg); + DispatchMessage(ref msg); + } + Console.WriteLine("Out of message loop."); + + // Revoke the class factory immediately. + // Don't wait until the thread has stopped before + // we perform revokation. + factory.RevokeClassObject(); + Console.WriteLine("SimpleCOMObjectClassFactory Revoked."); + + // Now stop the Garbage Collector thread. + GarbageCollector.StopThread(); + GarbageCollector.WaitForThreadToStop(); + Console.WriteLine("GarbageCollector thread stopped."); + + // Just an indication that this COM EXE Server is stopped. + Console.WriteLine("Press [ENTER] to exit."); + Console.ReadLine(); + } + } +} diff --git a/languages/CSharp/XAPI_CSharp/COM/SimpleCOMObject.cs b/languages/CSharp/XAPI_CSharp/COM/SimpleCOMObject.cs new file mode 100644 index 0000000..a959c89 --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/SimpleCOMObject.cs @@ -0,0 +1,81 @@ +using System; +using System.Diagnostics; +using System.Text; +using System.Windows.Forms; // For using MessageBox. +using Interop.SimpleCOMObject; // In order to implement ISimpleCOMObject. +using System.Runtime.InteropServices; // For use of the GuidAttribute, ProgIdAttribute and ClassInterfaceAttribute. + +namespace XAPI.COM +{ + /// + /// Summary description for SimpleCOMObject. + /// This is the class that will be exported to unmanaged COM client apps. + /// + [ + Guid("E1FE1223-45C2-4872-9B1E-634FB850E753"), // We indicate a specific CLSID for "ManagedCOMLocalServer_Impl01.SimpleCOMObject" for convenience of searching the registry. + ProgId("ManagedCOMLocalServer_Impl01.SimpleCOMObject"), // This ProgId is used by default. Not 100% necessary. + ClassInterface(ClassInterfaceType.None) // Specify that we will not generate any additional interface with a name like _SimpleCOMObject. + ] + public class SimpleCOMObject : + ReferenceCountedObjectBase, // SimpleCOMObject is derived from ReferenceCountedObjectBase so that we can track its creation and destruction. + ISimpleCOMObject // SimpleCOMObject must implement the ISimpleCOMObject interface. + { + private int m_iLongProperty; + + public SimpleCOMObject() + { + // ReferenceCountedObjectBase constructor will be invoked. + Console.WriteLine("SimpleCOMObject constructor."); + } + + ~SimpleCOMObject() + { + // ReferenceCountedObjectBase destructor will be invoked. + Console.WriteLine("SimpleCOMObject destructor."); + } + + public int LongProperty + { + get + { + return m_iLongProperty; + } + + set + { + m_iLongProperty = value; + } + } + + public void Method01 (String strMessage) + { + StringBuilder sb = new StringBuilder(strMessage); + + sb.Append(LongProperty.ToString()); + + MessageBox.Show(sb.ToString(), "ManagedCOMLocalServer_Impl01.SimpleCOMObject"); + } + } + + //class SimpleCOMObjectClassFactory : ClassFactoryBase + //{ + // public override void virtual_CreateInstance(IntPtr pUnkOuter, ref Guid riid, out IntPtr ppvObject) + // { + // Console.WriteLine("SimpleCOMObjectClassFactory.CreateInstance()."); + // Console.WriteLine("Requesting Interface : " + riid.ToString()); + + // if (riid == Marshal.GenerateGuidForType(typeof(ISimpleCOMObject)) || + // riid == ManagedCOMLocalServer.IID_IDispatch || + // riid == ManagedCOMLocalServer.IID_IUnknown) + // { + // SimpleCOMObject SimpleCOMObject_New = new SimpleCOMObject(); + + // ppvObject = Marshal.GetComInterfaceForObject(SimpleCOMObject_New, typeof(ISimpleCOMObject)); + // } + // else + // { + // throw new COMException("No interface", unchecked((int) 0x80004002)); + // } + // } + //} +} diff --git a/languages/CSharp/XAPI_CSharp/COM/Struct.cs b/languages/CSharp/XAPI_CSharp/COM/Struct.cs new file mode 100644 index 0000000..cb9ae10 --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/Struct.cs @@ -0,0 +1,702 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + + +namespace XAPI.COM +{ + ///持仓 + [ComVisible(true)] + [Guid("07C1DA6E-A85E-4931-ABE6-03681A3DBB0B")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class PositionClass + { + public string InstrumentName; + public string Symbol; + public string InstrumentID; + public string ExchangeID; + public string ClientID; + public string AccountID; + + public int Side; + public string Side_String; + public int HedgeFlag; + public string HedgeFlag_String; + public int Date; + public double PositionCost; + + public double Position; + public double TodayPosition; + public double HistoryPosition; + public double HistoryFrozen; + + ///今日买卖持仓 + public double TodayBSPosition; + ///今日买卖持仓冻结 + public double TodayBSFrozen; + ///今日申赎持仓 + public double TodayPRPosition; + ///今日申赎持仓冻结 + public double TodayPRFrozen; + + public string ID; + + public string PortfolioID1; + public string PortfolioID2; + public string PortfolioID3; + + public int Business; + public string Business_String; + } + + /// + /// 做市商双向报价 + /// + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct QuoteField + { + public byte[] InstrumentName; + public string Symbol; + public string InstrumentID; + public string ExchangeID; + public string ClientID; + public string AccountID; + + + public double AskQty; + public double AskPrice; + public OpenCloseType AskOpenClose; + public HedgeFlagType AskHedgeFlag; + + public double BidQty; + public double BidPrice; + public OpenCloseType BidOpenClose; + public HedgeFlagType BidHedgeFlag; + + public OrderStatus Status; + public ExecType ExecType; + + + public string QuoteReqID; + public string LocalID; + public string ID; + public string AskID; + public string BidID; + public string AskOrderID; + public string BidOrderID; + + public int XErrorID; + public int RawErrorID; + public byte[] Text; + } + + /// + /// 订单信息 + /// + [ComVisible(true)] + [Guid("23FC4E48-54FF-4A89-B924-B8668C5D9570")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class OrderClass + { + public string InstrumentName; + public string Symbol; + public string InstrumentID; + public string ExchangeID; + public string ClientID; + public string AccountID; + + + public int Side; + public string Side_String; + public double Qty; + public double Price; + public int OpenClose; + public string OpenClose_String; + public int HedgeFlag; + public string HedgeFlag_String; + public int Date; + public int Time; + + + public string ID; + public string OrderID; + public string LocalID; + + + public int Type; + public string Type_String; + public double StopPx; + public int TimeInForce; + public string TimeInForce_String; + + public int Status; + public string Status_String; + public int ExecType; + public string ExecType_String; + public double LeavesQty; + public double CumQty; + public double AvgPx; + + public int XErrorID; + public int RawErrorID; + public string Text; + + public int ReserveInt32; + public string ReserveChar64; + + public string PortfolioID1; + public string PortfolioID2; + public string PortfolioID3; + + public int Business; + public string Business_String; + } + + /// + /// 成交回报 + /// + [ComVisible(true)] + [Guid("9FF68AA1-CB14-49E5-91F9-856400663C5E")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class TradeClass + { + public string InstrumentName; + public string Symbol; + public string InstrumentID; + public string ExchangeID; + public string ClientID; + public string AccountID; + + public int Side; + public string Side_String; + public double Qty; + public double Price; + public int OpenClose; + public string OpenClose_String; + public int HedgeFlag; + public string HedgeFlag_String; + public int Date; + public int Time; + + + public string ID; + public string TradeID; + + public double Commission; + + public int ReserveInt32; + public string ReserveChar64; + + + public string PortfolioID1; + public string PortfolioID2; + public string PortfolioID3; + + public int Business; + public string Business_String; + } + + + /// + /// 错误信息 + /// + [ComVisible(true)] + [Guid("5F68D385-04A7-4247-8C07-839C6CE68EFF")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class ErrorClass + { + /// + /// 错误代码 + /// + public int XErrorID; + /// + /// 错误代码 + /// + public int RawErrorID; + /// + /// 错误信息 + /// + public string Text; + /// + /// 信息来源 + /// + public string Source; + } + + + /// + /// 日志信息 + /// + [ComVisible(true)] + [Guid("4A4FDEFA-AEA6-496E-AE92-F00FD28A2075")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class LogClass + { + /// + /// 日志级别 + /// + public int Level; + public string Level_String; + /// + /// 错误信息 + /// + public string Message; + } + + + [ComVisible(true)] + [Guid("D642BDD2-8BB7-4BC9-BDC4-29CF05D1EAD4")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class RspUserLoginClass + { + public int TradingDay; + public int LoginTime; + public string SessionID; + public string UserID; + public string AccountID; + public string InvestorName; + public int XErrorID; + public int RawErrorID; + public string Text; + } + + + + /// + /// DepthField行情 + /// + [ComVisible(true)] + [Guid("6A9597AE-9AB2-4C48-8A96-F386DBCD8AB6")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class DepthClass + { + public double Price; + public int Size; + public int Count; + } + + + /// + /// 合约信息 + /// + [ComVisible(true)] + [Guid("37ED5322-1C11-477A-AC97-F947AD8532B2")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class InstrumentClass + { + public string InstrumentName; + public string Symbol; + public string InstrumentID; + public string ExchangeID; + public string ClientID; + public string AccountID; + + + public string ExchangeInstID; + + + /// + /// 类型 + /// + public int Type; + public string Type_String; + /// + /// 合约数量乘数 + /// + public int VolumeMultiple; + /// + /// 最小变动价位 + /// + public double PriceTick; + /// + /// 到期日 + /// + public int ExpireDate; + + /// + /// 执行价 + /// + public double StrikePrice; + /// + /// 期权类型 + /// + public int OptionsType; + public string OptionsType_String; + /// + /// 产品代码 + /// + public string ProductID; + /// + /// 基础商品代码 + /// + public string UnderlyingInstrID; + ///合约生命周期状态 + public int InstLifePhase; + public string InstLifePhase_String; + } + + /// + /// 账号 + /// + [ComVisible(true)] + [Guid("6A75FF0C-C78F-4805-96AB-0FB4AF196152")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class AccountClass + { + public string ClientID; + public string AccountID; + public string CurrencyID; + /// + /// 上次结算准备金 + /// + public double PreBalance; + /// + /// 当前保证金总额 + /// + public double CurrMargin; + /// + /// 平仓盈亏 + /// + public double CloseProfit; + /// + /// 持仓盈亏 + /// + public double PositionProfit; + /// + /// 期货结算准备金 + /// + public double Balance; + /// + /// 可用资金 + /// + public double Available; + /// + /// 入金金额 + /// + public double Deposit; + /// + /// 出金金额 + /// + public double Withdraw; + /// + /// 可取资金 + /// + public double WithdrawQuota; + /// + /// 冻结的过户费 + /// + public double FrozenTransferFee; + /// + /// 冻结的印花税 + /// + public double FrozenStampTax; + /// + /// 冻结的手续费 + /// + public double FrozenCommission; + /// + /// 冻结的资金 + /// + public double FrozenCash; + /// + /// 过户费 + /// + public double TransferFee; + /// + /// 印花税 + /// + public double StampTax; + /// + /// 手续费 + /// + public double Commission; + /// + /// 资金差额 + /// + public double CashIn; + } + + + + /// + /// 发给做市商的询价请求 + /// + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct QuoteRequestField + { + /// + /// 合约代码 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string Symbol; + /// + /// 合约代码 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + public string InstrumentID; + /// + /// 交易所代码 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string ExchangeID; + /// + /// 交易日 + /// + public int TradingDay; + /// + /// 询价时间 + /// + public int QuoteTime; + + /// + /// 询价编号 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string QuoteID; + } + + + [ComVisible(true)] + [Guid("E08904CE-0E96-48B5-9D87-F4C5ACE3E560")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class SettlementInfoClass + { + /// + /// 交易日 + /// + public int TradingDay; + ///// + ///// 消息正文 + ///// + public string Content; + } + + /// + /// 投资者 + /// + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct InvestorField + { + public string InvestorID; + public string BrokerID; + public int IdentifiedCardType; + public string IdentifiedCardType_String; + public string IdentifiedCardNo; + public string InvestorName; + } + + + //[ComVisible(false)] + //[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + //public struct OrderIDType + //{ + // public string ID; + //} + + + [ComVisible(true)] + [Guid("734AF40E-D336-4C0C-A8B7-C7DB9C7FF726")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class DepthMarketDataNClass + { + public int TradingDay; + public int ActionDay; + public int UpdateTime; + public int UpdateMillisec; + public string Symbol; + public string InstrumentID; + public string ExchangeID; + + /// + /// 交易所代码 + /// + public int Exchange; + + + /// + /// 最新价 + /// + public double LastPrice; + /// + /// 数量 + /// + public double Volume; + /// + /// 成交金额 + /// + public double Turnover; + /// + /// 持仓量 + /// + public double OpenInterest; + /// + /// 当日均价 + /// + public double AveragePrice; + + + /// + /// 今开盘 + /// + public double OpenPrice; + /// + /// 最高价 + /// + public double HighestPrice; + /// + /// 最低价 + /// + public double LowestPrice; + /// + /// 今收盘 + /// + public double ClosePrice; + /// + /// 本次结算价 + /// + public double SettlementPrice; + + /// + /// 涨停板价 + /// + public double UpperLimitPrice; + /// + /// 跌停板价 + /// + public double LowerLimitPrice; + /// + /// 昨收盘 + /// + public double PreClosePrice; + /// + /// 上次结算价 + /// + public double PreSettlementPrice; + /// + /// 昨持仓量 + /// + public double PreOpenInterest; + + ///交易阶段类型 + public int TradingPhase; + public string TradingPhase_String; + + + public double AskPrice1; + public int AskSize; + public double BidPrice1; + public int BidSize; + } + + + + + + + + + + + + + + + + /// + /// Tick行情 + /// + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct TickField + { + public int Date; + public int Time; + public int Millisecond; + + public double LastPrice; + public double Volume; + public double OpenInterest; + public double BidPrice1; + public double AskPrice1; + public int BidSize1; + public int AskSize1; + } + + /// + /// Bar行情 + /// + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct BarField + { + public int Date; + public int Time; + + public double Open; + public double High; + public double Low; + public double Close; + public double Volume; + public double OpenInterest; + public double Turnover; + } + + + + /// + /// 合约信息 + /// + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct HistoricalDataRequestField + { + public int Date1; + public int Date2; + public int Time1; + public int Time2; + + public DataObjetType DataType; + public BarType BarType; + public int BarSize; + + public int RequestId; + public int CurrentDate; + public int lRequest; + + /// + /// 合约代码 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string Symbol; + /// + /// 合约代码 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + public string InstrumentID; + /// + /// 交易所代码 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string ExchangeID; + } + + [ComVisible(true)] + [Guid("42AB7905-CC91-480A-AEF0-FF8795872FF4")] + [ClassInterface(ClassInterfaceType.AutoDual)] + public class QueueData + { + public int Type; + public string Type_String; + public object Sender; + public object Data1; + public object Data2; + public object Data3; + public object Data4; + } + +} diff --git a/languages/CSharp/XAPI_CSharp/COM/XApiCom.cs b/languages/CSharp/XAPI_CSharp/COM/XApiCom.cs new file mode 100644 index 0000000..f0612ec --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/XApiCom.cs @@ -0,0 +1,961 @@ +using Ideafixxxer.Generics; +using XAPI.Callback; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +//using System.EnterpriseServices; +using System.Linq; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; +using Microsoft.Win32; + +namespace XAPI.COM +{ + [ComVisible(true)] + [Guid("825E3182-8444-4580-8A8C-965485FBF451")] + [ClassInterface(ClassInterfaceType.None)] + [ComSourceInterfaces(typeof(IXApiEvents))] + [ProgId("XAPI.COM")] + //[EventTrackingEnabled(true)] + //[Description("Interface Serviced Component")] + public class XApiCom : UserControl,/*ServicedComponent,*/ IXApi, + IObjectSafety // implement IObjectSafety to supress the unsafe for scripting + // warning message + { + #region Constants + // Constants for implementation of the IObjectSafety interface. + private const int INTERFACESAFE_FOR_UNTRUSTED_CALLER = 0x00000001; + private const int INTERFACESAFE_FOR_UNTRUSTED_DATA = 0x00000002; + private Label label1; + private const int S_OK = 0; + #endregion + + #region IObjectSafety Methods + public int GetInterfaceSafetyOptions(ref Guid riid, out int pdwSupportedOptions, out int pdwEnabledOptions) + { + pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA; + pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA; + return S_OK; // return S_OK + } + + public int SetInterfaceSafetyOptions(ref Guid riid, int dwOptionSetMask, int dwEnabledOptions) + { + return S_OK; // return S_OK + } + #endregion + + public event DelegateOnConnectionStatus OnConnectionStatus; + public event DelegateOnRtnError OnRtnError; + public event DelegateOnLog OnLog; + public event DelegateOnRtnDepthMarketData OnRtnDepthMarketData; + public event DelegateOnRspQryInstrument OnRspQryInstrument; + public event DelegateOnRspQryTradingAccount OnRspQryTradingAccount; + public event DelegateOnRspQryInvestorPosition OnRspQryInvestorPosition; + public event DelegateOnRspQrySettlementInfo OnRspQrySettlementInfo; + public event DelegateOnRtnOrder OnRtnOrder; + public event DelegateOnRtnTrade OnRtnTrade; + public event DelegateOnRspQryOrder OnRspQryOrder; + public event DelegateOnRspQryTrade OnRspQryTrade; + + private readonly ConcurrentQueue MessageQueue; + + private readonly XApi api; + private ServerInfoField _Server; + private UserInfoField _User; + private OrderField _Order; + private ReqQueryField _Query; + + //private static int cookie; + //private static RegistrationServices msRegSvc = new RegistrationServices(); + + // http://www.codeproject.com/Articles/24089/Create-ActiveX-in-NET-Step-by-Step + // http://www.codeproject.com/Articles/1256/Exposing-Windows-Forms-Controls-as-ActiveX-control + /// + ///Register the class as a control and set its CodeBase entry + /// + ///The registry key of the control + [ComRegisterFunction()] + public static void RegisterClass(string key) + { + // Strip off HKEY_CLASSES_ROOT\ from the passed key as I don't need it + StringBuilder sb = new StringBuilder(key); + sb.Replace(@"HKEY_CLASSES_ROOT\", ""); + + // Open the CLSID\{guid} key for write access + RegistryKey k = Registry.ClassesRoot.OpenSubKey(sb.ToString(), true); + + // And create the 'Control' key - this allows it to show up in + // the ActiveX control container + RegistryKey ctrl = k.CreateSubKey("Control"); + ctrl.Close(); + + // Next create the CodeBase entry - needed if not string named and GACced. + RegistryKey inprocServer32 = k.OpenSubKey("InprocServer32", true); + inprocServer32.SetValue("CodeBase", Assembly.GetExecutingAssembly().CodeBase); + inprocServer32.Close(); + + // 是否有必要将InprocServer32给删了来支持进程外呢? + RegistryKey localServer32 = k.CreateSubKey("LocalServer32"); + localServer32.SetValue("", Assembly.GetExecutingAssembly().Location); + inprocServer32.Close(); + + // Finally close the main key + k.Close(); + } + + /// + ///Called to unregister the control + /// + ///The registry key + [ComUnregisterFunction()] + public static void UnregisterClass(string key) + { + StringBuilder sb = new StringBuilder(key); + sb.Replace(@"HKEY_CLASSES_ROOT\", ""); + + // Open HKCR\CLSID\{guid} for write access + RegistryKey k = Registry.ClassesRoot.OpenSubKey(sb.ToString(), true); + + // Delete the 'Control' key, but don't throw an exception if it does not exist + k.DeleteSubKey("Control", false); + + // Next open up InprocServer32 + RegistryKey inprocServer32 = k.OpenSubKey("InprocServer32", true); + + // And delete the CodeBase key, again not throwing if missing + k.DeleteSubKey("CodeBase", false); + + // Finally close the main key + k.Close(); + } + + public XApiCom() + { + MessageQueue = new ConcurrentQueue(); + + api = new XApi(); + + api.OnConnectionStatus = OnConnectionStatus_callback; + api.OnRtnError = OnRtnError_callback; + api.OnLog = OnLog_callback; + + api.OnRtnDepthMarketData = OnRtnDepthMarketData_callback; + //base.OnRtnQuoteRequest = OnRtnQuoteRequest_callback; + + api.OnRspQryInstrument = OnRspQryInstrument_callback; + api.OnRspQryTradingAccount = OnRspQryTradingAccount_callback; + api.OnRspQryInvestorPosition = OnRspQryInvestorPosition_callback; + api.OnRspQrySettlementInfo = OnRspQrySettlementInfo_callback; + + api.OnRspQryOrder = OnRspQryOrder_callback; + api.OnRspQryTrade = OnRspQryTrade_callback; + //base.OnRspQryQuote = OnRspQryQuote_callback; + + api.OnRtnOrder = OnRtnOrder_callback; + api.OnRtnTrade = OnRtnTrade_callback; + //base.OnRtnQuote = OnRtnQuote_callback; + + //base.OnRspQryHistoricalTicks = OnRspQryHistoricalTicks_callback; + //base.OnRspQryHistoricalBars = OnRspQryHistoricalBars_callback; + + //base.OnRspQryInvestor = OnRspQryInvestor_callback; + + InitializeComponent(); + + + Console.WriteLine("ReferenceCountedObjectBase contructor."); + // We increment the global count of objects. + ManagedCOMLocalServer.InterlockedIncrementObjectsCount(); + } + + ~XApiCom() + { + Console.WriteLine("ReferenceCountedObjectBase destructor."); + // We decrement the global count of objects. + ManagedCOMLocalServer.InterlockedDecrementObjectsCount(); + // We then immediately test to see if we the conditions + // are right to attempt to terminate this server application. + ManagedCOMLocalServer.AttemptToTerminateServer(); + } + + public void SetLibPath(string LibPath) + { + api.LibPath = LibPath; + } + + public void SetServerInfo(string key, object value) + { + Type type = typeof(ServerInfoField); + FieldInfo field = type.GetField(key,BindingFlags.Public | BindingFlags.Instance); + if (field == null) + { + throw new ArgumentException(key +" is not exist!", key); + } + try + { + object obj = Helper.ChangeType(value, field.FieldType); + field.SetValueForValueType(ref _Server, obj); + } + catch(Exception ex) + { + throw new InvalidCastException(ex.Message); + } + } + + public void SetUserInfo(string key, object value) + { + Type type = typeof(UserInfoField); + FieldInfo field = type.GetField(key, BindingFlags.Public | BindingFlags.Instance); + if (field == null) + { + throw new ArgumentException(key + " is not exist!", key); + } + try + { + object obj = Helper.ChangeType(value, field.FieldType); + field.SetValueForValueType(ref _User, obj); + } + catch (Exception ex) + { + throw new InvalidCastException(ex.Message); + } + } + + public void Connect() + { + api.Server = _Server; + api.User = _User; + api.Connect(); + } + + public void Disconnect() + { + api.Disconnect(); + } + + public void Subscribe(string szInstrument, string szExchange) + { + api.Subscribe(szInstrument, szExchange); + } + + public void Unsubscribe(string szInstrument, string szExchange) + { + api.Unsubscribe(szInstrument, szExchange); + } + + public void NewOrder() + { + _Order = default(OrderField); + } + public void SetOrder(string key, object value) + { + Type type = typeof(OrderField); + FieldInfo field = type.GetField(key, BindingFlags.Public | BindingFlags.Instance); + if (field == null) + { + throw new ArgumentException(key + " is not exist!", key); + } + try + { + object obj = Helper.ChangeType(value, field.FieldType); + field.SetValueForValueType(ref _Order, obj); + } + catch (Exception ex) + { + throw new InvalidCastException(ex.Message); + } + } + + public string SendOrder() + { + return api.SendOrder(ref _Order); + } + public string CancelOrder(string id) + { + return api.CancelOrder(id); + } + + public void NewQuery() + { + _Query = default(ReqQueryField); + } + public void SetQuery(string key, object value) + { + Type type = typeof(ReqQueryField); + FieldInfo field = type.GetField(key, BindingFlags.Public | BindingFlags.Instance); + if (field == null) + { + throw new ArgumentException(key + " is not exist!", key); + } + try + { + object obj = Helper.ChangeType(value, field.FieldType); + field.SetValueForValueType(ref _Query, obj); + } + catch (Exception ex) + { + throw new InvalidCastException(ex.Message); + } + } + + public void ReqQuery(string type) + { + QueryType obj = Enum.Parse(type); + api.ReqQuery(obj, ref _Query); + } + + public QueueData TryDequeue() + { + QueueData qd; + if (MessageQueue.TryDequeue(out qd)) + { + return qd; + } + return null; + } + + /// + /// 给COM使用,进行内存回收 + /// + public void GCCollect() + { + api.GCCollect(); + } + + private void OnConnectionStatus_callback(object sender, XAPI.ConnectionStatus status, [In] ref RspUserLoginField userLogin, int size1) + { + RspUserLoginClass cls = new RspUserLoginClass(); + + if (size1 > 0) + { + RspUserLoginField field = userLogin; + + cls.TradingDay = field.TradingDay; + cls.LoginTime = field.LoginTime; + cls.SessionID = field.SessionID; + cls.UserID = field.UserID; + cls.AccountID = field.AccountID; + cls.InvestorName = field.InvestorName(); + cls.XErrorID = field.XErrorID; + cls.RawErrorID = field.RawErrorID; + cls.Text = field.Text(); + } + + if (null == OnConnectionStatus) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnConnectionStatus; + qd.Type_String = Enum.ToString(ResponseType.OnConnectionStatus); + qd.Sender = this; + qd.Data1 = status; + qd.Data2 = Enum.ToString(status); + qd.Data3 = cls; + qd.Data4 = size1; + + MessageQueue.Enqueue(qd); + } + else + { + OnConnectionStatus(this, (int)status, Enum.ToString(status), cls, size1); + } + } + + private void OnRtnError_callback(object sender, [In] ref ErrorField error) + { + ErrorClass cls = null; + + cls = new ErrorClass(); + ErrorField field = error; + + cls.XErrorID = field.XErrorID; + cls.RawErrorID = field.RawErrorID; + cls.Text = field.Text(); + cls.Source = field.Source; + + if (null == OnRtnError) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnRtnError; + qd.Type_String = Enum.ToString(ResponseType.OnRtnError); + qd.Sender = this; + qd.Data1 = cls; + + MessageQueue.Enqueue(qd); + } + else + { + OnRtnError(this, cls); + } + } + + private void OnLog_callback(object sender, [In] ref LogField log) + { + LogClass cls = null; + + cls = new LogClass(); + LogField field = log; + + cls.Level = (int)field.Level; + cls.Level_String = Enum.ToString(field.Level); + cls.Message = field.Message(); + + if (null == OnLog) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnLog; + qd.Type_String = Enum.ToString(ResponseType.OnLog); + qd.Sender = this; + qd.Data1 = cls; + + MessageQueue.Enqueue(qd); + } + else + { + OnLog(this, cls); + } + } + + private void OnRtnDepthMarketData_callback(object sender, [In] ref XAPI.DepthMarketDataNClass marketData) + { + DepthMarketDataNClass cls = new DepthMarketDataNClass(); + XAPI.DepthMarketDataNClass field = marketData; + + cls.TradingDay = field.TradingDay; + cls.ActionDay = field.ActionDay; + cls.UpdateTime = field.UpdateTime; + cls.UpdateMillisec = field.UpdateMillisec; + cls.Exchange = (int)field.Exchange; + cls.Symbol = field.Symbol; + cls.InstrumentID = field.InstrumentID; + cls.ExchangeID = field.ExchangeID; + cls.LastPrice = field.LastPrice; + cls.Volume = field.Volume; + cls.Turnover = field.Turnover; + cls.OpenInterest = field.OpenInterest; + cls.AveragePrice = field.AveragePrice; + cls.OpenPrice = field.OpenPrice; + cls.HighestPrice = field.HighestPrice; + cls.LowestPrice = field.LowestPrice; + cls.ClosePrice = field.ClosePrice; + cls.SettlementPrice = field.SettlementPrice; + cls.UpperLimitPrice = field.UpperLimitPrice; + cls.LowerLimitPrice = field.LowerLimitPrice; + cls.PreClosePrice = field.PreClosePrice; + cls.PreSettlementPrice = field.PreSettlementPrice; + cls.PreOpenInterest = field.PreOpenInterest; + cls.TradingPhase = (int)field.TradingPhase; + cls.TradingPhase_String = Enum.ToString(field.TradingPhase); + + if (field.Bids != null && field.Bids.Length > 0) + { + cls.BidPrice1 = field.Bids[0].Price; + cls.BidSize = field.Bids[0].Size; + } + + if (field.Asks != null && field.Asks.Length > 0) + { + cls.AskPrice1 = field.Asks[0].Price; + cls.AskSize = field.Asks[0].Size; + } + + if (null == OnRtnDepthMarketData) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnRtnDepthMarketData; + qd.Type_String = Enum.ToString(ResponseType.OnRtnDepthMarketData); + qd.Sender = this; + qd.Data1 = cls; + + MessageQueue.Enqueue(qd); + } + else + { + OnRtnDepthMarketData(this, cls); + } + } + + private void OnRtnOrder_callback(object sender, [In] ref OrderField order) + { + OrderField field = order; + + OrderClass cls = new OrderClass(); + + cls.InstrumentName = field.InstrumentName(); + cls.Symbol = field.Symbol; + cls.InstrumentID = field.InstrumentID; + cls.ExchangeID = field.ExchangeID; + cls.ClientID = field.ClientID; + cls.AccountID = field.AccountID; + cls.Side = (int)field.Side; + cls.Side_String = Enum.ToString(field.Side); + cls.Qty = field.Qty; + cls.Price = field.Price; + cls.OpenClose = (int)field.OpenClose; + cls.OpenClose_String = Enum.ToString(field.OpenClose); + cls.HedgeFlag = (int)field.HedgeFlag; + cls.HedgeFlag_String = Enum.ToString(field.HedgeFlag); + cls.Date = field.Date; + cls.Time = field.Time; + cls.ID = field.ID; + cls.OrderID = field.OrderID; + cls.LocalID = field.LocalID; + cls.Type = (int)field.Type; + cls.Type_String = Enum.ToString(field.Type); + cls.StopPx = field.StopPx; + cls.TimeInForce = (int)field.TimeInForce; + cls.TimeInForce_String = Enum.ToString(field.TimeInForce); + cls.Status = (int)field.Status; + cls.Status_String = Enum.ToString(field.Status); + cls.ExecType = (int)field.ExecType; + cls.ExecType_String = Enum.ToString(field.ExecType); + cls.LeavesQty = field.LeavesQty; + cls.CumQty = field.CumQty; + cls.AvgPx = field.AvgPx; + cls.XErrorID = field.XErrorID; + cls.RawErrorID = field.RawErrorID; + cls.Text = field.Text(); + cls.ReserveInt32 = field.ReserveInt32; + cls.ReserveChar64 = field.ReserveChar64; + + cls.PortfolioID1 = field.PortfolioID1; + cls.PortfolioID2 = field.PortfolioID2; + cls.PortfolioID3 = field.PortfolioID3; + cls.Business = (int)field.Business; + cls.Business_String = Enum.ToString(field.Business); + + if (null == OnRtnOrder) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnRtnOrder; + qd.Type_String = Enum.ToString(ResponseType.OnRtnOrder); + qd.Sender = this; + qd.Data1 = cls; + + MessageQueue.Enqueue(qd); + } + else + { + OnRtnOrder(this, cls); + } + } + + private void OnRtnTrade_callback(object sender, [In] ref TradeField trade) + { + if (null == OnRtnTrade) + return; + + TradeField field = trade; + + TradeClass cls = new TradeClass(); + + cls.InstrumentName = field.InstrumentName(); + cls.Symbol = field.Symbol; + cls.InstrumentID = field.InstrumentID; + cls.ExchangeID = field.ExchangeID; + cls.ClientID = field.ClientID; + cls.AccountID = field.AccountID; + cls.Side = (int)field.Side; + cls.Side_String = Enum.ToString(field.Side); + cls.Qty = field.Qty; + cls.Price = field.Price; + cls.OpenClose = (int)field.OpenClose; + cls.OpenClose_String = Enum.ToString(field.OpenClose); + cls.HedgeFlag = (int)field.HedgeFlag; + cls.HedgeFlag_String = Enum.ToString(field.HedgeFlag); + cls.Date = field.Date; + cls.Time = field.Time; + cls.ID = field.ID; + cls.TradeID = field.TradeID; + cls.ReserveInt32 = field.ReserveInt32; + cls.ReserveChar64 = field.ReserveChar64; + + cls.PortfolioID1 = field.PortfolioID1; + cls.PortfolioID2 = field.PortfolioID2; + cls.PortfolioID3 = field.PortfolioID3; + cls.Business = (int)field.Business; + cls.Business_String = Enum.ToString(field.Business); + + if (null == OnRtnTrade) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnRtnTrade; + qd.Type_String = Enum.ToString(ResponseType.OnRtnTrade); + qd.Sender = this; + qd.Data1 = cls; + + MessageQueue.Enqueue(qd); + } + else + { + OnRtnTrade(this, cls); + } + } + + private void OnRspQryInstrument_callback(object sender, [In] ref InstrumentField instrument, int size1, bool bIsLast) + { + if (null == OnRspQryInstrument) + return; + + InstrumentField field = instrument; + + InstrumentClass cls = new InstrumentClass(); + + cls.InstrumentName = field.InstrumentName(); + cls.Symbol = field.Symbol; + cls.InstrumentID = field.InstrumentID; + cls.ExchangeID = field.ExchangeID; + cls.ClientID = field.ClientID; + cls.AccountID = field.AccountID; + + cls.ExchangeInstID = field.ExchangeInstID; + + cls.Type = (int)field.Type; + cls.Type_String = Enum.ToString(field.Type); + + cls.VolumeMultiple = field.VolumeMultiple; + cls.PriceTick = field.PriceTick; + cls.ExpireDate = field.ExpireDate; + cls.StrikePrice = field.StrikePrice; + + cls.OptionsType = (int)field.OptionsType; + cls.OptionsType_String = Enum.ToString(field.OptionsType); + + cls.ProductID = field.ProductID; + cls.UnderlyingInstrID = field.UnderlyingInstrID; + + cls.InstLifePhase = (int)field.InstLifePhase; + cls.InstLifePhase_String = Enum.ToString(field.InstLifePhase); + + if (null == OnRspQryInstrument) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnRspQryInstrument; + qd.Type_String = Enum.ToString(ResponseType.OnRspQryInstrument); + qd.Sender = this; + qd.Data1 = cls; + qd.Data2 = size1; + qd.Data3 = bIsLast; + + MessageQueue.Enqueue(qd); + } + else + { + OnRspQryInstrument(this, cls, size1, bIsLast); + } + } + + private void OnRspQryInvestorPosition_callback(object sender, [In] ref PositionField position, int size1, bool bIsLast) + { + if (null == OnRspQryInvestorPosition) + return; + + PositionField field = position; + + PositionClass cls = new PositionClass(); + + cls.InstrumentName = field.InstrumentName(); + cls.Symbol = field.Symbol; + cls.InstrumentID = field.InstrumentID; + cls.ExchangeID = field.ExchangeID; + cls.ClientID = field.ClientID; + cls.AccountID = field.AccountID; + + cls.Side = (int)field.Side; + cls.Side_String = Enum.ToString(field.Side); + cls.HedgeFlag = (int)field.HedgeFlag; + cls.HedgeFlag_String = Enum.ToString(field.HedgeFlag); + + cls.Date = field.Date; + cls.PositionCost = field.PositionCost; + cls.Position = field.Position; + cls.TodayPosition = field.TodayPosition; + cls.HistoryPosition = field.HistoryPosition; + cls.HistoryFrozen = field.HistoryFrozen; + cls.TodayBSPosition = field.TodayBSPosition; + cls.TodayBSFrozen = field.TodayBSFrozen; + cls.TodayPRPosition = field.TodayPRPosition; + cls.TodayPRFrozen = field.TodayPRFrozen; + cls.ID = field.ID; + + cls.PortfolioID1 = field.PortfolioID1; + cls.PortfolioID2 = field.PortfolioID2; + cls.PortfolioID3 = field.PortfolioID3; + cls.Business = (int)field.Business; + cls.Business_String = Enum.ToString(field.Business); + + + if (null == OnRspQryInvestorPosition) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnRspQryInvestorPosition; + qd.Type_String = Enum.ToString(ResponseType.OnRspQryInvestorPosition); + qd.Sender = this; + qd.Data1 = cls; + qd.Data2 = size1; + qd.Data3 = bIsLast; + + MessageQueue.Enqueue(qd); + } + else + { + OnRspQryInvestorPosition(this, cls, size1, bIsLast); + } + } + + private void OnRspQrySettlementInfo_callback(object sender, [In] ref XAPI.SettlementInfoClass settlementInfo, int size1, bool bIsLast) + { + if (null == OnRspQrySettlementInfo) + return; + + XAPI.SettlementInfoClass field = settlementInfo; + + XAPI.COM.SettlementInfoClass cls = new XAPI.COM.SettlementInfoClass(); + cls.TradingDay = field.TradingDay; + cls.Content = field.Content; + + if (null == OnRspQrySettlementInfo) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnRspQrySettlementInfo; + qd.Type_String = Enum.ToString(ResponseType.OnRspQrySettlementInfo); + qd.Sender = this; + qd.Data1 = cls; + qd.Data2 = size1; + qd.Data3 = bIsLast; + + MessageQueue.Enqueue(qd); + } + else + { + OnRspQrySettlementInfo(this, cls, size1, bIsLast); + } + } + + + private void OnRspQryTradingAccount_callback(object sender, [In] ref AccountField account, int size1, bool bIsLast) + { + if (null == OnRspQryTradingAccount) + return; + + AccountField field = account; + + AccountClass cls = new AccountClass(); + + cls.ClientID = field.ClientID; + cls.AccountID = field.AccountID; + cls.CurrencyID = field.CurrencyID; + + cls.PreBalance = field.PreBalance; + cls.CurrMargin = field.CurrMargin; + cls.CloseProfit = field.CloseProfit; + cls.PositionProfit = field.PositionProfit; + cls.Balance = field.Balance; + cls.Available = field.Available; + cls.Deposit = field.Deposit; + cls.Withdraw = field.Withdraw; + cls.WithdrawQuota = field.WithdrawQuota; + cls.FrozenTransferFee = field.FrozenTransferFee; + cls.FrozenStampTax = field.FrozenStampTax; + cls.FrozenCommission = field.FrozenCommission; + cls.FrozenCash = field.FrozenCash; + cls.StampTax = field.StampTax; + cls.Commission = field.Commission; + cls.CashIn = field.CashIn; + + if (null == OnRspQryTradingAccount) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnRspQryTradingAccount; + qd.Type_String = Enum.ToString(ResponseType.OnRspQryTradingAccount); + qd.Sender = this; + qd.Data1 = cls; + qd.Data2 = size1; + qd.Data3 = bIsLast; + + MessageQueue.Enqueue(qd); + } + else + { + OnRspQryTradingAccount(this, cls, size1, bIsLast); + } + } + + private void OnRspQryOrder_callback(object sender, [In] ref OrderField order, int size1, bool bIsLast) + { + if (null == OnRspQryOrder) + return; + + OrderClass cls = new OrderClass(); + + if (size1 > 0) + { + OrderField field = order; + + cls.InstrumentName = field.InstrumentName(); + cls.Symbol = field.Symbol; + cls.InstrumentID = field.InstrumentID; + cls.ExchangeID = field.ExchangeID; + cls.ClientID = field.ClientID; + cls.AccountID = field.AccountID; + cls.Side = (int) field.Side; + cls.Side_String = Enum.ToString(field.Side); + cls.Qty = field.Qty; + cls.Price = field.Price; + cls.OpenClose = (int) field.OpenClose; + cls.OpenClose_String = Enum.ToString(field.OpenClose); + cls.HedgeFlag = (int) field.HedgeFlag; + cls.HedgeFlag_String = Enum.ToString(field.HedgeFlag); + cls.Date = field.Date; + cls.Time = field.Time; + cls.ID = field.ID; + cls.OrderID = field.OrderID; + cls.LocalID = field.LocalID; + cls.Type = (int) field.Type; + cls.Type_String = Enum.ToString(field.Type); + cls.StopPx = field.StopPx; + cls.TimeInForce = (int) field.TimeInForce; + cls.TimeInForce_String = Enum.ToString(field.TimeInForce); + cls.Status = (int) field.Status; + cls.Status_String = Enum.ToString(field.Status); + cls.ExecType = (int) field.ExecType; + cls.ExecType_String = Enum.ToString(field.ExecType); + cls.LeavesQty = field.LeavesQty; + cls.CumQty = field.CumQty; + cls.AvgPx = field.AvgPx; + cls.XErrorID = field.XErrorID; + cls.RawErrorID = field.RawErrorID; + cls.Text = field.Text(); + cls.ReserveInt32 = field.ReserveInt32; + cls.ReserveChar64 = field.ReserveChar64; + + cls.PortfolioID1 = field.PortfolioID1; + cls.PortfolioID2 = field.PortfolioID2; + cls.PortfolioID3 = field.PortfolioID3; + cls.Business = (int)field.Business; + cls.Business_String = Enum.ToString(field.Business); + } + + if (null == OnRspQryOrder) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnRspQryOrder; + qd.Type_String = Enum.ToString(ResponseType.OnRspQryOrder); + qd.Sender = this; + qd.Data1 = cls; + qd.Data2 = size1; + qd.Data3 = bIsLast; + + MessageQueue.Enqueue(qd); + } + else + { + OnRspQryOrder(this, cls, size1, bIsLast); + } + } + + private void OnRspQryTrade_callback(object sender, [In] ref TradeField trade, int size1, bool bIsLast) + { + if (null == OnRspQryTrade) + return; + + TradeClass cls = new TradeClass(); + + if (size1 > 0) + { + TradeField field = trade; + + cls.InstrumentName = field.InstrumentName(); + cls.Symbol = field.Symbol; + cls.InstrumentID = field.InstrumentID; + cls.ExchangeID = field.ExchangeID; + cls.ClientID = field.ClientID; + cls.AccountID = field.AccountID; + cls.Side = (int)field.Side; + cls.Side_String = Enum.ToString(field.Side); + cls.Qty = field.Qty; + cls.Price = field.Price; + cls.OpenClose = (int)field.OpenClose; + cls.OpenClose_String = Enum.ToString(field.OpenClose); + cls.HedgeFlag = (int)field.HedgeFlag; + cls.HedgeFlag_String = Enum.ToString(field.HedgeFlag); + cls.Date = field.Date; + cls.Time = field.Time; + cls.ID = field.ID; + cls.TradeID = field.TradeID; + cls.ReserveInt32 = field.ReserveInt32; + cls.ReserveChar64 = field.ReserveChar64; + + cls.PortfolioID1 = field.PortfolioID1; + cls.PortfolioID2 = field.PortfolioID2; + cls.PortfolioID3 = field.PortfolioID3; + cls.Business = (int)field.Business; + cls.Business_String = Enum.ToString(field.Business); + } + + if (null == OnRspQryTrade) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponseType.OnRspQryTrade; + qd.Type_String = Enum.ToString(ResponseType.OnRspQryTrade); + qd.Sender = this; + qd.Data1 = cls; + qd.Data2 = size1; + qd.Data3 = bIsLast; + + MessageQueue.Enqueue(qd); + } + else + { + OnRspQryTrade(this, cls, size1, bIsLast); + } + } + + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(20, 12); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(31, 13); + this.label1.TabIndex = 0; + this.label1.Text = "XAPI"; + // + // XApiCom + // + this.Controls.Add(this.label1); + this.Name = "XApiCom"; + this.Size = new System.Drawing.Size(122, 33); + this.ResumeLayout(false); + this.PerformLayout(); + + } + } + + class SimpleCOMObjectClassFactory : ClassFactoryBase + { + public override void virtual_CreateInstance(IntPtr pUnkOuter, ref Guid riid, out IntPtr ppvObject) + { + Console.WriteLine("SimpleCOMObjectClassFactory.CreateInstance()."); + Console.WriteLine("Requesting Interface : " + riid.ToString()); + + if (riid == Marshal.GenerateGuidForType(typeof(IXApi)) || + riid == ManagedCOMLocalServer.IID_IDispatch || + riid == ManagedCOMLocalServer.IID_IUnknown) + { + XApiCom SimpleCOMObject_New = new XApiCom(); + + ppvObject = Marshal.GetComInterfaceForObject(SimpleCOMObject_New, typeof(IXApi)); + } + else + { + throw new COMException("No interface", unchecked((int)0x80004002)); + } + } + } +} diff --git a/languages/CSharp/XAPI_CSharp/COM/XApiCom.resx b/languages/CSharp/XAPI_CSharp/COM/XApiCom.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/XApiCom.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/csharp/QuantBox.XAPI/Callback/BaseApi.cs b/languages/CSharp/XAPI_CSharp/Callback/BaseApi.cs similarity index 90% rename from csharp/QuantBox.XAPI/Callback/BaseApi.cs rename to languages/CSharp/XAPI_CSharp/Callback/BaseApi.cs index 7a2d9c5..d3cd0c1 100644 --- a/csharp/QuantBox.XAPI/Callback/BaseApi.cs +++ b/languages/CSharp/XAPI_CSharp/Callback/BaseApi.cs @@ -1,4 +1,4 @@ -using NLog; +//using NLog; using System; using System.Collections.Generic; using System.IO; @@ -6,15 +6,20 @@ using System.Runtime.InteropServices; using System.Text; -namespace QuantBox.XAPI.Callback +namespace XAPI.Callback { + [ComVisible(false)] public class BaseApi : IDisposable { - public Logger Log; + // 没有必要专门引入一个库,但又很少用 + //public Logger Log; + public object Log; + protected Proxy proxy; protected IntPtr Handle = IntPtr.Zero; public string LibPath; + [CLSCompliant(false)] protected XCall _XRespone; public ServerInfoField Server; @@ -200,6 +205,14 @@ public virtual void Disconnect() } + /// + /// 这个功能主要是给非.NET语言在调用时使用 + /// + public void GCCollect() + { + System.GC.Collect(); + } + public void RegisterAndStart(IntPtr ptr1) { lock (this) @@ -211,14 +224,15 @@ public void RegisterAndStart(IntPtr ptr1) } } - public ApiType GetApiType + + public ApiType GetApiTypes { get{ if (proxy == null) { proxy = new Proxy(LibPath); } - return (ApiType)proxy.XRequest((byte)RequestType.GetApiType, IntPtr.Zero, IntPtr.Zero, 0, 0, IntPtr.Zero, 0, IntPtr.Zero, 0, IntPtr.Zero, 0); + return (ApiType)proxy.XRequest((byte)RequestType.GetApiTypes, IntPtr.Zero, IntPtr.Zero, 0, 0, IntPtr.Zero, 0, IntPtr.Zero, 0, IntPtr.Zero, 0); } } @@ -251,25 +265,25 @@ public string GetApiName private IntPtr _OnRespone(byte type, IntPtr pApi1, IntPtr pApi2, double double1, double double2, IntPtr ptr1, int size1, IntPtr ptr2, int size2, IntPtr ptr3, int size3) { // 队列过来的消息,如何处理? - switch((ResponeType)type) + switch((ResponseType)type) { - case ResponeType.OnConnectionStatus: + case ResponseType.OnConnectionStatus: _OnConnectionStatus(double1, ptr1,size1); break; - case ResponeType.OnRtnError: + case ResponseType.OnRtnError: _OnRtnError(ptr1); break; - case ResponeType.OnLog: + case ResponseType.OnLog: _OnLog(ptr1); break; default: - return OnRespone(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); + return OnResponse(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); } return IntPtr.Zero; } - protected virtual IntPtr OnRespone(byte type, IntPtr pApi1, IntPtr pApi2, double double1, double double2, IntPtr ptr1, int size1, IntPtr ptr2, int size2, IntPtr ptr3, int size3) + protected virtual IntPtr OnResponse(byte type, IntPtr pApi1, IntPtr pApi2, double double1, double double2, IntPtr ptr1, int size1, IntPtr ptr2, int size2, IntPtr ptr3, int size3) { return IntPtr.Zero; } diff --git a/csharp/QuantBox.XAPI/Callback/XApi.HistoricalData.cs b/languages/CSharp/XAPI_CSharp/Callback/XApi.HistoricalData.cs similarity index 94% rename from csharp/QuantBox.XAPI/Callback/XApi.HistoricalData.cs rename to languages/CSharp/XAPI_CSharp/Callback/XApi.HistoricalData.cs index 20d8da6..bc67420 100644 --- a/csharp/QuantBox.XAPI/Callback/XApi.HistoricalData.cs +++ b/languages/CSharp/XAPI_CSharp/Callback/XApi.HistoricalData.cs @@ -1,11 +1,11 @@ -using QuantBox.XAPI.Interface; +using XAPI.Interface; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; -namespace QuantBox.XAPI.Callback +namespace XAPI.Callback { public partial class XApi : IXHistoricalData { diff --git a/csharp/QuantBox.XAPI/Callback/XApi.Instrument.cs b/languages/CSharp/XAPI_CSharp/Callback/XApi.Instrument.cs similarity index 91% rename from csharp/QuantBox.XAPI/Callback/XApi.Instrument.cs rename to languages/CSharp/XAPI_CSharp/Callback/XApi.Instrument.cs index 2d5b8d2..defed41 100644 --- a/csharp/QuantBox.XAPI/Callback/XApi.Instrument.cs +++ b/languages/CSharp/XAPI_CSharp/Callback/XApi.Instrument.cs @@ -1,4 +1,4 @@ -using QuantBox.XAPI.Interface; +using XAPI.Interface; using System; using System.Collections.Generic; using System.Linq; @@ -6,7 +6,7 @@ using System.Text; -namespace QuantBox.XAPI.Callback +namespace XAPI.Callback { public partial class XApi:IXInstrument { diff --git a/csharp/QuantBox.XAPI/Callback/XApi.MarketData.cs b/languages/CSharp/XAPI_CSharp/Callback/XApi.MarketData.cs similarity index 98% rename from csharp/QuantBox.XAPI/Callback/XApi.MarketData.cs rename to languages/CSharp/XAPI_CSharp/Callback/XApi.MarketData.cs index a5fe162..944eff8 100644 --- a/csharp/QuantBox.XAPI/Callback/XApi.MarketData.cs +++ b/languages/CSharp/XAPI_CSharp/Callback/XApi.MarketData.cs @@ -1,11 +1,11 @@ -using QuantBox.XAPI.Interface; +using XAPI.Interface; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; -namespace QuantBox.XAPI.Callback +namespace XAPI.Callback { public partial class XApi : IXMarketData { diff --git a/csharp/QuantBox.XAPI/Callback/XApi.Query.cs b/languages/CSharp/XAPI_CSharp/Callback/XApi.Query.cs similarity index 98% rename from csharp/QuantBox.XAPI/Callback/XApi.Query.cs rename to languages/CSharp/XAPI_CSharp/Callback/XApi.Query.cs index 1c0463e..e734b2c 100644 --- a/csharp/QuantBox.XAPI/Callback/XApi.Query.cs +++ b/languages/CSharp/XAPI_CSharp/Callback/XApi.Query.cs @@ -1,4 +1,4 @@ -using QuantBox.XAPI.Interface; +using XAPI.Interface; using System; using System.Collections.Generic; using System.Linq; @@ -6,7 +6,7 @@ using System.Text; -namespace QuantBox.XAPI.Callback +namespace XAPI.Callback { public partial class XApi : IXQuery { diff --git a/csharp/QuantBox.XAPI/Callback/XApi.QuoteRequest.cs b/languages/CSharp/XAPI_CSharp/Callback/XApi.QuoteRequest.cs similarity index 99% rename from csharp/QuantBox.XAPI/Callback/XApi.QuoteRequest.cs rename to languages/CSharp/XAPI_CSharp/Callback/XApi.QuoteRequest.cs index 154d99e..f4b610d 100644 --- a/csharp/QuantBox.XAPI/Callback/XApi.QuoteRequest.cs +++ b/languages/CSharp/XAPI_CSharp/Callback/XApi.QuoteRequest.cs @@ -5,7 +5,7 @@ using System.Text; -namespace QuantBox.XAPI.Callback +namespace XAPI.Callback { public partial class XApi { diff --git a/csharp/QuantBox.XAPI/Callback/XApi.Trade.cs b/languages/CSharp/XAPI_CSharp/Callback/XApi.Trade.cs similarity index 62% rename from csharp/QuantBox.XAPI/Callback/XApi.Trade.cs rename to languages/CSharp/XAPI_CSharp/Callback/XApi.Trade.cs index abb5bb7..01aa5c7 100644 --- a/csharp/QuantBox.XAPI/Callback/XApi.Trade.cs +++ b/languages/CSharp/XAPI_CSharp/Callback/XApi.Trade.cs @@ -1,4 +1,4 @@ -using QuantBox.XAPI.Interface; +using XAPI.Interface; using System; using System.Collections.Generic; using System.Linq; @@ -6,7 +6,7 @@ using System.Text; -namespace QuantBox.XAPI.Callback +namespace XAPI.Callback { public partial class XApi : IXTrade { @@ -30,7 +30,22 @@ public DelegateOnRtnQuote OnRtnQuote private DelegateOnRtnTrade OnRtnTrade_; private DelegateOnRtnQuote OnRtnQuote_; - public void SendOrder(ref OrderField[] orders,out string[] OrderRefs) + + public string SendOrder(ref OrderField order) + { + OrderField[] orders = new OrderField[1]; + orders[0] = order; + return SendOrder(ref orders); + } + + public string CancelOrder(string szId) + { + string[] szIds = new string[1]; + szIds[0] = szId; + return CancelOrder(szIds); + } + + public string SendOrder(ref OrderField[] orders) { int OrderField_size = Marshal.SizeOf(typeof(OrderField)); int OrderIDType_size = Marshal.SizeOf(typeof(OrderIDType)); @@ -48,60 +63,47 @@ public void SendOrder(ref OrderField[] orders,out string[] OrderRefs) 0, 0, OrderField_Ptr, orders.Length, OrderIDType_Ptr, 0, IntPtr.Zero, 0); - OrderRefs = new string[orders.Length]; - - for(int i = 0;i /// 连接状态 /// + [ComVisible(false)] public enum ConnectionStatus : byte { /// @@ -84,6 +86,7 @@ public enum ConnectionStatus : byte Unknown, } + [ComVisible(false)] [Flags] public enum ApiType : byte { @@ -97,7 +100,7 @@ public enum ApiType : byte Query = 64, }; - + [ComVisible(false)] public enum ResumeType : byte { Restart, @@ -106,6 +109,7 @@ public enum ResumeType : byte Undefined, }; + [ComVisible(false)] public enum LogLevel : byte { Trace, @@ -116,12 +120,14 @@ public enum LogLevel : byte Fatal, }; + [ComVisible(false)] public enum PutCall : byte { Put, Call, }; + [ComVisible(false)] public enum OrderStatus : byte { NotSent, @@ -137,16 +143,23 @@ public enum OrderStatus : byte Replaced, }; + [ComVisible(false)] public enum OrderSide : byte { Buy, Sell, - Creation, ///申购 - Redemption, ///赎回 - Merge, ///合并 - Split, ///拆分 + LOFCreation, ///LOF申购 + LOFRedemption, ///LOF赎回 + ETFCreation, ///ETF申购 + ETFRedemption, ///ETF赎回 + Merge, ///合并 + Split, ///拆分 + CBConvert, ///可转债转股,参考于https://en.wikipedia.org/wiki/Convertible_bond + CBRedemption, + Unknown, }; + [ComVisible(false)] public enum OrderType : byte { Market, @@ -159,6 +172,7 @@ public enum OrderType : byte TrailingStopLimit, }; + [ComVisible(false)] public enum TimeInForce : byte { ATC, @@ -174,12 +188,14 @@ public enum TimeInForce : byte AUC, }; + [ComVisible(false)] public enum PositionSide : byte { Long, Short, }; + [ComVisible(false)] public enum ExecType : byte { New, @@ -193,15 +209,23 @@ public enum ExecType : byte PendingReplace, Replace, ReplaceReject, + TradeCorrect, + TradeCancel, + OrderStatus, + PendingNew, + ClearingHold, }; + [ComVisible(false)] public enum OpenCloseType : byte { + Undefined, Open, Close, CloseToday, }; + [ComVisible(false)] public enum HedgeFlagType : byte { Speculation, @@ -211,6 +235,7 @@ public enum HedgeFlagType : byte MarketMaker, }; + [ComVisible(false)] public enum InstrumentType : byte { Stock, @@ -225,6 +250,7 @@ public enum InstrumentType : byte Synthetic, }; + [ComVisible(false)] public enum IdCardType : byte { EID, ///组织机构代码 @@ -238,6 +264,7 @@ public enum IdCardType : byte OtherCard, ///其他证件 }; + [ComVisible(false)] public enum ExchangeType : byte { Undefined, /// 未定义 @@ -254,6 +281,7 @@ public enum ExchangeType : byte }; ///合约生命周期状态类型 + [ComVisible(false)] public enum InstLifePhaseType : byte { NotStart, ///未上市 @@ -268,6 +296,7 @@ public enum InstLifePhaseType : byte ///交易阶段类型 + [ComVisible(false)] public enum TradingPhaseType : byte { BeforeTrading, ///开盘前 @@ -281,6 +310,14 @@ public enum TradingPhaseType : byte Fuse, ///熔断时段,参考于LTS }; + [ComVisible(false)] + public enum BusinessType : byte + { + Undefined, + Future, + Stock, + Option, + }; @@ -288,7 +325,7 @@ public enum TradingPhaseType : byte /// /// ///////////////////////////////////////////////////////// /// - + [ComVisible(false)] public enum BarType:byte { Time = 1, @@ -298,6 +335,7 @@ public enum BarType:byte Session, }; + [ComVisible(false)] public enum DataObjetType : byte { DataObject, @@ -315,7 +353,7 @@ public enum DataObjetType : byte /// /// /// - + [ComVisible(false)] public enum DepthLevelType : byte { L0, diff --git a/csharp/QuantBox.XAPI/Event/EventArgs.cs b/languages/CSharp/XAPI_CSharp/Event/EventArgs.cs similarity index 93% rename from csharp/QuantBox.XAPI/Event/EventArgs.cs rename to languages/CSharp/XAPI_CSharp/Event/EventArgs.cs index a28e8be..0a39348 100644 --- a/csharp/QuantBox.XAPI/Event/EventArgs.cs +++ b/languages/CSharp/XAPI_CSharp/Event/EventArgs.cs @@ -1,10 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices; using System.Text; -namespace QuantBox.XAPI.Event +namespace XAPI.Event { + [ComVisible(false)] public class OnConnectionStatusEventArgs:EventArgs { public readonly ConnectionStatus status; @@ -18,7 +20,7 @@ public OnConnectionStatusEventArgs(ConnectionStatus status, ref RspUserLoginFiel this.size1 = size1; } } - + [ComVisible(false)] public class OnRtnErrorEventArgs : EventArgs { public readonly ErrorField error; @@ -28,7 +30,7 @@ public OnRtnErrorEventArgs(ref ErrorField error) this.error = error; } } - + [ComVisible(false)] public class OnLogEventArgs : EventArgs { public readonly LogField log; @@ -38,7 +40,7 @@ public OnLogEventArgs(ref LogField log) this.log = log; } } - + [ComVisible(false)] public class OnRtnDepthMarketDataNEventArgs : EventArgs { public readonly DepthMarketDataNClass marketData; @@ -48,7 +50,7 @@ public OnRtnDepthMarketDataNEventArgs(ref DepthMarketDataNClass marketData) this.marketData = marketData; } } - + [ComVisible(false)] public class OnRtnQuoteRequestEventArgs : EventArgs { public readonly QuoteRequestField quoteRequest; @@ -58,7 +60,7 @@ public OnRtnQuoteRequestEventArgs(ref QuoteRequestField quoteRequest) this.quoteRequest = quoteRequest; } } - + [ComVisible(false)] public class OnRspQryInstrumentEventArgs : EventArgs { public readonly InstrumentField instrument; @@ -72,7 +74,7 @@ public OnRspQryInstrumentEventArgs(ref InstrumentField instrument, int size1, bo this.bIsLast = bIsLast; } } - + [ComVisible(false)] public class OnRspQryTradingAccountEventArgs : EventArgs { public readonly AccountField account; @@ -86,7 +88,7 @@ public OnRspQryTradingAccountEventArgs(ref AccountField account, int size1, bool this.bIsLast = bIsLast; } } - + [ComVisible(false)] public class OnRspQryInvestorPositionEventArgs : EventArgs { public readonly PositionField position; @@ -100,7 +102,7 @@ public OnRspQryInvestorPositionEventArgs(ref PositionField position, int size1, this.bIsLast = bIsLast; } } - + [ComVisible(false)] public class OnRspQrySettlementInfoEventArgs : EventArgs { public readonly SettlementInfoClass settlementInfo; @@ -114,7 +116,7 @@ public OnRspQrySettlementInfoEventArgs(ref SettlementInfoClass settlementInfo, i this.bIsLast = bIsLast; } } - + [ComVisible(false)] public class OnRspQryOrderEventArgs : EventArgs { public readonly OrderField order; @@ -128,7 +130,7 @@ public OnRspQryOrderEventArgs(ref OrderField order, int size1, bool bIsLast) this.bIsLast = bIsLast; } } - + [ComVisible(false)] public class OnRspQryTradeEventArgs : EventArgs { public readonly TradeField trade; @@ -142,7 +144,7 @@ public OnRspQryTradeEventArgs(ref TradeField trade, int size1, bool bIsLast) this.bIsLast = bIsLast; } } - + [ComVisible(false)] public class OnRspQryQuoteEventArgs : EventArgs { public readonly QuoteField quote; @@ -156,7 +158,7 @@ public OnRspQryQuoteEventArgs(ref QuoteField quote, int size1, bool bIsLast) this.bIsLast = bIsLast; } } - + [ComVisible(false)] public class OnRtnOrderEventArgs : EventArgs { public readonly OrderField order; @@ -166,7 +168,7 @@ public OnRtnOrderEventArgs(ref OrderField order) this.order = order; } } - + [ComVisible(false)] public class OnRtnTradeEventArgs : EventArgs { public readonly TradeField trade; @@ -176,7 +178,7 @@ public OnRtnTradeEventArgs(ref TradeField trade) this.trade = trade; } } - + [ComVisible(false)] public class OnRtnQuoteEventArgs : EventArgs { public readonly QuoteField quote; @@ -186,7 +188,7 @@ public OnRtnQuoteEventArgs(ref QuoteField quote) this.quote = quote; } } - + [ComVisible(false)] public class OnRspQryHistoricalTicksEventArgs : EventArgs { public readonly IntPtr pTicks; @@ -204,7 +206,7 @@ public OnRspQryHistoricalTicksEventArgs(IntPtr pTicks, int size1, ref Historical this.bIsLast = bIsLast; } } - + [ComVisible(false)] public class OnRspQryHistoricalBarsEventArgs : EventArgs { public readonly IntPtr pTicks; @@ -222,7 +224,7 @@ public OnRspQryHistoricalBarsEventArgs(IntPtr pTicks, int size1, ref HistoricalD this.bIsLast = bIsLast; } } - + [ComVisible(false)] public class OnRspQryInvestorEventArgs : EventArgs { public readonly InvestorField investor; diff --git a/csharp/QuantBox.XAPI/Event/XApiWrapper.cs b/languages/CSharp/XAPI_CSharp/Event/XApiWrapper.cs similarity index 81% rename from csharp/QuantBox.XAPI/Event/XApiWrapper.cs rename to languages/CSharp/XAPI_CSharp/Event/XApiWrapper.cs index 0ada749..387e625 100644 --- a/csharp/QuantBox.XAPI/Event/XApiWrapper.cs +++ b/languages/CSharp/XAPI_CSharp/Event/XApiWrapper.cs @@ -1,4 +1,4 @@ -using QuantBox.XAPI.Callback; +using XAPI.Callback; using System; using System.Collections.Generic; using System.Linq; @@ -7,35 +7,35 @@ using System.Windows.Forms; -namespace QuantBox.XAPI.Event +namespace XAPI.Event { - [ProgId("QuantBox.XAPI.Event.XApiWrapper"), ComVisible(true)] + [ComVisible(false)] public class XApiWrapper:XApi { - public new event EventHandler OnConnectionStatus; - public new event EventHandler OnRtnError; - public new event EventHandler OnLog; + public new event EventHandler OnConnectionStatus; + public new event EventHandler OnRtnError; + public new event EventHandler OnLog; - public new event EventHandler OnRtnDepthMarketData; - public new event EventHandler OnRtnQuoteRequest; + public new event EventHandler OnRtnDepthMarketData; + public new event EventHandler OnRtnQuoteRequest; - public new event EventHandler OnRspQryInstrument; - public new event EventHandler OnRspQryTradingAccount; - public new event EventHandler OnRspQryInvestorPosition; - public new event EventHandler OnRspQrySettlementInfo; + public new event EventHandler OnRspQryInstrument; + public new event EventHandler OnRspQryTradingAccount; + public new event EventHandler OnRspQryInvestorPosition; + public new event EventHandler OnRspQrySettlementInfo; - public new event EventHandler OnRspQryOrder; - public new event EventHandler OnRspQryTrade; - public new event EventHandler OnRspQryQuote; + public new event EventHandler OnRspQryOrder; + public new event EventHandler OnRspQryTrade; + public new event EventHandler OnRspQryQuote; - public new event EventHandler OnRtnOrder; - public new event EventHandler OnRtnTrade; - public new event EventHandler OnRtnQuote; + public new event EventHandler OnRtnOrder; + public new event EventHandler OnRtnTrade; + public new event EventHandler OnRtnQuote; - public new event EventHandler OnRspQryHistoricalTicks; - public new event EventHandler OnRspQryHistoricalBars; + public new event EventHandler OnRspQryHistoricalTicks; + public new event EventHandler OnRspQryHistoricalBars; - public new event EventHandler OnRspQryInvestor; + public new event EventHandler OnRspQryInvestor; public XApiWrapper(string path):this() diff --git a/csharp/QuantBox.XAPI/Extensions.cs b/languages/CSharp/XAPI_CSharp/Extensions.cs similarity index 93% rename from csharp/QuantBox.XAPI/Extensions.cs rename to languages/CSharp/XAPI_CSharp/Extensions.cs index 24e26da..5e3d8c5 100644 --- a/csharp/QuantBox.XAPI/Extensions.cs +++ b/languages/CSharp/XAPI_CSharp/Extensions.cs @@ -5,8 +5,9 @@ using System.Runtime.InteropServices; using System.Text; -namespace QuantBox.XAPI +namespace XAPI { + [ComVisible(false)] public static class Extensions_GBK { public static string InstrumentName([In]this InstrumentField field) @@ -14,6 +15,21 @@ public static string InstrumentName([In]this InstrumentField field) return PInvokeUtility.GetUnicodeString(field.InstrumentName); } + public static string InstrumentName([In]this OrderField field) + { + return PInvokeUtility.GetUnicodeString(field.InstrumentName); + } + + public static string InstrumentName([In]this TradeField field) + { + return PInvokeUtility.GetUnicodeString(field.InstrumentName); + } + + public static string InstrumentName([In]this PositionField field) + { + return PInvokeUtility.GetUnicodeString(field.InstrumentName); + } + public static string Text([In]this OrderField field) { return PInvokeUtility.GetUnicodeString(field.Text); @@ -63,6 +79,7 @@ public static string InvestorName([In]this RspUserLoginField field) TradeDay: 行情日 ActionDay:行情日 */ + [ComVisible(false)] public static class Extensions_Misc { public static DateTime ExchangeDateTime([In]this DepthMarketDataNClass field) @@ -123,6 +140,7 @@ public static DateTime ExchangeDateTime_([In]this DepthMarketDataNClass field) } } + [ComVisible(false)] public static class Extensions_Output { public static string ToFormattedString([In]this ErrorField field) @@ -206,16 +224,16 @@ public static string ToFormattedString([In]this LogField field) public static string ToFormattedString([In]this AccountField field) { - return string.Format("[AccountID={0};CurrencyID={1};Balance={2};Available={3}]", - field.AccountID, field.CurrencyID, field.Balance, field.Available); + return string.Format("[AccountID={0};CurrencyID={1};Balance={2};Available={3};Deposit={4};Withdraw={5}]", + field.AccountID, field.CurrencyID, field.Balance, field.Available, field.Deposit,field.Withdraw); } public static string ToFormattedString([In]this PositionField field) { return string.Format("[InstrumentID={0};ExchangeID={1};HedgeFlag={2};Side={3};" - + "Position={4};TodayPosition={5};HistoryPosition={6}]", + + "Position={4};TodayPosition={5};HistoryPosition={6};ID={7}]", field.InstrumentID, field.ExchangeID, Enum.ToString(field.HedgeFlag), Enum.ToString(field.Side), - field.Position, field.TodayPosition, field.HistoryPosition); + field.Position, field.TodayPosition, field.HistoryPosition, field.ID); } public static string ToFormattedHeader([In]this TickField field) diff --git a/csharp/QuantBox.XAPI/GB2312Marshaler.cs b/languages/CSharp/XAPI_CSharp/GB2312Marshaler.cs similarity index 98% rename from csharp/QuantBox.XAPI/GB2312Marshaler.cs rename to languages/CSharp/XAPI_CSharp/GB2312Marshaler.cs index 6c0b7a9..01554a2 100644 --- a/csharp/QuantBox.XAPI/GB2312Marshaler.cs +++ b/languages/CSharp/XAPI_CSharp/GB2312Marshaler.cs @@ -5,12 +5,13 @@ using System.Text; -namespace QuantBox.XAPI +namespace XAPI { /// /// Custom marshalers cannot be used on fields of structures /// 无语,本想实现中文直接的正常使用,后来发现这个不能用在结构体上还是没办法使用 /// + [ComVisible(false)] public class GB2312Marshaler : ICustomMarshaler { static Encoding encodingGB2312 = Encoding.GetEncoding(936); diff --git a/languages/CSharp/XAPI_CSharp/Helper.cs b/languages/CSharp/XAPI_CSharp/Helper.cs new file mode 100644 index 0000000..da3232f --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/Helper.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; + +namespace XAPI +{ + [CLSCompliant(true)] + [ComVisible(false)] + public static class Helper + { + public static void SetValueForValueType(this FieldInfo field, ref T item, object value) where T : struct + { + field.SetValueDirect(__makeref(item), value); + } + + public static object ChangeType(object value, Type type) + { + if (value == null && type.IsGenericType) return Activator.CreateInstance(type); + if (value == null) return null; + if (type == value.GetType()) return value; + if (type.IsEnum) + { + if (value is string) + return Enum.Parse(type, value as string); + else + return Enum.ToObject(type, value); + } + if (!type.IsInterface && type.IsGenericType) + { + Type innerType = type.GetGenericArguments()[0]; + object innerValue = ChangeType(value, innerType); + return Activator.CreateInstance(type, new object[] { innerValue }); + } + if (value is string && type == typeof(Guid)) return new Guid(value as string); + if (value is string && type == typeof(Version)) return new Version(value as string); + if (!(value is IConvertible)) return value; + return Convert.ChangeType(value, type); + } + } +} diff --git a/languages/CSharp/XAPI_CSharp/IObjectSafety.cs b/languages/CSharp/XAPI_CSharp/IObjectSafety.cs new file mode 100644 index 0000000..506d96b --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/IObjectSafety.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace XAPI +{ + /// + /// Import the IObjectSaftety COM Interface. + /// See http://msdn.microsoft.com/en-us/library/aa768224(VS.85).aspx + /// + [ComImport] + [Guid("CB5BDC81-93C1-11CF-8F20-00805F2CD064")] // This is the only Guid that cannot be modifed in this file + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + interface IObjectSafety + { + [PreserveSig] + int GetInterfaceSafetyOptions(ref Guid riid, out int pdwSupportedOptions, out int pdwEnabledOptions); + + [PreserveSig] + int SetInterfaceSafetyOptions(ref Guid riid, int dwOptionSetMask, int dwEnabledOptions); + } +} diff --git a/csharp/QuantBox.XAPI/Interface/IXApi.cs b/languages/CSharp/XAPI_CSharp/Interface/IXApi.cs similarity index 82% rename from csharp/QuantBox.XAPI/Interface/IXApi.cs rename to languages/CSharp/XAPI_CSharp/Interface/IXApi.cs index 207bfe8..186e060 100644 --- a/csharp/QuantBox.XAPI/Interface/IXApi.cs +++ b/languages/CSharp/XAPI_CSharp/Interface/IXApi.cs @@ -5,8 +5,9 @@ using System.Text; -namespace QuantBox.XAPI.Interface +namespace XAPI.Interface { + [ComVisible(false)] public interface IXApi { DelegateOnConnectionStatus OnConnectionStatus { get; set; } @@ -19,11 +20,12 @@ public interface IXApi void ReqQuery(QueryType type, ref ReqQueryField query); - ApiType GetApiType { get;} + ApiType GetApiTypes { get;} string GetApiName { get;} string GetApiVersion { get;} } + [ComVisible(false)] public interface IXMarketData { DelegateOnRtnDepthMarketData OnRtnDepthMarketData{ get; set; } @@ -31,11 +33,13 @@ public interface IXMarketData void Unsubscribe(string szInstrument, string szExchange); } + [ComVisible(false)] public interface IXInstrument { DelegateOnRspQryInstrument OnRspQryInstrument { get; set; } } + [ComVisible(false)] public interface IXQuery { DelegateOnRspQryTradingAccount OnRspQryTradingAccount { get; set; } @@ -47,19 +51,20 @@ public interface IXQuery DelegateOnRspQryQuote OnRspQryQuote { get; set; } } + [ComVisible(false)] public interface IXTrade { DelegateOnRtnOrder OnRtnOrder { get; set; } DelegateOnRtnTrade OnRtnTrade { get; set; } DelegateOnRtnQuote OnRtnQuote { get; set; } - - void SendOrder(ref OrderField[] orders, out string[] OrderRefs); - void CancelOrder(string[] szId,out string[] errs); - void SendQuote(ref QuoteField quote,out string AskRef,out string BidRef); - void CancelQuote(string szId,out string err); + string SendOrder(ref OrderField[] orders); + string CancelOrder(string[] szId); + string SendQuote(ref QuoteField quote); + string CancelQuote(string szId); } + [ComVisible(false)] public interface IXHistoricalData { DelegateOnRspQryHistoricalTicks OnRspQryHistoricalTicks { get; set; } diff --git a/csharp/QuantBox.XAPI/InvokeBase.cs b/languages/CSharp/XAPI_CSharp/InvokeBase.cs similarity index 81% rename from csharp/QuantBox.XAPI/InvokeBase.cs rename to languages/CSharp/XAPI_CSharp/InvokeBase.cs index b6bb3a5..21854db 100644 --- a/csharp/QuantBox.XAPI/InvokeBase.cs +++ b/languages/CSharp/XAPI_CSharp/InvokeBase.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices; using System.Text; -namespace QuantBox.XAPI +namespace XAPI { + [ComVisible(false)] public class InvokeBase { protected IntPtr hLib = IntPtr.Zero; diff --git a/csharp/QuantBox.XAPI/OptimizedEnum.cs b/languages/CSharp/XAPI_CSharp/OptimizedEnum.cs similarity index 99% rename from csharp/QuantBox.XAPI/OptimizedEnum.cs rename to languages/CSharp/XAPI_CSharp/OptimizedEnum.cs index d6a2c52..8f868b3 100644 --- a/csharp/QuantBox.XAPI/OptimizedEnum.cs +++ b/languages/CSharp/XAPI_CSharp/OptimizedEnum.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices; using System.Text; namespace Ideafixxxer.Generics @@ -17,6 +18,8 @@ namespace Ideafixxxer.Generics /// Helper class for enum types /// /// Must be enum type (declared using enum keyword) + [ComVisible(false)] + [CLSCompliant(false)] public static class Enum where T : struct, IConvertible { private static readonly EnumConverter Converter; diff --git a/csharp/QuantBox.XAPI/PInvokeUtility.cs b/languages/CSharp/XAPI_CSharp/PInvokeUtility.cs similarity index 96% rename from csharp/QuantBox.XAPI/PInvokeUtility.cs rename to languages/CSharp/XAPI_CSharp/PInvokeUtility.cs index e0ce4a7..76c2797 100644 --- a/csharp/QuantBox.XAPI/PInvokeUtility.cs +++ b/languages/CSharp/XAPI_CSharp/PInvokeUtility.cs @@ -5,8 +5,9 @@ using System.Text; -namespace QuantBox.XAPI +namespace XAPI { + [ComVisible(false)] public class PInvokeUtility { [DllImport("kernel32.dll", CharSet = CharSet.Auto)] @@ -71,6 +72,7 @@ public static DepthMarketDataNClass GetDepthMarketDataNClass(IntPtr ptr) cls.SettlementPrice = obj.SettlementPrice; cls.UpperLimitPrice = obj.UpperLimitPrice; cls.LowerLimitPrice = obj.LowerLimitPrice; + cls.PreClosePrice = obj.PreClosePrice; cls.PreSettlementPrice = obj.PreSettlementPrice; cls.PreOpenInterest = obj.PreOpenInterest; cls.TradingPhase = obj.TradingPhase; @@ -99,9 +101,11 @@ public static DepthMarketDataNClass GetDepthMarketDataNClass(IntPtr ptr) public static SettlementInfoClass GetSettlementInfoClass(IntPtr ptr) { - SettlementInfoField obj = (SettlementInfoField)Marshal.PtrToStructure(ptr, typeof(SettlementInfoField)); - SettlementInfoClass cls = new SettlementInfoClass(); + if (ptr == IntPtr.Zero) + return cls; + + SettlementInfoField obj = (SettlementInfoField)Marshal.PtrToStructure(ptr, typeof(SettlementInfoField)); int size = Marshal.SizeOf(typeof (SettlementInfoField)); IntPtr pContent = new IntPtr(ptr.ToInt64() + size); diff --git a/csharp/QuantBox.XAPI/PositionFieldEx.cs b/languages/CSharp/XAPI_CSharp/PositionFieldEx.cs similarity index 93% rename from csharp/QuantBox.XAPI/PositionFieldEx.cs rename to languages/CSharp/XAPI_CSharp/PositionFieldEx.cs index d710097..cf68556 100644 --- a/csharp/QuantBox.XAPI/PositionFieldEx.cs +++ b/languages/CSharp/XAPI_CSharp/PositionFieldEx.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices; using System.Text; -namespace QuantBox.XAPI +namespace XAPI { + [ComVisible(false)] public class PositionFieldEx { public string Symbol { get; private set; } diff --git a/csharp/QuantBox.XAPI/Program.cs b/languages/CSharp/XAPI_CSharp/Program.cs similarity index 78% rename from csharp/QuantBox.XAPI/Program.cs rename to languages/CSharp/XAPI_CSharp/Program.cs index 9324fbc..52b3a0d 100644 --- a/csharp/QuantBox.XAPI/Program.cs +++ b/languages/CSharp/XAPI_CSharp/Program.cs @@ -1,4 +1,4 @@ -using QuantBox.XAPI.Callback; +using XAPI.Callback; using System; using System.Collections.Generic; using System.Diagnostics; @@ -7,8 +7,9 @@ using System.IO; using System.Threading; +using XAPI.Event; -namespace QuantBox.XAPI +namespace XAPI { class Program { @@ -56,7 +57,7 @@ static void OnRspQryTradingAccount(object sender, ref AccountField account, int static void OnRspQrySettlementInfo(object sender, ref SettlementInfoClass settlementInfo, int size1, bool bIsLast) { - + Console.WriteLine(settlementInfo.Content); } static void OnRtnOrder(object sender, ref OrderField order) @@ -102,9 +103,23 @@ static bool OnFilterSubscribe(object sender, ExchangeType exchange, int instrume static void Main(string[] args) { + // 注意:为了进行进程外COM技术的支持,项目已经修改了启动对象, + // 默认是从另一个Main中启动,如想测试此内容,请修改项目的属性,Application->Startup object + int i; + int iCount = args.Length; + + for (i = 0; i < iCount; i++) + { + Console.Write("Argument : "); + Console.WriteLine(args[i]); + } + + Console.WriteLine("Press [ENTER] to exit."); + Console.ReadLine(); + //for (int i = 0; i < 10000; ++i) { - test_Tdx_Main(args); + test_CTP_Main(args); } Console.ReadKey(); } @@ -228,26 +243,28 @@ static void test_CTP_Main(string[] args) //api.Server.BrokerID = "1017"; //api.Server.Address = "tcp://ctpmn1-front1.citicsf.com:51213"; - api = new XApi(@"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\CTP\x86\QuantBox_CTP_Trade.dll"); + api = new XApi(@"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\x86\CTP\CTP_Trade_x86.dll"); - api.Server.BrokerID = "1017"; - api.Server.Address = "tcp://ctpmn1-front1.citicsf.com:51205"; + api.Server.BrokerID = "4040"; + api.Server.Address = "tcp://180.166.103.21:51205"; api.Server.PrivateTopicResumeType = ResumeType.Undefined; - api.User.UserID = "00000015"; - api.User.Password = "123456"; + api.User.UserID = ""; + api.User.Password = ""; api.OnConnectionStatus = OnConnectionStatus; api.OnRtnDepthMarketData = OnRtnDepthMarketData; api.OnRspQryInstrument = OnRspQryInstrument; + api.OnRspQrySettlementInfo = OnRspQrySettlementInfo; api.Connect(); - Thread.Sleep(10 * 1000); + Thread.Sleep(5 * 1000); //api.Subscribe("IF1502", ""); ReqQueryField query = default(ReqQueryField); - api.ReqQuery(QueryType.ReqQryInstrument, ref query); + query.DateStart = 20161124; + api.ReqQuery(QueryType.ReqQrySettlementInfo, ref query); - Thread.Sleep(300 * 1000); + Thread.Sleep(10 * 1000); api.Dispose(); @@ -306,7 +323,43 @@ static void test_KingstarGold_Main(string[] args) static void test_Tdx_Main(string[] args) { - api = new XApi(@"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\Tdx\x86\QuantBox_Tdx_Trade.dll"); + api = new XApi(@"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\x86\Tdx\Tdx_Trade_x86.dll"); + + + api.Server.Address = @"D:\tc_yhzq_v6\Login.lua"; + api.Server.ExtInfoChar128 = @"D:\tc_yhzq_v6\"; + api.User.UserID = "16206"; + api.User.Password = "198450"; + + api.Server.Address = @"D:\new_gjzq_v6\Login.lua"; + api.Server.ExtInfoChar128 = @"D:\new_gjzq_v6\"; + api.User.UserID = "31244679"; + api.User.Password = "400323"; + + api.OnConnectionStatus = OnConnectionStatus; + api.OnRtnDepthMarketData = OnRtnDepthMarketData; + + api.Connect(); + + Console.ReadKey(); + Console.WriteLine("回车后开始查持仓"); + Console.ReadKey(); + + ReqQueryField query = new ReqQueryField(); + query.Int32ID = -1; + api.ReqQuery(QueryType.ReqQryInvestorPosition, ref query); + + // api.Dispose(); + + Console.ReadKey(); + + Console.WriteLine("回车后退出"); + Console.ReadKey(); + } + + static void test_Tdx_Event_Main(string[] args) + { + XApiWrapper api = new XApiWrapper(@"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\Tdx\x86\QuantBox_Tdx_Trade.dll"); api.Server.BrokerID = ""; api.Server.Address = @"D:\new_hbzq_qq\Login.lua"; @@ -315,8 +368,8 @@ static void test_Tdx_Main(string[] args) api.User.UserID = "05000000000"; api.User.Password = "123456"; - api.OnConnectionStatus = OnConnectionStatus; - api.OnRtnDepthMarketData = OnRtnDepthMarketData; + api.OnConnectionStatus += api_OnConnectionStatus; + api.OnRtnDepthMarketData += api_OnRtnDepthMarketData; api.Connect(); @@ -330,5 +383,15 @@ static void test_Tdx_Main(string[] args) Console.ReadKey(); } + + static void api_OnRtnDepthMarketData(object sender, OnRtnDepthMarketDataNEventArgs e) + { + throw new NotImplementedException(); + } + + static void api_OnConnectionStatus(object sender, OnConnectionStatusEventArgs e) + { + throw new NotImplementedException(); + } } } diff --git a/csharp/QuantBox.XAPI/Properties/AssemblyInfo.cs b/languages/CSharp/XAPI_CSharp/Properties/AssemblyInfo.cs similarity index 61% rename from csharp/QuantBox.XAPI/Properties/AssemblyInfo.cs rename to languages/CSharp/XAPI_CSharp/Properties/AssemblyInfo.cs index bb86af5..4c7a166 100644 --- a/csharp/QuantBox.XAPI/Properties/AssemblyInfo.cs +++ b/languages/CSharp/XAPI_CSharp/Properties/AssemblyInfo.cs @@ -1,26 +1,31 @@ -using System.Reflection; +using System; +//using System.EnterpriseServices; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("QuantBox.XAPI")] +[assembly: AssemblyTitle("XAPI")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("QuantBox.XAPI")] -[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyProduct("XAPI")] +[assembly: AssemblyCopyright("Copyright © 2015-2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] +[assembly: ComVisible(true)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("4a780d41-2861-4c6e-8cfc-f604b1ce2ace")] +[assembly: CLSCompliant(true)] + +//[assembly: System.Security.AllowPartiallyTrustedCallers] // Version information for an assembly consists of the following four values: // @@ -32,5 +37,14 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.5.0.0")] +[assembly: AssemblyFileVersion("1.5.0.0")] + +//[assembly: ApplicationName("XApiComPlus")] +//[assembly: Description("XApiComPlus Assembly")] +//[assembly: ApplicationActivation(ActivationOption.Server)] +//[assembly: ApplicationAccessControl(false)] + +//[assembly: ImportedFromTypeLib("")] +//[assembly: PrimaryInteropAssembly(1,1)] + diff --git a/csharp/QuantBox.XAPI/Proxy.cs b/languages/CSharp/XAPI_CSharp/Proxy.cs similarity index 95% rename from csharp/QuantBox.XAPI/Proxy.cs rename to languages/CSharp/XAPI_CSharp/Proxy.cs index 6afad2e..05b1993 100644 --- a/csharp/QuantBox.XAPI/Proxy.cs +++ b/languages/CSharp/XAPI_CSharp/Proxy.cs @@ -1,12 +1,15 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices; using System.Text; -namespace QuantBox.XAPI +namespace XAPI { + [ComVisible(false)] public delegate IntPtr XCall(byte type, IntPtr pApi1, IntPtr pApi2, double double1, double double2, IntPtr ptr1, int size1, IntPtr ptr2, int size2, IntPtr ptr3, int size3); + [ComVisible(false)] public class Proxy { private InvokeBase _Invoke; diff --git a/csharp/QuantBox.XAPI/QueryType.cs b/languages/CSharp/XAPI_CSharp/QueryType.cs similarity index 90% rename from csharp/QuantBox.XAPI/QueryType.cs rename to languages/CSharp/XAPI_CSharp/QueryType.cs index e0126c5..7036bd6 100644 --- a/csharp/QuantBox.XAPI/QueryType.cs +++ b/languages/CSharp/XAPI_CSharp/QueryType.cs @@ -1,10 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices; using System.Text; -namespace QuantBox.XAPI +namespace XAPI { public enum QueryType : byte { diff --git a/csharp/QuantBox.XAPI/RequestType.cs b/languages/CSharp/XAPI_CSharp/RequestType.cs similarity index 93% rename from csharp/QuantBox.XAPI/RequestType.cs rename to languages/CSharp/XAPI_CSharp/RequestType.cs index dba3f93..3def22e 100644 --- a/csharp/QuantBox.XAPI/RequestType.cs +++ b/languages/CSharp/XAPI_CSharp/RequestType.cs @@ -4,11 +4,11 @@ using System.Text; -namespace QuantBox.XAPI +namespace XAPI { public enum RequestType:byte { - GetApiType = 0, + GetApiTypes = 0, GetApiVersion, GetApiName, diff --git a/csharp/QuantBox.XAPI/ResponeType.cs b/languages/CSharp/XAPI_CSharp/ResponseType.cs similarity index 91% rename from csharp/QuantBox.XAPI/ResponeType.cs rename to languages/CSharp/XAPI_CSharp/ResponseType.cs index c9b3a4e..54a8540 100644 --- a/csharp/QuantBox.XAPI/ResponeType.cs +++ b/languages/CSharp/XAPI_CSharp/ResponseType.cs @@ -4,9 +4,9 @@ using System.Text; -namespace QuantBox.XAPI +namespace XAPI { - public enum ResponeType : byte + public enum ResponseType : byte { OnConnectionStatus = 64, OnRtnError, diff --git a/csharp/QuantBox.XAPI/SoInvoke.cs b/languages/CSharp/XAPI_CSharp/SoInvoke.cs similarity index 97% rename from csharp/QuantBox.XAPI/SoInvoke.cs rename to languages/CSharp/XAPI_CSharp/SoInvoke.cs index 5f55529..c620d9f 100644 --- a/csharp/QuantBox.XAPI/SoInvoke.cs +++ b/languages/CSharp/XAPI_CSharp/SoInvoke.cs @@ -5,8 +5,9 @@ using System.Text; -namespace QuantBox.XAPI +namespace XAPI { + [ComVisible(false)] public class SoInvoke : InvokeBase { [DllImport("libdl.so")] diff --git a/csharp/QuantBox.XAPI/Struct.cs b/languages/CSharp/XAPI_CSharp/Struct.cs similarity index 91% rename from csharp/QuantBox.XAPI/Struct.cs rename to languages/CSharp/XAPI_CSharp/Struct.cs index 856596a..b5b64f1 100644 --- a/csharp/QuantBox.XAPI/Struct.cs +++ b/languages/CSharp/XAPI_CSharp/Struct.cs @@ -5,11 +5,12 @@ using System.Text; -namespace QuantBox.XAPI +namespace XAPI { /// /// 查询持仓,查委托,查成交 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct ReqQueryField { @@ -39,11 +40,21 @@ public struct ReqQueryField public string Char64ID; public int Int32ID; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - public string Char64RefID; - public int Int32RefID; + public string Char64PositionIndex; + public int Int32PositionIndex; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID1; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID2; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID3; + + public BusinessType Business; } ///持仓 + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct PositionField { @@ -78,11 +89,24 @@ public struct PositionField public double TodayPRPosition; ///今日申赎持仓冻结 public double TodayPRFrozen; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string ID; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID1; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID2; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID3; + + public BusinessType Business; } /// /// 做市商双向报价 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct QuoteField { @@ -138,6 +162,7 @@ public struct QuoteField /// /// 订单信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct OrderField { @@ -190,11 +215,21 @@ public struct OrderField public int ReserveInt32; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string ReserveChar64; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID1; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID2; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID3; + + public BusinessType Business; } /// /// 成交回报 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct TradeField { @@ -230,12 +265,22 @@ public struct TradeField public int ReserveInt32; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string ReserveChar64; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID1; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID2; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string PortfolioID3; + + public BusinessType Business; } /// /// 服务器信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct ServerInfoField { @@ -300,6 +345,7 @@ public struct ServerInfoField /// /// 用户信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct UserInfoField { @@ -328,6 +374,7 @@ public struct UserInfoField /// /// 错误信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct ErrorField { @@ -355,6 +402,7 @@ public struct ErrorField /// /// 日志信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct LogField { @@ -373,6 +421,7 @@ public struct LogField /// /// 登录回报 /// + [ComVisible(true)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct RspUserLoginField { @@ -426,6 +475,7 @@ public struct RspUserLoginField /// /// DepthField行情 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct DepthField { @@ -438,6 +488,7 @@ public struct DepthField /// /// 合约信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct InstrumentField { @@ -501,6 +552,7 @@ public struct InstrumentField /// /// 账号 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct AccountField { @@ -580,11 +632,10 @@ public struct AccountField public double CashIn; } - - /// /// 发给做市商的询价请求 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct QuoteRequestField { @@ -622,6 +673,7 @@ public struct QuoteRequestField /// /// 结算信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct SettlementInfoField { @@ -637,6 +689,7 @@ public struct SettlementInfoField //public byte[] Content; } + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct SettlementInfoClass { @@ -654,6 +707,7 @@ public struct SettlementInfoClass /// /// 投资者 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct InvestorField { @@ -669,6 +723,7 @@ public struct InvestorField } + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct OrderIDType { @@ -679,6 +734,7 @@ public struct OrderIDType /// /// 深度行情N档 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct DepthMarketDataNField { @@ -703,6 +759,11 @@ public struct DepthMarketDataNField /// /// 交易所代码 /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string ExchangeID; + /// + /// 交易所代码 + /// public ExchangeType Exchange; @@ -777,6 +838,7 @@ public struct DepthMarketDataNField public int BidCount; } + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public class DepthMarketDataNClass { @@ -785,11 +847,6 @@ public class DepthMarketDataNClass public int UpdateTime; public int UpdateMillisec; - /// - /// 交易所代码 - /// - public ExchangeType Exchange; - /// /// 合约代码 /// @@ -800,6 +857,16 @@ public class DepthMarketDataNClass /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] public string InstrumentID; + /// + /// 交易所代码 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string ExchangeID; + + /// + /// 交易所代码 + /// + public ExchangeType Exchange; /// @@ -891,6 +958,7 @@ public class DepthMarketDataNClass /// /// Tick行情 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct TickField { @@ -910,6 +978,7 @@ public struct TickField /// /// Bar行情 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct BarField { @@ -930,6 +999,7 @@ public struct BarField /// /// 合约信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct HistoricalDataRequestField { diff --git a/languages/CSharp/XAPI_CSharp/XAPI.snk b/languages/CSharp/XAPI_CSharp/XAPI.snk new file mode 100644 index 0000000..fe95a6b Binary files /dev/null and b/languages/CSharp/XAPI_CSharp/XAPI.snk differ diff --git a/csharp/QuantBox.XAPI/QuantBox.XAPI.csproj b/languages/CSharp/XAPI_CSharp/XAPI_CSharp.csproj similarity index 56% rename from csharp/QuantBox.XAPI/QuantBox.XAPI.csproj rename to languages/CSharp/XAPI_CSharp/XAPI_CSharp.csproj index aa3e5f3..fb32bf8 100644 --- a/csharp/QuantBox.XAPI/QuantBox.XAPI.csproj +++ b/languages/CSharp/XAPI_CSharp/XAPI_CSharp.csproj @@ -1,17 +1,32 @@  - + Debug AnyCPU {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB} - Library + Exe Properties - QuantBox.XAPI - QuantBox.XAPI - v4.5 + XAPI + XAPI_CSharp + v4.5.1 512 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true true @@ -21,10 +36,11 @@ DEBUG;TRACE prompt 4 - false + true AnyCPU true - false + true + ManagedMinimumRules.ruleset pdbonly @@ -34,10 +50,7 @@ prompt 4 false - - - - + true true @@ -48,6 +61,9 @@ prompt MinimumRecommendedRules.ruleset false + true + 4 + false true @@ -59,6 +75,8 @@ MinimumRecommendedRules.ruleset true false + 4 + false bin\x64\Release\ @@ -69,10 +87,12 @@ prompt MinimumRecommendedRules.ruleset false + 4 + true true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\ + bin\Debug\x64 DEBUG;TRACE full AnyCPU @@ -80,14 +100,44 @@ MinimumRecommendedRules.ruleset true false + 4 + false + + + true + + + XAPI.snk + + + bin\Release64\ + TRACE + true + pdbonly + AnyCPU + prompt + MinimumRecommendedRules.ruleset + 4 + true + + + bin\x64\Release64\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + 4 + true + + + XAPI.COM.ManagedCOMLocalServer - - False - ..\..\packages\NLog.4.0.1\lib\net45\NLog.dll - + @@ -102,6 +152,17 @@ + + + + + + + + + + UserControl + @@ -111,6 +172,7 @@ + @@ -119,12 +181,32 @@ - + + + + + + + + XApiCom.cs + + + + + False + Microsoft .NET Framework 4.5 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + @@ -132,8 +214,8 @@ - xcopy "$(TargetPath)" "$(SolutionDir)XAPI\" /Y -xcopy "$(TargetDir)NLog.dll" "$(SolutionDir)XAPI\" /Y + +