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; } }
public void Add(ASecurityGroup g) { foreach (ASecurity s in g.SecurityHoldings) { this.Add(s); } }
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; } }
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; } }
public abstract void LoadIndexPrice(ASecurityGroup g);
public abstract void LoadMutualFundReport(ASecurityGroup g);
public abstract void LoadMutualFundPrice(ASecurityGroup g);
public abstract void LoadMutualFundNAV(ASecurityGroup g);
public abstract void LoadEquityPrice(ASecurityGroup g);