Esempio n. 1
0
        public override void LoadMutualFundPrice(ASecurityGroup g)
        {
            try
            {
                //如果没有持仓则退出
                if (g.SecurityHoldings == null || g.SecurityCodes.Count == 0)
                {
                    return;
                }

                //读数据: 按时间降序排列
                string sql = C_SQL_GetFundPrice;
                sql += " AND " + base.BuildSQLClauseIn(g.SecurityCodes, "A.SYMBOL");
                sql += " AND A.Tdate >= '" + g.TimeSeriesStartExtended.ToString("yyyyMMdd") + "' AND A.Tdate <= '" + g.TimeSeriesEnd.ToString("yyyyMMdd") + "'";
                sql += " ORDER BY A.Symbol, Tdate Desc";
                DataSet ds = base.DBInstance.ExecuteSQL(sql);

                //更新数据
                foreach (MutualFund f in g.SecurityHoldings)
                {
                    this.updateFundPrice(ds, (SeriesFundPrice)f.TradingPrice);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
 public void Add(ASecurityGroup g)
 {
     foreach (ASecurity s in g.SecurityHoldings)
     {
         this.Add(s);
     }
 }
Esempio n. 3
0
        public override void LoadMutualFundNAV(ASecurityGroup g)
        {
            //===============================
            //批量读取多个股票的数据,速度更快
            //===============================
            try
            {
                //如果没有持仓则退出
                if (g.SecurityHoldings == null || g.SecurityCodes.Count == 0)
                {
                    return;
                }

                //读数据: 按时间降序排列
                string sql = C_SQL_GetFundNAV;
                sql += " AND " + base.BuildSQLClauseIn(g.SecurityCodes, "SYMBOL");
                sql += " AND Publishdate >= " + base.DBInstance.ConvertToSQLDate(g.TimeSeriesStartExtended)
                       + " AND Publishdate <= " + base.DBInstance.ConvertToSQLDate(g.TimeSeriesEnd);
                sql += " ORDER BY Symbol, Publishdate Desc";
                DataSet ds = base.DBInstance.ExecuteSQL(sql);

                //更新数据
                foreach (MutualFund f in g.SecurityHoldings)
                {
                    this.updateFundNAV(ds, f.TradingNAV);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 4
0
        public override void LoadMutualFundReport(ASecurityGroup g)
        {
            try
            {
                //如果没有持仓则退出
                if (g.SecurityHoldings == null || g.SecurityCodes.Count == 0)
                {
                    return;
                }

                //读数据:
                string sqlShare = C_SQL_GetFundShareReport
                                  + " AND " + base.BuildSQLClauseIn(g.SecurityCodes, "SYMBOL")
                                  + " AND Declaredate >= " + base.DBInstance.ConvertToSQLDate(g.TimeSeriesStartExtended.AddDays(-100))
                                  + " AND Declaredate <= " + base.DBInstance.ConvertToSQLDate(g.TimeSeriesEnd)
                                  + " ORDER BY Symbol, PublishDate Desc ";

                string sqlAsset = C_SQL_GetFundAssetReport
                                  + " AND " + base.BuildSQLClauseIn(g.SecurityCodes, "SYMBOL")
                                  + " AND PublishDate >= " + base.DBInstance.ConvertToSQLDate(g.TimeSeriesStartExtended.AddDays(-100))
                                  + " AND PublishDate <= " + base.DBInstance.ConvertToSQLDate(g.TimeSeriesEnd)
                                  + " ORDER BY Symbol, Reportdate Desc ";

                DataSet dsShare = base.DBInstance.ExecuteSQL(sqlShare);
                DataSet dsAsset = base.DBInstance.ExecuteSQL(sqlAsset);

                //更新数据
                foreach (MutualFund f in g.SecurityHoldings)
                {
                    this.updateFundReport(dsShare, dsAsset, f.FundReport);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 5
0
 public abstract void LoadIndexPrice(ASecurityGroup g);
Esempio n. 6
0
 public abstract void LoadMutualFundReport(ASecurityGroup g);
Esempio n. 7
0
 public abstract void LoadMutualFundPrice(ASecurityGroup g);
Esempio n. 8
0
 public abstract void LoadMutualFundNAV(ASecurityGroup g);
Esempio n. 9
0
 public abstract void LoadEquityPrice(ASecurityGroup g);