[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank ChosenTicker
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2004-11-29 14:30:00
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23959 Added Files: ChosenTickers.cs Log Message: The collection of the chosen tickers, among the best performing ones --- NEW FILE: ChosenTickers.cs --- /* QuantProject - Quantitative Finance Library ChosenTickers.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, USA. */ using System; using System.Collections; namespace QuantProject.Scripts.WalkForwardTesting.WalkForwardOneRank { /// <summary> /// The collection of the chosen tickers, among the best performing ones /// </summary> public class ChosenTickers : Hashtable { private int numberTickersToBeChosen; public ChosenTickers( int numberTickersToBeChosen ) { this.numberTickersToBeChosen = numberTickersToBeChosen; } #region SetTickers private void setTickers_build( BestPerformingTickers bestPerformingTickers ) { SortedList sortedList = new SortedList(); foreach ( string ticker in bestPerformingTickers.Keys ) sortedList.Add( ( ( ComparableAccount )bestPerformingTickers[ ticker ]).Goodness , ticker ); for ( int n=0; n<=this.numberTickersToBeChosen ; n++ ) this.Add( sortedList.GetByIndex( n ) , 1 ); } /// <summary> /// Populates the collection of eligible tickers /// </summary> /// <param name="dateTime"></param> public void SetTickers( BestPerformingTickers bestPerformingTickers ) { this.Clear(); this.setTickers_build( bestPerformingTickers ); } #endregion } } |