Exemple #1
0
        void LoadCycleEqAdjs()
        {
            _mdPivot = DataUtil.GetKeyMarketData(MarketDataSetKey.CycleLeadingIndex, _startDate, _endDate);
            //string marketDataText = DataUtil.GetMarketDataStringFromTextFile(kFileName);
            //MarketData md =
            //    new MarketDataTextReader().ReadMarketData(_key, marketDataText, _startDate, _endDate);

            _cycleAdjDic = new Dictionary<DateTime, double>();
            long totalCount = _mdPivot.GetTotalCount();
            for (int i = 0; i < totalCount; i++)
            {
                DOHLC dohlc = _mdPivot.GetByIndex(i);
                DateTime curDate = dohlc.CurDate;
                double curValue = dohlc.OHLC.Close;
                double curAdj = CalculateCycleAdjValue(curValue, kMaxValue, kMinValue);
                curAdj = GetSwitchUpDownAdjValue(curAdj);
                _cycleAdjDic.Add(curDate, curAdj);
            }
        }