添加ctp接口api编译的解决方案,修复获取持仓信息的bug

This commit is contained in:
msincenselee 2019-08-19 09:09:44 +08:00
parent 78852a0c52
commit 4acc31597e
3 changed files with 63 additions and 3 deletions

View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.489
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vnctpmd", "vnctpmd.vcxproj", "{2F0C046E-B41E-40E7-BB36-26249FA40DC1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2F0C046E-B41E-40E7-BB36-26249FA40DC1}.Debug|x64.ActiveCfg = Debug|x64
{2F0C046E-B41E-40E7-BB36-26249FA40DC1}.Debug|x64.Build.0 = Debug|x64
{2F0C046E-B41E-40E7-BB36-26249FA40DC1}.Debug|x86.ActiveCfg = Debug|Win32
{2F0C046E-B41E-40E7-BB36-26249FA40DC1}.Debug|x86.Build.0 = Debug|Win32
{2F0C046E-B41E-40E7-BB36-26249FA40DC1}.Release|x64.ActiveCfg = Release|x64
{2F0C046E-B41E-40E7-BB36-26249FA40DC1}.Release|x64.Build.0 = Release|x64
{2F0C046E-B41E-40E7-BB36-26249FA40DC1}.Release|x86.ActiveCfg = Release|Win32
{2F0C046E-B41E-40E7-BB36-26249FA40DC1}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EAF93A09-031B-4CE4-8304-31CD7C88637C}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.489
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vnctptd", "vnctptd.vcxproj", "{69635369-B64A-44F5-88E9-82CBD72EBE2E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{69635369-B64A-44F5-88E9-82CBD72EBE2E}.Debug|x64.ActiveCfg = Debug|x64
{69635369-B64A-44F5-88E9-82CBD72EBE2E}.Debug|x64.Build.0 = Debug|x64
{69635369-B64A-44F5-88E9-82CBD72EBE2E}.Debug|x86.ActiveCfg = Debug|Win32
{69635369-B64A-44F5-88E9-82CBD72EBE2E}.Debug|x86.Build.0 = Debug|Win32
{69635369-B64A-44F5-88E9-82CBD72EBE2E}.Release|x64.ActiveCfg = Release|x64
{69635369-B64A-44F5-88E9-82CBD72EBE2E}.Release|x64.Build.0 = Release|x64
{69635369-B64A-44F5-88E9-82CBD72EBE2E}.Release|x86.ActiveCfg = Release|Win32
{69635369-B64A-44F5-88E9-82CBD72EBE2E}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4C05450B-547E-4B43-A88E-152593CCF6B3}
EndGlobalSection
EndGlobal

View File

@ -1062,9 +1062,7 @@ class CtpTdApi(TdApi):
exchange = self.symbolExchangeDict.get(pos.symbol, EXCHANGE_UNKNOWN)
# 获取size
if pos.symbol not in self.symbolSizeDict:
return
size = self.symbolSizeDict[pos.symbol]
size = self.symbolSizeDict.get(pos.symbol,10)
# 针对上期所持仓的今昨分条返回(有昨仓、无今仓),读取昨仓数据
if exchange in [EXCHANGE_SHFE, EXCHANGE_INE]: