Beispiel #1
0
        public void Convergence()
        {
            foreach (int qty in convergeQuantities)
            {
                IEnumerable <Quote>    h = HistoryTestData.GetLong(6 * 20 + 100 + qty);
                IEnumerable <T3Result> r = Indicator.GetT3(h, 20);

                T3Result l = r.LastOrDefault();
                Console.WriteLine("T3 on {0:d} with {1,4} periods: {2:N8}",
                                  l.Date, h.Count(), l.T3);
            }
        }
    public void T3()
    {
        foreach (int qty in QuotesQuantities)
        {
            IEnumerable <Quote>    quotes = TestData.GetLongish(10 + qty);
            IEnumerable <T3Result> r      = quotes.GetT3(20);

            T3Result l = r.LastOrDefault();
            Console.WriteLine(
                "T3 on {0:d} with {1,4} periods: {2:N8}",
                l.Date, quotes.Count(), l.T3);
        }
    }
Beispiel #3
0
    public void Removed()
    {
        List <T3Result> results = quotes.GetT3(5, 0.7)
                                  .RemoveWarmupPeriods()
                                  .ToList();

        // assertions
        Assert.AreEqual(502 - ((6 * (5 - 1)) + 250), results.Count);

        T3Result last = results.LastOrDefault();

        Assert.AreEqual(238.9308m, Math.Round((decimal)last.T3, 4));
    }
Beispiel #4
0
        public void Standard()
        {
            List <T3Result> results = Indicator.GetT3(history, 5, 0.7)
                                      .ToList();

            // assertions

            // proper quantities
            // should always be the same number of results as there is history
            Assert.AreEqual(502, results.Count);
            Assert.AreEqual(478, results.Where(x => x.T3 != null).Count());

            // sample values
            T3Result r1 = results[23];

            Assert.IsNull(r1.T3);

            T3Result r2 = results[24];

            Assert.AreEqual(215.9343m, Math.Round((decimal)r2.T3, 4));

            T3Result r3 = results[44];

            Assert.AreEqual(224.9412m, Math.Round((decimal)r3.T3, 4));

            T3Result r4 = results[149];

            Assert.AreEqual(235.8851m, Math.Round((decimal)r4.T3, 4));

            T3Result r5 = results[249];

            Assert.AreEqual(257.8735m, Math.Round((decimal)r5.T3, 4));

            T3Result r6 = results[501];

            Assert.AreEqual(238.9308m, Math.Round((decimal)r6.T3, 4));
        }