[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting Portfolio.cs,1.1.1.1,1
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2004-11-29 16:18:27
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21531/b4_Business/a1_Financial/a2_Accounting Modified Files: Portfolio.cs Log Message: - added Contains( string ticker ) - ExtededDateTime has been replaced by EndOfDayDateTime Index: Portfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/Portfolio.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Portfolio.cs 13 Oct 2003 21:58:40 -0000 1.1.1.1 --- Portfolio.cs 29 Nov 2004 16:18:17 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- using QuantProject.ADT; using QuantProject.Business.Financial.Instruments; + using QuantProject.Business.Timing; namespace QuantProject.Business.Financial.Accounting *************** *** 44,52 **** } ! public bool Contains( Instrument instrument ) ! { ! return base.ContainsKey( instrument ) || ! base.ContainsKey( instrument.Key ); ! } public bool IsLong( Instrument instrument ) --- 45,63 ---- } ! public bool Contains( Instrument instrument ) ! { ! return base.ContainsKey( instrument ) || ! base.ContainsKey( instrument.Key ); ! } ! /// <summary> ! /// True iff the instrument corresponding to ticker is already ! /// into the portfolio ! /// </summary> ! /// <param name="ticker"></param> ! /// <returns></returns> ! public bool Contains( string ticker ) ! { ! return this.ContainsKey( ticker ); ! } public bool IsLong( Instrument instrument ) *************** *** 90,94 **** ! public bool Update( TimedTransaction transaction ) { bool errorArised = false; --- 101,105 ---- ! public bool Update( Transaction transaction ) { bool errorArised = false; *************** *** 113,125 **** #endregion ! public double GetMarketValue( ExtendedDateTime extendedDateTime ) ! { ! double totalValue = 0; ! foreach (Position position in this.Values) ! totalValue = position.Instrument.GetMarketValue( extendedDateTime ) * position.Quantity; ! return totalValue; ! } ! public override string ToString() { string toString = ""; --- 124,136 ---- #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() { string toString = ""; |