using System.Xml.Linq; using System; namespace XAMLFinance.DataSource { /// <summary> /// The price and associated information for a specific instrument /// </summary> public class InstrumentPriceData { internal InstrumentPriceData(XElement element) { Bid = element.DoubleValueOrNull("bid"); Ask = element.DoubleValueOrNull("ask"); Mid = element.DoubleValueOrNull("mid"); Change = element.DoubleValueOrNull("change"); Volume = element.DoubleValueOrNull("volume"); ChangePercent = element.DoubleValueOrNull("changePercent"); Instrument = element.Attribute("name").Value; Isin = element.Attribute("isin").Value; Symbol = element.Attribute("symbol").Value; Sector = element.StringValueOrNull("sector"); MarketCap = element.DoubleValueOrNull("marketCap"); High = element.DoubleValueOrNull("high"); Low = element.DoubleValueOrNull("low"); HighYear = element.DoubleValueOrNull("fiftyTwoWeekHigh"); LowYear = element.DoubleValueOrNull("fiftyTwoWeekLow"); MarketCap = element.DoubleValueOrNull("marketCap"); PERatio = element.DoubleValueOrNull("peRatio"); EPS = element.DoubleValueOrNull("eps"); Open = element.DoubleValueOrNull("open"); ExDividend = element.DateTimeValueOrNull("exDividend"); Shares = element.DoubleValueOrNull("sharesOutstanding"); LastTraded = element.DoubleValueOrNull("lastTrade"); } public DateTime? ExDividend { get; private set; } public double? High { get; private set; } public double? LastTraded { get; private set; } public double? Shares { get; private set; } public double? Low { get; private set; } public double? HighYear { get; private set; } public double? LowYear { get; private set; } public double? PERatio { get; private set; } public double? EPS { get; private set; } public double? Open { get; private set; } public double? ChangePercent { get; private set; } public double? MarketCap { get; private set; } public string Sector { get; private set; } public string Symbol { get; private set; } public double? Volume { get; private set; } public double? Change { get; private set; } public double? Mid { get; private set; } public string Instrument { get; private set; } public string Isin { get; private set; } public double? Ask { get; private set; } public double? Bid { get; private set; } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)