private static SingleExecutionCounts ReadOneBuyGroupCounts(string buyHtml) { SingleExecutionCounts BuyGroupCount = new SingleExecutionCounts(); HAP.HtmlDocument doc; HtmlAgility.GetDocumentFromString(buyHtml, out doc); BuyGroupCount.ResultTitle = HtmlAgility.ScrapElement(doc, "//div[@class='result-title']"); //.Replace(",", "-").Replace(" ", "_"); BuyGroupCount.Risk = HtmlAgility.ScrapElement(doc, "//span[@class = 'risked']"); BuyGroupCount.TotalReturn = HtmlAgility.ScrapElement(doc, "//span[contains(@class,'total-return result-number')]"); BuyGroupCount.Wins = HtmlAgility.ScrapElement(doc, "//span[@class = 'winning-trades result-number-positive']"); BuyGroupCount.Losses = HtmlAgility.ScrapElement(doc, "//span[@class = 'losing-trades result-number-negative']"); return(BuyGroupCount); }
public static void ReadSingleExecutionCounts(SingleExecutionFull exec) { try { var buys = GetBuys(); foreach (var buy in buys) { SingleExecutionCounts buyCounts = ReadOneBuyGroupCounts(buy); exec.ResultCounts.Add(buyCounts); } } catch (Exception x) { XLogger.Error(x); } }