[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting Portfolio.cs,1.4,1.5
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2005-01-09 23:35:59
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13908/b4_Business/a1_Financial/a2_Accounting Modified Files: Portfolio.cs Log Message: - the IHistoricalQuoteProvider "concept" has been introduced - the GetMarketValue method uses an IDataStreamer now Index: Portfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/Portfolio.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Portfolio.cs 29 Dec 2004 17:11:57 -0000 1.4 --- Portfolio.cs 9 Jan 2005 23:35:47 -0000 1.5 *************** *** 25,30 **** --- 25,32 ---- using System.Diagnostics; using QuantProject.ADT; + using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Instruments; using QuantProject.Business.Timing; + using QuantProject.Data.DataProviders; namespace QuantProject.Business.Financial.Accounting *************** *** 126,137 **** #endregion ! public double GetMarketValue( EndOfDayDateTime endOfDayDateTime ) { double totalValue = 0; foreach (Position position in this.Values) ! totalValue += position.Instrument.GetMarketValue( endOfDayDateTime ) * position.Quantity; return totalValue; } - public override string ToString() { --- 128,148 ---- #endregion ! public double GetMarketValue( EndOfDayDateTime endOfDayDateTime , ! IHistoricalQuoteProvider historicalQuoteProvider ) { double totalValue = 0; foreach (Position position in this.Values) ! totalValue += historicalQuoteProvider.GetMarketValue( ! position.Instrument.Key , endOfDayDateTime ) * position.Quantity; ! return totalValue; ! } ! public double GetMarketValue( IDataStreamer dataStreamer ) ! { ! double totalValue = 0; ! foreach (Position position in this.Values) ! totalValue += dataStreamer.GetCurrentBid( ! position.Instrument.Key ) * position.Quantity; return totalValue; } public override string ToString() { |