Fix Feeds. InsiderTransactions, ETFHoldings, Yahoo Price Feed
This commit is contained in:
@@ -231,6 +231,12 @@ namespace MarketData.Utils
|
||||
multiplier = -1.00;
|
||||
}
|
||||
if (strText.Equals("-")) return double.NaN;
|
||||
if (strText[strText.Length - 1].Equals('T'))
|
||||
{
|
||||
strText = strText.Replace("T", "");
|
||||
value = double.Parse(strText);
|
||||
value *= 1000000000000;
|
||||
}
|
||||
if (strText[strText.Length - 1].Equals('B'))
|
||||
{
|
||||
strText = strText.Replace("B", "");
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MarketData.Utils;
|
||||
|
||||
namespace MarketDataLib.Utility
|
||||
{
|
||||
@@ -28,6 +29,24 @@ namespace MarketDataLib.Utility
|
||||
if(String.IsNullOrEmpty(strContainingString))return null;
|
||||
return strContainingString;
|
||||
}
|
||||
|
||||
public static List<String> GetAllItemsInSections(String strInput, String sectionName)
|
||||
{
|
||||
int searchIndex = 0;
|
||||
List<String> sectionItems = new List<string>();
|
||||
|
||||
while (true)
|
||||
{
|
||||
String itemsInSection = GetItemsInSection(strInput, sectionName, ref searchIndex);
|
||||
if(null==itemsInSection)break;
|
||||
sectionItems.Add(itemsInSection);
|
||||
searchIndex++;
|
||||
}
|
||||
return sectionItems;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<String> GetSections(String strInput)
|
||||
{
|
||||
try
|
||||
@@ -36,6 +55,7 @@ namespace MarketDataLib.Utility
|
||||
int index=0;
|
||||
String strLiteral=null;
|
||||
|
||||
if(null==strInput)return null;
|
||||
while(index<strInput.Length)
|
||||
{
|
||||
char ch=strInput[index];
|
||||
@@ -379,6 +399,17 @@ namespace MarketDataLib.Utility
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static String GetItem(String strInput, String item)
|
||||
{
|
||||
if (null == strInput) return null;
|
||||
int startIndex = strInput.IndexOf(item);
|
||||
if (-1 == startIndex) return null;
|
||||
strInput = strInput.Substring(startIndex);
|
||||
String strItem = MarketData.Utils.Utility.BetweenString(strInput, ">", "<");
|
||||
return strItem;
|
||||
}
|
||||
|
||||
private static String ScanSection(String strInput, ref int index)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user