Пример #1
0
        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);
        }
Пример #2
0
 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);
     }
 }