[Quantproject-developers] QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOs
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2008-04-26 09:45:03
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/InSampleChoosers In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29299/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/InSampleChoosers Modified Files: PVOChooserFromSavedBackTestLog.cs Log Message: The chooser now makes possible to select the number of testingPositions you like (if this number is not greater than the testingPositions saved in each logItem of the backTestLog) Index: PVOChooserFromSavedBackTestLog.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/InSampleChoosers/PVOChooserFromSavedBackTestLog.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PVOChooserFromSavedBackTestLog.cs 8 Apr 2008 21:33:23 -0000 1.1 --- PVOChooserFromSavedBackTestLog.cs 26 Apr 2008 09:44:58 -0000 1.2 *************** *** 48,54 **** public PVOChooserFromSavedBackTestLog( ! string backTestLogFullPath) ! : base(backTestLogFullPath) { } --- 48,59 ---- public PVOChooserFromSavedBackTestLog( ! string backTestLogFullPath, int numberOfBestTestingPositionsToBeReturned) ! : base(backTestLogFullPath , numberOfBestTestingPositionsToBeReturned) { + int maxNumberOfTestingPositionsFromBackTestLogItems = + ((PVOLogItem)this.backTestLog[0]).BestPVOPositionsInSample.Length; + if(numberOfBestTestingPositionsToBeReturned > maxNumberOfTestingPositionsFromBackTestLogItems) + throw new Exception("Number of TestingPositions to be returned " + + "is too high for the given BackTestLog"); } *************** *** 56,66 **** { TestingPositions[] testingPositions = ! new TestingPositions[((PVOLogItem)this.backTestLog[0]).BestPVOPositionsInSample.Length]; ! for( int i = 0; i<this.backTestLog.Count ; i++ ) { if( this.backTestLog[i].SimulatedCreationTime.DateTime == lastInSampleDateOfOptimizedTestingPositions.DateTime ) { ! testingPositions = ((PVOLogItem)this.backTestLog[i]).BestPVOPositionsInSample; i = this.backTestLog.Count; } --- 61,74 ---- { TestingPositions[] testingPositions = ! new TestingPositions[this.numberOfBestTestingPositionsToBeReturned]; ! for( int i = 0; ! i < this.backTestLog.Count; ! i++ ) { if( this.backTestLog[i].SimulatedCreationTime.DateTime == lastInSampleDateOfOptimizedTestingPositions.DateTime ) { ! Array.Copy( ((PVOLogItem)this.backTestLog[i]).BestPVOPositionsInSample , ! 0, testingPositions, 0, numberOfBestTestingPositionsToBeReturned ); i = this.backTestLog.Count; } |