Add UnemploymentData
This commit is contained in:
@@ -35,7 +35,8 @@ namespace MarketData.Services
|
|||||||
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATEANALYSTRATINGS");
|
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATEANALYSTRATINGS");
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATESECFILINGSWATCHLIST /WATCHLIST:");
|
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATESECFILINGSWATCHLIST /WATCHLIST:");
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATECOMPANYPROFILES");
|
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATECOMPANYPROFILES");
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATEGDPPERCAPITA");
|
MDTrace.WriteLine(LogLevel.DEBUG, "UPDATEGDPPERCAPITA");
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATEUNEMPLOYMENTPERCAPITA");
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATEETFHOLDINGS");
|
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATEETFHOLDINGS");
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATEFINANCIALSTATEMENTS");
|
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATEFINANCIALSTATEMENTS");
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATEFUNDAMENTALS");
|
MDTrace.WriteLine(LogLevel.DEBUG,"UPDATEFUNDAMENTALS");
|
||||||
@@ -78,7 +79,8 @@ namespace MarketData.Services
|
|||||||
tasks.Add("UPDATEANALYSTRATINGS",TaskUpdateAnalystRatings);
|
tasks.Add("UPDATEANALYSTRATINGS",TaskUpdateAnalystRatings);
|
||||||
tasks.Add("UPDATESECFILINGSWATCHLIST",TaskUpdateSECFilingsWatchList);
|
tasks.Add("UPDATESECFILINGSWATCHLIST",TaskUpdateSECFilingsWatchList);
|
||||||
tasks.Add("UPDATECOMPANYPROFILES",TaskUpdateCompanyProfiles);
|
tasks.Add("UPDATECOMPANYPROFILES",TaskUpdateCompanyProfiles);
|
||||||
tasks.Add("UPDATEGDPPERCAPITA",TaskUpdateGDPPerCapita);
|
tasks.Add("UPDATEGDPPERCAPITA", TaskUpdateGDPPerCapita);
|
||||||
|
tasks.Add("UPDATEUNEMPLOYMENTPERCAPITA", TaskUpdateUnemploymentPerCapita);
|
||||||
tasks.Add("UPDATEETFHOLDINGS",TaskUpdateETFHoldings);
|
tasks.Add("UPDATEETFHOLDINGS",TaskUpdateETFHoldings);
|
||||||
tasks.Add("UPDATEFINANCIALSTATEMENTS",TaskUpdateFinancialStatements);
|
tasks.Add("UPDATEFINANCIALSTATEMENTS",TaskUpdateFinancialStatements);
|
||||||
tasks.Add("UPDATEFUNDAMENTALS",TaskUpdateFundamentals);
|
tasks.Add("UPDATEFUNDAMENTALS",TaskUpdateFundamentals);
|
||||||
@@ -219,6 +221,12 @@ namespace MarketData.Services
|
|||||||
await Task.FromResult(true);
|
await Task.FromResult(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task TaskUpdateUnemploymentPerCapita(CommandArgs commandArgs)
|
||||||
|
{
|
||||||
|
LoadUnemploymentPerCapita();
|
||||||
|
await Task.FromResult(true);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task TaskUpdateCompanyProfiles(CommandArgs commandArgs)
|
public async Task TaskUpdateCompanyProfiles(CommandArgs commandArgs)
|
||||||
{
|
{
|
||||||
UpdateCompanyProfiles();
|
UpdateCompanyProfiles();
|
||||||
@@ -577,6 +585,7 @@ namespace MarketData.Services
|
|||||||
{
|
{
|
||||||
UpdateYieldCurve(); // www.treasury.gov
|
UpdateYieldCurve(); // www.treasury.gov
|
||||||
LoadGDPPerCapita(); // api.worldbank.org
|
LoadGDPPerCapita(); // api.worldbank.org
|
||||||
|
LoadUnemploymentPerCapita(); // api.worldbank.org
|
||||||
LoadConsumerPriceIndex(); // Load consumer price index data from Bureau of Labor Statistics
|
LoadConsumerPriceIndex(); // Load consumer price index data from Bureau of Labor Statistics
|
||||||
resetEvents[STAGE_3].Set();
|
resetEvents[STAGE_3].Set();
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,$"STAGE_3 complete.");
|
MDTrace.WriteLine(LogLevel.DEBUG,$"STAGE_3 complete.");
|
||||||
@@ -746,65 +755,105 @@ namespace MarketData.Services
|
|||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()}(ms).");
|
MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()}(ms).");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Loads the GDP Data from WorldBank
|
||||||
|
/// </summary>
|
||||||
public static void LoadGDPPerCapita()
|
public static void LoadGDPPerCapita()
|
||||||
{
|
{
|
||||||
Profiler profiler = new Profiler();
|
Profiler profiler = new Profiler();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"Started.");
|
MDTrace.WriteLine(LogLevel.DEBUG, "Started.");
|
||||||
EconomicIndicators economicIndicators=MarketDataHelper.GetGDPPerCapita();
|
EconomicIndicators economicIndicators = MarketDataHelper.GetGDPPerCapita();
|
||||||
if(null==economicIndicators||0==economicIndicators.Count)
|
if (null == economicIndicators || 0 == economicIndicators.Count)
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"No data, see log file for potential issues.");
|
MDTrace.WriteLine(LogLevel.DEBUG, "No data, see log file for potential issues.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<String> distinctCountry=(from EconomicIndicator economicIndicator in economicIndicators select economicIndicator.CountryCode).Distinct().ToList();
|
List<String> distinctCountry = (from EconomicIndicator economicIndicator in economicIndicators select economicIndicator.CountryCode).Distinct().ToList();
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Downloaded {0} countries.",distinctCountry.Count));
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Downloaded {0} countries.", distinctCountry.Count));
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"Saving...");
|
MDTrace.WriteLine(LogLevel.DEBUG, "Saving...");
|
||||||
if(EconomicIndicatorDA.InsertUpdateEconomicIndicators(economicIndicators))
|
if (EconomicIndicatorDA.InsertUpdateEconomicIndicators(economicIndicators))
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,$"Save complete.");
|
MDTrace.WriteLine(LogLevel.DEBUG, $"Save complete.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"Failed to save economic indicators.");
|
MDTrace.WriteLine(LogLevel.DEBUG, "Failed to save economic indicators.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Exception:{0}",exception.ToString()));
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Exception:{0}", exception.ToString()));
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()}(ms)");
|
MDTrace.WriteLine(LogLevel.DEBUG, $"Done, total took {profiler.End()}(ms)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Loads the Unemployment Data from WorldBank
|
||||||
|
/// </summary>
|
||||||
|
public static void LoadUnemploymentPerCapita()
|
||||||
|
{
|
||||||
|
Profiler profiler = new Profiler();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, "Started.");
|
||||||
|
EconomicIndicators economicIndicators = MarketDataHelper.GetUnemploymentPerCapita();
|
||||||
|
if (null == economicIndicators || 0 == economicIndicators.Count)
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, "No data, see log file for potential issues.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<String> distinctCountry = (from EconomicIndicator economicIndicator in economicIndicators select economicIndicator.CountryCode).Distinct().ToList();
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Downloaded {0} countries.", distinctCountry.Count));
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, "Saving...");
|
||||||
|
if (EconomicIndicatorDA.InsertUpdateEconomicIndicators(economicIndicators))
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, $"Save complete.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, "Failed to save economic indicators.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Exception:{0}", exception.ToString()));
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, $"Done, total took {profiler.End()}(ms)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdateYieldCurve() // maintains current year of yield curve data
|
public static void UpdateYieldCurve() // maintains current year of yield curve data
|
||||||
{
|
{
|
||||||
Profiler profiler = new Profiler();
|
Profiler profiler = new Profiler();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int year = DateTime.Now.Year;
|
int year = DateTime.Now.Year;
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"Retrieving yield curve for year "+year);
|
MDTrace.WriteLine(LogLevel.DEBUG, "Retrieving yield curve for year " + year);
|
||||||
YieldCurve yieldCurve=MarketDataHelper.GetYieldCurve(year);
|
YieldCurve yieldCurve = MarketDataHelper.GetYieldCurve(year);
|
||||||
if (null == yieldCurve)
|
if (null == yieldCurve)
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Failed to get YieldCurve for {0}", year));
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Failed to get YieldCurve for {0}", year));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,"Got "+yieldCurve.Count+" points for "+year);
|
MDTrace.WriteLine(LogLevel.DEBUG, "Got " + yieldCurve.Count + " points for " + year);
|
||||||
YieldCurveDA.InsertOrUpdate(yieldCurve);
|
YieldCurveDA.InsertOrUpdate(yieldCurve);
|
||||||
}
|
}
|
||||||
catch(Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,$"Exception: {exception.ToString()}");
|
MDTrace.WriteLine(LogLevel.DEBUG, $"Exception: {exception.ToString()}");
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()}(ms)");
|
MDTrace.WriteLine(LogLevel.DEBUG, $"Done, total took {profiler.End()}(ms)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"market_data" : "Database=market_data;Datasource=adrastea;Username=guest;Password=guest",
|
"market_data" : "Database=market_data;Datasource=isonoe;Username=guest;Password=guest",
|
||||||
"portfolio_data" : "Database=portfolio_data;Datasource=adrastea;Username=guest;Password=guest",
|
"portfolio_data" : "Database=portfolio_data;Datasource=isonoe;Username=guest;Password=guest",
|
||||||
"user_data" : "Database=user_data;Datasource=adrastea;Username=guest;Password=guest",
|
"user_data" : "Database=user_data;Datasource=isonoe;Username=guest;Password=guest",
|
||||||
"sms_smtpaddress" : "smtp.gmail.com",
|
"sms_smtpaddress" : "smtp.gmail.com",
|
||||||
"sms_smsusername" : "skessler1964@gmail.com",
|
"sms_smsusername" : "skessler1964@gmail.com",
|
||||||
"sms_smspassword" : "xjfo isnf gmyi zovr",
|
"sms_smspassword" : "xjfo isnf gmyi zovr",
|
||||||
|
|||||||
@@ -7,33 +7,96 @@ namespace MarketData.DataAccess
|
|||||||
{
|
{
|
||||||
public class EconomicIndicatorDA
|
public class EconomicIndicatorDA
|
||||||
{
|
{
|
||||||
private EconomicIndicatorDA()
|
private EconomicIndicatorDA()
|
||||||
{
|
|
||||||
}
|
|
||||||
public static EconomicIndicators GetEconomicIndicators()
|
|
||||||
{
|
{
|
||||||
MySqlConnection sqlConnection=null;
|
}
|
||||||
MySqlCommand sqlCommand=null;
|
|
||||||
MySqlDataReader sqlDataReader=null;
|
/// <summary>
|
||||||
EconomicIndicators economicIndicators=new EconomicIndicators();
|
/// Retrieves a distinct list of indicator_code
|
||||||
try
|
/// </summary>
|
||||||
{
|
/// <returns></returns>
|
||||||
|
public static List<String> GetDistinctIndicators()
|
||||||
|
{
|
||||||
|
MySqlConnection sqlConnection = null;
|
||||||
|
MySqlCommand sqlCommand = null;
|
||||||
|
MySqlDataReader sqlDataReader = null;
|
||||||
|
List<String> indicators = new List<String>();
|
||||||
|
try
|
||||||
|
|
||||||
|
{
|
||||||
sqlConnection = SqlUtils.CreateMySqlConnection(MainDataSource.Instance.LocateDataSource("market_data"));
|
sqlConnection = SqlUtils.CreateMySqlConnection(MainDataSource.Instance.LocateDataSource("market_data"));
|
||||||
sqlCommand=sqlConnection.CreateCommand();
|
sqlCommand = sqlConnection.CreateCommand();
|
||||||
StringBuilder sb=new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.Append("select country_code,country_name,indicator_code,indicator_name,indicator_value,year,source from EconomicIndicators");
|
sb.Append("select distinct(indicator_code) from EconomicIndicators ");
|
||||||
sqlCommand.CommandText=sb.ToString();
|
sb.Append("ORDER BY 1 asc");
|
||||||
sqlDataReader=sqlCommand.ExecuteReader();
|
sqlCommand.CommandText = sb.ToString();
|
||||||
while(sqlDataReader.Read())
|
sqlDataReader = sqlCommand.ExecuteReader();
|
||||||
|
while (sqlDataReader.Read())
|
||||||
{
|
{
|
||||||
EconomicIndicator economicIndicator=new EconomicIndicator();
|
indicators.Add(sqlDataReader.GetString(0).ToUpper());
|
||||||
if(!sqlDataReader.IsDBNull(0))economicIndicator.CountryCode=sqlDataReader.GetString(0);
|
}
|
||||||
if(!sqlDataReader.IsDBNull(1))economicIndicator.CountryName=sqlDataReader.GetString(1);
|
sqlDataReader.Close();
|
||||||
if(!sqlDataReader.IsDBNull(2))economicIndicator.IndicatorCode=sqlDataReader.GetString(2);
|
sqlDataReader.Dispose();
|
||||||
if(!sqlDataReader.IsDBNull(3))economicIndicator.IndicatorName=sqlDataReader.GetString(3);
|
sqlCommand.Dispose();
|
||||||
if(!sqlDataReader.IsDBNull(4))economicIndicator.IndicatorValue=sqlDataReader.GetDouble(4);
|
sqlConnection.Close();
|
||||||
if(!sqlDataReader.IsDBNull(5))economicIndicator.Year=sqlDataReader.GetInt32(5);
|
sqlConnection.Dispose();
|
||||||
if(!sqlDataReader.IsDBNull(6))economicIndicator.Source=sqlDataReader.GetString(6);
|
return indicators;
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Exception:{0}", exception.ToString()));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (null != sqlDataReader)
|
||||||
|
{
|
||||||
|
sqlDataReader.Close();
|
||||||
|
sqlDataReader.Dispose();
|
||||||
|
}
|
||||||
|
if (null != sqlCommand)
|
||||||
|
{
|
||||||
|
sqlCommand.Dispose();
|
||||||
|
}
|
||||||
|
if (null != sqlConnection)
|
||||||
|
{
|
||||||
|
sqlConnection.Close();
|
||||||
|
sqlConnection.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve all records
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static EconomicIndicators GetEconomicIndicators(String indicatorCode, String countryCode="USA")
|
||||||
|
{
|
||||||
|
MySqlConnection sqlConnection = null;
|
||||||
|
MySqlCommand sqlCommand = null;
|
||||||
|
MySqlDataReader sqlDataReader = null;
|
||||||
|
EconomicIndicators economicIndicators = new EconomicIndicators();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
sqlConnection = SqlUtils.CreateMySqlConnection(MainDataSource.Instance.LocateDataSource("market_data"));
|
||||||
|
sqlCommand = sqlConnection.CreateCommand();
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("select country_code,country_name,indicator_code,indicator_name,indicator_value,year,source from EconomicIndicators").Append(" ");
|
||||||
|
sb.Append("where indicator_code=").Append(SqlUtils.AddQuotes(indicatorCode)).Append(" ");
|
||||||
|
sb.Append("AND country_code = ").Append(SqlUtils.AddQuotes(countryCode)).Append(" ");
|
||||||
|
sb.Append("ORDER BY YEAR ASC");
|
||||||
|
sqlCommand.CommandText = sb.ToString();
|
||||||
|
sqlDataReader = sqlCommand.ExecuteReader();
|
||||||
|
while (sqlDataReader.Read())
|
||||||
|
{
|
||||||
|
EconomicIndicator economicIndicator = new EconomicIndicator();
|
||||||
|
if (!sqlDataReader.IsDBNull(0)) economicIndicator.CountryCode = sqlDataReader.GetString(0);
|
||||||
|
if (!sqlDataReader.IsDBNull(1)) economicIndicator.CountryName = sqlDataReader.GetString(1);
|
||||||
|
if (!sqlDataReader.IsDBNull(2)) economicIndicator.IndicatorCode = sqlDataReader.GetString(2);
|
||||||
|
if (!sqlDataReader.IsDBNull(3)) economicIndicator.IndicatorName = sqlDataReader.GetString(3);
|
||||||
|
if (!sqlDataReader.IsDBNull(4)) economicIndicator.IndicatorValue = sqlDataReader.GetDouble(4);
|
||||||
|
if (!sqlDataReader.IsDBNull(5)) economicIndicator.Year = sqlDataReader.GetInt32(5);
|
||||||
|
if (!sqlDataReader.IsDBNull(6)) economicIndicator.Source = sqlDataReader.GetString(6);
|
||||||
economicIndicators.Add(economicIndicator);
|
economicIndicators.Add(economicIndicator);
|
||||||
}
|
}
|
||||||
sqlDataReader.Close();
|
sqlDataReader.Close();
|
||||||
@@ -41,103 +104,179 @@ namespace MarketData.DataAccess
|
|||||||
sqlCommand.Dispose();
|
sqlCommand.Dispose();
|
||||||
sqlConnection.Close();
|
sqlConnection.Close();
|
||||||
sqlConnection.Dispose();
|
sqlConnection.Dispose();
|
||||||
return economicIndicators;
|
return economicIndicators;
|
||||||
}
|
}
|
||||||
catch(Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Exception:{0}",exception.ToString()));
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Exception:{0}", exception.ToString()));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if(null!=sqlDataReader)
|
if (null != sqlDataReader)
|
||||||
{
|
{
|
||||||
sqlDataReader.Close();
|
sqlDataReader.Close();
|
||||||
sqlDataReader.Dispose();
|
sqlDataReader.Dispose();
|
||||||
}
|
}
|
||||||
if(null!=sqlCommand)
|
if (null != sqlCommand)
|
||||||
{
|
{
|
||||||
sqlCommand.Dispose();
|
sqlCommand.Dispose();
|
||||||
}
|
}
|
||||||
if(null!=sqlConnection)
|
if (null != sqlConnection)
|
||||||
{
|
{
|
||||||
sqlConnection.Close();
|
sqlConnection.Close();
|
||||||
sqlConnection.Dispose();
|
sqlConnection.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static bool InsertUpdateEconomicIndicators(EconomicIndicators economicIndicators)
|
|
||||||
{
|
/// <summary>
|
||||||
MySqlConnection sqlConnection=null;
|
/// Retrieve all records
|
||||||
MySqlCommand sqlCommand=null;
|
/// </summary>
|
||||||
MySqlTransaction sqlTransaction=null;
|
/// <returns></returns>
|
||||||
try
|
public static EconomicIndicators GetEconomicIndicators()
|
||||||
{
|
{
|
||||||
|
MySqlConnection sqlConnection = null;
|
||||||
|
MySqlCommand sqlCommand = null;
|
||||||
|
MySqlDataReader sqlDataReader = null;
|
||||||
|
EconomicIndicators economicIndicators = new EconomicIndicators();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
sqlConnection = SqlUtils.CreateMySqlConnection(MainDataSource.Instance.LocateDataSource("market_data"));
|
||||||
|
sqlCommand = sqlConnection.CreateCommand();
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("select country_code,country_name,indicator_code,indicator_name,indicator_value,year,source from EconomicIndicators");
|
||||||
|
sqlCommand.CommandText = sb.ToString();
|
||||||
|
sqlDataReader = sqlCommand.ExecuteReader();
|
||||||
|
while (sqlDataReader.Read())
|
||||||
|
{
|
||||||
|
EconomicIndicator economicIndicator = new EconomicIndicator();
|
||||||
|
if (!sqlDataReader.IsDBNull(0)) economicIndicator.CountryCode = sqlDataReader.GetString(0);
|
||||||
|
if (!sqlDataReader.IsDBNull(1)) economicIndicator.CountryName = sqlDataReader.GetString(1);
|
||||||
|
if (!sqlDataReader.IsDBNull(2)) economicIndicator.IndicatorCode = sqlDataReader.GetString(2);
|
||||||
|
if (!sqlDataReader.IsDBNull(3)) economicIndicator.IndicatorName = sqlDataReader.GetString(3);
|
||||||
|
if (!sqlDataReader.IsDBNull(4)) economicIndicator.IndicatorValue = sqlDataReader.GetDouble(4);
|
||||||
|
if (!sqlDataReader.IsDBNull(5)) economicIndicator.Year = sqlDataReader.GetInt32(5);
|
||||||
|
if (!sqlDataReader.IsDBNull(6)) economicIndicator.Source = sqlDataReader.GetString(6);
|
||||||
|
economicIndicators.Add(economicIndicator);
|
||||||
|
}
|
||||||
|
sqlDataReader.Close();
|
||||||
|
sqlDataReader.Dispose();
|
||||||
|
sqlCommand.Dispose();
|
||||||
|
sqlConnection.Close();
|
||||||
|
sqlConnection.Dispose();
|
||||||
|
return economicIndicators;
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Exception:{0}", exception.ToString()));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (null != sqlDataReader)
|
||||||
|
{
|
||||||
|
sqlDataReader.Close();
|
||||||
|
sqlDataReader.Dispose();
|
||||||
|
}
|
||||||
|
if (null != sqlCommand)
|
||||||
|
{
|
||||||
|
sqlCommand.Dispose();
|
||||||
|
}
|
||||||
|
if (null != sqlConnection)
|
||||||
|
{
|
||||||
|
sqlConnection.Close();
|
||||||
|
sqlConnection.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Upsert items
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool InsertUpdateEconomicIndicators(EconomicIndicators economicIndicators)
|
||||||
|
{
|
||||||
|
MySqlConnection sqlConnection = null;
|
||||||
|
MySqlCommand sqlCommand = null;
|
||||||
|
MySqlTransaction sqlTransaction = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
sqlConnection = SqlUtils.CreateMySqlConnection(MainDataSource.Instance.LocateDataSource("market_data"));
|
sqlConnection = SqlUtils.CreateMySqlConnection(MainDataSource.Instance.LocateDataSource("market_data"));
|
||||||
sqlTransaction = sqlConnection.BeginTransaction(System.Data.IsolationLevel.ReadUncommitted);
|
sqlTransaction = sqlConnection.BeginTransaction(System.Data.IsolationLevel.ReadUncommitted);
|
||||||
sqlCommand=sqlConnection.CreateCommand();
|
sqlCommand = sqlConnection.CreateCommand();
|
||||||
sqlCommand.Transaction=sqlTransaction;
|
sqlCommand.Transaction = sqlTransaction;
|
||||||
List<String> distinctCountryCodes=(from EconomicIndicator economicIndicator in economicIndicators select economicIndicator.CountryCode).Distinct().ToList();
|
List<String> distinctCountryCodes = (from EconomicIndicator economicIndicator in economicIndicators select economicIndicator.CountryCode).Distinct().ToList();
|
||||||
for(int index=0;index<distinctCountryCodes.Count;index++)
|
for (int index = 0; index < distinctCountryCodes.Count; index++)
|
||||||
{
|
{
|
||||||
String countryCode=distinctCountryCodes[index];
|
String countryCode = distinctCountryCodes[index];
|
||||||
List<int> years=(from EconomicIndicator economicIndicator in economicIndicators select economicIndicator.Year).Distinct().ToList();
|
List<int> years = (from EconomicIndicator economicIndicator in economicIndicators select economicIndicator.Year).Distinct().ToList();
|
||||||
DeleteEconomicIndicator(countryCode,years,sqlCommand,sqlTransaction);
|
DeleteEconomicIndicator(countryCode, years, sqlCommand, sqlTransaction);
|
||||||
}
|
}
|
||||||
InsertEconomicIndicators(economicIndicators,sqlCommand,sqlTransaction);
|
InsertEconomicIndicators(economicIndicators, sqlCommand, sqlTransaction);
|
||||||
sqlTransaction.Commit();
|
sqlTransaction.Commit();
|
||||||
sqlTransaction.Dispose();
|
sqlTransaction.Dispose();
|
||||||
sqlCommand.Dispose();
|
sqlCommand.Dispose();
|
||||||
sqlConnection.Close();
|
sqlConnection.Close();
|
||||||
sqlConnection.Dispose();
|
sqlConnection.Dispose();
|
||||||
sqlConnection=null;
|
sqlConnection = null;
|
||||||
sqlCommand=null;
|
sqlCommand = null;
|
||||||
sqlTransaction=null;
|
sqlTransaction = null;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch(Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Exception:{0}",exception.ToString()));
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Exception:{0}", exception.ToString()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if(null!=sqlConnection)
|
if (null != sqlConnection)
|
||||||
{
|
{
|
||||||
sqlConnection.Close();
|
sqlConnection.Close();
|
||||||
sqlConnection.Dispose();
|
sqlConnection.Dispose();
|
||||||
}
|
}
|
||||||
if(null!=sqlCommand)
|
if (null != sqlCommand)
|
||||||
{
|
{
|
||||||
sqlCommand.Dispose();
|
sqlCommand.Dispose();
|
||||||
}
|
}
|
||||||
if(null!=sqlTransaction)
|
if (null != sqlTransaction)
|
||||||
{
|
{
|
||||||
sqlTransaction.Dispose();
|
sqlTransaction.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static bool DeleteEconomicIndicator(String countryCode,List<int> years,MySqlCommand sqlCommand,MySqlTransaction sqlTransaction)
|
|
||||||
{
|
/// <summary>
|
||||||
String strQuery=null;
|
/// Remove items
|
||||||
try
|
/// </summary>
|
||||||
{
|
/// <returns></returns>
|
||||||
StringBuilder sb=new StringBuilder();
|
private static bool DeleteEconomicIndicator(String countryCode, List<int> years, MySqlCommand sqlCommand, MySqlTransaction sqlTransaction)
|
||||||
|
{
|
||||||
|
String strQuery = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.Append("delete from EconomicIndicators ").Append(" where ");
|
sb.Append("delete from EconomicIndicators ").Append(" where ");
|
||||||
sb.Append("country_code=").Append("'").Append(countryCode).Append("'").Append(" and ");
|
sb.Append("country_code=").Append("'").Append(countryCode).Append("'").Append(" and ");
|
||||||
sb.Append("year in ").Append(SqlUtils.CreateInClause(years));
|
sb.Append("year in ").Append(SqlUtils.CreateInClause(years));
|
||||||
strQuery=sb.ToString();
|
strQuery = sb.ToString();
|
||||||
sqlCommand.CommandText=strQuery;
|
sqlCommand.CommandText = strQuery;
|
||||||
sqlCommand.ExecuteNonQuery();
|
sqlCommand.ExecuteNonQuery();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch(Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Exception:{0}, query was {1}",exception.ToString(),strQuery));
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Exception:{0}, query was {1}", exception.ToString(), strQuery));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static bool InsertEconomicIndicators(EconomicIndicators economicIndicators,MySqlCommand sqlCommand,MySqlTransaction sqlTransaction)
|
|
||||||
|
/// <summary>
|
||||||
|
/// Insert items
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private static bool InsertEconomicIndicators(EconomicIndicators economicIndicators,MySqlCommand sqlCommand,MySqlTransaction sqlTransaction)
|
||||||
{
|
{
|
||||||
String strQuery=null;
|
String strQuery=null;
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -20,31 +20,32 @@ using MarketDataLib.Utility;
|
|||||||
using MarketData.Configuration;
|
using MarketData.Configuration;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
//Zacks Rank - Zacks
|
// Zacks Rank - Zacks
|
||||||
//Splits - EODDATA
|
// Splits - EODDATA
|
||||||
//GDP Data - WorldBank
|
// GDP Data - WorldBank
|
||||||
//Dividend History - NASDAQ
|
// Employment Data - WorldBank
|
||||||
//Options - NASDAQ
|
// Dividend History - NASDAQ
|
||||||
//Analyst Ratings - Briefing.com
|
// Options - NASDAQ
|
||||||
//SEC Filings - SEC.GOV (EDGAR)
|
// Analyst Ratings - Briefing.com
|
||||||
//Yield Curve - Treasury.Gov
|
// SEC Filings - SEC.GOV (EDGAR)
|
||||||
//ETF Holdings - Yahoo Finance
|
// Yield Curve - Treasury.Gov
|
||||||
//Insider Transactions - Insider Tracking.com
|
// ETF Holdings - Yahoo Finance
|
||||||
//Company Profile - MorningStar + Reuters
|
// Insider Transactions - Insider Tracking.com
|
||||||
//Headlines - Seeking Alpha + NASDAQ
|
// Company Profile - MorningStar + Reuters
|
||||||
//CIK Codes - SEC.GOV
|
// Headlines - Seeking Alpha + NASDAQ
|
||||||
//Analyst Price Target - Yahoo Finance , Market Beat as backup
|
// CIK Codes - SEC.GOV
|
||||||
//Historical - MorningStar
|
// Analyst Price Target - Yahoo Finance , Market Beat as backup
|
||||||
//Income Statement - NASDAQ
|
// Historical - MorningStar
|
||||||
//Balance Sheet - NASDAQ
|
// Income Statement - NASDAQ
|
||||||
//Statement of Cashflows - MorningStar
|
// Balance Sheet - NASDAQ
|
||||||
//Fundamentals - 2 Sources....Yahoo Finance & FINVIZ
|
// Statement of Cashflows - MorningStar
|
||||||
|
// Fundamentals - 2 Sources....Yahoo Finance & FINVIZ
|
||||||
// a) Key Statistics
|
// a) Key Statistics
|
||||||
// b) Financials
|
// b) Financials
|
||||||
//Intraday Pricing - Yahoo Finance + BigCharts
|
// Intraday Pricing - Yahoo Finance + RobinHood
|
||||||
//Historical Pricing - BigCharts + Yahoo Finance
|
// Historical Pricing - Yahoo Finance
|
||||||
//CompanyDescription - Reuters
|
// CompanyDescription - Reuters
|
||||||
//Premarket - CNN
|
// Premarket - CNN
|
||||||
|
|
||||||
namespace MarketData.Helper
|
namespace MarketData.Helper
|
||||||
{
|
{
|
||||||
@@ -395,50 +396,94 @@ namespace MarketData.Helper
|
|||||||
if (null != httpNetResponse) httpNetResponse.Dispose();
|
if (null != httpNetResponse) httpNetResponse.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************************************************************************************************************************
|
// ***************************************************************************************************************************************************************************************
|
||||||
// ************************************************************************** G D P P E R C A P I T A D A T A W O R L D B A N K *************************************************
|
// ************************************************************************** W O R L D B A N K F E E D *************************************************
|
||||||
// ***************************************************************************************************************************************************************************************
|
// ***************************************************************************************************************************************************************************************
|
||||||
public static EconomicIndicators GetGDPPerCapita(bool debug=false)
|
public static EconomicIndicators GetUnemploymentPerCapita(bool debug = false)
|
||||||
{
|
{
|
||||||
HttpNetResponse httpNetResponse=null;
|
HttpNetResponse httpNetResponse = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Retrieve compressed CSV from World Bank web site and write to disk
|
StringBuilder sb = new StringBuilder();
|
||||||
StringBuilder sb=new StringBuilder();
|
String strRequest;
|
||||||
String strRequest;
|
String currentWorkingDirectory = Directory.GetCurrentDirectory();
|
||||||
String currentWorkingDirectory=Directory.GetCurrentDirectory();
|
String strExtractFolder = currentWorkingDirectory + "/" + "extracts";
|
||||||
String strExtractFolder=currentWorkingDirectory+"/"+"extracts";
|
String strFileName = "API_SL.UEM.TOTL.ZS_DS2_en_csv_v2_254884.zip";
|
||||||
String strFileName="API_NY.GDP.MKTP.CD_DS2_V2_USD.zip";
|
String strPathFileName = currentWorkingDirectory + "/" + strFileName;
|
||||||
String strPathFileName=currentWorkingDirectory+"/"+strFileName;
|
sb.Append("http://api.worldbank.org/v2/en/indicator/SL.UEM.TOTL.ZS?downloadformat=csv");
|
||||||
sb.Append("http://api.worldbank.org/v2/en/indicator/NY.GDP.MKTP.CD?downloadformat=csv");
|
strRequest = sb.ToString();
|
||||||
strRequest=sb.ToString();
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Downloading {0} from {1}", strFileName, strRequest));
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Downloading {0} from {1}",strFileName,strRequest));
|
httpNetResponse = HttpNetRequest.GetRequestStreamZIP(strRequest);
|
||||||
httpNetResponse=HttpNetRequest.GetRequestStreamZIP(strRequest);
|
if (!httpNetResponse.Success)
|
||||||
if(!httpNetResponse.Success)
|
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Request:{0} failed with status {1}",httpNetResponse.Request,httpNetResponse.StatusCode));
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Request:{0} failed with status {1}", httpNetResponse.Request, httpNetResponse.StatusCode));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if(File.Exists(strPathFileName))File.Delete(strPathFileName);
|
if (File.Exists(strPathFileName)) File.Delete(strPathFileName);
|
||||||
FileStream outStream=new FileStream(strPathFileName,FileMode.Create);
|
FileStream outStream = new FileStream(strPathFileName, FileMode.Create);
|
||||||
byte[] streamBytes=httpNetResponse.ResponseStream.GetBuffer();
|
byte[] streamBytes = httpNetResponse.ResponseStream.GetBuffer();
|
||||||
outStream.Write(streamBytes,0,streamBytes.Length);
|
outStream.Write(streamBytes, 0, streamBytes.Length);
|
||||||
outStream.Flush();
|
outStream.Flush();
|
||||||
outStream.Close();
|
outStream.Close();
|
||||||
outStream.Dispose();
|
outStream.Dispose();
|
||||||
return EconomicIndicators.FromZipFile(strPathFileName,strExtractFolder,debug);
|
return EconomicIndicators.FromZipFile(strPathFileName, strExtractFolder, debug);
|
||||||
}
|
}
|
||||||
catch(Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
MDTrace.WriteLine(LogLevel.DEBUG,exception);
|
MDTrace.WriteLine(LogLevel.DEBUG, exception);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if(null!=httpNetResponse)httpNetResponse.Dispose();
|
if (null != httpNetResponse) httpNetResponse.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves GDP Data from WorlBank as zip file, decompresses the zip file, reads and imports the CSV contents and returns EconomicIndicators
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="debug"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static EconomicIndicators GetGDPPerCapita(bool debug = false)
|
||||||
|
{
|
||||||
|
HttpNetResponse httpNetResponse = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String strRequest;
|
||||||
|
String currentWorkingDirectory = Directory.GetCurrentDirectory();
|
||||||
|
String strExtractFolder = currentWorkingDirectory + "/" + "extracts";
|
||||||
|
String strFileName = "API_NY.GDP.MKTP.CD_DS2_V2_USD.zip";
|
||||||
|
String strPathFileName = currentWorkingDirectory + "/" + strFileName;
|
||||||
|
sb.Append("http://api.worldbank.org/v2/en/indicator/NY.GDP.MKTP.CD?downloadformat=csv");
|
||||||
|
strRequest = sb.ToString();
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Downloading {0} from {1}", strFileName, strRequest));
|
||||||
|
httpNetResponse = HttpNetRequest.GetRequestStreamZIP(strRequest);
|
||||||
|
if (!httpNetResponse.Success)
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Request:{0} failed with status {1}", httpNetResponse.Request, httpNetResponse.StatusCode));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (File.Exists(strPathFileName)) File.Delete(strPathFileName);
|
||||||
|
FileStream outStream = new FileStream(strPathFileName, FileMode.Create);
|
||||||
|
byte[] streamBytes = httpNetResponse.ResponseStream.GetBuffer();
|
||||||
|
outStream.Write(streamBytes, 0, streamBytes.Length);
|
||||||
|
outStream.Flush();
|
||||||
|
outStream.Close();
|
||||||
|
outStream.Dispose();
|
||||||
|
return EconomicIndicators.FromZipFile(strPathFileName, strExtractFolder, debug);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, exception);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (null != httpNetResponse) httpNetResponse.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
// ***************************************************************************************************************************************************************************************
|
// ***************************************************************************************************************************************************************************************
|
||||||
// ************************************************************************** D I V I D E N D H I S T O R Y N A S D A Q ***********************************************************
|
// ************************************************************************** D I V I D E N D H I S T O R Y N A S D A Q ***********************************************************
|
||||||
// ***************************************************************************************************************************************************************************************
|
// ***************************************************************************************************************************************************************************************
|
||||||
|
|||||||
59
MarketDataServer/Controllers/EconomicindicatorsController.cs
Normal file
59
MarketDataServer/Controllers/EconomicindicatorsController.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using MarketData.MarketDataModel;
|
||||||
|
using MarketData.DataAccess;
|
||||||
|
using MarketDataServer.Authorization;
|
||||||
|
using MarketData;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using LogLevel = MarketData.LogLevel;
|
||||||
|
using MarketData.Utils;
|
||||||
|
|
||||||
|
namespace MarketDataServer.Controllers
|
||||||
|
{
|
||||||
|
[ApiController]
|
||||||
|
[Route("api/[controller]/[action]")]
|
||||||
|
public class EconomicIndicastorsController : ControllerBase
|
||||||
|
{
|
||||||
|
//http://localhost:8000/api/EconomicIndicators/GetDistnctIndicators
|
||||||
|
[HttpGet(Name = "GetDistinctEconomicIndicators")]
|
||||||
|
public IEnumerable<String> GetDistinctEconomicIndicators(String token)
|
||||||
|
{
|
||||||
|
Profiler profiler = new Profiler();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,$"Start");
|
||||||
|
if (!Authorizations.GetInstance().IsAuthorized(token)) return null;
|
||||||
|
return EconomicIndicatorDA.GetDistinctIndicators();
|
||||||
|
}
|
||||||
|
catch(Exception exception)
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,$"Exception:{exception.ToString()}");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()} (ms)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet(Name = "GetEconomicIndicators")]
|
||||||
|
public IEnumerable<EconomicIndicator> GetEconomicIndicators(String token,String indicatorCode)
|
||||||
|
{
|
||||||
|
Profiler profiler = new Profiler();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,$"Start");
|
||||||
|
if (!Authorizations.GetInstance().IsAuthorized(token)) return null;
|
||||||
|
EconomicIndicators economicIndicators=EconomicIndicatorDA.GetEconomicIndicators(indicatorCode);
|
||||||
|
return economicIndicators;
|
||||||
|
}
|
||||||
|
catch(Exception exception)
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,$"Exception:{exception.ToString()}");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()} (ms)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -272,6 +272,13 @@ public class MarketDataUnitTestClass
|
|||||||
Assert.IsTrue(null != economicIndicators && economicIndicators.Count > 0);
|
Assert.IsTrue(null != economicIndicators && economicIndicators.Count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void UnemploymentPerCapitaRetrieval()
|
||||||
|
{
|
||||||
|
EconomicIndicators economicIndicators = MarketDataHelper.GetUnemploymentPerCapita();
|
||||||
|
Assert.IsTrue(null != economicIndicators && economicIndicators.Count > 0);
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void LatestAnalystRatingsRetrieval()
|
public void LatestAnalystRatingsRetrieval()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user