[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting Position.cs,1.1.1.1,1.
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2005-10-15 18:19:30
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18323/b4_Business/a1_Financial/a2_Accounting Modified Files: Position.cs Log Message: The Type property has been added (of type PositionType) Index: Position.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/Position.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Position.cs 13 Oct 2003 21:58:40 -0000 1.1.1.1 --- Position.cs 15 Oct 2005 18:19:22 -0000 1.2 *************** *** 48,52 **** } ! public Position( Instrument instrument , long quantity ) { this.instrument = instrument; --- 48,68 ---- } ! public PositionType Type ! { ! get ! { ! if ( this.Quantity == 0 ) ! throw new Exception( "Position Type cannot be requested " + ! "when no position is held!" ); ! PositionType positionType; ! if ( this.Quantity > 0 ) ! positionType = PositionType.Long; ! else ! // this.Quantity < 0 ! positionType = PositionType.Short; ! return positionType; ! } ! } ! public Position( Instrument instrument , long quantity ) { this.instrument = instrument; |