diff --git a/vnpy/api/ctp/vnctpmd/vnctpmd/vnctpmd.sln b/vnpy/api/ctp/vnctpmd/vnctpmd/vnctpmd.sln new file mode 100644 index 00000000..13e7a30b --- /dev/null +++ b/vnpy/api/ctp/vnctpmd/vnctpmd/vnctpmd.sln @@ -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 diff --git a/vnpy/api/ctp/vnctptd/vnctptd/vnctptd.sln b/vnpy/api/ctp/vnctptd/vnctptd/vnctptd.sln new file mode 100644 index 00000000..daf6fbc3 --- /dev/null +++ b/vnpy/api/ctp/vnctptd/vnctptd/vnctptd.sln @@ -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 diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index 9b7a83b0..755888e4 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -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]: