[Quantproject-developers] QuantProject/b4_Business/a2_Strategies SignedTicker.cs, 1.5, 1.6
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2006-09-17 21:33:31
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29454/b4_Business/a2_Strategies Modified Files: SignedTicker.cs Log Message: Fixed bug in GetCloseToClosePortfolioReturn method. The portfolio return is properly computed now. Index: SignedTicker.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/SignedTicker.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SignedTicker.cs 22 Jul 2006 20:50:16 -0000 1.5 --- SignedTicker.cs 17 Sep 2006 21:33:27 -0000 1.6 *************** *** 171,175 **** DateTime endDate ) { ! double returnValue = 0.0; Quotes[] tickersQuotes = new Quotes[signedTickers.Length]; for(int i = 0; i<signedTickers.Length; i++) --- 171,176 ---- DateTime endDate ) { ! const double initialEquity = 1.0; ! double equityValue = initialEquity; Quotes[] tickersQuotes = new Quotes[signedTickers.Length]; for(int i = 0; i<signedTickers.Length; i++) *************** *** 186,192 **** tickersWeights, tickersQuotes); for(int i = 0; i < returns.Length; i++) ! returnValue = (1.0+returnValue) * returns[i]; ! return returnValue; } --- 187,194 ---- tickersWeights, tickersQuotes); for(int i = 0; i < returns.Length; i++) ! equityValue = ! equityValue + equityValue * returns[i]; ! return (equityValue - initialEquity)/initialEquity; } *************** *** 221,225 **** SortedList commonMarketDays ) { ! double returnValue = 0.0; Quotes[] tickersQuotes = new Quotes[ signedTickers.Length ]; for( int i = 0 ; i < signedTickers.Length ; i++ ) --- 223,228 ---- SortedList commonMarketDays ) { ! const double initialEquity = 1.0; ! double equityValue = initialEquity; Quotes[] tickersQuotes = new Quotes[ signedTickers.Length ]; for( int i = 0 ; i < signedTickers.Length ; i++ ) *************** *** 233,239 **** tickersWeights , tickersQuotes); for( int i = 0 ; i < returns.Length ; i++ ) ! returnValue = (1.0+returnValue) * returns[i]; ! ! return returnValue; } --- 236,243 ---- tickersWeights , tickersQuotes); for( int i = 0 ; i < returns.Length ; i++ ) ! equityValue = ! equityValue + equityValue * returns[i]; ! ! return (equityValue - initialEquity)/initialEquity; } |