Esempio n. 1
0
        public void TestGetNextValidTradingTimes()
        {
            ChaosAnalysis analysis   = new ChaosAnalysis();
            TimeSpan      sampleTime = new TimeSpan(1, 0, 0);
            TradingTimes  tr         = new TradingTimes();

            tr.tradingDays = new bool[] { false, true, true, true, true, true, false };
            double[] linear = new double[1000];
            linear[0] = 0.1;
            for (int n = 1; n < 1000; n++)
            {
                linear[n] = linear[n - 1] + 1.0;
            }
            DateTime start = new DateTime(2000, 1, 1);

            analysis.LoadSampledData(linear, start, sampleTime);
            analysis.SortEvents();
            DateTime[] offsets = analysis.GetNextValidTradingTimes(9);
            Assert.AreEqual(9, offsets.Length);
        }