Exemple #1
0
        public void RetrieveFundamentalsTest()
        {
            //Arrange
            var stockData = new StockDataRepository();

            //Act
            stockData.RetrieveHTML("September17");
            var retrieved = stockData.RetrieveFundamentals("September17");
            var notSet    = retrieved.FindAll(symbol => symbol.ADX == 0);

            //Assert
            Assert.AreEqual(notSet.Count, 0);
        }
Exemple #2
0
 private void AddFundamentals(object sender, RoutedEventArgs e)
 {
     if (month != null && HTMLGathered && Ready)
     {
         Ready = false;
         var stockData = stock.RetrieveFundamentals(month); //sends month and adds fundamental data
         if (stockData.Count != 0)
         {
             Data.ItemsSource = null;
             Data.ItemsSource = stockData;           //along with null set will refresh data
         }
         SizeToContent        = SizeToContent.Width; //fixes poor sizing
         FundamentalsGathered = true;
         Ready = true;
     }
 }
Exemple #3
0
        public void SubsetsTest()
        {
            var fundamentals = new FundamentalChooser();
            var stock        = new StockDataRepository();
            var set          = new List <string>
            {
                "ADX", "BBANDS", "BOP", "MACD", "MOM", "RSI"
            };

            var result = fundamentals.SubSetsOf(set);

            var stockData = stock.RetrieveHTML("October17");

            stockData = stock.RetrieveFundamentals("October17");

            var stockTest = new StockData
            {
                Symbol         = "TEST",
                Price          = 10,
                EarningsGrowth = 1,
                ADX            = 30,
                BBANDS         = .5,
                BOP            = -.03,
                MACD           = -2,
                MOM            = -.03,
                RSI            = 40,
                Gain           = 1.07,
                ForwardPE      = 4
            };

            foreach (var symbol in stockData)
            {
                foreach (var list in result)
                {
                    fundamentals.BuildComparison((StockData)symbol, list.Distinct().ToList());
                }
            }
        }