Update threading model for company profile
This commit is contained in:
@@ -1428,10 +1428,11 @@ namespace MarketData.Helper
|
||||
{
|
||||
String nasdaq = "xnas";
|
||||
String nyse = "xnys";
|
||||
|
||||
CompanyProfile companyProfile = null;
|
||||
companyProfile = GetCompanyProfileYahoo(symbol);
|
||||
if (null==companyProfile)companyProfile=GetCompanyProfileMorningStar(symbol,nasdaq);
|
||||
if (null == companyProfile) companyProfile = GetCompanyProfileMorningStar(symbol, nyse);
|
||||
companyProfile = GetCompanyProfileMorningStar(symbol,nasdaq);
|
||||
if (null == companyProfile)companyProfile = GetCompanyProfileMorningStar(symbol, nyse);
|
||||
if (null == companyProfile)companyProfile = GetCompanyProfileYahoo(symbol);
|
||||
return companyProfile;
|
||||
}
|
||||
|
||||
@@ -1511,11 +1512,19 @@ namespace MarketData.Helper
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve company profile information from MorningStar
|
||||
/// </summary>
|
||||
/// <param name="symbol">The Symbol</param>
|
||||
/// <param name="exchange">XNAS or XNYS</param>
|
||||
/// <returns></returns>
|
||||
public static CompanyProfile GetCompanyProfileMorningStar(String symbol,String exchange)
|
||||
{
|
||||
HttpNetResponse httpNetResponse=null;
|
||||
try
|
||||
{
|
||||
if(null==exchange)return default;
|
||||
exchange=exchange.ToLower();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String strRequest;
|
||||
symbol = symbol.ToUpper();
|
||||
@@ -1523,7 +1532,7 @@ namespace MarketData.Helper
|
||||
sb.Append(String.Format("https://www.morningstar.com/stocks/{0}/{1}/quote",exchange,symbol));
|
||||
strRequest = sb.ToString();
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,strRequest);
|
||||
httpNetResponse = HttpNetRequest.GetRequestNoEncodingV5A(strRequest, 10000, webProxy);
|
||||
httpNetResponse = HttpNetRequest.GetRequestNoEncodingV5A(strRequest, 15000, webProxy);
|
||||
|
||||
if(!httpNetResponse.Success)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user