diff --git a/.gitignore b/.gitignore index 78b49ee..2fdb741 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,7 @@ ipch/ *.opensdf *.sdf *.cachefile +*.opendb # Visual Studio profiler *.psess diff --git a/AllCppProjects.sln b/AllCppProjects.sln new file mode 100644 index 0000000..5be26aa --- /dev/null +++ b/AllCppProjects.sln @@ -0,0 +1,266 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.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 +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}.Debug64|x64.Build.0 = 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 + 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} + {26C43947-9E7A-4B55-8A6D-A0F5222612AA} = {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} + {A67F001E-0B1B-4BE2-90BB-243F8648B5EF} = {8B1A6E55-6AB5-4875-8EC0-97E86BF42714} + {358586C9-A4B8-43E4-8376-59C68F0F6211} = {EA89FD2A-C740-4401-84E8-3BFEB57B1D5A} + {C77ADBF7-E610-4E57-BE4D-C122FC5BE611} = {A67F001E-0B1B-4BE2-90BB-243F8648B5EF} + {E883D8BF-3E2E-4899-B490-7346465B2555} = {DFA0F44C-82C0-4772-B71F-51D3DDE00F16} + {39599EFE-428F-408F-BF4F-BF462E37C5E8} = {E883D8BF-3E2E-4899-B490-7346465B2555} + EndGlobalSection +EndGlobal diff --git a/CopyApiDll.bat b/CopyApiDll.bat new file mode 100644 index 0000000..58f3105 --- /dev/null +++ b/CopyApiDll.bat @@ -0,0 +1,17 @@ +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\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\CTP\win64\*.dll" "bin\Debug64\x64\CTP" /Y + +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/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_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/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/dllmain.cpp b/QuantBox_XAPI/dllmain.cpp deleted file mode 100644 index 69b5891..0000000 --- a/QuantBox_XAPI/dllmain.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// 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_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.md b/README.md index 9f12bf7..cb7eab9 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**,这样授权功能模块将不参与编译。 + +## 编译各种语言封装 +### 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. 模仿已经提供的几个项目即可 - +1. 模仿已经提供的几个项目即可 \ No newline at end of file diff --git a/QuantBox_CTP_Quote/MdUserApi.cpp b/apis/CTP/Quote/MdUserApi.cpp similarity index 78% rename from QuantBox_CTP_Quote/MdUserApi.cpp rename to apis/CTP/Quote/MdUserApi.cpp index dbe8738..d1763e8 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 @@ -118,7 +118,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(ResponeType::ResponeType_OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); } return bRet; } @@ -159,11 +159,51 @@ 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(ResponeType::ResponeType_OnLog, m_msgQueue, m_pClass, true, 0, pField, sizeof(LogField), nullptr, 0, nullptr, 0); + } +#endif // KS_COPYFILE + + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_pApi = CThostFtdcMdApi::CreateFtdcMdApi(pszPath, m_ServerInfo.IsUsingUdp, m_ServerInfo.IsMulticast); 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,8 +226,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(ResponeType::ResponeType_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(ResponeType::ResponeType_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,7 +262,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); return m_pApi->ReqUserLogin((CThostFtdcReqUserLoginField*)ptr1, ++m_lRequestID); } @@ -230,7 +286,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); // 主动触发 m_msgQueue->Process(); } @@ -257,7 +313,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; @@ -285,7 +341,7 @@ void CMdUserApi::Subscribe(const string& szInstrumentIDs, const string& szExchag 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; @@ -299,11 +355,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; @@ -331,7 +387,7 @@ void CMdUserApi::Unsubscribe(const string& szInstrumentIDs, const string& szExch delete[] pBuf; } -void CMdUserApi::SubscribeQuote(const string& szInstrumentIDs, const string& szExchageID) +void CMdUserApi::SubscribeQuote(const string& szInstrumentIDs, const string& szExchangeID) { if (nullptr == m_pApi) return; @@ -359,7 +415,7 @@ void CMdUserApi::SubscribeQuote(const string& szInstrumentIDs, const string& szE delete[] pBuf; } -void CMdUserApi::SubscribeQuote(const set& instrumentIDs, const string& szExchageID) +void CMdUserApi::SubscribeQuote(const set& instrumentIDs, const string& szExchangeID) { if (nullptr == m_pApi) return; @@ -373,11 +429,11 @@ void CMdUserApi::SubscribeQuote(const set& instrumentIDs, const string& if (szInstrumentIDs.length()>1) { - SubscribeQuote(szInstrumentIDs, szExchageID); + SubscribeQuote(szInstrumentIDs, szExchangeID); } } -void CMdUserApi::UnsubscribeQuote(const string& szInstrumentIDs, const string& szExchageID) +void CMdUserApi::UnsubscribeQuote(const string& szInstrumentIDs, const string& szExchangeID) { if (nullptr == m_pApi) return; @@ -407,7 +463,7 @@ void CMdUserApi::UnsubscribeQuote(const string& szInstrumentIDs, const string& s 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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); //连接成功后自动请求登录 ReqUserLogin(); @@ -420,7 +476,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } void CMdUserApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) @@ -436,8 +492,8 @@ void CMdUserApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CTho 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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); //有可能断线了,本处是断线重连后重新订阅 set mapOld = m_setInstrumentIDs;//记下上次订阅的合约 @@ -453,7 +509,7 @@ void CMdUserApi::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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } } @@ -497,6 +553,7 @@ void CMdUserApi::OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMark DepthMarketDataNField* pField = (DepthMarketDataNField*)m_msgQueue->new_block(sizeof(DepthMarketDataNField)+sizeof(DepthField)* 10); 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); @@ -603,11 +660,11 @@ void CMdUserApi::OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMark #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(ResponeType::ResponeType_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(ResponeType::ResponeType_OnRtnDepthMarketData, m_msgQueue, m_pClass, 0, 0, pField, pField->Size, nullptr, 0, nullptr, 0); // 要关注一下其内的 //} } @@ -647,5 +704,5 @@ 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(ResponeType::ResponeType_OnRtnQuoteRequest, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteRequestField), nullptr, 0, nullptr, 0); } diff --git a/QuantBox_CTP_Quote/MdUserApi.h b/apis/CTP/Quote/MdUserApi.h similarity index 89% rename from QuantBox_CTP_Quote/MdUserApi.h rename to apis/CTP/Quote/MdUserApi.h index f3be004..5385ff8 100644 --- a/QuantBox_CTP_Quote/MdUserApi.h +++ b/apis/CTP/Quote/MdUserApi.h @@ -1,16 +1,9 @@ #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 @@ -44,10 +37,10 @@ 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); + 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); @@ -60,7 +53,7 @@ class CMdUserApi : // 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); diff --git a/QuantBox_CTP_Quote/main.cpp b/apis/CTP/Quote/main.cpp similarity index 67% rename from QuantBox_CTP_Quote/main.cpp rename to apis/CTP/Quote/main.cpp index 80628cf..8460cb4 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,30 +37,30 @@ 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: + 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; default: 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 77% rename from QuantBox_CTP_Trade/TraderApi.cpp rename to apis/CTP/Trade/TraderApi.cpp index 12355c7..0b6a141 100644 --- a/QuantBox_CTP_Trade/TraderApi.cpp +++ b/apis/CTP/Trade/TraderApi.cpp @@ -1,21 +1,29 @@ #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 +#include + +#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) { @@ -43,28 +51,28 @@ void CTraderApi::QueryInThread(char type, void* pApi1, void* pApi2, double doubl iRet = _ReqSettlementInfoConfirm(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); break; - case QueryType::ReqQryTradingAccount: + case QueryType::QueryType_ReqQryTradingAccount: iRet = _ReqQryTradingAccount(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); break; - case QueryType::ReqQryInvestorPosition : + case QueryType::QueryType_ReqQryInvestorPosition: iRet = _ReqQryInvestorPosition(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); break; - case QueryType::ReqQryInstrument : + case QueryType::QueryType_ReqQryInstrument: iRet = _ReqQryInstrument(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); break; - case QueryType::ReqQryInvestor : + case QueryType::QueryType_ReqQryInvestor: iRet = _ReqQryInvestor(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); break; - case QueryType::ReqQryOrder : + case QueryType::QueryType_ReqQryOrder: iRet = _ReqQryOrder(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); break; - case QueryType::ReqQryTrade: + case QueryType::QueryType_ReqQryTrade: iRet = _ReqQryTrade(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); break; - case QueryType::ReqQryQuote: + case QueryType::QueryType_ReqQryQuote: iRet = _ReqQryQuote(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); break; - case QueryType::ReqQrySettlementInfo: + case QueryType::QueryType_ReqQrySettlementInfo: iRet = _ReqQrySettlementInfo(type, pApi1, pApi2, double1, double2, ptr1, size1, ptr2, size2, ptr3, size3); break; default: @@ -118,12 +126,34 @@ CTraderApi::CTraderApi(void) 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 } CTraderApi::~CTraderApi(void) { Disconnect(); + +#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 +167,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(ResponeType::ResponeType_OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); } return bRet; } @@ -164,16 +194,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } + else if (err < 0) + { + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_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(ResponeType::ResponeType_OnLog, m_msgQueue, m_pClass, true, 0, pField, sizeof(LogField), nullptr, 0, nullptr, 0); + } +#endif // KS_COPYFILE + + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_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); @@ -215,15 +336,31 @@ 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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); //连接成功后自动请求认证或登录 if (strlen(m_ServerInfo.AuthCode)>0 @@ -246,7 +383,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } void CTraderApi::ReqAuthenticate() @@ -264,7 +401,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(ResponeType::ResponeType_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 +410,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorized, 0, nullptr, 0, nullptr, 0, nullptr, 0); ReqUserLogin(); } @@ -284,7 +421,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } } @@ -303,7 +440,7 @@ 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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logining, 0, nullptr, 0, nullptr, 0, nullptr, 0); return m_pApi->ReqUserLogin((CThostFtdcReqUserLoginField*)ptr1, ++m_lRequestID); } @@ -319,7 +456,7 @@ void CTraderApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CTho 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::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); // 记下登录信息,可能会用到 memcpy(&m_RspUserLogin, pRspUserLogin, sizeof(CThostFtdcRspUserLoginField)); @@ -327,9 +464,8 @@ void CTraderApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CTho // 自己发单时ID从1开始,不能从0开始 m_nMaxOrderRef = m_nMaxOrderRef>1 ? m_nMaxOrderRef : 1; ReqSettlementInfoConfirm(); - ReqQueryField body = { 0 }; - ReqQuery(QueryType::ReqQryInvestor, &body); + ReqQuery(QueryType::QueryType_ReqQryInvestor, &body); //TEST:测完要删 //body.DateStart = 20151111; @@ -340,7 +476,7 @@ 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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } } @@ -357,7 +493,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Confirming, 0, nullptr, 0, nullptr, 0, nullptr, 0); return m_pApi->ReqSettlementInfoConfirm((CThostFtdcSettlementInfoConfirmField*)ptr1, ++m_lRequestID); } @@ -366,8 +502,8 @@ 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); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Confirmed, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponeType::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); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } } @@ -411,7 +547,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); // 主动触发 m_msgQueue->Process(); } @@ -453,14 +589,14 @@ void CTraderApi::Clear() 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}; @@ -568,6 +704,33 @@ int CTraderApi::ReqOrderInsert( // 测试平台穿越速度,用完后需要注释掉 //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)); + + ////RspUserLoginField* pField = (RspUserLoginField*)m_msgQueue->new_block(sizeof(RspUserLoginField)); + //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(ResponeType::ResponeType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + + return nullptr; + } +#endif //不保存到队列,而是直接发送 @@ -586,13 +749,13 @@ int CTraderApi::ReqOrderInsert( 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) @@ -623,7 +786,7 @@ void CTraderApi::OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThost 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(ResponeType::ResponeType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } @@ -655,7 +818,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(ResponeType::ResponeType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } @@ -664,19 +827,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,7 +885,7 @@ 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; @@ -756,10 +920,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) @@ -790,7 +953,7 @@ void CTraderApi::OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAc 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(ResponeType::ResponeType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } @@ -822,7 +985,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(ResponeType::ResponeType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } @@ -940,7 +1103,7 @@ void CTraderApi::OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThost 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); + m_msgQueue->Input_Copy(ResponeType::ResponeType_OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); } } @@ -972,7 +1135,7 @@ void CTraderApi::OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CTh 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); + m_msgQueue->Input_Copy(ResponeType::ResponeType_OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); } } @@ -1067,7 +1230,7 @@ void CTraderApi::OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAc 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); + m_msgQueue->Input_Copy(ResponeType::ResponeType_OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); } } @@ -1100,7 +1263,7 @@ void CTraderApi::OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, C 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); + m_msgQueue->Input_Copy(ResponeType::ResponeType_OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); } } @@ -1142,11 +1305,11 @@ void CTraderApi::OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingA 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); + m_msgQueue->Input_NoCopy(ResponeType::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); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnRspQryTradingAccount, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); } } } @@ -1184,55 +1347,54 @@ void CTraderApi::OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInve { if (!IsErrorRspInfo("OnRspQryInvestorPosition", pRspInfo, nRequestID, bIsLast)) { - if (pInvestorPosition) + // 如果没有持仓,返回空的数据 + if (nullptr == pInvestorPosition) { - 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)); + m_msgQueue->Input_Copy(ResponeType::ResponeType_OnRspQryInvestorPosition, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + return; + } - //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); + PositionIDType positionId = { 0 }; + sprintf(positionId, "%s:%s:%d:%c", + pInvestorPosition->ExchangeID, + pInvestorPosition->InstrumentID, + TThostFtdcPosiDirectionType_2_PositionSide(pInvestorPosition->PosiDirection), + pInvestorPosition->HedgeFlag); - m_id_platform_position.insert(pair(positionId, pField)); - } - else - { - pField = it->second; - } + 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)); - pField->Position = pInvestorPosition->Position; - pField->TodayPosition = pInvestorPosition->TodayPosition; - pField->HistoryPosition = pInvestorPosition->Position - pInvestorPosition->TodayPosition; + //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); - // 等数据收集全了再遍历通知一次,为何要这样做?因为今昨是两条记录,但我记在一个里面 - 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); + m_id_platform_position.insert(pair(positionId, pField)); } else { - m_msgQueue->Input_Copy(ResponeType::OnRspQryInvestorPosition, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + 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::ResponeType_OnRspQryInvestorPosition, m_msgQueue, m_pClass, cnt == count, 0, iter->second, sizeof(PositionField), nullptr, 0, nullptr, 0); + } } } } @@ -1288,11 +1450,11 @@ void CTraderApi::OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CTho pField->StrikePrice = (pInstrument->StrikePrice < DBL_EPSILON || pInstrument->StrikePrice == DBL_MAX) ? 0 : pInstrument->StrikePrice; strcpy(pField->UnderlyingInstrID, pInstrument->UnderlyingInstrID); - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InstrumentField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponeType::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); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); } } } @@ -1373,7 +1535,7 @@ void CTraderApi::OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettleme 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); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnRspQrySettlementInfo, m_msgQueue, this, bIsLast, 0, pField, pField->Size, nullptr, 0, nullptr, 0); } //SettlementInfoField field = { 0 }; //strncpy(field.TradingDay, pSettlementInfo->TradingDay, sizeof(TThostFtdcDateType)); @@ -1383,7 +1545,7 @@ void CTraderApi::OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettleme } else { - m_msgQueue->Input_NoCopy(ResponeType::OnRspQrySettlementInfo, m_msgQueue, this, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnRspQrySettlementInfo, m_msgQueue, this, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); } } } @@ -1417,7 +1579,14 @@ int CTraderApi::_ReqQryOrder(char type, void* pApi1, void* pApi2, double double1 void CTraderApi::OnOrder(CThostFtdcOrderField *pOrder, int nRequestID, bool bIsLast) { if (nullptr == pOrder) + { + // 如果是请求报单而当日无报单,也需要回调告知 bIsLast = true + if (nRequestID != 0) + { + m_msgQueue->Input_Copy(ResponeType::ResponeType_OnRspQryOrder, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } return; + } OrderIDType orderId = { 0 }; sprintf(orderId, "%d:%d:%s", pOrder->FrontID, pOrder->SessionID, pOrder->OrderRef); @@ -1476,7 +1645,7 @@ void CTraderApi::OnOrder(CThostFtdcOrderField *pOrder, int nRequestID, bool bIsL 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); + m_msgQueue->Input_Copy(ResponeType::ResponeType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } else { @@ -1489,7 +1658,7 @@ void CTraderApi::OnOrder(CThostFtdcOrderField *pOrder, int nRequestID, bool bIsL // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 //m_id_platform_order.insert(pair(orderId, pField)); - m_msgQueue->Input_Copy(ResponeType::OnRspQryOrder, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponeType::ResponeType_OnRspQryOrder, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); m_msgQueue->delete_block(pField); } @@ -1528,7 +1697,13 @@ int CTraderApi::_ReqQryTrade(char type, void* pApi1, void* pApi2, double double1 void CTraderApi::OnTrade(CThostFtdcTradeField *pTrade, int nRequestID, bool bIsLast) { if (nullptr == pTrade) + { + if (nRequestID != 0) + { + m_msgQueue->Input_Copy(ResponeType::ResponeType_OnRspQryTrade, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } return; + } TradeField* pField = (TradeField*)m_msgQueue->new_block(sizeof(TradeField)); strcpy(pField->InstrumentID, pTrade->InstrumentID); @@ -1557,7 +1732,7 @@ void CTraderApi::OnTrade(CThostFtdcTradeField *pTrade, int nRequestID, bool bIsL // 找到对应的报单 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); + m_msgQueue->Input_Copy(ResponeType::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()) @@ -1576,7 +1751,7 @@ void CTraderApi::OnTrade(CThostFtdcTradeField *pTrade, int nRequestID, bool bIsL } else { - m_msgQueue->Input_Copy(ResponeType::OnRspQryOrder, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponeType::ResponeType_OnRspQryTrade, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); } // 清理内存 @@ -1636,12 +1811,12 @@ void CTraderApi::OnTrade(TradeField *pTrade) { //ReqQryInvestorPosition("", ""); ReqQueryField body = { 0 }; - ReqQuery(QueryType::ReqQryInvestorPosition, &body); + ReqQuery(QueryType::QueryType_ReqQryInvestorPosition, &body); return; } } - m_msgQueue->Input_Copy(ResponeType::OnRspQryInvestorPosition, m_msgQueue, m_pClass, false, 0, pField, sizeof(PositionField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponeType::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) @@ -1676,7 +1851,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(ResponeType::ResponeType_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); @@ -1763,7 +1944,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(ResponeType::ResponeType_OnRtnQuote, m_msgQueue, m_pClass, 0, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); } else { @@ -1803,7 +1984,7 @@ 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(ResponeType::ResponeType_OnRspQryQuote, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(QuoteField), nullptr, 0, nullptr, 0); m_msgQueue->delete_block(pField); } @@ -1860,11 +2041,35 @@ void CTraderApi::OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdc 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); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_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(); + } + + int err = m_pLicense->GetErrorCodeByNameThenAccount(pField->InvestorName,m_UserInfo.UserID); + { + m_pLicense->SetSendOrderFlag(true); + 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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } + } +#endif } else { - m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInvestor, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnRspQryInvestor, m_msgQueue, m_pClass, bIsLast, 0, nullptr, 0, nullptr, 0, nullptr, 0); } } } diff --git a/QuantBox_CTP_Trade/TraderApi.h b/apis/CTP/Trade/TraderApi.h similarity index 86% rename from QuantBox_CTP_Trade/TraderApi.h rename to apis/CTP/Trade/TraderApi.h index 83cf596..7d1320e 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,10 +21,15 @@ using namespace std; class CMsgQueue; +#ifdef ENABLE_LICENSE +class CLicense; +#endif + + class CTraderApi : public CThostFtdcTraderSpi { - //ݰ + //请求数据包类型 enum RequestType { E_Init = 100, @@ -70,18 +70,18 @@ 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); char* ReqQuoteInsert( QuoteField* pQuote, @@ -140,82 +140,82 @@ class CTraderApi : 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); - //¼ + //报价录入 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 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: - atomic m_lRequestID; //ID,ñ + 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; @@ -230,8 +230,12 @@ class CTraderApi : unordered_map m_id_platform_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 58% rename from QuantBox_CTP_Trade/main.cpp rename to apis/CTP/Trade/main.cpp index a0f23ca..3805250 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,38 +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 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_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_ReqOrderAction: + return (void*)pApi->ReqOrderAction((OrderIDType*)ptr1, size1, (char*)ptr2); + case RequestType_ReqQuoteAction: return (void*)pApi->ReqQuoteAction((const char*)ptr1, (OrderIDType*)ptr2); default: break; diff --git a/QuantBox_CTP_Trade/TypeConvert.cpp b/apis/CTP/TypeConvert.cpp similarity index 98% rename from QuantBox_CTP_Trade/TypeConvert.cpp rename to apis/CTP/TypeConvert.cpp index 31a8e94..3ceb11a 100644 --- a/QuantBox_CTP_Trade/TypeConvert.cpp +++ b/apis/CTP/TypeConvert.cpp @@ -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: @@ -198,11 +199,11 @@ OrderStatus CThostFtdcQuoteField_2_OrderStatus(CThostFtdcQuoteField* pIn) // 这个地方要改 //if (pIn->VolumeTotal == 0) - // return OrderStatus::Filled; + // return OrderStatus::OrderStatus_Filled; //else if (pIn->VolumeTotal == pIn->VolumeTotalOriginal) return OrderStatus::OrderStatus_New; //else - // return OrderStatus::PartiallyFilled; + // return OrderStatus::OrderStatus_PartiallyFilled; } } diff --git a/QuantBox_CTP_Trade/TypeConvert.h b/apis/CTP/TypeConvert.h similarity index 90% rename from QuantBox_CTP_Trade/TypeConvert.h rename to apis/CTP/TypeConvert.h index be39fec..c075823 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); 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/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/QuantBox_LTS_Quote_v2/QuantBox_LTS_Quote_v2.vcxproj b/apis/CTP_Quote/CTP_Quote.vcxproj similarity index 51% rename from QuantBox_LTS_Quote_v2/QuantBox_LTS_Quote_v2.vcxproj rename to apis/CTP_Quote/CTP_Quote.vcxproj index ba3fb43..765f522 100644 --- a/QuantBox_LTS_Quote_v2/QuantBox_LTS_Quote_v2.vcxproj +++ b/apis/CTP_Quote/CTP_Quote.vcxproj @@ -1,10 +1,6 @@  - - Debug64 - Win32 - Debug64 x64 @@ -13,23 +9,19 @@ Debug Win32 - - Debug + + Release64 x64 Release Win32 - - Release - x64 - - {D4387736-0623-4442-A4AC-AF79239F9419} + {919B914D-6840-453E-9201-8619E63AD0E1} Win32Proj - QuantBox_LTS_Quote + CTP_Quote @@ -38,18 +30,6 @@ v120 Unicode - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - DynamicLibrary true @@ -63,7 +43,7 @@ true Unicode - + DynamicLibrary false v120 @@ -76,100 +56,73 @@ - - - - - - - + true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\LTS_v2\x86 - - - true - - - true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\LTS + ..\..\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;QUANTBOX_LTS_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + 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 + ../../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) - true - - - Windows - true - ..\include\ApiHeader.def - - + Use Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTBOX_LTS_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true Windows true - ..\include\ApiHeader.def + ../../include/ApiHeader.def @@ -179,7 +132,7 @@ 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;CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -187,17 +140,17 @@ xcopy "$(SolutionDir)include\LTS_v2\win32\*.dll" "$(SolutionDir)XAPI\LTS_v2\x86 true true true - ..\include\ApiHeader.def + ../../include/ApiHeader.def - + Level3 Use MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTBOX_LTS_QUOTE_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CTP_QUOTE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -205,51 +158,33 @@ xcopy "$(SolutionDir)include\LTS_v2\win32\*.dll" "$(SolutionDir)XAPI\LTS_v2\x86 true true true - QuantBox_LTS_Quote.def + ../../include/ApiHeader.def - - - + + + + + - - - - false - false - false - false - - - - - - - - - false - false - - - - - - - + + + + + + Create - Create - Create Create Create - Create + Create 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..35399ab --- /dev/null +++ b/apis/CTP_Quote/Include.h @@ -0,0 +1,22 @@ +// 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") +#pragma comment(lib, "../../lib/Queue_x64.lib") +#else +#pragma comment(lib, "../../include/CTP/win32/thostmduserapi.lib") +#pragma comment(lib, "../../lib/Queue_x86.lib") +#endif \ No newline at end of file diff --git a/QuantBox_Tdx_Trade/ReadMe.txt b/apis/CTP_Quote/ReadMe.txt similarity index 84% rename from QuantBox_Tdx_Trade/ReadMe.txt rename to apis/CTP_Quote/ReadMe.txt index f89d1b6..5b54557 100644 --- a/QuantBox_Tdx_Trade/ReadMe.txt +++ b/apis/CTP_Quote/ReadMe.txt @@ -1,27 +1,27 @@ ======================================================================== - DYNAMIC LINK LIBRARY : QuantBox_Tdx_Trade Project Overview + DYNAMIC LINK LIBRARY : CTP_Quote Project Overview ======================================================================== -AppWizard has created this QuantBox_Tdx_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_Tdx_Trade application. +make up your CTP_Quote application. -QuantBox_Tdx_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_Tdx_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_Tdx_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_Tdx_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/FakeAPI/targetver.h b/apis/CTP_Quote/targetver.h similarity index 100% rename from FakeAPI/targetver.h rename to apis/CTP_Quote/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..2706ba5 --- /dev/null +++ b/apis/CTP_Trade/CTP_Trade.vcxproj @@ -0,0 +1,194 @@ + + + + + Debug64 + x64 + + + Debug + Win32 + + + Release64 + x64 + + + Release + Win32 + + + + {9FBB0318-E21C-4B7C-A258-98E6A3860B35} + Win32Proj + CTP_Trade + + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP + ./;../../include/cryptopp/;$(IncludePath) + $(ProjectName)_$(PlatformTarget) + + + true + ..\..\bin\$(Configuration)\$(PlatformTarget)\CTP + ./;$(IncludePath) + + + 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..a8964c2 --- /dev/null +++ b/apis/CTP_Trade/Include.h @@ -0,0 +1,22 @@ +// 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") +#pragma comment(lib, "../../lib/Queue_x64.lib") +#else +#pragma comment(lib, "../../include/CTP/win32/thosttraderapi.lib") +#pragma comment(lib, "../../lib/Queue_x86.lib") +#endif \ No newline at end of file diff --git a/QuantBox_CTP_Quote/ReadMe.txt b/apis/CTP_Trade/ReadMe.txt similarity index 84% rename from QuantBox_CTP_Quote/ReadMe.txt rename to apis/CTP_Trade/ReadMe.txt index 5e8e1d9..918e658 100644 --- a/QuantBox_CTP_Quote/ReadMe.txt +++ b/apis/CTP_Trade/ReadMe.txt @@ -1,27 +1,27 @@ ======================================================================== - DYNAMIC LINK LIBRARY : QuantBox_CTP_Quote Project Overview + DYNAMIC LINK LIBRARY : CTP_Trade Project Overview ======================================================================== -AppWizard has created this QuantBox_CTP_Quote DLL for you. +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 QuantBox_CTP_Quote application. +make up your CTP_Trade application. -QuantBox_CTP_Quote.vcxproj +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. -QuantBox_CTP_Quote.vcxproj.filters +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). -QuantBox_CTP_Quote.cpp +CTP_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 CTP_Trade.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: 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_CTP_Quote/targetver.h b/apis/CTP_Trade/targetver.h similarity index 100% rename from QuantBox_CTP_Quote/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..8840478 --- /dev/null +++ b/apis/Kingstar_Quote/Include.h @@ -0,0 +1,30 @@ +// 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") +#pragma comment(lib, "../../lib/Queue_x64.lib") +#else +#pragma comment(lib, "../../include/Kingstar/win32/KSMarketDataAPI.lib") +#pragma comment(lib, "../../lib/Queue_x86.lib") +#endif + +// 为了解决金仕达授权问题而加的功能 +#define KS_LKC_FILENAME "KSInterB2C" +#define KS_LKC_EXT "lkc" + +#define KS_COPYFILE 1 \ 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..6ac372e --- /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 + v120 + Unicode + + + DynamicLibrary + false + v120 + 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/QuantBox_Queue/ReadMe.txt b/apis/Kingstar_Quote/ReadMe.txt similarity index 86% rename from QuantBox_Queue/ReadMe.txt rename to apis/Kingstar_Quote/ReadMe.txt index f7d2719..262bfa1 100644 --- a/QuantBox_Queue/ReadMe.txt +++ b/apis/Kingstar_Quote/ReadMe.txt @@ -1,27 +1,27 @@ ======================================================================== - DYNAMIC LINK LIBRARY : QuantBox_Queue Project Overview + DYNAMIC LINK LIBRARY : Kingstar_Quote Project Overview ======================================================================== -AppWizard has created this QuantBox_Queue DLL for you. +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 QuantBox_Queue application. +make up your Kingstar_Quote application. -QuantBox_Queue.vcxproj +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. -QuantBox_Queue.vcxproj.filters +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). -QuantBox_Queue.cpp +Kingstar_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_Queue.pch and a precompiled types file named StdAfx.obj. + named Kingstar_Quote.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: diff --git a/QuantBox_Tdx_Trade/stdafx.cpp b/apis/Kingstar_Quote/stdafx.cpp similarity index 80% rename from QuantBox_Tdx_Trade/stdafx.cpp rename to apis/Kingstar_Quote/stdafx.cpp index 06ec8f9..fb7e65c 100644 --- a/QuantBox_Tdx_Trade/stdafx.cpp +++ b/apis/Kingstar_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 +// Kingstar_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/Kingstar_Quote/stdafx.h similarity index 100% rename from FakeAPI/stdafx.h rename to apis/Kingstar_Quote/stdafx.h diff --git a/QuantBox_CTP_Trade/targetver.h b/apis/Kingstar_Quote/targetver.h similarity index 100% rename from QuantBox_CTP_Trade/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..030a04b --- /dev/null +++ b/apis/Kingstar_Trade/Include.h @@ -0,0 +1,30 @@ +// 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") +#pragma comment(lib, "../../lib/Queue_x64.lib") +#else +#pragma comment(lib, "../../include/Kingstar/win32/KSTradeAPI.lib") +#pragma comment(lib, "../../lib/Queue_x86.lib") +#endif + +// 为了解决金仕达授权问题而加的功能 +#define KS_LKC_FILENAME "KSInterB2C" +#define KS_LKC_EXT "lkc" + +#define KS_COPYFILE 1 \ No newline at end of file diff --git a/FakeAPI/FakeAPI.vcxproj b/apis/Kingstar_Trade/Kingstar_Trade.vcxproj similarity index 72% rename from FakeAPI/FakeAPI.vcxproj rename to apis/Kingstar_Trade/Kingstar_Trade.vcxproj index 82a8f6e..645bc35 100644 --- a/FakeAPI/FakeAPI.vcxproj +++ b/apis/Kingstar_Trade/Kingstar_Trade.vcxproj @@ -11,9 +11,9 @@ - {358586C9-A4B8-43E4-8376-59C68F0F6211} + {70015722-8252-4944-AE20-16A88B583CEE} Win32Proj - FakeAPI + Kingstar_Trade @@ -41,25 +41,33 @@ true - D:\Program Files (x86)\HailiLive - StockDrv + ..\..\bin\$(Configuration)\$(PlatformTarget)\Kingstar + ./;$(IncludePath) + $(ProjectName)_$(PlatformTarget) false + ./;$(IncludePath) + ..\..\bin\$(Configuration)\$(PlatformTarget)\Kingstar + $(ProjectName)_$(PlatformTarget) Use Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;FAKEAPI_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;KINGSTAR_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true Windows true - export.def + ../../include/ApiHeader.def + + + + @@ -68,7 +76,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;FAKEAPI_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;KINGSTAR_TRADE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -76,42 +84,31 @@ true true true - export.def + ../../include/ApiHeader.def - + + + + - - - false - - - false - - - - - + + + + + Create Create + Create - - - - - - - - - diff --git a/QuantBox_CTP_Quote/QuantBox_CTP_Quote.vcxproj.filters b/apis/Kingstar_Trade/Kingstar_Trade.vcxproj.filters similarity index 76% rename from QuantBox_CTP_Quote/QuantBox_CTP_Quote.vcxproj.filters rename to apis/Kingstar_Trade/Kingstar_Trade.vcxproj.filters index 8b20d4f..54e8630 100644 --- a/QuantBox_CTP_Quote/QuantBox_CTP_Quote.vcxproj.filters +++ b/apis/Kingstar_Trade/Kingstar_Trade.vcxproj.filters @@ -24,16 +24,16 @@ Header Files - + Header Files - + Header Files - + Header Files - + Header Files @@ -41,22 +41,19 @@ Source Files - + Source Files - + Source Files - + Source Files - + Source Files - - Source Files - - + Source Files diff --git a/QuantBox_CTP_Trade/ReadMe.txt b/apis/Kingstar_Trade/ReadMe.txt similarity index 84% rename from QuantBox_CTP_Trade/ReadMe.txt rename to apis/Kingstar_Trade/ReadMe.txt index e05ea6a..ad3554e 100644 --- a/QuantBox_CTP_Trade/ReadMe.txt +++ b/apis/Kingstar_Trade/ReadMe.txt @@ -1,27 +1,27 @@ ======================================================================== - DYNAMIC LINK LIBRARY : QuantBox_CTP_Trade Project Overview + DYNAMIC LINK LIBRARY : Kingstar_Trade Project Overview ======================================================================== -AppWizard has created this QuantBox_CTP_Trade DLL for you. +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 QuantBox_CTP_Trade application. +make up your Kingstar_Trade application. -QuantBox_CTP_Trade.vcxproj +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. -QuantBox_CTP_Trade.vcxproj.filters +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). -QuantBox_CTP_Trade.cpp +Kingstar_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_Trade.pch and a precompiled types file named StdAfx.obj. + named Kingstar_Trade.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: diff --git a/QuantBox_XAPI_TEST/stdafx.cpp b/apis/Kingstar_Trade/stdafx.cpp similarity index 80% rename from QuantBox_XAPI_TEST/stdafx.cpp rename to apis/Kingstar_Trade/stdafx.cpp index 6f6a809..d21ef9a 100644 --- a/QuantBox_XAPI_TEST/stdafx.cpp +++ b/apis/Kingstar_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 +// Kingstar_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/Kingstar_Trade/stdafx.h similarity index 100% rename from QuantBox_LTS_Query_v2/stdafx.h rename to apis/Kingstar_Trade/stdafx.h diff --git a/QuantBox_LTS_Query_v2/targetver.h b/apis/Kingstar_Trade/targetver.h similarity index 100% rename from QuantBox_LTS_Query_v2/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 74% rename from QuantBox_LTS_Query_v2/QuantBox_LTS_Query_v2.vcxproj rename to apis/LTS_Query_v2/LTS_Query_v2.vcxproj index ffef572..a58e455 100644 --- a/QuantBox_LTS_Query_v2/QuantBox_LTS_Query_v2.vcxproj +++ b/apis/LTS_Query_v2/LTS_Query_v2.vcxproj @@ -13,7 +13,7 @@ {51D11C21-C4A7-4F07-9658-B8BA223684B8} Win32Proj - QuantBox_LTS_Query_v2 + LTS_Query_v2 @@ -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..6acfc22 --- /dev/null +++ b/apis/LTS_Query_v2/QueryApi.cpp @@ -0,0 +1,859 @@ +#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; + 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(ResponeType::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/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(ResponeType::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.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(ResponeType::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::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::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::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::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::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::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::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::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(); + ReqQueryField body = { 0 }; + ReqQuery(QueryType::QueryType_ReqQryInvestor, &body); + + m_msgQueue->Input_NoCopy(ResponeType::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::ResponeType_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(ResponeType::ResponeType_OnRspQryTradingAccount, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(AccountField), nullptr, 0, nullptr, 0); + } + else + { + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_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)); + + 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::ResponeType_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(ResponeType::ResponeType_OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InstrumentField), nullptr, 0, nullptr, 0); + } + else + { + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_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(ResponeType::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)); + + // ʱϢûУҲӦĵӣҪOrderĻָ + CSecurityFtdcOrderField_2_OrderField_0(orderId, pOrder, pField); + + // ӵmapУߵĶȡʧʱ֪ͨ + //m_id_platform_order.insert(pair(orderId, pField)); + + m_msgQueue->Input_Copy(ResponeType::ResponeType_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(ResponeType::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); + } + } + else + { + m_msgQueue->Input_Copy(ResponeType::ResponeType_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(ResponeType::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("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(ResponeType::ResponeType_OnRspQryInvestor, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InvestorField), nullptr, 0, nullptr, 0); + } + else + { + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_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 85% rename from QuantBox_LTS_Query_v2/QueryApi.h rename to apis/LTS_Query_v2/QueryApi.h index f71aca1..c263121 100644 --- a/QuantBox_LTS_Query_v2/QueryApi.h +++ b/apis/LTS_Query_v2/QueryApi.h @@ -1,14 +1,15 @@ #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") +#pragma comment(lib, "../../lib/Queue_x64.lib") #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") +#pragma comment(lib, "../../lib/Queue_x86.lib") #endif #include @@ -30,7 +31,7 @@ class CQueryApi : //ݰ enum RequestType { - E_Init, + E_Init = 100, E_ReqAuthenticateField, E_ReqUserLoginField, @@ -83,19 +84,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 +123,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_CTP_Quote/dllmain.cpp b/apis/LTS_Query_v2/dllmain.cpp similarity index 100% rename from QuantBox_CTP_Quote/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/QuantBox_Tdx_Trade/stdafx.h b/apis/LTS_Query_v2/stdafx.h similarity index 100% rename from QuantBox_Tdx_Trade/stdafx.h rename to apis/LTS_Query_v2/stdafx.h diff --git a/QuantBox_LTS_Quote_v2/targetver.h b/apis/LTS_Query_v2/targetver.h similarity index 100% rename from QuantBox_LTS_Quote_v2/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..129e9bd --- /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 + v120 + Unicode + + + DynamicLibrary + false + v120 + 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..1741311 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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_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 88% rename from QuantBox_LTS_Quote_v2/MdUserApi.h rename to apis/LTS_Quote_v2/MdUserApi.h index 6452742..3e59445 100644 --- a/QuantBox_LTS_Quote_v2/MdUserApi.h +++ b/apis/LTS_Quote_v2/MdUserApi.h @@ -1,14 +1,14 @@ #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") +#pragma comment(lib, "../../lib/Queue_x64.lib") #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") +#pragma comment(lib, "../../lib/Queue_x86.lib") #endif #include @@ -41,11 +41,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 +57,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_CTP_Trade/dllmain.cpp b/apis/LTS_Quote_v2/dllmain.cpp similarity index 100% rename from QuantBox_CTP_Trade/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_LTS_Trade_v2/targetver.h b/apis/LTS_Quote_v2/targetver.h similarity index 100% rename from QuantBox_LTS_Trade_v2/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..9631114 --- /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 + v120 + Unicode + + + DynamicLibrary + false + v120 + 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 77% rename from QuantBox_LTS_Trade_v2/TraderApi.cpp rename to apis/LTS_Trade_v2/TraderApi.cpp index 48a1676..ca8d078 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" @@ -126,7 +126,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(ResponeType::ResponeType_OnRtnError, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(ErrorField), nullptr, 0, nullptr, 0); } return bRet; } @@ -160,7 +160,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); if (m_pApi) { @@ -187,7 +187,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connecting, 0, nullptr, 0, nullptr, 0, nullptr, 0); //初始化连接 m_pApi->Init(); } @@ -214,7 +214,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, nullptr, 0, nullptr, 0, nullptr, 0); // 主动触发 m_msgQueue->Process(); } @@ -258,7 +258,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Connected, 0, nullptr, 0, nullptr, 0, nullptr, 0); //ReqUserLogin(); ReqFetchAuthRandCode(); @@ -272,7 +272,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } void CTraderApi::ReqFetchAuthRandCode() @@ -287,7 +287,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(ResponeType::ResponeType_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 +298,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Authorized, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); ReqUserLogin(pAuthRandCode->RandCode); } @@ -307,7 +307,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); } } @@ -328,7 +328,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(ResponeType::ResponeType_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 +344,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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); // 记下登录信息,可能会用到 memcpy(&m_RspUserLogin,pRspUserLogin,sizeof(CSecurityFtdcRspUserLoginField)); @@ -354,7 +354,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(ResponeType::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); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_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 +506,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 +541,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(ResponeType::ResponeType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } @@ -575,34 +575,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(ResponeType::ResponeType_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 +635,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 +666,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(ResponeType::ResponeType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); } } @@ -695,13 +696,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(ResponeType::ResponeType_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 +710,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 +745,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(ResponeType::ResponeType_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)); + + // 开盘时发单信息还没有,所以找不到对应的单子,需要进行Order的恢复 + CSecurityFtdcOrderField_2_OrderField_0(orderId, pOrder, pField); + + // 添加到map中,用于其它工具的读取,撤单失败时的再通知等 + //m_id_platform_order.insert(pair(orderId, pField)); - m_msgQueue->Input_Copy(ResponeType::OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + m_msgQueue->Input_Copy(ResponeType::ResponeType_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 +811,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()) - { - // 此成交找不到对应的报单 - //assert(false); - } - else + if (nRequestID == 0) { - // 找到对应的报单 - 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()); - // 查询与交易分离,所以本地计算更新持仓的功能失效 - //OnTrade(pField, bFromQry); + m_msgQueue->Input_Copy(ResponeType::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); + } } + else + { + m_msgQueue->Input_Copy(ResponeType::ResponeType_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 +909,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(ResponeType::ResponeType_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 92% rename from QuantBox_LTS_Trade_v2/TraderApi.h rename to apis/LTS_Trade_v2/TraderApi.h index 1b64f01..c52154f 100644 --- a/QuantBox_LTS_Trade_v2/TraderApi.h +++ b/apis/LTS_Trade_v2/TraderApi.h @@ -1,14 +1,14 @@ #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") +#pragma comment(lib, "../../lib/Queue_x64.lib") #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") +#pragma comment(lib, "../../lib/Queue_x86.lib") #endif #include @@ -30,7 +30,7 @@ class CTraderApi : //请求数据包类型 enum RequestType { - E_Init, + E_Init = 100, E_ReqAuthenticateField, E_ReqUserLoginField, @@ -67,13 +67,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 +120,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_LTS_Query_v2/dllmain.cpp b/apis/LTS_Trade_v2/dllmain.cpp similarity index 100% rename from QuantBox_LTS_Query_v2/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_Queue/targetver.h b/apis/LTS_Trade_v2/targetver.h similarity index 100% rename from QuantBox_Queue/targetver.h rename to apis/LTS_Trade_v2/targetver.h 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..49b5488 --- /dev/null +++ b/apis/Tdx_Trade/SingleUser.cpp @@ -0,0 +1,836 @@ +#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); + } +} + +CSingleUser::CSingleUser(CTraderApi* pApi) +{ + m_pApi = pApi; + m_pClient = nullptr; + memset(m_UserID, 0, sizeof(m_UserID)); +} + + +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(ResponeType::ResponeType_OnLog, m_msgQueue, m_pClass, true, 0, pField, sizeof(LogField), nullptr, 0, nullptr, 0); +} + +void CSingleUser::CheckThenQueryOrder(time_t _now) +{ + 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 (_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::OnRespone_ReqQryOrder(CTdxApi* pApi, RequestRespone_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(ResponeType::ResponeType_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_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)); + } + } + ++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(ResponeType::ResponeType_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(ResponeType::ResponeType_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"); + } + + 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::OnRespone_ReqQryTrade(CTdxApi* pApi, RequestRespone_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(ResponeType::ResponeType_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_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); + 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(ResponeType::ResponeType_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(); + + 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(ResponeType::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::ResponeType_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(ResponeType::ResponeType_OnRtnTrade, m_msgQueue, m_pClass, 0, 0, pField, sizeof(TradeField), nullptr, 0, nullptr, 0); + } + + // 前一个可能为空,移动到下一个时需要注意 + if (it2 != oldList.end()) + { + ++it2; + } + + ++i; + } +} + + +int CSingleUser::OnRespone_ReqUserLogin(CTdxApi* pApi, RequestRespone_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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + + m_pApi->RemoveUser((CSingleUser*)pRespone->pUserData_Public); + } + else + { + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Logined, 0, nullptr, 0, nullptr, 0, nullptr, 0); + + m_pApi->StartQueryThread(); + } + + // 查询股东列表,华泰证券可能一开始查会返回非知请求[1122] + GDLB_STRUCT** ppRS = nullptr; + CharTable2Login(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(ResponeType::ResponeType_OnRspQryInvestor, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(InvestorField), nullptr, 0, nullptr, 0); + } + + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } + + return 0; +} + +int CSingleUser::OnRespone_ReqQryInvestor(CTdxApi* pApi, RequestRespone_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(ResponeType::ResponeType_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(ResponeType::ResponeType_OnRspQryInvestor, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(InvestorField), nullptr, 0, nullptr, 0); + } + + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Done, 0, nullptr, 0, nullptr, 0, nullptr, 0); + } + + return 0; +} + +int CSingleUser::OnRespone_ReqQryTradingAccount(CTdxApi* pApi, RequestRespone_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(ResponeType::ResponeType_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); + + 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::ResponeType_OnRspQryTradingAccount, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(AccountField), nullptr, 0, nullptr, 0); + } + + return 0; +} + +int CSingleUser::OnRespone_ReqQryInvestorPosition(CTdxApi* pApi, RequestRespone_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(ResponeType::ResponeType_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); + + 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::ResponeType_OnRspQryInvestorPosition, m_msgQueue, m_pClass, i == count - 1, 0, pField, sizeof(PositionField), nullptr, 0, nullptr, 0); + } + + return 0; +} + +int CSingleUser::OnRespone_ReqOrderInsert(CTdxApi* pApi, RequestRespone_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->GDDM, pTdxOrder->GDDM); + strcpy(pWTOrders->WTBH, pTdxOrder->WTBH); + strcpy(pWTOrders->JYSDM, pTdxOrder->ZHLB_); + 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(ResponeType::ResponeType_OnRtnOrder, m_msgQueue, m_pClass, 0, 0, pField, sizeof(OrderField), nullptr, 0, nullptr, 0); + + return 0; +} + +int CSingleUser::OnRespone_ReqOrderAction(CTdxApi* pApi, RequestRespone_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(ResponeType::ResponeType_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..84680b7 --- /dev/null +++ b/apis/Tdx_Trade/SingleUser.h @@ -0,0 +1,74 @@ +#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 OnRespone_ReqQryOrder(CTdxApi* pApi, RequestRespone_STRUCT* pRespone); + int OnRespone_ReqQryTrade(CTdxApi* pApi, RequestRespone_STRUCT* pRespone); + + int OnRespone_ReqUserLogin(CTdxApi* pApi, RequestRespone_STRUCT* pRespone); + int OnRespone_ReqQryInvestor(CTdxApi* pApi, RequestRespone_STRUCT* pRespone); + int OnRespone_ReqQryTradingAccount(CTdxApi* pApi, RequestRespone_STRUCT* pRespone); + int OnRespone_ReqQryInvestorPosition(CTdxApi* pApi, RequestRespone_STRUCT* pRespone); + + int OnRespone_ReqOrderInsert(CTdxApi* pApi, RequestRespone_STRUCT* pRespone); + int OnRespone_ReqOrderAction(CTdxApi* pApi, RequestRespone_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]; +}; + diff --git a/QuantBox_Tdx_Trade/Struct.h b/apis/Tdx_Trade/Struct.h similarity index 100% rename from QuantBox_Tdx_Trade/Struct.h rename to apis/Tdx_Trade/Struct.h diff --git a/QuantBox_Tdx_Trade/QuantBox_Tdx_Trade.vcxproj b/apis/Tdx_Trade/Tdx_Trade.vcxproj similarity index 71% rename from QuantBox_Tdx_Trade/QuantBox_Tdx_Trade.vcxproj rename to apis/Tdx_Trade/Tdx_Trade.vcxproj index 5fe1cfe..5b4c49f 100644 --- a/QuantBox_Tdx_Trade/QuantBox_Tdx_Trade.vcxproj +++ b/apis/Tdx_Trade/Tdx_Trade.vcxproj @@ -13,7 +13,7 @@ {01D3F1DE-99B3-4D41-97C3-F4680CDB980B} Win32Proj - QuantBox_Tdx_Trade + Tdx_Trade @@ -41,30 +41,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 +74,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,15 +82,17 @@ xcopy "$(SolutionDir)include\Tdx\win32\*.doc" "$(SolutionDir)XAPI\Tdx\x86\" /Y< true true true + ../../include/ApiHeader.def - - - + + + + @@ -98,18 +100,12 @@ xcopy "$(SolutionDir)include\Tdx\win32\*.doc" "$(SolutionDir)XAPI\Tdx\x86\" /Y< - - - - - 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 81% rename from QuantBox_Tdx_Trade/QuantBox_Tdx_Trade.vcxproj.filters rename to apis/Tdx_Trade/Tdx_Trade.vcxproj.filters index c094e00..c688033 100644 --- a/QuantBox_Tdx_Trade/QuantBox_Tdx_Trade.vcxproj.filters +++ b/apis/Tdx_Trade/Tdx_Trade.vcxproj.filters @@ -27,19 +27,22 @@ Header Files - - Header Files - Header Files Header Files - + + Header Files + + + Header Files + + Header Files - + Header Files @@ -56,16 +59,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..21f45a3 --- /dev/null +++ b/apis/Tdx_Trade/TraderApi.cpp @@ -0,0 +1,776 @@ +#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_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; + } + 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); + } + + 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::OnRespone(CTdxApi* pApi, RequestRespone_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->OnRespone_ReqUserLogin(pApi, pRespone); + break; + case REQUEST_WT: + case REQUEST_ETF_SGSH: + case REQUEST_ZGHS: + case REQUEST_WT_QQ: + pUser->OnRespone_ReqOrderInsert(pApi, pRespone); + break; + case REQUEST_CD: + pUser->OnRespone_ReqOrderAction(pApi, pRespone); + break; + case REQUEST_HQ: + OnRespone_Subscribe(pApi, pRespone); + break; + case REQUEST_GDLB: + pUser->OnRespone_ReqQryInvestor(pApi, pRespone); + break; + case REQUEST_DRWT: + pUser->OnRespone_ReqQryOrder(pApi, pRespone); + break; + case REQUEST_DRCJ: + pUser->OnRespone_ReqQryTrade(pApi, pRespone); + break; + case REQUEST_ZJYE: + pUser->OnRespone_ReqQryTradingAccount(pApi, pRespone); + break; + case REQUEST_GFLB: + pUser->OnRespone_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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } + else + { + m_msgQueue->Input_NoCopy(ResponeType::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; + + 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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Disconnected, 0, pField, sizeof(RspUserLoginField), nullptr, 0, nullptr, 0); + } + } + + DeleteError(pErr); + + return 0; +} + +void CTraderApi::StartQueryThread() +{ + // 启动定时查询功能使用 + m_msgQueue_Test->Input_Copy(ResponeType::ResponeType_OnRtnOrder, m_msgQueue_Test, this, 0, 0, nullptr, 0, nullptr, 0, nullptr, 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; + + 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); + RequestRespone_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) +{ + m_pIDGenerator = nullptr; + m_pApi = nullptr; + m_lRequestID = 0; + m_nSleep = 1; + + // 自己维护两个消息队列 + 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(); + + m_pDefaultUser = nullptr; +} + + +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::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->Exit(); + + m_pApi->Release(); + m_pApi = nullptr; + + // 全清理,只留最后一个 + if (m_msgQueue) + { + m_msgQueue->Clear(); + m_msgQueue->Input_NoCopy(ResponeType::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; + } +} + +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); + + RequestRespone_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; + } + + 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) + { + CSingleUser* pUser = Fill_UserID_Client(ppTdxOrders[i]->KHH, &ppTdxOrders[i]->Client); + + RequestRespone_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); + RequestRespone_STRUCT* pRequest = m_pApi->MakeQueryData(&query); + pRequest->pUserData_Public = pUser; + m_pApi->SendRequest(pRequest); + + return 0; +} + +int CTraderApi::OnRespone_Subscribe(CTdxApi* pApi, RequestRespone_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(ResponeType::ResponeType_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..0cb3236 --- /dev/null +++ b/apis/Tdx_Trade/TraderApi.h @@ -0,0 +1,186 @@ +#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/Queue_x64.lib") +#else +#pragma comment(lib, "../../include/Tdx/win32/TdxApi.lib") +#pragma comment(lib, "../../lib/Queue_x86.lib") +#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_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, + }; + +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 StartQueryThread(); + void RemoveUser(CSingleUser* pUser); + +private: + virtual void OnRespone(CTdxApi* pApi, RequestRespone_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 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 OnRespone_Subscribe(CTdxApi* pApi, RequestRespone_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; //发送消息队列指针 + 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; + + 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..1317081 --- /dev/null +++ b/apis/Tdx_Trade/TypeConvert.cpp @@ -0,0 +1,1047 @@ +#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" + +////////////////////////////////////////////////////////////////////////// +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; +} + +// 报价方式转,这是根据字符串的特点进行分类 +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; + } + } + + 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) +{ + *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_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); + + int col_166 = GetIndexByFieldID(ppFieldInfos, FIELD_WTFS); + int col_121 = GetIndexByFieldID(ppFieldInfos, FIELD_ZJZH); + + + for (int i = 0; i < count; ++i) + { + 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]); + if (col_166 >= 0) + strcpy_s(ppResults[i]->WTFS, ppTable[i * COL_EACH_ROW + col_166]); + if (col_121 >= 0) + strcpy_s(ppResults[i]->ZJZH, ppTable[i * COL_EACH_ROW + col_121]); + + 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]->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) +{ + *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; + + 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); + int col_121 = GetIndexByFieldID(ppFieldInfos, FIELD_ZJZH); + + 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]->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) +{ + *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; + + 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); + + for (int i = 0; i < count; ++i) + { + 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); + + ppResults[i]->Client = Client; + } +} + +void CharTable2ZJYE(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, ZJYE_STRUCT*** pppResults, void* Client) +{ + *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; + + 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]->Client = Client; + } +} + +void CharTable2HQ(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, HQ_STRUCT*** pppResults, void* Client) +{ + *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; + + 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]); + + + 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); + + // 还有一些信息没有 +} \ 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..61d9281 --- /dev/null +++ b/apis/Tdx_Trade/TypeConvert.h @@ -0,0 +1,37 @@ +#pragma once + +#include "../../include/ApiStruct.h" + +#include "../../include/Tdx/tdx_struct.h" + +// 两种情况: +// 1.完全重建 +// 2.部分重建 + +void CharTable2WTLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, WTLB_STRUCT*** pppResults, void* Client); + +void CharTable2CJLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, CJLB_STRUCT*** pppResults, void* Client); + +void CharTable2GFLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GFLB_STRUCT*** pppResults, void* Client); + +void CharTable2ZJYE(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, ZJYE_STRUCT*** pppResults, void* Client); + +void CharTable2HQ(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, HQ_STRUCT*** pppResults, void* Client); + +////////////////////////////////////////////////////////////////////////// + + +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_LTS_Quote_v2/dllmain.cpp b/apis/Tdx_Trade/dllmain.cpp similarity index 100% rename from QuantBox_LTS_Quote_v2/dllmain.cpp rename to apis/Tdx_Trade/dllmain.cpp 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..0ab3c62 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.3.0.20151212"; + 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/QuantBox_Tdx_Trade/targetver.h b/apis/Tdx_Trade/targetver.h similarity index 100% rename from QuantBox_Tdx_Trade/targetver.h rename to apis/Tdx_Trade/targetver.h 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..5972b57 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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_OnConnectionStatus, m_msgQueue, m_pClass, ConnectionStatus::ConnectionStatus_Initialized, 0, nullptr, 0, nullptr, 0, nullptr, 0); + m_msgQueue->Input_NoCopy(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_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(ResponeType::ResponeType_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 94% rename from QuantBox_TongShi_Quote/MdUserApi.h rename to apis/TongShi_Quote/MdUserApi.h index 9555c92..ee543e2 100644 --- a/QuantBox_TongShi_Quote/MdUserApi.h +++ b/apis/TongShi_Quote/MdUserApi.h @@ -2,16 +2,17 @@ #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") +#pragma comment(lib, "../../lib/Queue_x64.lib") #else -#pragma comment(lib, "../lib/QuantBox_Queue_x86.lib") +#pragma comment(lib, "../../lib/Queue_x86.lib") #endif #include @@ -56,11 +57,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 +85,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 82% rename from QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.vcxproj rename to apis/TongShi_Quote/TongShi_Quote.vcxproj index ba0ee99..93c7ccc 100644 --- a/QuantBox_TongShi_Quote/QuantBox_TongShi_Quote.vcxproj +++ b/apis/TongShi_Quote/TongShi_Quote.vcxproj @@ -12,7 +12,7 @@ {372C0D5E-ED93-4335-849C-65494AE8A17D} - QuantBox_TongShi_Quote + TongShi_Quote MFCDLLProj @@ -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 100% rename from QuantBox_TongShi_Quote/TypeConvert.cpp rename to apis/TongShi_Quote/TypeConvert.cpp 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/QuantBox_TongShi_Quote/targetver.h b/apis/TongShi_Quote/targetver.h similarity index 100% rename from QuantBox_TongShi_Quote/targetver.h rename to apis/TongShi_Quote/targetver.h diff --git a/QuantBox_XAPI/QuantBox_XAPI.vcxproj b/apis/UFX_Trade/UFX_Trade.vcxproj similarity index 84% rename from QuantBox_XAPI/QuantBox_XAPI.vcxproj rename to apis/UFX_Trade/UFX_Trade.vcxproj index 4057688..a528485 100644 --- a/QuantBox_XAPI/QuantBox_XAPI.vcxproj +++ b/apis/UFX_Trade/UFX_Trade.vcxproj @@ -11,9 +11,9 @@ - {39599EFE-428F-408F-BF4F-BF462E37C5E8} + {26C43947-9E7A-4B55-8A6D-A0F5222612AA} Win32Proj - QuantBox_XAPI + UFX_Trade @@ -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/clear.bat b/clear.bat index 2097cb9..85e86f1 100644 --- a/clear.bat +++ b/clear.bat @@ -1,100 +1,69 @@ 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\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\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..7c14460 --- /dev/null +++ b/common/License/License.cpp @@ -0,0 +1,608 @@ +#include "stdafx.h" +#include "License.h" + +#ifdef ENABLE_LICENSE + +#include +#include + +// BOOLEAN与asn.h中的冲突,不得不将asn.h中的改了,希望有人帮忙解决这个问题 +#include +#include +#pragma comment(lib, "IPHLPAPI.lib") + +#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..4975e5e --- /dev/null +++ b/common/License/License.vcxproj @@ -0,0 +1,103 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {D3231052-575C-4D58-BA38-2C01B10BF205} + Win32Proj + License + + + + Application + true + v120 + MultiByte + + + Application + false + v120 + 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/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..b005a83 --- /dev/null +++ b/common/License/stdafx.h @@ -0,0 +1,15 @@ +// 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 diff --git a/QuantBox_XAPI/targetver.h b/common/License/targetver.h similarity index 100% rename from QuantBox_XAPI/targetver.h rename to common/License/targetver.h 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/QuantBox_Queue/MsgQueue.cpp b/common/Queue/MsgQueue.cpp similarity index 57% rename from QuantBox_Queue/MsgQueue.cpp rename to common/Queue/MsgQueue.cpp index 50df4a4..64b75f1 100644 --- a/QuantBox_Queue/MsgQueue.cpp +++ b/common/Queue/MsgQueue.cpp @@ -29,21 +29,28 @@ void CMsgQueue::Clear() bool CMsgQueue::Process() { - ResponeItem* pItem = nullptr; - if (m_queue.try_dequeue(pItem)) + try { - Output(pItem); - if (pItem->bNeedDelete) + ResponeItem* pItem = nullptr; + if (m_queue.try_dequeue(pItem)) { - // 删除的是数组,目前是自己模块创建的自己删 - delete[] pItem->ptr1; - delete[] pItem->ptr2; - delete[] pItem->ptr3; + Output(pItem); + if (pItem->bNeedDelete) + { + // 删除的是数组,目前是自己模块创建的自己删 + delete[] pItem->ptr1; + delete[] pItem->ptr2; + delete[] pItem->ptr3; + } + delete pItem; + return true; } - delete pItem; - return true; + return false; + } + catch (...) + { + return false; } - return false; } void CMsgQueue::Output(ResponeItem* pItem) @@ -87,23 +94,33 @@ void CMsgQueue::StopThread() void CMsgQueue::RunInThread() { - while (m_bRunning) + try { - if (Process()) - { - } - else + while (m_bRunning) { - // 空闲时等1ms,如果立即有事件过来就晚了1ms - //this_thread::sleep_for(chrono::milliseconds(1)); + 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; }); + // 空闲时过来等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 (...) + { + } + // 清理线程 m_hThread = nullptr; m_bRunning = false; diff --git a/QuantBox_Queue/MsgQueue.h b/common/Queue/MsgQueue.h similarity index 95% rename from QuantBox_Queue/MsgQueue.h rename to common/Queue/MsgQueue.h index c528364..8a6cb0c 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" @@ -152,6 +152,7 @@ class DLL_PUBLIC CMsgQueue return; } ResponeItem* pItem = new ResponeItem; + //memset(pItem, 0, sizeof(ResponeItem)); pItem->bNeedDelete = true; pItem->type = type; @@ -183,6 +184,7 @@ class DLL_PUBLIC CMsgQueue return; } ResponeItem* pItem = new ResponeItem; + //memset(pItem, 0, sizeof(ResponeItem)); pItem->bNeedDelete = false; pItem->type = type; 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 53% rename from QuantBox_Queue/QuantBox_Queue.vcxproj rename to common/Queue/Queue.vcxproj index 438eca1..f0b6d2b 100644 --- a/QuantBox_Queue/QuantBox_Queue.vcxproj +++ b/common/Queue/Queue.vcxproj @@ -1,10 +1,6 @@  - - Debug64 - Win32 - Debug64 x64 @@ -13,23 +9,20 @@ Debug Win32 - - Debug + + Release64 x64 Release Win32 - - Release - x64 - {3A9173AA-92DB-49F9-88E3-09419C1D8E9F} Win32Proj - QuantBox_Queue + Queue + Queue @@ -38,18 +31,6 @@ v120 Unicode - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - DynamicLibrary true @@ -63,7 +44,7 @@ true Unicode - + DynamicLibrary false v120 @@ -76,48 +57,35 @@ - - - - - - - + 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) + ..\..\bin\$(Configuration)\$(PlatformTarget)\$(ProjectName) true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI - QuantBox_Queue_x64 + ..\..\bin\$(Configuration)\$(PlatformTarget)\$(ProjectName) + $(ProjectName)_$(PlatformTarget) 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) @@ -139,39 +107,10 @@ - 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 @@ -194,7 +133,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -206,14 +145,14 @@ - + Level3 Use MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTBOX_QUEUE_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;QUEUE_EXPORTS;BUILDING_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -221,60 +160,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 100% rename from QuantBox_Queue/RemoteQueue.h rename to common/Queue/RemoteQueue.h 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/QuantBox_LTS_Trade_v2/dllmain.cpp b/common/Queue/dllmain.cpp similarity index 100% rename from QuantBox_LTS_Trade_v2/dllmain.cpp rename to common/Queue/dllmain.cpp 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/QuantBox_XAPI_TEST/targetver.h b/common/Queue/targetver.h similarity index 100% rename from QuantBox_XAPI_TEST/targetver.h rename to common/Queue/targetver.h 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..79a13f2 --- /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同目录下

+ + \ 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..0576258 --- /dev/null +++ b/common/www/LicenseInfoReview.php @@ -0,0 +1,120 @@ +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')]); + +if( +($row[strtolower('Status')]<4) // 没有下载的可以直接审核 +||($row[strtolower('Status')]==4 && $t<$ReviewTimeLimit2) // 已经下载的一定时间内可以再审核 +||($_SESSION['Right']==99&& $t<$ReviewTimeLimit99) // 管理员一定时间内可以再审核 +) +{?> +
+

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

+

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/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..59b3b75 --- /dev/null +++ b/design.md @@ -0,0 +1,93 @@ +# 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。 diff --git a/include/ApiEnum.h b/include/ApiEnum.h index c686c91..ec12519 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中的值一样 @@ -179,6 +184,7 @@ enum InstrumentType :char InstrumentType_ETF, InstrumentType_MultiLeg, InstrumentType_Synthetic, + InstrumentType_LOF, ///多加LOF }; ////////////////////////////////////////////////////////////////////////// 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..762489d 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) @@ -46,8 +45,8 @@ struct ReqQueryField Int32Type Int32ID; ///一般是由API底层查询预留 - OrderIDType Char64RefID; - Int32Type Int32RefID; + OrderIDType Char64PositionIndex; + Int32Type Int32PositionIndex; }; ///持仓 @@ -384,6 +383,8 @@ struct DepthMarketDataNField SymbolType Symbol; ///合约代码 InstrumentIDType InstrumentID; + + ExchangeIDType ExchangeID; ///交易所代码,枚举类型,主要是用于过滤使用,效率比字符串比较要高 ExchangeType Exchange; diff --git a/include/CTP/win64/thostmduserapi.dll b/include/CTP/win64/thostmduserapi.dll new file mode 100644 index 0000000..aa65f46 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..032d1ee 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..4739b2c 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..5be84f0 Binary files /dev/null and b/include/CTP/win64/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/FeiShu/SgitFtdcMdApi.h b/include/FeiShu/SgitFtdcMdApi.h new file mode 100644 index 0000000..91a1ef3 --- /dev/null +++ b/include/FeiShu/SgitFtdcMdApi.h @@ -0,0 +1,118 @@ +///////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////// + +#if !defined(Sgit_FTDCMDAPI_H) +#define Sgit_FTDCMDAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "SgitFtdcUserApiStruct.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 CSgitFtdcMdSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param pErrMsg ԭ + virtual void OnFrontDisconnected(char *pErrMsg){}; + + ///¼Ӧ + virtual void OnRspUserLogin(CSgitFtdcRspUserLoginField *pRspUserLogin, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CSgitFtdcUserLogoutField *pUserLogout, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnDepthMarketData(CSgitFtdcDepthMarketDataField *pDepthMarketData) {}; +}; + +class MD_API_EXPORT CSgitFtdcMdApi +{ +public: + ///MdApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + static CSgitFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = ""); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + ///isLogged ʱʹtrueԴӡյϢ + virtual void Init(bool isLogged) = 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; + + /**öಥʱTCPҲҪ + *øúĬϲtcpģʽ + *öಥ MlCast://hostIP$multiaddress:port + *ֻһ MlCast://ANY$multiaddress:port + * @param szMlCastAddr ipַಥ鼰˿ + */ + virtual void SetMultiCastAddr(char *szMlCastAddr) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CSgitFtdcMdSpi *pSpi) = 0; + ///г + ///@param nResumeType شʽ + /// Sgit_TERT_RESTART:ӱտʼش + /// Sgit_TERT_RESUME:ϴյ + /// Sgit_TERT_QUICK:ֻ͵¼󹫹 + ///@remark ÷ҪInitǰá򲻻յݡ + virtual void SubscribeMarketTopic(Sgit_TE_RESUME_TYPE nResumeType) = 0; + + /// + /// 鶩 + /// @param iRequestID + /// @param pMBLQuotReq 鶩 + /// @return 0ʾɹ + /// @return ʾʧ + /// + virtual int SubQuot(CSgitSubQuotField *pSgitSubQuotField)=0; + ///;ָǰ,֪ͨǰÿԸԼ˽빫 + /// @return 0ʾɹ + /// @return μ + /// + virtual int Ready() = 0; + + ///û¼ + virtual int ReqUserLogin(CSgitFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + ///dz + virtual int ReqUserLogout(CSgitFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; +protected: + ~CSgitFtdcMdApi(){}; +}; + +#endif diff --git a/include/FeiShu/SgitFtdcTraderApi.h b/include/FeiShu/SgitFtdcTraderApi.h new file mode 100644 index 0000000..d5ce40f --- /dev/null +++ b/include/FeiShu/SgitFtdcTraderApi.h @@ -0,0 +1,204 @@ +///////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////// + +#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_TRADER_API_EXPORT +#define TRADER_API_EXPORT __declspec(dllexport) +#else +#define TRADER_API_EXPORT __declspec(dllimport) +#endif +#else +#define TRADER_API_EXPORT +#endif + +class CSgitFtdcTraderSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param pErrMsg ԭ + virtual void OnFrontDisconnected(char *pErrMsg){}; + + ///¼Ӧ + virtual void OnRspUserLogin(CSgitFtdcRspUserLoginField *pRspUserLogin, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CSgitFtdcUserLogoutField *pUserLogout, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ûӦ + virtual void OnRspUserPasswordUpdate(CSgitFtdcUserPasswordUpdateField *pUserPasswordUpdate, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspOrderInsert(CSgitFtdcInputOrderField *pInputOrder, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspOrderAction(CSgitFtdcInputOrderActionField *pInputOrderAction, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryOrder(CSgitFtdcOrderField *pOrder, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʽ˻Ӧ + virtual void OnRspQryTradingAccount(CSgitFtdcTradingAccountField *pTradingAccount, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶӦ + virtual void OnRspQryInvestor(CSgitFtdcInvestorField *pInvestor, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrument(CSgitFtdcInstrumentField *pInstrument, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnOrder(CSgitFtdcOrderField *pOrder,CSgitFtdcRspInfoField *pRspInfo) {}; + + ///ɽ֪ͨ + virtual void OnRtnTrade(CSgitFtdcTradeField *pTrade) {}; + + ///Լ״̬֪ͨ + virtual void OnRtnInstrumentStatus(CSgitFtdcInstrumentStatusField *pInstrumentStatus) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionDetail(CSgitFtdcInvestorPositionDetailField *pInvestorPositionDetail, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳Ӧ + virtual void OnRspQryInvestorPosition(CSgitFtdcInvestorPositionField *pInvestorPosition, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + /// յԼλѯӦʱصú + virtual void onRspMBLQuot(CSgitMBLQuotData *pMBLQuotData,CSgitFtdcRspInfoField *pRspMsg,int nRequestID,bool bIsLast){}; + + ///ѯɽӦ + virtual void OnRspQryTrade(CSgitFtdcTradeField *pTrade, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼ֤Ӧ + virtual void OnRspQryInstrumentMarginRate(CSgitFtdcInstrumentMarginRateField *pInstrumentMarginRate, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrumentCommissionRate(CSgitFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯױӦ + virtual void OnRspQryTradingCode(CSgitFtdcTradingCodeField *pTradingCode, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + +}; + +class TRADER_API_EXPORT CSgitFtdcTraderApi +{ +public: + ///TraderApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + static CSgitFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = ""); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + ///isLogged ʱʹtrueԴӡյϢ + virtual void Init(bool isLogged) = 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 pSpi Իصӿʵ + virtual void RegisterSpi(CSgitFtdcTraderSpi *pSpi) = 0; + + ///˽ + ///@param nResumeType ˽شʽ + /// Sgit_TERT_RESTART:ӱտʼش + /// Sgit_TERT_RESUME:ϴյ + /// Sgit_TERT_QUICK:ֻ͵¼˽ + ///@remark ÷ҪInitǰá򲻻յ˽ݡ + virtual void SubscribePrivateTopic(Sgit_TE_RESUME_TYPE nResumeType) = 0; + + ///Ĺ + ///@param nResumeType شʽ + /// Sgit_TERT_RESTART:ӱտʼش + /// Sgit_TERT_RESUME:ϴյ + /// Sgit_TERT_QUICK:ֻ͵¼󹫹 + ///@remark ÷ҪInitǰá򲻻յݡ + virtual void SubscribePublicTopic(Sgit_TE_RESUME_TYPE nResumeType) = 0; + + ///;ָǰ,֪ͨǰÿԸԼ˽빫 + /// @return 0ʾɹ + /// @return μ + /// + virtual int Ready() = 0; + + ///û¼ + virtual int ReqUserLogin(CSgitFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + ///dz + virtual int ReqUserLogout(CSgitFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; + + ///û + virtual int ReqUserPasswordUpdate(CSgitFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0; + + ///¼ + virtual int ReqOrderInsert(CSgitFtdcInputOrderField *pInputOrder, int nRequestID) = 0; + + /// + virtual int ReqOrderAction(CSgitFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryOrder(CSgitFtdcQryOrderField *pQryOrder, int nRequestID) = 0; + + ///ѯʽ˻ + virtual int ReqQryTradingAccount(CSgitFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0; + + ///ѯͶ + virtual int ReqQryInvestor(CSgitFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrument(CSgitFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionDetail(CSgitFtdcQryInvestorPositionDetailField *pQryInvestorPositionDetail, int nRequestID) = 0; + + ///ѯͶֲ߳ + virtual int ReqQryInvestorPosition(CSgitFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0; + + /// ͺԼλѯ + virtual int ReqMBLQuot(int iRequestID,CSgitMBLQuotReq *pMBLQuotReq) = 0; + + ///ѯɽ + virtual int ReqQryTrade(CSgitFtdcQryTradeField *pQryTrade, int nRequestID) = 0; + + ///ѯԼ֤ + virtual int ReqQryInstrumentMarginRate(CSgitFtdcQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrumentCommissionRate(CSgitFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0; + + ///ѯױ + virtual int ReqQryTradingCode(CSgitFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0; + +protected: + ~CSgitFtdcTraderApi(){}; +}; + +#endif diff --git a/include/FeiShu/SgitFtdcUserApiDataType.h b/include/FeiShu/SgitFtdcUserApiDataType.h new file mode 100644 index 0000000..e53d0ea --- /dev/null +++ b/include/FeiShu/SgitFtdcUserApiDataType.h @@ -0,0 +1,4818 @@ +///////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////// + +#ifndef Sgit_FTDCDATATYPE_H +#define Sgit_FTDCDATATYPE_H + +enum Sgit_TE_RESUME_TYPE +{ + Sgit_TERT_RESTART = 0, + Sgit_TERT_RESUME, + Sgit_TERT_QUICK +}; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcTraderIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDTypeһͶߴ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerAbbrTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBrokerAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerNameTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBrokerNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeInstIDTypeһԼڽĴ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOrderRefType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParticipantIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcParticipantIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserIDTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcUserIDType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPasswordType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcInstrumentIDType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarketIDTypeһг +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcMarketIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcProductNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcExchangeIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcExchangeNameType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeAbbrTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcExchangeAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcExchangeFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMacAddressTypeһMacַ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcMacAddressType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangePropertyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_EXP_Normal '0' +///ݳɽɱ +#define Sgit_FTDC_EXP_GenOrderByTrade '1' + +typedef char TSgitFtdcExchangePropertyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLongTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcLongTimeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcInstrumentNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSettlementGroupIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSysIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcTradeIDType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandTypeTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCommandTypeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPAddressTypeһIPַ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcIPAddressType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductInfoTypeһƷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcProductInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocolInfoTypeһЭϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcProtocolInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessUnitTypeһҵԪ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBusinessUnitType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepositSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcDepositSeqNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֯ +#define Sgit_FTDC_ICT_EID '0' +///֤ +#define Sgit_FTDC_ICT_IDCard '1' +///֤ +#define Sgit_FTDC_ICT_OfficerIDCard '2' +///֤ +#define Sgit_FTDC_ICT_PoliceIDCard '3' +///ʿ֤ +#define Sgit_FTDC_ICT_SoldierIDCard '4' +///ڲ +#define Sgit_FTDC_ICT_HouseholdRegister '5' +/// +#define Sgit_FTDC_ICT_Passport '6' +///̨֤ +#define Sgit_FTDC_ICT_TaiwanCompatriotIDCard '7' +///֤ +#define Sgit_FTDC_ICT_HomeComingCard '8' +///Ӫҵִպ +#define Sgit_FTDC_ICT_LicenseNo '9' +///˰ǼǺ +#define Sgit_FTDC_ICT_TaxNo 'A' +///֤ +#define Sgit_FTDC_ICT_OtherCard 'x' + +typedef char TSgitFtdcIdCardTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderLocalIDTypeһر +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOrderLocalIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserNameTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcUserNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPartyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPartyNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorMsgTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcErrorMsgType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldNameTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFieldNameType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldContentTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFieldContentType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemNameTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSystemNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContentTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcContentType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_IR_All '1' +///Ͷ +#define Sgit_FTDC_IR_Group '2' +///һͶ +#define Sgit_FTDC_IR_Single '3' + +typedef char TSgitFtdcInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepartmentRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_DR_All '1' +///ܹ֯ +#define Sgit_FTDC_DR_Group '2' +///һͶ +#define Sgit_FTDC_DR_Single '3' + +typedef char TSgitFtdcDepartmentRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataSyncStatusTypeһͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define Sgit_FTDC_DS_Asynchronous '1' +///ͬ +#define Sgit_FTDC_DS_Synchronizing '2' +///ͬ +#define Sgit_FTDC_DS_Synchronized '3' + +typedef char TSgitFtdcDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDataSyncStatusTypeһ͹˾ͬ״̬ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define Sgit_FTDC_BDS_Synchronized '1' +///ͬ +#define Sgit_FTDC_BDS_Synchronizing '2' + +typedef char TSgitFtdcBrokerDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeConnectStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define Sgit_FTDC_ECS_NoConnection '1' +///ѾԼѯ +#define Sgit_FTDC_ECS_QryInstrumentSent '2' +///ѾȡϢ +#define Sgit_FTDC_ECS_GotInformation '9' + +typedef char TSgitFtdcExchangeConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderConnectStatusTypeһԱ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define Sgit_FTDC_TCS_NotConnected '1' +///Ѿ +#define Sgit_FTDC_TCS_Connected '2' +///ѾԼѯ +#define Sgit_FTDC_TCS_QryInstrumentSent '3' +///˽ +#define Sgit_FTDC_TCS_SubPrivateFlow '4' + +typedef char TSgitFtdcTraderConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionCodeTypeһܴ +///////////////////////////////////////////////////////////////////////// +///첽 +#define Sgit_FTDC_FC_DataAsync '1' +///ǿûdz +#define Sgit_FTDC_FC_ForceUserLogout '2' +///û +#define Sgit_FTDC_FC_UserPasswordUpdate '3' +///͹˾ +#define Sgit_FTDC_FC_BrokerPasswordUpdate '4' +///Ͷ߿ +#define Sgit_FTDC_FC_InvestorPasswordUpdate '5' +/// +#define Sgit_FTDC_FC_OrderInsert '6' +/// +#define Sgit_FTDC_FC_OrderAction '7' +///ͬϵͳ +#define Sgit_FTDC_FC_SyncSystemData '8' +///ͬ͹˾ +#define Sgit_FTDC_FC_SyncBrokerData '9' +///ͬ͹˾ +#define Sgit_FTDC_FC_BachSyncBrokerData 'A' +///ѯ +#define Sgit_FTDC_FC_SuperQuery 'B' +/// +#define Sgit_FTDC_FC_ParkedOrderInsert 'C' +/// +#define Sgit_FTDC_FC_ParkedOrderAction 'D' +///̬ͬ +#define Sgit_FTDC_FC_SyncOTP 'E' + +typedef char TSgitFtdcFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerFunctionCodeTypeһ͹˾ܴ +///////////////////////////////////////////////////////////////////////// +///ǿûdz +#define Sgit_FTDC_BFC_ForceUserLogout '1' +///û +#define Sgit_FTDC_BFC_UserPasswordUpdate '2' +///ͬ͹˾ +#define Sgit_FTDC_BFC_SyncBrokerData '3' +///ͬ͹˾ +#define Sgit_FTDC_BFC_BachSyncBrokerData '4' +/// +#define Sgit_FTDC_BFC_OrderInsert '5' +/// +#define Sgit_FTDC_BFC_OrderAction '6' +///ȫѯ +#define Sgit_FTDC_BFC_AllQuery '7' +///ϵͳܣ/dz/޸ +#define Sgit_FTDC_BFC_log 'a' +///ѯѯݣԼȳ +#define Sgit_FTDC_BFC_BaseQry 'b' +///ײѯɽί +#define Sgit_FTDC_BFC_TradeQry 'c' +///׹ܣ +#define Sgit_FTDC_BFC_Trade 'd' +///ת +#define Sgit_FTDC_BFC_Virement 'e' +///ռ +#define Sgit_FTDC_BFC_Risk 'f' +///ѯ/ѯỰ˵ +#define Sgit_FTDC_BFC_Session 'g' +///֪ͨ +#define Sgit_FTDC_BFC_RiskNoticeCtl 'h' +///֪ͨ +#define Sgit_FTDC_BFC_RiskNotice 'i' +///쿴͹˾ʽȨ +#define Sgit_FTDC_BFC_BrokerDeposit 'j' +///ʽѯ +#define Sgit_FTDC_BFC_QueryFund 'k' +///ѯ +#define Sgit_FTDC_BFC_QueryOrder 'l' +///ɽѯ +#define Sgit_FTDC_BFC_QueryTrade 'm' +///ֲֲѯ +#define Sgit_FTDC_BFC_QueryPosition 'n' +///ѯ +#define Sgit_FTDC_BFC_QueryMarketData 'o' +///û¼ѯ +#define Sgit_FTDC_BFC_QueryUserEvent 'p' +///֪ͨѯ +#define Sgit_FTDC_BFC_QueryRiskNotify 'q' +///ѯ +#define Sgit_FTDC_BFC_QueryFundChange 'r' +///ͶϢѯ +#define Sgit_FTDC_BFC_QueryInvestor 's' +///ױѯ +#define Sgit_FTDC_BFC_QueryTradingCode 't' +///ǿƽ +#define Sgit_FTDC_BFC_ForceClose 'u' +///ѹ +#define Sgit_FTDC_BFC_PressTest 'v' +///Ȩ淴 +#define Sgit_FTDC_BFC_RemainCalc 'w' +///ֱֲָ֤ +#define Sgit_FTDC_BFC_NetPositionInd 'x' +///Ԥ +#define Sgit_FTDC_BFC_RiskPredict 'y' +///ݵ +#define Sgit_FTDC_BFC_DataExport 'z' +///ָ +#define Sgit_FTDC_BFC_RiskTargetSetup 'A' +///Ԥ +#define Sgit_FTDC_BFC_MarketDataWarn 'B' +///ҵ֪ͨѯ +#define Sgit_FTDC_BFC_QryBizNotice 'C' +///ҵ֪ͨģ +#define Sgit_FTDC_BFC_CfgBizNotice 'D' +///̬ͬ +#define Sgit_FTDC_BFC_SyncOTP 'E' +///ҵ֪ͨ +#define Sgit_FTDC_BFC_SendBizNotice 'F' +///ռ׼ +#define Sgit_FTDC_BFC_CfgRiskLevelStd 'G' + +typedef char TSgitFtdcBrokerFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define Sgit_FTDC_OAS_Submitted 'a' +///Ѿ +#define Sgit_FTDC_OAS_Accepted 'b' +///Ѿܾ +#define Sgit_FTDC_OAS_Rejected 'c' + +typedef char TSgitFtdcOrderActionStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ȫɽ +#define Sgit_FTDC_OST_AllTraded '0' +///ֳɽڶ +#define Sgit_FTDC_OST_PartTradedQueueing '1' +///ֳɽڶ +#define Sgit_FTDC_OST_PartTradedNotQueueing '2' +///δɽڶ +#define Sgit_FTDC_OST_NoTradeQueueing '3' +///δɽڶ +#define Sgit_FTDC_OST_NoTradeNotQueueing '4' +/// +#define Sgit_FTDC_OST_Canceled '5' +///δ֪ +#define Sgit_FTDC_OST_Unknown 'a' +///δ +#define Sgit_FTDC_OST_NotTouched 'b' +///Ѵ +#define Sgit_FTDC_OST_Touched 'c' + +typedef char TSgitFtdcOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSubmitStatusTypeһύ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define Sgit_FTDC_OSS_InsertSubmitted '0' +///Ѿύ +#define Sgit_FTDC_OSS_CancelSubmitted '1' +///޸Ѿύ +#define Sgit_FTDC_OSS_ModifySubmitted '2' +///Ѿ +#define Sgit_FTDC_OSS_Accepted '3' +///Ѿܾ +#define Sgit_FTDC_OSS_InsertRejected '4' +///Ѿܾ +#define Sgit_FTDC_OSS_CancelRejected '5' +///ĵѾܾ +#define Sgit_FTDC_OSS_ModifyRejected '6' + +typedef char TSgitFtdcOrderSubmitStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ճֲ +#define Sgit_FTDC_PSD_Today '1' +///ʷֲ +#define Sgit_FTDC_PSD_History '2' + +typedef char TSgitFtdcPositionDateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ʹʷֲ +#define Sgit_FTDC_PDT_UseHistory '1' +///ʹʷֲ +#define Sgit_FTDC_PDT_NoUseHistory '2' + +typedef char TSgitFtdcPositionDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRoleTypeһ׽ɫ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_ER_Broker '1' +///Ӫ +#define Sgit_FTDC_ER_Host '2' +/// +#define Sgit_FTDC_ER_Maker '3' + +typedef char TSgitFtdcTradingRoleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define Sgit_FTDC_PC_Futures '1' +///Ȩ +#define Sgit_FTDC_PC_Options '2' +/// +#define Sgit_FTDC_PC_Combination '3' +/// +#define Sgit_FTDC_PC_Spot '4' +///ת +#define Sgit_FTDC_PC_EFP '5' + +typedef char TSgitFtdcProductClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define Sgit_FTDC_IP_NotStart '0' +/// +#define Sgit_FTDC_IP_Started '1' +///ͣ +#define Sgit_FTDC_IP_Pause '2' +/// +#define Sgit_FTDC_IP_Expired '3' + +typedef char TSgitFtdcInstLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_D_Buy '0' +/// +#define Sgit_FTDC_D_Sell '1' + +typedef char TSgitFtdcDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ֲ +#define Sgit_FTDC_PT_Net '1' +///ۺϳֲ +#define Sgit_FTDC_PT_Gross '2' + +typedef char TSgitFtdcPositionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosiDirectionTypeһֲֶշ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_PD_Net '1' +///ͷ +#define Sgit_FTDC_PD_Long '2' +///ͷ +#define Sgit_FTDC_PD_Short '3' + +typedef char TSgitFtdcPosiDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysSettlementStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define Sgit_FTDC_SS_NonActive '1' +/// +#define Sgit_FTDC_SS_Startup '2' +/// +#define Sgit_FTDC_SS_Operating '3' +/// +#define Sgit_FTDC_SS_Settlement '4' +/// +#define Sgit_FTDC_SS_SettlementFinished '5' + +typedef char TSgitFtdcSysSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioAttrTypeһ +///////////////////////////////////////////////////////////////////////// +///׷ +#define Sgit_FTDC_RA_Trade '0' +/// +#define Sgit_FTDC_RA_Settlement '1' + +typedef char TSgitFtdcRatioAttrType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define Sgit_FTDC_HF_Speculation '1' +/// +#define Sgit_FTDC_HF_Arbitrage '2' +///ױ +#define Sgit_FTDC_HF_Hedge '3' + +typedef char TSgitFtdcHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define Sgit_FTDC_BHF_Speculation '1' +/// +#define Sgit_FTDC_BHF_Arbitrage '2' +///ױ +#define Sgit_FTDC_BHF_Hedge '3' + +typedef char TSgitFtdcBillHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define Sgit_FTDC_CIDT_Speculation '1' +/// +#define Sgit_FTDC_CIDT_Arbitrage '2' +///ױ +#define Sgit_FTDC_CIDT_Hedge '3' + +typedef char TSgitFtdcClientIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderPriceTypeTypeһ۸ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_OPT_AnyPrice '1' +///޼ +#define Sgit_FTDC_OPT_LimitPrice '2' +///ż +#define Sgit_FTDC_OPT_BestPrice '3' +///¼ +#define Sgit_FTDC_OPT_LastPrice '4' +///¼۸ϸ1ticks +#define Sgit_FTDC_OPT_LastPricePlusOneTicks '5' +///¼۸ϸ2ticks +#define Sgit_FTDC_OPT_LastPricePlusTwoTicks '6' +///¼۸ϸ3ticks +#define Sgit_FTDC_OPT_LastPricePlusThreeTicks '7' +///һ +#define Sgit_FTDC_OPT_AskPrice1 '8' +///һ۸ϸ1ticks +#define Sgit_FTDC_OPT_AskPrice1PlusOneTicks '9' +///һ۸ϸ2ticks +#define Sgit_FTDC_OPT_AskPrice1PlusTwoTicks 'A' +///һ۸ϸ3ticks +#define Sgit_FTDC_OPT_AskPrice1PlusThreeTicks 'B' +///һ +#define Sgit_FTDC_OPT_BidPrice1 'C' +///һ۸ϸ1ticks +#define Sgit_FTDC_OPT_BidPrice1PlusOneTicks 'D' +///һ۸ϸ2ticks +#define Sgit_FTDC_OPT_BidPrice1PlusTwoTicks 'E' +///һ۸ϸ3ticks +#define Sgit_FTDC_OPT_BidPrice1PlusThreeTicks 'F' + +typedef char TSgitFtdcOrderPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_OF_Open '0' +///ƽ +#define Sgit_FTDC_OF_Close '1' +///ǿƽ +#define Sgit_FTDC_OF_ForceClose '2' +///ƽ +#define Sgit_FTDC_OF_CloseToday '3' +///ƽ +#define Sgit_FTDC_OF_CloseYesterday '4' +///ǿ +#define Sgit_FTDC_OF_ForceOff '5' +///ǿƽ +#define Sgit_FTDC_OF_LocalForceClose '6' + +typedef char TSgitFtdcOffsetFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseReasonTypeһǿƽԭ +///////////////////////////////////////////////////////////////////////// +///ǿƽ +#define Sgit_FTDC_FCC_NotForceClose '0' +///ʽ +#define Sgit_FTDC_FCC_LackDeposit '1' +///ͻ +#define Sgit_FTDC_FCC_ClientOverPositionLimit '2' +///Ա +#define Sgit_FTDC_FCC_MemberOverPositionLimit '3' +///ֲַ +#define Sgit_FTDC_FCC_NotMultiple '4' +///Υ +#define Sgit_FTDC_FCC_Violation '5' +/// +#define Sgit_FTDC_FCC_Other '6' +///Ȼٽ +#define Sgit_FTDC_FCC_PersonDeliv '7' + +typedef char TSgitFtdcForceCloseReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_ORDT_Normal '0' +/// +#define Sgit_FTDC_ORDT_DeriveFromQuote '1' +/// +#define Sgit_FTDC_ORDT_DeriveFromCombination '2' +///ϱ +#define Sgit_FTDC_ORDT_Combination '3' +/// +#define Sgit_FTDC_ORDT_ConditionalOrder '4' +/// +#define Sgit_FTDC_ORDT_Swap '5' + +typedef char TSgitFtdcOrderTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeConditionTypeһЧ +///////////////////////////////////////////////////////////////////////// +///ɣ +#define Sgit_FTDC_TC_IOC '1' +///Ч +#define Sgit_FTDC_TC_GFS '2' +///Ч +#define Sgit_FTDC_TC_GFD '3' +///ָǰЧ +#define Sgit_FTDC_TC_GTD '4' +///ǰЧ +#define Sgit_FTDC_TC_GTC '5' +///ϾЧ +#define Sgit_FTDC_TC_GFA '6' + +typedef char TSgitFtdcTimeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeConditionTypeһɽ +///////////////////////////////////////////////////////////////////////// +///κ +#define Sgit_FTDC_VC_AV '1' +///С +#define Sgit_FTDC_VC_MV '2' +///ȫ +#define Sgit_FTDC_VC_CV '3' + +typedef char TSgitFtdcVolumeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContingentConditionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_CC_Immediately '1' +///ֹ +#define Sgit_FTDC_CC_Touch '2' +///ֹӮ +#define Sgit_FTDC_CC_TouchProfit '3' +///Ԥ +#define Sgit_FTDC_CC_ParkedOrder '4' +///¼۴ +#define Sgit_FTDC_CC_LastPriceGreaterThanStopPrice '5' +///¼۴ڵ +#define Sgit_FTDC_CC_LastPriceGreaterEqualStopPrice '6' +///¼С +#define Sgit_FTDC_CC_LastPriceLesserThanStopPrice '7' +///¼Сڵ +#define Sgit_FTDC_CC_LastPriceLesserEqualStopPrice '8' +///һ۴ +#define Sgit_FTDC_CC_AskPriceGreaterThanStopPrice '9' +///һ۴ڵ +#define Sgit_FTDC_CC_AskPriceGreaterEqualStopPrice 'A' +///һС +#define Sgit_FTDC_CC_AskPriceLesserThanStopPrice 'B' +///һСڵ +#define Sgit_FTDC_CC_AskPriceLesserEqualStopPrice 'C' +///һ۴ +#define Sgit_FTDC_CC_BidPriceGreaterThanStopPrice 'D' +///һ۴ڵ +#define Sgit_FTDC_CC_BidPriceGreaterEqualStopPrice 'E' +///һС +#define Sgit_FTDC_CC_BidPriceLesserThanStopPrice 'F' +///һСڵ +#define Sgit_FTDC_CC_BidPriceLesserEqualStopPrice 'H' + +typedef char TSgitFtdcContingentConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +///ɾ +#define Sgit_FTDC_AF_Delete '0' +///޸ +#define Sgit_FTDC_AF_Modify '3' + +typedef char TSgitFtdcActionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRightTypeһȨ +///////////////////////////////////////////////////////////////////////// +///Խ +#define Sgit_FTDC_TR_Allow '0' +///ֻƽ +#define Sgit_FTDC_TR_CloseOnly '1' +///ܽ +#define Sgit_FTDC_TR_Forbidden '2' + +typedef char TSgitFtdcTradingRightType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///Բ +#define Sgit_FTDC_OSRC_Participant '0' +///ԹԱ +#define Sgit_FTDC_OSRC_Administrator '1' + +typedef char TSgitFtdcOrderSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTypeTypeһɽ +///////////////////////////////////////////////////////////////////////// +///ͨɽ +#define Sgit_FTDC_TRDT_Common '0' +///Ȩִ +#define Sgit_FTDC_TRDT_OptionsExecution '1' +///OTCɽ +#define Sgit_FTDC_TRDT_OTC '2' +///תɽ +#define Sgit_FTDC_TRDT_EFPDerived '3' +///ɽ +#define Sgit_FTDC_TRDT_CombinationDerived '4' + +typedef char TSgitFtdcTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///ǰɽ +#define Sgit_FTDC_PSRC_LastPrice '0' +///ίм +#define Sgit_FTDC_PSRC_Buy '1' +///ίм +#define Sgit_FTDC_PSRC_Sell '2' + +typedef char TSgitFtdcPriceSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentStatusTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define Sgit_FTDC_IS_BeforeTrading '0' +///ǽ +#define Sgit_FTDC_IS_NoTrading '1' +/// +#define Sgit_FTDC_IS_Continous '2' +///Ͼ۱ +#define Sgit_FTDC_IS_AuctionOrdering '3' +///Ͼۼ۸ƽ +#define Sgit_FTDC_IS_AuctionBalance '4' +///Ͼ۴ +#define Sgit_FTDC_IS_AuctionMatch '5' +/// +#define Sgit_FTDC_IS_Closed '6' + +typedef char TSgitFtdcInstrumentStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstStatusEnterReasonTypeһƷֽ뽻״̬ԭ +///////////////////////////////////////////////////////////////////////// +///Զл +#define Sgit_FTDC_IER_Automatic '1' +///ֶл +#define Sgit_FTDC_IER_Manual '2' +///۶ +#define Sgit_FTDC_IER_Fuse '3' + +typedef char TSgitFtdcInstStatusEnterReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcOrderActionRefType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallCountTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcInstallCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallIDTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcInstallIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcErrorIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcSettlementIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFrontIDTypeһǰñ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcFrontIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSessionIDTypeһỰ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcSessionIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcSequenceNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandNoTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcCommandNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMillisecTypeһʱ䣨룩 +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcMillisecType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeMultipleTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcVolumeMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingSegmentSNTypeһ׽׶α +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcTradingSegmentSNType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRequestIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYearTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcYearType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcMonthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBoolTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcBoolType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombOffsetFlagTypeһϿƽ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCombOffsetFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCombHedgeFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcRatioType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLargeVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcLargeVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceSeriesTypeһϵк +///////////////////////////////////////////////////////////////////////// +typedef short TSgitFtdcSequenceSeriesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommPhaseNoTypeһͨѶʱα +///////////////////////////////////////////////////////////////////////// +typedef short TSgitFtdcCommPhaseNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceLabelTypeһб +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSequenceLabelType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContractCodeTypeһͬ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcContractCodeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCityTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCityType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsStockTypeһǷ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcIsStockType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcChannelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcChannelType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddressTypeһͨѶַ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAddressType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcZipCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcZipCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTelephoneTypeһϵ绰 +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcTelephoneType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFaxTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFaxType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobileTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcMobileType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEMailTypeһʼ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcEMailType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMemoTypeһע +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcMemoType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyCodeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCompanyCodeType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWebsiteTypeһվַ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcWebsiteType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTaxNoTypeһ˰ǼǺ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcTaxNoType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBatchStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δϴ +#define Sgit_FTDC_BS_NoUpload '1' +///ϴ +#define Sgit_FTDC_BS_Uploaded '2' +///ʧ +#define Sgit_FTDC_BS_Failed '3' + +typedef char TSgitFtdcBatchStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyIDTypeһԴ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPropertyIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPropertyNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNoTypeһӪҵִպ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcLicenseNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentIDTypeһ˴ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAgentIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAgentNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAgentGroupIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAgentGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStyleTypeһƷַʽ +///////////////////////////////////////////////////////////////////////// +///Ʒ +#define Sgit_FTDC_RS_All '1' +///Ʒ +#define Sgit_FTDC_RS_ByProduct '2' + +typedef char TSgitFtdcReturnStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnPatternTypeһģʽ +///////////////////////////////////////////////////////////////////////// +///ɽ +#define Sgit_FTDC_RP_ByVolume '1' +/// +#define Sgit_FTDC_RP_ByFeeOnHand '2' + +typedef char TSgitFtdcReturnPatternType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///1 +#define Sgit_FTDC_RL_Level1 '1' +///2 +#define Sgit_FTDC_RL_Level2 '2' +///3 +#define Sgit_FTDC_RL_Level3 '3' +///4 +#define Sgit_FTDC_RL_Level4 '4' +///5 +#define Sgit_FTDC_RL_Level5 '5' +///6 +#define Sgit_FTDC_RL_Level6 '6' +///7 +#define Sgit_FTDC_RL_Level7 '7' +///8 +#define Sgit_FTDC_RL_Level8 '8' +///9 +#define Sgit_FTDC_RL_Level9 '9' + +typedef char TSgitFtdcReturnLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStandardTypeһ׼ +///////////////////////////////////////////////////////////////////////// +///ֽ׶η +#define Sgit_FTDC_RSD_ByPeriod '1' +///ijһ׼ +#define Sgit_FTDC_RSD_ByStandard '2' + +typedef char TSgitFtdcReturnStandardType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMortgageTypeTypeһѺ +///////////////////////////////////////////////////////////////////////// +///ʳ +#define Sgit_FTDC_MT_Out '0' +/// +#define Sgit_FTDC_MT_In '1' + +typedef char TSgitFtdcMortgageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorSettlementParamIDTypeһͶ߽ +///////////////////////////////////////////////////////////////////////// +///֤ +#define Sgit_FTDC_ISPI_BaseMargin '1' +///Ȩ׼ +#define Sgit_FTDC_ISPI_LowestInterest '2' +///Ѻ +#define Sgit_FTDC_ISPI_MortgageRatio '4' +///֤㷨 +#define Sgit_FTDC_ISPI_MarginWay '5' +///㵥()Ȩڽ +#define Sgit_FTDC_ISPI_BillDeposit '9' + +typedef char TSgitFtdcInvestorSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeSettlementParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define Sgit_FTDC_ESPI_MortgageRatio '1' +///ʽ +#define Sgit_FTDC_ESPI_OtherFundItem '2' +///ʽ뽻 +#define Sgit_FTDC_ESPI_OtherFundImport '3' +///ȡʽ +#define Sgit_FTDC_ESPI_SHFEDelivFee '4' +///ȡʽ +#define Sgit_FTDC_ESPI_DCEDelivFee '5' +///нͿý +#define Sgit_FTDC_ESPI_CFFEXMinPrepa '6' + +typedef char TSgitFtdcExchangeSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ͶߴС +#define Sgit_FTDC_SPI_InvestorIDMinLength '1' +///ͶʺŴС +#define Sgit_FTDC_SPI_AccountIDMinLength '2' +///Ͷ߿Ĭϵ¼Ȩ +#define Sgit_FTDC_SPI_UserRightLogon '3' +///Ͷ߽׽㵥ɽܷʽ +#define Sgit_FTDC_SPI_SettlementBillTrade '4' +///ͳһ½ױ뷽ʽ +#define Sgit_FTDC_SPI_TradingCode '5' +///Ƿжϴδ˵ijͷʽ +#define Sgit_FTDC_SPI_CheckFund '6' +///ǷģȨ +#define Sgit_FTDC_SPI_CommModelRight '7' +///Ƿ淶ûܼ +#define Sgit_FTDC_SPI_IsStandardActive '8' +///ϴĽļ· +#define Sgit_FTDC_SPI_UploadSettlementFile 'U' +///ϱ֤ļ· +#define Sgit_FTDC_SPI_DownloadCSRCFile 'D' +///ɵĽ㵥ļ· +#define Sgit_FTDC_SPI_SettlementBillFile 'S' +///֤ļʶ +#define Sgit_FTDC_SPI_CSRCOthersFile 'C' +///ͶƬ· +#define Sgit_FTDC_SPI_InvestorPhoto 'P' +///ȫᾭ͹˾ϴļ· +#define Sgit_FTDC_SPI_CSRCData 'R' +///¼뷽ʽ +#define Sgit_FTDC_SPI_InvestorPwdModel 'I' +///Ͷнļ· +#define Sgit_FTDC_SPI_CFFEXInvestorSettleFile 'F' +///Ͷߴ뷽ʽ +#define Sgit_FTDC_SPI_InvestorIDType 'a' + +typedef char TSgitFtdcSystemParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ϵͳ㷨 +#define Sgit_FTDC_TPID_EncryptionStandard 'E' +///ϵͳ㷨 +#define Sgit_FTDC_TPID_RiskMode 'R' +///ϵͳ㷨Ƿȫ 0- 1- +#define Sgit_FTDC_TPID_RiskModeGlobal 'G' + +typedef char TSgitFtdcTradeParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSettlementParamValueType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCounterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCounterIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorGroupNameTypeһͶ߷ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcInvestorGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrandCodeTypeһƺ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBrandCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWarehouseTypeһֿ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcWarehouseType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcProductDateType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGradeTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcGradeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClassifyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcClassifyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPositionType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYieldlyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcYieldlyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWeightTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcWeightType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubEntryFundNoTypeһʽˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcSubEntryFundNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileIDTypeһļʶ +///////////////////////////////////////////////////////////////////////// +///ʽ +#define Sgit_FTDC_FI_SettlementFund 'F' +///ɽ +#define Sgit_FTDC_FI_Trade 'T' +///Ͷֲ߳ +#define Sgit_FTDC_FI_InvestorPosition 'P' +///Ͷ߷ʽ +#define Sgit_FTDC_FI_SubEntryFund 'O' +///֣ϳֲ +#define Sgit_FTDC_FI_CZCECombinationPos 'C' +///ϱ֤ +#define Sgit_FTDC_FI_CSRCData 'R' + +typedef char TSgitFtdcFileIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileTypeTypeһļϴ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_FUT_Settlement '0' +///˶ +#define Sgit_FTDC_FUT_Check '1' + +typedef char TSgitFtdcFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileFormatTypeһļʽ +///////////////////////////////////////////////////////////////////////// +///ıļ(.txt) +#define Sgit_FTDC_FFT_Txt '0' +///ѹļ(.zip) +#define Sgit_FTDC_FFT_Zip '1' +///DBFļ(.dbf) +#define Sgit_FTDC_FFT_DBF '2' + +typedef char TSgitFtdcFileFormatType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileUploadStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///ϴɹ +#define Sgit_FTDC_FUS_SucceedUpload '1' +///ϴʧ +#define Sgit_FTDC_FUS_FailedUpload '2' +///ɹ +#define Sgit_FTDC_FUS_SucceedLoad '3' +///벿ֳɹ +#define Sgit_FTDC_FUS_PartSucceedLoad '4' +///ʧ +#define Sgit_FTDC_FUS_FailedLoad '5' + +typedef char TSgitFtdcFileUploadStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferDirectionTypeһƲַ +///////////////////////////////////////////////////////////////////////// +///Ƴ +#define Sgit_FTDC_TD_Out '0' +/// +#define Sgit_FTDC_TD_In '1' + +typedef char TSgitFtdcTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUploadModeTypeһϴļ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcUploadModeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountIDTypeһͶʺ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAccountIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankFlagTypeһͳһʶ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_BF_ICBC '1' +///ũҵ +#define Sgit_FTDC_BF_ABC '2' +///й +#define Sgit_FTDC_BF_BC '3' +/// +#define Sgit_FTDC_BF_CBC '4' +///ͨ +#define Sgit_FTDC_BF_BOC '5' +/// +#define Sgit_FTDC_BF_Other 'Z' + +typedef char TSgitFtdcBankFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankAccountType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenNameTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOpenNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenBankTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOpenBankType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishPathTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPublishPathType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOperatorIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthCountTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcMonthCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAdvanceMonthArrayTypeһ·ǰ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAdvanceMonthArrayType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateExprTypeһڱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcDateExprType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDExprTypeһԼʽ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcInstrumentIDExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameExprTypeһԼƱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcInstrumentNameExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSpecialCreateRuleTypeһĴ +///////////////////////////////////////////////////////////////////////// +///ûⴴ +#define Sgit_FTDC_SC_NoSpecialRule '0' +/// +#define Sgit_FTDC_SC_NoSpringFestival '1' + +typedef char TSgitFtdcSpecialCreateRuleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBasisPriceTypeTypeһƻ׼ +///////////////////////////////////////////////////////////////////////// +///һԼ +#define Sgit_FTDC_IPT_LastSettlement '1' +///һԼ̼ +#define Sgit_FTDC_IPT_LaseClose '2' + +typedef char TSgitFtdcBasisPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductLifePhaseTypeһƷ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define Sgit_FTDC_PLP_Active '1' +///Ծ +#define Sgit_FTDC_PLP_NonActive '2' +///ע +#define Sgit_FTDC_PLP_Canceled '3' + +typedef char TSgitFtdcProductLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeliveryModeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ֽ𽻸 +#define Sgit_FTDC_DM_CashDeliv '1' +///ʵサ +#define Sgit_FTDC_DM_CommodityDeliv '2' + +typedef char TSgitFtdcDeliveryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLogLevelTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcLogLevelType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessNameTypeһ洢 +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcProcessNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperationMemoTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOperationMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_FIOT_FundIO '1' +///ת +#define Sgit_FTDC_FIOT_Transfer '2' + +typedef char TSgitFtdcFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///д +#define Sgit_FTDC_FT_Deposite '1' +///ʽ +#define Sgit_FTDC_FT_ItemFund '2' +///˾ +#define Sgit_FTDC_FT_Company '3' + +typedef char TSgitFtdcFundTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_FD_In '1' +/// +#define Sgit_FTDC_FD_Out '2' + +typedef char TSgitFtdcFundDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundStatusTypeһʽ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define Sgit_FTDC_FS_Record '1' +///Ѹ +#define Sgit_FTDC_FS_Check '2' +///ѳ +#define Sgit_FTDC_FS_Charge '3' + +typedef char TSgitFtdcFundStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNoTypeһƱݺ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBillNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNameTypeһƱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBillNameType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define Sgit_FTDC_PS_None '1' +///ڷ +#define Sgit_FTDC_PS_Publishing '2' +///ѷ +#define Sgit_FTDC_PS_Published '3' + +typedef char TSgitFtdcPublishStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueIDTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcEnumValueIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueTypeTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcEnumValueTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueLabelTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcEnumValueLabelType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueResultTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcEnumValueResultType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define Sgit_FTDC_ES_NonActive '1' +/// +#define Sgit_FTDC_ES_Startup '2' +///׿ʼʼ +#define Sgit_FTDC_ES_Initialize '3' +///ɳʼ +#define Sgit_FTDC_ES_Initialized '4' +///пʼ +#define Sgit_FTDC_ES_Close '5' +/// +#define Sgit_FTDC_ES_Closed '6' +/// +#define Sgit_FTDC_ES_Settlement '7' + +typedef char TSgitFtdcSystemStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ʼ +#define Sgit_FTDC_STS_Initialize '0' +/// +#define Sgit_FTDC_STS_Settlementing '1' +///ѽ +#define Sgit_FTDC_STS_Settlemented '2' +/// +#define Sgit_FTDC_STS_Finished '3' + +typedef char TSgitFtdcSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntTypeTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRangeIntTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntFromTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRangeIntFromType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntToTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRangeIntToType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionIDTypeһܴ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFunctionIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionValueCodeTypeһܱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFunctionValueCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFunctionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleIDTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRoleIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleNameTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRoleNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescriptionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcDescriptionType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineIDTypeһϱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCombineIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCombineTypeType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define Sgit_FTDC_CT_Person '0' +/// +#define Sgit_FTDC_CT_Company '1' +///Ͷʻ +#define Sgit_FTDC_CT_Fund '2' + +typedef char TSgitFtdcInvestorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerTypeTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +///׻Ա +#define Sgit_FTDC_BT_Trade '0' +///׽Ա +#define Sgit_FTDC_BT_TradeSettle '1' + +typedef char TSgitFtdcBrokerTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskLevelTypeһյȼ +///////////////////////////////////////////////////////////////////////// +///ͷտͻ +#define Sgit_FTDC_FAS_Low '1' +///ͨͻ +#define Sgit_FTDC_FAS_Normal '2' +///עͻ +#define Sgit_FTDC_FAS_Focus '3' +///տͻ +#define Sgit_FTDC_FAS_Risk '4' + +typedef char TSgitFtdcRiskLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeeAcceptStyleTypeһȡʽ +///////////////////////////////////////////////////////////////////////// +///ȡ +#define Sgit_FTDC_FAS_ByTrade '1' +///ȡ +#define Sgit_FTDC_FAS_ByDeliv '2' +/// +#define Sgit_FTDC_FAS_None '3' +///ָȡ +#define Sgit_FTDC_FAS_FixFee '4' + +typedef char TSgitFtdcFeeAcceptStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_PWDT_Trade '1' +///ʽ +#define Sgit_FTDC_PWDT_Account '2' + +typedef char TSgitFtdcPasswordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgorithmTypeһӯ㷨 +///////////////////////////////////////////////////////////////////////// +///ӯ +#define Sgit_FTDC_AG_All '1' +///ӯƣ +#define Sgit_FTDC_AG_OnlyLost '2' +///ӯƣ +#define Sgit_FTDC_AG_OnlyGain '3' +///ӯ +#define Sgit_FTDC_AG_None '4' + +typedef char TSgitFtdcAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIncludeCloseProfitTypeһǷƽӯ +///////////////////////////////////////////////////////////////////////// +///ƽӯ +#define Sgit_FTDC_ICP_Include '0' +///ƽӯ +#define Sgit_FTDC_ICP_NotInclude '2' + +typedef char TSgitFtdcIncludeCloseProfitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAllWithoutTradeTypeһǷܿ +///////////////////////////////////////////////////////////////////////// +///ܿ +#define Sgit_FTDC_AWT_Enable '0' +///ܿ +#define Sgit_FTDC_AWT_Disable '2' + +typedef char TSgitFtdcAllWithoutTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommentTypeһӯ㷨˵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCommentType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVersionTypeһ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcVersionType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcTradeCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcTradeDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcTradeTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcTradeSerialType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcTradeSerialNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureIDTypeһڻ˾ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFutureIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDTypeһд +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBrchIDTypeһзĴ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankBrchIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBranchIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankBranchIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperNoTypeһ׹Ա +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOperNoType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeviceIDTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcDeviceIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordNumTypeһ¼ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRecordNumType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountTypeһڻʽ˺ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFutureAccountType[22]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturePwdFlagTypeһʽ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define Sgit_FTDC_FPWD_UnCheck '0' +///˶ +#define Sgit_FTDC_FPWD_Check '1' + +typedef char TSgitFtdcFuturePwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferTypeTypeһת +///////////////////////////////////////////////////////////////////////// +///תڻ +#define Sgit_FTDC_TT_BankToFuture '0' +///ڻת +#define Sgit_FTDC_TT_FutureToBank '1' + +typedef char TSgitFtdcTransferTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccPwdTypeһڻʽ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFutureAccPwdType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCurrencyCodeType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetCodeTypeһӦ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRetCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetInfoTypeһӦϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRetInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmtTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcTradeAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUseAmtTypeһп +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcUseAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFetchAmtTypeһпȡ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFetchAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferValidFlagTypeһתЧ־ +///////////////////////////////////////////////////////////////////////// +///Чʧ +#define Sgit_FTDC_TVF_Invalid '0' +///Ч +#define Sgit_FTDC_TVF_Valid '1' +/// +#define Sgit_FTDC_TVF_Reverse '2' + +typedef char TSgitFtdcTransferValidFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertCodeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCertCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReasonTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_RN_CD '0' +///ʽ; +#define Sgit_FTDC_RN_ZT '1' +/// +#define Sgit_FTDC_RN_QT '2' + +typedef char TSgitFtdcReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundProjectIDTypeһʽĿ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFundProjectIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSexTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define Sgit_FTDC_SEX_None '0' +/// +#define Sgit_FTDC_SEX_Man '1' +///Ů +#define Sgit_FTDC_SEX_Woman '2' + +typedef char TSgitFtdcSexType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProfessionTypeһְҵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcProfessionType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNationalTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcNationalType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProvinceTypeһʡ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcProvinceType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRegionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRegionType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCountryType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNOTypeһӪҵִ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcLicenseNOType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCompanyTypeType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessScopeTypeһӪΧ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBusinessScopeType[1001]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCapitalCurrencyTypeһעʱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCapitalCurrencyType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserTypeTypeһû +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define Sgit_FTDC_UT_Investor '0' +///Ա +#define Sgit_FTDC_UT_Operator '1' +///Ա +#define Sgit_FTDC_UT_SuperUser '2' + +typedef char TSgitFtdcUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///֤ +#define Sgit_FTDC_RATETYPE_MarginRate '2' + +typedef char TSgitFtdcRateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNoteTypeTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +///׽㵥 +#define Sgit_FTDC_NOTETYPE_TradeSettleBill '1' +///׽± +#define Sgit_FTDC_NOTETYPE_TradeSettleMonth '2' +///׷ӱ֤֪ͨ +#define Sgit_FTDC_NOTETYPE_CallMarginNotes '3' +///ǿƽ֪ͨ +#define Sgit_FTDC_NOTETYPE_ForceCloseNotes '4' +///ɽ֪ͨ +#define Sgit_FTDC_NOTETYPE_TradeNotes '5' +///֪ͨ +#define Sgit_FTDC_NOTETYPE_DelivNotes '6' + +typedef char TSgitFtdcNoteTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStyleTypeһ㵥ʽ +///////////////////////////////////////////////////////////////////////// +///ն +#define Sgit_FTDC_SBS_Day '1' +///ʶԳ +#define Sgit_FTDC_SBS_Volume '2' + +typedef char TSgitFtdcSettlementStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDNSTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBrokerDNSType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSentenceTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSentenceType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementBillTypeTypeһ㵥 +///////////////////////////////////////////////////////////////////////// +///ձ +#define Sgit_FTDC_ST_Day '0' +///± +#define Sgit_FTDC_ST_Month '1' + +typedef char TSgitFtdcSettlementBillTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRightTypeTypeһͻȨ +///////////////////////////////////////////////////////////////////////// +///¼ +#define Sgit_FTDC_URT_Logon '1' +///ת +#define Sgit_FTDC_URT_Transfer '2' +///ʼĽ㵥 +#define Sgit_FTDC_URT_EMail '3' +///㵥 +#define Sgit_FTDC_URT_Fax '4' +/// +#define Sgit_FTDC_URT_ConditionOrder '5' + +typedef char TSgitFtdcUserRightTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginPriceTypeTypeһ֤۸ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_MPT_PreSettlementPrice '1' +///¼ +#define Sgit_FTDC_MPT_SettlementPrice '2' +///ɽ +#define Sgit_FTDC_MPT_AveragePrice '3' +///ּ +#define Sgit_FTDC_MPT_OpenPrice '4' + +typedef char TSgitFtdcMarginPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillGenStatusTypeһ㵥״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_BGS_None '0' +///δ +#define Sgit_FTDC_BGS_NoGenerated '1' +/// +#define Sgit_FTDC_BGS_Generated '2' + +typedef char TSgitFtdcBillGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgoTypeTypeһ㷨 +///////////////////////////////////////////////////////////////////////// +///ֲִ㷨 +#define Sgit_FTDC_AT_HandlePositionAlgo '1' +///Ѱұ֤㷨 +#define Sgit_FTDC_AT_FindMarginRateAlgo '2' + +typedef char TSgitFtdcAlgoTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandlePositionAlgoIDTypeһֲִ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_HPA_Base '1' +///Ʒ +#define Sgit_FTDC_HPA_DCE '2' +///֣Ʒ +#define Sgit_FTDC_HPA_CZCE '3' + +typedef char TSgitFtdcHandlePositionAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFindMarginRateAlgoIDTypeһѰұ֤㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_FMRA_Base '1' +///Ʒ +#define Sgit_FTDC_FMRA_DCE '2' +///֣Ʒ +#define Sgit_FTDC_FMRA_CZCE '3' + +typedef char TSgitFtdcFindMarginRateAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandleTradingAccountAlgoIDTypeһʽ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_HTAA_Base '1' +///Ʒ +#define Sgit_FTDC_HTAA_DCE '2' +///֣Ʒ +#define Sgit_FTDC_HTAA_CZCE '3' + +typedef char TSgitFtdcHandleTradingAccountAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPersonTypeTypeһϵ +///////////////////////////////////////////////////////////////////////// +///ָµ +#define Sgit_FTDC_PST_Order '1' +///Ȩ +#define Sgit_FTDC_PST_Open '2' +///ʽ +#define Sgit_FTDC_PST_Fund '3' +///㵥ȷ +#define Sgit_FTDC_PST_Settlement '4' +/// +#define Sgit_FTDC_PST_Company '5' +///˴ +#define Sgit_FTDC_PST_Corporation '6' +///Ͷϵ +#define Sgit_FTDC_PST_LinkMan '7' + +typedef char TSgitFtdcPersonTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryInvestorRangeTypeһѯΧ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_QIR_All '1' +///ѯ +#define Sgit_FTDC_QIR_Group '2' +///һͶ +#define Sgit_FTDC_QIR_Single '3' + +typedef char TSgitFtdcQueryInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRiskStatusTypeһͶ߷״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_IRS_Normal '1' +/// +#define Sgit_FTDC_IRS_Warn '2' +///׷ +#define Sgit_FTDC_IRS_Call '3' +///ǿƽ +#define Sgit_FTDC_IRS_Force '4' +///쳣 +#define Sgit_FTDC_IRS_Exception '5' + +typedef char TSgitFtdcInvestorRiskStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegIDTypeһȱ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcLegIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegMultipleTypeһȳ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcLegMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImplyLevelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcImplyLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcClearAccountType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNOTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOrganNOType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearbarchIDTypeһ˻к +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcClearbarchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventTypeTypeһû¼ +///////////////////////////////////////////////////////////////////////// +///¼ +#define Sgit_FTDC_UET_Login '1' +///dz +#define Sgit_FTDC_UET_Logout '2' +///׳ɹ +#define Sgit_FTDC_UET_Trading '3' +///ʧ +#define Sgit_FTDC_UET_TradingError '4' +///޸ +#define Sgit_FTDC_UET_UpdatePassword '5' +///ͻ֤ +#define Sgit_FTDC_UET_Authenticate '6' +/// +#define Sgit_FTDC_UET_Other '9' + +typedef char TSgitFtdcUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventInfoTypeһû¼Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcUserEventInfoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseStyleTypeһƽַʽ +///////////////////////////////////////////////////////////////////////// +///ȿƽ +#define Sgit_FTDC_ICS_Close '0' +///ƽƽ +#define Sgit_FTDC_ICS_CloseToday '1' + +typedef char TSgitFtdcCloseStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStatModeTypeһͳƷʽ +///////////////////////////////////////////////////////////////////////// +///---- +#define Sgit_FTDC_SM_Non '0' +///Լͳ +#define Sgit_FTDC_SM_Instrument '1' +///Ʒͳ +#define Sgit_FTDC_SM_Product '2' +///Ͷͳ +#define Sgit_FTDC_SM_Investor '3' + +typedef char TSgitFtdcStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderStatusTypeһԤ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define Sgit_FTDC_PAOS_NotSend '1' +///ѷ +#define Sgit_FTDC_PAOS_Send '2' +///ɾ +#define Sgit_FTDC_PAOS_Deleted '3' + +typedef char TSgitFtdcParkedOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderIDTypeһԤ񱨵 +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcParkedOrderIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderActionIDTypeһԤ񳷵 +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcParkedOrderActionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirDealStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ڴ +#define Sgit_FTDC_VDS_Dealing '1' +///ɹ +#define Sgit_FTDC_VDS_DeaclSucceed '2' + +typedef char TSgitFtdcVirDealStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrgSystemIDTypeһԭϵͳ +///////////////////////////////////////////////////////////////////////// +///ۺϽƽ̨ +#define Sgit_FTDC_ORGS_Standard '0' +///ʢϵͳ +#define Sgit_FTDC_ORGS_ESunny '1' +///˴V6ϵͳ +#define Sgit_FTDC_ORGS_KingStarV6 '2' + +typedef char TSgitFtdcOrgSystemIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirTradeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_VTS_NaturalDeal '0' +///ɹ +#define Sgit_FTDC_VTS_SucceedEnd '1' +///ʧܽ +#define Sgit_FTDC_VTS_FailedEND '2' +///쳣 +#define Sgit_FTDC_VTS_Exception '3' +///˹쳣 +#define Sgit_FTDC_VTS_ManualDeal '4' +///ͨѶ쳣 ˹ +#define Sgit_FTDC_VTS_MesException '5' +///ϵͳ˹ +#define Sgit_FTDC_VTS_SysException '6' + +typedef char TSgitFtdcVirTradeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirBankAccTypeTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_VBAT_BankBook '1' +/// +#define Sgit_FTDC_VBAT_BankCard '2' +///ÿ +#define Sgit_FTDC_VBAT_CreditCard '3' + +typedef char TSgitFtdcVirBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementStatusTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_VMS_Natural '0' +/// +#define Sgit_FTDC_VMS_Canceled '9' + +typedef char TSgitFtdcVirementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementAvailAbilityTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define Sgit_FTDC_VAA_NoAvailAbility '0' +///Ч +#define Sgit_FTDC_VAA_AvailAbility '1' +/// +#define Sgit_FTDC_VAA_Repeal '2' + +typedef char TSgitFtdcVirementAvailAbilityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +///зʽתڻ +#define Sgit_FTDC_VTC_BankBankToFuture '102001' +///зڻʽת +#define Sgit_FTDC_VTC_BankFutureToBank '102002' +///ڻʽתڻ +#define Sgit_FTDC_VTC_FutureBankToFuture '202001' +///ڻڻʽת +#define Sgit_FTDC_VTC_FutureFutureToBank '202002' + +typedef char TSgitFtdcVirementTradeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPhotoTypeNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeIDTypeһӰʹ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPhotoTypeIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPhotoNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTopicIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcTopicIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportTypeIDTypeһױͱʶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcReportTypeIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCharacterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCharacterIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLInvestorTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLIdCardTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeDirectTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLTradeDirectType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeModelTypeһʽʽ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLTradeModelType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLOpParamValueTypeһҵֵ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcAMLOpParamValueType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCustomerCardTypeTypeһͻ֤/֤ļ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLCustomerCardTypeType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionNameTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLInstitutionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLDistrictIDTypeһڻڵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLDistrictIDType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLRelationShipTypeһڻ׵Ĺϵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLRelationShipType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLInstitutionTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionIDTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLInstitutionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLAccountTypeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradingTypeTypeһ׷ʽ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLTradingTypeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTransactClassTypeһ֧׷ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLTransactClassType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalIOTypeһʽոʶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLCapitalIOType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSiteTypeһ׵ص +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLSiteType[10]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalPurposeTypeһʽ; +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLCapitalPurposeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLReportTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSerialNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLSerialNoType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLGenStatusTypeһAmlɷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_GEN_Program '0' +///˹ +#define Sgit_FTDC_GEN_HandWork '1' + +typedef char TSgitFtdcAMLGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSeqCodeTypeһҵʶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLSeqCodeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileNameTypeһAMLļ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLMoneyTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcAMLMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileAmountTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcAMLFileAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCKeyTypeһԿ(֤) +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCFMMCKeyType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCKeyKindTypeһ̬Կ(֤) +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_CFMMCKK_REQUEST 'R' +///CFMMCԶ +#define Sgit_FTDC_CFMMCKK_AUTO 'A' +///CFMMCֶ +#define Sgit_FTDC_CFMMCKK_MANUAL 'M' + +typedef char TSgitFtdcCFMMCKeyKindType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAMLReportNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndividualNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcIndividualNameType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyIDTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCurrencyIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustNumberTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCustNumberType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOrganCodeType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOrganNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSuperOrganCodeTypeһϼ,ڻ˾ܲ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSuperOrganCodeType[12]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchIDTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchNameTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSubBranchNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBranchNetCodeType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBranchNetNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganFlagTypeһʶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOrganFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCodingForFutureTypeһжڻ˾ı +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankCodingForFutureType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankReturnCodeTypeһжԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateReturnCodeTypeһתƽ̨ԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPlateReturnCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSubBranchIDTypeһз֧ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureBranchIDTypeһڻ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFutureBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnCodeTypeһش +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorCodeTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOperatorCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearDepIDTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcClearDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearBrchIDTypeһʻк +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcClearBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcClearNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankAccountNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvDepIDTypeһͶ˺Ż +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcInvDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvBrchIDTypeһͶк +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcInvBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMessageFormatVersionTypeһϢʽ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcMessageFormatVersionType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDigestTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcDigestType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthenticDataTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAuthenticDataType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPasswordKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountNameTypeһڻʻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFutureAccountNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobilePhoneTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcMobilePhoneType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureMainKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFutureMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureWorkKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFutureWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTransKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFutureTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankMainKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankWorkKeyTypeһйԿ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankTransKeyTypeһдԿ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankServerDescriptionTypeһзϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankServerDescriptionType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddInfoTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAddInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescrInfoForReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcDescrInfoForReturnCodeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCountryCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateSerialTypeһƽ̨ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcPlateSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankSerialType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorrectSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcCorrectSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureSerialTypeһڻ˾ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcFutureSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplicationIDTypeһӦñʶ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcApplicationIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankProxyIDTypeһдʶ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcBankProxyIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTCoreIDTypeһתʺϵͳʶ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcFBTCoreIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServerPortTypeһ˿ں +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcServerPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealedTimesTypeһѾ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcRepealedTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealTimeIntervalTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcRepealTimeIntervalType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalTimesTypeһÿۼתʴ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcTotalTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTRequestIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcFBTRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcTIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmountTypeһ׽Ԫ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcTradeAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustFeeTypeһӦտͻãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcCustFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureFeeTypeһӦڻ˾ãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcFutureFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMaxAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcSingleMaxAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMinAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcSingleMinAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalAmtTypeһÿۼתʶ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcTotalAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertificationTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define Sgit_FTDC_CFT_IDCard '0' +/// +#define Sgit_FTDC_CFT_Passport '1' +///֤ +#define Sgit_FTDC_CFT_OfficerIDCard '2' +///ʿ֤ +#define Sgit_FTDC_CFT_SoldierIDCard '3' +///֤ +#define Sgit_FTDC_CFT_HomeComingCard '4' +///ڲ +#define Sgit_FTDC_CFT_HouseholdRegister '5' +///Ӫҵִպ +#define Sgit_FTDC_CFT_LicenseNo '6' +///֤֯ +#define Sgit_FTDC_CFT_InstitutionCodeCard '7' +///ʱӪҵִպ +#define Sgit_FTDC_CFT_TempLicenseNo '8' +///ҵǼ֤ +#define Sgit_FTDC_CFT_NoEnterpriseLicenseNo '9' +///֤ +#define Sgit_FTDC_CFT_OtherCard 'x' +///ܲ +#define Sgit_FTDC_CFT_SuperDepAgree 'a' + +typedef char TSgitFtdcCertificationTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileBusinessCodeTypeһļҵ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_FBC_Others '0' +///ת˽ϸ +#define Sgit_FTDC_FBC_TransferDetails '1' +///ͻ˻״̬ +#define Sgit_FTDC_FBC_CustAccStatus '2' +///˻ཻϸ +#define Sgit_FTDC_FBC_AccountTradeDetails '3' +///ڻ˻Ϣϸ +#define Sgit_FTDC_FBC_FutureAccountChangeInfoDetails '4' +///ͻʽ̨ϸ +#define Sgit_FTDC_FBC_CustMoneyDetail '5' +///ͻϢϸ +#define Sgit_FTDC_FBC_CustCancelAccountInfo '6' +///ͻʽ˽ +#define Sgit_FTDC_FBC_CustMoneyResult '7' +///쳣ļ +#define Sgit_FTDC_FBC_OthersExceptionResult '8' +///ͻϢϸ +#define Sgit_FTDC_FBC_CustInterestNetMoneyDetails '9' +///ͻʽϸ +#define Sgit_FTDC_FBC_CustMoneySendAndReceiveDetails 'a' +///˴ʽջ +#define Sgit_FTDC_FBC_CorporationMoneyTotal 'b' +///ʽջ +#define Sgit_FTDC_FBC_MainbodyMoneyTotal 'c' +///ܷƽ +#define Sgit_FTDC_FBC_MainPartMonitorData 'd' +///б +#define Sgit_FTDC_FBC_PreparationMoney 'e' +///Эʽ +#define Sgit_FTDC_FBC_BankMoneyMonitorData 'f' + +typedef char TSgitFtdcFileBusinessCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCashExchangeCodeTypeһ㳮־ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_CEC_Exchange '1' +/// +#define Sgit_FTDC_CEC_Cash '2' + +typedef char TSgitFtdcCashExchangeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYesNoIndicatorTypeһǻʶ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_YNI_Yes '0' +/// +#define Sgit_FTDC_YNI_No '1' + +typedef char TSgitFtdcYesNoIndicatorType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBanlanceTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define Sgit_FTDC_BLT_CurrentMoney '0' +/// +#define Sgit_FTDC_BLT_UsableMoney '1' +///ȡ +#define Sgit_FTDC_BLT_FetchableMoney '2' +/// +#define Sgit_FTDC_BLT_FreezeMoney '3' + +typedef char TSgitFtdcBanlanceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGenderTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪״̬ +#define Sgit_FTDC_GD_Unknown '0' +/// +#define Sgit_FTDC_GD_Male '1' +///Ů +#define Sgit_FTDC_GD_Female '2' + +typedef char TSgitFtdcGenderType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeePayFlagTypeһ֧־ +///////////////////////////////////////////////////////////////////////// +///淽֧ +#define Sgit_FTDC_FPF_BEN '0' +///ɷͷ֧ +#define Sgit_FTDC_FPF_OUR '1' +///ɷͷ֧ķã淽֧ܵķ +#define Sgit_FTDC_FPF_SHA '2' + +typedef char TSgitFtdcFeePayFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPassWordKeyTypeTypeһԿ +///////////////////////////////////////////////////////////////////////// +///Կ +#define Sgit_FTDC_PWKT_ExchangeKey '0' +///Կ +#define Sgit_FTDC_PWKT_PassWordKey '1' +///MACԿ +#define Sgit_FTDC_PWKT_MACKey '2' +///Կ +#define Sgit_FTDC_PWKT_MessageKey '3' + +typedef char TSgitFtdcPassWordKeyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTPassWordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ѯ +#define Sgit_FTDC_PWT_Query '0' +///ȡ +#define Sgit_FTDC_PWT_Fetch '1' +///ת +#define Sgit_FTDC_PWT_Transfer '2' +/// +#define Sgit_FTDC_PWT_Trade '3' + +typedef char TSgitFtdcFBTPassWordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTEncryModeTypeһܷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_EM_NoEncry '0' +///DES +#define Sgit_FTDC_EM_DES '1' +///3DES +#define Sgit_FTDC_EM_3DES '2' + +typedef char TSgitFtdcFBTEncryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankRepealFlagTypeһг־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define Sgit_FTDC_BRF_BankNotNeedRepeal '0' +///дԶ +#define Sgit_FTDC_BRF_BankWaitingRepeal '1' +///Զ +#define Sgit_FTDC_BRF_BankBeenRepealed '2' + +typedef char TSgitFtdcBankRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerRepealFlagTypeһ̳־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define Sgit_FTDC_BRORF_BrokerNotNeedRepeal '0' +///̴Զ +#define Sgit_FTDC_BRORF_BrokerWaitingRepeal '1' +///Զ +#define Sgit_FTDC_BRORF_BrokerBeenRepealed '2' + +typedef char TSgitFtdcBrokerRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstitutionTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_TS_Bank '0' +/// +#define Sgit_FTDC_TS_Future '1' +///ȯ +#define Sgit_FTDC_TS_Store '2' + +typedef char TSgitFtdcInstitutionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastFragmentTypeһƬ־ +///////////////////////////////////////////////////////////////////////// +///Ƭ +#define Sgit_FTDC_LF_Yes '0' +///Ƭ +#define Sgit_FTDC_LF_No '1' + +typedef char TSgitFtdcLastFragmentType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccStatusTypeһ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_BAS_Normal '0' +/// +#define Sgit_FTDC_BAS_Freeze '1' +///ʧ +#define Sgit_FTDC_BAS_ReportLoss '2' + +typedef char TSgitFtdcBankAccStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyAccountStatusTypeһʽ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_MAS_Normal '0' +/// +#define Sgit_FTDC_MAS_Cancel '1' + +typedef char TSgitFtdcMoneyAccountStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcManageStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ָ +#define Sgit_FTDC_MSS_Point '0' +///Ԥָ +#define Sgit_FTDC_MSS_PrePoint '1' +///ָ +#define Sgit_FTDC_MSS_CancelPoint '2' + +typedef char TSgitFtdcManageStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemTypeTypeһӦϵͳ +///////////////////////////////////////////////////////////////////////// +///ת +#define Sgit_FTDC_SYT_FutureBankTransfer '0' +///֤ת +#define Sgit_FTDC_SYT_StockBankTransfer '1' +/// +#define Sgit_FTDC_SYT_TheThirdPartStore '2' + +typedef char TSgitFtdcSystemTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTxnEndFlagTypeһתʻת־ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_TEF_NormalProcessing '0' +///ɹ +#define Sgit_FTDC_TEF_Success '1' +///ʧܽ +#define Sgit_FTDC_TEF_Failed '2' +///쳣 +#define Sgit_FTDC_TEF_Abnormal '3' +///˹쳣 +#define Sgit_FTDC_TEF_ManualProcessedForException '4' +///ͨѶ쳣 ˹ +#define Sgit_FTDC_TEF_CommuFailedNeedManualProcess '5' +///ϵͳ˹ +#define Sgit_FTDC_TEF_SysErrorNeedManualProcess '6' + +typedef char TSgitFtdcTxnEndFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessStatusTypeһתʷ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define Sgit_FTDC_PSS_NotProcess '0' +///ʼ +#define Sgit_FTDC_PSS_StartProcess '1' +/// +#define Sgit_FTDC_PSS_Finished '2' + +typedef char TSgitFtdcProcessStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define Sgit_FTDC_CUSTT_Person '0' +/// +#define Sgit_FTDC_CUSTT_Institution '1' + +typedef char TSgitFtdcCustTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTransferDirectionTypeһתʷ +///////////////////////////////////////////////////////////////////////// +///תڻ +#define Sgit_FTDC_FBTTD_FromBankToFuture '1' +///ڻת +#define Sgit_FTDC_FBTTD_FromFutureToBank '2' + +typedef char TSgitFtdcFBTTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenOrDestroyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_OOD_Open '1' +/// +#define Sgit_FTDC_OOD_Destroy '0' + +typedef char TSgitFtdcOpenOrDestroyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAvailabilityFlagTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define Sgit_FTDC_AVAF_Invalid '0' +///Ч +#define Sgit_FTDC_AVAF_Valid '1' +/// +#define Sgit_FTDC_AVAF_Repeal '2' + +typedef char TSgitFtdcAvailabilityFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///д +#define Sgit_FTDC_OT_Bank '1' +///ǰ +#define Sgit_FTDC_OT_Future '2' +///תƽ̨ +#define Sgit_FTDC_OT_PlateForm '9' + +typedef char TSgitFtdcOrganTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///лܲ +#define Sgit_FTDC_OL_HeadQuarters '1' +///зĻڻ˾Ӫҵ +#define Sgit_FTDC_OL_Branch '2' + +typedef char TSgitFtdcOrganLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocalIDTypeһЭ +///////////////////////////////////////////////////////////////////////// +///Э +#define Sgit_FTDC_PID_FutureProtocal '0' +///Э +#define Sgit_FTDC_PID_ICBCProtocal '1' +///ũЭ +#define Sgit_FTDC_PID_ABCProtocal '2' +///йЭ +#define Sgit_FTDC_PID_CBCProtocal '3' +///Э +#define Sgit_FTDC_PID_CCBProtocal '4' +///Э +#define Sgit_FTDC_PID_BOCOMProtocal '5' +///תƽ̨Э +#define Sgit_FTDC_PID_FBTPlateFormProtocal 'X' + +typedef char TSgitFtdcProtocalIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConnectModeTypeһ׽ӷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_CM_ShortConnect '0' +/// +#define Sgit_FTDC_CM_LongConnect '1' + +typedef char TSgitFtdcConnectModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncModeTypeһ׽ͨŷʽ +///////////////////////////////////////////////////////////////////////// +///첽 +#define Sgit_FTDC_SRM_ASync '0' +///ͬ +#define Sgit_FTDC_SRM_Sync '1' + +typedef char TSgitFtdcSyncModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccTypeTypeһʺ +///////////////////////////////////////////////////////////////////////// +///д +#define Sgit_FTDC_BAT_BankBook '1' +/// +#define Sgit_FTDC_BAT_SavingCard '2' +///ÿ +#define Sgit_FTDC_BAT_CreditCard '3' + +typedef char TSgitFtdcBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccTypeTypeһڻ˾ʺ +///////////////////////////////////////////////////////////////////////// +///д +#define Sgit_FTDC_FAT_BankBook '1' +/// +#define Sgit_FTDC_FAT_SavingCard '2' +///ÿ +#define Sgit_FTDC_FAT_CreditCard '3' + +typedef char TSgitFtdcFutureAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_OS_Ready '0' +///ǩ +#define Sgit_FTDC_OS_CheckIn '1' +///ǩ +#define Sgit_FTDC_OS_CheckOut '2' +///ļ +#define Sgit_FTDC_OS_CheckFileArrived '3' +/// +#define Sgit_FTDC_OS_CheckDetail '4' +/// +#define Sgit_FTDC_OS_DayEndClean '5' +///ע +#define Sgit_FTDC_OS_Invalid '9' + +typedef char TSgitFtdcOrganStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCCBFeeModeTypeһշģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_CCBFM_ByAmount '1' +///¿ +#define Sgit_FTDC_CCBFM_ByMonth '2' + +typedef char TSgitFtdcCCBFeeModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiTypeTypeһͨѶAPI +///////////////////////////////////////////////////////////////////////// +///ͻ +#define Sgit_FTDC_CAPIT_Client '1' +/// +#define Sgit_FTDC_CAPIT_Server '2' +///ϵͳUserApi +#define Sgit_FTDC_CAPIT_UserApi '3' + +typedef char TSgitFtdcCommApiTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcServiceIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceLineNoTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcServiceLineNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcServiceNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLinkStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿ +#define Sgit_FTDC_LS_Connected '1' +///û +#define Sgit_FTDC_LS_Disconnected '2' + +typedef char TSgitFtdcLinkStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiPointerTypeһͨѶAPIָ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcCommApiPointerType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPwdFlagTypeһ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define Sgit_FTDC_BPWDF_NoCheck '0' +///ĺ˶ +#define Sgit_FTDC_BPWDF_BlankCheck '1' +///ĺ˶ +#define Sgit_FTDC_BPWDF_EncryptCheck '2' + +typedef char TSgitFtdcPwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSecuAccTypeTypeһڻʺ +///////////////////////////////////////////////////////////////////////// +///ʽʺ +#define Sgit_FTDC_SAT_AccountID '1' +///ʽ𿨺 +#define Sgit_FTDC_SAT_CardID '2' +///Ϻɶʺ +#define Sgit_FTDC_SAT_SHStockholderID '3' +///ڹɶʺ +#define Sgit_FTDC_SAT_SZStockholderID '4' + +typedef char TSgitFtdcSecuAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferStatusTypeһת˽״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_TRFS_Normal '0' +/// +#define Sgit_FTDC_TRFS_Repealed '1' + +typedef char TSgitFtdcTransferStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSponsorTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_SPTYPE_Broker '0' +/// +#define Sgit_FTDC_SPTYPE_Bank '1' + +typedef char TSgitFtdcSponsorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReqRspTypeTypeһӦ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_REQRSP_Request '0' +///Ӧ +#define Sgit_FTDC_REQRSP_Response '1' + +typedef char TSgitFtdcReqRspTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTUserEventTypeTypeһתû¼ +///////////////////////////////////////////////////////////////////////// +///ǩ +#define Sgit_FTDC_FBTUET_SignIn '0' +///תڻ +#define Sgit_FTDC_FBTUET_FromBankToFuture '1' +///ڻת +#define Sgit_FTDC_FBTUET_FromFutureToBank '2' +/// +#define Sgit_FTDC_FBTUET_OpenAccount '3' +/// +#define Sgit_FTDC_FBTUET_CancelAccount '4' +///˻ +#define Sgit_FTDC_FBTUET_ChangeAccount '5' +///תڻ +#define Sgit_FTDC_FBTUET_RepealFromBankToFuture '6' +///ڻת +#define Sgit_FTDC_FBTUET_RepealFromFutureToBank '7' +///ѯ˻ +#define Sgit_FTDC_FBTUET_QueryBankAccount '8' +///ѯڻ˻ +#define Sgit_FTDC_FBTUET_QueryFutureAccount '9' +///ǩ +#define Sgit_FTDC_FBTUET_SignOut 'A' +///Կͬ +#define Sgit_FTDC_FBTUET_SyncKey 'B' +/// +#define Sgit_FTDC_FBTUET_Other 'Z' + +typedef char TSgitFtdcFBTUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDByBankTypeһԼı +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcBankIDByBankType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNotifyClassTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_NC_NOERROR '0' +///ʾ +#define Sgit_FTDC_NC_Warn '1' +///׷ +#define Sgit_FTDC_NC_Call '2' +///ǿƽ +#define Sgit_FTDC_NC_Force '3' +/// +#define Sgit_FTDC_NC_CHUANCANG '4' +///쳣 +#define Sgit_FTDC_NC_Exception '5' + +typedef char TSgitFtdcNotifyClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNofityInfoTypeһͻ֪ͨϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRiskNofityInfoType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseSceneIdTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcForceCloseSceneIdType[24]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseTypeTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +///ֹǿƽ +#define Sgit_FTDC_FCT_Manual '0' +///һͶ߸ǿƽ +#define Sgit_FTDC_FCT_Single '1' +///Ͷ߸ǿƽ +#define Sgit_FTDC_FCT_Group '2' + +typedef char TSgitFtdcForceCloseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDsTypeһƷ,+ָ,cu+zn +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcInstrumentIDsType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyMethodTypeһ֪ͨ; +///////////////////////////////////////////////////////////////////////// +///ϵͳ֪ͨ +#define Sgit_FTDC_RNM_System '0' +///֪ͨ +#define Sgit_FTDC_RNM_SMS '1' +///ʼ֪ͨ +#define Sgit_FTDC_RNM_EMail '2' +///˹֪ͨ +#define Sgit_FTDC_RNM_Manual '3' + +typedef char TSgitFtdcRiskNotifyMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyStatusTypeһ֪ͨ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define Sgit_FTDC_RNS_NotGen '0' +///δ +#define Sgit_FTDC_RNS_Generated '1' +///ʧ +#define Sgit_FTDC_RNS_SendError '2' +///ѷδ +#define Sgit_FTDC_RNS_SendOk '3' +///ѽδȷ +#define Sgit_FTDC_RNS_Received '4' +///ȷ +#define Sgit_FTDC_RNS_Confirmed '5' + +typedef char TSgitFtdcRiskNotifyStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskUserEventTypeһû¼ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_RUE_ExportData '0' + +typedef char TSgitFtdcRiskUserEventType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcParamNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcParamValueType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConditionalOrderSortTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ʹ¼ +#define Sgit_FTDC_COST_LastPriceAsc '0' +///ʹ¼۽ +#define Sgit_FTDC_COST_LastPriceDesc '1' +///ʹ +#define Sgit_FTDC_COST_AskPriceAsc '2' +///ʹ۽ +#define Sgit_FTDC_COST_AskPriceDesc '3' +///ʹ +#define Sgit_FTDC_COST_BidPriceAsc '4' +///ʹ۽ +#define Sgit_FTDC_COST_BidPriceDesc '5' + +typedef char TSgitFtdcConditionalOrderSortTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendTypeTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define Sgit_FTDC_UOAST_NoSend '0' +///ѷ +#define Sgit_FTDC_UOAST_Sended '1' +/// +#define Sgit_FTDC_UOAST_Generated '2' +///ʧ +#define Sgit_FTDC_UOAST_SendFail '3' +///ճɹ +#define Sgit_FTDC_UOAST_Success '4' +///ʧ +#define Sgit_FTDC_UOAST_Fail '5' +///ȡ +#define Sgit_FTDC_UOAST_Cancel '6' + +typedef char TSgitFtdcSendTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDStatusTypeһױ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define Sgit_FTDC_UOACS_NoApply '1' +///ύ +#define Sgit_FTDC_UOACS_Submited '2' +///ѷ +#define Sgit_FTDC_UOACS_Sended '3' +/// +#define Sgit_FTDC_UOACS_Success '4' +///ܾ +#define Sgit_FTDC_UOACS_Refuse '5' +///ѳ +#define Sgit_FTDC_UOACS_Cancel '6' + +typedef char TSgitFtdcClientIDStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndustryIDTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcIndustryIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionIDTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcQuestionIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionContentTypeһϢ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcQuestionContentType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionIDTypeһѡ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOptionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionContentTypeһѡ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOptionContentType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionTypeTypeһϢ +///////////////////////////////////////////////////////////////////////// +///ѡ +#define Sgit_FTDC_QT_Radio '1' +///ѡ +#define Sgit_FTDC_QT_Option '2' +/// +#define Sgit_FTDC_QT_Blank '3' + +typedef char TSgitFtdcQuestionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessIDTypeһҵˮ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcProcessIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAProcessStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcUOAProcessStatusType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessTypeTypeһ̹ +///////////////////////////////////////////////////////////////////////// +///뽻ױ +#define Sgit_FTDC_PT_ApplyTradingCode '1' +///ױ +#define Sgit_FTDC_PT_CancelTradingCode '2' +///޸Ϣ +#define Sgit_FTDC_PT_ModifyIDCard '3' +///޸һϢ +#define Sgit_FTDC_PT_ModifyNoIDCard '4' +/// +#define Sgit_FTDC_PT_ExchOpenBak '5' +/// +#define Sgit_FTDC_PT_ExchCancelBak '6' +///淶 +#define Sgit_FTDC_PT_StandardAccount '7' +///˻ +#define Sgit_FTDC_PT_FreezeAccount '8' +///˻ +#define Sgit_FTDC_PT_ActiveFreezeAccount '9' + +typedef char TSgitFtdcProcessTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_BT_Request '1' +///Ӧ +#define Sgit_FTDC_BT_Response '2' +///֪ͨ +#define Sgit_FTDC_BT_Notice '3' + +typedef char TSgitFtdcBusinessTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCfmmcReturnCodeTypeһķ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define Sgit_FTDC_CRC_Success '0' +///ÿͻѾڴ +#define Sgit_FTDC_CRC_Working '1' +///пͻϼʧ +#define Sgit_FTDC_CRC_InfoFail '2' +///ʵƼʧ +#define Sgit_FTDC_CRC_IDCardFail '3' +/// +#define Sgit_FTDC_CRC_OtherFail '4' + +typedef char TSgitFtdcCfmmcReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcExReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_CfMMCCT_All '0' +/// +#define Sgit_FTDC_CfMMCCT_Person '1' +///λ +#define Sgit_FTDC_CfMMCCT_Company '2' + +typedef char TSgitFtdcClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///Ϻڻ +#define Sgit_FTDC_EIDT_SHFE 'S' +///֣Ʒ +#define Sgit_FTDC_EIDT_CZCE 'Z' +///Ʒ +#define Sgit_FTDC_EIDT_DCE 'D' +///йڻ +#define Sgit_FTDC_EIDT_CFFEX 'J' +///ƽ +#define Sgit_FTDC_EIDT_GOLD 'G' +///PAT +#define Sgit_FTDC_EIDT_PAT 'P' +/// +#define Sgit_FTDC_EIDT_LTS 'L' + +typedef char TSgitFtdcExchangeIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExClientIDTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///ױ +#define Sgit_FTDC_ECIDT_Hedge '1' +/// +#define Sgit_FTDC_ECIDT_Arbitrage '2' +///Ͷ +#define Sgit_FTDC_ECIDT_Speculation '3' + +typedef char TSgitFtdcExClientIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientClassifyTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcClientClassifyType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAOrganTypeTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcUOAOrganTypeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOACountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcUOACountryCodeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAreaCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAreaCodeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturesIDTypeһΪͻĴ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFuturesIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCffmcDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCffmcTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNocIDTypeһ֯ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcNocIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUpdateFlagTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define Sgit_FTDC_UF_NoUpdate '0' +///ȫϢɹ +#define Sgit_FTDC_UF_Success '1' +///ȫϢʧ +#define Sgit_FTDC_UF_Fail '2' +///½ױɹ +#define Sgit_FTDC_UF_TCSuccess '3' +///½ױʧ +#define Sgit_FTDC_UF_TCFail '4' +///Ѷ +#define Sgit_FTDC_UF_Cancel '5' + +typedef char TSgitFtdcUpdateFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyOperateIDTypeһ붯 +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_AOID_OpenInvestor '1' +///޸Ϣ +#define Sgit_FTDC_AOID_ModifyIDCard '2' +///޸һϢ +#define Sgit_FTDC_AOID_ModifyNoIDCard '3' +///뽻ױ +#define Sgit_FTDC_AOID_ApplyTradingCode '4' +///ױ +#define Sgit_FTDC_AOID_CancelTradingCode '5' +/// +#define Sgit_FTDC_AOID_CancelInvestor '6' +///˻ +#define Sgit_FTDC_AOID_FreezeAccount '8' +///˻ +#define Sgit_FTDC_AOID_ActiveFreezeAccount '9' + +typedef char TSgitFtdcApplyOperateIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyStatusIDTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δȫ +#define Sgit_FTDC_ASID_NoComplete '1' +///ύ +#define Sgit_FTDC_ASID_Submited '2' +/// +#define Sgit_FTDC_ASID_Checked '3' +///Ѿܾ +#define Sgit_FTDC_ASID_Refused '4' +///ɾ +#define Sgit_FTDC_ASID_Deleted '5' + +typedef char TSgitFtdcApplyStatusIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendMethodTypeһͷʽ +///////////////////////////////////////////////////////////////////////// +///ļ +#define Sgit_FTDC_UOASM_ByAPI '1' +///ӷ +#define Sgit_FTDC_UOASM_ByFile '2' + +typedef char TSgitFtdcSendMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcEventTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventModeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_EvM_ADD '1' +///޸ +#define Sgit_FTDC_EvM_UPDATE '2' +///ɾ +#define Sgit_FTDC_EvM_DELETE '3' +/// +#define Sgit_FTDC_EvM_CHECK '4' +/// +#define Sgit_FTDC_EvM_COPY '5' +///ע +#define Sgit_FTDC_EvM_CANCEL '6' +/// +#define Sgit_FTDC_EvM_Reverse '7' + +typedef char TSgitFtdcEventModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAAutoSendTypeһͳһԶ +///////////////////////////////////////////////////////////////////////// +///ԶͲ +#define Sgit_FTDC_UOAA_ASR '1' +///ԶͣԶ +#define Sgit_FTDC_UOAA_ASNR '2' +///ԶͣԶ +#define Sgit_FTDC_UOAA_NSAR '3' +///ԶͣҲԶ +#define Sgit_FTDC_UOAA_NSR '4' + +typedef char TSgitFtdcUOAAutoSendType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryDepthTypeһѯ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcQueryDepthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataCenterIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcDataCenterIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFlowIDTypeһID +///////////////////////////////////////////////////////////////////////// +///Ͷ߶ӦͶ +#define Sgit_FTDC_EvM_InvestorGroupFlow '1' +///Ͷ +#define Sgit_FTDC_EvM_InvestorRate '2' +///Ͷģϵ +#define Sgit_FTDC_EvM_InvestorCommRateModel '3' + +typedef char TSgitFtdcFlowIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define Sgit_FTDC_CL_Zero '0' +///һ +#define Sgit_FTDC_CL_One '1' +/// +#define Sgit_FTDC_CL_Two '2' + +typedef char TSgitFtdcCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcCheckNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckStatusTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///δ +#define Sgit_FTDC_CHS_Init '0' +/// +#define Sgit_FTDC_CHS_Checking '1' +///Ѹ +#define Sgit_FTDC_CHS_Checked '2' +///ܾ +#define Sgit_FTDC_CHS_Refuse '3' +/// +#define Sgit_FTDC_CHS_Cancel '4' + +typedef char TSgitFtdcCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUsedStatusTypeһЧ״̬ +///////////////////////////////////////////////////////////////////////// +///δЧ +#define Sgit_FTDC_CHU_Unused '0' +///Ч +#define Sgit_FTDC_CHU_Used '1' +///Чʧ +#define Sgit_FTDC_CHU_Fail '2' + +typedef char TSgitFtdcUsedStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRateTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyStringTypeһڲѯͶֶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcPropertyStringType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAcountOriginTypeһ˻Դ +///////////////////////////////////////////////////////////////////////// +///ֹ¼ +#define Sgit_FTDC_BAO_ByAccProperty '0' +///ת +#define Sgit_FTDC_BAO_ByFBTransfer '1' + +typedef char TSgitFtdcBankAcountOriginType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthBillTradeSumTypeһ㵥±ɽܷʽ +///////////////////////////////////////////////////////////////////////// +///ͬͬԼ +#define Sgit_FTDC_MBTS_ByInstrument '0' +///ͬͬԼͬ۸ +#define Sgit_FTDC_MBTS_ByDayInsPrc '1' +///ͬԼ +#define Sgit_FTDC_MBTS_ByDayIns '2' + +typedef char TSgitFtdcMonthBillTradeSumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTradeCodeEnumTypeһڽ״ö +///////////////////////////////////////////////////////////////////////// +///зתڻ +#define Sgit_FTDC_FTC_BankLaunchBankToBroker '102001' +///ڻתڻ +#define Sgit_FTDC_FTC_BrokerLaunchBankToBroker '202001' +///зڻת +#define Sgit_FTDC_FTC_BankLaunchBrokerToBank '102002' +///ڻڻת +#define Sgit_FTDC_FTC_BrokerLaunchBrokerToBank '202002' + +typedef char TSgitFtdcFBTTradeCodeEnumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateIDTypeһģʹ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRateTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimestampTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcTimestampType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleNameTypeһŶι +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcInvestorIDRuleNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleExprTypeһŶιʽ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcInvestorIDRuleExprType[513]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastDriftTypeһϴOTPƯֵ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcLastDriftType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastSuccessTypeһϴOTPɹֵ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcLastSuccessType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAuthKeyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialNumberTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSerialNumberType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPTypeTypeһ̬ +///////////////////////////////////////////////////////////////////////// +///޶̬ +#define Sgit_FTDC_OTP_NONE '0' +///ʱ +#define Sgit_FTDC_OTP_TOTP '1' + +typedef char TSgitFtdcOTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsIDTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOTPVendorsIDType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsNameTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcOTPVendorsNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPStatusTypeһ̬״̬ +///////////////////////////////////////////////////////////////////////// +///δʹ +#define Sgit_FTDC_OTPS_Unused '0' +///ʹ +#define Sgit_FTDC_OTPS_Used '1' +///ע +#define Sgit_FTDC_OTPS_Disuse '2' + +typedef char TSgitFtdcOTPStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerUserTypeTypeһù˾û +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define Sgit_FTDC_BUT_Investor '1' +///Ա +#define Sgit_FTDC_BUT_BrokerUser '2' + +typedef char TSgitFtdcBrokerUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +///Ʒڻ +#define Sgit_FTDC_FUTT_Commodity '1' +///ڻ +#define Sgit_FTDC_FUTT_Financial '2' + +typedef char TSgitFtdcFutureTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundEventTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ת޶ +#define Sgit_FTDC_FET_Restriction '0' +///ת޶ +#define Sgit_FTDC_FET_TodayRestriction '1' +///ˮ +#define Sgit_FTDC_FET_Transfer '2' +///ʽ𶳽 +#define Sgit_FTDC_FET_Credit '3' +///Ͷ߿ʽ +#define Sgit_FTDC_FET_InvestorWithdrawAlm '4' +///ʻת޶ +#define Sgit_FTDC_FET_BankRestriction '5' +///ǩԼ˻ +#define Sgit_FTDC_FET_Accountregister '6' +/// +#define Sgit_FTDC_FET_ExchangeFundIO '7' +///Ͷ߳ +#define Sgit_FTDC_FET_InvestorFundIO '8' + +typedef char TSgitFtdcFundEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountSourceTypeTypeһʽ˻Դ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define Sgit_FTDC_AST_FBTransfer '0' +///ֹ¼ +#define Sgit_FTDC_AST_ManualEntry '1' + +typedef char TSgitFtdcAccountSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCodeSourceTypeTypeһױԴ +///////////////////////////////////////////////////////////////////////// +///ͳһ(ѹ淶) +#define Sgit_FTDC_CST_UnifyAccount '0' +///ֹ¼(δ淶) +#define Sgit_FTDC_CST_ManualEntry '1' + +typedef char TSgitFtdcCodeSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRangeTypeһԱΧ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_UR_All '0' +///һԱ +#define Sgit_FTDC_UR_Single '1' + +typedef char TSgitFtdcUserRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeSpanTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcTimeSpanType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImportSequenceIDTypeһ̬Ƶα +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcImportSequenceIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByGroupTypeһͳƱͻͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ͷͳ +#define Sgit_FTDC_BG_Investor '2' +///ͳ +#define Sgit_FTDC_BG_Group '1' + +typedef char TSgitFtdcByGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSumStatModeTypeһͳƱΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Լͳ +#define Sgit_FTDC_TSSM_Instrument '1' +///Ʒͳ +#define Sgit_FTDC_TSSM_Product '2' +///ͳ +#define Sgit_FTDC_TSSM_Exchange '3' + +typedef char TSgitFtdcTradeSumStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcComTypeTypeһϳɽ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcComTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductIDTypeһƷʶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcUserProductIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcUserProductNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductMemoTypeһƷ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcUserProductMemoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCCancelFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCCancelFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorNameTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCInvestorNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorIDTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCIdentifiedCardNoType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankFlagTypeһбʶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCBankFlagType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCBankAccountType[23]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOpenNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCOpenNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMemoTypeһ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCMemoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTradeIDTypeһɽˮ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCExchangeInstIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCExchangeInstIDType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMortgageNameTypeһѺƷ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCMortgageNameType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCReasonTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCReasonType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsSettlementTypeһǷΪǽԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcIsSettlementType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TSgitFtdcCSRCMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCommModelNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelMemoTypeһģ屸ע +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCommModelMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_RIR_All '1' +///ģ +#define Sgit_FTDC_RIR_Model '2' +///һͶ +#define Sgit_FTDC_RIR_Single '3' + +typedef char TSgitFtdcRateInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAgentBrokerIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcDRIdentityIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcDRIdentityNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBLinkIDTypeһDBLinkʶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcDBLinkIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncDataStatusTypeһϵͳͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define Sgit_FTDC_SDS_Initialize '0' +///ͬ +#define Sgit_FTDC_SDS_Settlementing '1' +///ͬ +#define Sgit_FTDC_SDS_Settlemented '2' + +typedef char TSgitFtdcSyncDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///Խͨر +#define Sgit_FTDC_TSRC_NORMAL '0' +///Բѯ +#define Sgit_FTDC_TSRC_QUERY '1' + +typedef char TSgitFtdcTradeSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFlexStatModeTypeһƷԼͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ʒͳ +#define Sgit_FTDC_FSM_Product '1' +///ͳ +#define Sgit_FTDC_FSM_Exchange '2' +///ͳ +#define Sgit_FTDC_FSM_All '3' + +typedef char TSgitFtdcFlexStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByInvestorRangeTypeһͶ߷ΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///ͳ +#define Sgit_FTDC_BIR_Property '1' +///ͳ +#define Sgit_FTDC_BIR_All '2' + +typedef char TSgitFtdcByInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTBankIDTypeһбʶ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFBTBankIDType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNo12Typeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSgitFtdcSequenceNo12Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_PIR_All '1' +///Ͷ +#define Sgit_FTDC_PIR_Property '2' +///һͶ +#define Sgit_FTDC_PIR_Single '3' + +typedef char TSgitFtdcPropertyInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define Sgit_FTDC_FIS_NoCreate '0' +/// +#define Sgit_FTDC_FIS_Created '1' +///ʧ +#define Sgit_FTDC_FIS_Failed '2' + +typedef char TSgitFtdcFileStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileGenStyleTypeһļɷʽ +///////////////////////////////////////////////////////////////////////// +///· +#define Sgit_FTDC_FGS_FileTransmit '0' +/// +#define Sgit_FTDC_FGS_FileGen '1' + +typedef char TSgitFtdcFileGenStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperModeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_SoM_Add '1' +///޸ +#define Sgit_FTDC_SoM_Update '2' +///ɾ +#define Sgit_FTDC_SoM_Delete '3' +/// +#define Sgit_FTDC_SoM_Copy '4' +/// +#define Sgit_FTDC_SoM_AcTive '5' +///ע +#define Sgit_FTDC_SoM_CanCel '6' +/// +#define Sgit_FTDC_SoM_ReSet '7' + +typedef char TSgitFtdcSysOperModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperTypeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +///޸IJԱ +#define Sgit_FTDC_SoT_UpdatePassword '0' +///Աܹ֯ϵ +#define Sgit_FTDC_SoT_UserDepartment '1' +///ɫ +#define Sgit_FTDC_SoT_RoleManager '2' +///ɫ +#define Sgit_FTDC_SoT_RoleFunction '3' +/// +#define Sgit_FTDC_SoT_BaseParam '4' +///òԱ +#define Sgit_FTDC_SoT_SetUserID '5' +///ûɫ +#define Sgit_FTDC_SoT_SetUserRole '6' +///ûIP +#define Sgit_FTDC_SoT_UserIpRestriction '7' +///ܹ֯ +#define Sgit_FTDC_SoT_DepartmentManager '8' +///ܹ֯ѯิ +#define Sgit_FTDC_SoT_DepartmentCopy '9' +///ױ +#define Sgit_FTDC_SoT_Tradingcode 'A' +///Ͷ״̬ά +#define Sgit_FTDC_SoT_InvestorStatus 'B' +///ͶȨ޹ +#define Sgit_FTDC_SoT_InvestorAuthority 'C' +/// +#define Sgit_FTDC_SoT_PropertySet 'D' +///Ͷ +#define Sgit_FTDC_SoT_ReSetInvestorPasswd 'E' +///Ͷ߸Ϣά +#define Sgit_FTDC_SoT_InvestorPersonalityInfo 'F' + +typedef char TSgitFtdcSysOperTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDataQueyTypeTypeһϱݲѯ +///////////////////////////////////////////////////////////////////////// +///ѯǰձ͵ +#define Sgit_FTDC_CSRCQ_Current '0' +///ѯʷ͵Ĵ͹˾ +#define Sgit_FTDC_CSRCQ_History '1' + +typedef char TSgitFtdcCSRCDataQueyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define Sgit_FTDC_FRS_Normal '1' +/// +#define Sgit_FTDC_FRS_Freeze '0' + +typedef char TSgitFtdcFreezeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStandardStatusTypeһ淶״̬ +///////////////////////////////////////////////////////////////////////// +///ѹ淶 +#define Sgit_FTDC_STST_Standard '0' +///δ淶 +#define Sgit_FTDC_STST_NonStandard '1' + +typedef char TSgitFtdcStandardStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCSRCFreezeStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightParamTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///߻ +#define Sgit_FTDC_RPT_Freeze '1' +///߻ +#define Sgit_FTDC_RPT_FreezeActive '2' + +typedef char TSgitFtdcRightParamTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateIDTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRightTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcRightTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataStatusTypeһϴǮ˱״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_AMLDS_Normal '0' +///ɾ +#define Sgit_FTDC_AMLDS_Deleted '1' + +typedef char TSgitFtdcDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCheckStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define Sgit_FTDC_AMLCHS_Init '0' +/// +#define Sgit_FTDC_AMLCHS_Checking '1' +///Ѹ +#define Sgit_FTDC_AMLCHS_Checked '2' +///ܾϱ +#define Sgit_FTDC_AMLCHS_RefuseReport '3' + +typedef char TSgitFtdcAMLCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlDateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define Sgit_FTDC_AMLDT_DrawDay '0' +/// +#define Sgit_FTDC_AMLDT_TouchDay '1' + +typedef char TSgitFtdcAmlDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define Sgit_FTDC_AMLCL_CheckLevel0 '0' +///һ +#define Sgit_FTDC_AMLCL_CheckLevel1 '1' +/// +#define Sgit_FTDC_AMLCL_CheckLevel2 '2' +/// +#define Sgit_FTDC_AMLCL_CheckLevel3 '3' + +typedef char TSgitFtdcAmlCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckFlowTypeһϴǮݳȡ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAmlCheckFlowType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcDataTypeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExportFileTypeTypeһļ +///////////////////////////////////////////////////////////////////////// +///CSV +#define Sgit_FTDC_EFT_CSV '0' +///Excel +#define Sgit_FTDC_EFT_EXCEL '1' +///DBF +#define Sgit_FTDC_EFT_DBF '2' + +typedef char TSgitFtdcExportFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ׼ +#define Sgit_FTDC_SMT_Before '1' +/// +#define Sgit_FTDC_SMT_Settlement '2' +///˶ +#define Sgit_FTDC_SMT_After '3' +/// +#define Sgit_FTDC_SMT_Settlemented '4' + +typedef char TSgitFtdcSettleManagerTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerIDTypeһô +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSettleManagerIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcSettleManagerNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerLevelTypeһõȼ +///////////////////////////////////////////////////////////////////////// +///Ҫ +#define Sgit_FTDC_SML_Must '1' +/// +#define Sgit_FTDC_SML_Alarm '2' +///ʾ +#define Sgit_FTDC_SML_Prompt '3' +/// +#define Sgit_FTDC_SML_Ignore '4' + +typedef char TSgitFtdcSettleManagerLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerGroupTypeһģ +///////////////////////////////////////////////////////////////////////// +///˶ +#define Sgit_FTDC_SMG_Exhcange '1' +///ڲ˶ +#define Sgit_FTDC_SMG_ASP '2' +///ϱݺ˶ +#define Sgit_FTDC_SMG_CSRC '3' + +typedef char TSgitFtdcSettleManagerGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckResultMemoTypeһ˶Խ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcCheckResultMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionUrlTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcFunctionUrlType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthInfoTypeһͻ֤Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAuthInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthCodeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TSgitFtdcAuthCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLimitUseTypeTypeһֵʹ +///////////////////////////////////////////////////////////////////////// +///ظʹ +#define Sgit_FTDC_LUT_Repeatable '1' +///ظʹ +#define Sgit_FTDC_LUT_Unrepeatable '2' + +typedef char TSgitFtdcLimitUseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataResourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define Sgit_FTDC_DAR_Settle '1' +/// +#define Sgit_FTDC_DAR_Exchange '2' +/// +#define Sgit_FTDC_DAR_CSRC '3' + +typedef char TSgitFtdcDataResourceType; + +#endif diff --git a/include/FeiShu/SgitFtdcUserApiStruct.h b/include/FeiShu/SgitFtdcUserApiStruct.h new file mode 100644 index 0000000..c263756 --- /dev/null +++ b/include/FeiShu/SgitFtdcUserApiStruct.h @@ -0,0 +1,5862 @@ +///////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////// + +#if !defined(Sgit_FTDCSTRUCT_H) +#define Sgit_FTDCSTRUCT_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "SgitFtdcUserApiDataType.h" + +///Ϣַ +struct CSgitFtdcDisseminationField +{ + ///ϵк + TSgitFtdcSequenceSeriesType SequenceSeries; + ///к + TSgitFtdcSequenceNoType SequenceNo; +}; + +///û¼ +struct CSgitFtdcReqUserLoginField +{ + /// + TSgitFtdcDateType TradingDay; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + /// + TSgitFtdcPasswordType Password; + ///û˲ƷϢ + TSgitFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TSgitFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TSgitFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TSgitFtdcMacAddressType MacAddress; + ///̬ + TSgitFtdcPasswordType OneTimePassword; + ///նIPַ + TSgitFtdcIPAddressType ClientIPAddress; +}; + +///û¼Ӧ +struct CSgitFtdcRspUserLoginField +{ + /// + TSgitFtdcDateType TradingDay; + ///¼ɹʱ + TSgitFtdcTimeType LoginTime; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///ϵͳ + TSgitFtdcSystemNameType SystemName; + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///󱨵 + TSgitFtdcOrderRefType MaxOrderRef; + ///ʱ + TSgitFtdcTimeType SHFETime; + ///ʱ + TSgitFtdcTimeType DCETime; + ///֣ʱ + TSgitFtdcTimeType CZCETime; + ///нʱ + TSgitFtdcTimeType FFEXTime; +}; + +///ûdz +struct CSgitFtdcUserLogoutField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; +}; + +///ǿƽԱ˳ +struct CSgitFtdcForceUserLogoutField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; +}; + +///ͻ֤ +struct CSgitFtdcReqAuthenticateField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///û˲ƷϢ + TSgitFtdcProductInfoType UserProductInfo; + ///֤ + TSgitFtdcAuthCodeType AuthCode; +}; + +///ͻ֤Ӧ +struct CSgitFtdcRspAuthenticateField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///û˲ƷϢ + TSgitFtdcProductInfoType UserProductInfo; +}; + +///ͻ֤Ϣ +struct CSgitFtdcAuthenticationInfoField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///û˲ƷϢ + TSgitFtdcProductInfoType UserProductInfo; + ///֤Ϣ + TSgitFtdcAuthInfoType AuthInfo; + ///ǷΪ֤ + TSgitFtdcBoolType IsResult; +}; + +///תʱͷ +struct CSgitFtdcTransferHeaderField +{ + ///汾ţ1.0 + TSgitFtdcVersionType Version; + ///״룬 + TSgitFtdcTradeCodeType TradeCode; + ///ڣʽyyyymmdd + TSgitFtdcTradeDateType TradeDate; + ///ʱ䣬ʽhhmmss + TSgitFtdcTradeTimeType TradeTime; + ///ˮţN/A + TSgitFtdcTradeSerialType TradeSerial; + ///ڻ˾룬 + TSgitFtdcFutureIDType FutureID; + ///д룬ݲѯеõ + TSgitFtdcBankIDType BankID; + ///зĴ룬ݲѯеõ + TSgitFtdcBankBrchIDType BankBrchID; + ///ԱN/A + TSgitFtdcOperNoType OperNo; + ///豸ͣN/A + TSgitFtdcDeviceIDType DeviceID; + ///¼N/A + TSgitFtdcRecordNumType RecordNum; + ///ỰţN/A + TSgitFtdcSessionIDType SessionID; + ///ţN/A + TSgitFtdcRequestIDType RequestID; +}; + +///ʽתڻTradeCode=202001 +struct CSgitFtdcTransferBankToFutureReqField +{ + ///ڻʽ˻ + TSgitFtdcAccountIDType FutureAccount; + ///־ + TSgitFtdcFuturePwdFlagType FuturePwdFlag; + /// + TSgitFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TSgitFtdcMoneyType TradeAmt; + ///ͻ + TSgitFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TSgitFtdcCurrencyCodeType CurrencyCode; +}; + +///ʽתڻӦ +struct CSgitFtdcTransferBankToFutureRspField +{ + ///Ӧ + TSgitFtdcRetCodeType RetCode; + ///ӦϢ + TSgitFtdcRetInfoType RetInfo; + ///ʽ˻ + TSgitFtdcAccountIDType FutureAccount; + ///תʽ + TSgitFtdcMoneyType TradeAmt; + ///Ӧտͻ + TSgitFtdcMoneyType CustFee; + /// + TSgitFtdcCurrencyCodeType CurrencyCode; +}; + +///ڻʽתTradeCode=202002 +struct CSgitFtdcTransferFutureToBankReqField +{ + ///ڻʽ˻ + TSgitFtdcAccountIDType FutureAccount; + ///־ + TSgitFtdcFuturePwdFlagType FuturePwdFlag; + /// + TSgitFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TSgitFtdcMoneyType TradeAmt; + ///ͻ + TSgitFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TSgitFtdcCurrencyCodeType CurrencyCode; +}; + +///ڻʽתӦ +struct CSgitFtdcTransferFutureToBankRspField +{ + ///Ӧ + TSgitFtdcRetCodeType RetCode; + ///ӦϢ + TSgitFtdcRetInfoType RetInfo; + ///ʽ˻ + TSgitFtdcAccountIDType FutureAccount; + ///תʽ + TSgitFtdcMoneyType TradeAmt; + ///Ӧտͻ + TSgitFtdcMoneyType CustFee; + /// + TSgitFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯʽTradeCode=204002 +struct CSgitFtdcTransferQryBankReqField +{ + ///ڻʽ˻ + TSgitFtdcAccountIDType FutureAccount; + ///־ + TSgitFtdcFuturePwdFlagType FuturePwdFlag; + /// + TSgitFtdcFutureAccPwdType FutureAccPwd; + ///֣RMB- USD-Բ HKD-Ԫ + TSgitFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯʽӦ +struct CSgitFtdcTransferQryBankRspField +{ + ///Ӧ + TSgitFtdcRetCodeType RetCode; + ///ӦϢ + TSgitFtdcRetInfoType RetInfo; + ///ʽ˻ + TSgitFtdcAccountIDType FutureAccount; + /// + TSgitFtdcMoneyType TradeAmt; + ///п + TSgitFtdcMoneyType UseAmt; + ///пȡ + TSgitFtdcMoneyType FetchAmt; + /// + TSgitFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯнϸTradeCode=204999 +struct CSgitFtdcTransferQryDetailReqField +{ + ///ڻʽ˻ + TSgitFtdcAccountIDType FutureAccount; +}; + +///ѯнϸӦ +struct CSgitFtdcTransferQryDetailRspField +{ + /// + TSgitFtdcDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///״ + TSgitFtdcTradeCodeType TradeCode; + ///ڻˮ + TSgitFtdcTradeSerialNoType FutureSerial; + ///ڻ˾ + TSgitFtdcFutureIDType FutureID; + ///ʽʺ + TSgitFtdcFutureAccountType FutureAccount; + ///ˮ + TSgitFtdcTradeSerialNoType BankSerial; + ///д + TSgitFtdcBankIDType BankID; + ///зĴ + TSgitFtdcBankBrchIDType BankBrchID; + ///˺ + TSgitFtdcBankAccountType BankAccount; + ///֤ + TSgitFtdcCertCodeType CertCode; + ///Ҵ + TSgitFtdcCurrencyCodeType CurrencyCode; + /// + TSgitFtdcMoneyType TxAmount; + ///Ч־ + TSgitFtdcTransferValidFlagType Flag; +}; + +///ӦϢ +struct CSgitFtdcRspInfoField +{ + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CSgitFtdcExchangeField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + /// + TSgitFtdcExchangeNameType ExchangeName; + /// + TSgitFtdcExchangePropertyType ExchangeProperty; +}; + +///Ʒ +struct CSgitFtdcProductField +{ + ///Ʒ + TSgitFtdcInstrumentIDType ProductID; + ///Ʒ + TSgitFtdcProductNameType ProductName; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ʒ + TSgitFtdcProductClassType ProductClass; + ///Լ + TSgitFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TSgitFtdcPriceType PriceTick; + ///м۵µ + TSgitFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TSgitFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TSgitFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TSgitFtdcVolumeType MinLimitOrderVolume; + ///ֲ + TSgitFtdcPositionTypeType PositionType; + ///ֲ + TSgitFtdcPositionDateTypeType PositionDateType; +}; + +///Լ +struct CSgitFtdcInstrumentField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Լ + TSgitFtdcInstrumentNameType InstrumentName; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TSgitFtdcInstrumentIDType ProductID; + ///Ʒ + TSgitFtdcProductClassType ProductClass; + /// + TSgitFtdcYearType DeliveryYear; + /// + TSgitFtdcMonthType DeliveryMonth; + ///м۵µ + TSgitFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TSgitFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TSgitFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TSgitFtdcVolumeType MinLimitOrderVolume; + ///Լ + TSgitFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TSgitFtdcPriceType PriceTick; + /// + TSgitFtdcDateType CreateDate; + /// + TSgitFtdcDateType OpenDate; + /// + TSgitFtdcDateType ExpireDate; + ///ʼ + TSgitFtdcDateType StartDelivDate; + /// + TSgitFtdcDateType EndDelivDate; + ///Լ״̬ + TSgitFtdcInstLifePhaseType InstLifePhase; + ///ǰǷ + TSgitFtdcBoolType IsTrading; + ///ֲ + TSgitFtdcPositionTypeType PositionType; + ///ֲ + TSgitFtdcPositionDateTypeType PositionDateType; + ///ͷ֤ + TSgitFtdcRatioType LongMarginRatio; + ///ͷ֤ + TSgitFtdcRatioType ShortMarginRatio; +}; + +///͹˾ +struct CSgitFtdcBrokerField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///͹˾ + TSgitFtdcBrokerAbbrType BrokerAbbr; + ///͹˾ + TSgitFtdcBrokerNameType BrokerName; + ///ǷԾ + TSgitFtdcBoolType IsActive; +}; + +///Ա +struct CSgitFtdcTraderField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + /// + TSgitFtdcPasswordType Password; + ///װ + TSgitFtdcInstallCountType InstallCount; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; +}; + +///Ͷ +struct CSgitFtdcInvestorField +{ + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TSgitFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TSgitFtdcPartyNameType InvestorName; + ///֤ + TSgitFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TSgitFtdcBoolType IsActive; + ///ϵ绰 + TSgitFtdcTelephoneType Telephone; + ///ͨѶַ + TSgitFtdcAddressType Address; + /// + TSgitFtdcDateType OpenDate; + ///ֻ + TSgitFtdcMobileType Mobile; + ///ģ + TSgitFtdcInvestorIDType CommModelID; +}; + +///ױ +struct CSgitFtdcTradingCodeField +{ + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///ǷԾ + TSgitFtdcBoolType IsActive; + ///ױ + TSgitFtdcClientIDTypeType ClientIDType; +}; + +///Ա;͹˾ձ +struct CSgitFtdcPartBrokerField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///ǷԾ + TSgitFtdcBoolType IsActive; +}; + +///û +struct CSgitFtdcSuperUserField +{ + ///û + TSgitFtdcUserIDType UserID; + ///û + TSgitFtdcUserNameType UserName; + /// + TSgitFtdcPasswordType Password; + ///ǷԾ + TSgitFtdcBoolType IsActive; +}; + +///ûȨ +struct CSgitFtdcSuperUserFunctionField +{ + ///û + TSgitFtdcUserIDType UserID; + ///ܴ + TSgitFtdcFunctionCodeType FunctionCode; +}; + +///Ͷ +struct CSgitFtdcInvestorGroupField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TSgitFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TSgitFtdcInvestorGroupNameType InvestorGroupName; +}; + +///ʽ˻ +struct CSgitFtdcTradingAccountField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ϴѺ + TSgitFtdcMoneyType PreMortgage; + ///ϴö + TSgitFtdcMoneyType PreCredit; + ///ϴδ + TSgitFtdcMoneyType PreDeposit; + ///ϴν׼ + TSgitFtdcMoneyType PreBalance; + ///ϴռõı֤ + TSgitFtdcMoneyType PreMargin; + ///Ϣ + TSgitFtdcMoneyType InterestBase; + ///Ϣ + TSgitFtdcMoneyType Interest; + /// + TSgitFtdcMoneyType Deposit; + /// + TSgitFtdcMoneyType Withdraw; + ///ı֤ + TSgitFtdcMoneyType FrozenMargin; + ///ʽ + TSgitFtdcMoneyType FrozenCash; + /// + TSgitFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TSgitFtdcMoneyType CurrMargin; + ///ʽ + TSgitFtdcMoneyType CashIn; + /// + TSgitFtdcMoneyType Commission; + ///ƽӯ + TSgitFtdcMoneyType CloseProfit; + ///ֲӯ + TSgitFtdcMoneyType PositionProfit; + ///ڻ׼ + TSgitFtdcMoneyType Balance; + ///ʽ + TSgitFtdcMoneyType Available; + ///ȡʽ + TSgitFtdcMoneyType WithdrawQuota; + ///׼ + TSgitFtdcMoneyType Reserve; + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; + ///ö + TSgitFtdcMoneyType Credit; + ///Ѻ + TSgitFtdcMoneyType Mortgage; + ///֤ + TSgitFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TSgitFtdcMoneyType DeliveryMargin; + ///֤ + TSgitFtdcMoneyType ExchangeDeliveryMargin; +}; + +///Ͷֲ߳ +struct CSgitFtdcInvestorPositionField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ֲֶշ + TSgitFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + ///ֲ + TSgitFtdcPositionDateType PositionDate; + ///ճֲ + TSgitFtdcVolumeType YdPosition; + ///ճֲ + TSgitFtdcVolumeType Position; + ///ͷ + TSgitFtdcVolumeType LongFrozen; + ///ͷ + TSgitFtdcVolumeType ShortFrozen; + ///ֶ + TSgitFtdcMoneyType LongFrozenAmount; + ///ֶ + TSgitFtdcMoneyType ShortFrozenAmount; + /// + TSgitFtdcVolumeType OpenVolume; + ///ƽ + TSgitFtdcVolumeType CloseVolume; + ///ֽ + TSgitFtdcMoneyType OpenAmount; + ///ƽֽ + TSgitFtdcMoneyType CloseAmount; + ///ֲֳɱ + TSgitFtdcMoneyType PositionCost; + ///ϴռõı֤ + TSgitFtdcMoneyType PreMargin; + ///ռõı֤ + TSgitFtdcMoneyType UseMargin; + ///ı֤ + TSgitFtdcMoneyType FrozenMargin; + ///ʽ + TSgitFtdcMoneyType FrozenCash; + /// + TSgitFtdcMoneyType FrozenCommission; + ///ʽ + TSgitFtdcMoneyType CashIn; + /// + TSgitFtdcMoneyType Commission; + ///ƽӯ + TSgitFtdcMoneyType CloseProfit; + ///ֲӯ + TSgitFtdcMoneyType PositionProfit; + ///ϴν + TSgitFtdcPriceType PreSettlementPrice; + ///ν + TSgitFtdcPriceType SettlementPrice; + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; + ///ֳɱ + TSgitFtdcMoneyType OpenCost; + ///֤ + TSgitFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TSgitFtdcVolumeType CombPosition; + ///϶ͷ + TSgitFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TSgitFtdcVolumeType CombShortFrozen; + ///նƽӯ + TSgitFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TSgitFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TSgitFtdcVolumeType TodayPosition; + ///֤ + TSgitFtdcRatioType MarginRateByMoney; + ///֤() + TSgitFtdcRatioType MarginRateByVolume; +}; + +///Լ֤ +struct CSgitFtdcInstrumentMarginRateField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TSgitFtdcInvestorRangeType InvestorRange; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TSgitFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TSgitFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TSgitFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TSgitFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TSgitFtdcBoolType IsRelative; +}; + +///Լ +struct CSgitFtdcInstrumentCommissionRateField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TSgitFtdcInvestorRangeType InvestorRange; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcRatioType OpenRatioByMoney; + /// + TSgitFtdcRatioType OpenRatioByVolume; + ///ƽ + TSgitFtdcRatioType CloseRatioByMoney; + ///ƽ + TSgitFtdcRatioType CloseRatioByVolume; + ///ƽ + TSgitFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TSgitFtdcRatioType CloseTodayRatioByVolume; +}; + +/// +struct CSgitFtdcDepthMarketDataField +{ + /// + TSgitFtdcDateType TradingDay; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TSgitFtdcPriceType LastPrice; + ///ϴν + TSgitFtdcPriceType PreSettlementPrice; + /// + TSgitFtdcPriceType PreClosePrice; + ///ֲ + TSgitFtdcLargeVolumeType PreOpenInterest; + /// + TSgitFtdcPriceType OpenPrice; + ///߼ + TSgitFtdcPriceType HighestPrice; + ///ͼ + TSgitFtdcPriceType LowestPrice; + /// + TSgitFtdcVolumeType Volume; + ///ɽ + TSgitFtdcMoneyType Turnover; + ///ֲ + TSgitFtdcLargeVolumeType OpenInterest; + /// + TSgitFtdcPriceType ClosePrice; + ///ν + TSgitFtdcPriceType SettlementPrice; + ///ͣ + TSgitFtdcPriceType UpperLimitPrice; + ///ͣ + TSgitFtdcPriceType LowerLimitPrice; + ///ʵ + TSgitFtdcRatioType PreDelta; + ///ʵ + TSgitFtdcRatioType CurrDelta; + ///޸ʱ + TSgitFtdcTimeType UpdateTime; + ///޸ĺ + TSgitFtdcMillisecType UpdateMillisec; + ///һ + TSgitFtdcPriceType BidPrice1; + ///һ + TSgitFtdcVolumeType BidVolume1; + ///һ + TSgitFtdcPriceType AskPrice1; + ///һ + TSgitFtdcVolumeType AskVolume1; + ///۶ + TSgitFtdcPriceType BidPrice2; + /// + TSgitFtdcVolumeType BidVolume2; + ///۶ + TSgitFtdcPriceType AskPrice2; + /// + TSgitFtdcVolumeType AskVolume2; + /// + TSgitFtdcPriceType BidPrice3; + /// + TSgitFtdcVolumeType BidVolume3; + /// + TSgitFtdcPriceType AskPrice3; + /// + TSgitFtdcVolumeType AskVolume3; + /// + TSgitFtdcPriceType BidPrice4; + /// + TSgitFtdcVolumeType BidVolume4; + /// + TSgitFtdcPriceType AskPrice4; + /// + TSgitFtdcVolumeType AskVolume4; + /// + TSgitFtdcPriceType BidPrice5; + /// + TSgitFtdcVolumeType BidVolume5; + /// + TSgitFtdcPriceType AskPrice5; + /// + TSgitFtdcVolumeType AskVolume5; + ///վ + TSgitFtdcPriceType AveragePrice; +}; + +///ͶߺԼȨ +struct CSgitFtdcInstrumentTradingRightField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TSgitFtdcInvestorRangeType InvestorRange; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Ȩ + TSgitFtdcTradingRightType TradingRight; +}; + +///͹˾û +struct CSgitFtdcBrokerUserField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///û + TSgitFtdcUserNameType UserName; + ///û + TSgitFtdcUserTypeType UserType; + ///ǷԾ + TSgitFtdcBoolType IsActive; + ///Ƿʹ + TSgitFtdcBoolType IsUsingOTP; +}; + +///͹˾û +struct CSgitFtdcBrokerUserPasswordField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + /// + TSgitFtdcPasswordType Password; +}; + +///͹˾ûȨ +struct CSgitFtdcBrokerUserFunctionField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///͹˾ܴ + TSgitFtdcBrokerFunctionCodeType BrokerFunctionCode; +}; + +///Ա̻ +struct CSgitFtdcTraderOfferField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + /// + TSgitFtdcPasswordType Password; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TSgitFtdcTraderConnectStatusType TraderConnectStatus; + /// + TSgitFtdcDateType ConnectRequestDate; + ///ʱ + TSgitFtdcTimeType ConnectRequestTime; + ///ϴα + TSgitFtdcDateType LastReportDate; + ///ϴαʱ + TSgitFtdcTimeType LastReportTime; + /// + TSgitFtdcDateType ConnectDate; + ///ʱ + TSgitFtdcTimeType ConnectTime; + /// + TSgitFtdcDateType StartDate; + ///ʱ + TSgitFtdcTimeType StartTime; + /// + TSgitFtdcDateType TradingDay; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///ϯλɽ + TSgitFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TSgitFtdcReturnCodeType MaxOrderMessageReference; +}; + +///Ͷ߽ +struct CSgitFtdcSettlementInfoField +{ + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcSequenceNoType SequenceNo; + ///Ϣ + TSgitFtdcContentType Content; +}; + +///Լ֤ʵ +struct CSgitFtdcInstrumentMarginRateAdjustField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TSgitFtdcInvestorRangeType InvestorRange; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TSgitFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TSgitFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TSgitFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TSgitFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TSgitFtdcBoolType IsRelative; +}; + +///֤ +struct CSgitFtdcExchangeMarginRateField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TSgitFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TSgitFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TSgitFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TSgitFtdcMoneyType ShortMarginRatioByVolume; +}; + +///֤ʵ +struct CSgitFtdcExchangeMarginRateAdjustField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + ///潻Ͷ߶ͷ֤ + TSgitFtdcRatioType LongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TSgitFtdcMoneyType LongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TSgitFtdcRatioType ShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TSgitFtdcMoneyType ShortMarginRatioByVolume; + ///ͷ֤ + TSgitFtdcRatioType ExchLongMarginRatioByMoney; + ///ͷ֤ + TSgitFtdcMoneyType ExchLongMarginRatioByVolume; + ///ͷ֤ + TSgitFtdcRatioType ExchShortMarginRatioByMoney; + ///ͷ֤ + TSgitFtdcMoneyType ExchShortMarginRatioByVolume; + ///潻Ͷ߶ͷ֤ + TSgitFtdcRatioType NoLongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TSgitFtdcMoneyType NoLongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TSgitFtdcRatioType NoShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TSgitFtdcMoneyType NoShortMarginRatioByVolume; +}; + +/// +struct CSgitFtdcSettlementRefField +{ + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; +}; + +///ǰʱ +struct CSgitFtdcCurrentTimeField +{ + ///ǰ + TSgitFtdcDateType CurrDate; + ///ǰʱ + TSgitFtdcTimeType CurrTime; + ///ǰʱ䣨룩 + TSgitFtdcMillisecType CurrMillisec; +}; + +///ͨѶ׶ +struct CSgitFtdcCommPhaseField +{ + /// + TSgitFtdcDateType TradingDay; + ///ͨѶʱα + TSgitFtdcCommPhaseNoType CommPhaseNo; +}; + +///¼Ϣ +struct CSgitFtdcLoginInfoField +{ + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///¼ + TSgitFtdcDateType LoginDate; + ///¼ʱ + TSgitFtdcTimeType LoginTime; + ///IPַ + TSgitFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TSgitFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TSgitFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TSgitFtdcProtocolInfoType ProtocolInfo; + ///ϵͳ + TSgitFtdcSystemNameType SystemName; + /// + TSgitFtdcPasswordType Password; + ///󱨵 + TSgitFtdcOrderRefType MaxOrderRef; + ///ʱ + TSgitFtdcTimeType SHFETime; + ///ʱ + TSgitFtdcTimeType DCETime; + ///֣ʱ + TSgitFtdcTimeType CZCETime; + ///нʱ + TSgitFtdcTimeType FFEXTime; + ///Macַ + TSgitFtdcMacAddressType MacAddress; + ///̬ + TSgitFtdcPasswordType OneTimePassword; +}; + +///¼Ϣ +struct CSgitFtdcLogoutAllField +{ + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ϵͳ + TSgitFtdcSystemNameType SystemName; +}; + +///ǰ״̬ +struct CSgitFtdcFrontStatusField +{ + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///ϴα + TSgitFtdcDateType LastReportDate; + ///ϴαʱ + TSgitFtdcTimeType LastReportTime; + ///ǷԾ + TSgitFtdcBoolType IsActive; +}; + +///û +struct CSgitFtdcUserPasswordUpdateField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///ԭĿ + TSgitFtdcPasswordType OldPassword; + ///µĿ + TSgitFtdcPasswordType NewPassword; +}; + +///뱨 +struct CSgitFtdcInputOrderField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcOrderRefType OrderRef; + ///û + TSgitFtdcUserIDType UserID; + ///۸ + TSgitFtdcOrderPriceTypeType OrderPriceType; + /// + TSgitFtdcDirectionType Direction; + ///Ͽƽ־ + TSgitFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSgitFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSgitFtdcPriceType LimitPrice; + /// + TSgitFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSgitFtdcTimeConditionType TimeCondition; + ///GTD + TSgitFtdcDateType GTDDate; + ///ɽ + TSgitFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSgitFtdcVolumeType MinVolume; + /// + TSgitFtdcContingentConditionType ContingentCondition; + ///ֹ + TSgitFtdcPriceType StopPrice; + ///ǿƽԭ + TSgitFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSgitFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSgitFtdcBusinessUnitType BusinessUnit; + /// + TSgitFtdcRequestIDType RequestID; + ///ûǿ־ + TSgitFtdcBoolType UserForceClose; +}; + +/// +struct CSgitFtdcOrderField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcOrderRefType OrderRef; + ///û + TSgitFtdcUserIDType UserID; + ///۸ + TSgitFtdcOrderPriceTypeType OrderPriceType; + /// + TSgitFtdcDirectionType Direction; + ///Ͽƽ־ + TSgitFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSgitFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSgitFtdcPriceType LimitPrice; + /// + TSgitFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSgitFtdcTimeConditionType TimeCondition; + ///GTD + TSgitFtdcDateType GTDDate; + ///ɽ + TSgitFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSgitFtdcVolumeType MinVolume; + /// + TSgitFtdcContingentConditionType ContingentCondition; + ///ֹ + TSgitFtdcPriceType StopPrice; + ///ǿƽԭ + TSgitFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSgitFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSgitFtdcBusinessUnitType BusinessUnit; + /// + TSgitFtdcRequestIDType RequestID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ύ״̬ + TSgitFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TSgitFtdcSequenceNoType NotifySequence; + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///Դ + TSgitFtdcOrderSourceType OrderSource; + ///״̬ + TSgitFtdcOrderStatusType OrderStatus; + /// + TSgitFtdcOrderTypeType OrderType; + ///ɽ + TSgitFtdcVolumeType VolumeTraded; + ///ʣ + TSgitFtdcVolumeType VolumeTotal; + /// + TSgitFtdcDateType InsertDate; + ///ίʱ + TSgitFtdcTimeType InsertTime; + ///ʱ + TSgitFtdcTimeType ActiveTime; + ///ʱ + TSgitFtdcTimeType SuspendTime; + ///޸ʱ + TSgitFtdcTimeType UpdateTime; + ///ʱ + TSgitFtdcTimeType CancelTime; + ///޸ĽԱ + TSgitFtdcTraderIDType ActiveTraderID; + ///Ա + TSgitFtdcParticipantIDType ClearingPartID; + /// + TSgitFtdcSequenceNoType SequenceNo; + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///û˲ƷϢ + TSgitFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TSgitFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TSgitFtdcBoolType UserForceClose; + ///û + TSgitFtdcUserIDType ActiveUserID; + ///͹˾ + TSgitFtdcSequenceNoType BrokerOrderSeq; + ///ر + TSgitFtdcOrderSysIDType RelativeOrderSysID; +}; + +/// +struct CSgitFtdcExchangeOrderField +{ + ///۸ + TSgitFtdcOrderPriceTypeType OrderPriceType; + /// + TSgitFtdcDirectionType Direction; + ///Ͽƽ־ + TSgitFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSgitFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSgitFtdcPriceType LimitPrice; + /// + TSgitFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSgitFtdcTimeConditionType TimeCondition; + ///GTD + TSgitFtdcDateType GTDDate; + ///ɽ + TSgitFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSgitFtdcVolumeType MinVolume; + /// + TSgitFtdcContingentConditionType ContingentCondition; + ///ֹ + TSgitFtdcPriceType StopPrice; + ///ǿƽԭ + TSgitFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSgitFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSgitFtdcBusinessUnitType BusinessUnit; + /// + TSgitFtdcRequestIDType RequestID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ύ״̬ + TSgitFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TSgitFtdcSequenceNoType NotifySequence; + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///Դ + TSgitFtdcOrderSourceType OrderSource; + ///״̬ + TSgitFtdcOrderStatusType OrderStatus; + /// + TSgitFtdcOrderTypeType OrderType; + ///ɽ + TSgitFtdcVolumeType VolumeTraded; + ///ʣ + TSgitFtdcVolumeType VolumeTotal; + /// + TSgitFtdcDateType InsertDate; + ///ίʱ + TSgitFtdcTimeType InsertTime; + ///ʱ + TSgitFtdcTimeType ActiveTime; + ///ʱ + TSgitFtdcTimeType SuspendTime; + ///޸ʱ + TSgitFtdcTimeType UpdateTime; + ///ʱ + TSgitFtdcTimeType CancelTime; + ///޸ĽԱ + TSgitFtdcTraderIDType ActiveTraderID; + ///Ա + TSgitFtdcParticipantIDType ClearingPartID; + /// + TSgitFtdcSequenceNoType SequenceNo; +}; + +///ʧ +struct CSgitFtdcExchangeOrderInsertErrorField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///뱨 +struct CSgitFtdcInputOrderActionField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcOrderActionRefType OrderActionRef; + /// + TSgitFtdcOrderRefType OrderRef; + /// + TSgitFtdcRequestIDType RequestID; + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///Ự + TSgitFtdcSessionIDType SessionID; + /// + TSgitFtdcExchangeIDType ExchangeID; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///־ + TSgitFtdcActionFlagType ActionFlag; + ///۸ + TSgitFtdcPriceType LimitPrice; + ///仯 + TSgitFtdcVolumeType VolumeChange; + ///û + TSgitFtdcUserIDType UserID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CSgitFtdcOrderActionField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcOrderActionRefType OrderActionRef; + /// + TSgitFtdcOrderRefType OrderRef; + /// + TSgitFtdcRequestIDType RequestID; + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///Ự + TSgitFtdcSessionIDType SessionID; + /// + TSgitFtdcExchangeIDType ExchangeID; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///־ + TSgitFtdcActionFlagType ActionFlag; + ///۸ + TSgitFtdcPriceType LimitPrice; + ///仯 + TSgitFtdcVolumeType VolumeChange; + /// + TSgitFtdcDateType ActionDate; + ///ʱ + TSgitFtdcTimeType ActionTime; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + ///ر + TSgitFtdcOrderLocalIDType ActionLocalID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///ҵԪ + TSgitFtdcBusinessUnitType BusinessUnit; + ///״̬ + TSgitFtdcOrderActionStatusType OrderActionStatus; + ///û + TSgitFtdcUserIDType UserID; + ///״̬Ϣ + TSgitFtdcErrorMsgType StatusMsg; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CSgitFtdcExchangeOrderActionField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///־ + TSgitFtdcActionFlagType ActionFlag; + ///۸ + TSgitFtdcPriceType LimitPrice; + ///仯 + TSgitFtdcVolumeType VolumeChange; + /// + TSgitFtdcDateType ActionDate; + ///ʱ + TSgitFtdcTimeType ActionTime; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + ///ر + TSgitFtdcOrderLocalIDType ActionLocalID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///ҵԪ + TSgitFtdcBusinessUnitType BusinessUnit; + ///״̬ + TSgitFtdcOrderActionStatusType OrderActionStatus; + ///û + TSgitFtdcUserIDType UserID; +}; + +///ʧ +struct CSgitFtdcExchangeOrderActionErrorField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + ///ر + TSgitFtdcOrderLocalIDType ActionLocalID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ɽ +struct CSgitFtdcExchangeTradeField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ɽ + TSgitFtdcTradeIDType TradeID; + /// + TSgitFtdcDirectionType Direction; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///׽ɫ + TSgitFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TSgitFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + ///۸ + TSgitFtdcPriceType Price; + /// + TSgitFtdcVolumeType Volume; + ///ɽʱ + TSgitFtdcDateType TradeDate; + ///ɽʱ + TSgitFtdcTimeType TradeTime; + ///ɽ + TSgitFtdcTradeTypeType TradeType; + ///ɽԴ + TSgitFtdcPriceSourceType PriceSource; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + ///Ա + TSgitFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TSgitFtdcBusinessUnitType BusinessUnit; + /// + TSgitFtdcSequenceNoType SequenceNo; + ///ɽԴ + TSgitFtdcTradeSourceType TradeSource; +}; + +///ɽ +struct CSgitFtdcTradeField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcOrderRefType OrderRef; + ///û + TSgitFtdcUserIDType UserID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ɽ + TSgitFtdcTradeIDType TradeID; + /// + TSgitFtdcDirectionType Direction; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///׽ɫ + TSgitFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TSgitFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + ///۸ + TSgitFtdcPriceType Price; + /// + TSgitFtdcVolumeType Volume; + ///ɽʱ + TSgitFtdcDateType TradeDate; + ///ɽʱ + TSgitFtdcTimeType TradeTime; + ///ɽ + TSgitFtdcTradeTypeType TradeType; + ///ɽԴ + TSgitFtdcPriceSourceType PriceSource; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + ///Ա + TSgitFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TSgitFtdcBusinessUnitType BusinessUnit; + /// + TSgitFtdcSequenceNoType SequenceNo; + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; + ///͹˾ + TSgitFtdcSequenceNoType BrokerOrderSeq; + ///ɽԴ + TSgitFtdcTradeSourceType TradeSource; +}; + +///ûỰ +struct CSgitFtdcUserSessionField +{ + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///¼ + TSgitFtdcDateType LoginDate; + ///¼ʱ + TSgitFtdcTimeType LoginTime; + ///IPַ + TSgitFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TSgitFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TSgitFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TSgitFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TSgitFtdcMacAddressType MacAddress; +}; + +///ѯ󱨵 +struct CSgitFtdcQueryMaxOrderVolumeField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcDirectionType Direction; + ///ƽ־ + TSgitFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + /// + TSgitFtdcVolumeType MaxVolume; +}; + +///Ͷ߽ȷϢ +struct CSgitFtdcSettlementInfoConfirmField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ȷ + TSgitFtdcDateType ConfirmDate; + ///ȷʱ + TSgitFtdcTimeType ConfirmTime; +}; + +///ͬ +struct CSgitFtdcSyncDepositField +{ + ///ˮ + TSgitFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcMoneyType Deposit; + ///Ƿǿƽ + TSgitFtdcBoolType IsForce; +}; + +///͹˾ͬ +struct CSgitFtdcBrokerSyncField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; +}; + +///ͬеͶ +struct CSgitFtdcSyncingInvestorField +{ + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TSgitFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TSgitFtdcPartyNameType InvestorName; + ///֤ + TSgitFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TSgitFtdcBoolType IsActive; + ///ϵ绰 + TSgitFtdcTelephoneType Telephone; + ///ͨѶַ + TSgitFtdcAddressType Address; + /// + TSgitFtdcDateType OpenDate; + ///ֻ + TSgitFtdcMobileType Mobile; + ///ģ + TSgitFtdcInvestorIDType CommModelID; +}; + +///ͬеĽ״ +struct CSgitFtdcSyncingTradingCodeField +{ + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///ǷԾ + TSgitFtdcBoolType IsActive; + ///ױ + TSgitFtdcClientIDTypeType ClientIDType; +}; + +///ͬеͶ߷ +struct CSgitFtdcSyncingInvestorGroupField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TSgitFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TSgitFtdcInvestorGroupNameType InvestorGroupName; +}; + +///ͬеĽ˺ +struct CSgitFtdcSyncingTradingAccountField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ϴѺ + TSgitFtdcMoneyType PreMortgage; + ///ϴö + TSgitFtdcMoneyType PreCredit; + ///ϴδ + TSgitFtdcMoneyType PreDeposit; + ///ϴν׼ + TSgitFtdcMoneyType PreBalance; + ///ϴռõı֤ + TSgitFtdcMoneyType PreMargin; + ///Ϣ + TSgitFtdcMoneyType InterestBase; + ///Ϣ + TSgitFtdcMoneyType Interest; + /// + TSgitFtdcMoneyType Deposit; + /// + TSgitFtdcMoneyType Withdraw; + ///ı֤ + TSgitFtdcMoneyType FrozenMargin; + ///ʽ + TSgitFtdcMoneyType FrozenCash; + /// + TSgitFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TSgitFtdcMoneyType CurrMargin; + ///ʽ + TSgitFtdcMoneyType CashIn; + /// + TSgitFtdcMoneyType Commission; + ///ƽӯ + TSgitFtdcMoneyType CloseProfit; + ///ֲӯ + TSgitFtdcMoneyType PositionProfit; + ///ڻ׼ + TSgitFtdcMoneyType Balance; + ///ʽ + TSgitFtdcMoneyType Available; + ///ȡʽ + TSgitFtdcMoneyType WithdrawQuota; + ///׼ + TSgitFtdcMoneyType Reserve; + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; + ///ö + TSgitFtdcMoneyType Credit; + ///Ѻ + TSgitFtdcMoneyType Mortgage; + ///֤ + TSgitFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TSgitFtdcMoneyType DeliveryMargin; + ///֤ + TSgitFtdcMoneyType ExchangeDeliveryMargin; +}; + +///ͬеͶֲ߳ +struct CSgitFtdcSyncingInvestorPositionField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ֲֶշ + TSgitFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + ///ֲ + TSgitFtdcPositionDateType PositionDate; + ///ճֲ + TSgitFtdcVolumeType YdPosition; + ///ճֲ + TSgitFtdcVolumeType Position; + ///ͷ + TSgitFtdcVolumeType LongFrozen; + ///ͷ + TSgitFtdcVolumeType ShortFrozen; + ///ֶ + TSgitFtdcMoneyType LongFrozenAmount; + ///ֶ + TSgitFtdcMoneyType ShortFrozenAmount; + /// + TSgitFtdcVolumeType OpenVolume; + ///ƽ + TSgitFtdcVolumeType CloseVolume; + ///ֽ + TSgitFtdcMoneyType OpenAmount; + ///ƽֽ + TSgitFtdcMoneyType CloseAmount; + ///ֲֳɱ + TSgitFtdcMoneyType PositionCost; + ///ϴռõı֤ + TSgitFtdcMoneyType PreMargin; + ///ռõı֤ + TSgitFtdcMoneyType UseMargin; + ///ı֤ + TSgitFtdcMoneyType FrozenMargin; + ///ʽ + TSgitFtdcMoneyType FrozenCash; + /// + TSgitFtdcMoneyType FrozenCommission; + ///ʽ + TSgitFtdcMoneyType CashIn; + /// + TSgitFtdcMoneyType Commission; + ///ƽӯ + TSgitFtdcMoneyType CloseProfit; + ///ֲӯ + TSgitFtdcMoneyType PositionProfit; + ///ϴν + TSgitFtdcPriceType PreSettlementPrice; + ///ν + TSgitFtdcPriceType SettlementPrice; + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; + ///ֳɱ + TSgitFtdcMoneyType OpenCost; + ///֤ + TSgitFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TSgitFtdcVolumeType CombPosition; + ///϶ͷ + TSgitFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TSgitFtdcVolumeType CombShortFrozen; + ///նƽӯ + TSgitFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TSgitFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TSgitFtdcVolumeType TodayPosition; + ///֤ + TSgitFtdcRatioType MarginRateByMoney; + ///֤() + TSgitFtdcRatioType MarginRateByVolume; +}; + +///ͬеĺԼ֤ +struct CSgitFtdcSyncingInstrumentMarginRateField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TSgitFtdcInvestorRangeType InvestorRange; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TSgitFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TSgitFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TSgitFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TSgitFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TSgitFtdcBoolType IsRelative; +}; + +///ͬеĺԼ +struct CSgitFtdcSyncingInstrumentCommissionRateField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TSgitFtdcInvestorRangeType InvestorRange; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcRatioType OpenRatioByMoney; + /// + TSgitFtdcRatioType OpenRatioByVolume; + ///ƽ + TSgitFtdcRatioType CloseRatioByMoney; + ///ƽ + TSgitFtdcRatioType CloseRatioByVolume; + ///ƽ + TSgitFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TSgitFtdcRatioType CloseTodayRatioByVolume; +}; + +///ͬеĺԼȨ +struct CSgitFtdcSyncingInstrumentTradingRightField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TSgitFtdcInvestorRangeType InvestorRange; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Ȩ + TSgitFtdcTradingRightType TradingRight; +}; + +///ѯ +struct CSgitFtdcQryOrderField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcExchangeIDType ExchangeID; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TSgitFtdcTimeType InsertTimeStart; + ///ʱ + TSgitFtdcTimeType InsertTimeEnd; +}; + +///ѯɽ +struct CSgitFtdcQryTradeField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ɽ + TSgitFtdcTradeIDType TradeID; + ///ʼʱ + TSgitFtdcTimeType TradeTimeStart; + ///ʱ + TSgitFtdcTimeType TradeTimeEnd; +}; + +///ѯͶֲ߳ +struct CSgitFtdcQryInvestorPositionField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; +}; + +///ѯʽ˻ +struct CSgitFtdcQryTradingAccountField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; +}; + +///ѯͶ +struct CSgitFtdcQryInvestorField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; +}; + +///ѯױ +struct CSgitFtdcQryTradingCodeField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///ױ + TSgitFtdcClientIDTypeType ClientIDType; +}; + +///ѯױ +struct CSgitFtdcQryInvestorGroupField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; +}; + +///ѯױ +struct CSgitFtdcQryInstrumentMarginRateField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; +}; + +///ѯױ +struct CSgitFtdcQryInstrumentCommissionRateField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; +}; + +///ѯױ +struct CSgitFtdcQryInstrumentTradingRightField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; +}; + +///ѯ͹˾ +struct CSgitFtdcQryBrokerField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; +}; + +///ѯԱ +struct CSgitFtdcQryTraderField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///Ա + TSgitFtdcTraderIDType TraderID; +}; + +///ѯ͹˾Ա +struct CSgitFtdcQryPartBrokerField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; +}; + +///ѯûȨ +struct CSgitFtdcQrySuperUserFunctionField +{ + ///û + TSgitFtdcUserIDType UserID; +}; + +///ѯûỰ +struct CSgitFtdcQryUserSessionField +{ + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; +}; + +///ѯǰ״̬ +struct CSgitFtdcQryFrontStatusField +{ + ///ǰñ + TSgitFtdcFrontIDType FrontID; +}; + +///ѯ +struct CSgitFtdcQryExchangeOrderField +{ + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcTraderIDType TraderID; +}; + +///ѯ +struct CSgitFtdcQryOrderActionField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CSgitFtdcQryExchangeOrderActionField +{ + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///ͻ + TSgitFtdcClientIDType ClientID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcTraderIDType TraderID; +}; + +///ѯû +struct CSgitFtdcQrySuperUserField +{ + ///û + TSgitFtdcUserIDType UserID; +}; + +///ѯ +struct CSgitFtdcQryExchangeField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; +}; + +///ѯƷ +struct CSgitFtdcQryProductField +{ + ///Ʒ + TSgitFtdcInstrumentIDType ProductID; +}; + +///ѯԼ +struct CSgitFtdcQryInstrumentField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TSgitFtdcInstrumentIDType ProductID; +}; + +///ѯ +struct CSgitFtdcQryDepthMarketDataField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; +}; + +///ѯ͹˾û +struct CSgitFtdcQryBrokerUserField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; +}; + +///ѯ͹˾ûȨ +struct CSgitFtdcQryBrokerUserFunctionField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; +}; + +///ѯԱ̻ +struct CSgitFtdcQryTraderOfferField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///Ա + TSgitFtdcTraderIDType TraderID; +}; + +///ѯˮ +struct CSgitFtdcQrySyncDepositField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///ˮ + TSgitFtdcDepositSeqNoType DepositSeqNo; +}; + +///ѯͶ߽ +struct CSgitFtdcQrySettlementInfoField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcDateType TradingDay; +}; + +///ѯ +struct CSgitFtdcQryHisOrderField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcExchangeIDType ExchangeID; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TSgitFtdcTimeType InsertTimeStart; + ///ʱ + TSgitFtdcTimeType InsertTimeEnd; + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; +}; + +///г +struct CSgitFtdcMarketDataField +{ + /// + TSgitFtdcDateType TradingDay; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TSgitFtdcPriceType LastPrice; + ///ϴν + TSgitFtdcPriceType PreSettlementPrice; + /// + TSgitFtdcPriceType PreClosePrice; + ///ֲ + TSgitFtdcLargeVolumeType PreOpenInterest; + /// + TSgitFtdcPriceType OpenPrice; + ///߼ + TSgitFtdcPriceType HighestPrice; + ///ͼ + TSgitFtdcPriceType LowestPrice; + /// + TSgitFtdcVolumeType Volume; + ///ɽ + TSgitFtdcMoneyType Turnover; + ///ֲ + TSgitFtdcLargeVolumeType OpenInterest; + /// + TSgitFtdcPriceType ClosePrice; + ///ν + TSgitFtdcPriceType SettlementPrice; + ///ͣ + TSgitFtdcPriceType UpperLimitPrice; + ///ͣ + TSgitFtdcPriceType LowerLimitPrice; + ///ʵ + TSgitFtdcRatioType PreDelta; + ///ʵ + TSgitFtdcRatioType CurrDelta; + ///޸ʱ + TSgitFtdcTimeType UpdateTime; + ///޸ĺ + TSgitFtdcMillisecType UpdateMillisec; +}; + +/// +struct CSgitFtdcMarketDataBaseField +{ + /// + TSgitFtdcDateType TradingDay; + ///ϴν + TSgitFtdcPriceType PreSettlementPrice; + /// + TSgitFtdcPriceType PreClosePrice; + ///ֲ + TSgitFtdcLargeVolumeType PreOpenInterest; + ///ʵ + TSgitFtdcRatioType PreDelta; +}; + +///龲̬ +struct CSgitFtdcMarketDataStaticField +{ + /// + TSgitFtdcPriceType OpenPrice; + ///߼ + TSgitFtdcPriceType HighestPrice; + ///ͼ + TSgitFtdcPriceType LowestPrice; + /// + TSgitFtdcPriceType ClosePrice; + ///ͣ + TSgitFtdcPriceType UpperLimitPrice; + ///ͣ + TSgitFtdcPriceType LowerLimitPrice; + ///ν + TSgitFtdcPriceType SettlementPrice; + ///ʵ + TSgitFtdcRatioType CurrDelta; +}; + +///³ɽ +struct CSgitFtdcMarketDataLastMatchField +{ + ///¼ + TSgitFtdcPriceType LastPrice; + /// + TSgitFtdcVolumeType Volume; + ///ɽ + TSgitFtdcMoneyType Turnover; + ///ֲ + TSgitFtdcLargeVolumeType OpenInterest; +}; + +///ż +struct CSgitFtdcMarketDataBestPriceField +{ + ///һ + TSgitFtdcPriceType BidPrice1; + ///һ + TSgitFtdcVolumeType BidVolume1; + ///һ + TSgitFtdcPriceType AskPrice1; + ///һ + TSgitFtdcVolumeType AskVolume1; +}; + +/// +struct CSgitFtdcMarketDataBid23Field +{ + ///۶ + TSgitFtdcPriceType BidPrice2; + /// + TSgitFtdcVolumeType BidVolume2; + /// + TSgitFtdcPriceType BidPrice3; + /// + TSgitFtdcVolumeType BidVolume3; +}; + +/// +struct CSgitFtdcMarketDataAsk23Field +{ + ///۶ + TSgitFtdcPriceType AskPrice2; + /// + TSgitFtdcVolumeType AskVolume2; + /// + TSgitFtdcPriceType AskPrice3; + /// + TSgitFtdcVolumeType AskVolume3; +}; + +///ġ +struct CSgitFtdcMarketDataBid45Field +{ + /// + TSgitFtdcPriceType BidPrice4; + /// + TSgitFtdcVolumeType BidVolume4; + /// + TSgitFtdcPriceType BidPrice5; + /// + TSgitFtdcVolumeType BidVolume5; +}; + +///ġ +struct CSgitFtdcMarketDataAsk45Field +{ + /// + TSgitFtdcPriceType AskPrice4; + /// + TSgitFtdcVolumeType AskVolume4; + /// + TSgitFtdcPriceType AskPrice5; + /// + TSgitFtdcVolumeType AskVolume5; +}; + +///ʱ +struct CSgitFtdcMarketDataUpdateTimeField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///޸ʱ + TSgitFtdcTimeType UpdateTime; + ///޸ĺ + TSgitFtdcMillisecType UpdateMillisec; +}; + +///齻 +struct CSgitFtdcMarketDataExchangeField +{ + /// + TSgitFtdcPriceType ExchangeID; +}; + +///ָĺԼ +struct CSgitFtdcSpecificInstrumentField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; +}; + +///Լ״̬ +struct CSgitFtdcInstrumentStatusField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; + /// + TSgitFtdcSettlementGroupIDType SettlementGroupID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Լ״̬ + TSgitFtdcInstrumentStatusType InstrumentStatus; + ///׽׶α + TSgitFtdcTradingSegmentSNType TradingSegmentSN; + ///뱾״̬ʱ + TSgitFtdcTimeType EnterTime; + ///뱾״̬ԭ + TSgitFtdcInstStatusEnterReasonType EnterReason; +}; + +///ѯԼ״̬ +struct CSgitFtdcQryInstrumentStatusField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; +}; + +///Ͷ˻ +struct CSgitFtdcInvestorAccountField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; +}; + +///ӯ㷨 +struct CSgitFtdcPositionProfitAlgorithmField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ӯ㷨 + TSgitFtdcAlgorithmType Algorithm; + ///ע + TSgitFtdcMemoType Memo; +}; + +///Աʽۿ +struct CSgitFtdcDiscountField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TSgitFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ʽۿ۱ + TSgitFtdcRatioType Discount; +}; + +///ѯת +struct CSgitFtdcQryTransferBankField +{ + ///д + TSgitFtdcBankIDType BankID; + ///зĴ + TSgitFtdcBankBrchIDType BankBrchID; +}; + +///ת +struct CSgitFtdcTransferBankField +{ + ///д + TSgitFtdcBankIDType BankID; + ///зĴ + TSgitFtdcBankBrchIDType BankBrchID; + /// + TSgitFtdcBankNameType BankName; + ///ǷԾ + TSgitFtdcBoolType IsActive; +}; + +///ѯͶֲ߳ϸ +struct CSgitFtdcQryInvestorPositionDetailField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; +}; + +///Ͷֲ߳ϸ +struct CSgitFtdcInvestorPositionDetailField +{ + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + /// + TSgitFtdcDirectionType Direction; + /// + TSgitFtdcDateType OpenDate; + ///ɽ + TSgitFtdcTradeIDType TradeID; + /// + TSgitFtdcVolumeType Volume; + ///ּ + TSgitFtdcPriceType OpenPrice; + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; + ///ɽ + TSgitFtdcTradeTypeType TradeType; + ///ϺԼ + TSgitFtdcInstrumentIDType CombInstrumentID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///նƽӯ + TSgitFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TSgitFtdcMoneyType CloseProfitByTrade; + ///նгֲӯ + TSgitFtdcMoneyType PositionProfitByDate; + ///ʶԳֲӯ + TSgitFtdcMoneyType PositionProfitByTrade; + ///Ͷ֤߱ + TSgitFtdcMoneyType Margin; + ///֤ + TSgitFtdcMoneyType ExchMargin; + ///֤ + TSgitFtdcRatioType MarginRateByMoney; + ///֤() + TSgitFtdcRatioType MarginRateByVolume; + /// + TSgitFtdcPriceType LastSettlementPrice; + /// + TSgitFtdcPriceType SettlementPrice; + ///ƽ + TSgitFtdcVolumeType CloseVolume; + ///ƽֽ + TSgitFtdcMoneyType CloseAmount; +}; + +///ʽ˻ +struct CSgitFtdcTradingAccountPasswordField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + /// + TSgitFtdcPasswordType Password; +}; + +///鱨̻ +struct CSgitFtdcMDTraderOfferField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + /// + TSgitFtdcPasswordType Password; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TSgitFtdcTraderConnectStatusType TraderConnectStatus; + /// + TSgitFtdcDateType ConnectRequestDate; + ///ʱ + TSgitFtdcTimeType ConnectRequestTime; + ///ϴα + TSgitFtdcDateType LastReportDate; + ///ϴαʱ + TSgitFtdcTimeType LastReportTime; + /// + TSgitFtdcDateType ConnectDate; + ///ʱ + TSgitFtdcTimeType ConnectTime; + /// + TSgitFtdcDateType StartDate; + ///ʱ + TSgitFtdcTimeType StartTime; + /// + TSgitFtdcDateType TradingDay; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///ϯλɽ + TSgitFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TSgitFtdcReturnCodeType MaxOrderMessageReference; +}; + +///ѯ鱨̻ +struct CSgitFtdcQryMDTraderOfferField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///Ա + TSgitFtdcTraderIDType TraderID; +}; + +///ѯͻ֪ͨ +struct CSgitFtdcQryNoticeField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; +}; + +///ͻ֪ͨ +struct CSgitFtdcNoticeField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ϣ + TSgitFtdcContentType Content; + ///͹˾֪ͨк + TSgitFtdcSequenceLabelType SequenceLabel; +}; + +///ûȨ +struct CSgitFtdcUserRightField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///ͻȨ + TSgitFtdcUserRightTypeType UserRightType; + ///Ƿֹ + TSgitFtdcBoolType IsForbidden; +}; + +///ѯϢȷ +struct CSgitFtdcQrySettlementInfoConfirmField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; +}; + +///װؽϢ +struct CSgitFtdcLoadSettlementInfoField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; +}; + +///͹˾ʽ㷨 +struct CSgitFtdcBrokerWithdrawAlgorithmField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///ʽ㷨 + TSgitFtdcAlgorithmType WithdrawAlgorithm; + ///ʽʹ + TSgitFtdcRatioType UsingRatio; + ///Ƿƽӯ + TSgitFtdcIncludeCloseProfitType IncludeCloseProfit; + ///޲޳ɽͻǷܿ + TSgitFtdcAllWithoutTradeType AllWithoutTrade; + ///Ƿƽӯ + TSgitFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///Ƿû¼ + TSgitFtdcBoolType IsBrokerUserEvent; +}; + +///ʽ˻ +struct CSgitFtdcTradingAccountPasswordUpdateV1Field +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ԭĿ + TSgitFtdcPasswordType OldPassword; + ///µĿ + TSgitFtdcPasswordType NewPassword; +}; + +///ʽ˻ +struct CSgitFtdcTradingAccountPasswordUpdateField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ԭĿ + TSgitFtdcPasswordType OldPassword; + ///µĿ + TSgitFtdcPasswordType NewPassword; +}; + +///ѯϺԼ +struct CSgitFtdcQryCombinationLegField +{ + ///ϺԼ + TSgitFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TSgitFtdcLegIDType LegID; + ///ȺԼ + TSgitFtdcInstrumentIDType LegInstrumentID; +}; + +///ѯϺԼ +struct CSgitFtdcQrySyncStatusField +{ + /// + TSgitFtdcDateType TradingDay; +}; + +///Ͻ׺Լĵ +struct CSgitFtdcCombinationLegField +{ + ///ϺԼ + TSgitFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TSgitFtdcLegIDType LegID; + ///ȺԼ + TSgitFtdcInstrumentIDType LegInstrumentID; + /// + TSgitFtdcDirectionType Direction; + ///ȳ + TSgitFtdcLegMultipleType LegMultiple; + /// + TSgitFtdcImplyLevelType ImplyLevel; +}; + +///ͬ״̬ +struct CSgitFtdcSyncStatusField +{ + /// + TSgitFtdcDateType TradingDay; + ///ͬ״̬ + TSgitFtdcDataSyncStatusType DataSyncStatus; +}; + +///ѯϵ +struct CSgitFtdcQryLinkManField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; +}; + +///ϵ +struct CSgitFtdcLinkManField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ϵ + TSgitFtdcPersonTypeType PersonType; + ///֤ + TSgitFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + /// + TSgitFtdcPartyNameType PersonName; + ///ϵ绰 + TSgitFtdcTelephoneType Telephone; + ///ͨѶַ + TSgitFtdcAddressType Address; + /// + TSgitFtdcZipCodeType ZipCode; + ///ȼ + TSgitFtdcPriorityType Priority; +}; + +///ѯ͹˾û¼ +struct CSgitFtdcQryBrokerUserEventField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///û¼ + TSgitFtdcUserEventTypeType UserEventType; +}; + +///ѯ͹˾û¼ +struct CSgitFtdcBrokerUserEventField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///û¼ + TSgitFtdcUserEventTypeType UserEventType; + ///û¼ + TSgitFtdcSequenceNoType EventSequenceNo; + ///¼ + TSgitFtdcDateType EventDate; + ///¼ʱ + TSgitFtdcTimeType EventTime; + ///û¼Ϣ + TSgitFtdcUserEventInfoType UserEventInfo; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; +}; + +///ѯǩԼ +struct CSgitFtdcQryContractBankField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///д + TSgitFtdcBankIDType BankID; + ///зĴ + TSgitFtdcBankBrchIDType BankBrchID; +}; + +///ѯǩԼӦ +struct CSgitFtdcContractBankField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///д + TSgitFtdcBankIDType BankID; + ///зĴ + TSgitFtdcBankBrchIDType BankBrchID; + /// + TSgitFtdcBankNameType BankName; +}; + +///Ͷϳֲϸ +struct CSgitFtdcInvestorPositionCombineDetailField +{ + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcDateType OpenDate; + /// + TSgitFtdcExchangeIDType ExchangeID; + /// + TSgitFtdcSettlementIDType SettlementID; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ϱ + TSgitFtdcTradeIDType ComTradeID; + ///ϱ + TSgitFtdcTradeIDType TradeID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + /// + TSgitFtdcDirectionType Direction; + ///ֲ + TSgitFtdcVolumeType TotalAmt; + ///Ͷ֤߱ + TSgitFtdcMoneyType Margin; + ///֤ + TSgitFtdcMoneyType ExchMargin; + ///֤ + TSgitFtdcRatioType MarginRateByMoney; + ///֤() + TSgitFtdcRatioType MarginRateByVolume; + ///ȱ + TSgitFtdcLegIDType LegID; + ///ȳ + TSgitFtdcLegMultipleType LegMultiple; + ///ϳֲֺԼ + TSgitFtdcInstrumentIDType CombInstrumentID; +}; + +///Ԥ +struct CSgitFtdcParkedOrderField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcOrderRefType OrderRef; + ///û + TSgitFtdcUserIDType UserID; + ///۸ + TSgitFtdcOrderPriceTypeType OrderPriceType; + /// + TSgitFtdcDirectionType Direction; + ///Ͽƽ־ + TSgitFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSgitFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSgitFtdcPriceType LimitPrice; + /// + TSgitFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSgitFtdcTimeConditionType TimeCondition; + ///GTD + TSgitFtdcDateType GTDDate; + ///ɽ + TSgitFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSgitFtdcVolumeType MinVolume; + /// + TSgitFtdcContingentConditionType ContingentCondition; + ///ֹ + TSgitFtdcPriceType StopPrice; + ///ǿƽԭ + TSgitFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSgitFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSgitFtdcBusinessUnitType BusinessUnit; + /// + TSgitFtdcRequestIDType RequestID; + ///ûǿ־ + TSgitFtdcBoolType UserForceClose; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ԥ񱨵 + TSgitFtdcParkedOrderIDType ParkedOrderID; + ///û + TSgitFtdcUserTypeType UserType; + ///Ԥ״̬ + TSgitFtdcParkedOrderStatusType Status; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///Ԥ񵥲 +struct CSgitFtdcParkedOrderActionField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcOrderActionRefType OrderActionRef; + /// + TSgitFtdcOrderRefType OrderRef; + /// + TSgitFtdcRequestIDType RequestID; + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///Ự + TSgitFtdcSessionIDType SessionID; + /// + TSgitFtdcExchangeIDType ExchangeID; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///־ + TSgitFtdcActionFlagType ActionFlag; + ///۸ + TSgitFtdcPriceType LimitPrice; + ///仯 + TSgitFtdcVolumeType VolumeChange; + ///û + TSgitFtdcUserIDType UserID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///Ԥ񳷵 + TSgitFtdcParkedOrderActionIDType ParkedOrderActionID; + ///û + TSgitFtdcUserTypeType UserType; + ///Ԥ񳷵״̬ + TSgitFtdcParkedOrderStatusType Status; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ѯԤ +struct CSgitFtdcQryParkedOrderField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcExchangeIDType ExchangeID; +}; + +///ѯԤ񳷵 +struct CSgitFtdcQryParkedOrderActionField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcExchangeIDType ExchangeID; +}; + +///ɾԤ +struct CSgitFtdcRemoveParkedOrderField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Ԥ񱨵 + TSgitFtdcParkedOrderIDType ParkedOrderID; +}; + +///ɾԤ񳷵 +struct CSgitFtdcRemoveParkedOrderActionField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Ԥ񳷵 + TSgitFtdcParkedOrderActionIDType ParkedOrderActionID; +}; + +///͹˾ʽ㷨 +struct CSgitFtdcInvestorWithdrawAlgorithmField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TSgitFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ʽ + TSgitFtdcRatioType UsingRatio; +}; + +///ѯϳֲϸ +struct CSgitFtdcQryInvestorPositionCombineDetailField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ϳֲֺԼ + TSgitFtdcInstrumentIDType CombInstrumentID; +}; + +///ɽ +struct CSgitFtdcMarketDataAveragePriceField +{ + ///վ + TSgitFtdcPriceType AveragePrice; +}; + +///УͶ +struct CSgitFtdcVerifyInvestorPasswordField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcPasswordType Password; +}; + +///ûIP +struct CSgitFtdcUserIPField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///IPַ + TSgitFtdcIPAddressType IPAddress; + ///IPַ + TSgitFtdcIPAddressType IPMask; + ///Macַ + TSgitFtdcMacAddressType MacAddress; +}; + +///û¼֪ͨϢ +struct CSgitFtdcTradingNoticeInfoField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ʱ + TSgitFtdcTimeType SendTime; + ///Ϣ + TSgitFtdcContentType FieldContent; + ///ϵк + TSgitFtdcSequenceSeriesType SequenceSeries; + ///к + TSgitFtdcSequenceNoType SequenceNo; +}; + +///û¼֪ͨ +struct CSgitFtdcTradingNoticeField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TSgitFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ϵк + TSgitFtdcSequenceSeriesType SequenceSeries; + ///û + TSgitFtdcUserIDType UserID; + ///ʱ + TSgitFtdcTimeType SendTime; + ///к + TSgitFtdcSequenceNoType SequenceNo; + ///Ϣ + TSgitFtdcContentType FieldContent; +}; + +///ѯ¼֪ͨ +struct CSgitFtdcQryTradingNoticeField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; +}; + +///ѯ󱨵 +struct CSgitFtdcQryErrOrderField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; +}; + +///󱨵 +struct CSgitFtdcErrOrderField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcOrderRefType OrderRef; + ///û + TSgitFtdcUserIDType UserID; + ///۸ + TSgitFtdcOrderPriceTypeType OrderPriceType; + /// + TSgitFtdcDirectionType Direction; + ///Ͽƽ־ + TSgitFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSgitFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSgitFtdcPriceType LimitPrice; + /// + TSgitFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSgitFtdcTimeConditionType TimeCondition; + ///GTD + TSgitFtdcDateType GTDDate; + ///ɽ + TSgitFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSgitFtdcVolumeType MinVolume; + /// + TSgitFtdcContingentConditionType ContingentCondition; + ///ֹ + TSgitFtdcPriceType StopPrice; + ///ǿƽԭ + TSgitFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSgitFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSgitFtdcBusinessUnitType BusinessUnit; + /// + TSgitFtdcRequestIDType RequestID; + ///ûǿ־ + TSgitFtdcBoolType UserForceClose; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ѯ󱨵 +struct CSgitFtdcErrorConditionalOrderField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcOrderRefType OrderRef; + ///û + TSgitFtdcUserIDType UserID; + ///۸ + TSgitFtdcOrderPriceTypeType OrderPriceType; + /// + TSgitFtdcDirectionType Direction; + ///Ͽƽ־ + TSgitFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSgitFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSgitFtdcPriceType LimitPrice; + /// + TSgitFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSgitFtdcTimeConditionType TimeCondition; + ///GTD + TSgitFtdcDateType GTDDate; + ///ɽ + TSgitFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSgitFtdcVolumeType MinVolume; + /// + TSgitFtdcContingentConditionType ContingentCondition; + ///ֹ + TSgitFtdcPriceType StopPrice; + ///ǿƽԭ + TSgitFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSgitFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSgitFtdcBusinessUnitType BusinessUnit; + /// + TSgitFtdcRequestIDType RequestID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///ԼڽĴ + TSgitFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ύ״̬ + TSgitFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TSgitFtdcSequenceNoType NotifySequence; + /// + TSgitFtdcDateType TradingDay; + /// + TSgitFtdcSettlementIDType SettlementID; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///Դ + TSgitFtdcOrderSourceType OrderSource; + ///״̬ + TSgitFtdcOrderStatusType OrderStatus; + /// + TSgitFtdcOrderTypeType OrderType; + ///ɽ + TSgitFtdcVolumeType VolumeTraded; + ///ʣ + TSgitFtdcVolumeType VolumeTotal; + /// + TSgitFtdcDateType InsertDate; + ///ίʱ + TSgitFtdcTimeType InsertTime; + ///ʱ + TSgitFtdcTimeType ActiveTime; + ///ʱ + TSgitFtdcTimeType SuspendTime; + ///޸ʱ + TSgitFtdcTimeType UpdateTime; + ///ʱ + TSgitFtdcTimeType CancelTime; + ///޸ĽԱ + TSgitFtdcTraderIDType ActiveTraderID; + ///Ա + TSgitFtdcParticipantIDType ClearingPartID; + /// + TSgitFtdcSequenceNoType SequenceNo; + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///û˲ƷϢ + TSgitFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TSgitFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TSgitFtdcBoolType UserForceClose; + ///û + TSgitFtdcUserIDType ActiveUserID; + ///͹˾ + TSgitFtdcSequenceNoType BrokerOrderSeq; + ///ر + TSgitFtdcOrderSysIDType RelativeOrderSysID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ѯ󱨵 +struct CSgitFtdcQryErrOrderActionField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; +}; + +///󱨵 +struct CSgitFtdcErrOrderActionField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcOrderActionRefType OrderActionRef; + /// + TSgitFtdcOrderRefType OrderRef; + /// + TSgitFtdcRequestIDType RequestID; + ///ǰñ + TSgitFtdcFrontIDType FrontID; + ///Ự + TSgitFtdcSessionIDType SessionID; + /// + TSgitFtdcExchangeIDType ExchangeID; + /// + TSgitFtdcOrderSysIDType OrderSysID; + ///־ + TSgitFtdcActionFlagType ActionFlag; + ///۸ + TSgitFtdcPriceType LimitPrice; + ///仯 + TSgitFtdcVolumeType VolumeChange; + /// + TSgitFtdcDateType ActionDate; + ///ʱ + TSgitFtdcTimeType ActionTime; + ///Ա + TSgitFtdcTraderIDType TraderID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ر + TSgitFtdcOrderLocalIDType OrderLocalID; + ///ر + TSgitFtdcOrderLocalIDType ActionLocalID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + ///ͻ + TSgitFtdcClientIDType ClientID; + ///ҵԪ + TSgitFtdcBusinessUnitType BusinessUnit; + ///״̬ + TSgitFtdcOrderActionStatusType OrderActionStatus; + ///û + TSgitFtdcUserIDType UserID; + ///״̬Ϣ + TSgitFtdcErrorMsgType StatusMsg; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ѯ״̬ +struct CSgitFtdcQryExchangeSequenceField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; +}; + +///״̬ +struct CSgitFtdcExchangeSequenceField +{ + /// + TSgitFtdcExchangeIDType ExchangeID; + /// + TSgitFtdcSequenceNoType SequenceNo; + ///Լ״̬ + TSgitFtdcInstrumentStatusType MarketStatus; +}; + +///ݼ۸ѯ󱨵 +struct CSgitFtdcQueryMaxOrderVolumeWithPriceField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcDirectionType Direction; + ///ƽ־ + TSgitFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + /// + TSgitFtdcVolumeType MaxVolume; + ///۸ + TSgitFtdcPriceType Price; +}; + +///ѯ͹˾ײ +struct CSgitFtdcQryBrokerTradingParamsField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; +}; + +///͹˾ײ +struct CSgitFtdcBrokerTradingParamsField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///֤۸ + TSgitFtdcMarginPriceTypeType MarginPriceType; + ///ӯ㷨 + TSgitFtdcAlgorithmType Algorithm; + ///Ƿƽӯ + TSgitFtdcIncludeCloseProfitType AvailIncludeCloseProfit; +}; + +///ѯ͹˾㷨 +struct CSgitFtdcQryBrokerTradingAlgosField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; +}; + +///͹˾㷨 +struct CSgitFtdcBrokerTradingAlgosField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + ///ֲִ㷨 + TSgitFtdcHandlePositionAlgoIDType HandlePositionAlgoID; + ///Ѱұ֤㷨 + TSgitFtdcFindMarginRateAlgoIDType FindMarginRateAlgoID; + ///ʽ㷨 + TSgitFtdcHandleTradingAccountAlgoIDType HandleTradingAccountAlgoID; +}; + +///ѯ͹˾ʽ +struct CSgitFtdcQueryBrokerDepositField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + /// + TSgitFtdcExchangeIDType ExchangeID; +}; + +///͹˾ʽ +struct CSgitFtdcBrokerDepositField +{ + /// + TSgitFtdcTradeDateType TradingDay; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ա + TSgitFtdcParticipantIDType ParticipantID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///ϴν׼ + TSgitFtdcMoneyType PreBalance; + ///ǰ֤ܶ + TSgitFtdcMoneyType CurrMargin; + ///ƽӯ + TSgitFtdcMoneyType CloseProfit; + ///ڻ׼ + TSgitFtdcMoneyType Balance; + /// + TSgitFtdcMoneyType Deposit; + /// + TSgitFtdcMoneyType Withdraw; + ///ʽ + TSgitFtdcMoneyType Available; + ///׼ + TSgitFtdcMoneyType Reserve; + ///ı֤ + TSgitFtdcMoneyType FrozenMargin; +}; + +///ѯ֤ϵͳ͹˾Կ +struct CSgitFtdcQryCFMMCBrokerKeyField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; +}; + +///֤ϵͳ͹˾Կ +struct CSgitFtdcCFMMCBrokerKeyField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TSgitFtdcParticipantIDType ParticipantID; + ///Կ + TSgitFtdcDateType CreateDate; + ///Կʱ + TSgitFtdcTimeType CreateTime; + ///Կ + TSgitFtdcSequenceNoType KeyID; + ///̬Կ + TSgitFtdcCFMMCKeyType CurrentKey; + ///̬Կ + TSgitFtdcCFMMCKeyKindType KeyKind; +}; + +///֤ϵͳ͹˾ʽ˻Կ +struct CSgitFtdcCFMMCTradingAccountKeyField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TSgitFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///Կ + TSgitFtdcSequenceNoType KeyID; + ///̬Կ + TSgitFtdcCFMMCKeyType CurrentKey; +}; + +///ѯ֤ϵͳ͹˾ʽ˻Կ +struct CSgitFtdcQryCFMMCTradingAccountKeyField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; +}; + +///û̬Ʋ +struct CSgitFtdcBrokerUserOTPParamField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///̬ṩ + TSgitFtdcOTPVendorsIDType OTPVendorsID; + ///̬к + TSgitFtdcSerialNumberType SerialNumber; + ///Կ + TSgitFtdcAuthKeyType AuthKey; + ///Ưֵ + TSgitFtdcLastDriftType LastDrift; + ///ɹֵ + TSgitFtdcLastSuccessType LastSuccess; + ///̬ + TSgitFtdcOTPTypeType OTPType; +}; + +///ֹͬû̬ +struct CSgitFtdcManualSyncBrokerUserOTPField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///̬ + TSgitFtdcOTPTypeType OTPType; + ///һ̬ + TSgitFtdcPasswordType FirstOTP; + ///ڶ̬ + TSgitFtdcPasswordType SecondOTP; +}; + +///Ͷģ +struct CSgitFtdcCommRateModelField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///ģ + TSgitFtdcInvestorIDType CommModelID; + ///ģ + TSgitFtdcCommModelNameType CommModelName; +}; + +///ѯͶģ +struct CSgitFtdcQryCommRateModelField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///ģ + TSgitFtdcInvestorIDType CommModelID; +}; + +///ֵ۵Ϣ +struct CSgitFtdcEWarrantOffsetField +{ + /// + TSgitFtdcTradeDateType TradingDay; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; + /// + TSgitFtdcDirectionType Direction; + ///Ͷױ־ + TSgitFtdcHedgeFlagType HedgeFlag; + /// + TSgitFtdcVolumeType Volume; +}; + +///ѯֵ۵Ϣ +struct CSgitFtdcQryEWarrantOffsetField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcExchangeIDType ExchangeID; + ///Լ + TSgitFtdcInstrumentIDType InstrumentID; +}; + +///תʿ +struct CSgitFtdcReqOpenAccountField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TSgitFtdcGenderType Gender; + ///Ҵ + TSgitFtdcCountryCodeType CountryCode; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ַ + TSgitFtdcAddressType Address; + ///ʱ + TSgitFtdcZipCodeType ZipCode; + ///绰 + TSgitFtdcTelephoneType Telephone; + ///ֻ + TSgitFtdcMobilePhoneType MobilePhone; + /// + TSgitFtdcFaxType Fax; + ///ʼ + TSgitFtdcEMailType EMail; + ///ʽ˻״̬ + TSgitFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///װ + TSgitFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///㳮־ + TSgitFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻλʺ + TSgitFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TSgitFtdcBankAccountType BankSecuAcc; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TSgitFtdcOperNoType OperNo; + ///ID + TSgitFtdcTIDType TID; +}; + +///ת +struct CSgitFtdcReqCancelAccountField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TSgitFtdcGenderType Gender; + ///Ҵ + TSgitFtdcCountryCodeType CountryCode; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ַ + TSgitFtdcAddressType Address; + ///ʱ + TSgitFtdcZipCodeType ZipCode; + ///绰 + TSgitFtdcTelephoneType Telephone; + ///ֻ + TSgitFtdcMobilePhoneType MobilePhone; + /// + TSgitFtdcFaxType Fax; + ///ʼ + TSgitFtdcEMailType EMail; + ///ʽ˻״̬ + TSgitFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///װ + TSgitFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///㳮־ + TSgitFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻλʺ + TSgitFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TSgitFtdcBankAccountType BankSecuAcc; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TSgitFtdcOperNoType OperNo; + ///ID + TSgitFtdcTIDType TID; +}; + +///˻ +struct CSgitFtdcReqChangeAccountField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TSgitFtdcGenderType Gender; + ///Ҵ + TSgitFtdcCountryCodeType CountryCode; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ַ + TSgitFtdcAddressType Address; + ///ʱ + TSgitFtdcZipCodeType ZipCode; + ///绰 + TSgitFtdcTelephoneType Telephone; + ///ֻ + TSgitFtdcMobilePhoneType MobilePhone; + /// + TSgitFtdcFaxType Fax; + ///ʼ + TSgitFtdcEMailType EMail; + ///ʽ˻״̬ + TSgitFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///ʺ + TSgitFtdcBankAccountType NewBankAccount; + /// + TSgitFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///װ + TSgitFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///ID + TSgitFtdcTIDType TID; + ///ժҪ + TSgitFtdcDigestType Digest; +}; + +///ת +struct CSgitFtdcReqTransferField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TSgitFtdcFutureSerialType FutureSerial; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///תʽ + TSgitFtdcTradeAmountType TradeAmount; + ///ڻȡ + TSgitFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TSgitFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TSgitFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TSgitFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TSgitFtdcAddInfoType Message; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻλʺ + TSgitFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TSgitFtdcBankAccountType BankSecuAcc; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + ///ת˽״̬ + TSgitFtdcTransferStatusType TransferStatus; +}; + +///зʽתڻӦ +struct CSgitFtdcRspTransferField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TSgitFtdcFutureSerialType FutureSerial; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///תʽ + TSgitFtdcTradeAmountType TradeAmount; + ///ڻȡ + TSgitFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TSgitFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TSgitFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TSgitFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TSgitFtdcAddInfoType Message; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻλʺ + TSgitFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TSgitFtdcBankAccountType BankSecuAcc; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + ///ת˽״̬ + TSgitFtdcTransferStatusType TransferStatus; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CSgitFtdcReqRepealField +{ + ///ʱ + TSgitFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TSgitFtdcRepealedTimesType RepealedTimes; + ///г־ + TSgitFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TSgitFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TSgitFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TSgitFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TSgitFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TSgitFtdcFutureSerialType FutureSerial; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///תʽ + TSgitFtdcTradeAmountType TradeAmount; + ///ڻȡ + TSgitFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TSgitFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TSgitFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TSgitFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TSgitFtdcAddInfoType Message; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻλʺ + TSgitFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TSgitFtdcBankAccountType BankSecuAcc; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + ///ת˽״̬ + TSgitFtdcTransferStatusType TransferStatus; +}; + +///Ӧ +struct CSgitFtdcRspRepealField +{ + ///ʱ + TSgitFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TSgitFtdcRepealedTimesType RepealedTimes; + ///г־ + TSgitFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TSgitFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TSgitFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TSgitFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TSgitFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TSgitFtdcFutureSerialType FutureSerial; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///תʽ + TSgitFtdcTradeAmountType TradeAmount; + ///ڻȡ + TSgitFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TSgitFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TSgitFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TSgitFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TSgitFtdcAddInfoType Message; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻλʺ + TSgitFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TSgitFtdcBankAccountType BankSecuAcc; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + ///ת˽״̬ + TSgitFtdcTransferStatusType TransferStatus; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ +struct CSgitFtdcReqQueryAccountField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///ڻ˾ˮ + TSgitFtdcFutureSerialType FutureSerial; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻλʺ + TSgitFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TSgitFtdcBankAccountType BankSecuAcc; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; +}; + +///ѯ˻ϢӦ +struct CSgitFtdcRspQueryAccountField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///ڻ˾ˮ + TSgitFtdcFutureSerialType FutureSerial; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻλʺ + TSgitFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TSgitFtdcBankAccountType BankSecuAcc; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + ///пý + TSgitFtdcTradeAmountType BankUseAmount; + ///пȡ + TSgitFtdcTradeAmountType BankFetchAmount; +}; + +///ǩǩ +struct CSgitFtdcFutureSignIOField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; +}; + +///ǩӦ +struct CSgitFtdcRspFutureSignInField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; + ///PINԿ + TSgitFtdcPasswordKeyType PinKey; + ///MACԿ + TSgitFtdcPasswordKeyType MacKey; +}; + +///ǩ +struct CSgitFtdcReqFutureSignOutField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; +}; + +///ǩӦ +struct CSgitFtdcRspFutureSignOutField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ѯָˮŵĽ׽ +struct CSgitFtdcReqQueryTradeResultBySerialField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ˮ + TSgitFtdcSerialType Reference; + ///ˮŷߵĻ + TSgitFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TSgitFtdcOrganCodeType RefrenceIssure; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///תʽ + TSgitFtdcTradeAmountType TradeAmount; + ///ժҪ + TSgitFtdcDigestType Digest; +}; + +///ѯָˮŵĽ׽Ӧ +struct CSgitFtdcRspQueryTradeResultBySerialField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; + ///ˮ + TSgitFtdcSerialType Reference; + ///ˮŷߵĻ + TSgitFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TSgitFtdcOrganCodeType RefrenceIssure; + ///ԭʼش + TSgitFtdcReturnCodeType OriginReturnCode; + ///ԭʼ + TSgitFtdcDescrInfoForReturnCodeType OriginDescrInfoForReturnCode; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///תʽ + TSgitFtdcTradeAmountType TradeAmount; + ///ժҪ + TSgitFtdcDigestType Digest; +}; + +///ļ +struct CSgitFtdcReqDayEndFileReadyField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ļҵ + TSgitFtdcFileBusinessCodeType FileBusinessCode; + ///ժҪ + TSgitFtdcDigestType Digest; +}; + +///ؽ +struct CSgitFtdcReturnResultField +{ + ///ش + TSgitFtdcReturnCodeType ReturnCode; + /// + TSgitFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; +}; + +///֤ڻʽ +struct CSgitFtdcVerifyFuturePasswordField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ID + TSgitFtdcTIDType TID; +}; + +///֤ͻϢ +struct CSgitFtdcVerifyCustInfoField +{ + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TSgitFtdcCustTypeType CustType; +}; + +///֤ڻʽͿͻϢ +struct CSgitFtdcVerifyFuturePasswordAndCustInfoField +{ + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; +}; + +///֤ڻʽͿͻϢ +struct CSgitFtdcDepositResultInformField +{ + ///ˮţˮΪڱ̷صˮ + TSgitFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + /// + TSgitFtdcMoneyType Deposit; + /// + TSgitFtdcRequestIDType RequestID; + ///ش + TSgitFtdcReturnCodeType ReturnCode; + /// + TSgitFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; +}; + +///׺ڱ̷Կͬ +struct CSgitFtdcReqSyncKeyField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TSgitFtdcAddInfoType Message; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; +}; + +///׺ڱ̷ԿͬӦ +struct CSgitFtdcRspSyncKeyField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TSgitFtdcAddInfoType Message; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ֪ͨ +struct CSgitFtdcNotifyQueryAccountField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///ڻ˾ˮ + TSgitFtdcFutureSerialType FutureSerial; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻλʺ + TSgitFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TSgitFtdcBankAccountType BankSecuAcc; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + ///пý + TSgitFtdcTradeAmountType BankUseAmount; + ///пȡ + TSgitFtdcTradeAmountType BankFetchAmount; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ת˽ˮ +struct CSgitFtdcTransferSerialField +{ + ///ƽ̨ˮ + TSgitFtdcPlateSerialType PlateSerial; + ///׷ + TSgitFtdcTradeDateType TradeDate; + /// + TSgitFtdcDateType TradingDay; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///״ + TSgitFtdcTradeCodeType TradeCode; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///б + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ڻ˾ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + ///ڻ˾ʺ + TSgitFtdcFutureAccTypeType FutureAccType; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///Ͷߴ + TSgitFtdcInvestorIDType InvestorID; + ///ڻ˾ˮ + TSgitFtdcFutureSerialType FutureSerial; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///׽ + TSgitFtdcTradeAmountType TradeAmount; + ///Ӧտͻ + TSgitFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TSgitFtdcFutureFeeType BrokerFee; + ///Ч־ + TSgitFtdcAvailabilityFlagType AvailabilityFlag; + ///Ա + TSgitFtdcOperatorCodeType OperatorCode; + ///ʺ + TSgitFtdcBankAccountType BankNewAccount; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ѯתˮ +struct CSgitFtdcQryTransferSerialField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///б + TSgitFtdcBankIDType BankID; +}; + +///ǩ֪ͨ +struct CSgitFtdcNotifyFutureSignInField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; + ///PINԿ + TSgitFtdcPasswordKeyType PinKey; + ///MACԿ + TSgitFtdcPasswordKeyType MacKey; +}; + +///ǩ֪ͨ +struct CSgitFtdcNotifyFutureSignOutField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///׺ڱ̷Կ֪ͬͨ +struct CSgitFtdcNotifySyncKeyField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///װ + TSgitFtdcInstallIDType InstallID; + ///ûʶ + TSgitFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TSgitFtdcAddInfoType Message; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TSgitFtdcOperNoType OperNo; + /// + TSgitFtdcRequestIDType RequestID; + ///ID + TSgitFtdcTIDType TID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ѯǩԼϵ +struct CSgitFtdcQryAccountregisterField +{ + ///͹˾ + TSgitFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///б + TSgitFtdcBankIDType BankID; +}; + +///ͻϢ +struct CSgitFtdcAccountregisterField +{ + /// + TSgitFtdcTradeDateType TradeDay; + ///б + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + ///ڻ˾ + TSgitFtdcBrokerIDType BrokerID; + ///ڻ˾֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + /// + TSgitFtdcOpenOrDestroyType OpenOrDestroy; + ///ǩԼ + TSgitFtdcTradeDateType RegDate; + ///Լ + TSgitFtdcTradeDateType OutDate; + ///ID + TSgitFtdcTIDType TID; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; +}; + +///ڿϢ +struct CSgitFtdcOpenAccountField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TSgitFtdcGenderType Gender; + ///Ҵ + TSgitFtdcCountryCodeType CountryCode; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ַ + TSgitFtdcAddressType Address; + ///ʱ + TSgitFtdcZipCodeType ZipCode; + ///绰 + TSgitFtdcTelephoneType Telephone; + ///ֻ + TSgitFtdcMobilePhoneType MobilePhone; + /// + TSgitFtdcFaxType Fax; + ///ʼ + TSgitFtdcEMailType EMail; + ///ʽ˻״̬ + TSgitFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///װ + TSgitFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///㳮־ + TSgitFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻλʺ + TSgitFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TSgitFtdcBankAccountType BankSecuAcc; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TSgitFtdcOperNoType OperNo; + ///ID + TSgitFtdcTIDType TID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///Ϣ +struct CSgitFtdcCancelAccountField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TSgitFtdcGenderType Gender; + ///Ҵ + TSgitFtdcCountryCodeType CountryCode; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ַ + TSgitFtdcAddressType Address; + ///ʱ + TSgitFtdcZipCodeType ZipCode; + ///绰 + TSgitFtdcTelephoneType Telephone; + ///ֻ + TSgitFtdcMobilePhoneType MobilePhone; + /// + TSgitFtdcFaxType Fax; + ///ʼ + TSgitFtdcEMailType EMail; + ///ʽ˻״̬ + TSgitFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///װ + TSgitFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///㳮־ + TSgitFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TSgitFtdcDigestType Digest; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///־ + TSgitFtdcDeviceIDType DeviceID; + ///ڻλʺ + TSgitFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TSgitFtdcBankAccountType BankSecuAcc; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TSgitFtdcOperNoType OperNo; + ///ID + TSgitFtdcTIDType TID; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ڱ˺Ϣ +struct CSgitFtdcChangeAccountField +{ + ///ҵ + TSgitFtdcTradeCodeType TradeCode; + ///д + TSgitFtdcBankIDType BankID; + ///з֧ + TSgitFtdcBankBrchIDType BankBranchID; + ///̴ + TSgitFtdcBrokerIDType BrokerID; + ///̷֧ + TSgitFtdcFutureBranchIDType BrokerBranchID; + /// + TSgitFtdcTradeDateType TradeDate; + ///ʱ + TSgitFtdcTradeTimeType TradeTime; + ///ˮ + TSgitFtdcBankSerialType BankSerial; + ///ϵͳ + TSgitFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TSgitFtdcSerialType PlateSerial; + ///Ƭ־ + TSgitFtdcLastFragmentType LastFragment; + ///Ự + TSgitFtdcSessionIDType SessionID; + ///ͻ + TSgitFtdcIndividualNameType CustomerName; + ///֤ + TSgitFtdcIdCardTypeType IdCardType; + ///֤ + TSgitFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TSgitFtdcGenderType Gender; + ///Ҵ + TSgitFtdcCountryCodeType CountryCode; + ///ͻ + TSgitFtdcCustTypeType CustType; + ///ַ + TSgitFtdcAddressType Address; + ///ʱ + TSgitFtdcZipCodeType ZipCode; + ///绰 + TSgitFtdcTelephoneType Telephone; + ///ֻ + TSgitFtdcMobilePhoneType MobilePhone; + /// + TSgitFtdcFaxType Fax; + ///ʼ + TSgitFtdcEMailType EMail; + ///ʽ˻״̬ + TSgitFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TSgitFtdcBankAccountType BankAccount; + /// + TSgitFtdcPasswordType BankPassWord; + ///ʺ + TSgitFtdcBankAccountType NewBankAccount; + /// + TSgitFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TSgitFtdcAccountIDType AccountID; + ///ڻ + TSgitFtdcPasswordType Password; + ///ʺ + TSgitFtdcBankAccTypeType BankAccType; + ///װ + TSgitFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TSgitFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TSgitFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TSgitFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TSgitFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TSgitFtdcPwdFlagType SecuPwdFlag; + ///ID + TSgitFtdcTIDType TID; + ///ժҪ + TSgitFtdcDigestType Digest; + /// + TSgitFtdcErrorIDType ErrorID; + ///Ϣ + TSgitFtdcErrorMsgType ErrorMsg; +}; + +///ֱĽȨ +struct CSgitFtdcUserRightsAssignField +{ + ///ӦõԪ + TSgitFtdcBrokerIDType BrokerID; + ///û + TSgitFtdcUserIDType UserID; + ///Ĵ + TSgitFtdcDRIdentityIDType DRIdentityID; +}; + +///ù˾ǷڱʾĽȨ +struct CSgitFtdcBrokerUserRightAssignField +{ + ///ӦõԪ + TSgitFtdcBrokerIDType BrokerID; + ///Ĵ + TSgitFtdcDRIdentityIDType DRIdentityID; + ///ܷ + TSgitFtdcBoolType Tradeable; +}; + +///ֱת +struct CSgitFtdcDRTransferField +{ + ///ԭĴ + TSgitFtdcDRIdentityIDType OrigDRIdentityID; + ///Ŀ꽻Ĵ + TSgitFtdcDRIdentityIDType DestDRIdentityID; + ///ԭӦõԪ + TSgitFtdcBrokerIDType OrigBrokerID; + ///ĿõԪ + TSgitFtdcBrokerIDType DestBrokerID; +}; + +//Լλѯ +struct CSgitMBLQuotReq +{ + TSgitFtdcInstrumentIDType StartContractID; //ʼԼ + TSgitFtdcInstrumentIDType EndContractID; //Լ + TSgitFtdcDirectionType BsFlag; //־ +}; + +//Լλ +struct CSgitMBLQuotData +{ + TSgitFtdcInstrumentIDType ContractID; //Լ + TSgitFtdcDirectionType BsFlag; //־ + TSgitFtdcPriceType Price; //۸ + TSgitFtdcVolumeType Qty; // +}; + +//ĺԼ +struct CSgitSubQuotField +{ + TSgitFtdcInstrumentIDType ContractID; //Լ +}; + +#endif diff --git "a/include/FeiShu/api\345\274\200\345\217\221\350\257\264\346\230\216.pdf" "b/include/FeiShu/api\345\274\200\345\217\221\350\257\264\346\230\216.pdf" new file mode 100644 index 0000000..4167c8a Binary files /dev/null and "b/include/FeiShu/api\345\274\200\345\217\221\350\257\264\346\230\216.pdf" differ diff --git a/include/FeiShu/linux64/libsgitquotapi.so.64 b/include/FeiShu/linux64/libsgitquotapi.so.64 new file mode 100644 index 0000000..25c5b2d Binary files /dev/null and b/include/FeiShu/linux64/libsgitquotapi.so.64 differ diff --git a/include/FeiShu/linux64/libsgittradeapi.so.64 b/include/FeiShu/linux64/libsgittradeapi.so.64 new file mode 100644 index 0000000..12b22da Binary files /dev/null and b/include/FeiShu/linux64/libsgittradeapi.so.64 differ diff --git "a/include/FeiShu/sgitApi\351\224\231\350\257\257\347\240\201.txt" "b/include/FeiShu/sgitApi\351\224\231\350\257\257\347\240\201.txt" new file mode 100644 index 0000000..c0d4c80 --- /dev/null +++ "b/include/FeiShu/sgitApi\351\224\231\350\257\257\347\240\201.txt" @@ -0,0 +1,60 @@ +//---- ´ǽӦ𷵻Ϣ(CSgitFtdcRspInfoField)д ----// +10001,"ϯλ!"; +10002,"Ϊÿͻ!" +10004,"¼δɹܾͽ!" +10005,"δ¼!" +10013,"¼!" + +#11000ʾίм +11000,"ýӿڲʹ!" +11000,"رظ!"; +11000,"ǰ״̬!" +11000,"ͻʽʺ" +11000,"ʽʺޱ֤" +11000,"ʽʺż¼" +11000,"ʽ𲻹!" + +11010,"ʧ!"); +12000,"ֲֿƽ!" +20000,"Գɽ!" + + +//---- ´api󷵻ֵ(Join/Ready/ReqXXXXXX) ----// +//---- 121010000ǻ׼ֵ ----// + +API +121010000 + iErrCode + +#ifndef _API_ERROR_CODE_H +#define _API_ERROR_CODE_H +#define REACTOR_NO_INITIALIZE 1//Ϣ߳δ +#define CA_NO_INITIALIZE 2//CAģδ +#define APICONTROL_NO_INITIALIZE 3//API Controlģδ +#define CHNL_CREATE_FAIL 4//TCPʧ +#define SYNC_CALL_TIMEOUT 5//ͬóʱ +#define CHNL_ERR 6//ӳ +#define CA_SIGN_ERROR 7//CA֤ģǩ +#define RE_CERT 8//ظ֤ +#define CA_CHECKSIGN_ERROR 9//֤ǩʧ +#define RE_LOGIN 10//ظ½ +#define NO_CERT 11//δͨCA֤ +#define NO_LOGIN 12//δ¼ǰ +#define CA_INIT_ERR 13//CAģʼʧ +#define NO_SERVICE 14//ûǰÿ +#define NO_SYNCTIMEOUT 15//ͬʱΪ +#define RE_SESSION 16//ظỰ +#define NO_SESSION 17//֤֮ǰδͨỰ +#define DIFF_TRADERNO 18//Ự֤ϯλŲͬ +#define CA_CERT_ERR 19//CA֤ʼ +#define CA_DECODE_ERR 20//֤ӦCA֤ʧ +#define CA_ERROR_LOAD_LIBRARY 21//װض̬ +#define CA_ERROR_PRIVATE_KEY_DEV 22//д˽Կ豸ʧ +#define CA_ERROR_PRI_KEY_PASS 23//˽Կ +#define CA_ERROR_INITIAL_SESSION 24//ʼ +#define CA_ERROR_MEMORY 25//ڴ +#define CA_ERROR_CERT_DATE 26//ȡ֤Чڴ +#endif + + + + diff --git "a/include/FeiShu/sigtApi\345\274\200\345\217\221\351\227\256\351\242\230\347\255\224\347\226\221.doc" "b/include/FeiShu/sigtApi\345\274\200\345\217\221\351\227\256\351\242\230\347\255\224\347\226\221.doc" new file mode 100644 index 0000000..9aa8974 Binary files /dev/null and "b/include/FeiShu/sigtApi\345\274\200\345\217\221\351\227\256\351\242\230\347\255\224\347\226\221.doc" differ diff --git a/include/FeiShu/win32/sgitquotapi.dll b/include/FeiShu/win32/sgitquotapi.dll new file mode 100644 index 0000000..fbcd34d Binary files /dev/null and b/include/FeiShu/win32/sgitquotapi.dll differ diff --git a/include/FeiShu/win32/sgitquotapi.lib b/include/FeiShu/win32/sgitquotapi.lib new file mode 100644 index 0000000..0d15870 Binary files /dev/null and b/include/FeiShu/win32/sgitquotapi.lib differ diff --git a/include/FeiShu/win32/sgittradeapi.dll b/include/FeiShu/win32/sgittradeapi.dll new file mode 100644 index 0000000..fa5c87f Binary files /dev/null and b/include/FeiShu/win32/sgittradeapi.dll differ diff --git a/include/FeiShu/win32/sgittradeapi.lib b/include/FeiShu/win32/sgittradeapi.lib new file mode 100644 index 0000000..0bd1349 Binary files /dev/null and b/include/FeiShu/win32/sgittradeapi.lib differ diff --git "a/include/FeiShu/\344\273\277CTP\346\216\245\345\217\243\344\275\277\347\224\250\350\257\264\346\230\216.txt" "b/include/FeiShu/\344\273\277CTP\346\216\245\345\217\243\344\275\277\347\224\250\350\257\264\346\230\216.txt" new file mode 100644 index 0000000..a2d9de9 --- /dev/null +++ "b/include/FeiShu/\344\273\277CTP\346\216\245\345\217\243\344\275\277\347\224\250\350\257\264\346\230\216.txt" @@ -0,0 +1,33 @@ +1apiʱ,δָĿ¼,dllļĿ¼ϼĿ¼һҪstoreĿ¼,Ϊʱļ洢Ŀ¼. +2رű12λǰ0¼ɹᣬյMaxOrderRef,رŴյرϿʼۼơ +3ͶIDдָӦĽױ롣 +4ָҪдExchangeIDInvestorIDOrderSysIDInstrumentID + UserIDдϵͳĽԱš + ExchangeIDд'S''Z''D''J'һSgitFtdcUserApiDataType.hض塣Sgit_FTDC_EIDT_SHFE ʾ + InvestorIDдӦĽױ롣 + OrderSysIDдӦصĽšעнϵͳǰпո񣬱ָʱյһ¡ + رOnRspOrderAction. + +5ίбָɹ󣬱ɹʧܶͨOnRtnOrder֪ͨӦյOnRtnOrderʾӦıӦ + +6עǵķctpӿڱӦOnRtnOrderctpһctpļ̳ʵ֣ղӦ + +7ָɹ󣬳ɹͨOnRspOrderAction֪ͨӦOnRspOrderActionزCSgitFtdcInputOrderActionFieldVolumeChangeʾɹ + ע⣺вд ϵͳ ᳷ɹղر + +8ctpӿڱָ֧FAK + +9CSgitFtdcInvestorPositionDetailFieldOpenPriceֲ־ ExchMarginֲ + +10ԼͻָƽίеĿƽֱ־Ϊƽ/ƽ/ƽ + ͻָƽֱ־Ϊ ƽ֣ ί ƽ򱨵ᱻܾϢֲֿƽ + ͻָƽֱ־Ϊ ƽ ƽ񣬲ٽв𵥣 + ʹ°汾sgitapiԼίлر ɽرƽ/ƽ־ƽ֡ + +11apiӿCSgitFtdcMdApi֧鶩ģҪڵ¼ɹ֮󣬵Ready֮ǰġ򣬻յкԼ顣 + Ready֮ǰ飬ں׹пٴζ顣 + Ready֮ǰûж飬ں׹вŶ飬 + +12ֲֲѯӦ YdPositionPosition ǰܲλTodayPosition = Position + YdPosition ֲ longfrozenʾƽֶ᣻ֲ shortFrozenʾƽֶᡣ + +13Ҫöಥģʽ飩ҪSetMultiCastAddr \ No newline at end of file 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..a98cec6 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 { - OnConnectionStatus = 64, - OnRtnError, - OnLog, + ResponeType_OnConnectionStatus = 64, + ResponeType_OnRtnError, + ResponeType_OnLog, - OnRtnDepthMarketData, - OnRspQryInstrument, - OnRspQryTradingAccount, - OnRspQryInvestorPosition, - OnRspQrySettlementInfo, + ResponeType_OnRtnDepthMarketData, + ResponeType_OnRspQryInstrument, + ResponeType_OnRspQryTradingAccount, + ResponeType_OnRspQryInvestorPosition, + ResponeType_OnRspQrySettlementInfo, - OnRspQryOrder, - OnRspQryTrade, - OnRspQryQuote, + ResponeType_OnRspQryOrder, + ResponeType_OnRspQryTrade, + ResponeType_OnRspQryQuote, - OnRtnOrder, - OnRtnTrade, - OnRtnQuote, + ResponeType_OnRtnOrder, + ResponeType_OnRtnTrade, + ResponeType_OnRtnQuote, - OnRtnQuoteRequest, + ResponeType_OnRtnQuoteRequest, - OnRspQryHistoricalTicks, - OnRspQryHistoricalBars, - OnRspQryInvestor, + ResponeType_OnRspQryHistoricalTicks, + ResponeType_OnRspQryHistoricalBars, + ResponeType_OnRspQryInvestor, - OnFilterSubscribe, + ResponeType_OnFilterSubscribe, }; -// >=100ʾAPIԶ +// >=100表示API自定义 #endif diff --git a/include/QueueHeader.h b/include/QueueHeader.h index 0730eb8..a093fd4 100644 --- a/include/QueueHeader.h +++ b/include/QueueHeader.h @@ -1,7 +1,7 @@ #ifndef _QUEUE_HEADER_H_ #define _QUEUE_HEADER_H_ -#include "../include/CrossPlatform.h" +//#include "CrossPlatform.h" #ifdef __cplusplus extern "C" { diff --git a/include/Tdx/TdxApi.h b/include/Tdx/TdxApi.h index b12d158..83eb6e2 100644 --- a/include/Tdx/TdxApi.h +++ b/include/Tdx/TdxApi.h @@ -17,49 +17,48 @@ #include "tdx_request.h" #include "tdx_field.h" + +class CTdxApi; + +class CTdxSpi +{ +public: + virtual void OnRespone(CTdxApi* pApi, RequestRespone_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 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; - -public: - // 设置会话 - virtual void SetClient(void* client) = 0; + virtual int SendRequest(IN RequestRespone_STRUCT* pRequest) = 0; - virtual void* GetClient() = 0; - // 设置资金账号 - virtual void SetAccount(const char* szAccount) = 0; - // 得到资金账号 - virtual const char* GetAccount() = 0; + virtual RequestRespone_STRUCT* MakeQueryData(ReqQueryData_STRUCT* query) = 0; + virtual RequestRespone_STRUCT* MakeOrder(Order_STRUCT* pOrder) = 0; + // 撤单 + virtual RequestRespone_STRUCT* MakeCancelOrder(CancelOrder_STRUCT* pCancelOrder) = 0; + virtual RequestRespone_STRUCT* MakeCancelOrder(WTLB_STRUCT* pOrder) = 0; + protected: CTdxApi(); ~CTdxApi(){}; diff --git a/include/Tdx/tdx_enum.h b/include/Tdx/tdx_enum.h index 67fa276..e867d6f 100644 --- a/include/Tdx/tdx_enum.h +++ b/include/Tdx/tdx_enum.h @@ -3,44 +3,63 @@ #ifndef _TDX_ENUM_H_ #define _TDX_ENUM_H_ -#define COL_EACH_ROW (64) //每行多少例,相当重要 +#include "tdx_request.h" // 125_帐号类别 +// 37 期权 +// 40 沪港通 // 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_Market 67 // 市价买 #define MMBZ_Sell_Market 68 // 市价卖 +#define MMBZ_Buy_RZ 69 // 融资买入 +#define MMBZ_Sell_RQ 70 // 融券卖出 +#define MMBZ_Buy_HQ 71 // 买券还券 +#define MMBZ_73 73 // 现券还券 +#define MMBZ_74 74 // 担保品划转 +#define MMBZ_75 75 // 现金还款 +#define MMBZ_76 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+ 79 // 基金申购 +#define WTLB_LOFRedemption REQUEST_WT*100+ 80 // 基金赎回 +#define WTLB_ETFCreation REQUEST_ETF_SGSH*100+ MMBZ_Creation // ETF申购 +#define WTLB_ETFRedemption REQUEST_ETF_SGSH*100+ MMBZ_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下:债券回售 + +// 603_交易类型 +#define JYLX_Creation 0 // ETF申购 +#define JYLX_Redemption 1 // ETF赎回 + // 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 +68,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 +93,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..2a31228 100644 --- a/include/Tdx/tdx_field.h +++ b/include/Tdx/tdx_field.h @@ -43,6 +43,8 @@ ID一样,中文名可能不一样 #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 // ? @@ -65,6 +67,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_资金余额 @@ -84,13 +88,16 @@ 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_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_CS 1227 // 1227_参数 #define FIELD_XSYS 1231 // 1231_显示颜色 diff --git a/include/Tdx/tdx_function.cpp b/include/Tdx/tdx_function.cpp index 8118292..2b39ed5 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) { @@ -215,61 +188,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 +315,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 +367,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) @@ -625,500 +410,11 @@ void CharTable2GDLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GDLB_STRUCT ppResults[i]->ZHLB_ = atoi(ppResults[i]->ZHLB); ppResults[i]->RZRQBS_ = atoi(ppResults[i]->RZRQBS); - } -} - - - -void CharTable2WTLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, WTLB_STRUCT*** pppResults) -{ - *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_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); - - for (int i = 0; i < count; ++i) - { - 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); - } - - ppResults[i]->BJFS_ = BJFS_2_WTFS(ppResults[i]->BJFS); - } -} - -void CharTable2CJLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, CJLB_STRUCT*** pppResults) -{ - *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; - - 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); - - 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; - } -} - -void CharTable2GFLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GFLB_STRUCT*** pppResults) -{ - *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; - - 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); - - for (int i = 0; i < count; ++i) - { - 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); + ppResults[i]->Client = Client; } } -void CharTable2ZJYE(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, ZJYE_STRUCT*** pppResults) -{ - *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; - - 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); - } -} - -void CharTable2HQ(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, HQ_STRUCT*** pppResults) -{ - *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; - - 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]); - - - 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); - } -} - - void DeleteStructs(void*** pppStructs) { if (*pppStructs == nullptr) @@ -1157,7 +453,7 @@ A341083000|LK|1| |主股东| E015976151|HT|1|88500918| 12982|1| |主股东| 0601605823|HT|0|88500918| 354000|1| |主股东| */ -void String2GDLB(char* szString, GDLB_STRUCT*** pppResults) +void String2GDLB(char* szString, GDLB_STRUCT*** pppResults, void* Client) { *pppResults = nullptr; if (szString == nullptr) @@ -1234,12 +530,14 @@ void String2GDLB(char* szString, GDLB_STRUCT*** pppResults) ppResults[i]->ZHLB_ = atoi(ppResults[i]->ZHLB); ppResults[i]->RZRQBS_ = atoi(ppResults[i]->RZRQBS); + + ppResults[i]->Client = Client; } delete[] pBuf; } -void CharTable2Login(char** ppTable, GDLB_STRUCT*** pppResults) +void CharTable2Login(char** ppTable, GDLB_STRUCT*** pppResults, void* Client) { *pppResults = nullptr; if (ppTable == nullptr) @@ -1254,7 +552,7 @@ void CharTable2Login(char** ppTable, GDLB_STRUCT*** pppResults) int requstid = atoi(p); if (requstid == REQUEST_GDLB + 1) { - String2GDLB(ppTable[i * COL_EACH_ROW + 2], pppResults); + String2GDLB(ppTable[i * COL_EACH_ROW + 2], pppResults, Client); } ++i; @@ -1279,5 +577,141 @@ int GetCountStructs(void** ppResults) return i; } +void DeleteRequestRespone(RequestRespone_STRUCT* pRespone) +{ + if (pRespone == nullptr) + return; + + DeleteTableBody(pRespone->ppResults); + DeleteError(pRespone->pErr); +} + #else + + +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"); +} + + +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; +} + + +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"); + } +} + + + + #endif \ No newline at end of file diff --git a/include/Tdx/tdx_function.h b/include/Tdx/tdx_function.h index 1f96d2f..3715b9e 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,24 @@ 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 int GetCountStructs(void** ppResults); -TDXAPI_API void CharTable2WTLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, WTLB_STRUCT*** pppResults); +TDXAPI_API void DeleteStructs(void*** pppStructs); +////////////////////////////////////////////////////////////////////////// +// 股东列表处理,用于授权部分 +TDXAPI_API void CharTable2GDLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GDLB_STRUCT*** pppResults, void* Client); -TDXAPI_API void CharTable2CJLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, CJLB_STRUCT*** pppResults); +TDXAPI_API void CharTable2Login(char** ppTable, GDLB_STRUCT*** pppResults, void* Client); -TDXAPI_API void CharTable2GFLB(FieldInfo_STRUCT** ppFieldInfos, char** ppTable, GFLB_STRUCT*** pppResults); +TDXAPI_API void DeleteRequestRespone(RequestRespone_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 CharTable2Login(char** ppTable, GDLB_STRUCT*** pppResults); -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..b0d224a 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_开平 @@ -69,6 +69,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 +140,7 @@ _起始序号|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_委托方式|113_ 操作标志|299_对方分支代码|298_对方客户代码|243_对方资金帐号|158_对方密码|361_升 @@ -160,7 +169,7 @@ _起始序号|140_证券代码|113_操作标志|1228_模式|1299_功能版本|10 /* */ -#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 +294,18 @@ CPUID|5254_信用交易标识|5255_会话号|5256_客户代码| */ #define REQUEST_CYXYCX_QQ 1320 // 可用合约查询 + +#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申购赎回 + ////////////////////////////////////////////////////////////////////////// // 登录部分 diff --git a/include/Tdx/tdx_struct.h b/include/Tdx/tdx_struct.h index b556680..0f6f087 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,93 @@ struct Error_STRUCT int ErrType; int ErrCode; char ErrInfo[256]; + + void* Client; // 多账号 +}; + +// 请求 +// 响应,有两种类型 +// 一个请求只返回一行数据 +// 一个请求返回多行数据 +struct RequestRespone_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 WTBH[32]; // 146_委托编号 + char JYSDM[32]; // 100_交易所代码 + + 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]; + + bool bAll; + + void* Client; // 多账号 + //请求类型 + int requestType; }; // 股东列表 @@ -56,18 +126,22 @@ struct GDLB_STRUCT int ZHLB_; // 125_帐号类别 int RZRQBS_; // 281_融资融券标识 + + 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 +149,18 @@ 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_保留信息 + int WTRQ_; int WTSJ_; - char MMBZ_; - char JYSDM_; + int MMBZ_; + int WTLB_; + int JYSDM_; double WTJG_; int WTSL_; double CJJG_; @@ -92,6 +169,9 @@ struct WTLB_STRUCT double DJZJ_; int ZTSM_; int BJFS_; + int WTFS_; + + void* Client; // 多账号 }; // 成交列表 @@ -118,8 +198,8 @@ struct CJLB_STRUCT int CJRQ_; int CJSJ_; - char MMBZ_; - char WTLB_; + int MMBZ_; + int WTLB_; double CJJG_; int CJSL_; double FSJE_; @@ -128,7 +208,9 @@ struct CJLB_STRUCT double YHS_; double GHF_; double CJF_; - char CDBZ_; + int CDBZ_; + + void* Client; // 多账号 }; @@ -157,6 +239,8 @@ struct GFLB_STRUCT double DQJ_; double ZXSZ_; double DJSL_; + + void* Client; // 多账号 }; // 资金余额 @@ -175,6 +259,8 @@ struct ZJYE_STRUCT double ZZC_; double KQZJ_; double ZXSZ_; + + void* Client; // 多账号 }; struct HQ_STRUCT @@ -246,6 +332,8 @@ struct HQ_STRUCT double ZXMCBDJW_; // 227_最小卖出变动价位 double ZTJG_; // 940_涨停价格 double DTJG_; // 941_跌停价格 + + void* Client; // 多账号 }; // @@ -260,6 +348,8 @@ struct DLJG_STRUCT char COL1[128]; char COL2[128]; char COL3[128]; + + void* Client; // 多账号 }; #endif diff --git a/include/Tdx/win32/TdxApi.License b/include/Tdx/win32/TdxApi.License new file mode 100644 index 0000000..596fcbc --- /dev/null +++ b/include/Tdx/win32/TdxApi.License @@ -0,0 +1,9 @@ +[License] +ExpireDate = "20160201" +Trial = "5" +MachineID = ".*" +Product = "TdxApi" +[User] +Account = ".*" +UserName = +Info = "公开试用账号" diff --git a/include/Tdx/win32/TdxApi.Signature b/include/Tdx/win32/TdxApi.Signature new file mode 100644 index 0000000..80c9dad --- /dev/null +++ b/include/Tdx/win32/TdxApi.Signature @@ -0,0 +1 @@ +623463875E2D9E29330E241A589BDE68186C54E97612498200173885476C3E7DC6F2B92E3358D7678F6340AADF24792A23A5F60E994596A591455554D40F9C17B2A3FD3AD28BEFA5D416C5E7FF0BBA6BD38066FB6AD82ABC03643CA73007EDA45E1FA2C2124B8D742A279CA69FC13F621D28C306AC8E2C40A791873DF6C06C2F \ No newline at end of file diff --git a/include/Tdx/win32/TdxApi.dll b/include/Tdx/win32/TdxApi.dll index 8dcc513..3c8d3d2 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..7c379b1 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..1a0839c 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..154069f 100644 Binary files a/include/Tdx/win32/TdxInjector.exe and b/include/Tdx/win32/TdxInjector.exe 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..e75fb10 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/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..04af10c 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, fnOnRespone 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..c7383a2 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; @@ -38,31 +39,29 @@ 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(){}; 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..a4a0f24 100644 --- a/include/toolkit.cpp +++ b/include/toolkit.cpp @@ -469,3 +469,42 @@ void GetOnFrontDisconnectedMsg(int ErrorId, char* ErrorMsg) break; } } + +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); +} 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..587f783 --- /dev/null +++ b/languages/CPP/XAPI_CPP/XAPI_CPP.vcxproj @@ -0,0 +1,106 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {39599EFE-428F-408F-BF4F-BF462E37C5E8} + Win32Proj + XAPI_CPP + + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + false + v120 + 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;%(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 90% rename from QuantBox_XAPI/QuantBox_XAPI.vcxproj.filters rename to languages/CPP/XAPI_CPP/XAPI_CPP.vcxproj.filters index 49328ae..72f259a 100644 --- a/QuantBox_XAPI/QuantBox_XAPI.vcxproj.filters +++ b/languages/CPP/XAPI_CPP/XAPI_CPP.vcxproj.filters @@ -30,12 +30,6 @@ 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..fadb7d8 --- /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 = ((fnOnRespone)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*)((fnOnRespone)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*)((fnOnRespone)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 ((fnOnRespone)pFun)(RequestType::RequestType_Create, nullptr, nullptr, 0, 0, nullptr, 0, nullptr, 0, nullptr, 0); +} + +void X_Register(void* pFun, void* pApi, fnOnRespone pCallback, void* pClass) +{ + if (pFun == nullptr || pApi == nullptr) + return; + + ((fnOnRespone)pFun)(RequestType::RequestType_Register, pApi, nullptr, 0, 0, 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; + + ((fnOnRespone)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; + + ((fnOnRespone)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; + + ((fnOnRespone)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; + + ((fnOnRespone)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; + + ((fnOnRespone)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; + + ((fnOnRespone)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; + + ((fnOnRespone)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*)((fnOnRespone)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*)((fnOnRespone)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*)((fnOnRespone)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*)((fnOnRespone)pFun)(RequestType::RequestType_ReqQuoteAction, pApi, nullptr, 0, 0, pIn, count, pOut, 0, nullptr, 0); +} diff --git a/QuantBox_XAPI/XApiCpp.cpp b/languages/CPP/XAPI_CPP/XApiCpp.cpp similarity index 54% rename from QuantBox_XAPI/XApiCpp.cpp rename to languages/CPP/XAPI_CPP/XApiCpp.cpp index d69c6ce..c862161 100644 --- a/QuantBox_XAPI/XApiCpp.cpp +++ b/languages/CPP/XAPI_CPP/XApiCpp.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "../include/XApiCpp.h" +#include "../../../include/XApiCpp.h" #include "XApiImpl.h" @@ -7,7 +7,7 @@ CXApi::CXApi() { } -CXApi* CXApi::CreateApi(char* libPath) +CXApi* CXApi::CreateApi(const char* libPath) { return new CXApiImpl(libPath); } diff --git a/QuantBox_XAPI/XApiImpl.cpp b/languages/CPP/XAPI_CPP/XApiImpl.cpp similarity index 62% rename from QuantBox_XAPI/XApiImpl.cpp rename to languages/CPP/XAPI_CPP/XApiImpl.cpp index a3a9126..745ca0b 100644 --- a/QuantBox_XAPI/XApiImpl.cpp +++ b/languages/CPP/XAPI_CPP/XApiImpl.cpp @@ -3,8 +3,8 @@ #include #include "XApiImpl.h" -#include "../include/QueueEnum.h" -#include "../include/XApiC.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) { @@ -23,53 +23,53 @@ void* CXApiImpl::_OnRespone(char type, void* pApi1, void* pApi2, double double1, ResponeType rt = (ResponeType)type; switch (rt) { - case OnConnectionStatus: + case ResponeType_OnConnectionStatus: m_pSpi->OnConnectionStatus(this, (ConnectionStatus)(char)double1, (RspUserLoginField*)ptr1, size1); break; - case OnRtnError: + case ResponeType_OnRtnError: m_pSpi->OnRtnError(this, (ErrorField*)ptr1); break; - case OnRtnDepthMarketData: + case ResponeType_OnRtnDepthMarketData: m_pSpi->OnRtnDepthMarketDataN(this, (DepthMarketDataNField*)ptr1); break; - case OnRspQryInstrument: + case ResponeType_OnRspQryInstrument: m_pSpi->OnRspQryInstrument(this, (InstrumentField*)ptr1, size1, double1 != 0); break; - case OnRspQryTradingAccount: + case ResponeType_OnRspQryTradingAccount: m_pSpi->OnRspQryTradingAccount(this, (AccountField*)ptr1, size1, double1 != 0); break; - case OnRspQryInvestorPosition: + case ResponeType_OnRspQryInvestorPosition: m_pSpi->OnRspQryInvestorPosition(this, (PositionField*)ptr1, size1, double1 != 0); break; - case OnRspQrySettlementInfo: + case ResponeType_OnRspQrySettlementInfo: m_pSpi->OnRspQrySettlementInfo(this, (SettlementInfoField*)ptr1, size1, double1 != 0); break; - case OnRtnOrder: + case ResponeType_OnRtnOrder: m_pSpi->OnRtnOrder(this, (OrderField*)ptr1); break; - case OnRtnTrade: + case ResponeType_OnRtnTrade: m_pSpi->OnRtnTrade(this, (TradeField*)ptr1); break; - case OnRtnQuote: + case ResponeType_OnRtnQuote: m_pSpi->OnRtnQuote(this, (QuoteField*)ptr1); break; - case OnRtnQuoteRequest: + case ResponeType_OnRtnQuoteRequest: m_pSpi->OnRtnQuoteRequest(this, (QuoteRequestField*)ptr1); break; - case OnRspQryHistoricalTicks: + case ResponeType_OnRspQryHistoricalTicks: m_pSpi->OnRspQryHistoricalTicks(this, (TickField*)ptr1, size1, (HistoricalDataRequestField*)ptr2, size2, double1 != 0); break; - case OnRspQryHistoricalBars: + case ResponeType_OnRspQryHistoricalBars: m_pSpi->OnRspQryHistoricalBars(this, (BarField*)ptr1, size1, (HistoricalDataRequestField*)ptr2, size2, double1 != 0); break; - case OnRspQryInvestor: + case ResponeType_OnRspQryInvestor: m_pSpi->OnRspQryInvestor(this, (InvestorField*)ptr1, size1, double1 != 0); break; - case OnFilterSubscribe: + case ResponeType_OnFilterSubscribe: return (void*)m_pSpi->OnFilterSubscribe(this, (ExchangeType)(char)double1, (int)size1, (int)size1, (int)size3, (char*)ptr1); default: break; @@ -77,7 +77,7 @@ void* CXApiImpl::_OnRespone(char type, void* pApi1, void* pApi2, double double1, return nullptr; } -CXApiImpl::CXApiImpl(char* libPath) :CXApi() +CXApiImpl::CXApiImpl(const char* libPath) :CXApi() { m_pLib = nullptr; m_pFun = nullptr; @@ -93,17 +93,17 @@ CXApiImpl::~CXApiImpl() Disconnect(); } -ApiType CXApiImpl::GetApiType() +ApiType CXApiImpl::GetApiTypes() { - return X_GetApiType(m_pFun); + return X_GetApiTypes(m_pFun); } -char* CXApiImpl::GetApiVersion() +const char* CXApiImpl::GetApiVersion() { return X_GetApiVersion(m_pFun); } -char* CXApiImpl::GetApiName() +const char* CXApiImpl::GetApiName() { return X_GetApiName(m_pFun); } @@ -127,15 +127,15 @@ bool CXApiImpl::Init() return false; } -char* CXApiImpl::GetLastError() +const char* CXApiImpl::GetLastError() { return X_GetLastError(); } -void CXApiImpl::Connect(char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count) +void CXApiImpl::Connect(const char* szPath, ServerInfoField* pServerInfo, UserInfoField* pUserInfo, int count) { m_pApi = X_Create(m_pFun); - X_Register(m_pFun, m_pApi, (void*)OnRespone, this); + X_Register(m_pFun, m_pApi, (fnOnRespone)OnRespone, this); X_Connect(m_pFun, m_pApi, szPath, pServerInfo, pUserInfo, count); } @@ -150,46 +150,37 @@ void CXApiImpl::Disconnect() m_pSpi = nullptr; } -void CXApiImpl::Subscribe(char* szInstrument, char* szExchange) +void CXApiImpl::Subscribe(const char* szInstrument, const char* szExchange) { X_Subscribe(m_pFun, m_pApi, szInstrument, szExchange); } -void CXApiImpl::Unsubscribe(char* szInstrument, char* szExchange) +void CXApiImpl::Unsubscribe(const char* szInstrument, const char* szExchange) { X_Unsubscribe(m_pFun, m_pApi, szInstrument, szExchange); } -void CXApiImpl::ReqQryInstrument(char* szInstrument, char* szExchange) +void CXApiImpl::ReqQuery(QueryType type, ReqQueryField* query) { - X_ReqQryInstrument(m_pFun, m_pApi, szInstrument, szExchange); + X_ReqQuery(m_pFun, m_pApi, type, query); } -void CXApiImpl::ReqQryInvestorPosition(char* szInstrument, char* szExchange) +const char* CXApiImpl::SendOrder(OrderField* pOrder, int count, char* pOut) { - X_ReqQryInvestorPosition(m_pFun, m_pApi, szInstrument, szExchange); + return X_SendOrder(m_pFun, m_pApi, pOrder, count, pOut); } -void CXApiImpl::ReqQryTradingAccount() +const char* CXApiImpl::CancelOrder(OrderIDType* pIn, int count, char* pOut) { - X_ReqQryTradingAccount(m_pFun, m_pApi); + return X_CancelOrder(m_pFun, m_pApi, pIn, count, pOut); } -void CXApiImpl::SendOrder(OrderField* pOrder, OrderIDType* pInOut, int count) +const char* CXApiImpl::SendQuote(QuoteField* pQuote, int count, char* pOut) { - X_SendOrder(m_pFun, m_pApi, pOrder, pInOut, count); + return X_SendQuote(m_pFun, m_pApi, pQuote, count, pOut); } -void CXApiImpl::CancelOrder(OrderIDType* pIn, OrderIDType* pOut, int count) +const char* CXApiImpl::CancelQuote(OrderIDType* pIn, int count, char* pOut) { - 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); + 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..97e6104 --- /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 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_Queue/dllmain.cpp b/languages/CPP/XAPI_CPP/dllmain.cpp similarity index 100% rename from QuantBox_Queue/dllmain.cpp rename to languages/CPP/XAPI_CPP/dllmain.cpp 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/Delegate.cs b/languages/CSharp/XAPI_CSharp/COM/Delegate.cs new file mode 100644 index 0000000..745632d --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/Delegate.cs @@ -0,0 +1,44 @@ +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(object sender, int status, string status_String, [In] ref RspUserLoginClass userLogin, int size1); + [ComVisible(false)] + public delegate void DelegateOnRtnError(object sender, [In] ref ErrorClass error); + [ComVisible(false)] + public delegate void DelegateOnLog(object sender, [In] ref LogClass log); + + [ComVisible(false)] + public delegate void DelegateOnRtnDepthMarketData(object sender, [In]ref DepthMarketDataNClass marketData); + //public delegate void DelegateOnRtnQuoteRequest(object sender, [In]ref QuoteRequestField quoteRequest); + + [ComVisible(false)] + public delegate void DelegateOnRspQryInstrument(object sender, [In] ref InstrumentClass instrument, int size1, bool bIsLast); + [ComVisible(false)] + public delegate void DelegateOnRspQryTradingAccount(object sender, [In] ref AccountClass account, int size1, bool bIsLast); + [ComVisible(false)] + public delegate void DelegateOnRspQryInvestorPosition(object sender, [In] ref PositionClass position, int size1, bool bIsLast); + //public delegate void DelegateOnRspQrySettlementInfo(object sender, [In] ref SettlementInfoClass settlementInfo, int size1, bool bIsLast); + //public delegate void DelegateOnRspQryInvestor(object sender, [In] ref InvestorField investor, int size1, bool bIsLast); + [ComVisible(false)] + public delegate void DelegateOnRtnOrder(object sender, [In] ref OrderClass order); + [ComVisible(false)] + public delegate void DelegateOnRtnTrade(object sender, [In] ref TradeClass trade); + //public delegate void DelegateOnRtnQuote(object sender, [In] ref QuoteField quote); + [ComVisible(false)] + public delegate void DelegateOnRspQryOrder(object sender, [In] ref OrderClass order, int size1, bool bIsLast); + [ComVisible(false)] + public delegate void DelegateOnRspQryTrade(object sender, [In] ref TradeClass trade, int size1, bool bIsLast); + //public delegate void DelegateOnRspQryQuote(object sender, [In] ref QuoteField quote, int size1, bool bIsLast); + + //public delegate void DelegateOnRspQryHistoricalTicks(object sender, IntPtr pTicks, int size1, [In] ref HistoricalDataRequestField request, int size2, bool bIsLast); + //public delegate void DelegateOnRspQryHistoricalBars(object sender, IntPtr pBars, int size1, [In] ref 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/IXApi.cs b/languages/CSharp/XAPI_CSharp/COM/IXApi.cs new file mode 100644 index 0000000..3555df6 --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/IXApi.cs @@ -0,0 +1,50 @@ +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(XAPI.QueryType type); + [DispId(50)] + QueueData TryDequeue(); + } +} diff --git a/languages/CSharp/XAPI_CSharp/COM/IXApiEvents.cs b/languages/CSharp/XAPI_CSharp/COM/IXApiEvents.cs new file mode 100644 index 0000000..7f2223e --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/IXApiEvents.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace XAPI.COM +{ + [ComVisible(true)] + [Guid("4D7F9B54-3098-45AE-8EEB-4ED24AC47613")] + [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] + public interface IXApiEvents + { + [DispId(1)] + void OnConnectionStatus(object sender, int status, string status_String, [In] ref RspUserLoginClass userLogin, int size1); + [DispId(2)] + void OnRtnError(object sender, [In] ref ErrorClass error); + [DispId(3)] + void OnLog(object sender, [In] ref LogClass log); + + [DispId(4)] + void OnRtnDepthMarketData(object sender, [In]ref DepthMarketDataNClass marketData); + //public delegate void DelegateOnRtnQuoteRequest(object sender, [In]ref QuoteRequestField quoteRequest); + + [DispId(5)] + void OnRspQryInstrument(object sender, [In] ref InstrumentClass instrument, int size1, bool bIsLast); + [DispId(6)] + void OnRspQryTradingAccount(object sender, [In] ref AccountClass account, int size1, bool bIsLast); + [DispId(7)] + void OnRspQryInvestorPosition(object sender, [In] ref PositionClass position, int size1, bool bIsLast); + //public delegate void DelegateOnRspQrySettlementInfo(object sender, [In] ref SettlementInfoClass settlementInfo, int size1, bool bIsLast); + //public delegate void DelegateOnRspQryInvestor(object sender, [In] ref InvestorField investor, int size1, bool bIsLast); + [DispId(8)] + void OnRtnOrder(object sender, [In] ref OrderClass order); + [DispId(9)] + void OnRtnTrade(object sender, [In] ref TradeClass trade); + //public delegate void DelegateOnRtnQuote(object sender, [In] ref QuoteField quote); + [DispId(10)] + void OnRspQryOrder(object sender, [In] ref OrderClass order, int size1, bool bIsLast); + [DispId(11)] + void OnRspQryTrade(object sender, [In] ref TradeClass trade, int size1, bool bIsLast); + //public delegate void DelegateOnRspQryQuote(object sender, [In] ref QuoteField quote, int size1, bool bIsLast); + + //public delegate void DelegateOnRspQryHistoricalTicks(object sender, IntPtr pTicks, int size1, [In] ref HistoricalDataRequestField request, int size2, bool bIsLast); + //public delegate void DelegateOnRspQryHistoricalBars(object sender, IntPtr pBars, int size1, [In] ref 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/Struct.cs b/languages/CSharp/XAPI_CSharp/COM/Struct.cs new file mode 100644 index 0000000..313c8bb --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/Struct.cs @@ -0,0 +1,981 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + + +namespace XAPI.COM +{ + ///// + ///// 查询持仓,查委托,查成交 + ///// + //[ComVisible(true)] + //[Guid("6E232C62-E200-4C15-863F-D319B74414C9")] + //public class ReqQueryClass + //{ + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] + // public string InstrumentName; + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + // public string Symbol; + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + // public string InstrumentID; + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + // public string ExchangeID; + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + // public string ClientID; + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + // public string AccountID; + + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + // public string CurrencyID; + + // public int DateStart; + // public int DateEnd; + // public int TimeStart; + // public int TimeEnd; + + + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + // public string Char64ID; + // public int Int32ID; + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + // public string Char64PositionIndex; + // public int Int32PositionIndex; + //} + + ///持仓 + [ComVisible(true)] + [Guid("07C1DA6E-A85E-4931-ABE6-03681A3DBB0B")] + public class PositionClass + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] + public string InstrumentName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string Symbol; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + public string InstrumentID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string ExchangeID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string ClientID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + 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; + } + + /// + /// 做市商双向报价 + /// + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct QuoteField + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] + public byte[] InstrumentName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string Symbol; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + public string InstrumentID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string ExchangeID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string ClientID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + 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; + + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string QuoteReqID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string LocalID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string ID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string AskID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string BidID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string AskOrderID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string BidOrderID; + + public int XErrorID; + public int RawErrorID; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + public byte[] Text; + } + + /// + /// 订单信息 + /// + [ComVisible(true)] + [Guid("23FC4E48-54FF-4A89-B924-B8668C5D9570")] + public class OrderClass + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] + public string InstrumentName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string Symbol; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + public string InstrumentID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string ExchangeID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string ClientID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + 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; + + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string ID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string OrderID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + 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; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + public string Text; + + public int ReserveInt32; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string ReserveChar64; + } + + /// + /// 成交回报 + /// + [ComVisible(true)] + [Guid("9FF68AA1-CB14-49E5-91F9-856400663C5E")] + public class TradeClass + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] + public string InstrumentName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string Symbol; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + public string InstrumentID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string ExchangeID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string ClientID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + 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; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string ID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string TradeID; + + public double Commission; + + public int ReserveInt32; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string ReserveChar64; + } + + + ///// + ///// 服务器信息 + ///// + //[ComVisible(true)] + //[Guid("44C1222D-D53A-40E7-ADE6-8106ED187389")] + //public class ServerInfoClass + //{ + // /// + // /// 订阅主题 + // /// + // [MarshalAs(UnmanagedType.U1)] + // public bool IsUsingUdp; + // /// + // /// 订阅主题 + // /// + // [MarshalAs(UnmanagedType.U1)] + // public bool IsMulticast; + // /// + // /// 订阅主题 + // /// + // public int TopicId; + // /// + // /// 端口号 + // /// + // public int Port; + // /// + // /// 流恢复 + // /// + // public int MarketDataTopicResumeType; + // public int PrivateTopicResumeType; + // public int PublicTopicResumeType; + // public int UserTopicResumeType; + // /// + // /// 经纪公司代码 + // /// + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 11)] + // public string BrokerID; + // /// + // /// 用户端产品信息 + // /// + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 11)] + // public string UserProductInfo; + // /// + // /// 认证码 + // /// + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 17)] + // public string AuthCode; + // /// + // /// 地址 + // /// + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)] + // public string Address; + // /// + // /// 配置文件路径 + // /// + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + // public string ConfigPath; + // /// + // /// 扩展信息 + // /// + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + // public string ExtInfoChar128; + //} + + + ///// + ///// 用户信息 + ///// + //[ComVisible(true)] + //[Guid("64B0070A-B601-45C2-BD7D-CE507AFB924E")] + //public class UserInfoClass + //{ + // /// + // /// 用户代码 + // /// + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + // public string UserID; + // /// + // /// 密码 + // /// + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 41)] + // public string Password; + // /// + // /// 扩展信息,通达信中用来做通讯密码 + // /// + // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + // public string ExtInfoChar64; + // /// + // /// 扩展信息 + // /// + // public int ExtInfoInt32; + //} + + + /// + /// 错误信息 + /// + [ComVisible(true)] + [Guid("5F68D385-04A7-4247-8C07-839C6CE68EFF")] + public class ErrorClass + { + /// + /// 错误代码 + /// + public int XErrorID; + /// + /// 错误代码 + /// + public int RawErrorID; + /// + /// 错误信息 + /// + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + public string Text; + /// + /// 信息来源 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string Source; + } + + + /// + /// 日志信息 + /// + [ComVisible(true)] + [Guid("4A4FDEFA-AEA6-496E-AE92-F00FD28A2075")] + public class LogClass + { + /// + /// 日志级别 + /// + public int Level; + public string Level_String; + /// + /// 错误信息 + /// + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + public string Message; + } + + + [ComVisible(true)] + [Guid("D642BDD2-8BB7-4BC9-BDC4-29CF05D1EAD4")] + 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)] + public struct DepthClass + { + public double Price; + public int Size; + public int Count; + } + + + /// + /// 合约信息 + /// + [ComVisible(true)] + [Guid("37ED5322-1C11-477A-AC97-F947AD8532B2")] + public class InstrumentClass + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] + public string InstrumentName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string Symbol; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + public string InstrumentID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string ExchangeID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string ClientID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string AccountID; + + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + 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; + /// + /// 产品代码 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + public string ProductID; + /// + /// 基础商品代码 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + public string UnderlyingInstrID; + ///合约生命周期状态 + public int InstLifePhase; + public string InstLifePhase_String; + } + + /// + /// 账号 + /// + [ComVisible(true)] + [Guid("6A75FF0C-C78F-4805-96AB-0FB4AF196152")] + public class AccountClass + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string ClientID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string AccountID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] + 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(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct SettlementInfoField + { + public int Size; + /// + /// 交易日 + /// + public int TradingDay; + ///// + ///// 消息正文 + ///// + //[MarshalAs(UnmanagedType.ByValArray, SizeConst = 501)] + //public byte[] Content; + } + + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct SettlementInfoClass + { + /// + /// 交易日 + /// + public int TradingDay; + ///// + ///// 消息正文 + ///// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)] + public string Content; + } + + /// + /// 投资者 + /// + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct InvestorField + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string InvestorID; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 11)] + public string BrokerID; + public IdCardType IdentifiedCardType; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 51)] + public string IdentifiedCardNo; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 81)] + public byte[] InvestorName; + } + + + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct OrderIDType + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string ID; + } + + /// + /// 深度行情N档 + /// + [ComVisible(false)] + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] + public struct DepthMarketDataNField + { + ///占用总字节大小 + public int Size; + + public int TradingDay; + public int ActionDay; + public int UpdateTime; + public int UpdateMillisec; + + /// + /// 合约代码 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string Symbol; + /// + /// 合约代码 + /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] + public string InstrumentID; + /// + /// 交易所代码 + /// + public ExchangeType 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 TradingPhaseType TradingPhase; + + ///买档个数 + public int BidCount; + } + + [ComVisible(true)] + [Guid("468A2E0A-A1F3-4B68-8CC4-D1C4DBA8E45B")] + public class DepthMarketDataNClass + { + public int TradingDay; + public int ActionDay; + public int UpdateTime; + public int UpdateMillisec; + + /// + /// 合约代码 + /// + [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 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 DepthField[] Bids; + public DepthField[] Asks; + } + + + + + + + + + + + + + + + + /// + /// 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")] + 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..d2cfd01 --- /dev/null +++ b/languages/CSharp/XAPI_CSharp/COM/XApiCom.cs @@ -0,0 +1,858 @@ +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 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(); + + // 这里不知道如何使用 + //Guid clsid = typeof(XApiCom).GUID; + //cookie = msRegSvc.RegisterTypeForComClients( + // typeof(XApiCom), + // RegistrationClassContext.LocalServer, + // RegistrationConnectionType.SingleUse); + } + + /// + ///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(); + + //msRegSvc.UnregisterTypeForComClients(cookie); + } + + 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; + //base.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(); + + + } + + 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(XAPI.QueryType type) + { + api.ReqQuery(type, ref _Query); + } + + public QueueData TryDequeue() + { + QueueData qd; + if (MessageQueue.TryDequeue(out qd)) + { + return qd; + } + return null; + } + + private void OnConnectionStatus_callback(object sender, XAPI.ConnectionStatus status, ref RspUserLoginField userLogin, int size1) + { + RspUserLoginClass cls = null; + + if (size1 > 0) + { + cls = new RspUserLoginClass(); + 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)ResponeType.OnConnectionStatus; + qd.Type_String = Enum.ToString(ResponeType.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), ref 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)ResponeType.OnRtnError; + qd.Type_String = Enum.ToString(ResponeType.OnRtnError); + qd.Sender = this; + qd.Data1 = cls; + + MessageQueue.Enqueue(qd); + } + else + { + OnRtnError(this, ref 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)ResponeType.OnLog; + qd.Type_String = Enum.ToString(ResponeType.OnLog); + qd.Sender = this; + qd.Data1 = cls; + + MessageQueue.Enqueue(qd); + } + else + { + OnLog(this, ref cls); + } + } + + private void OnRtnDepthMarketData_callback(object sender, 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); + //cls.Bids = marketData.TradingDay; + //cls.TradingDay = marketData.TradingDay; + + if (null == OnRtnDepthMarketData) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponeType.OnRtnDepthMarketData; + qd.Type_String = Enum.ToString(ResponeType.OnRtnDepthMarketData); + qd.Sender = this; + qd.Data1 = cls; + + MessageQueue.Enqueue(qd); + } + else + { + OnRtnDepthMarketData(this, ref cls); + } + } + + private void OnRtnOrder_callback(object sender, 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; + + if (null == OnRtnOrder) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponeType.OnRtnOrder; + qd.Type_String = Enum.ToString(ResponeType.OnRtnOrder); + qd.Sender = this; + qd.Data1 = cls; + + MessageQueue.Enqueue(qd); + } + else + { + OnRtnOrder(this, ref cls); + } + } + + private void OnRtnTrade_callback(object sender, 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; + + if (null == OnRtnTrade) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponeType.OnRtnTrade; + qd.Type_String = Enum.ToString(ResponeType.OnRtnTrade); + qd.Sender = this; + qd.Data1 = cls; + + MessageQueue.Enqueue(qd); + } + else + { + OnRtnTrade(this, ref cls); + } + } + + private void OnRspQryInstrument_callback(object sender, 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)ResponeType.OnRspQryInstrument; + qd.Type_String = Enum.ToString(ResponeType.OnRspQryInstrument); + qd.Sender = this; + qd.Data1 = cls; + qd.Data2 = size1; + qd.Data3 = bIsLast; + + MessageQueue.Enqueue(qd); + } + else + { + OnRspQryInstrument(this, ref cls, size1, bIsLast); + } + } + + private void OnRspQryInvestorPosition_callback(object sender, 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; + + if (null == OnRspQryInvestorPosition) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponeType.OnRspQryInvestorPosition; + qd.Type_String = Enum.ToString(ResponeType.OnRspQryInvestorPosition); + qd.Sender = this; + qd.Data1 = cls; + qd.Data2 = size1; + qd.Data3 = bIsLast; + + MessageQueue.Enqueue(qd); + } + else + { + OnRspQryInvestorPosition(this, ref cls, size1, bIsLast); + } + } + + private void OnRspQryTradingAccount_callback(object sender, 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)ResponeType.OnRspQryTradingAccount; + qd.Type_String = Enum.ToString(ResponeType.OnRspQryTradingAccount); + qd.Sender = this; + qd.Data1 = cls; + qd.Data2 = size1; + qd.Data3 = bIsLast; + + MessageQueue.Enqueue(qd); + } + else + { + OnRspQryTradingAccount(this, ref cls, size1, bIsLast); + } + } + + private void OnRspQryOrder_callback(object sender, ref OrderField order, int size1, bool bIsLast) + { + if (null == OnRspQryOrder) + return; + + OrderClass cls = null; + + if (size1 > 0) + { + OrderField field = order; + + 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; + } + + if (null == OnRspQryOrder) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponeType.OnRspQryOrder; + qd.Type_String = Enum.ToString(ResponeType.OnRspQryOrder); + qd.Sender = this; + qd.Data1 = cls; + qd.Data2 = size1; + qd.Data3 = bIsLast; + + MessageQueue.Enqueue(qd); + } + else + { + OnRspQryOrder(this, ref cls, size1, bIsLast); + } + } + + private void OnRspQryTrade_callback(object sender, ref TradeField trade, int size1, bool bIsLast) + { + if (null == OnRspQryTrade) + return; + + TradeClass cls = null; + + if (size1 > 0) + { + TradeField field = trade; + + 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; + } + + if (null == OnRspQryTrade) + { + QueueData qd = new QueueData(); + qd.Type = (int)ResponeType.OnRspQryTrade; + qd.Type_String = Enum.ToString(ResponeType.OnRspQryTrade); + qd.Sender = this; + qd.Data1 = cls; + qd.Data2 = size1; + qd.Data3 = bIsLast; + + MessageQueue.Enqueue(qd); + } + else + { + OnRspQryTrade(this, ref 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(); + + } + } +} 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 98% rename from csharp/QuantBox.XAPI/Callback/BaseApi.cs rename to languages/CSharp/XAPI_CSharp/Callback/BaseApi.cs index 7a2d9c5..061d405 100644 --- a/csharp/QuantBox.XAPI/Callback/BaseApi.cs +++ b/languages/CSharp/XAPI_CSharp/Callback/BaseApi.cs @@ -6,8 +6,9 @@ using System.Runtime.InteropServices; using System.Text; -namespace QuantBox.XAPI.Callback +namespace XAPI.Callback { + [ComVisible(false)] public class BaseApi : IDisposable { public Logger Log; @@ -211,14 +212,14 @@ 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); } } 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, @@ -195,6 +211,7 @@ public enum ExecType : byte ReplaceReject, }; + [ComVisible(false)] public enum OpenCloseType : byte { Open, @@ -202,6 +219,7 @@ public enum OpenCloseType : byte CloseToday, }; + [ComVisible(false)] public enum HedgeFlagType : byte { Speculation, @@ -211,6 +229,7 @@ public enum HedgeFlagType : byte MarketMaker, }; + [ComVisible(false)] public enum InstrumentType : byte { Stock, @@ -225,6 +244,7 @@ public enum InstrumentType : byte Synthetic, }; + [ComVisible(false)] public enum IdCardType : byte { EID, ///组织机构代码 @@ -238,6 +258,7 @@ public enum IdCardType : byte OtherCard, ///其他证件 }; + [ComVisible(false)] public enum ExchangeType : byte { Undefined, /// 未定义 @@ -254,6 +275,7 @@ public enum ExchangeType : byte }; ///合约生命周期状态类型 + [ComVisible(false)] public enum InstLifePhaseType : byte { NotStart, ///未上市 @@ -268,6 +290,7 @@ public enum InstLifePhaseType : byte ///交易阶段类型 + [ComVisible(false)] public enum TradingPhaseType : byte { BeforeTrading, ///开盘前 @@ -288,7 +311,7 @@ public enum TradingPhaseType : byte /// /// ///////////////////////////////////////////////////////// /// - + [ComVisible(false)] public enum BarType:byte { Time = 1, @@ -298,6 +321,7 @@ public enum BarType:byte Session, }; + [ComVisible(false)] public enum DataObjetType : byte { DataObject, @@ -315,7 +339,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 94% rename from csharp/QuantBox.XAPI/Extensions.cs rename to languages/CSharp/XAPI_CSharp/Extensions.cs index 24e26da..eec8628 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) 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..5df4b6c 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,7 @@ namespace Ideafixxxer.Generics /// Helper class for enum types /// /// Must be enum type (declared using enum keyword) + [ComVisible(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 99% rename from csharp/QuantBox.XAPI/PInvokeUtility.cs rename to languages/CSharp/XAPI_CSharp/PInvokeUtility.cs index e0ce4a7..a9a5862 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)] 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 86% rename from csharp/QuantBox.XAPI/Program.cs rename to languages/CSharp/XAPI_CSharp/Program.cs index 9324fbc..f564dd7 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 { @@ -102,11 +103,23 @@ static bool OnFilterSubscribe(object sender, ExchangeType exchange, int instrume static void Main(string[] args) { - //for (int i = 0; i < 10000; ++i) + int i; + int iCount = args.Length; + + for (i = 0; i < iCount; i++) { - test_Tdx_Main(args); + Console.Write("Argument : "); + Console.WriteLine(args[i]); } - Console.ReadKey(); + + Console.WriteLine("Press [ENTER] to exit."); + Console.ReadLine(); + + ////for (int i = 0; i < 10000; ++i) + //{ + // test_Tdx_Main(args); + //} + //Console.ReadKey(); } static void test_Linux_Main(string[] args) @@ -330,5 +343,42 @@ static void test_Tdx_Main(string[] args) 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"; + api.Server.ExtInfoChar128 = @"D:\new_hbzq_qq\"; + + api.User.UserID = "05000000000"; + api.User.Password = "123456"; + + api.OnConnectionStatus += api_OnConnectionStatus; + api.OnRtnDepthMarketData += api_OnRtnDepthMarketData; + + api.Connect(); + + Console.ReadKey(); + + Console.ReadKey(); + + api.Dispose(); + + Console.ReadKey(); + + 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 68% rename from csharp/QuantBox.XAPI/Properties/AssemblyInfo.cs rename to languages/CSharp/XAPI_CSharp/Properties/AssemblyInfo.cs index bb86af5..042a2d9 100644 --- a/csharp/QuantBox.XAPI/Properties/AssemblyInfo.cs +++ b/languages/CSharp/XAPI_CSharp/Properties/AssemblyInfo.cs @@ -1,15 +1,17 @@ -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: AssemblyProduct("XAPI")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -17,10 +19,13 @@ // 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,10 @@ // 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.4.0.0")] +[assembly: AssemblyFileVersion("1.4.0.0")] + +[assembly: ApplicationName("XApiComPlus")] +[assembly: Description("XApiComPlus Assembly")] +[assembly: ApplicationActivation(ActivationOption.Server)] +[assembly: ApplicationAccessControl(false)] 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/ResponeType.cs similarity index 96% rename from csharp/QuantBox.XAPI/ResponeType.cs rename to languages/CSharp/XAPI_CSharp/ResponeType.cs index c9b3a4e..e5f1f77 100644 --- a/csharp/QuantBox.XAPI/ResponeType.cs +++ b/languages/CSharp/XAPI_CSharp/ResponeType.cs @@ -4,7 +4,7 @@ using System.Text; -namespace QuantBox.XAPI +namespace XAPI { public enum ResponeType : byte { 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 96% rename from csharp/QuantBox.XAPI/Struct.cs rename to languages/CSharp/XAPI_CSharp/Struct.cs index 856596a..0b3d77c 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,12 @@ 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; } ///持仓 + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct PositionField { @@ -83,6 +85,7 @@ public struct PositionField /// /// 做市商双向报价 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct QuoteField { @@ -138,6 +141,7 @@ public struct QuoteField /// /// 订单信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct OrderField { @@ -195,6 +199,7 @@ public struct OrderField /// /// 成交回报 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct TradeField { @@ -236,6 +241,7 @@ public struct TradeField /// /// 服务器信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct ServerInfoField { @@ -300,6 +306,7 @@ public struct ServerInfoField /// /// 用户信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct UserInfoField { @@ -328,6 +335,7 @@ public struct UserInfoField /// /// 错误信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct ErrorField { @@ -355,6 +363,7 @@ public struct ErrorField /// /// 日志信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct LogField { @@ -373,6 +382,7 @@ public struct LogField /// /// 登录回报 /// + [ComVisible(true)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct RspUserLoginField { @@ -426,6 +436,7 @@ public struct RspUserLoginField /// /// DepthField行情 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct DepthField { @@ -438,6 +449,7 @@ public struct DepthField /// /// 合约信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct InstrumentField { @@ -501,6 +513,7 @@ public struct InstrumentField /// /// 账号 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct AccountField { @@ -580,11 +593,10 @@ public struct AccountField public double CashIn; } - - /// /// 发给做市商的询价请求 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct QuoteRequestField { @@ -622,6 +634,7 @@ public struct QuoteRequestField /// /// 结算信息 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct SettlementInfoField { @@ -637,6 +650,7 @@ public struct SettlementInfoField //public byte[] Content; } + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct SettlementInfoClass { @@ -654,6 +668,7 @@ public struct SettlementInfoClass /// /// 投资者 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct InvestorField { @@ -669,6 +684,7 @@ public struct InvestorField } + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct OrderIDType { @@ -679,6 +695,7 @@ public struct OrderIDType /// /// 深度行情N档 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct DepthMarketDataNField { @@ -703,6 +720,11 @@ public struct DepthMarketDataNField /// /// 交易所代码 /// + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] + public string ExchangeID; + /// + /// 交易所代码 + /// public ExchangeType Exchange; @@ -777,6 +799,7 @@ public struct DepthMarketDataNField public int BidCount; } + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public class DepthMarketDataNClass { @@ -785,11 +808,6 @@ public class DepthMarketDataNClass public int UpdateTime; public int UpdateMillisec; - /// - /// 交易所代码 - /// - public ExchangeType Exchange; - /// /// 合约代码 /// @@ -800,6 +818,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 +919,7 @@ public class DepthMarketDataNClass /// /// Tick行情 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct TickField { @@ -910,6 +939,7 @@ public struct TickField /// /// Bar行情 /// + [ComVisible(false)] [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public struct BarField { @@ -930,6 +960,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 73% rename from csharp/QuantBox.XAPI/QuantBox.XAPI.csproj rename to languages/CSharp/XAPI_CSharp/XAPI_CSharp.csproj index aa3e5f3..0dc869d 100644 --- a/csharp/QuantBox.XAPI/QuantBox.XAPI.csproj +++ b/languages/CSharp/XAPI_CSharp/XAPI_CSharp.csproj @@ -7,8 +7,8 @@ {6AA065F5-2E4A-4112-A3AE-1F75CAE42FFB} Library Properties - QuantBox.XAPI - QuantBox.XAPI + XAPI + XAPI_CSharp v4.5 512 @@ -17,11 +17,11 @@ true full false - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\ + bin\Debug\x86\ DEBUG;TRACE prompt 4 - false + true AnyCPU true false @@ -48,6 +48,7 @@ prompt MinimumRecommendedRules.ruleset false + true true @@ -72,7 +73,7 @@ true - C:\Program Files\SmartQuant Ltd\OpenQuant 2014\ + bin\Debug\x64 DEBUG;TRACE full AnyCPU @@ -81,13 +82,38 @@ true false + + true + + + XAPI.snk + + + bin\Release64\ + TRACE + true + pdbonly + AnyCPU + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release64\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + - - False - ..\..\packages\NLog.4.0.1\lib\net45\NLog.dll + + ..\packages\NLog.4.2.3\lib\net45\NLog.dll + + @@ -102,6 +128,13 @@ + + + + + + UserControl + @@ -111,6 +144,7 @@ + @@ -122,9 +156,16 @@ + + + + + + XApiCom.cs + @@ -132,8 +173,8 @@ - xcopy "$(TargetPath)" "$(SolutionDir)XAPI\" /Y -xcopy "$(TargetDir)NLog.dll" "$(SolutionDir)XAPI\" /Y + +