Refactor InsiderTransactionParser, InsiderTransactionDA and UpdateManager
This commit is contained in:
88
Program.cs
88
Program.cs
@@ -594,37 +594,21 @@ namespace MarketData
|
||||
// sessionParams.Candidates = new CMTCandidates(sessionParams.Candidates.Except(candidatesToRemove).ToList());
|
||||
// CMTSessionManager.SaveSession(sessionParams,@"C:\boneyard\marketdata\bin\Debug\CMT20200817.txt");
|
||||
//}
|
||||
|
||||
|
||||
// ******************************************************************************************************************************************************************************************
|
||||
// ******************************************************************************************************************************************************************************************
|
||||
// **********************************************************************************************************************************************.ToString()********************************************
|
||||
|
||||
|
||||
// **********************************************************************************************************
|
||||
static int Main(string[] args)
|
||||
private static void InsiderTransactionsTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
MDTrace.LogLevel = LogLevel.DEBUG;
|
||||
String strLogFile = "marketdata.log";
|
||||
Utility.DeleteFile(strLogFile);
|
||||
Trace.Listeners.Add(new TextWriterTraceListener(strLogFile));
|
||||
DateTime currentDate=DateTime.Now;
|
||||
|
||||
// InsiderTransactionMarketDataHelper.LoadInsiderTransactionsYearGreaterEqualEx("COIN",2023);
|
||||
|
||||
// Run the Year loader
|
||||
// InsiderTransactionMarketDataHelper.LoadInsiderTransactionsYearGreaterEqualEx("COIN",2023);
|
||||
|
||||
// Run Insider Transactions
|
||||
//InsiderTransactions insiderTransactions =MarketDataHelper.GetInsiderTransactionsYear("COIN",2023);
|
||||
//InsiderTransactionDA.InsertInsiderTransactions(insiderTransactions);
|
||||
//Console.WriteLine("Done");
|
||||
//Console.ReadLine();
|
||||
|
||||
// Trying to figure out in Form 4 and Form 5
|
||||
// How to tell if acquiring or disposing
|
||||
//String symbol = "COIN";
|
||||
// Query Symbol and save files
|
||||
//String symbol = "AAPL";
|
||||
//String[] descFilter = new String[] { "Form 4", "Form 5" };
|
||||
//SECFilings secFilings = MarketDataHelper.GetSECFilings(symbol, 7);
|
||||
//SECFilings secFilings = MarketDataHelper.GetSECFilings(symbol,120);
|
||||
//secFilings = new SECFilings(secFilings.Where(x => descFilter.Any(y => x.Description.StartsWith(y))).ToList());
|
||||
//foreach (SECFiling secFiling in secFilings)
|
||||
//{
|
||||
@@ -644,20 +628,64 @@ namespace MarketData
|
||||
//Console.Read();
|
||||
//return 0;
|
||||
|
||||
|
||||
// Load 1 file
|
||||
//String symbol="AAPL";
|
||||
//String fileName="c:\\2\\AAPL-0000320193-23-000111.html";
|
||||
//String secAccessionNumber=Utility.BetweenString(fileName,"-",".html");
|
||||
//FileStream inStream = new FileStream(fileName, FileMode.Open);
|
||||
//StreamReader streamReader = new StreamReader(inStream);
|
||||
//String html = streamReader.ReadToEnd();
|
||||
//streamReader.Close();
|
||||
//streamReader.Dispose();
|
||||
//InsiderTransactions insiderTransactions = InsiderTransactionsParser.GetInstance().Parse(html, symbol, secAccessionNumber, "4", DateTime.Now);
|
||||
|
||||
//String[] fileNames=Directory.GetFiles("c:\\2","*.html");
|
||||
//foreach(String fileName in fileNames)
|
||||
|
||||
// Load Files
|
||||
//InsiderTransactions mainList=new InsiderTransactions();
|
||||
//String symbol = "AAPL";
|
||||
//String[] fileNames = Directory.GetFiles("c:\\2", "*.html");
|
||||
//foreach (String fileName in fileNames)
|
||||
//{
|
||||
// FileStream inStream=new FileStream(fileName,FileMode.Open);
|
||||
// StreamReader streamReader=new StreamReader(inStream);
|
||||
// String html=streamReader.ReadToEnd();
|
||||
// String secAccessionNumber=Utility.BetweenString(fileName,"-",".html");
|
||||
// FileStream inStream = new FileStream(fileName, FileMode.Open);
|
||||
// StreamReader streamReader = new StreamReader(inStream);
|
||||
// String html = streamReader.ReadToEnd();
|
||||
// streamReader.Close();
|
||||
// streamReader.Dispose();
|
||||
// InsiderTransactions insiderTransactions=InsiderTransactionsParser.GetInstance().Parse(html,"LEG","001","1","1",DateTime.Now);
|
||||
// InsiderTransactions insiderTransactions = InsiderTransactionsParser.GetInstance().Parse(html, symbol, secAccessionNumber, "4", DateTime.Now);
|
||||
// if(null!=insiderTransactions)mainList.AddRange(insiderTransactions);
|
||||
//}
|
||||
|
||||
//Dictionary<String,InsiderTransaction> dictionary=new Dictionary<String,InsiderTransaction>();
|
||||
//foreach(InsiderTransaction insiderTransaction in mainList)
|
||||
//{
|
||||
// String insiderTransactionKey = insiderTransaction.Form + insiderTransaction.SECAccessionNumber + insiderTransaction.FormRowNumber;
|
||||
// if(dictionary.ContainsKey(insiderTransactionKey))
|
||||
// {
|
||||
// Console.WriteLine(String.Format("Key exists {0}",insiderTransactionKey));
|
||||
// }
|
||||
// dictionary.Add(insiderTransactionKey,insiderTransaction);
|
||||
//}
|
||||
//Console.WriteLine("Done");
|
||||
//Console.Read();
|
||||
//return 0;
|
||||
}
|
||||
|
||||
// **********************************************************************************************************
|
||||
static int Main(string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
MDTrace.LogLevel = LogLevel.DEBUG;
|
||||
String strLogFile = "marketdata.log";
|
||||
Utility.DeleteFile(strLogFile);
|
||||
Trace.Listeners.Add(new TextWriterTraceListener(strLogFile));
|
||||
DateTime currentDate=DateTime.Now;
|
||||
|
||||
|
||||
String insiderName=@"Deutsche Bank Ag\";
|
||||
insiderName=SqlUtils.SqlString(insiderName);
|
||||
|
||||
|
||||
DateTime maxHolidayDate=HolidayDA.GetMaxHolidayDate();
|
||||
@@ -1879,7 +1907,7 @@ namespace MarketData
|
||||
|
||||
ThreadPool.QueueUserWorkItem(delegate
|
||||
{
|
||||
LoadInsiderTransactions(); // InsiderTracking stopped working so this source is now going directly to SEC.GOV. www.insidertracking.com
|
||||
LoadInsiderTransactions();
|
||||
resetEvents[STAGE_6].Set();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user