quantproject-developers Mailing List for QuantProject (Page 79)
Brought to you by:
glauco_1
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(103) |
Dec
(67) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(52) |
Feb
(9) |
Mar
(69) |
Apr
(53) |
May
(80) |
Jun
(23) |
Jul
(24) |
Aug
(112) |
Sep
(9) |
Oct
|
Nov
(58) |
Dec
(93) |
| 2005 |
Jan
(90) |
Feb
(93) |
Mar
(61) |
Apr
(56) |
May
(37) |
Jun
(61) |
Jul
(55) |
Aug
(68) |
Sep
(25) |
Oct
(46) |
Nov
(41) |
Dec
(37) |
| 2006 |
Jan
(33) |
Feb
(7) |
Mar
(19) |
Apr
(27) |
May
(73) |
Jun
(49) |
Jul
(83) |
Aug
(66) |
Sep
(45) |
Oct
(16) |
Nov
(15) |
Dec
(7) |
| 2007 |
Jan
(14) |
Feb
(33) |
Mar
|
Apr
(21) |
May
|
Jun
(34) |
Jul
(18) |
Aug
(100) |
Sep
(39) |
Oct
(55) |
Nov
(12) |
Dec
(2) |
| 2008 |
Jan
(120) |
Feb
(133) |
Mar
(129) |
Apr
(104) |
May
(42) |
Jun
(2) |
Jul
(52) |
Aug
(99) |
Sep
(134) |
Oct
|
Nov
(137) |
Dec
(48) |
| 2009 |
Jan
(48) |
Feb
(55) |
Mar
(61) |
Apr
(3) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(51) |
Sep
|
Oct
(7) |
Nov
|
Dec
|
| 2010 |
Jan
(7) |
Feb
(1) |
Mar
(145) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
|
| 2011 |
Jan
(78) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(88) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Glauco S. <gla...@us...> - 2006-09-20 21:49:12
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12570/b5_Presentation Modified Files: b5_Presentation.csproj Log Message: Minor automatic VSNet changes Index: b5_Presentation.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/b5_Presentation.csproj,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** b5_Presentation.csproj 8 Sep 2006 15:26:54 -0000 1.30 --- b5_Presentation.csproj 20 Sep 2006 21:49:09 -0000 1.31 *************** *** 126,138 **** /> <Reference - Name = "NPlot" - AssemblyName = "NPlot" - HintPath = "..\..\..\NPlot.dll" - /> - <Reference Name = "b4_Business" Project = "{6EE31501-376E-491B-869E-F06D5B7C9C30}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> </References> </Build> --- 126,138 ---- /> <Reference Name = "b4_Business" Project = "{6EE31501-376E-491B-869E-F06D5B7C9C30}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> + <Reference + Name = "NPlot" + AssemblyName = "NPlot" + HintPath = "..\..\NPlot.dll" + /> </References> </Build> *************** *** 161,165 **** <File RelPath = "Charting\Chart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> --- 161,165 ---- <File RelPath = "Charting\Chart.cs" ! SubType = "Code" BuildAction = "Compile" /> |
|
From: Glauco S. <gla...@us...> - 2006-09-20 21:47:33
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11756/b7_Scripts Modified Files: b7_Scripts.csproj Log Message: WalkForwardTesting\WalkForwardLag\WFLagBruteForceOptimizableItemManager\WFLagFixedPortfolioBruteForceOptParamManagerWithNormalizedVolatility.cs has been renamed to WalkForwardTesting\WalkForwardLag\WFLagBruteForceOptimizableItemManager\WFLagFixedPortfolioBruteForceOptParamManagerWithPortfolioNormalizedVolatility.cs (before committing) Index: b7_Scripts.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/b7_Scripts.csproj,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** b7_Scripts.csproj 20 Sep 2006 21:14:46 -0000 1.64 --- b7_Scripts.csproj 20 Sep 2006 21:47:30 -0000 1.65 *************** *** 710,714 **** /> <File ! RelPath = "WalkForwardTesting\WalkForwardLag\WFLagBruteForceOptimizableItemManager\WFLagFixedPortfolioBruteForceOptParamManagerWithNormalizedVolatility.cs" SubType = "Code" BuildAction = "Compile" --- 710,714 ---- /> <File ! RelPath = "WalkForwardTesting\WalkForwardLag\WFLagBruteForceOptimizableItemManager\WFLagFixedPortfolioBruteForceOptParamManagerWithPortfolioNormalizedVolatility.cs" SubType = "Code" BuildAction = "Compile" |
|
From: Glauco S. <gla...@us...> - 2006-09-20 21:14:50
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30628/b7_Scripts Modified Files: b7_Scripts.csproj Log Message: WalkForwardTesting\WalkForwardLag\WFLagBruteForceOptimizableItemManager\WFLagFixedPortfolioBruteForceOptParamManagerWithNormalizedVolatility.cs has been added Index: b7_Scripts.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/b7_Scripts.csproj,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** b7_Scripts.csproj 17 Sep 2006 23:00:33 -0000 1.63 --- b7_Scripts.csproj 20 Sep 2006 21:14:46 -0000 1.64 *************** *** 710,713 **** --- 710,718 ---- /> <File + RelPath = "WalkForwardTesting\WalkForwardLag\WFLagBruteForceOptimizableItemManager\WFLagFixedPortfolioBruteForceOptParamManagerWithNormalizedVolatility.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "WalkForwardTesting\WalkForwardLag\WFLagDebugger\WFLagChosenPositions.cs" SubType = "Code" |
|
From: Glauco S. <gla...@us...> - 2006-09-20 21:11:55
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29413/b7_Scripts/WalkForwardTesting/WalkForwardLag Modified Files: RunWalkForwardLag.cs Log Message: A statement is used to avoid too many output Console output when a small populations are chosen. I don't like this implementation... a different approach should be taken. To do. Index: RunWalkForwardLag.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/RunWalkForwardLag.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RunWalkForwardLag.cs 21 Jun 2006 17:25:41 -0000 1.5 --- RunWalkForwardLag.cs 20 Sep 2006 21:11:45 -0000 1.6 *************** *** 151,164 **** if ( !(this.InSampleNewProgress == null) ) this.InSampleNewProgress( this , eventArgs ); ! // Console.WriteLine( ! // eventArgs.CurrentProgress.ToString() + " / " + ! // eventArgs.Goal.ToString() + ! // " - " + ! // DateTime.Now.ToString() ); ! RunWalkForwardLag.WriteToTextLog( ! eventArgs.CurrentProgress.ToString() + " / " + ! eventArgs.Goal.ToString() + ! " - " + ! DateTime.Now.ToString() ); } private void run_initializeProgressHandlers() --- 151,163 ---- if ( !(this.InSampleNewProgress == null) ) this.InSampleNewProgress( this , eventArgs ); ! // the following if statement is used to avoid too many output ! // when small populations are chosen. Comment it out ! // when large populations are chosen ! if ( eventArgs.CurrentProgress % 20 == 0 ) ! RunWalkForwardLag.WriteToTextLog( ! eventArgs.CurrentProgress.ToString() + " / " + ! eventArgs.Goal.ToString() + ! " - " + ! DateTime.Now.ToString() ); } private void run_initializeProgressHandlers() |
|
From: Glauco S. <gla...@us...> - 2006-09-20 21:06:37
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27180/b7_Scripts/WalkForwardTesting/WalkForwardLag Modified Files: WFLagChosenTickers.cs Log Message: a WFLagFixedPortfolioBruteForceOptParamManagerWithNormalizedVolatility object is used instead of a WFLagFixedPortfolioBruteForceOptimizableParametersManager object (weights are used to normalize the portfolio's tickers volatility) Index: WFLagChosenTickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagChosenTickers.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** WFLagChosenTickers.cs 8 Sep 2006 15:30:17 -0000 1.6 --- WFLagChosenTickers.cs 20 Sep 2006 21:06:33 -0000 1.7 *************** *** 259,265 **** this.endOfDayTimer.GetCurrentTime().DateTime; ! WFLagFixedPortfolioBruteForceOptimizableParametersManager wFLagFixedPortfolioBruteForceOptimizableParametersManager= ! new WFLagFixedPortfolioBruteForceOptimizableParametersManager( eligibleTickers.EligibleTickers , longPortfolioTicker , --- 259,275 ---- this.endOfDayTimer.GetCurrentTime().DateTime; ! // WFLagFixedPortfolioBruteForceOptimizableParametersManager ! // wFLagFixedPortfolioBruteForceOptimizableParametersManager= ! // new WFLagFixedPortfolioBruteForceOptimizableParametersManager( ! // eligibleTickers.EligibleTickers , ! // longPortfolioTicker , ! // shortPortfolioTicker , ! // this.firstOptimizationDate , ! // this.lastOptimizationDate , ! // this.numberOfDrivingPositions ); ! // ! WFLagFixedPortfolioBruteForceOptParamManagerWithNormalizedVolatility wFLagFixedPortfolioBruteForceOptimizableParametersManager= ! new WFLagFixedPortfolioBruteForceOptParamManagerWithNormalizedVolatility( eligibleTickers.EligibleTickers , longPortfolioTicker , *************** *** 298,301 **** --- 308,315 ---- this.setWeightedPositions_withFixedPortfolio( eligibleTickers , "SPY" , "IWM" ); + // this.setWeightedPositions_withFixedPortfolio( + // eligibleTickers , "XLF" , "SMH" ); + // this.setWeightedPositions_withFixedPortfolio( + // eligibleTickers , "QQQQ" , "SPY" ); } #endregion |
|
From: Glauco S. <gla...@us...> - 2006-09-20 21:02:51
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25539/b7_Scripts/WalkForwardTesting/WalkForwardLag Modified Files: WFLagEligibleTickers.cs Log Message: - the private method debug_displayTickersToConsole has been added (for debugging purposes only) Index: WFLagEligibleTickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagEligibleTickers.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WFLagEligibleTickers.cs 18 Jun 2006 14:14:27 -0000 1.2 --- WFLagEligibleTickers.cs 20 Sep 2006 21:02:45 -0000 1.3 *************** *** 98,101 **** --- 98,106 ---- return returnValue; } + private void debug_displayTickersToConsole() + { + foreach ( DataRow dataRow in this.eligibleTickers.Rows ) + Console.WriteLine( (string)dataRow[ 0 ] ); + } private void setTickers_build() { *************** *** 104,107 **** --- 109,114 ---- // for fast debug, uncomment the following line // DataTable selectedTickers = setTickers_buildQuickly_getSelectedTickers(); + // this.debug_displayTickersToConsole(); + // this.debug_displayTickersToConsole(); } /// <summary> |
|
From: Glauco S. <gla...@us...> - 2006-09-20 21:01:59
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagBruteForceOptimizableItemManager In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25139/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagBruteForceOptimizableItemManager Modified Files: WFLagFixedPortfolioBruteForceOptimizableParametersManager.cs Log Message: - the class inherits WFLagGenomeManager now (the private member wFLagGenomeManager has been removed) - portfolioLongTicker and portfolioShortTicker are protected now (they were private before) - the method decodePortfolioWeightedPositions is protected and virtual now (it was private before) Index: WFLagFixedPortfolioBruteForceOptimizableParametersManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagBruteForceOptimizableItemManager/WFLagFixedPortfolioBruteForceOptimizableParametersManager.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WFLagFixedPortfolioBruteForceOptimizableParametersManager.cs 8 Sep 2006 15:21:09 -0000 1.1 --- WFLagFixedPortfolioBruteForceOptimizableParametersManager.cs 20 Sep 2006 21:01:56 -0000 1.2 *************** *** 37,50 **** /// </summary> public class WFLagFixedPortfolioBruteForceOptimizableParametersManager : ! IBruteForceOptimizableParametersManager { private Combination drivingCombination; private int numberOfDrivingPositions; ! private WFLagGenomeManager wFLagGenomeManager; private DataTable eligibleTickersForDrivingPositions; ! private string portfolioLongTicker; ! private string portfolioShortTicker; public int TotalIterations --- 37,50 ---- /// </summary> public class WFLagFixedPortfolioBruteForceOptimizableParametersManager : ! WFLagGenomeManager , IBruteForceOptimizableParametersManager { private Combination drivingCombination; private int numberOfDrivingPositions; ! // protected WFLagGenomeManager wFLagGenomeManager; private DataTable eligibleTickersForDrivingPositions; ! protected string portfolioLongTicker; ! protected string portfolioShortTicker; public int TotalIterations *************** *** 61,65 **** DateTime firstOptimizationDate , DateTime lastOptimizationDate , ! int numberOfDrivingPositions ) { this.eligibleTickersForDrivingPositions = --- 61,73 ---- DateTime firstOptimizationDate , DateTime lastOptimizationDate , ! int numberOfDrivingPositions ) : ! base( ! eligibleTickersForDrivingPositions , ! eligibleTickersForDrivingPositions , ! firstOptimizationDate , ! lastOptimizationDate , ! numberOfDrivingPositions , ! 2 , ! QuantProject.ADT.ConstantsProvider.SeedForRandomGenerator ) { this.eligibleTickersForDrivingPositions = *************** *** 72,83 **** eligibleTickersForDrivingPositions.Rows.Count - 1 , numberOfDrivingPositions ); ! this.wFLagGenomeManager = new WFLagGenomeManager( ! eligibleTickersForDrivingPositions , ! eligibleTickersForDrivingPositions , ! firstOptimizationDate , ! lastOptimizationDate , ! numberOfDrivingPositions , ! 2 , ! QuantProject.ADT.ConstantsProvider.SeedForRandomGenerator ); } public bool MoveNext() --- 80,91 ---- eligibleTickersForDrivingPositions.Rows.Count - 1 , numberOfDrivingPositions ); ! // this.wFLagGenomeManager = new WFLagGenomeManager( ! // eligibleTickersForDrivingPositions , ! // eligibleTickersForDrivingPositions , ! // firstOptimizationDate , ! // lastOptimizationDate , ! // numberOfDrivingPositions , ! // 2 , ! // QuantProject.ADT.ConstantsProvider.SeedForRandomGenerator ); } public bool MoveNext() *************** *** 200,204 **** this.eligibleTickersForDrivingPositions ); } ! private WeightedPositions decodePortfolioWeightedPositions( int[] optimizableParameters ) { --- 208,212 ---- this.eligibleTickersForDrivingPositions ); } ! protected virtual WeightedPositions decodePortfolioWeightedPositions( int[] optimizableParameters ) { *************** *** 251,255 **** // all driving position parameters refer to distinct tickers fitnessValue = ! this.wFLagGenomeManager.GetFitnessValue( wFLagWeightedPositions ); return fitnessValue; } --- 259,263 ---- // all driving position parameters refer to distinct tickers fitnessValue = ! base.GetFitnessValue( wFLagWeightedPositions ); return fitnessValue; } |
|
From: Glauco S. <gla...@us...> - 2006-09-20 20:58:36
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23123/b7_Scripts/WalkForwardTesting/WalkForwardLag Modified Files: WFLagGenomeManager.cs Log Message: wFLagCandidates is protected now (it was private before) Index: WFLagGenomeManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomeManager.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WFLagGenomeManager.cs 21 Aug 2006 19:55:17 -0000 1.4 --- WFLagGenomeManager.cs 20 Sep 2006 20:58:30 -0000 1.5 *************** *** 49,53 **** private double minimumPositionWeight; ! private WFLagCandidates wFLagCandidates; --- 49,53 ---- private double minimumPositionWeight; ! protected WFLagCandidates wFLagCandidates; |
|
From: Marco M. <mi...@us...> - 2006-09-17 23:02:33
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32745/b1_ADT Modified Files: ADT_SD.csproj Log Message: Updated sharpDevelop project's files Index: ADT_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ADT_SD.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ADT_SD.csproj 2 Jul 2006 20:07:59 -0000 1.1 --- ADT_SD.csproj 17 Sep 2006 23:02:24 -0000 1.2 *************** *** 72,75 **** --- 72,85 ---- <Compile Include="Optimizing\Genetic\GenomeCounter.cs" /> <Compile Include="Collections\QPHashtable.cs" /> + <Compile Include="Optimizing\BruteForce\BruteForceOptimizableParameters.cs" /> + <Compile Include="Optimizing\BruteForce\BruteForceOptimizer.cs" /> + <Compile Include="Optimizing\BruteForce\IBruteForceOptimizableParametersManager.cs" /> + <Compile Include="Statistics\Combinatorial\Combination.cs" /> + <Compile Include="ExtendedMath.cs" /> + <Compile Include="Collections\CollectionManager.cs" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Optimizing\BruteForce" /> + <Folder Include="Statistics\Combinatorial" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
|
From: Marco M. <mi...@us...> - 2006-09-17 23:02:27
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32745/b7_Scripts Modified Files: Scripts_SD.csproj Log Message: Updated sharpDevelop project's files Index: Scripts_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/Scripts_SD.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Scripts_SD.csproj 3 Aug 2006 21:37:15 -0000 1.2 --- Scripts_SD.csproj 17 Sep 2006 23:02:24 -0000 1.3 *************** *** 114,118 **** <Compile Include="TickerSelectionTesting\EndOfDayTimerHandlerOTC.cs" /> <Compile Include="TickerSelectionTesting\RunTestOptimizedOTCPortfolio.cs" /> - <Compile Include="TickerSelectionTesting\TestingOTCTypes\GenomeManagerForEfficientOTCTypes.cs" /> <Compile Include="TickerSelectionTesting\EndOfDayTimerHandlerOTCTest.cs" /> <Compile Include="EvaluatingOptimizationTechnique\EfficientPortfolio\RunTestingOptimizationCloseToOpen.cs" /> --- 114,117 ---- *************** *** 175,178 **** --- 174,188 ---- <Compile Include="WalkForwardTesting\WalkForwardLag\WFLagWeightedPositions.cs" /> <Compile Include="WalkForwardTesting\LinearCombination\ImmediateTrendFollowerStrategy.cs" /> + <Compile Include="TechnicalAnalysisTesting\Oscillators\FixedLevelOscillators\PortfolioValueOscillator\EndOfDayTimerHandlerPVO.cs" /> + <Compile Include="TechnicalAnalysisTesting\Oscillators\FixedLevelOscillators\PortfolioValueOscillator\GenomeManagerPVO.cs" /> + <Compile Include="TechnicalAnalysisTesting\Oscillators\FixedLevelOscillators\PortfolioValueOscillator\GenomeMeaningPVO.cs" /> + <Compile Include="TechnicalAnalysisTesting\Oscillators\FixedLevelOscillators\PortfolioValueOscillator\RunPVO.cs" /> + <Compile Include="WalkForwardTesting\WalkForwardLag\WFLagBruteForceOptimizableItemManager\WFLagBruteForceOptimizableParametersManager.cs" /> + <Compile Include="TickerSelectionTesting\TestingOTCTypes\BruteForceOptimization\RunEfficientOTCTypesBruteForce.cs" /> + <Compile Include="TickerSelectionTesting\TestingOTCTypes\BruteForceOptimization\EndOfDayTimerHandlerOTCTypesBruteForce.cs" /> + <Compile Include="TickerSelectionTesting\TestingOTCTypes\BruteForceOptimization\OTCBruteForceOptimizableParametersManager.cs" /> + <Compile Include="WalkForwardTesting\WalkForwardLag\GeneticOptimizerTesting\WFLagGOTester.cs" /> + <Compile Include="WalkForwardTesting\LinearCombination\FixedLevelOscillatorPVOStrategy.cs" /> + <Compile Include="WalkForwardTesting\WalkForwardLag\WFLagBruteForceOptimizableItemManager\WFLagFixedPortfolioBruteForceOptimizableParametersManager.cs" /> </ItemGroup> <ItemGroup> *************** *** 209,212 **** --- 219,227 ---- <Folder Include="TechnicalAnalysisTesting\TrendFollowing" /> <Folder Include="TechnicalAnalysisTesting\TrendFollowing\ImmediateTrendFollower" /> + <Folder Include="TechnicalAnalysisTesting\Oscillators\FixedLevelOscillators" /> + <Folder Include="TechnicalAnalysisTesting\Oscillators\FixedLevelOscillators\PortfolioValueOscillator" /> + <Folder Include="WalkForwardTesting\WalkForwardLag\WFLagBruteForceOptimizableItemManager" /> + <Folder Include="TickerSelectionTesting\TestingOTCTypes\BruteForceOptimization" /> + <Folder Include="WalkForwardTesting\WalkForwardLag\GeneticOptimizerTesting" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
|
From: Marco M. <mi...@us...> - 2006-09-17 23:01:22
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32338/b3_Data Modified Files: b3_Data.csproj Log Message: Minor changes made by VS NET. Index: b3_Data.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/b3_Data.csproj,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** b3_Data.csproj 30 Jul 2006 13:06:15 -0000 1.41 --- b3_Data.csproj 17 Sep 2006 23:01:19 -0000 1.42 *************** *** 136,140 **** <File RelPath = "ExtendedDataTable.cs" ! SubType = "Component" BuildAction = "Compile" /> --- 136,140 ---- <File RelPath = "ExtendedDataTable.cs" ! SubType = "Code" BuildAction = "Compile" /> |
|
From: Marco M. <mi...@us...> - 2006-09-17 23:00:38
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31928/b7_Scripts Modified Files: b7_Scripts.csproj Log Message: Added Portfolio Value Oscillator strategy; Added OTC - CTO strategy using the BruteForceOptimizer Index: b7_Scripts.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/b7_Scripts.csproj,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** b7_Scripts.csproj 8 Sep 2006 15:27:35 -0000 1.62 --- b7_Scripts.csproj 17 Sep 2006 23:00:33 -0000 1.63 *************** *** 264,267 **** --- 264,287 ---- /> <File + RelPath = "TechnicalAnalysisTesting\Oscillators\FixedLevelOscillators\PortfolioValueOscillator\EndOfDayTimerHandlerPVO.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "TechnicalAnalysisTesting\Oscillators\FixedLevelOscillators\PortfolioValueOscillator\GenomeManagerPVO.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "TechnicalAnalysisTesting\Oscillators\FixedLevelOscillators\PortfolioValueOscillator\GenomeMeaningPVO.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "TechnicalAnalysisTesting\Oscillators\FixedLevelOscillators\PortfolioValueOscillator\RunPVO.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "TechnicalAnalysisTesting\Oscillators\FixedPeriodOscillators\EndOfDayTimerHandlerFPOscillatorCTC.cs" SubType = "Code" *************** *** 504,507 **** --- 524,542 ---- /> <File + RelPath = "TickerSelectionTesting\TestingOTCTypes\BruteForceOptimization\EndOfDayTimerHandlerOTCTypesBruteForce.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectionTesting\TestingOTCTypes\BruteForceOptimization\OTCBruteForceOptimizableParametersManager.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectionTesting\TestingOTCTypes\BruteForceOptimization\RunEfficientOTCTypesBruteForce.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "WalkForwardTesting\IWalkForwardProgressNotifier.cs" SubType = "Code" *************** *** 519,522 **** --- 554,562 ---- /> <File + RelPath = "WalkForwardTesting\LinearCombination\FixedLevelOscillatorPVOStrategy.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "WalkForwardTesting\LinearCombination\FixedPeriodOscillatorStrategy.cs" SubType = "Code" *************** *** 544,552 **** /> <File - RelPath = "WalkForwardTesting\LinearCombination\MainForm.resx" - DependentUpon = "MainForm.cs" - BuildAction = "EmbeddedResource" - /> - <File RelPath = "WalkForwardTesting\LinearCombination\OpenToCloseDailyStrategy.cs" SubType = "Code" --- 584,587 ---- *************** *** 584,592 **** /> <File - RelPath = "WalkForwardTesting\LinearCombination\TestDisplayer.resx" - DependentUpon = "TestDisplayer.cs" - BuildAction = "EmbeddedResource" - /> - <File RelPath = "WalkForwardTesting\LinearCombination\WalkForwardTest\RunWalkForwardLinearCombination.cs" SubType = "Code" --- 619,622 ---- |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:49:47
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3507/Downloader/TickerSelectors Modified Files: TickerSelectorForm.cs Log Message: Added new constructor to the SelectorByLiquidity class: now it is possible to filter tickers by a given min volume value also when selection is performed on a given set (dataTable) of tickers Index: TickerSelectorForm.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors/TickerSelectorForm.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TickerSelectorForm.cs 2 Jul 2006 20:01:07 -0000 1.20 --- TickerSelectorForm.cs 17 Sep 2006 21:49:43 -0000 1.21 *************** *** 70,73 **** --- 70,75 ---- private System.Windows.Forms.Splitter splitter1; private System.Windows.Forms.CheckBox checkBoxOnlyWithAtLeastOneWinningDay; + private System.Windows.Forms.TextBox textBoxMinVolume; + private System.Windows.Forms.Label labelMinVolume; private DataTable tableOfSelectedTickers; *************** *** 132,491 **** /// </summary> private void InitializeComponent() { ! this.components = new System.ComponentModel.Container(); ! this.splitter1 = new System.Windows.Forms.Splitter(); ! this.textBoxMaxPrice = new System.Windows.Forms.TextBox(); ! this.labelMaxPrice = new System.Windows.Forms.Label(); ! this.label5 = new System.Windows.Forms.Label(); ! this.labelMaxStdDev = new System.Windows.Forms.Label(); ! this.label7 = new System.Windows.Forms.Label(); ! this.textBoxMaxNumOfReturnedTickers = new System.Windows.Forms.TextBox(); ! this.panel2 = new System.Windows.Forms.Panel(); ! this.groupBoxSelectionRule = new System.Windows.Forms.GroupBox(); ! this.labelTextBoxPopulationSize = new System.Windows.Forms.Label(); ! this.labelTextBoxGenerations = new System.Windows.Forms.Label(); ! this.textBoxGenerationsForGeneticOptimizer = new System.Windows.Forms.TextBox(); ! this.textBoxPopulationSizeForGeneticOptimizer = new System.Windows.Forms.TextBox(); ! this.checkBoxAddIndexToOutputTable = new System.Windows.Forms.CheckBox(); ! this.checkBoxOnlyWithAtLeastOneWinningDay = new System.Windows.Forms.CheckBox(); ! this.textBoxMaxStdDev = new System.Windows.Forms.TextBox(); ! this.labelMinStdDev = new System.Windows.Forms.Label(); ! this.textBoxMinStdDev = new System.Windows.Forms.TextBox(); ! this.labelMinPrice = new System.Windows.Forms.Label(); ! this.textBoxMinPrice = new System.Windows.Forms.TextBox(); ! this.labelMarketIndexKey = new System.Windows.Forms.Label(); ! this.textBoxMarketIndex = new System.Windows.Forms.TextBox(); ! this.checkBoxASCMode = new System.Windows.Forms.CheckBox(); ! this.label3 = new System.Windows.Forms.Label(); ! this.comboBoxAvailableSelectionRules = new System.Windows.Forms.ComboBox(); ! this.label2 = new System.Windows.Forms.Label(); ! this.label1 = new System.Windows.Forms.Label(); ! this.textBoxGroupID = new System.Windows.Forms.TextBox(); ! this.dateTimePickerLastDate = new System.Windows.Forms.DateTimePicker(); ! this.dateTimePickerFirstDate = new System.Windows.Forms.DateTimePicker(); ! this.buttonSelectTickers = new System.Windows.Forms.Button(); ! this.dataGrid1 = new System.Windows.Forms.DataGrid(); ! this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); ! this.panel2.SuspendLayout(); ! this.groupBoxSelectionRule.SuspendLayout(); ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); ! this.SuspendLayout(); ! // ! // splitter1 ! // ! this.splitter1.BackColor = System.Drawing.SystemColors.Highlight; ! this.splitter1.Location = new System.Drawing.Point(432, 0); ! this.splitter1.Name = "splitter1"; ! this.splitter1.Size = new System.Drawing.Size(3, 478); ! this.splitter1.TabIndex = 8; ! this.splitter1.TabStop = false; ! // ! // textBoxMaxPrice ! // ! this.textBoxMaxPrice.Location = new System.Drawing.Point(69, 202); ! this.textBoxMaxPrice.Name = "textBoxMaxPrice"; ! this.textBoxMaxPrice.Size = new System.Drawing.Size(56, 21); ! this.textBoxMaxPrice.TabIndex = 32; ! this.textBoxMaxPrice.Visible = false; ! // ! // labelMaxPrice ! // ! this.labelMaxPrice.Location = new System.Drawing.Point(13, 202); ! this.labelMaxPrice.Name = "labelMaxPrice"; ! this.labelMaxPrice.Size = new System.Drawing.Size(56, 14); ! this.labelMaxPrice.TabIndex = 33; ! this.labelMaxPrice.Text = "Max Price"; ! this.labelMaxPrice.Visible = false; ! // ! // label5 ! // ! this.label5.Location = new System.Drawing.Point(8, 16); ! this.label5.Name = "label5"; ! this.label5.Size = new System.Drawing.Size(64, 21); ! this.label5.TabIndex = 18; ! this.label5.Text = "First Date"; ! // ! // labelMaxStdDev ! // ! this.labelMaxStdDev.Location = new System.Drawing.Point(149, 202); ! this.labelMaxStdDev.Name = "labelMaxStdDev"; ! this.labelMaxStdDev.Size = new System.Drawing.Size(80, 14); ! this.labelMaxStdDev.TabIndex = 37; ! this.labelMaxStdDev.Text = "Max Std Dev"; ! this.labelMaxStdDev.Visible = false; ! // ! // label7 ! // ! this.label7.Location = new System.Drawing.Point(168, 16); ! this.label7.Name = "label7"; ! this.label7.Size = new System.Drawing.Size(64, 21); ! this.label7.TabIndex = 20; ! this.label7.Text = "Last Date"; ! // ! // textBoxMaxNumOfReturnedTickers ! // ! this.textBoxMaxNumOfReturnedTickers.Location = new System.Drawing.Point(312, 41); ! this.textBoxMaxNumOfReturnedTickers.Name = "textBoxMaxNumOfReturnedTickers"; ! this.textBoxMaxNumOfReturnedTickers.Size = new System.Drawing.Size(48, 21); ! this.textBoxMaxNumOfReturnedTickers.TabIndex = 23; ! // ! // panel2 ! // ! this.panel2.Controls.Add(this.groupBoxSelectionRule); ! this.panel2.Controls.Add(this.buttonSelectTickers); ! this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; ! this.panel2.ForeColor = System.Drawing.SystemColors.ControlText; ! this.panel2.Location = new System.Drawing.Point(432, 0); ! this.panel2.Name = "panel2"; ! this.panel2.Size = new System.Drawing.Size(372, 478); ! this.panel2.TabIndex = 7; ! // ! // groupBoxSelectionRule ! // ! this.groupBoxSelectionRule.Controls.Add(this.labelTextBoxPopulationSize); ! this.groupBoxSelectionRule.Controls.Add(this.labelTextBoxGenerations); ! this.groupBoxSelectionRule.Controls.Add(this.textBoxGenerationsForGeneticOptimizer); ! this.groupBoxSelectionRule.Controls.Add(this.textBoxPopulationSizeForGeneticOptimizer); ! this.groupBoxSelectionRule.Controls.Add(this.checkBoxAddIndexToOutputTable); ! this.groupBoxSelectionRule.Controls.Add(this.checkBoxOnlyWithAtLeastOneWinningDay); ! this.groupBoxSelectionRule.Controls.Add(this.labelMaxStdDev); ! this.groupBoxSelectionRule.Controls.Add(this.textBoxMaxStdDev); ! this.groupBoxSelectionRule.Controls.Add(this.labelMinStdDev); ! this.groupBoxSelectionRule.Controls.Add(this.textBoxMinStdDev); ! this.groupBoxSelectionRule.Controls.Add(this.labelMaxPrice); ! this.groupBoxSelectionRule.Controls.Add(this.textBoxMaxPrice); ! this.groupBoxSelectionRule.Controls.Add(this.labelMinPrice); ! this.groupBoxSelectionRule.Controls.Add(this.textBoxMinPrice); ! this.groupBoxSelectionRule.Controls.Add(this.labelMarketIndexKey); ! this.groupBoxSelectionRule.Controls.Add(this.textBoxMarketIndex); ! this.groupBoxSelectionRule.Controls.Add(this.checkBoxASCMode); ! this.groupBoxSelectionRule.Controls.Add(this.label3); ! this.groupBoxSelectionRule.Controls.Add(this.comboBoxAvailableSelectionRules); ! this.groupBoxSelectionRule.Controls.Add(this.label2); ! this.groupBoxSelectionRule.Controls.Add(this.textBoxMaxNumOfReturnedTickers); ! this.groupBoxSelectionRule.Controls.Add(this.label1); ! this.groupBoxSelectionRule.Controls.Add(this.textBoxGroupID); ! this.groupBoxSelectionRule.Controls.Add(this.label7); ! this.groupBoxSelectionRule.Controls.Add(this.label5); ! this.groupBoxSelectionRule.Controls.Add(this.dateTimePickerLastDate); ! this.groupBoxSelectionRule.Controls.Add(this.dateTimePickerFirstDate); ! this.groupBoxSelectionRule.Location = new System.Drawing.Point(8, 10); ! this.groupBoxSelectionRule.Name = "groupBoxSelectionRule"; ! this.groupBoxSelectionRule.Size = new System.Drawing.Size(361, 272); ! this.groupBoxSelectionRule.TabIndex = 14; ! this.groupBoxSelectionRule.TabStop = false; ! this.groupBoxSelectionRule.Text = "Single Selection rule"; ! // ! // labelTextBoxPopulationSize ! // ! this.labelTextBoxPopulationSize.Location = new System.Drawing.Point(192, 227); ! this.labelTextBoxPopulationSize.Name = "labelTextBoxPopulationSize"; ! this.labelTextBoxPopulationSize.Size = new System.Drawing.Size(70, 14); ! this.labelTextBoxPopulationSize.TabIndex = 45; ! this.labelTextBoxPopulationSize.Text = "Pop. Size"; ! this.labelTextBoxPopulationSize.Visible = false; ! // ! // labelTextBoxGenerations ! // ! this.labelTextBoxGenerations.Location = new System.Drawing.Point(16, 227); ! this.labelTextBoxGenerations.Name = "labelTextBoxGenerations"; ! this.labelTextBoxGenerations.Size = new System.Drawing.Size(73, 15); ! this.labelTextBoxGenerations.TabIndex = 44; ! this.labelTextBoxGenerations.Text = "Generations"; ! this.labelTextBoxGenerations.Visible = false; ! // ! // textBoxGenerationsForGeneticOptimizer ! // ! this.textBoxGenerationsForGeneticOptimizer.Location = new System.Drawing.Point(117, 228); ! this.textBoxGenerationsForGeneticOptimizer.Name = "textBoxGenerationsForGeneticOptimizer"; ! this.textBoxGenerationsForGeneticOptimizer.Size = new System.Drawing.Size(56, 21); ! this.textBoxGenerationsForGeneticOptimizer.TabIndex = 43; ! this.textBoxGenerationsForGeneticOptimizer.Visible = false; ! // ! // textBoxPopulationSizeForGeneticOptimizer ! // ! this.textBoxPopulationSizeForGeneticOptimizer.Location = new System.Drawing.Point(269, 227); ! this.textBoxPopulationSizeForGeneticOptimizer.Name = "textBoxPopulationSizeForGeneticOptimizer"; ! this.textBoxPopulationSizeForGeneticOptimizer.Size = new System.Drawing.Size(56, 21); ! this.textBoxPopulationSizeForGeneticOptimizer.TabIndex = 42; ! this.textBoxPopulationSizeForGeneticOptimizer.Visible = false; ! // ! // checkBoxAddIndexToOutputTable ! // ! this.checkBoxAddIndexToOutputTable.Location = new System.Drawing.Point(11, 131); ! this.checkBoxAddIndexToOutputTable.Name = "checkBoxAddIndexToOutputTable"; ! this.checkBoxAddIndexToOutputTable.Size = new System.Drawing.Size(164, 15); ! this.checkBoxAddIndexToOutputTable.TabIndex = 41; ! this.checkBoxAddIndexToOutputTable.Text = "Add index to Output Table"; ! this.toolTip1.SetToolTip(this.checkBoxAddIndexToOutputTable, "Check if you want to filter only tickers with at least one winning day"); ! this.checkBoxAddIndexToOutputTable.Visible = false; ! // ! // checkBoxOnlyWithAtLeastOneWinningDay ! // ! this.checkBoxOnlyWithAtLeastOneWinningDay.Location = new System.Drawing.Point(195, 113); ! this.checkBoxOnlyWithAtLeastOneWinningDay.Name = "checkBoxOnlyWithAtLeastOneWinningDay"; ! this.checkBoxOnlyWithAtLeastOneWinningDay.Size = new System.Drawing.Size(152, 16); ! this.checkBoxOnlyWithAtLeastOneWinningDay.TabIndex = 38; ! this.checkBoxOnlyWithAtLeastOneWinningDay.Text = "Exclude \"pure\" losers"; ! this.toolTip1.SetToolTip(this.checkBoxOnlyWithAtLeastOneWinningDay, "Check if you want to filter only tickers with at least one winning day"); ! this.checkBoxOnlyWithAtLeastOneWinningDay.Visible = false; ! // ! // textBoxMaxStdDev ! // ! this.textBoxMaxStdDev.Location = new System.Drawing.Point(229, 202); ! this.textBoxMaxStdDev.Name = "textBoxMaxStdDev"; ! this.textBoxMaxStdDev.Size = new System.Drawing.Size(56, 21); ! this.textBoxMaxStdDev.TabIndex = 36; ! this.textBoxMaxStdDev.Visible = false; ! // ! // labelMinStdDev ! // ! this.labelMinStdDev.Location = new System.Drawing.Point(152, 149); ! this.labelMinStdDev.Name = "labelMinStdDev"; ! this.labelMinStdDev.Size = new System.Drawing.Size(72, 14); ! this.labelMinStdDev.TabIndex = 35; ! this.labelMinStdDev.Text = "Min Std Dev"; ! this.labelMinStdDev.Visible = false; ! // ! // textBoxMinStdDev ! // ! this.textBoxMinStdDev.Location = new System.Drawing.Point(232, 149); ! this.textBoxMinStdDev.Name = "textBoxMinStdDev"; ! this.textBoxMinStdDev.Size = new System.Drawing.Size(56, 21); ! this.textBoxMinStdDev.TabIndex = 34; ! this.textBoxMinStdDev.Visible = false; ! // ! // labelMinPrice ! // ! this.labelMinPrice.Location = new System.Drawing.Point(16, 149); ! this.labelMinPrice.Name = "labelMinPrice"; ! this.labelMinPrice.Size = new System.Drawing.Size(56, 14); ! this.labelMinPrice.TabIndex = 31; ! this.labelMinPrice.Text = "Min Price"; ! this.labelMinPrice.Visible = false; ! // ! // textBoxMinPrice ! // ! this.textBoxMinPrice.Location = new System.Drawing.Point(72, 149); ! this.textBoxMinPrice.Name = "textBoxMinPrice"; ! this.textBoxMinPrice.Size = new System.Drawing.Size(56, 21); ! this.textBoxMinPrice.TabIndex = 30; ! this.textBoxMinPrice.Visible = false; ! // ! // labelMarketIndexKey ! // ! this.labelMarketIndexKey.Location = new System.Drawing.Point(13, 176); ! this.labelMarketIndexKey.Name = "labelMarketIndexKey"; ! this.labelMarketIndexKey.Size = new System.Drawing.Size(96, 16); ! this.labelMarketIndexKey.TabIndex = 29; ! this.labelMarketIndexKey.Text = "Market index key:"; ! this.labelMarketIndexKey.Visible = false; ! // ! // textBoxMarketIndex ! // ! this.textBoxMarketIndex.Location = new System.Drawing.Point(117, 176); ! this.textBoxMarketIndex.Name = "textBoxMarketIndex"; ! this.textBoxMarketIndex.Size = new System.Drawing.Size(56, 21); ! this.textBoxMarketIndex.TabIndex = 28; ! this.textBoxMarketIndex.Visible = false; ! // ! // checkBoxASCMode ! // ! this.checkBoxASCMode.Location = new System.Drawing.Point(11, 113); ! this.checkBoxASCMode.Name = "checkBoxASCMode"; ! this.checkBoxASCMode.Size = new System.Drawing.Size(152, 16); ! this.checkBoxASCMode.TabIndex = 27; ! this.checkBoxASCMode.Text = "Order by ASC mode"; ! // ! // label3 ! // ! this.label3.Location = new System.Drawing.Point(16, 68); ! this.label3.Name = "label3"; ! this.label3.Size = new System.Drawing.Size(120, 11); ! this.label3.TabIndex = 26; ! this.label3.Text = "Choose selection rule"; ! // ! // comboBoxAvailableSelectionRules ! // ! this.comboBoxAvailableSelectionRules.Location = new System.Drawing.Point(11, 87); ! this.comboBoxAvailableSelectionRules.Name = "comboBoxAvailableSelectionRules"; ! this.comboBoxAvailableSelectionRules.Size = new System.Drawing.Size(176, 21); ! this.comboBoxAvailableSelectionRules.TabIndex = 25; ! this.comboBoxAvailableSelectionRules.Text = "comboBox1"; ! this.comboBoxAvailableSelectionRules.SelectedValueChanged += new System.EventHandler(this.comboBoxAvailableSelectionRules_SelectedValueChanged); ! // ! // label2 ! // ! this.label2.Location = new System.Drawing.Point(160, 41); ! this.label2.Name = "label2"; ! this.label2.Size = new System.Drawing.Size(152, 16); ! this.label2.TabIndex = 24; ! this.label2.Text = "Max Num of returned tickers"; ! // ! // label1 ! // ! this.label1.Location = new System.Drawing.Point(8, 41); ! this.label1.Name = "label1"; ! this.label1.Size = new System.Drawing.Size(64, 21); ! this.label1.TabIndex = 22; ! this.label1.Text = "GroupID"; ! // ! // textBoxGroupID ! // ! this.textBoxGroupID.Location = new System.Drawing.Point(72, 41); ! this.textBoxGroupID.Name = "textBoxGroupID"; ! this.textBoxGroupID.Size = new System.Drawing.Size(88, 21); ! this.textBoxGroupID.TabIndex = 21; ! // ! // dateTimePickerLastDate ! // ! this.dateTimePickerLastDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; ! this.dateTimePickerLastDate.Location = new System.Drawing.Point(240, 16); ! this.dateTimePickerLastDate.Name = "dateTimePickerLastDate"; ! this.dateTimePickerLastDate.Size = new System.Drawing.Size(88, 21); ! this.dateTimePickerLastDate.TabIndex = 15; ! // ! // dateTimePickerFirstDate ! // ! this.dateTimePickerFirstDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; ! this.dateTimePickerFirstDate.Location = new System.Drawing.Point(72, 16); ! this.dateTimePickerFirstDate.Name = "dateTimePickerFirstDate"; ! this.dateTimePickerFirstDate.Size = new System.Drawing.Size(88, 21); ! this.dateTimePickerFirstDate.TabIndex = 13; ! // ! // buttonSelectTickers ! // ! this.buttonSelectTickers.Location = new System.Drawing.Point(148, 301); ! this.buttonSelectTickers.Name = "buttonSelectTickers"; ! this.buttonSelectTickers.Size = new System.Drawing.Size(104, 31); ! this.buttonSelectTickers.TabIndex = 3; ! this.buttonSelectTickers.Text = "Select Tickers"; ! this.buttonSelectTickers.Click += new System.EventHandler(this.buttonSelectTickers_Click); ! // ! // dataGrid1 ! // ! this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.None; ! this.dataGrid1.DataMember = ""; ! this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Left; ! this.dataGrid1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); ! this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; ! this.dataGrid1.Location = new System.Drawing.Point(0, 0); ! this.dataGrid1.Name = "dataGrid1"; ! this.dataGrid1.Size = new System.Drawing.Size(432, 478); ! this.dataGrid1.TabIndex = 2; ! // ! // TickerSelectorForm ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); ! this.ClientSize = new System.Drawing.Size(804, 478); ! this.Controls.Add(this.splitter1); ! this.Controls.Add(this.panel2); ! this.Controls.Add(this.dataGrid1); ! this.Name = "TickerSelectorForm"; ! this.Text = "Ticker Selector"; ! this.panel2.ResumeLayout(false); ! this.groupBoxSelectionRule.ResumeLayout(false); ! this.groupBoxSelectionRule.PerformLayout(); ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); ! this.ResumeLayout(false); } private System.Windows.Forms.Label labelTextBoxPopulationSize; --- 134,524 ---- /// </summary> private void InitializeComponent() { ! this.components = new System.ComponentModel.Container(); ! this.splitter1 = new System.Windows.Forms.Splitter(); ! this.textBoxMaxPrice = new System.Windows.Forms.TextBox(); ! this.labelMaxPrice = new System.Windows.Forms.Label(); ! this.label5 = new System.Windows.Forms.Label(); ! this.labelMaxStdDev = new System.Windows.Forms.Label(); ! this.label7 = new System.Windows.Forms.Label(); ! this.textBoxMaxNumOfReturnedTickers = new System.Windows.Forms.TextBox(); ! this.panel2 = new System.Windows.Forms.Panel(); ! this.groupBoxSelectionRule = new System.Windows.Forms.GroupBox(); ! this.labelTextBoxPopulationSize = new System.Windows.Forms.Label(); ! this.labelTextBoxGenerations = new System.Windows.Forms.Label(); ! this.textBoxGenerationsForGeneticOptimizer = new System.Windows.Forms.TextBox(); ! this.textBoxPopulationSizeForGeneticOptimizer = new System.Windows.Forms.TextBox(); ! this.checkBoxAddIndexToOutputTable = new System.Windows.Forms.CheckBox(); ! this.checkBoxOnlyWithAtLeastOneWinningDay = new System.Windows.Forms.CheckBox(); ! this.textBoxMaxStdDev = new System.Windows.Forms.TextBox(); ! this.labelMinStdDev = new System.Windows.Forms.Label(); ! this.textBoxMinStdDev = new System.Windows.Forms.TextBox(); ! this.labelMinPrice = new System.Windows.Forms.Label(); ! this.textBoxMinPrice = new System.Windows.Forms.TextBox(); ! this.labelMarketIndexKey = new System.Windows.Forms.Label(); ! this.textBoxMarketIndex = new System.Windows.Forms.TextBox(); ! this.checkBoxASCMode = new System.Windows.Forms.CheckBox(); ! this.label3 = new System.Windows.Forms.Label(); ! this.comboBoxAvailableSelectionRules = new System.Windows.Forms.ComboBox(); ! this.label2 = new System.Windows.Forms.Label(); ! this.label1 = new System.Windows.Forms.Label(); ! this.textBoxGroupID = new System.Windows.Forms.TextBox(); ! this.dateTimePickerLastDate = new System.Windows.Forms.DateTimePicker(); ! this.dateTimePickerFirstDate = new System.Windows.Forms.DateTimePicker(); ! this.buttonSelectTickers = new System.Windows.Forms.Button(); ! this.dataGrid1 = new System.Windows.Forms.DataGrid(); ! this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); ! this.textBoxMinVolume = new System.Windows.Forms.TextBox(); ! this.labelMinVolume = new System.Windows.Forms.Label(); ! this.panel2.SuspendLayout(); ! this.groupBoxSelectionRule.SuspendLayout(); ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); ! this.SuspendLayout(); ! // ! // splitter1 ! // ! this.splitter1.BackColor = System.Drawing.SystemColors.Highlight; ! this.splitter1.Location = new System.Drawing.Point(432, 0); ! this.splitter1.Name = "splitter1"; ! this.splitter1.Size = new System.Drawing.Size(3, 478); ! this.splitter1.TabIndex = 8; ! this.splitter1.TabStop = false; ! // ! // textBoxMaxPrice ! // ! this.textBoxMaxPrice.Location = new System.Drawing.Point(69, 202); ! this.textBoxMaxPrice.Name = "textBoxMaxPrice"; ! this.textBoxMaxPrice.Size = new System.Drawing.Size(56, 20); ! this.textBoxMaxPrice.TabIndex = 32; ! this.textBoxMaxPrice.Text = ""; ! this.textBoxMaxPrice.Visible = false; ! // ! // labelMaxPrice ! // ! this.labelMaxPrice.Location = new System.Drawing.Point(13, 202); ! this.labelMaxPrice.Name = "labelMaxPrice"; ! this.labelMaxPrice.Size = new System.Drawing.Size(56, 14); ! this.labelMaxPrice.TabIndex = 33; ! this.labelMaxPrice.Text = "Max Price"; ! this.labelMaxPrice.Visible = false; ! // ! // label5 ! // ! this.label5.Location = new System.Drawing.Point(8, 16); ! this.label5.Name = "label5"; ! this.label5.Size = new System.Drawing.Size(64, 21); ! this.label5.TabIndex = 18; ! this.label5.Text = "First Date"; ! // ! // labelMaxStdDev ! // ! this.labelMaxStdDev.Location = new System.Drawing.Point(149, 202); ! this.labelMaxStdDev.Name = "labelMaxStdDev"; ! this.labelMaxStdDev.Size = new System.Drawing.Size(80, 14); ! this.labelMaxStdDev.TabIndex = 37; ! this.labelMaxStdDev.Text = "Max Std Dev"; ! this.labelMaxStdDev.Visible = false; ! // ! // label7 ! // ! this.label7.Location = new System.Drawing.Point(168, 16); ! this.label7.Name = "label7"; ! this.label7.Size = new System.Drawing.Size(64, 21); ! this.label7.TabIndex = 20; ! this.label7.Text = "Last Date"; ! // ! // textBoxMaxNumOfReturnedTickers ! // ! this.textBoxMaxNumOfReturnedTickers.Location = new System.Drawing.Point(312, 41); ! this.textBoxMaxNumOfReturnedTickers.Name = "textBoxMaxNumOfReturnedTickers"; ! this.textBoxMaxNumOfReturnedTickers.Size = new System.Drawing.Size(48, 20); ! this.textBoxMaxNumOfReturnedTickers.TabIndex = 23; ! this.textBoxMaxNumOfReturnedTickers.Text = ""; ! // ! // panel2 ! // ! this.panel2.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.groupBoxSelectionRule, ! this.buttonSelectTickers}); ! this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; ! this.panel2.ForeColor = System.Drawing.SystemColors.ControlText; ! this.panel2.Location = new System.Drawing.Point(432, 0); ! this.panel2.Name = "panel2"; ! this.panel2.Size = new System.Drawing.Size(372, 478); ! this.panel2.TabIndex = 7; ! // ! // groupBoxSelectionRule ! // ! this.groupBoxSelectionRule.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.labelMinVolume, ! this.textBoxMinVolume, ! this.labelTextBoxPopulationSize, ! this.labelTextBoxGenerations, ! this.textBoxGenerationsForGeneticOptimizer, ! this.textBoxPopulationSizeForGeneticOptimizer, ! this.checkBoxAddIndexToOutputTable, ! this.checkBoxOnlyWithAtLeastOneWinningDay, ! this.labelMaxStdDev, ! this.textBoxMaxStdDev, ! this.labelMinStdDev, ! this.textBoxMinStdDev, ! this.labelMaxPrice, ! this.textBoxMaxPrice, ! this.labelMinPrice, ! this.textBoxMinPrice, ! this.labelMarketIndexKey, ! this.textBoxMarketIndex, ! this.checkBoxASCMode, ! this.label3, ! this.comboBoxAvailableSelectionRules, ! this.label2, ! this.textBoxMaxNumOfReturnedTickers, ! this.label1, ! this.textBoxGroupID, ! this.label7, ! this.label5, ! this.dateTimePickerLastDate, ! this.dateTimePickerFirstDate}); ! this.groupBoxSelectionRule.Location = new System.Drawing.Point(8, 10); ! this.groupBoxSelectionRule.Name = "groupBoxSelectionRule"; ! this.groupBoxSelectionRule.Size = new System.Drawing.Size(361, 272); ! this.groupBoxSelectionRule.TabIndex = 14; ! this.groupBoxSelectionRule.TabStop = false; ! this.groupBoxSelectionRule.Text = "Single Selection rule"; ! // ! // labelTextBoxPopulationSize ! // ! this.labelTextBoxPopulationSize.Location = new System.Drawing.Point(192, 227); ! this.labelTextBoxPopulationSize.Name = "labelTextBoxPopulationSize"; ! this.labelTextBoxPopulationSize.Size = new System.Drawing.Size(70, 14); ! this.labelTextBoxPopulationSize.TabIndex = 45; ! this.labelTextBoxPopulationSize.Text = "Pop. Size"; ! this.labelTextBoxPopulationSize.Visible = false; ! // ! // labelTextBoxGenerations ! // ! this.labelTextBoxGenerations.Location = new System.Drawing.Point(16, 227); ! this.labelTextBoxGenerations.Name = "labelTextBoxGenerations"; ! this.labelTextBoxGenerations.Size = new System.Drawing.Size(73, 15); ! this.labelTextBoxGenerations.TabIndex = 44; ! this.labelTextBoxGenerations.Text = "Generations"; ! this.labelTextBoxGenerations.Visible = false; ! // ! // textBoxGenerationsForGeneticOptimizer ! // ! this.textBoxGenerationsForGeneticOptimizer.Location = new System.Drawing.Point(117, 228); ! this.textBoxGenerationsForGeneticOptimizer.Name = "textBoxGenerationsForGeneticOptimizer"; ! this.textBoxGenerationsForGeneticOptimizer.Size = new System.Drawing.Size(56, 20); ! this.textBoxGenerationsForGeneticOptimizer.TabIndex = 43; ! this.textBoxGenerationsForGeneticOptimizer.Text = ""; ! this.textBoxGenerationsForGeneticOptimizer.Visible = false; ! // ! // textBoxPopulationSizeForGeneticOptimizer ! // ! this.textBoxPopulationSizeForGeneticOptimizer.Location = new System.Drawing.Point(269, 227); ! this.textBoxPopulationSizeForGeneticOptimizer.Name = "textBoxPopulationSizeForGeneticOptimizer"; ! this.textBoxPopulationSizeForGeneticOptimizer.Size = new System.Drawing.Size(56, 20); ! this.textBoxPopulationSizeForGeneticOptimizer.TabIndex = 42; ! this.textBoxPopulationSizeForGeneticOptimizer.Text = ""; ! this.textBoxPopulationSizeForGeneticOptimizer.Visible = false; ! // ! // checkBoxAddIndexToOutputTable ! // ! this.checkBoxAddIndexToOutputTable.Location = new System.Drawing.Point(11, 131); ! this.checkBoxAddIndexToOutputTable.Name = "checkBoxAddIndexToOutputTable"; ! this.checkBoxAddIndexToOutputTable.Size = new System.Drawing.Size(164, 15); ! this.checkBoxAddIndexToOutputTable.TabIndex = 41; ! this.checkBoxAddIndexToOutputTable.Text = "Add index to Output Table"; ! this.toolTip1.SetToolTip(this.checkBoxAddIndexToOutputTable, "Check if you want to filter only tickers with at least one winning day"); ! this.checkBoxAddIndexToOutputTable.Visible = false; ! // ! // checkBoxOnlyWithAtLeastOneWinningDay ! // ! this.checkBoxOnlyWithAtLeastOneWinningDay.Location = new System.Drawing.Point(195, 113); ! this.checkBoxOnlyWithAtLeastOneWinningDay.Name = "checkBoxOnlyWithAtLeastOneWinningDay"; ! this.checkBoxOnlyWithAtLeastOneWinningDay.Size = new System.Drawing.Size(152, 16); ! this.checkBoxOnlyWithAtLeastOneWinningDay.TabIndex = 38; ! this.checkBoxOnlyWithAtLeastOneWinningDay.Text = "Exclude \"pure\" losers"; ! this.toolTip1.SetToolTip(this.checkBoxOnlyWithAtLeastOneWinningDay, "Check if you want to filter only tickers with at least one winning day"); ! this.checkBoxOnlyWithAtLeastOneWinningDay.Visible = false; ! // ! // textBoxMaxStdDev ! // ! this.textBoxMaxStdDev.Location = new System.Drawing.Point(229, 202); ! this.textBoxMaxStdDev.Name = "textBoxMaxStdDev"; ! this.textBoxMaxStdDev.Size = new System.Drawing.Size(56, 20); ! this.textBoxMaxStdDev.TabIndex = 36; ! this.textBoxMaxStdDev.Text = ""; ! this.textBoxMaxStdDev.Visible = false; ! // ! // labelMinStdDev ! // ! this.labelMinStdDev.Location = new System.Drawing.Point(152, 149); ! this.labelMinStdDev.Name = "labelMinStdDev"; ! this.labelMinStdDev.Size = new System.Drawing.Size(72, 14); ! this.labelMinStdDev.TabIndex = 35; ! this.labelMinStdDev.Text = "Min Std Dev"; ! this.labelMinStdDev.Visible = false; ! // ! // textBoxMinStdDev ! // ! this.textBoxMinStdDev.Location = new System.Drawing.Point(232, 149); ! this.textBoxMinStdDev.Name = "textBoxMinStdDev"; ! this.textBoxMinStdDev.Size = new System.Drawing.Size(56, 20); ! this.textBoxMinStdDev.TabIndex = 34; ! this.textBoxMinStdDev.Text = ""; ! this.textBoxMinStdDev.Visible = false; ! // ! // labelMinPrice ! // ! this.labelMinPrice.Location = new System.Drawing.Point(16, 149); ! this.labelMinPrice.Name = "labelMinPrice"; ! this.labelMinPrice.Size = new System.Drawing.Size(56, 14); ! this.labelMinPrice.TabIndex = 31; ! this.labelMinPrice.Text = "Min Price"; ! this.labelMinPrice.Visible = false; ! // ! // textBoxMinPrice ! // ! this.textBoxMinPrice.Location = new System.Drawing.Point(72, 149); ! this.textBoxMinPrice.Name = "textBoxMinPrice"; ! this.textBoxMinPrice.Size = new System.Drawing.Size(56, 20); ! this.textBoxMinPrice.TabIndex = 30; ! this.textBoxMinPrice.Text = ""; ! this.textBoxMinPrice.Visible = false; ! // ! // labelMarketIndexKey ! // ! this.labelMarketIndexKey.Location = new System.Drawing.Point(13, 176); ! this.labelMarketIndexKey.Name = "labelMarketIndexKey"; ! this.labelMarketIndexKey.Size = new System.Drawing.Size(96, 16); ! this.labelMarketIndexKey.TabIndex = 29; ! this.labelMarketIndexKey.Text = "Market index key:"; ! this.labelMarketIndexKey.Visible = false; ! // ! // textBoxMarketIndex ! // ! this.textBoxMarketIndex.Location = new System.Drawing.Point(117, 176); ! this.textBoxMarketIndex.Name = "textBoxMarketIndex"; ! this.textBoxMarketIndex.Size = new System.Drawing.Size(56, 20); ! this.textBoxMarketIndex.TabIndex = 28; ! this.textBoxMarketIndex.Text = ""; ! this.textBoxMarketIndex.Visible = false; ! // ! // checkBoxASCMode ! // ! this.checkBoxASCMode.Location = new System.Drawing.Point(11, 113); ! this.checkBoxASCMode.Name = "checkBoxASCMode"; ! this.checkBoxASCMode.Size = new System.Drawing.Size(152, 16); ! this.checkBoxASCMode.TabIndex = 27; ! this.checkBoxASCMode.Text = "Order by ASC mode"; ! // ! // label3 ! // ! this.label3.Location = new System.Drawing.Point(16, 68); ! this.label3.Name = "label3"; ! this.label3.Size = new System.Drawing.Size(120, 11); ! this.label3.TabIndex = 26; ! this.label3.Text = "Choose selection rule"; ! // ! // comboBoxAvailableSelectionRules ! // ! this.comboBoxAvailableSelectionRules.Location = new System.Drawing.Point(11, 87); ! this.comboBoxAvailableSelectionRules.Name = "comboBoxAvailableSelectionRules"; ! this.comboBoxAvailableSelectionRules.Size = new System.Drawing.Size(176, 21); ! this.comboBoxAvailableSelectionRules.TabIndex = 25; ! this.comboBoxAvailableSelectionRules.Text = "comboBox1"; ! this.comboBoxAvailableSelectionRules.SelectedValueChanged += new System.EventHandler(this.comboBoxAvailableSelectionRules_SelectedValueChanged); ! // ! // label2 ! // ! this.label2.Location = new System.Drawing.Point(160, 45); ! this.label2.Name = "label2"; ! this.label2.Size = new System.Drawing.Size(152, 16); ! this.label2.TabIndex = 24; ! this.label2.Text = "Max Num of returned tickers"; ! // ! // label1 ! // ! this.label1.Location = new System.Drawing.Point(8, 41); ! this.label1.Name = "label1"; ! this.label1.Size = new System.Drawing.Size(64, 21); ! this.label1.TabIndex = 22; ! this.label1.Text = "GroupID"; ! // ! // textBoxGroupID ! // ! this.textBoxGroupID.Location = new System.Drawing.Point(72, 41); ! this.textBoxGroupID.Name = "textBoxGroupID"; ! this.textBoxGroupID.Size = new System.Drawing.Size(88, 20); ! this.textBoxGroupID.TabIndex = 21; ! this.textBoxGroupID.Text = ""; ! // ! // dateTimePickerLastDate ! // ! this.dateTimePickerLastDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; ! this.dateTimePickerLastDate.Location = new System.Drawing.Point(240, 16); ! this.dateTimePickerLastDate.Name = "dateTimePickerLastDate"; ! this.dateTimePickerLastDate.Size = new System.Drawing.Size(88, 20); ! this.dateTimePickerLastDate.TabIndex = 15; ! // ! // dateTimePickerFirstDate ! // ! this.dateTimePickerFirstDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; ! this.dateTimePickerFirstDate.Location = new System.Drawing.Point(72, 16); ! this.dateTimePickerFirstDate.Name = "dateTimePickerFirstDate"; ! this.dateTimePickerFirstDate.Size = new System.Drawing.Size(88, 20); ! this.dateTimePickerFirstDate.TabIndex = 13; ! // ! // buttonSelectTickers ! // ! this.buttonSelectTickers.Location = new System.Drawing.Point(148, 301); ! this.buttonSelectTickers.Name = "buttonSelectTickers"; ! this.buttonSelectTickers.Size = new System.Drawing.Size(104, 31); ! this.buttonSelectTickers.TabIndex = 3; ! this.buttonSelectTickers.Text = "Select Tickers"; ! this.buttonSelectTickers.Click += new System.EventHandler(this.buttonSelectTickers_Click); ! // ! // dataGrid1 ! // ! this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.None; ! this.dataGrid1.DataMember = ""; ! this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Left; ! this.dataGrid1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); ! this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; ! this.dataGrid1.Name = "dataGrid1"; ! this.dataGrid1.Size = new System.Drawing.Size(432, 478); ! this.dataGrid1.TabIndex = 2; ! // ! // textBoxMinVolume ! // ! this.textBoxMinVolume.Location = new System.Drawing.Point(264, 88); ! this.textBoxMinVolume.Name = "textBoxMinVolume"; ! this.textBoxMinVolume.Size = new System.Drawing.Size(80, 20); ! this.textBoxMinVolume.TabIndex = 46; ! this.textBoxMinVolume.Text = "0"; ! // ! // labelMinVolume ! // ! this.labelMinVolume.Location = new System.Drawing.Point(192, 92); ! this.labelMinVolume.Name = "labelMinVolume"; ! this.labelMinVolume.Size = new System.Drawing.Size(64, 16); ! this.labelMinVolume.TabIndex = 47; ! this.labelMinVolume.Text = "Min Volume"; ! // ! // TickerSelectorForm ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(804, 478); ! this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.splitter1, ! this.panel2, ! this.dataGrid1}); ! this.Name = "TickerSelectorForm"; ! this.Text = "Ticker Selector"; ! this.panel2.ResumeLayout(false); ! this.groupBoxSelectionRule.ResumeLayout(false); ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); ! this.ResumeLayout(false); ! } private System.Windows.Forms.Label labelTextBoxPopulationSize; *************** *** 535,542 **** private ITickerSelector getITickerSelector() { ! ITickerSelector returnValue = new SelectorByLiquidity(this.textBoxGroupID.Text, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text )); ! if(this.comboBoxAvailableSelectionRules.Text == "Liquidity") { --- 568,573 ---- private ITickerSelector getITickerSelector() { ! ITickerSelector returnValue = null; ! if(this.comboBoxAvailableSelectionRules.Text == "Liquidity") { *************** *** 544,552 **** returnValue = new SelectorByLiquidity(this.textBoxGroupID.Text, this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text )); else returnValue = new SelectorByLiquidity(this.tableOfSelectedTickers, this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); } else if (this.comboBoxAvailableSelectionRules.Text == "Performance") --- 575,587 ---- returnValue = new SelectorByLiquidity(this.textBoxGroupID.Text, this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, ! Int64.Parse(this.textBoxMinVolume.Text), ! Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text )); else returnValue = new SelectorByLiquidity(this.tableOfSelectedTickers, this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, ! Int64.Parse(this.textBoxMinVolume.Text), ! Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); } else if (this.comboBoxAvailableSelectionRules.Text == "Performance") *************** *** 786,790 **** this.textBoxGenerationsForGeneticOptimizer.Visible = showControls; } ! private void comboBoxAvailableSelectionRules_SelectedValueChanged(object sender, System.EventArgs e) { --- 821,830 ---- this.textBoxGenerationsForGeneticOptimizer.Visible = showControls; } ! private void setVisibilityForControls_ByLiquidity(bool showControls) ! { ! this.textBoxMinVolume.Visible = showControls; ! this.labelMinVolume.Visible = showControls; ! this.checkBoxASCMode.Enabled = true; ! } private void comboBoxAvailableSelectionRules_SelectedValueChanged(object sender, System.EventArgs e) { *************** *** 797,800 **** --- 837,841 ---- this.setVisibilityForControls_WinningOpenToClose(false); this.setVisibilityForControls_MaxLinearIndipendence(false); + this.setVisibilityForControls_ByLiquidity(false); this.setVisibilityForControls_QuotedAtEachMarketDay(true); } *************** *** 806,809 **** --- 847,851 ---- this.setVisibilityForControls_WinningOpenToClose(false); this.setVisibilityForControls_MaxLinearIndipendence(false); + this.setVisibilityForControls_ByLiquidity(false); this.setVisibilityForControls_AverageRawOpenPrice(true); } *************** *** 815,818 **** --- 857,861 ---- this.setVisibilityForControls_AverageRawOpenPrice(false); this.setVisibilityForControls_MaxLinearIndipendence(false); + this.setVisibilityForControls_ByLiquidity(false); this.setVisibilityForControls_WinningOpenToClose(true); } *************** *** 823,826 **** --- 866,870 ---- this.setVisibilityForControls_WinningOpenToClose(false); this.setVisibilityForControls_MaxLinearIndipendence(false); + this.setVisibilityForControls_ByLiquidity(false); this.setVisibilityForControls_CloseToCloseCorrelationToBenchmark(true); } *************** *** 831,836 **** --- 875,890 ---- this.setVisibilityForControls_WinningOpenToClose(false); this.setVisibilityForControls_CloseToCloseCorrelationToBenchmark(false); + this.setVisibilityForControls_ByLiquidity(false); this.setVisibilityForControls_MaxLinearIndipendence(true); } + else if(this.comboBoxAvailableSelectionRules.Text == "Liquidity") + { + this.setVisibilityForControls_AverageRawOpenPrice(false); + this.setVisibilityForControls_WinningOpenToClose(false); + this.setVisibilityForControls_CloseToCloseCorrelationToBenchmark(false); + this.setVisibilityForControls_MaxLinearIndipendence(false); + this.setVisibilityForControls_QuotedAtEachMarketDay(false); + this.setVisibilityForControls_ByLiquidity(true); + } else { *************** *** 840,844 **** this.setVisibilityForControls_CloseToCloseCorrelationToBenchmark(false); this.setVisibilityForControls_MaxLinearIndipendence(false); ! this.setVisibilityForControls_QuotedAtEachMarketDay(true); this.checkBoxASCMode.Enabled = true; } --- 894,899 ---- this.setVisibilityForControls_CloseToCloseCorrelationToBenchmark(false); this.setVisibilityForControls_MaxLinearIndipendence(false); ! this.setVisibilityForControls_QuotedAtEachMarketDay(false); ! this.setVisibilityForControls_ByLiquidity(false); this.checkBoxASCMode.Enabled = true; } |
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3064/b7_Scripts/TickerSelectionTesting Modified Files: GenomeManagerForEfficientOTCCTOPortfolio.cs EndOfDayTimerHandlerOTCMultiday.cs EndOfDayTimerHandlerOTCMultiAccount.cs EndOfDayTimerHandlerOTCCTO.cs EndOfDayTimerHandlerOTC.cs EndOfDayTimerHandlerLastChosenPortfolio.cs EndOfDayTimerHandlerCTOMultiAccount.cs EndOfDayTimerHandlerCTO.cs EndOfDayTimerHandlerCTCWeekly.cs EndOfDayTimerHandlerCTC.cs Log Message: Minor changes: -formatting changes; -changes in parameters. Index: EndOfDayTimerHandlerLastChosenPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerLastChosenPortfolio.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EndOfDayTimerHandlerLastChosenPortfolio.cs 25 Jun 2005 09:50:44 -0000 1.2 --- EndOfDayTimerHandlerLastChosenPortfolio.cs 17 Sep 2006 21:48:39 -0000 1.3 *************** *** 71,75 **** if(endOfDayTimingEventArgs.EndOfDayDateTime.CompareTo(this.firstDate) == 0) { ! this.openPositions(); } } --- 71,75 ---- if(endOfDayTimingEventArgs.EndOfDayDateTime.CompareTo(this.firstDate) == 0) { ! this.openPositions(this.chosenTickers); } } Index: EndOfDayTimerHandlerOTCCTO.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerOTCCTO.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** EndOfDayTimerHandlerOTCCTO.cs 3 Aug 2006 21:31:15 -0000 1.5 --- EndOfDayTimerHandlerOTCCTO.cs 17 Sep 2006 21:48:39 -0000 1.6 *************** *** 78,82 **** //if(this.numDaysElapsedSinceLastOptimization == 0) this.closePositions(); ! this.openPositions(); } private void reverseSignOfChosenTickers() --- 78,82 ---- //if(this.numDaysElapsedSinceLastOptimization == 0) this.closePositions(); ! this.openPositions(this.chosenTickers); } private void reverseSignOfChosenTickers() *************** *** 105,109 **** this.orders.Clear(); this.reverseSignOfChosenTickers(); ! this.openPositions(); this.reverseSignOfChosenTickers(); } --- 105,109 ---- this.orders.Clear(); this.reverseSignOfChosenTickers(); ! this.openPositions(this.chosenTickers); this.reverseSignOfChosenTickers(); } Index: EndOfDayTimerHandlerOTCMultiday.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerOTCMultiday.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EndOfDayTimerHandlerOTCMultiday.cs 7 Aug 2006 21:09:15 -0000 1.6 --- EndOfDayTimerHandlerOTCMultiday.cs 17 Sep 2006 21:48:39 -0000 1.7 *************** *** 77,81 **** if(this.numDaysElapsedSinceLastOptimization == 0) ! this.openPositions(); } --- 77,81 ---- if(this.numDaysElapsedSinceLastOptimization == 0) ! this.openPositions(this.chosenTickers); } Index: EndOfDayTimerHandlerCTOMultiAccount.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerCTOMultiAccount.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EndOfDayTimerHandlerCTOMultiAccount.cs 27 Sep 2005 22:29:58 -0000 1.1 --- EndOfDayTimerHandlerCTOMultiAccount.cs 17 Sep 2006 21:48:39 -0000 1.2 *************** *** 98,102 **** } ! protected override void addChosenTickersToOrderList() { for(int i = 0; i<this.accounts.Length; i++) --- 98,102 ---- } ! protected override void addChosenTickersToOrderList(string[] tickers) { for(int i = 0; i<this.accounts.Length; i++) Index: EndOfDayTimerHandlerCTO.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerCTO.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** EndOfDayTimerHandlerCTO.cs 3 Aug 2006 21:31:15 -0000 1.24 --- EndOfDayTimerHandlerCTO.cs 17 Sep 2006 21:48:39 -0000 1.25 *************** *** 88,92 **** // this.numDaysBetweenEachOptimization - 1) // { ! this.openPositions(); // } } --- 88,92 ---- // this.numDaysBetweenEachOptimization - 1) // { ! this.openPositions(this.chosenTickers); // } } Index: EndOfDayTimerHandlerCTC.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerCTC.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** EndOfDayTimerHandlerCTC.cs 3 Aug 2006 21:31:15 -0000 1.21 --- EndOfDayTimerHandlerCTC.cs 17 Sep 2006 21:48:39 -0000 1.22 *************** *** 132,136 **** this.Account.Transactions.Count <= 1) { ! this.openPositions(); this.daysCounterWithNoPositions = 0; } --- 132,136 ---- this.Account.Transactions.Count <= 1) { ! this.openPositions(this.chosenTickers); this.daysCounterWithNoPositions = 0; } Index: GenomeManagerForEfficientOTCCTOPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/GenomeManagerForEfficientOTCCTOPortfolio.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenomeManagerForEfficientOTCCTOPortfolio.cs 2 Jul 2006 19:18:08 -0000 1.1 --- GenomeManagerForEfficientOTCCTOPortfolio.cs 17 Sep 2006 21:48:39 -0000 1.2 *************** *** 38,42 **** /// </summary> [Serializable] ! public class GenomeManagerForEfficientOTCCTOPortfolio : GenomeManagerForWeightedEfficientPortfolio { --- 38,42 ---- /// </summary> [Serializable] ! public class GenomeManagerForEfficientOTCCTOPortfolio : GenomeManagerForEfficientPortfolio { *************** *** 86,91 **** protected override double getFitnessValue_calculate() { ! //return this.RateOfReturn/Math.Sqrt(this.Variance); ! return AdvancedFunctions.GetExpectancyScore(this.PortfolioRatesOfReturn); } --- 86,91 ---- protected override double getFitnessValue_calculate() { ! return this.RateOfReturn/Math.Sqrt(this.Variance); ! //return AdvancedFunctions.GetExpectancyScore(this.PortfolioRatesOfReturn); } Index: EndOfDayTimerHandlerCTCWeekly.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerCTCWeekly.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** EndOfDayTimerHandlerCTCWeekly.cs 8 Nov 2005 18:36:48 -0000 1.5 --- EndOfDayTimerHandlerCTCWeekly.cs 17 Sep 2006 21:48:39 -0000 1.6 *************** *** 100,104 **** if(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime.DayOfWeek == DayOfWeek.Monday) ! this.openPositions(); if(this.stopLossConditionReached || --- 100,104 ---- if(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime.DayOfWeek == DayOfWeek.Monday) ! this.openPositions(this.chosenTickers); if(this.stopLossConditionReached || Index: EndOfDayTimerHandlerOTCMultiAccount.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerOTCMultiAccount.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EndOfDayTimerHandlerOTCMultiAccount.cs 7 Jan 2006 10:35:39 -0000 1.1 --- EndOfDayTimerHandlerOTCMultiAccount.cs 17 Sep 2006 21:48:39 -0000 1.2 *************** *** 98,102 **** } ! protected override void addChosenTickersToOrderList() { for(int i = 0; i<this.accounts.Length; i++) --- 98,102 ---- } ! protected override void addChosenTickersToOrderList(string[] tickers) { for(int i = 0; i<this.accounts.Length; i++) *************** *** 116,120 **** ! protected override void openPositions() { //add cash first --- 116,120 ---- ! protected override void openPositions(string[] tickers) { //add cash first *************** *** 125,129 **** } ! this.addChosenTickersToOrderList(); //execute orders actually for(int i = 0; i<this.accounts.Length; i++) --- 125,129 ---- } ! this.addChosenTickersToOrderList(tickers); //execute orders actually for(int i = 0; i<this.accounts.Length; i++) *************** *** 168,172 **** //temporarily the if condition //if(this.numDaysElapsedSinceLastOptimization == 0) ! this.openPositions(); } --- 168,172 ---- //temporarily the if condition //if(this.numDaysElapsedSinceLastOptimization == 0) ! this.openPositions(this.chosenTickers); } Index: EndOfDayTimerHandlerOTC.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerOTC.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EndOfDayTimerHandlerOTC.cs 3 Aug 2006 21:31:15 -0000 1.4 --- EndOfDayTimerHandlerOTC.cs 17 Sep 2006 21:48:39 -0000 1.5 *************** *** 126,130 **** if(allTickerHasBeenChosen && this.marketOpenEventHandler_currCombinationHasLost()) ! this.openPositions(); } --- 126,130 ---- if(allTickerHasBeenChosen && this.marketOpenEventHandler_currCombinationHasLost()) ! this.openPositions(this.chosenTickers); } |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:48:45
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/ExtremeCounterTrend In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3064/b7_Scripts/TechnicalAnalysisTesting/Oscillators/ExtremeCounterTrend Modified Files: GenomeManagerECT.cs EndOfDayTimerHandlerECT.cs Log Message: Minor changes: -formatting changes; -changes in parameters. Index: EndOfDayTimerHandlerECT.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/ExtremeCounterTrend/EndOfDayTimerHandlerECT.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EndOfDayTimerHandlerECT.cs 7 Aug 2006 21:09:15 -0000 1.4 --- EndOfDayTimerHandlerECT.cs 17 Sep 2006 21:48:39 -0000 1.5 *************** *** 139,143 **** { if(lastHalfPeriodGain < 0.0) ! base.openPositions(); else if (lastHalfPeriodGain > 0.0 && this.portfolioType == PortfolioType.ShortAndLong) --- 139,143 ---- { if(lastHalfPeriodGain < 0.0) ! base.openPositions(this.chosenTickers); else if (lastHalfPeriodGain > 0.0 && this.portfolioType == PortfolioType.ShortAndLong) *************** *** 146,150 **** //short the portfolio try{ ! base.openPositions(); } catch(Exception ex) --- 146,150 ---- //short the portfolio try{ ! base.openPositions(this.chosenTickers); } catch(Exception ex) *************** *** 197,216 **** int numOfTickersInGroupAtCurrentDate = tickersFromGroup.Rows.Count; ! // SelectorByAverageRawOpenPrice byPrice = ! // new SelectorByAverageRawOpenPrice(tickersFromGroup,false,currentDate, ! // currentDate.AddDays(-30), ! // numOfTickersInGroupAtCurrentDate, ! // 30,500, 0.0001,100); ! // SelectorByLiquidity mostLiquidSelector = ! // new SelectorByLiquidity(byPrice.GetTableOfSelectedTickers(), ! // false,currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, ! // this.numberOfEligibleTickers); // SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromByPrice = SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromGroup = ! new SelectorByQuotationAtEachMarketDay(tickersFromGroup, false, currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, ! numOfTickersInGroupAtCurrentDate, this.benchmark); // SelectorByCloseToCloseVolatility lessVolatile = --- 197,216 ---- int numOfTickersInGroupAtCurrentDate = tickersFromGroup.Rows.Count; ! SelectorByAverageRawOpenPrice byPrice = ! new SelectorByAverageRawOpenPrice(tickersFromGroup,false,currentDate, ! currentDate.AddDays(-30), ! numOfTickersInGroupAtCurrentDate, ! 20,500, 0.0001,100); ! SelectorByLiquidity mostLiquidSelector = ! new SelectorByLiquidity(byPrice.GetTableOfSelectedTickers() , ! false,currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, ! this.numberOfEligibleTickers); // SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromByPrice = SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromGroup = ! new SelectorByQuotationAtEachMarketDay(mostLiquidSelector.GetTableOfSelectedTickers(), false, currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, ! this.numberOfEligibleTickers, this.benchmark); // SelectorByCloseToCloseVolatility lessVolatile = *************** *** 268,279 **** this.generationNumberForGeneticOptimizer, this.seedForRandomGenerator); ! GO.CrossoverRate = 0.50; if(setGenomeCounter) this.genomeCounter = new GenomeCounter(GO); ! GO.Run(false); this.addGenomeToBestGenomes(GO.BestGenome,((GenomeManagerForEfficientPortfolio)this.iGenomeManager).FirstQuoteDate, ((GenomeManagerForEfficientPortfolio)this.iGenomeManager).LastQuoteDate, setOfTickersToBeOptimized.Rows.Count, ! this.numDaysForReturnCalculation, this.portfolioType); this.chosenTickers = ((GenomeMeaning)GO.BestGenome.Meaning).Tickers; this.chosenTickersPortfolioWeights = ((GenomeMeaning)GO.BestGenome.Meaning).TickersPortfolioWeights; --- 268,284 ---- this.generationNumberForGeneticOptimizer, this.seedForRandomGenerator); ! if(setGenomeCounter) this.genomeCounter = new GenomeCounter(GO); ! // GO.ElitismRate = 0.00; ! GO.MutationRate = 0.3; ! GO.CrossoverRate = 0.9; ! // GO.MinConvergenceRate = 0.75; ! // GO.KeepOnRunningUntilConvergenceIsReached = true; ! //GO.CrossoverRate = 0.5; GO.Run(false); this.addGenomeToBestGenomes(GO.BestGenome,((GenomeManagerForEfficientPortfolio)this.iGenomeManager).FirstQuoteDate, ((GenomeManagerForEfficientPortfolio)this.iGenomeManager).LastQuoteDate, setOfTickersToBeOptimized.Rows.Count, ! this.numDaysForReturnCalculation, this.portfolioType, GO.GenerationCounter); this.chosenTickers = ((GenomeMeaning)GO.BestGenome.Meaning).Tickers; this.chosenTickersPortfolioWeights = ((GenomeMeaning)GO.BestGenome.Meaning).TickersPortfolioWeights; *************** *** 300,304 **** //it is the first close (OLD IMPLEMENTATION) { ! this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime, false); //sets tickers to be chosen next Market Close event this.numDaysElapsedSinceLastOptimization = 0; --- 305,309 ---- //it is the first close (OLD IMPLEMENTATION) { ! this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime, true); //sets tickers to be chosen next Market Close event this.numDaysElapsedSinceLastOptimization = 0; Index: GenomeManagerECT.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/ExtremeCounterTrend/GenomeManagerECT.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GenomeManagerECT.cs 7 Aug 2006 21:03:24 -0000 1.3 --- GenomeManagerECT.cs 17 Sep 2006 21:48:39 -0000 1.4 *************** *** 68,71 **** --- 68,73 ---- returnValue = ExtendedDataTable.GetArrayOfFloatFromColumn(tickerQuotes, Quotes.AdjustedCloseToCloseRatio); + + for(int i = 0; i<returnValue.Length; i++) returnValue[i] = returnValue[i] - 1.0f; *************** *** 121,149 **** { double[] returnValue = new double[this.PortfolioRatesOfReturn.Length]; ! double gainForTheLastHalfPeriod = 0.0; for(int i = this.numDaysForReturnCalculation - 1; i<this.PortfolioRatesOfReturn.Length - this.numDaysForReturnCalculation; i += this.numDaysForReturnCalculation) { ! gainForTheLastHalfPeriod = 0.0; for(int j=this.numDaysForReturnCalculation - 1; j > -1; j--) { ! gainForTheLastHalfPeriod = ! (1.0+gainForTheLastHalfPeriod) * this.PortfolioRatesOfReturn[i-j]; } ! for(int t=1;t<this.numDaysForReturnCalculation + 1;t++) { ! if(gainForTheLastHalfPeriod < 0.0) // if gain of first half period is negative returnValue[i+t] = this.PortfolioRatesOfReturn[i+t]; ! else if(gainForTheLastHalfPeriod > 0.0 && ! this.PortfolioType == PortfolioType.ShortAndLong) //if gain of first half period is positive and //original positions can be reversed returnValue[i+t] = - this.PortfolioRatesOfReturn[i+t]; ! else if(gainForTheLastHalfPeriod > 0.0 && ! this.PortfolioType != PortfolioType.ShortAndLong) //if gain of first half period is positive and //original positions can't be reversed --- 123,148 ---- { double[] returnValue = new double[this.PortfolioRatesOfReturn.Length]; ! double K;//initial capital invested at the beginning of the period for(int i = this.numDaysForReturnCalculation - 1; i<this.PortfolioRatesOfReturn.Length - this.numDaysForReturnCalculation; i += this.numDaysForReturnCalculation) { ! K = 1.0; for(int j=this.numDaysForReturnCalculation - 1; j > -1; j--) { ! K = K + K * this.PortfolioRatesOfReturn[i-j]; } ! for(int t=1;t<this.numDaysForReturnCalculation + 1;t++) { ! if(K < 1.0) // if gain of first half period is negative returnValue[i+t] = this.PortfolioRatesOfReturn[i+t]; ! else if(K > 1.0 && this.PortfolioType == PortfolioType.ShortAndLong) //if gain of first half period is positive and //original positions can be reversed returnValue[i+t] = - this.PortfolioRatesOfReturn[i+t]; ! else if(K > 1.0 && this.PortfolioType != PortfolioType.ShortAndLong) //if gain of first half period is positive and //original positions can't be reversed |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:48:44
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/TrendFollowing/ImmediateTrendFollower In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3064/b7_Scripts/TechnicalAnalysisTesting/TrendFollowing/ImmediateTrendFollower Modified Files: GenomeManagerITF.cs EndOfDayTimerHandlerITF.cs Log Message: Minor changes: -formatting changes; -changes in parameters. Index: GenomeManagerITF.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/TrendFollowing/ImmediateTrendFollower/GenomeManagerITF.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenomeManagerITF.cs 3 Aug 2006 21:14:13 -0000 1.1 --- GenomeManagerITF.cs 17 Sep 2006 21:48:39 -0000 1.2 *************** *** 90,116 **** private double[] getFitnessValue_getEquityLineRates() { ! double[] returnValue = new double[this.PortfolioRatesOfReturn.Length]; ! double gainForTheLastHalfPeriod = 0.0; for(int i = this.numDaysForReturnCalculation - 1; ! i<this.PortfolioRatesOfReturn.Length - this.numDaysForReturnCalculation; ! i += this.numDaysForReturnCalculation) { ! gainForTheLastHalfPeriod = 0.0; for(int j=this.numDaysForReturnCalculation - 1; ! j > -1; j--) { ! gainForTheLastHalfPeriod = ! (1.0+gainForTheLastHalfPeriod) * this.PortfolioRatesOfReturn[i-j]; } ! for(int t=1;t<this.numDaysForReturnCalculation + 1;t++) { ! if(gainForTheLastHalfPeriod<0.0) ! // if gain of first half period is negative ! returnValue[i+t] = - this.PortfolioRatesOfReturn[i+t]; ! //return of the next half period is still negative ! else// if gain of first half period is positive ! returnValue[i+t] = this.PortfolioRatesOfReturn[i+t]; ! //return of the next half period is still positive } --- 90,119 ---- private double[] getFitnessValue_getEquityLineRates() { ! double[] returnValue = new double[this.PortfolioRatesOfReturn.Length]; ! double K;//initial capital invested at the beginning of the period for(int i = this.numDaysForReturnCalculation - 1; ! i<this.PortfolioRatesOfReturn.Length - this.numDaysForReturnCalculation; ! i += this.numDaysForReturnCalculation) { ! K = 1.0; for(int j=this.numDaysForReturnCalculation - 1; ! j > -1; j--) { ! K = K + K * this.PortfolioRatesOfReturn[i-j]; } ! for(int t=1;t<this.numDaysForReturnCalculation + 1;t++) { ! if(K < 1.0 && this.PortfolioType == PortfolioType.ShortAndLong) ! // if gain of first half period is negative and ! //positions can be reversed ! returnValue[i+t] = - this.PortfolioRatesOfReturn[i+t]; ! else if(K > 1.0) ! //if gain of first half period is positive ! returnValue[i+t] = this.PortfolioRatesOfReturn[i+t]; ! else if(K < 1.0 && this.PortfolioType != PortfolioType.ShortAndLong) ! //if gain of first half period is negative and ! //original positions can't be reversed ! returnValue[i+t] = 0.0;//out of the market } Index: EndOfDayTimerHandlerITF.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/TrendFollowing/ImmediateTrendFollower/EndOfDayTimerHandlerITF.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EndOfDayTimerHandlerITF.cs 7 Aug 2006 21:09:15 -0000 1.2 --- EndOfDayTimerHandlerITF.cs 17 Sep 2006 21:48:39 -0000 1.3 *************** *** 132,136 **** { if(lastHalfPeriodGain > 0.0) ! base.openPositions(); else//the last HalfPeriodGain has been negative { --- 132,136 ---- { if(lastHalfPeriodGain > 0.0) ! base.openPositions(this.chosenTickers); else//the last HalfPeriodGain has been negative { *************** *** 138,142 **** //short the portfolio try{ ! base.openPositions(); } catch(Exception ex) --- 138,142 ---- //short the portfolio try{ ! base.openPositions(this.chosenTickers); } catch(Exception ex) |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:48:44
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/TestingOTCTypes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3064/b7_Scripts/TickerSelectionTesting/TestingOTCTypes Modified Files: RunEfficientOTCTypes.cs EndOfDayTimerHandlerOTCTypes.cs Log Message: Minor changes: -formatting changes; -changes in parameters. Index: RunEfficientOTCTypes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/TestingOTCTypes/RunEfficientOTCTypes.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RunEfficientOTCTypes.cs 7 Aug 2006 21:21:20 -0000 1.5 --- RunEfficientOTCTypes.cs 17 Sep 2006 21:48:39 -0000 1.6 *************** *** 72,76 **** portfolioType, maxRunningHours) { ! this.ScriptName = "OTC_Types_ExpScoreWithCoeffAndPriceSelection"; this.numDaysBetweenEachOptimization = numDaysBetweenEachOptimization; this.accounts = new Account[4]; --- 72,76 ---- portfolioType, maxRunningHours) { ! this.ScriptName = "OTCTypes_SR_NoCoeffPriceSel"; this.numDaysBetweenEachOptimization = numDaysBetweenEachOptimization; this.accounts = new Account[4]; Index: EndOfDayTimerHandlerOTCTypes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/TestingOTCTypes/EndOfDayTimerHandlerOTCTypes.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EndOfDayTimerHandlerOTCTypes.cs 3 Aug 2006 21:31:15 -0000 1.4 --- EndOfDayTimerHandlerOTCTypes.cs 17 Sep 2006 21:48:39 -0000 1.5 *************** *** 222,226 **** currentDate.AddDays(-30), tickersFromGroup.Rows.Count, ! 30,500, 0.0001,100); --- 222,226 ---- currentDate.AddDays(-30), tickersFromGroup.Rows.Count, ! 20,500, 0.0001,100); *************** *** 262,269 **** if(setGenomeCounter) this.genomeCounter = new GenomeCounter(GO); ! GO.Run(false); this.addGenomeToBestGenomes(GO.BestGenome,currentDate.AddDays(-this.numDaysForOptimizationPeriod), ! currentDate,setOfTickersToBeOptimized.Rows.Count); this.chosenTickers = ((GenomeMeaning)GO.BestGenome.Meaning).Tickers; this.chosenTickersPortfolioWeights = ((GenomeMeaning)GO.BestGenome.Meaning).TickersPortfolioWeights; --- 262,271 ---- if(setGenomeCounter) this.genomeCounter = new GenomeCounter(GO); ! GO.MutationRate = 0.2; ! GO.CrossoverRate = 0.95; GO.Run(false); this.addGenomeToBestGenomes(GO.BestGenome,currentDate.AddDays(-this.numDaysForOptimizationPeriod), ! currentDate,setOfTickersToBeOptimized.Rows.Count,-1, this.portfolioType, ! GO.GenerationCounter); this.chosenTickers = ((GenomeMeaning)GO.BestGenome.Meaning).Tickers; this.chosenTickersPortfolioWeights = ((GenomeMeaning)GO.BestGenome.Meaning).TickersPortfolioWeights; |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:48:44
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedPeriodOscillators In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3064/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedPeriodOscillators Modified Files: EndOfDayTimerHandlerFPOscillatorCTC.cs Log Message: Minor changes: -formatting changes; -changes in parameters. Index: EndOfDayTimerHandlerFPOscillatorCTC.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedPeriodOscillators/EndOfDayTimerHandlerFPOscillatorCTC.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EndOfDayTimerHandlerFPOscillatorCTC.cs 7 Aug 2006 21:09:15 -0000 1.3 --- EndOfDayTimerHandlerFPOscillatorCTC.cs 17 Sep 2006 21:48:39 -0000 1.4 *************** *** 158,162 **** { if(this.marketCloseEventHandler_openPositionsIfTuned_isTuned(timer)) ! base.openPositions(); } --- 158,162 ---- { if(this.marketCloseEventHandler_openPositionsIfTuned_isTuned(timer)) ! base.openPositions(this.chosenTickers); } |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:45:36
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1851/b7_Scripts/TickerSelectionTesting Modified Files: GenomeMeaning.cs Log Message: Just formatting changes. Index: GenomeMeaning.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/GenomeMeaning.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GenomeMeaning.cs 8 Nov 2005 18:28:30 -0000 1.2 --- GenomeMeaning.cs 17 Sep 2006 21:45:33 -0000 1.3 *************** *** 31,34 **** --- 31,35 ---- public class GenomeMeaning { + private string[] tickers; private double[] tickersPortfolioWeights; |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:44:07
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1049/b7_Scripts/TickerSelectionTesting Modified Files: EndOfDayTimerHandler.cs Log Message: Added a protected method "reversePosition", for reversing existing positions. Other minor changes, too. Index: EndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandler.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** EndOfDayTimerHandler.cs 7 Aug 2006 21:09:15 -0000 1.22 --- EndOfDayTimerHandler.cs 17 Sep 2006 21:44:04 -0000 1.23 *************** *** 33,36 **** --- 33,37 ---- using QuantProject.Data.DataTables; using QuantProject.ADT.Optimizing.Genetic; + using QuantProject.ADT.Optimizing.BruteForce; using QuantProject.Scripts.WalkForwardTesting.LinearCombination; *************** *** 46,49 **** --- 47,51 ---- protected DataTable eligibleTickers; protected string[] chosenTickers; + protected string[] reversedTickersForOpenedPositions; protected double[] chosenTickersPortfolioWeights; protected string[] lastOrderedTickers; *************** *** 179,186 **** } ! protected virtual void addOrderForTicker(int tickerPosition ) { string tickerCode = ! GenomeManagerForEfficientPortfolio.GetCleanTickerCode(this.chosenTickers[tickerPosition]); double cashForSinglePosition = this.account.CashAmount * this.chosenTickersPortfolioWeights[tickerPosition]; --- 181,189 ---- } ! protected virtual void addOrderForTicker(string[] tickers, ! int tickerPosition ) { string tickerCode = ! GenomeManagerForEfficientPortfolio.GetCleanTickerCode(tickers[tickerPosition]); double cashForSinglePosition = this.account.CashAmount * this.chosenTickersPortfolioWeights[tickerPosition]; *************** *** 190,194 **** if(this.portfolioType == PortfolioType.OnlyShort || (this.portfolioType == PortfolioType.ShortAndLong && ! this.chosenTickers[tickerPosition] != tickerCode)) order = new Order( OrderType.MarketSellShort, new Instrument( tickerCode ) , quantity ); else --- 193,197 ---- if(this.portfolioType == PortfolioType.OnlyShort || (this.portfolioType == PortfolioType.ShortAndLong && ! tickers[tickerPosition] != tickerCode)) order = new Order( OrderType.MarketSellShort, new Instrument( tickerCode ) , quantity ); else *************** *** 222,243 **** } ! protected virtual void addChosenTickersToOrderList() { ! for( int i = 0; i<this.chosenTickers.Length; i++) { ! if(this.chosenTickers[i] != null) { ! this.addOrderForTicker( i ); this.lastOrderedTickers[i] = ! GenomeManagerForEfficientPortfolio.GetCleanTickerCode(this.chosenTickers[i]); } } } ! protected bool openPositions_allChosenTickersQuotedAtCurrentDate() { bool returnValue = true; DateTime currentDate = this.Account.EndOfDayTimer.GetCurrentTime().DateTime; ! foreach(string ticker in this.chosenTickers) { if(ticker != null) --- 225,246 ---- } ! protected virtual void addChosenTickersToOrderList(string[] tickers) { ! for( int i = 0; i<tickers.Length; i++) { ! if(tickers[i] != null) { ! this.addOrderForTicker( tickers, i ); this.lastOrderedTickers[i] = ! GenomeManagerForEfficientPortfolio.GetCleanTickerCode(tickers[i]); } } } ! protected bool openPositions_allTickersToOpenQuotedAtCurrentDate(string[] tickers) { bool returnValue = true; DateTime currentDate = this.Account.EndOfDayTimer.GetCurrentTime().DateTime; ! foreach(string ticker in tickers) { if(ticker != null) *************** *** 253,265 **** } ! protected virtual void openPositions() { //add cash first if(this.orders.Count == 0 && this.account.Transactions.Count == 0) this.account.AddCash(30000); ! if(this.openPositions_allChosenTickersQuotedAtCurrentDate()) //all tickers have quotes at the current date, so orders can be filled { ! this.addChosenTickersToOrderList(); //execute orders actually foreach(object item in this.orders) --- 256,268 ---- } ! protected virtual void openPositions(string[] tickers) { //add cash first if(this.orders.Count == 0 && this.account.Transactions.Count == 0) this.account.AddCash(30000); ! if(this.openPositions_allTickersToOpenQuotedAtCurrentDate(tickers)) //all tickers have quotes at the current date, so orders can be filled { ! this.addChosenTickersToOrderList(tickers); //execute orders actually foreach(object item in this.orders) *************** *** 283,286 **** --- 286,305 ---- } + protected void addGenomeToBestGenomes(BruteForceOptimizableParameters BFOptimizableParameters, + string[] signedTickers, + DateTime firstOptimizationDate, + DateTime secondOptimizationDate, + int eligibleTickers) + { + if(this.bestGenomes == null) + this.bestGenomes = new ArrayList(); + + this.bestGenomes.Add(new GenomeRepresentation(BFOptimizableParameters, + signedTickers, + firstOptimizationDate, + secondOptimizationDate, + eligibleTickers) ); + } + protected void addGenomeToBestGenomes(Genome genome, DateTime firstOptimizationDate, *************** *** 316,319 **** --- 335,356 ---- } + protected void addGenomeToBestGenomes(Genome genome, + DateTime firstOptimizationDate, + DateTime secondOptimizationDate, + int eligibleTickers, int halfPeriodDays, + PortfolioType portfolioType, + int createdGenerations) + { + if(this.bestGenomes == null) + this.bestGenomes = new ArrayList(); + + this.bestGenomes.Add(new GenomeRepresentation(genome, + firstOptimizationDate, + secondOptimizationDate, + genome.Generation, + eligibleTickers, + halfPeriodDays, portfolioType, createdGenerations)); + } + public virtual void MarketOpenEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) *************** *** 331,334 **** --- 368,434 ---- ; } + + #region reversePositions + private void reversePositions_addReversedTickersToOrderList_addOrderForTicker(int tickerPosition ) + { + string tickerCode = + GenomeManagerForEfficientPortfolio.GetCleanTickerCode(this.reversedTickersForOpenedPositions[tickerPosition]); + double cashForSinglePosition = + this.account.CashAmount * this.chosenTickersPortfolioWeights[tickerPosition]; + long quantity = + Convert.ToInt64( Math.Floor( cashForSinglePosition / this.account.DataStreamer.GetCurrentBid( tickerCode ) ) ); + Order order; + if(this.portfolioType == PortfolioType.OnlyShort || + (this.portfolioType == PortfolioType.ShortAndLong && + this.reversedTickersForOpenedPositions[tickerPosition] != tickerCode)) + order = new Order( OrderType.MarketSellShort, new Instrument( tickerCode ) , quantity ); + else + order = new Order( OrderType.MarketBuy, new Instrument( tickerCode ) , quantity ); + + this.orders.Add(order); + } + + private void reversePositions_addReversedTickersToOrderList() + { + for( int i = 0; i<this.reversedTickersForOpenedPositions.Length; i++) + { + if(this.reversedTickersForOpenedPositions[i] != null) + { + this.reversePositions_addReversedTickersToOrderList_addOrderForTicker( i ); + this.lastOrderedTickers[i] = + GenomeManagerForEfficientPortfolio.GetCleanTickerCode(this.reversedTickersForOpenedPositions[i]); + } + } + } + + + private void reversePositions_setReversedTickers() + { + string sign = ""; + string instrumentKey = ""; + Position[] positions = new Position[this.chosenTickers.Length]; + this.account.Portfolio.Positions.CopyTo(positions, 0); + for(int i = 0; i<this.account.Portfolio.Count; i++) + { + instrumentKey = positions[i].Instrument.Key; + if(positions[i].IsShort) + sign = ""; + else + sign = "-"; + this.reversedTickersForOpenedPositions[i] = sign + instrumentKey; + } + } + + protected void reversePositions() + { + this.reversedTickersForOpenedPositions = + new string[this.chosenTickers.Length]; + this.reversePositions_setReversedTickers(); + this.closePositions(); + this.orders.Clear(); + this.openPositions(this.reversedTickersForOpenedPositions); + } + #endregion + } // end of class } |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:41:39
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32724/b7_Scripts/TickerSelectionTesting Modified Files: GenomeManagerForEfficientPortfolio.cs Log Message: Added the OTC - CTO strategy using a brute force optimizer: Decode method has been overloaded with a BruteForceOptimizableParameter parameter. Index: GenomeManagerForEfficientPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/GenomeManagerForEfficientPortfolio.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** GenomeManagerForEfficientPortfolio.cs 7 Aug 2006 21:03:24 -0000 1.24 --- GenomeManagerForEfficientPortfolio.cs 17 Sep 2006 21:41:37 -0000 1.25 *************** *** 26,29 **** --- 26,30 ---- using QuantProject.ADT.Statistics; using QuantProject.ADT.Optimizing.Genetic; + using QuantProject.ADT.Optimizing.BruteForce; using QuantProject.Data; using QuantProject.Data.DataTables; *************** *** 68,82 **** //IGenomeManager implementation for properties ! public int GenomeSize { get{return this.genomeSize;} } ! public int GetMinValueForGenes(int genePosition) { return this.minValueForGenes; } ! public int GetMaxValueForGenes(int genePosition) { return this.maxValueForGenes; --- 69,83 ---- //IGenomeManager implementation for properties ! public virtual int GenomeSize { get{return this.genomeSize;} } ! public virtual int GetMinValueForGenes(int genePosition) { return this.minValueForGenes; } ! public virtual int GetMaxValueForGenes(int genePosition) { return this.maxValueForGenes; *************** *** 239,242 **** --- 240,271 ---- } + public virtual double GetFitnessValue(BruteForceOptimizableParameters bruteForceOptimizableParameters) + { + double returnValue = 0; + this.portfolioRatesOfReturn = + this.getPortfolioRatesOfReturn(bruteForceOptimizableParameters.GetValues()); + double averagePortfolioRateOfReturn = + BasicFunctions.SimpleAverage(this.portfolioRatesOfReturn); + + double portfolioVariance = + BasicFunctions.Variance(this.portfolioRatesOfReturn); + + if(!Double.IsInfinity(portfolioVariance) && + !Double.IsInfinity(averagePortfolioRateOfReturn) && + !Double.IsNaN(portfolioVariance) && + !Double.IsNaN(averagePortfolioRateOfReturn) && + portfolioVariance > 0.0) + //both variance and rate of return are + //double values computed in the right way: + // so it's possible to assign fitness + { + this.variance = portfolioVariance; + this.rateOfReturn = averagePortfolioRateOfReturn; + returnValue = this.getFitnessValue_calculate(); + } + + return returnValue; + } + #endregion *************** *** 301,304 **** --- 330,347 ---- } + public virtual object Decode(BruteForceOptimizableParameters bruteForceOptimizableParameters) + { + string[] arrayOfTickers = + new string[bruteForceOptimizableParameters.GetValues().Length]; + int indexOfTicker; + for(int index = 0; index < bruteForceOptimizableParameters.GetValues().Length; index++) + { + indexOfTicker = bruteForceOptimizableParameters.GetValues()[index]; + arrayOfTickers[index] = this.decode_getTickerCodeForLongOrShortTrade(indexOfTicker); + } + GenomeMeaning meaning = new GenomeMeaning(arrayOfTickers); + return meaning; + } + public virtual object Decode(Genome genome) { *************** *** 388,392 **** #region getPortfolioRatesOfReturn ! protected int getPortfolioRatesOfReturn_getRateOfTickerToBeAddedToTheArray_getPositionInArray(int geneValueForTickerIdx) { int position = geneValueForTickerIdx; --- 431,435 ---- #region getPortfolioRatesOfReturn ! protected int getPortfolioRatesOfReturn_getRateOfTickerToBeAddedToTheArray_getPositionInSetOfCandidates(int geneValueForTickerIdx) { int position = geneValueForTickerIdx; *************** *** 404,408 **** //genes[tickerPositionInGenes], the code for ticker, points to a ticker for which long returns are to be examined longReturns = true; ! int position = this.getPortfolioRatesOfReturn_getRateOfTickerToBeAddedToTheArray_getPositionInArray(genes[tickerPositionInGenes]); this.setOfCandidates[position].LongRatesOfReturn = longReturns; float[] arrayOfRatesOfReturn = this.setOfCandidates[position].ArrayOfRatesOfReturn; --- 447,451 ---- //genes[tickerPositionInGenes], the code for ticker, points to a ticker for which long returns are to be examined longReturns = true; ! int position = this.getPortfolioRatesOfReturn_getRateOfTickerToBeAddedToTheArray_getPositionInSetOfCandidates(genes[tickerPositionInGenes]); this.setOfCandidates[position].LongRatesOfReturn = longReturns; float[] arrayOfRatesOfReturn = this.setOfCandidates[position].ArrayOfRatesOfReturn; |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:37:22
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/TestingOTCTypes/BruteForceOptimization In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31050/b7_Scripts/TickerSelectionTesting/TestingOTCTypes/BruteForceOptimization Added Files: RunEfficientOTCTypesBruteForce.cs OTCBruteForceOptimizableParametersManager.cs EndOfDayTimerHandlerOTCTypesBruteForce.cs Log Message: Added the OTC - CTO strategy using a brute force optimizer. --- NEW FILE: OTCBruteForceOptimizableParametersManager.cs --- /* QuantProject - Quantitative Finance Library OTCBruteForceOptimizableParametersManager.cs Copyright (C) 2006 Marco Milletti 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.Data; using QuantProject.ADT.Optimizing.BruteForce; using QuantProject.ADT.Statistics.Combinatorial; using QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios; namespace QuantProject.Scripts.TickerSelectionTesting.TestingOTCTypes.BruteForceOptimization { /// <summary> /// This class implements IBruteForceOptimizableParametersManager, /// in order to find the best portfolio with respect /// to the OTC - CTO (open to close - close to open) strategy. /// Weights are NOT used in this implementation /// </summary> public class OTCBruteForceOptimizableParametersManager : IBruteForceOptimizableParametersManager { private Combination portfolioCombination; private int numberOfPortfolioPositions; private GenomeManagerForEfficientOTCCTOPortfolio otcCtoGenomeManager; private DataTable eligibleTickersForPortfolioPositions; public OTCBruteForceOptimizableParametersManager( DataTable eligibleTickersForPortfolioPositions , DateTime firstOptimizationDate , DateTime lastOptimizationDate , int numberOfPortfolioPositions ) { this.eligibleTickersForPortfolioPositions = eligibleTickersForPortfolioPositions; this.numberOfPortfolioPositions = numberOfPortfolioPositions; this.portfolioCombination = new Combination( - eligibleTickersForPortfolioPositions.Rows.Count , eligibleTickersForPortfolioPositions.Rows.Count - 1 , numberOfPortfolioPositions ); this.otcCtoGenomeManager = new GenomeManagerForEfficientOTCCTOPortfolio( eligibleTickersForPortfolioPositions , firstOptimizationDate , lastOptimizationDate , numberOfPortfolioPositions , 0.0, PortfolioType.ShortAndLong); } public bool MoveNext() { return this.portfolioCombination.MoveNext(); } public void Reset() { this.portfolioCombination.Reset(); } #region Current public object Current { get { return this.getCurrent(); } } private object getCurrent() { int[] currentValues = new int[ this.portfolioCombination.Length ]; for ( int i = 0 ; i < this.portfolioCombination.Length ; i ++ ) currentValues[ i ] = this.portfolioCombination.GetValue( i ); BruteForceOptimizableParameters bruteForceOptimizableParameters = new BruteForceOptimizableParameters( currentValues , this ); return bruteForceOptimizableParameters; } #endregion public object Decode( BruteForceOptimizableParameters bruteForceOptimizableItem ) { return this.otcCtoGenomeManager.Decode(bruteForceOptimizableItem); } public double GetFitnessValue( BruteForceOptimizableParameters bruteForceOptimizableItem ) { return this.otcCtoGenomeManager.GetFitnessValue(bruteForceOptimizableItem); } } } --- NEW FILE: EndOfDayTimerHandlerOTCTypesBruteForce.cs --- /* QuantProject - Quantitative Finance Library EndOfDayTimerHandlerOTCTypesBruteForce.cs Copyright (C) 2003 Marco Milletti 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.Data; using System.Collections; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting; using QuantProject.Business.Financial.Instruments; using QuantProject.Business.Financial.Ordering; using QuantProject.Business.Timing; using QuantProject.Business.Strategies; using QuantProject.Data.DataProviders; using QuantProject.Data.Selectors; using QuantProject.ADT.Optimizing.Genetic; using QuantProject.ADT.Optimizing.BruteForce; using QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios; namespace QuantProject.Scripts.TickerSelectionTesting.TestingOTCTypes.BruteForceOptimization { /// <summary> /// Implements MarketOpenEventHandler, /// MarketCloseEventHandler and OneHourAfterMarketCloseEventHandler /// These handlers run all the /// OTC strategy types after a common optimization, for testing purposes /// </summary> [Serializable] public class EndOfDayTimerHandlerOTCTypesBruteForce : EndOfDayTimerHandler { private int numDaysBetweenEachOptimization; private int numDaysElapsedSinceLastOptimization; private int seedForRandomGenerator; private Account[] accounts; private string[,] lastOrderedTickersForTheAccount; int numOfClosesWithOpenPositionsFor2DaysStrategy; public EndOfDayTimerHandlerOTCTypesBruteForce(string tickerGroupID, int numberOfEligibleTickers, int numberOfTickersToBeChosen, int numDaysForOptimizationPeriod, string benchmark, int numDaysBetweenEachOptimization, Account[] accounts): base(tickerGroupID, numberOfEligibleTickers, numberOfTickersToBeChosen, numDaysForOptimizationPeriod, 1, 100, benchmark, 0.0, PortfolioType.ShortAndLong) { this.numDaysBetweenEachOptimization = numDaysBetweenEachOptimization; this.numDaysElapsedSinceLastOptimization = 0; this.seedForRandomGenerator = ConstantsProvider.SeedForRandomGenerator; this.accounts = accounts; this.lastOrderedTickersForTheAccount = new string[this.accounts.Length, this.numberOfTickersToBeChosen]; } private void openPositionsForTheAccountWhenPortfolioIsEmpty(int accountNumber) { if(this.accounts[accountNumber].Portfolio.Count == 0) { this.orders.Clear(); this.addChosenTickersToOrderListForTheGivenAccount(accountNumber); for(int i = 0; i<this.orders.Count;i++) { this.accounts[accountNumber].AddOrder((Order)this.orders[i]); this.lastOrderedTickersForTheAccount[accountNumber, i] = SignedTicker.GetTicker(((Order)this.orders[i]).Instrument.Key); } } } protected void addOrderForTickerForTheGivenAccount(int tickerPosition, int accountNumber ) { string tickerCode = GenomeManagerForEfficientPortfolio.GetCleanTickerCode(this.chosenTickers[tickerPosition]); double cashForSinglePosition = this.accounts[accountNumber].CashAmount * this.chosenTickersPortfolioWeights[tickerPosition]; long quantity = Convert.ToInt64( Math.Floor( cashForSinglePosition / this.accounts[accountNumber].DataStreamer.GetCurrentBid( tickerCode ) ) ); Order order; if(this.portfolioType == PortfolioType.OnlyShort || (this.portfolioType == PortfolioType.ShortAndLong && this.chosenTickers[tickerPosition] != tickerCode)) order = new Order( OrderType.MarketSellShort, new Instrument( tickerCode ) , quantity ); else order = new Order( OrderType.MarketBuy, new Instrument( tickerCode ) , quantity ); this.orders.Add(order); } protected void addChosenTickersToOrderListForTheGivenAccount(int accountNumber) { for( int i = 0; i<this.chosenTickers.Length; i++) { if(this.chosenTickers[i] != null) this.addOrderForTickerForTheGivenAccount( i, accountNumber ); } } private void closePositionsForTheAccount(int accountNumber) { string ticker; if(this.accounts[accountNumber].Portfolio.Count >0) { for(int j = 0; j<this.numberOfTickersToBeChosen; j++) { ticker = this.lastOrderedTickersForTheAccount[accountNumber, j]; if( ticker != null) { if(this.accounts[accountNumber].Portfolio[ticker]!=null) this.accounts[accountNumber].ClosePosition(ticker); } } } } private void marketCloseEventHandler_reversePositionsForTheAccount(int accountNumber) { this.closePositionsForTheAccount(accountNumber); SignedTicker.ChangeSignOfEachTicker(this.chosenTickers); try { this.openPositionsForTheAccountWhenPortfolioIsEmpty(accountNumber); } catch(Exception ex) { ex = ex; } finally { SignedTicker.ChangeSignOfEachTicker(this.chosenTickers); } } /// <summary> /// Handles a "Market Open" event. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> public override void MarketOpenEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { for(int i = 0; i<this.accounts.Length; i++) { //add cash first for each account if(this.orders.Count == 0 && this.accounts[i].Transactions.Count == 0) this.accounts[i].AddCash(30000); if(i<=1)//daily classical and multiday this.openPositionsForTheAccountWhenPortfolioIsEmpty(i); if(i==2)//for the CTO OTC { this.closePositionsForTheAccount(i); this.openPositionsForTheAccountWhenPortfolioIsEmpty(i); } if(i==3)//for the CTO, no position is opened //at market open. Any open position is closed, instead this.closePositionsForTheAccount(i); } } public override void MarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { if(this.accounts[1].Portfolio.Count > 0) numOfClosesWithOpenPositionsFor2DaysStrategy++; for(int i=0; i<this.accounts.Length; i++) { if(i==0)//OTC daily account this.closePositionsForTheAccount(i); if(i==1)//OTC 2 days { if(this.numOfClosesWithOpenPositionsFor2DaysStrategy == 2) { this.closePositionsForTheAccount(i); this.numOfClosesWithOpenPositionsFor2DaysStrategy = 0; } } if(i>=2)//for the OTC-CTO and CTO this.marketCloseEventHandler_reversePositionsForTheAccount(i); } } #region OneHourAfterMarketCloseEventHandler protected DataTable getSetOfTickersToBeOptimized(DateTime currentDate) { SelectorByGroup temporizedGroup = new SelectorByGroup(this.tickerGroupID, currentDate); DataTable tickersFromGroup = temporizedGroup.GetTableOfSelectedTickers(); SelectorByAverageRawOpenPrice byPrice = new SelectorByAverageRawOpenPrice(tickersFromGroup,false,currentDate, currentDate.AddDays(-30), tickersFromGroup.Rows.Count, 20,500, 0.0001,100); SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity(byPrice.GetTableOfSelectedTickers(), false,currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, this.numberOfEligibleTickers); SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromMostLiquid = new SelectorByQuotationAtEachMarketDay(mostLiquidSelector.GetTableOfSelectedTickers(), false, currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, this.numberOfEligibleTickers, this.benchmark); return quotedAtEachMarketDayFromMostLiquid.GetTableOfSelectedTickers(); } private double[] setTickers_getWeights(string[] tickers) { double[] returnValue = new double[tickers.Length]; for(int i = 0;i<tickers.Length; i++) returnValue[i] = 1.0/tickers.Length; return returnValue; } protected virtual void setTickers(DateTime currentDate, bool setGenomeCounter) { DataTable setOfTickersToBeOptimized = this.getSetOfTickersToBeOptimized(currentDate); if(setOfTickersToBeOptimized.Rows.Count > this.chosenTickers.Length*2) //the optimization process is possible only if the initial set of tickers is //as large as the number of tickers to be chosen { OTCBruteForceOptimizableParametersManager otcBruteForceParamManager = new OTCBruteForceOptimizableParametersManager( setOfTickersToBeOptimized, currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate,this.chosenTickers.Length); BruteForceOptimizer BFO = new BruteForceOptimizer(otcBruteForceParamManager); BFO.Run(); this.chosenTickers = ((GenomeMeaning)otcBruteForceParamManager.Decode(BFO.BestParameters)).Tickers; //this.setTickers_getChosenTickers(BFO.BestParameters); this.addGenomeToBestGenomes(BFO.BestParameters,this.chosenTickers, currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate,setOfTickersToBeOptimized.Rows.Count); this.chosenTickersPortfolioWeights = this.setTickers_getWeights(this.chosenTickers); } //else it will be buyed again the previous optimized portfolio //that's it the actual chosenTickers member } /// <summary> /// Handles a "One hour after market close" event. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> public override void OneHourAfterMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { this.seedForRandomGenerator++; this.orders.Clear(); if(this.numDaysElapsedSinceLastOptimization == this.numDaysBetweenEachOptimization - 1) { this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime, false); //sets tickers to be chosen at next Market Open event this.numDaysElapsedSinceLastOptimization = 0; } else { this.numDaysElapsedSinceLastOptimization++; } } #endregion } } --- NEW FILE: RunEfficientOTCTypesBruteForce.cs --- /* QuantProject - Quantitative Finance Library RunEfficientOTCTypesBruteForce.cs Copyright (C) 2003 Marco Milletti 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; using System.Data; using QuantProject.ADT; using QuantProject.ADT.Optimizing.Genetic; using QuantProject.ADT.Optimizing.BruteForce; using QuantProject.ADT.FileManaging; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting; using QuantProject.Business.Financial.Accounting.Reporting; using QuantProject.Business.Financial.Instruments; using QuantProject.Business.Financial.Ordering; using QuantProject.Business.Scripting; using QuantProject.Business.Strategies; using QuantProject.Business.Testing; using QuantProject.Business.Timing; using QuantProject.Business.Financial.Accounting.Commissions; using QuantProject.Data.DataProviders; using QuantProject.Data.Selectors; using QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios; using QuantProject.Presentation.Reporting.WindowsForm; using QuantProject.Scripts.WalkForwardTesting.LinearCombination; namespace QuantProject.Scripts.TickerSelectionTesting.TestingOTCTypes.BruteForceOptimization { /// <summary> /// Script to test OTC daily, OTC multiday and OTC - CTO /// all together with one brute force optimization and 3 accounts (each for /// each type of strategy) /// </summary> [Serializable] public class RunEfficientOTCTypesBruteForce : RunEfficientPortfolio { protected int numDaysBetweenEachOptimization; private Account[] accounts; public RunEfficientOTCTypesBruteForce(string tickerGroupID, int numberOfEligibleTickers, int numberOfTickersToBeChosen, int numDaysForOptimizationPeriod, string benchmark, DateTime startDate, DateTime endDate, double maxRunningHours, int numDaysBetweenEachOptimization): base(tickerGroupID, numberOfEligibleTickers, numberOfTickersToBeChosen, numDaysForOptimizationPeriod, 1,100, benchmark, startDate, endDate, 0.0, PortfolioType.ShortAndLong, maxRunningHours) { this.ScriptName = "OTC_SR_PriceSelBruteForce"; this.numDaysBetweenEachOptimization = numDaysBetweenEachOptimization; this.accounts = new Account[4]; } #region auxiliary overriden methods for Run protected override void run_initializeAccount() { for(int i = 0; i<this.accounts.Length; i++) { this.accounts[i] = new Account( this.ScriptName, this.endOfDayTimer , new HistoricalEndOfDayDataStreamer( this.endOfDayTimer , this.historicalQuoteProvider ) , new HistoricalEndOfDayOrderExecutor( this.endOfDayTimer , this.historicalQuoteProvider )); } } protected override void run_initializeEndOfDayTimerHandler() { this.endOfDayTimerHandler = new EndOfDayTimerHandlerOTCTypesBruteForce(this.tickerGroupID, this.numberOfEligibleTickers, this.numberOfTickersToBeChosen, this.numDaysForOptimizationPeriod, this.benchmark, this.numDaysBetweenEachOptimization, this.accounts); } protected override void run_initializeHistoricalQuoteProvider() { //this.historicalQuoteProvider = new HistoricalRawQuoteProvider(); this.historicalQuoteProvider = new HistoricalAdjustedQuoteProvider(); } protected override void run_addEventHandlers() { this.endOfDayTimer.MarketOpen += new MarketOpenEventHandler( this.endOfDayTimerHandler.MarketOpenEventHandler); this.endOfDayTimer.MarketClose += new MarketCloseEventHandler( this.endOfDayTimerHandler.MarketCloseEventHandler); this.endOfDayTimer.MarketClose += new MarketCloseEventHandler( this.checkDateForReport); this.endOfDayTimer.OneHourAfterMarketClose += new OneHourAfterMarketCloseEventHandler( this.endOfDayTimerHandler.OneHourAfterMarketCloseEventHandler ); } #endregion //necessary far calling RunEfficientPortfolio.Run() //in classes that inherit from this class public override void Run() { base.Run(); } public override void SaveScriptResults() { string fileName = "From"+this.numberOfEligibleTickers + "OptDays" + this.numDaysForOptimizationPeriod + "Portfolio" + this.numberOfTickersToBeChosen + "BruteForce"; string dirNameWhereToSaveAccounts = System.Configuration.ConfigurationSettings.AppSettings["AccountsArchive"] + "\\" + this.ScriptName + "\\"; string dirNameWhereToSaveTransactions = System.Configuration.ConfigurationSettings.AppSettings["TransactionsArchive"] + "\\" + this.ScriptName + "\\"; string dirNameWhereToSaveBestGenomes = System.Configuration.ConfigurationSettings.AppSettings["GenomesArchive"] + "\\" + this.ScriptName + "\\"; this.checkDateForReport_createDirIfNotPresent(dirNameWhereToSaveAccounts); this.checkDateForReport_createDirIfNotPresent(dirNameWhereToSaveTransactions); this.checkDateForReport_createDirIfNotPresent(dirNameWhereToSaveBestGenomes); for(int i = 0; i<this.accounts.Length; i++) { ObjectArchiver.Archive(accounts[i], dirNameWhereToSaveAccounts + fileName + "#" + i.ToString() + ".qPa"); ObjectArchiver.Archive(this.accounts[i].Transactions, dirNameWhereToSaveTransactions + fileName + "#" + i.ToString() + ".qPt"); } OptimizationOutput optimizationOutput = new OptimizationOutput(); foreach(GenomeRepresentation genomeRepresentation in this.endOfDayTimerHandler.BestGenomes) optimizationOutput.Add(genomeRepresentation); ObjectArchiver.Archive(optimizationOutput, dirNameWhereToSaveBestGenomes + fileName + ".bgn"); this.endOfDayTimer.Stop(); } } } |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:36:12
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataTables In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30608/b3_Data/DataTables Modified Files: Quotes.cs Log Message: Added new constructor to the SelectorByLiquidity class: now it is possible to filter tickers by a given min volume value also when selection is performed on a given set (dataTable) of tickers Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataTables/Quotes.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Quotes.cs 3 Aug 2006 21:21:34 -0000 1.30 --- Quotes.cs 17 Sep 2006 21:36:09 -0000 1.31 *************** *** 111,115 **** /// returns most liquid tickers within the given set of tickers /// </summary> - public static DataTable GetTickersByLiquidity( bool orderByASC, DataTable setOfTickers, --- 111,114 ---- *************** *** 133,136 **** --- 132,171 ---- /// <summary> + /// returns most liquid tickers with the given min volume + /// within the given set of tickers + /// </summary> + public static DataTable GetTickersByLiquidity( bool orderByASC, + DataTable setOfTickers, + DateTime firstQuoteDate, + DateTime lastQuoteDate, + long minVolume, + long maxNumOfReturnedTickers) + { + if(!setOfTickers.Columns.Contains("AverageTradedValue")) + setOfTickers.Columns.Add("AverageTradedValue", System.Type.GetType("System.Double")); + if(!setOfTickers.Columns.Contains("AverageTradedVolume")) + setOfTickers.Columns.Add("AverageTradedVolume", System.Type.GetType("System.Int64")); + + foreach(DataRow row in setOfTickers.Rows) + { + row["AverageTradedValue"] = + QuantProject.DataAccess.Tables.Quotes.GetAverageTradedValue((string)row[0], + firstQuoteDate, + lastQuoteDate); + row["AverageTradedVolume"] = + QuantProject.DataAccess.Tables.Quotes.GetAverageTradedVolume((string)row[0], + firstQuoteDate, + lastQuoteDate); + } + DataTable getMostLiquidTicker = ExtendedDataTable.CopyAndSort(setOfTickers, + "AverageTradedVolume>" + + minVolume.ToString(), + "AverageTradedValue", + orderByASC); + ExtendedDataTable.DeleteRows(getMostLiquidTicker, maxNumOfReturnedTickers); + return getMostLiquidTicker; + } + + /// <summary> /// returns tickers ordered by volatility computed with Standard deviation of adjusted /// close to close ratio, within the given set of tickers |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:36:12
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/Selectors In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30608/b3_Data/Selectors Modified Files: SelectorByLiquidity.cs Log Message: Added new constructor to the SelectorByLiquidity class: now it is possible to filter tickers by a given min volume value also when selection is performed on a given set (dataTable) of tickers Index: SelectorByLiquidity.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/Selectors/SelectorByLiquidity.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SelectorByLiquidity.cs 18 Jun 2006 14:18:07 -0000 1.2 --- SelectorByLiquidity.cs 17 Sep 2006 21:36:09 -0000 1.3 *************** *** 51,55 **** } ! public SelectorByLiquidity(string groupID, bool orderInASCmode, DateTime firstQuoteDate, --- 51,70 ---- } ! public SelectorByLiquidity(DataTable setOfTickersToBeSelected, ! bool orderInASCmode, ! DateTime firstQuoteDate, ! DateTime lastQuoteDate, ! long minVolume, ! long maxNumOfReturnedTickers): ! base(setOfTickersToBeSelected, ! orderInASCmode, ! firstQuoteDate, ! lastQuoteDate, ! maxNumOfReturnedTickers) ! { ! this.minVolume = minVolume; ! } ! ! public SelectorByLiquidity(string groupID, bool orderInASCmode, DateTime firstQuoteDate, *************** *** 84,116 **** { DataTable returnTickers; ! if(this.setOfTickersToBeSelected == null) ! { ! if ( this.minVolume > long.MinValue ) ! // a min volume value has been requested ! returnTickers = ! QuantProject.DataAccess.Tables.Quotes.GetTickersByLiquidity(this.isOrderedInASCMode, ! this.groupID, ! this.firstQuoteDate, ! this.lastQuoteDate, ! this.minVolume , ! this.maxNumOfReturnedTickers); ! else ! // a min volume value has not been requested ! returnTickers = ! QuantProject.DataAccess.Tables.Quotes.GetTickersByLiquidity(this.isOrderedInASCMode, ! this.groupID, ! this.firstQuoteDate, ! this.lastQuoteDate, ! this.maxNumOfReturnedTickers); ! } ! ! else ! returnTickers = ! QuantProject.Data.DataTables.Quotes.GetTickersByLiquidity(this.isOrderedInASCMode, ! this.setOfTickersToBeSelected, ! this.firstQuoteDate, ! this.lastQuoteDate, ! this.maxNumOfReturnedTickers); ! return returnTickers; } public void SelectAllTickers() --- 99,143 ---- { DataTable returnTickers; ! if(this.setOfTickersToBeSelected == null) ! { ! if ( this.minVolume > long.MinValue ) ! // a min volume value has been requested ! returnTickers = ! QuantProject.DataAccess.Tables.Quotes.GetTickersByLiquidity(this.isOrderedInASCMode, ! this.groupID, ! this.firstQuoteDate, ! this.lastQuoteDate, ! this.minVolume , ! this.maxNumOfReturnedTickers); ! else ! // a min volume value has not been requested ! returnTickers = ! QuantProject.DataAccess.Tables.Quotes.GetTickersByLiquidity(this.isOrderedInASCMode, ! this.groupID, ! this.firstQuoteDate, ! this.lastQuoteDate, ! this.maxNumOfReturnedTickers); ! } ! else//a set of tickers, not a group ID, ! //has been passed to the selector ! { ! if ( this.minVolume > long.MinValue ) ! // a min volume value has been requested ! returnTickers = ! QuantProject.Data.DataTables.Quotes.GetTickersByLiquidity(this.isOrderedInASCMode, ! this.setOfTickersToBeSelected, ! this.firstQuoteDate, ! this.lastQuoteDate, ! this.minVolume, ! this.maxNumOfReturnedTickers); ! else ! returnTickers = ! QuantProject.Data.DataTables.Quotes.GetTickersByLiquidity(this.isOrderedInASCMode, ! this.setOfTickersToBeSelected, ! this.firstQuoteDate, ! this.lastQuoteDate, ! this.maxNumOfReturnedTickers); ! } ! return returnTickers; } public void SelectAllTickers() |
|
From: Marco M. <mi...@us...> - 2006-09-17 21:36:12
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30608/b2_DataAccess/Tables Modified Files: Quotes.cs Log Message: Added new constructor to the SelectorByLiquidity class: now it is possible to filter tickers by a given min volume value also when selection is performed on a given set (dataTable) of tickers Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Quotes.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Quotes.cs 22 Jul 2006 20:52:44 -0000 1.30 --- Quotes.cs 17 Sep 2006 21:36:09 -0000 1.31 *************** *** 679,682 **** --- 679,704 ---- } + /// <summary> + /// returns the average traded volume for the given ticker in the specified interval + /// </summary> + public static double GetAverageTradedVolume( string ticker, + DateTime firstQuoteDate, + DateTime lastQuoteDate) + + { + DataTable dt; + string sql = "SELECT quotes.quTicker, " + + "Avg([quVolume]) AS AverageTradedVolume " + + "FROM quotes WHERE quTicker ='" + + ticker + "' " + + "AND quotes.quDate BETWEEN " + SQLBuilder.GetDateConstant(firstQuoteDate) + + " AND " + SQLBuilder.GetDateConstant(lastQuoteDate) + + " GROUP BY quotes.quTicker"; + dt = SqlExecutor.GetDataTable( sql ); + if(dt.Rows.Count==0) + return 0; + else + return (double)dt.Rows[0]["AverageTradedVolume"]; + } /// <summary> |