Re: [Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Summ
Brought to you by:
glauco_1
|
From: Marco M. <mar...@po...> - 2006-06-09 20:56:44
|
Sbaglio o il file di progetto business non =E8 stato committato? Il mio vs.net non me li ha inclusi nel progetto: da' un'occhiata appena p= uoi=20 per favore ... ----- Original Message -----=20 From: "Glauco Siliprandi" <gla...@us...> To: <Qua...@li...> Sent: Thursday, June 08, 2006 11:11 PM Subject:=20 [Quantproject-developers]QuantProject/b4_Business/a1_Financial/a2_Account= ing/h5_Reporting/SummaryRowsExpectancyScore.cs,=20 NONE, 1.1 > Update of=20 > /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounti= ng/h5_Reporting/SummaryRows > In directory=20 > sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27667/b4_Business/a1_Financial= /a2_Accounting/h5_Reporting/SummaryRows > > Added Files: > ExpectancyScore.cs > Log Message: > Summary row containing the Expectancy Score calculation for > the account report equity line > > --- NEW FILE: ExpectancyScore.cs --- > /* > QuantProject - Quantitative Finance Library > > ExpectancyScore.cs > Copyright (C) 2003 > Glauco Siliprandi > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU General Public License > as published by the Free Software Foundation; either version 2 > of the License, or (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,=20 > USA. > */ > > using System; > using System.Collections; > using QuantProject.ADT.Histories; > using QuantProject.ADT.Statistics; > using QuantProject.Business.Financial.Accounting.Reporting.Tables; > > namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryR= ows > { > /// <summary> > /// Summary row containing the Expectancy Score calculation for > /// the account report equity line > /// </summary> > [Serializable] > public class ExpectancyScore : DoubleSummaryRow > { > private ArrayList getReturns( EquityLine equityLine ) > { > ArrayList returnValue =3D new ArrayList(); > for ( int i=3D0 ; i < equityLine.Count - 1 ; i++ ) > { > if ( Convert.ToDouble( equityLine.GetByIndex( i ) ) <=3D 0 ) > throw new Exception( "Equity line is expected to always being " + > "strictly positive. equityLine[ i ] is negative or equal to zero!" ); > double periodReturn =3D > ( Convert.ToDouble( equityLine.GetByIndex( i + 1 ) ) - > Convert.ToDouble( equityLine.GetByIndex( i ) ) ) / > Convert.ToDouble( equityLine.GetByIndex( i ) ); > returnValue.Add( periodReturn ); > } > return returnValue; > } > public ExpectancyScore( EquityLine equityLine ) : base( 6 ) > { > this.rowDescription =3D "Expectancy Score"; > ICollection returns =3D equityLine.GetReturns().Values; > this.rowValue =3D AdvancedFunctions.GetExpectancyScore( > returns ); > } > } > } > > > > _______________________________________________ > Quantproject-developers mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantproject-developers=20 |