private Position UpdatePositionCurrentPrice(Position position)
 {
     InstrumentHistoricalData          = Factory.OutPutSourceInstrumentData(position.InstrumentRepositoryPath, position.Ticker, 2, position.InstrumentFileType);
     position.CurrentPrice             = InstrumentHistoricalData.Last().Close;
     position.CurrentOpenPositionValue = PortfolioAnalytics.CalculateCurrentOpenPositionValue(position);
     position.Profit     = PortfolioAnalytics.CalculatePositionProfit(position);
     position.ReturnRate = PortfolioAnalytics.CalculatePositionReturn(position);
     return(position);
 }
        private Position UpdatePositionInstrumentData(Position position)
        {
            InstrumentHistoricalData = new List <SourceInstrumentQuote>();
            decimal positionDuration = PortfolioAnalytics.CalculatePositionDuration(position.EntryDate);

            InstrumentHistoricalData          = Factory.OutPutSourceInstrumentData(position.InstrumentRepositoryPath, position.Ticker, Convert.ToInt32(positionDuration), position.InstrumentFileType);
            position.CurrentPrice             = InstrumentHistoricalData.Last().Close;
            position.CurrentOpenPositionValue = PortfolioAnalytics.CalculateCurrentOpenPositionValue(position);
            position.Profit     = PortfolioAnalytics.CalculatePositionProfit(position);
            position.ReturnRate = PortfolioAnalytics.CalculatePositionReturn(position);
            return(position);
        }