Fix Yahoo Fundamental retrieval.

Fix SeekingAlpha news retrieval.
This commit is contained in:
2024-04-12 12:40:41 -04:00
parent 799356533a
commit c0c1d37bf0
11 changed files with 353 additions and 66 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Text;
using MarketData.Utils;
@@ -203,7 +204,7 @@ namespace MarketData.MarketDataModel
get{return debtToEquity;}
set{debtToEquity=value;}
}
// if columns are added to this object must ensure that the columns are also added to the MergeFrom and IsZero methods so that the consistency checks can still function properly
// If columns are added to this object must ensure that the columns are also added to the MergeFrom, IsZero, and GetLoad() methods so that the consistency checks can still function properly
// Do not include a comparison of the AsOf date. The prior fundamental will always have an AsOf date that precedes the one that we fetch.
// In contrast, the AsOf date in the financial statements is the statement date and we use the AsOf date as a comparison there.
// The idea here is to ensure that we do not lose any fidelity of the fundamental data if elements are missing in the current fetch but were present in a previous fetch.
@@ -279,6 +280,45 @@ namespace MarketData.MarketDataModel
if(percentMissing>85.00)return true;
return false;
}
public double GetLoad()
{
double missingItemCount=0.00;
double totalItems=29.00;
double percentMissing=0.00;
if(Utility.IsZeroOrNaN(Beta))missingItemCount++;
if(Utility.IsZeroOrNaN(Low52))missingItemCount++;
if(Utility.IsZeroOrNaN(High52))missingItemCount++;
if(Utility.IsZeroOrNaN((double)Volume))missingItemCount++;
if(Utility.IsZeroOrNaN(MarketCap))missingItemCount++;
if(Utility.IsZeroOrNaN(PE))missingItemCount++;
if(Utility.IsZeroOrNaN(EPS))missingItemCount++;
if(Utility.IsZeroOrNaN(PEG))missingItemCount++;
if(Utility.IsZeroOrNaN(ReturnOnAssets))missingItemCount++;
if(Utility.IsZeroOrNaN(ReturnOnEquity))missingItemCount++;
if(Utility.IsZeroOrNaN(TotalCash))missingItemCount++;
if(Utility.IsZeroOrNaN(TotalDebt))missingItemCount++;
if(Utility.IsZeroOrNaN(SharesOutstanding))missingItemCount++;
if(Utility.IsZeroOrNaN(Revenue))missingItemCount++;
if(Utility.IsZeroOrNaN(SharesOutstanding))missingItemCount++;
if(Utility.IsZeroOrNaN(Revenue))missingItemCount++;
if(Utility.IsZeroOrNaN(RevenuePerShare))missingItemCount++;
if(Utility.IsZeroOrNaN(QtrlyRevenueGrowth))missingItemCount++;
if(Utility.IsZeroOrNaN(GrossProfit))missingItemCount++;
if(Utility.IsZeroOrNaN(EBITDA))missingItemCount++;
if(Utility.IsZeroOrNaN(NetIncomeAvailableToCommon))missingItemCount++;
if(Utility.IsZeroOrNaN(BookValuePerShare))missingItemCount++;
if(Utility.IsZeroOrNaN(OperatingCashflow))missingItemCount++;
if(Utility.IsZeroOrNaN(LeveragedFreeCashflow))missingItemCount++;
if(Utility.IsZeroOrNaN(Equity))missingItemCount++;
if(Utility.IsZeroOrNaN(TrailingPE))missingItemCount++;
if(Utility.IsZeroOrNaN(EnterpriseValue))missingItemCount++;
if(Utility.IsZeroOrNaN(EBIT))missingItemCount++;
if(Utility.IsZeroOrNaN(DebtToEquity))missingItemCount++;
percentMissing=(missingItemCount/totalItems)*100.00;
return 100.00-percentMissing;
}
public static String Header
{
get