Ejemplo n.º 1
0
        public override void LoadData(DataInfoType type)
        {
            switch (type)
            {
            case DataInfoType.SecurityInfo:
                base.LoadSecurityInfo();
                break;

            case DataInfoType.TradingPrice:
                DataManager.GetDataLoader().LoadMutualFundPrice(this);
                break;

            case DataInfoType.FundNetAssetValue:
                DataManager.GetDataLoader().LoadMutualFundNAV(this);
                break;

            case DataInfoType.SecurityReport:
                DataManager.GetDataLoader().LoadMutualFundReport(this);
                break;

            default:
                MessageManager.GetInstance().AddMessage(MessageType.Warning, Message.C_Msg_GE1, type.ToString());
                break;
            }
        }
Ejemplo n.º 2
0
        public override void DebugPrint(DataInfoType type, bool showheader)
        {
            //if (this.SecurityHoldings != null && this.SecurityHoldings.Count > 0)
            //{
            //    if (showheader)
            //    {
            //        Debug.Write("日期\t");
            //        for (int j = 0; j < this.SecurityHoldings.Count; j++)
            //        {
            //            Debug.Write(this.SecurityHoldings[j].Code + "\t");
            //        }
            //        Debug.WriteLine("");
            //    }

            //    int totalcount = 0;
            //    int maxlengthindex = 0;
            //    for (int k = 0; k < this.SecurityHoldings.Count; k++)
            //    {
            //        if (((MutualFund)this.SecurityHoldings[k]).TradingNAV.TradingDates.Count > totalcount)
            //        {
            //            totalcount = ((MutualFund)this.SecurityHoldings[k]).TradingNAV.TradingDates.Count;
            //            maxlengthindex = k;
            //        }
            //    }

            //    for (int i = 0; i < totalcount; i++)
            //    {
            //        Debug.Write(((MutualFund)this.SecurityHoldings[maxlengthindex]).TradingNAV.TradingDates[i].ToString("yyyy-MM-dd") + "\t");
            //        foreach (ASecurity s in this.SecurityHoldings)
            //        {
            //            switch (type)
            //            {
            //                case DataInfoType.TradingPrice:
            //                    if (i < s.TradingPrice.AdjustedTimeSeries.Count)
            //                        Debug.Write(s.TradingPrice.AdjustedTimeSeries[i].UpAndDown.KLineDay5 + "\t");
            //                    else
            //                        Debug.Write("-");
            //                    break;
            //                case DataInfoType.FundNetAssetValue:
            //                    if (i < ((MutualFund)s).TradingNAV.AdjustedTimeSeries.Count)
            //                        Debug.Write(((MutualFund)s).TradingNAV.AdjustedTimeSeries[i].UpAndDown.KLineDay5 + "\t");
            //                    else
            //                        Debug.Write("-");
            //                    break;
            //                default:
            //                    break;
            //            }
            //        }
            //        Debug.WriteLine("");
            //    }
            //}
        }
Ejemplo n.º 3
0
        public override void LoadData(DataInfoType type)
        {
            try
            {
                switch (type)
                {
                case DataInfoType.SecurityInfo:
                    DataManager.GetDataLoader().LoadMutualFundInfo(this);
                    break;

                case DataInfoType.FundNetAssetValue:
                    if (this.TradingNAV == null)
                    {
                        this.TradingNAV = new SeriesNetAssetValue(base.Code, base.TimeSeriesStart, base.TimeSeriesEnd);
                    }
                    //仅对非货币基金
                    if (this.Category.AssetCategory != FundAssetCategory.Monetory)
                    {
                        this.TradingNAV.Load();
                    }
                    break;

                case DataInfoType.TradingPrice:
                    if (base.TradingPrice == null)
                    {
                        base.TradingPrice = new SeriesFundPrice(base.Code, base.TimeSeriesStart, base.TimeSeriesEnd);
                    }
                    base.TradingPrice.Load();
                    break;

                case DataInfoType.SecurityReport:
                    if (this.FundReport == null)
                    {
                        this.FundReport = new SeriesFundReport(base.Code, base.TimeSeriesStart, base.TimeSeriesEnd);
                    }
                    this.FundReport.Load();
                    break;

                default:
                    MessageManager.GetInstance().AddMessage(MessageType.Warning, Message.C_Msg_GE1, type.ToString());
                    return;
                }
            }
            catch (Exception ex)
            {
                throw new Exception("读取基金数据时出错!", ex);;
            }
        }
Ejemplo n.º 4
0
        public override void LoadData(DataInfoType type)
        {
            switch (type)
            {
            case DataInfoType.SecurityInfo:
                base.LoadSecurityInfo();
                break;

            case DataInfoType.TradingPrice:
                DataManager.GetDataLoader().LoadIndexPrice(this);
                break;

            default:
                MessageManager.GetInstance().AddMessage(MessageType.Warning, Message.C_Msg_GE1, type.ToString());
                return;
            }
        }
Ejemplo n.º 5
0
        public override void LoadData(DataInfoType type)
        {
            switch (type)
            {
            case DataInfoType.SecurityInfo:
                DataManager.GetDataLoader().LoadIndexInfo(this);
                break;

            case DataInfoType.TradingPrice:
                if (base.TradingPrice == null)
                {
                    base.TradingPrice = new SeriesIndexPrice(base.Code, base.TimeSeriesStart, base.TimeSeriesEnd);
                }
                base.TradingPrice.Load();
                break;

            default:
                MessageManager.GetInstance().AddMessage(MessageType.Warning, Message.C_Msg_GE1, type.ToString());
                return;
            }
        }
Ejemplo n.º 6
0
 public virtual void DebugPrint(DataInfoType type, bool showheader)
 {
 }
Ejemplo n.º 7
0
 public abstract void LoadData(DataInfoType type);