TRD-005 Fix nomenclature for fetching InsiderTransactions for YearGreaterEquak
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user