Fix Yahoo Fundamental retrieval.
Fix SeekingAlpha news retrieval.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using MarketData.MarketDataModel;
|
||||
using MarketData.DataAccess;
|
||||
@@ -11,8 +10,8 @@ namespace MarketData.Helper
|
||||
{
|
||||
public class HeadlinesMarketDataHelper
|
||||
{
|
||||
private static int MaxThreads = 10; // (int)ThreadHelperEnum.MaxThreads;
|
||||
private static int WAIT_BETWEEN_REQUESTS_MS = 1000; // wait 1000 ms between requests
|
||||
private static int MaxThreads = 5; // (int)ThreadHelperEnum.MaxThreads;
|
||||
private static int WAIT_BETWEEN_REQUESTS_MS = 2000; // wait ms between requests
|
||||
private List<String> symbols;
|
||||
private int currentIndex = 0;
|
||||
|
||||
@@ -134,23 +133,6 @@ namespace MarketData.Helper
|
||||
marketDate=new DateTime(marketDate.Year,marketDate.Month,marketDate.Day,23,59,59);
|
||||
|
||||
Headlines headlines=null;
|
||||
// SEEKING ALPHA
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("GetCompanyHeadlinesSeekingAlpha {0}",symbol));
|
||||
headlines=MarketDataHelper.GetCompanyHeadlinesSeekingAlpha(symbol);
|
||||
if(headlines.IsNullOrEmpty())
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("No headlines for {0} from Seeking Alpha",symbol));
|
||||
}
|
||||
else
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Got {0} headlines for {1} from Seeking Alpha",headlines.Count,symbol));
|
||||
headlines=new Headlines(headlines.Where(x=>x.Date<marketDate).ToList());
|
||||
HeadlinesDA.InsertHeadlines(headlines);
|
||||
foreach(Headline headline in headlines)
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Seeking Alpha {0}, {1} -> {2}",headline.Symbol,headline.Date.ToShortDateString(),headline.Entry));
|
||||
}
|
||||
}
|
||||
// NASDAQ
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("GetCompanyHeadlinesNASDAQ {0}",symbol));
|
||||
headlines=MarketDataHelper.GetCompanyHeadlinesNASDAQ(symbol);
|
||||
@@ -185,6 +167,23 @@ namespace MarketData.Helper
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("MARKETWATCH: {0}, {1} -> {2}",headline.Symbol,headline.Date.ToShortDateString(),headline.Entry));
|
||||
}
|
||||
}
|
||||
// SEEKING ALPHA
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("GetCompanyHeadlinesSeekingAlpha {0}",symbol));
|
||||
headlines=MarketDataHelper.GetCompanyHeadlinesSeekingAlpha(symbol);
|
||||
if(headlines.IsNullOrEmpty())
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("No headlines for {0} from Seeking Alpha",symbol));
|
||||
}
|
||||
else
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Got {0} headlines for {1} from Seeking Alpha",headlines.Count,symbol));
|
||||
headlines=new Headlines(headlines.Where(x=>x.Date<marketDate).ToList());
|
||||
HeadlinesDA.InsertHeadlines(headlines);
|
||||
foreach(Headline headline in headlines)
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Seeking Alpha {0}, {1} -> {2}",headline.Symbol,headline.Date.ToShortDateString(),headline.Entry));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user