示例#1
0
        public OptiTester(IAlloc alloc, IAdj adj, double startKospiWeight, double endKospiWeight, int testCount)
        {
            this.StartKospiWeight = startKospiWeight;
            this.EndKospiWeight = endKospiWeight;
            this.TestCount = testCount;
            this.Alloc = alloc;
            this.Adj = adj;

            Trace.Assert(TestCount != 0);
        }
        SortedList<DateTime, AdjRateDatum> CreateAdjRateData(IAdj adj)
        {
            SortedList<DateTime, AdjRateDatum> data = new SortedList<DateTime, AdjRateDatum>();
            DateTime curDate = _input.StartDate;

            while (curDate <= _input.EndDate)
            {
                if (_marketData.IsExistDate(curDate))
                {
                    AdjRateDatum datum = adj.CalculateAdjRateDatum(curDate, _marketData);
                    data.Add(curDate, datum);
                }
                curDate = curDate.AddDays(1);
            }
            return data;
        }