diff --git a/MarketDataServer/Controllers/GainLossController.cs b/MarketDataServer/Controllers/GainLossController.cs index d1789f2..0a87acf 100755 --- a/MarketDataServer/Controllers/GainLossController.cs +++ b/MarketDataServer/Controllers/GainLossController.cs @@ -35,7 +35,7 @@ namespace MarketDataServer.Controllers { MDTrace.WriteLine(LogLevel.DEBUG,$"Start"); if (!Authorizations.GetInstance().IsAuthorized(token)) return null; - LocalPriceCache.GetInstance().Refresh(); + GLPriceCache.GetInstance().Refresh(); PortfolioTrades portfolioTrades = PortfolioDA.GetTrades(); PortfolioTrades tradesOnOrBefore = portfolioTrades.GetTradesOnOrBefore(selectedDate); GainLossSummaryItemCollection gainLossSummaryItems = new GainLossSummaryItemCollection(tradesOnOrBefore, selectedDate); @@ -82,7 +82,7 @@ namespace MarketDataServer.Controllers try { MDTrace.WriteLine(LogLevel.DEBUG,$"Start"); - LocalPriceCache.GetInstance().Refresh(); + GLPriceCache.GetInstance().Refresh(); if (!Authorizations.GetInstance().IsAuthorized(token)) return null; PortfolioTrades portfolioTrades = PortfolioDA.GetTrades(); portfolioTrades=new PortfolioTrades(portfolioTrades.Where(x=>x.Account.Equals(account)).ToList()); @@ -138,7 +138,7 @@ namespace MarketDataServer.Controllers { MDTrace.WriteLine(LogLevel.DEBUG,$"Start"); if (!Authorizations.GetInstance().IsAuthorized(token)) return null; - LocalPriceCache.GetInstance().Refresh(); + GLPriceCache.GetInstance().Refresh(); PortfolioTrades portfolioTrades = PortfolioDA.GetTrades(); PortfolioTrades tradesOnOrBefore = portfolioTrades.GetTradesOnOrBefore(selectedDate); GainLossSummaryItemCollection gainLossSummaryItems = new GainLossSummaryItemCollection(tradesOnOrBefore, selectedDate); @@ -166,7 +166,7 @@ namespace MarketDataServer.Controllers gainLossSummaryItemDetail.DividendYield = weightAdjustedDividendYield; gainLossSummaryItemDetail.AnnualDividend = exposure * weightAdjustedDividendYield; } - Prices prices = LocalPriceCache.GetInstance().GetPrices(gainLossSummaryItem.Symbol, currentDate, 3); // cache should be refreshed after GainLossSummaryItemCollection + Prices prices = GLPriceCache.GetInstance().GetPrices(gainLossSummaryItem.Symbol, currentDate, 3); // cache should be refreshed after GainLossSummaryItemCollection Price p1 = prices.Count>0?prices[0]:default; Price p2 = prices.Count>1?prices[1]:default; PortfolioTrades symbolTrades = new PortfolioTrades(portfolioTrades.Where(x=>x.Symbol.Equals(gainLossSummaryItem.Symbol)).ToList()); @@ -234,7 +234,7 @@ namespace MarketDataServer.Controllers { MDTrace.WriteLine(LogLevel.DEBUG,$"Start"); if (!Authorizations.GetInstance().IsAuthorized(token)) return null; - LocalPriceCache.GetInstance().Refresh(); + GLPriceCache.GetInstance().Refresh(); PortfolioTrades portfolioTrades = PortfolioDA.GetTrades(); portfolioTrades = new PortfolioTrades(portfolioTrades.Where(x => x.Account.Equals(account)).ToList()); PortfolioTrades tradesOnOrBefore = portfolioTrades.GetTradesOnOrBefore(selectedDate); @@ -263,7 +263,7 @@ namespace MarketDataServer.Controllers gainLossSummaryItemDetail.DividendYield=weightAdjustedDividendYield; gainLossSummaryItemDetail.AnnualDividend=exposure * weightAdjustedDividendYield; } - Prices prices = LocalPriceCache.GetInstance().GetPrices(gainLossSummaryItem.Symbol, currentDate, 3); // cache should be refreshed after GainLossSummaryItemCollection + Prices prices = GLPriceCache.GetInstance().GetPrices(gainLossSummaryItem.Symbol, currentDate, 3); // cache should be refreshed after GainLossSummaryItemCollection Price p1 = prices.Count>0?prices[0]:default; Price p2 = prices.Count>1?prices[1]:default; PortfolioTrades symbolTrades = new PortfolioTrades(portfolioTrades.Where(x=>x.Symbol.Equals(gainLossSummaryItem.Symbol)).ToList()); @@ -331,7 +331,7 @@ namespace MarketDataServer.Controllers { MDTrace.WriteLine(LogLevel.DEBUG,$"Start"); if(!Authorizations.GetInstance().IsAuthorized(token)) return null; - LocalPriceCache.GetInstance().Refresh(); + GLPriceCache.GetInstance().Refresh(); DividendPayments dividendPayments = null; PortfolioTrades portfolioTrades = PortfolioDA.GetTrades(); GainLossGenerator gainLossGenerator=new GainLossGenerator();