TRD-005 Fix nomenclature for fetching InsiderTransactions for YearGreaterEquak

This commit is contained in:
2024-03-02 08:02:50 -05:00
parent fea293b7e8
commit 846ceec5cb
14 changed files with 31 additions and 29 deletions

View File

@@ -15,7 +15,7 @@ namespace MarketData.Helper
: base(symbol, resetEvent)
{
}
public int Year { get; set; }
public int YearGreaterEqual { get; set; }
}
public class InsiderTransactionMarketDataHelper
@@ -93,7 +93,7 @@ namespace MarketData.Helper
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("[LoadInsiderTransactions]End, total took {0}(ms)",profiler.End()));
}
}
public bool LoadInsiderTransactionsYear(List<String> symbols,int year)
public bool LoadInsiderTransactionsYearGreaterEqual(List<String> symbols,int yearGreaterEqual)
{
Profiler profiler=new Profiler();
try
@@ -117,7 +117,7 @@ namespace MarketData.Helper
{
InsiderTransactionThreadHelper threadHelper = new InsiderTransactionThreadHelper(queueSymbols[index], resetEvents[index]);
threadHelper.UpdateManager=UpdateManager;
threadHelper.Year=year;
threadHelper.YearGreaterEqual=yearGreaterEqual;
ThreadPool.QueueUserWorkItem(ThreadPoolCallbackYearGreaterEqual, threadHelper);
try { Thread.Sleep(WAIT_TIME_MS); } catch(Exception) { ;} // wait
}
@@ -172,24 +172,24 @@ namespace MarketData.Helper
{
InsiderTransactionThreadHelper threadHelper = (InsiderTransactionThreadHelper)threadHelperContext;
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Insider Transactions Thread {0} started for {1}...", Thread.CurrentThread.ManagedThreadId, threadHelper.Symbol));
LoadInsiderTransactionsYearGreaterEqualEx(threadHelper.Symbol,threadHelper.Year);
LoadInsiderTransactionsYearGreaterEqualEx(threadHelper.Symbol,threadHelper.YearGreaterEqual);
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Insider Transactions Thread {0} ended for {1}...", Thread.CurrentThread.ManagedThreadId, threadHelper.Symbol));
threadHelper.UpdateManager.Add(threadHelper.Symbol);
threadHelper.ResetEvent.Set();
}
public static void LoadInsiderTransactionsYearGreaterEqualEx(String symbol, int year)
public static void LoadInsiderTransactionsYearGreaterEqualEx(String symbol, int yearGreaterEqual)
{
symbol = symbol.ToUpper();
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Load insider transactions for {0} years>={1}", symbol,year));
InsiderTransactions insiderTransactions = MarketDataHelper.GetInsiderTransactionsYear(symbol, year);
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Load insider transactions for {0} years>={1}", symbol,yearGreaterEqual));
InsiderTransactions insiderTransactions = MarketDataHelper.GetInsiderTransactionsYear(symbol, yearGreaterEqual);
if (null == insiderTransactions || 0 == insiderTransactions.Count)
{
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("No insider transactions for {0} years>={1}", symbol,year));
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("No insider transactions for {0} years>={1}", symbol,yearGreaterEqual));
return;
}
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Insider Transactions, Saving {0} records for {1} years>={2}", insiderTransactions.Count, symbol, year));
InsiderTransactionDA.DeleteInsiderTransactionsYearsGreaterEqual(symbol, year);
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Insider Transactions, Saving {0} records for {1} years>={2}", insiderTransactions.Count, symbol, yearGreaterEqual));
InsiderTransactionDA.DeleteInsiderTransactionsYearsGreaterEqual(symbol, yearGreaterEqual);
InsiderTransactionDA.InsertInsiderTransactions(insiderTransactions);
MDTrace.WriteLine(LogLevel.DEBUG,"Insider Transactions - Done.");
}