[Quantproject-developers] QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOs
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2008-03-12 22:05:36
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/InSampleChoosers In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8127/InSampleChoosers Modified Files: PVOCorrelationChooser.cs Log Message: Updated objects implementing the PVO strategy Index: PVOCorrelationChooser.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/InSampleChoosers/PVOCorrelationChooser.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PVOCorrelationChooser.cs 9 Mar 2008 22:49:23 -0000 1.1 --- PVOCorrelationChooser.cs 12 Mar 2008 22:05:32 -0000 1.2 *************** *** 40,44 **** /// requested number of PVOPositions (positions for the PVO strategy) /// </summary> ! public class PVOCorrelationChooser : IInSampleChooser { public event NewProgressEventHandler NewProgress; --- 40,44 ---- /// requested number of PVOPositions (positions for the PVO strategy) /// </summary> ! public abstract class PVOCorrelationChooser : IInSampleChooser { public event NewProgressEventHandler NewProgress; *************** *** 47,52 **** protected CorrelationProvider correlationProvider; protected int numberOfBestTestingPositionsToBeReturned; - protected double oversoldThreshold; - protected double overboughtThreshold; protected int numDaysForOscillatingPeriod; --- 47,50 ---- *************** *** 55,60 **** get { ! string description = "PVOCorrelationChooser_" + ! this.correlationProvider.GetType().ToString(); return description; } --- 53,60 ---- get { ! string description = "CorrelationChooserType:\n" + ! this.correlationProvider.GetType().ToString() + "\n" + ! "NumOfTickersReturned:\n" + ! this.numberOfBestTestingPositionsToBeReturned.ToString(); return description; } *************** *** 75,84 **** /// </param> public PVOCorrelationChooser(int numberOfBestTestingPositionsToBeReturned, ! double oversoldThreshold, double overboughtThreshold, ! int numDaysForOscillatingPeriod) { this.numberOfBestTestingPositionsToBeReturned = numberOfBestTestingPositionsToBeReturned; - this.oversoldThreshold = oversoldThreshold; - this.overboughtThreshold = overboughtThreshold; this.numDaysForOscillatingPeriod = numDaysForOscillatingPeriod; } --- 75,81 ---- /// </param> public PVOCorrelationChooser(int numberOfBestTestingPositionsToBeReturned, ! int numDaysForOscillatingPeriod) { this.numberOfBestTestingPositionsToBeReturned = numberOfBestTestingPositionsToBeReturned; this.numDaysForOscillatingPeriod = numDaysForOscillatingPeriod; } *************** *** 95,109 **** } ! protected virtual void setCorrelationProvider(EligibleTickers eligibleTickers , ! ReturnsManager returnsManager) ! { ! this.correlationProvider = ! new OpenToCloseCorrelationProvider(eligibleTickers.Tickers, returnsManager, ! 0.0001f, 0.5f); ! } ! protected virtual PVOPositions getTestingPositions(WeightedPositions weightedPositions) { ! return new PVOPositions(weightedPositions, this.oversoldThreshold, this.overboughtThreshold, this.numDaysForOscillatingPeriod ); } --- 92,102 ---- } ! protected abstract void setCorrelationProvider(EligibleTickers eligibleTickers , ! ReturnsManager returnsManager); ! protected PVOPositions getTestingPositions(WeightedPositions weightedPositions) { ! return new PVOPositions(weightedPositions, 0.0, 0.0, ! this.numDaysForOscillatingPeriod ); } *************** *** 124,127 **** --- 117,122 ---- WeightedPositions weightedPositions = new WeightedPositions(signedTickers); bestTestingPositions[i] = this.getTestingPositions(weightedPositions); + ((PVOPositions)bestTestingPositions[i]).FitnessInSample = + correlations[correlations.Length - 1 -i].CorrelationValue; } return bestTestingPositions; |