quantproject-developers Mailing List for QuantProject (Page 101)
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: marco\.milletti\@l <mar...@li...> - 2005-08-29 07:54:57
|
>>+ ConstantsProvider.SeedForRandomGenerator++;
> Aaaarrrggghh=
h!!! Cambiare il valore di una costante... non >era una di
> quelle cos=
e che, agli esami, facesse prendere un bel voto :-)
Be', ti =E8 piaciu=
to lo scherzetto? :-)
Meno male che non ho mai fatto esami d'informati=
ca ...
Cmq, dopo 15 mesi di EI (Esercito Italiano - PA per antonomasia) =
e quasi 9 anni (diconsi "nove", puttana la miseria), pensavo di molto ma =
molto peggio ...
>Lo so che probabilmente non ci sono effetti collater=
ali, ma >se non ti
> complica troppo la vita usare una variabile d'appo=
ggio, >quando hai tempo
> vedi se si puo' lasciare la costante... costa=
nte ;-)
Certo, lo faccio immediatamente. Al prossimo commit sistemo.=0D
=
Piccola osservazione: io ho cannato (osservo che pestare un bel merdone=
dovrebbe portare fortuna ...), ma =E8 sbagliato anche che una "costante"=
venga rappresentata da una "variabile" ...
> Scherzi a parte, nei v=
ecchi linguaggi, il senso delle costanti era solo
> che quello dare un =
un nome mnemonico ad un valore che non cambiava mai e
> di avere un uni=
co punto del codice in cui andare a cambiare il valore. Le
> costanti e=
rano addirittura preprocessate rispetto alla compilazione,
> cioe', al =
compilatore veniva passato il testo con i valori gia'
> sositutiti, qui=
ndi uno statement tipo
>
> costantName++
>
> al compilatore sarebbe, =
ad esempio, arrivato cosi'
>
> 13++
>
>
>> this.orders.Clear=
();
>> //this.oneHourAfterMarketCloseEventHandler_updatePrices()=
;
>> if(this.numDaysElapsedSinceLastOptimization =3D=3D
>>! =
this.numDaysBetweenEachOptimization - 1)
>> {
>> this.set=
Tickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime,
>> false);=0D
=
>>
>>Index: EndOfDayTimerHandler.cs
>>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
>>RCS file:
>>/cvsroot/quantproject/QuantProject/b7=
_Scripts/TickerSelectionTesting/EndOfDayTimerHandler.cs,v
>>retrieving r=
evision 1.15
>>retrieving revision 1.16
>>diff -C2 -d -r1.15 -r1.16
>>=
*** EndOfDayTimerHandler.cs 1 Aug 2005 22:31:48 -0000 1.15
>>-=
-- EndOfDayTimerHandler.cs 28 Aug 2005 10:05:03 -0000 1.16
>>**=
*************
>>*** 212,216 ****
>> this.bestGenomes.Add(new Ge=
nomeRepresentation(genome,
>>
>> firstOptimizationDate,
>>! secondOpt=
imizationDate));
>> }
>>
>>--- 212,217 ----
>> this.bes=
tGenomes.Add(new GenomeRepresentation(genome,
>>
>> firstOptimizationD=
ate,
>>!
>>secondOptimizationDate,
>>! =
genome.Generation));
>> }
>>
>>
>>Index: =
EndOfDayTimerHandlerCTC.cs
>>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
>>RCS file:
>>/cvsroot/quantproject/QuantProject/b7_Scripts/Tic=
kerSelectionTesting/EndOfDayTimerHandlerCTC.cs,v
>>retrieving revision 1=
.12
>>retrieving revision 1.13
>>diff -C2 -d -r1.12 -r1.13
>>*** EndOf=
DayTimerHandlerCTC.cs 1 Aug 2005 22:31:48 -0000 1.12
>>--- EndOfD=
ayTimerHandlerCTC.cs 28 Aug 2005 10:05:03 -0000 1.13
>>***********=
****
>>*** 193,197 ****
>> Object sender , EndOfDayTimingEventA=
rgs endOfDayTimingEventArgs )
>> {
>>!
>> if(this.accoun=
t.Portfolio.Count =3D=3D 0 )
>> {
>>--- 193,197 ----
>> =
Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs )
>> =
{
>>! ConstantsProvider.SeedForRandomGenerator++;
>> =
if(this.account.Portfolio.Count =3D=3D 0 )
>> {
>>
>>
>>
>>=
-------------------------------------------------------
>>SF.Net email i=
s Sponsored by the Better Software Conference & EXPO
>>September 19-22, =
2005 * San Francisco, CA * Development Lifecycle
>>Practices
>>Agile &=
Plan-Driven Development * Managing Projects & Teams * Testing & QA
>>Se=
curity * Process Improvement & Measurement * http://www.sqe.com/bsce5sf=0D
=
>>_______________________________________________
>>Quantproject-develop=
ers mailing list
>>Qua...@li...
>>http=
s://lists.sourceforge.net/lists/listinfo/quantproject-developers
>
>=0D
=
>
> -------------------------------------------------------
> SF.Net em=
ail is Sponsored by the Better Software Conference & EXPO
> September 19=
-22, 2005 * San Francisco, CA * Development Lifecycle
> Practices
> Ag=
ile & Plan-Driven Development * Managing Projects & Teams * Testing & QA=0D
=
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5=
sf
> _______________________________________________
> Quantproject-dev=
elopers mailing list
> Qua...@li...
> =
https://lists.sourceforge.net/lists/listinfo/quantproject-developers
=0D
=
=0A=0A=0A=0A____________________________________________________________=0A=
Libero Flat, sempre a 4 Mega a 19,95 euro al mese! =0AAbbonati subito su =
http://www.libero.it=0A=0A
|
At 10:05 AM 8/28/2005 +0000, you wrote:
>+ ConstantsProvider.SeedForRandomGenerator++;
Aaaarrrggghhh!!! Cambiare il valore di una costante... non era una di
quelle cose che, agli esami, facesse prendere un bel voto :-)
Lo so che probabilmente non ci sono effetti collaterali, ma se non ti
complica troppo la vita usare una variabile d'appoggio, quando hai tempo
vedi se si puo' lasciare la costante... costante ;-)
Scherzi a parte, nei vecchi linguaggi, il senso delle costanti era solo che
quello dare un un nome mnemonico ad un valore che non cambiava mai e di
avere un unico punto del codice in cui andare a cambiare il valore. Le
costanti erano addirittura preprocessate rispetto alla compilazione, cioe',
al compilatore veniva passato il testo con i valori gia' sositutiti, quindi
uno statement tipo
costantName++
al compilatore sarebbe, ad esempio, arrivato cosi'
13++
> this.orders.Clear();
> //this.oneHourAfterMarketCloseEventHandler_updatePrices();
> if(this.numDaysElapsedSinceLastOptimization ==
>! this.numDaysBetweenEachOptimization - 1)
> {
>
>this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime, false);
>
>Index: EndOfDayTimerHandler.cs
>===================================================================
>RCS file:
>/cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandler.cs,v
>retrieving revision 1.15
>retrieving revision 1.16
>diff -C2 -d -r1.15 -r1.16
>*** EndOfDayTimerHandler.cs 1 Aug 2005 22:31:48 -0000 1.15
>--- EndOfDayTimerHandler.cs 28 Aug 2005 10:05:03 -0000 1.16
>***************
>*** 212,216 ****
> this.bestGenomes.Add(new GenomeRepresentation(genome,
> firstOptimizationDate,
>!
>secondOptimizationDate));
> }
>
>--- 212,217 ----
> this.bestGenomes.Add(new GenomeRepresentation(genome,
> firstOptimizationDate,
>! secondOptimizationDate,
>! genome.Generation));
> }
>
>
>Index: EndOfDayTimerHandlerCTC.cs
>===================================================================
>RCS file:
>/cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerCTC.cs,v
>retrieving revision 1.12
>retrieving revision 1.13
>diff -C2 -d -r1.12 -r1.13
>*** EndOfDayTimerHandlerCTC.cs 1 Aug 2005 22:31:48 -0000 1.12
>--- EndOfDayTimerHandlerCTC.cs 28 Aug 2005 10:05:03 -0000 1.13
>***************
>*** 193,197 ****
> Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs )
> {
>!
> if(this.account.Portfolio.Count == 0 )
> {
>--- 193,197 ----
> Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs )
> {
>! ConstantsProvider.SeedForRandomGenerator++;
> if(this.account.Portfolio.Count == 0 )
> {
>
>
>
>-------------------------------------------------------
>SF.Net email is Sponsored by the Better Software Conference & EXPO
>September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
>Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
>Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
>_______________________________________________
>Quantproject-developers mailing list
>Qua...@li...
>https://lists.sourceforge.net/lists/listinfo/quantproject-developers
|
|
From: Glauco S. <gl...@my...> - 2005-08-28 11:17:29
|
At 10:02 AM 8/28/2005 +0000, you wrote: >Log Message: >RunTestingOptimizationOpenToClose now saves a log file to disk at the end >of the test. Sono curioso di vedere quali informazioni salva. C'e' un metodo che scrive il log? Che parola chiave devo cercare per trovarlo? >Index: RunTestingOptimizationOpenToClose.cs >=================================================================== >RCS file: >/cvsroot/quantproject/QuantProject/b7_Scripts/EvaluatingOptimizationTechnique/EfficientPortfolio/RunTestingOptimizationOpenToClose.cs,v >retrieving revision 1.1 >retrieving revision 1.2 >diff -C2 -d -r1.1 -r1.2 >*** RunTestingOptimizationOpenToClose.cs 20 Aug 2005 16:08:48 >-0000 1.1 >--- RunTestingOptimizationOpenToClose.cs 28 Aug 2005 10:02:52 >-0000 1.2 >*************** >*** 23,26 **** >--- 23,27 ---- > using System; > using System.Data; >+ using System.IO; > > using QuantProject.ADT; >*************** >*** 46,49 **** >--- 47,51 ---- > private int numDaysForLiquidity; > private int populationSizeForGeneticOptimizer; >+ private int generationNumberForGeneticOptimizer; > private string benchmark; > private DateTime marketDate; >*************** >*** 52,64 **** > private int numDaysAfterLastOptimizationDay; > private int numberOfSubsets; > > public RunTestingOptimizationOpenToClose(string tickerGroupID, int > numberOfEligibleTickers, >! int numberOfTickersToBeChosen, int >numDaysForLiquidity, >! int >populationSizeForGeneticOptimizer, string benchmark, > DateTime marketDate, double > targetReturn, >! PortfolioType portfolioType, int >numDaysAfterLastOptimizationDay) > { >! this.fitnessesInSample = new >double[populationSizeForGeneticOptimizer]; >! this.fitnessesOutOfSample = new >double[populationSizeForGeneticOptimizer]; > this.tickerGroupID = tickerGroupID; > this.numberOfEligibleTickers = numberOfEligibleTickers; >--- 54,72 ---- > private int numDaysAfterLastOptimizationDay; > private int numberOfSubsets; >+ private Genome[] genomesToTestOutOfSample; >+ private int numberOfGenomesToTest; > > public RunTestingOptimizationOpenToClose(string tickerGroupID, int > numberOfEligibleTickers, >! int numberOfTickersToBeChosen, int >numDaysForLiquidity, >! int >generationNumberForGeneticOptimizer, int populationSizeForGeneticOptimizer, >! string benchmark, > DateTime marketDate, double > targetReturn, >! PortfolioType portfolioType, int >numDaysAfterLastOptimizationDay, >! int numberOfSubsets, int >numberOfGenomesToTest) > { >! this.numberOfGenomesToTest = numberOfGenomesToTest; >! this.genomesToTestOutOfSample = new >Genome[numberOfGenomesToTest]; >! this.fitnessesInSample = new double[numberOfGenomesToTest]; >! this.fitnessesOutOfSample = new double[numberOfGenomesToTest]; > this.tickerGroupID = tickerGroupID; > this.numberOfEligibleTickers = numberOfEligibleTickers; >*************** >*** 66,69 **** >--- 74,78 ---- > this.numDaysForLiquidity = numDaysForLiquidity; > this.populationSizeForGeneticOptimizer = > populationSizeForGeneticOptimizer; >+ this.generationNumberForGeneticOptimizer = >generationNumberForGeneticOptimizer; > this.benchmark = benchmark; > this.marketDate = marketDate; >*************** >*** 71,76 **** > this.portfolioType = portfolioType; > this.numDaysAfterLastOptimizationDay = > numDaysAfterLastOptimizationDay; >! this.numberOfSubsets = 5; >! } > > private DataTable getSetOfTickersToBeOptimized(DateTime date) >--- 80,86 ---- > this.portfolioType = portfolioType; > this.numDaysAfterLastOptimizationDay = > numDaysAfterLastOptimizationDay; >! this.numberOfSubsets = numberOfSubsets; >! >! } > > private DataTable getSetOfTickersToBeOptimized(DateTime date) >*************** >*** 138,150 **** > } > >! private void setFitnesses_setFitnessesActually(GeneticOptimizer GO) > > { > >! for(int i = 0; i<GO.CurrentGeneration.Count; i++) > { >! >this.fitnessesInSample[i]=((Genome)GO.CurrentGeneration[i]).Fitness; > this.fitnessesOutOfSample[i]= >! >this.setFitnesses_setFitnessesActually_getFitnessOutOfSample((Genome)GO.CurrentGeneration[i]); > } > >--- 148,171 ---- > } > >! private void >setFitnesses_setFitnessesActually_setGenomesToTestOutOfSample(GeneticOptimizer >GO) > > { >+ Random random = new Random(10); >+ for(int i = 0; i<this.numberOfGenomesToTest; i++) >+ { >+ this.genomesToTestOutOfSample[i]= >+ >(Genome)GO.CurrentGeneration[random.Next(this.populationSizeForGeneticOptimizer)]; >+ } >+ Array.Sort(this.genomesToTestOutOfSample); >+ } >+ private void setFitnesses_setFitnessesActually(GeneticOptimizer GO) > >! { >! >this.setFitnesses_setFitnessesActually_setGenomesToTestOutOfSample(GO); >! for(int i = 0; i<this.numberOfGenomesToTest; i++) > { >! >this.fitnessesInSample[i]=(this.genomesToTestOutOfSample[i]).Fitness; > this.fitnessesOutOfSample[i]= >! >this.setFitnesses_setFitnessesActually_getFitnessOutOfSample(this.genomesToTestOutOfSample[i]); > } > >*************** >*** 167,171 **** > GeneticOptimizer GO = new > GeneticOptimizer(genManEfficientCTOPortfolio, > >this.populationSizeForGeneticOptimizer, >! 0, > >ConstantsProvider.SeedForRandomGenerator); > >--- 188,192 ---- > GeneticOptimizer GO = new > GeneticOptimizer(genManEfficientCTOPortfolio, > >this.populationSizeForGeneticOptimizer, >! >this.generationNumberForGeneticOptimizer, > >ConstantsProvider.SeedForRandomGenerator); > >*************** >*** 181,184 **** >--- 202,210 ---- > new OptimizationTechniqueEvaluator(this.fitnessesInSample, > >this.fitnessesOutOfSample); >+ this.run_writeToLogFile(evaluator); >+ } >+ >+ private void run_writeToLogFile(OptimizationTechniqueEvaluator >evaluator) >+ { > double[] averagesInSample = > evaluator.GetAveragesOfSubsetsInSample(this.numberOfSubsets); >*************** >*** 186,190 **** > >evaluator.GetAveragesOfSubsetsOutOfSample(this.numberOfSubsets); > double r = evaluator.GetCorrelationBetweenFitnesses(); >! } > } > } >--- 212,245 ---- > >evaluator.GetAveragesOfSubsetsOutOfSample(this.numberOfSubsets); > double r = evaluator.GetCorrelationBetweenFitnesses(); >! GenomeCounter genomeCounter = new >GenomeCounter(this.genomesToTestOutOfSample); >! int differentEvaluatedGenomes = genomeCounter.TotalEvaluatedGenomes; >! string pathFile = >System.Configuration.ConfigurationSettings.AppSettings["GenericArchive"] + >! "\\OpenToCloseOptimizationEvaluation.txt"; >! StreamWriter w = File.AppendText(pathFile); >! w.WriteLine >("\n----------------------------------------------\r\n"); >! w.Write("\r\nNew Test for Evaluation of Open To Close >Optimization {0}\r", DateTime.Now.Date.ToLongDateString()); >! w.WriteLine ("\n----------------------------------------------"); >! w.Write("\r\nFitnesses compared: {0}\r", >this.fitnessesInSample.Length.ToString()); >! w.Write("\r\nDifferent evaluated genomes: {0}\r", >differentEvaluatedGenomes.ToString()); >! w.Write("\r\nAverages of the {0} sub sets of fitnesses In Sample:\r", >! this.numberOfSubsets); >! // >! for(int i = 0; i<averagesInSample.Length; i++) >! w.WriteLine("\n{0}-->{1}", i.ToString(), >averagesInSample[i].ToString()); >! >! w.WriteLine ("\n\n----------------------------------------------"); >! w.Write("\r\nAverages of the {0} sub sets of fitnesses Out of >Sample:\r", >! this.numberOfSubsets); >! // >! for(int i = 0; i<averagesOutOfSample.Length; i++) >! w.WriteLine("\n{0}-->{1}", i.ToString(), >averagesOutOfSample[i].ToString()); >! w.WriteLine ("\n\n----------------------------------------------"); >! // >! w.Write("\r\nCorrelation coefficient between fitnesses: {0}\r", >r.ToString()); >! w.WriteLine ("\n-----------------End of Test------------------\r\n"); >! // Update the underlying file. >! w.Flush(); >! w.Close(); >! } > } > } > > > >------------------------------------------------------- >SF.Net email is Sponsored by the Better Software Conference & EXPO >September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices >Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA >Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf >_______________________________________________ >Quantproject-developers mailing list >Qua...@li... >https://lists.sourceforge.net/lists/listinfo/quantproject-developers |
|
From: Marco M. <mi...@us...> - 2005-08-28 10:08:25
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17524/b91_QuantProject Modified Files: app.config Log Message: Added new item to app.config file. Index: app.config =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b91_QuantProject/app.config,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** app.config 1 Aug 2005 22:31:48 -0000 1.4 --- app.config 28 Aug 2005 10:08:07 -0000 1.5 *************** *** 1,3 **** ! <?xml version="1.0" encoding="utf-8" ?> <configuration> --- 1,3 ---- ! <?xml version="1.0" encoding="utf-8" ?> <configuration> *************** *** 11,15 **** <add key="TransactionsArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedTransactions\\" /> <add key="GenomesArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedGenomes\\" /> </appSettings> ! </configuration> \ No newline at end of file --- 11,16 ---- <add key="TransactionsArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedTransactions\\" /> <add key="GenomesArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedGenomes\\" /> + <add key="GenericArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\GenericArchive\\" /> </appSettings> ! </configuration> |
|
From: Marco M. <mi...@us...> - 2005-08-28 10:06:36
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17338/b7_Scripts Modified Files: Scripts.prjx Log Message: Updated #develop projects files. Index: Scripts.prjx =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/Scripts.prjx,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Scripts.prjx 21 Aug 2005 10:11:11 -0000 1.11 --- Scripts.prjx 28 Aug 2005 10:06:27 -0000 1.12 *************** *** 50,53 **** --- 50,55 ---- <File name=".\WalkForwardTesting\LinearCombination\OpenToCloseWeeklyStrategy.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> <File name=".\WalkForwardTesting\LinearCombination\OpenToCloseDailyStrategy.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> + <File name=".\WalkForwardTesting\LinearCombination\WalkForwardTest\RunWalkForwardLinearCombination.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> + <File name=".\WalkForwardTesting\LinearCombination\WalkForwardTest\WalkForwardOpenToCloseDailyStrategy.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> <File name=".\EvaluatingOptimizationTechnique" subtype="Directory" buildaction="Compile" dependson="" data="" /> <File name=".\EvaluatingOptimizationTechnique\EfficientPortfolio" subtype="Directory" buildaction="Compile" dependson="" data="" /> |
|
From: Marco M. <mi...@us...> - 2005-08-28 10:05:14
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17128/b7_Scripts/TickerSelectionTesting Modified Files: EndOfDayTimerHandler.cs EndOfDayTimerHandlerCTC.cs EndOfDayTimerHandlerCTO.cs Log Message: Fixed bug in script for the efficient open to close portfolio. Seed for random generation is now changed at each new optimization. Index: EndOfDayTimerHandlerCTO.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerCTO.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** EndOfDayTimerHandlerCTO.cs 1 Aug 2005 22:31:48 -0000 1.16 --- EndOfDayTimerHandlerCTO.cs 28 Aug 2005 10:05:03 -0000 1.17 *************** *** 184,191 **** Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { this.orders.Clear(); //this.oneHourAfterMarketCloseEventHandler_updatePrices(); if(this.numDaysElapsedSinceLastOptimization == ! this.numDaysBetweenEachOptimization) { this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime, false); --- 184,192 ---- Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { + ConstantsProvider.SeedForRandomGenerator++; this.orders.Clear(); //this.oneHourAfterMarketCloseEventHandler_updatePrices(); if(this.numDaysElapsedSinceLastOptimization == ! this.numDaysBetweenEachOptimization - 1) { this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime, false); Index: EndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandler.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** EndOfDayTimerHandler.cs 1 Aug 2005 22:31:48 -0000 1.15 --- EndOfDayTimerHandler.cs 28 Aug 2005 10:05:03 -0000 1.16 *************** *** 212,216 **** this.bestGenomes.Add(new GenomeRepresentation(genome, firstOptimizationDate, ! secondOptimizationDate)); } --- 212,217 ---- this.bestGenomes.Add(new GenomeRepresentation(genome, firstOptimizationDate, ! secondOptimizationDate, ! genome.Generation)); } Index: EndOfDayTimerHandlerCTC.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerCTC.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** EndOfDayTimerHandlerCTC.cs 1 Aug 2005 22:31:48 -0000 1.12 --- EndOfDayTimerHandlerCTC.cs 28 Aug 2005 10:05:03 -0000 1.13 *************** *** 193,197 **** Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! if(this.account.Portfolio.Count == 0 ) { --- 193,197 ---- Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! ConstantsProvider.SeedForRandomGenerator++; if(this.account.Portfolio.Count == 0 ) { |
|
From: Marco M. <mi...@us...> - 2005-08-28 10:03:00
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/EvaluatingOptimizationTechnique/EfficientPortfolio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16908/b7_Scripts/EvaluatingOptimizationTechnique/EfficientPortfolio Modified Files: RunTestingOptimizationOpenToClose.cs Log Message: RunTestingOptimizationOpenToClose now saves a log file to disk at the end of the test. Index: RunTestingOptimizationOpenToClose.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/EvaluatingOptimizationTechnique/EfficientPortfolio/RunTestingOptimizationOpenToClose.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RunTestingOptimizationOpenToClose.cs 20 Aug 2005 16:08:48 -0000 1.1 --- RunTestingOptimizationOpenToClose.cs 28 Aug 2005 10:02:52 -0000 1.2 *************** *** 23,26 **** --- 23,27 ---- using System; using System.Data; + using System.IO; using QuantProject.ADT; *************** *** 46,49 **** --- 47,51 ---- private int numDaysForLiquidity; private int populationSizeForGeneticOptimizer; + private int generationNumberForGeneticOptimizer; private string benchmark; private DateTime marketDate; *************** *** 52,64 **** private int numDaysAfterLastOptimizationDay; private int numberOfSubsets; public RunTestingOptimizationOpenToClose(string tickerGroupID, int numberOfEligibleTickers, ! int numberOfTickersToBeChosen, int numDaysForLiquidity, ! int populationSizeForGeneticOptimizer, string benchmark, DateTime marketDate, double targetReturn, ! PortfolioType portfolioType, int numDaysAfterLastOptimizationDay) { ! this.fitnessesInSample = new double[populationSizeForGeneticOptimizer]; ! this.fitnessesOutOfSample = new double[populationSizeForGeneticOptimizer]; this.tickerGroupID = tickerGroupID; this.numberOfEligibleTickers = numberOfEligibleTickers; --- 54,72 ---- private int numDaysAfterLastOptimizationDay; private int numberOfSubsets; + private Genome[] genomesToTestOutOfSample; + private int numberOfGenomesToTest; public RunTestingOptimizationOpenToClose(string tickerGroupID, int numberOfEligibleTickers, ! int numberOfTickersToBeChosen, int numDaysForLiquidity, ! int generationNumberForGeneticOptimizer, int populationSizeForGeneticOptimizer, ! string benchmark, DateTime marketDate, double targetReturn, ! PortfolioType portfolioType, int numDaysAfterLastOptimizationDay, ! int numberOfSubsets, int numberOfGenomesToTest) { ! this.numberOfGenomesToTest = numberOfGenomesToTest; ! this.genomesToTestOutOfSample = new Genome[numberOfGenomesToTest]; ! this.fitnessesInSample = new double[numberOfGenomesToTest]; ! this.fitnessesOutOfSample = new double[numberOfGenomesToTest]; this.tickerGroupID = tickerGroupID; this.numberOfEligibleTickers = numberOfEligibleTickers; *************** *** 66,69 **** --- 74,78 ---- this.numDaysForLiquidity = numDaysForLiquidity; this.populationSizeForGeneticOptimizer = populationSizeForGeneticOptimizer; + this.generationNumberForGeneticOptimizer = generationNumberForGeneticOptimizer; this.benchmark = benchmark; this.marketDate = marketDate; *************** *** 71,76 **** this.portfolioType = portfolioType; this.numDaysAfterLastOptimizationDay = numDaysAfterLastOptimizationDay; ! this.numberOfSubsets = 5; ! } private DataTable getSetOfTickersToBeOptimized(DateTime date) --- 80,86 ---- this.portfolioType = portfolioType; this.numDaysAfterLastOptimizationDay = numDaysAfterLastOptimizationDay; ! this.numberOfSubsets = numberOfSubsets; ! ! } private DataTable getSetOfTickersToBeOptimized(DateTime date) *************** *** 138,150 **** } ! private void setFitnesses_setFitnessesActually(GeneticOptimizer GO) { ! for(int i = 0; i<GO.CurrentGeneration.Count; i++) { ! this.fitnessesInSample[i]=((Genome)GO.CurrentGeneration[i]).Fitness; this.fitnessesOutOfSample[i]= ! this.setFitnesses_setFitnessesActually_getFitnessOutOfSample((Genome)GO.CurrentGeneration[i]); } --- 148,171 ---- } ! private void setFitnesses_setFitnessesActually_setGenomesToTestOutOfSample(GeneticOptimizer GO) { + Random random = new Random(10); + for(int i = 0; i<this.numberOfGenomesToTest; i++) + { + this.genomesToTestOutOfSample[i]= + (Genome)GO.CurrentGeneration[random.Next(this.populationSizeForGeneticOptimizer)]; + } + Array.Sort(this.genomesToTestOutOfSample); + } + private void setFitnesses_setFitnessesActually(GeneticOptimizer GO) ! { ! this.setFitnesses_setFitnessesActually_setGenomesToTestOutOfSample(GO); ! for(int i = 0; i<this.numberOfGenomesToTest; i++) { ! this.fitnessesInSample[i]=(this.genomesToTestOutOfSample[i]).Fitness; this.fitnessesOutOfSample[i]= ! this.setFitnesses_setFitnessesActually_getFitnessOutOfSample(this.genomesToTestOutOfSample[i]); } *************** *** 167,171 **** GeneticOptimizer GO = new GeneticOptimizer(genManEfficientCTOPortfolio, this.populationSizeForGeneticOptimizer, ! 0, ConstantsProvider.SeedForRandomGenerator); --- 188,192 ---- GeneticOptimizer GO = new GeneticOptimizer(genManEfficientCTOPortfolio, this.populationSizeForGeneticOptimizer, ! this.generationNumberForGeneticOptimizer, ConstantsProvider.SeedForRandomGenerator); *************** *** 181,184 **** --- 202,210 ---- new OptimizationTechniqueEvaluator(this.fitnessesInSample, this.fitnessesOutOfSample); + this.run_writeToLogFile(evaluator); + } + + private void run_writeToLogFile(OptimizationTechniqueEvaluator evaluator) + { double[] averagesInSample = evaluator.GetAveragesOfSubsetsInSample(this.numberOfSubsets); *************** *** 186,190 **** evaluator.GetAveragesOfSubsetsOutOfSample(this.numberOfSubsets); double r = evaluator.GetCorrelationBetweenFitnesses(); ! } } } --- 212,245 ---- evaluator.GetAveragesOfSubsetsOutOfSample(this.numberOfSubsets); double r = evaluator.GetCorrelationBetweenFitnesses(); ! GenomeCounter genomeCounter = new GenomeCounter(this.genomesToTestOutOfSample); ! int differentEvaluatedGenomes = genomeCounter.TotalEvaluatedGenomes; ! string pathFile = System.Configuration.ConfigurationSettings.AppSettings["GenericArchive"] + ! "\\OpenToCloseOptimizationEvaluation.txt"; ! StreamWriter w = File.AppendText(pathFile); ! w.WriteLine ("\n----------------------------------------------\r\n"); ! w.Write("\r\nNew Test for Evaluation of Open To Close Optimization {0}\r", DateTime.Now.Date.ToLongDateString()); ! w.WriteLine ("\n----------------------------------------------"); ! w.Write("\r\nFitnesses compared: {0}\r", this.fitnessesInSample.Length.ToString()); ! w.Write("\r\nDifferent evaluated genomes: {0}\r", differentEvaluatedGenomes.ToString()); ! w.Write("\r\nAverages of the {0} sub sets of fitnesses In Sample:\r", ! this.numberOfSubsets); ! // ! for(int i = 0; i<averagesInSample.Length; i++) ! w.WriteLine("\n{0}-->{1}", i.ToString(), averagesInSample[i].ToString()); ! ! w.WriteLine ("\n\n----------------------------------------------"); ! w.Write("\r\nAverages of the {0} sub sets of fitnesses Out of Sample:\r", ! this.numberOfSubsets); ! // ! for(int i = 0; i<averagesOutOfSample.Length; i++) ! w.WriteLine("\n{0}-->{1}", i.ToString(), averagesOutOfSample[i].ToString()); ! w.WriteLine ("\n\n----------------------------------------------"); ! // ! w.Write("\r\nCorrelation coefficient between fitnesses: {0}\r", r.ToString()); ! w.WriteLine ("\n-----------------End of Test------------------\r\n"); ! // Update the underlying file. ! w.Flush(); ! w.Close(); ! } } } |
|
From: Marco M. <mi...@us...> - 2005-08-28 09:59:46
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16126/b1_ADT/Optimizing/Genetic Modified Files: Genome.cs Log Message: Added new property "Generation" to Genome object Index: Genome.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic/Genome.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Genome.cs 3 Aug 2005 23:05:23 -0000 1.7 --- Genome.cs 28 Aug 2005 09:59:36 -0000 1.8 *************** *** 87,90 **** --- 87,100 ---- } + /// <summary> + /// Returns the generation at which + /// the current genome has been generated + /// by the Genetic Optimizer + /// </summary> + public int Generation + { + get{return this.genomeManager.CurrentGeneticOptimizer.GenerationCounter;} + } + //implementation of IComparable interface public int CompareTo(object obj) { |
|
From: Marco M. <mi...@us...> - 2005-08-28 09:58:36
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15921/b1_ADT/Optimizing/Genetic Modified Files: GenomeCounter.cs Log Message: Added new constructor to GenomeCounter. Index: GenomeCounter.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic/GenomeCounter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GenomeCounter.cs 31 Jul 2005 20:07:28 -0000 1.2 --- GenomeCounter.cs 28 Aug 2005 09:58:27 -0000 1.3 *************** *** 60,63 **** --- 60,76 ---- } + public GenomeCounter(Genome[] genomesToBeCounted) + { + this.geneticOptimizer = null; + this.fitnessCollector = new Hashtable(); + foreach(Genome genome in genomesToBeCounted) + { + if(!this.fitnessCollector.ContainsKey(genome.Fitness)) + //the hashtable fitnessCollector doesn't contain the + //current genome's fitness, yet + this.fitnessCollector.Add(genome.Fitness, null); + } + } + private void addNewGenome(Object sender, NewGenerationEventArgs newGenerationEventArgs) |
|
From: Marco M. <mi...@us...> - 2005-08-28 09:57:13
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15683/b7_Scripts/TickerSelectionTesting Modified Files: RunEfficientPortfolio.cs Log Message: Updated code for saving OptimizationOutput to disk. Index: RunEfficientPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/RunEfficientPortfolio.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** RunEfficientPortfolio.cs 22 Aug 2005 22:17:43 -0000 1.14 --- RunEfficientPortfolio.cs 28 Aug 2005 09:57:02 -0000 1.15 *************** *** 244,248 **** // this.checkDateForReport_createDirIfNotPresent(dirNameWhereToSaveBestGenomes); ! ObjectArchiver.Archive(new OptimizationOutput(), dirNameWhereToSaveBestGenomes + fileName + ".bgn"); --- 244,251 ---- // this.checkDateForReport_createDirIfNotPresent(dirNameWhereToSaveBestGenomes); ! OptimizationOutput optimizationOutput = new OptimizationOutput(); ! foreach(GenomeRepresentation genomeRepresentation in this.endOfDayTimerHandler.BestGenomes) ! optimizationOutput.Add(genomeRepresentation); ! ObjectArchiver.Archive(optimizationOutput, dirNameWhereToSaveBestGenomes + fileName + ".bgn"); |
|
From: Marco M. <mi...@us...> - 2005-08-27 19:21:44
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3981/Downloader/TickerSelectors Modified Files: TickerGroupsViewer.cs Log Message: Modified database's structure. New fields added to tickers_tickerGroups table. Index: TickerGroupsViewer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors/TickerGroupsViewer.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TickerGroupsViewer.cs 10 Jun 2005 18:35:30 -0000 1.8 --- TickerGroupsViewer.cs 27 Aug 2005 19:21:35 -0000 1.9 *************** *** 32,35 **** --- 32,36 ---- using QuantProject.Data.DataTables; using QuantProject.Data.Selectors; + using QuantProject.ADT; namespace QuantProject.Applications.Downloader.TickerSelectors *************** *** 539,543 **** this.oleDbConnection.Open(); this.oleDbDataAdapter.SelectCommand.CommandText = ! "SELECT ttTiId, tiCompanyName, ttTgId FROM tickers INNER JOIN " + "tickers_tickerGroups ON tickers.tiTicker = tickers_tickerGroups.ttTiId WHERE ttTgId ='" + (string)selectedNode.Tag + "'"; --- 540,544 ---- this.oleDbConnection.Open(); this.oleDbDataAdapter.SelectCommand.CommandText = ! "SELECT DISTINCT ttTiId, tiCompanyName, ttTgId FROM tickers INNER JOIN " + "tickers_tickerGroups ON tickers.tiTicker = tickers_tickerGroups.ttTiId WHERE ttTgId ='" + (string)selectedNode.Tag + "'"; *************** *** 760,786 **** } ! private bool isRowInsertedInDataBase(DataRow row) { ! try ! { ! this.oleDbDataAdapter.InsertCommand = ! new OleDbCommand("INSERT INTO tickers_tickerGroups(ttTiId, ttTgId) " + ! "VALUES('" + (string)row[0] + "','" + ! (string)this.treeViewGroups.SelectedNode.Tag + "')", this.oleDbConnection); ! if(this.oleDbDataAdapter.InsertCommand.ExecuteNonQuery()>0) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! catch(Exception ex) ! { ! string neverUsed = ex.ToString(); ! return false; ! } ! } --- 761,770 ---- } ! private void insertRow(DataRow row) { ! QuantProject.DataAccess.Tables.Tickers_tickerGroups.Add((string)row[0], ! (string)this.treeViewGroups.SelectedNode.Tag, ! EventType.Entry, ! ConstantsProvider.DefaultDateForTickersAddedToGroups); } *************** *** 831,846 **** if(this.oleDbConnection.State != ConnectionState.Open) this.oleDbConnection.Open(); - int numRowsInserted = 0; foreach (DataRow row in tickers.Rows) ! { ! if(this.isRowInsertedInDataBase(row)) ! numRowsInserted ++; ! } ! if(numRowsInserted != tickers.Rows.Count) ! MessageBox.Show("Some selected tickers have not been added", ! "Warning after paste operation", MessageBoxButtons.OK, ! MessageBoxIcon.Exclamation); this.updateListView(this.treeViewGroups.SelectedNode); - } catch(Exception ex) --- 815,821 ---- if(this.oleDbConnection.State != ConnectionState.Open) this.oleDbConnection.Open(); foreach (DataRow row in tickers.Rows) ! this.insertRow(row); this.updateListView(this.treeViewGroups.SelectedNode); } catch(Exception ex) |
|
From: Marco M. <mi...@us...> - 2005-08-27 19:20:44
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/Selectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3761/b3_Data/Selectors Modified Files: SelectorByGroup.cs Log Message: Modified database's structure. New fields added to tickers_tickerGroups table. GetTableOfSelectedTickers in SelectorByGroup now selects tickers belonging to the specified group at a given date, when SelectorByGroup has been instantiated with a particular date. Index: SelectorByGroup.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/Selectors/SelectorByGroup.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SelectorByGroup.cs 29 Jul 2005 13:27:40 -0000 1.1 --- SelectorByGroup.cs 27 Aug 2005 19:20:26 -0000 1.2 *************** *** 31,48 **** { /// <summary> ! /// Class for selection on tickers by groupId /// </summary> public class SelectorByGroup : ITickerSelector { private string groupID; ! public SelectorByGroup( string groupID ) { this.groupID = groupID; ! } public DataTable GetTableOfSelectedTickers() { ! return QuantProject.DataAccess.Tables.Tickers_tickerGroups.GetTickers( this.groupID ); } public void SelectAllTickers() --- 31,71 ---- { /// <summary> ! /// Class for selection on tickers by groupId only or groupId and date /// </summary> public class SelectorByGroup : ITickerSelector { private string groupID; ! private DateTime date = new DateTime(1900,1,1); ! ! /// <summary> ! /// Creates an new instance of SelectorByGroup, in order ! /// to get tickers contained in the given group ! /// </summary> ! /// <param name="groupID">Group's code for which tickers are to be selected</param> public SelectorByGroup( string groupID ) { this.groupID = groupID; ! } ! ! /// <summary> ! /// Creates an new instance of SelectorByGroup, in order ! /// to get tickers contained in the given group ! /// </summary> ! /// <param name="groupID">Group's code for which tickers are to be selected</param> ! /// <param name="date">The date at which tickers to be selected belong effectively ! /// to the given group</param> ! public SelectorByGroup( string groupID, DateTime date ) ! { ! this.groupID = groupID; ! this.date = date; ! } public DataTable GetTableOfSelectedTickers() { ! if(this.date.CompareTo(new DateTime(1900,1,1)) == 0) ! //date has not be set by the user because it is still equal to default value ! return QuantProject.DataAccess.Tables.Tickers_tickerGroups.GetTickers( this.groupID ); ! else ! return QuantProject.DataAccess.Tables.Tickers_tickerGroups.GetTickers( this.groupID, this.date ); } public void SelectAllTickers() |
|
From: Marco M. <mi...@us...> - 2005-08-27 19:20:44
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3761/b2_DataAccess/Tables Modified Files: Tickers_tickerGroups.cs Added Files: EventType.cs Log Message: Modified database's structure. New fields added to tickers_tickerGroups table. GetTableOfSelectedTickers in SelectorByGroup now selects tickers belonging to the specified group at a given date, when SelectorByGroup has been instantiated with a particular date. --- NEW FILE: EventType.cs --- /* QuantProject - Quantitative Finance Library EventType.cs Copyright (C) 2004 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; namespace QuantProject.DataAccess.Tables { /// <summary> /// Enum used by tickers_tickerGroups object for ttEventType values /// </summary> public enum EventType { Entry, Exit } } Index: Tickers_tickerGroups.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Tickers_tickerGroups.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Tickers_tickerGroups.cs 5 Sep 2004 13:49:31 -0000 1.5 --- Tickers_tickerGroups.cs 27 Aug 2005 19:20:26 -0000 1.6 *************** *** 40,43 **** --- 40,45 ---- public static string GroupID = "ttTgId"; public static string Ticker = "ttTiId"; + public static string EventTypeFieldName = "ttEventType"; + public static string EventDate = "ttEventDate"; public Tickers_tickerGroups() *************** *** 80,83 **** --- 82,110 ---- } } + + private static string insert_getEventTypeCode(EventType eventType) + { + string returnValue = "I";//default value for Exit eventType + switch (eventType) + { + case EventType.Exit: + returnValue = "O"; + break; + } + return returnValue; + + } + + /// <summary> + /// Adds a new row into tickers_tickerGroups + /// </summary> + public static void Add( string ticker, string groupId, EventType eventType, + DateTime eventDate) + { + string eventTypeCode = insert_getEventTypeCode(eventType); + SqlExecutor.ExecuteNonQuery("INSERT INTO tickers_tickerGroups(ttTiId, ttTgId, ttEventType, ttEventDate) " + + "VALUES('" + ticker + "','" + groupId + "','" + eventTypeCode + + "'," + SQLBuilder.GetDateConstant(eventDate)+ ")"); + } /// <summary> *************** *** 104,111 **** { /// TO DO use a join in order to return a table with tiTicker and company name ! return SqlExecutor.GetDataTable("SELECT " + Tickers_tickerGroups.Ticker + " FROM tickers_tickerGroups " + "WHERE " + Tickers_tickerGroups.GroupID + "='" + groupID + "'"); } /* /// <summary> --- 131,185 ---- { /// TO DO use a join in order to return a table with tiTicker and company name ! return SqlExecutor.GetDataTable("SELECT DISTINCT " + Tickers_tickerGroups.Ticker + " FROM tickers_tickerGroups " + "WHERE " + Tickers_tickerGroups.GroupID + "='" + groupID + "'"); } + + private static void getTickers_createView(string viewName, + string sqlStatement) + { + try + { + string sqlForViewCreation = "CREATE VIEW " + viewName + " AS " + sqlStatement; + SqlExecutor.ExecuteNonQuery(sqlForViewCreation); + } + catch(Exception ex) + { + ex = ex; + } + } + + /// <summary> + /// It returns a table containing tickers effectively contained + /// in the given group at the given Date + /// </summary> + public static DataTable GetTickers( string groupID, DateTime date) + { + + string sqlLastEntries = "SELECT tickers_tickerGroups.ttTgId AS GroupIDEntries, " + + "tickers_tickerGroups.ttTiId AS TickerIDEntries, Max(tickers_tickerGroups.ttEventDate) " + + "AS MaxEntryDate FROM tickers_tickerGroups WHERE " + + "tickers_tickerGroups.ttEventType='I' " + + "GROUP BY tickers_tickerGroups.ttTgId, tickers_tickerGroups.ttTiId"; + getTickers_createView("Entries", sqlLastEntries); + + string sqlLastExits = "SELECT tickers_tickerGroups.ttTgId AS GroupIDExits, " + + "tickers_tickerGroups.ttTiId AS TickerIDExits, Max(tickers_tickerGroups.ttEventDate) " + + "AS MaxExitDate FROM tickers_tickerGroups WHERE " + + "tickers_tickerGroups.ttEventType='O' " + + "GROUP BY tickers_tickerGroups.ttTgId, tickers_tickerGroups.ttTiId"; + + getTickers_createView("Exits", sqlLastExits); + + string sqlTickersAtTheGivenDate = "SELECT GroupIDEntries, " + + "TickerIDEntries FROM Entries LEFT JOIN Exits " + + "ON (Entries.GroupIDEntries = Exits.GroupIDExits) AND " + + "(Entries.TickerIDEntries = Exits.TickerIDExits) WHERE " + + "GroupIDEntries ='" + groupID + "' AND " + + "MaxEntryDate<=" + SQLBuilder.GetDateConstant(date) + " AND " + + "(MaxExitDate Is Null OR MaxEntryDate>Exits.MaxExitDate)"; + + return SqlExecutor.GetDataTable(sqlTickersAtTheGivenDate); + } /* /// <summary> |
|
From: Marco M. <mi...@us...> - 2005-08-27 19:20:44
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3761/b1_ADT Modified Files: ConstantsProvider.cs Log Message: Modified database's structure. New fields added to tickers_tickerGroups table. GetTableOfSelectedTickers in SelectorByGroup now selects tickers belonging to the specified group at a given date, when SelectorByGroup has been instantiated with a particular date. Index: ConstantsProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ConstantsProvider.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ConstantsProvider.cs 31 Jul 2005 20:03:31 -0000 1.13 --- ConstantsProvider.cs 27 Aug 2005 19:20:26 -0000 1.14 *************** *** 37,40 **** --- 37,42 ---- // for GeneticOptimizer (used by CalculateRandomFitness() in order //to update averageRandomFitness and standardDeviationOfRandomFitness properties + public static DateTime DefaultDateForTickersAddedToGroups = new DateTime(1980,1,1); + //conventional date for new tickers added to groups |
|
From: Marco M. <mi...@us...> - 2005-08-27 19:20:44
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3761/b2_DataAccess Modified Files: DataBaseVersionManager.cs b2_DataAccess.csproj Log Message: Modified database's structure. New fields added to tickers_tickerGroups table. GetTableOfSelectedTickers in SelectorByGroup now selects tickers belonging to the specified group at a given date, when SelectorByGroup has been instantiated with a particular date. Index: b2_DataAccess.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/b2_DataAccess.csproj,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** b2_DataAccess.csproj 20 Jan 2005 19:12:28 -0000 1.15 --- b2_DataAccess.csproj 27 Aug 2005 19:20:26 -0000 1.16 *************** *** 138,141 **** --- 138,146 ---- /> <File + RelPath = "Tables\EventType.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Tables\FaultyTickers.cs" SubType = "Code" Index: DataBaseVersionManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DataBaseVersionManager.cs 1 Dec 2004 22:47:00 -0000 1.14 --- DataBaseVersionManager.cs 27 Aug 2005 19:20:26 -0000 1.15 *************** *** 26,29 **** --- 26,30 ---- using System.Data; using System.Collections; + using QuantProject.ADT; *************** *** 66,73 **** this.updatingMethods.Add(new updatingMethodHandler(this.createTables)); this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddPrimaryKeys)); ! this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddForeignKeys)); ! this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddIndexes)); this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddColumns)); this.updatingMethods.Add(new updatingMethodHandler(this.dropTables)); } --- 67,76 ---- this.updatingMethods.Add(new updatingMethodHandler(this.createTables)); this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddPrimaryKeys)); ! this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesRemovePrimaryKeys)); ! this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddForeignKeys)); ! this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddIndexes)); this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddColumns)); this.updatingMethods.Add(new updatingMethodHandler(this.dropTables)); + this.updatingMethods.Add(new updatingMethodHandler(this.updateTables)); } *************** *** 160,166 **** this.executeCommand("ALTER TABLE tickerGroups ADD CONSTRAINT PKtgId PRIMARY KEY (tgId)"); this.executeCommand("ALTER TABLE validatedTickers ADD CONSTRAINT myKey PRIMARY KEY ( vtTicker )"); ! this.executeCommand("ALTER TABLE tickers_tickerGroups " + ! "ADD CONSTRAINT PKttTgId_ttTiId PRIMARY KEY ( ttTgId, ttTiId)"); } private void alterTablesAddForeignKeys() { --- 163,174 ---- this.executeCommand("ALTER TABLE tickerGroups ADD CONSTRAINT PKtgId PRIMARY KEY (tgId)"); this.executeCommand("ALTER TABLE validatedTickers ADD CONSTRAINT myKey PRIMARY KEY ( vtTicker )"); ! //this.executeCommand("ALTER TABLE tickers_tickerGroups " + ! // "ADD CONSTRAINT PKttTgId_ttTiId PRIMARY KEY ( ttTgId, ttTiId)"); } + + private void alterTablesRemovePrimaryKeys() + { + this.executeCommand("DROP INDEX PKttTgId_ttTiId ON tickers_tickerGroups"); + } private void alterTablesAddForeignKeys() { *************** *** 177,184 **** --- 185,201 ---- this.executeCommand("ALTER TABLE validatedTickers " + "ADD COLUMN vtEditDate DATETIME"); + this.executeCommand("ALTER TABLE tickers_tickerGroups " + + "ADD COLUMN ttEventType TEXT(1) NOT NULL"); + this.executeCommand("ALTER TABLE tickers_tickerGroups " + + "ADD COLUMN ttEventDate DATETIME NOT NULL"); } private void alterTablesAddIndexes() { //add code here for adding indexes to existing tables; + this.executeCommand("CREATE INDEX " + + "PK_ttTgId_ttTiId_ttEventDate_ttEventDate " + + "ON tickers_tickerGroups " + + "(ttTgId, ttTiId, ttEventType, ttEventDate) "+ + "WITH PRIMARY"); } *************** *** 187,190 **** --- 204,220 ---- this.executeCommand("DROP TABLE version"); this.executeCommand("DROP TABLE visuallyValidatedTickers"); + } + + //inserts new rows or updates + //existing rows in tables after structure's modifications + private void updateTables() + { + this.executeCommand("UPDATE tickers_tickerGroups " + + "SET tickers_tickerGroups.ttEventType ='I', " + + "tickers_tickerGroups.ttEventDate =" + + SQLBuilder.GetDateConstant(ConstantsProvider.DefaultDateForTickersAddedToGroups) + " " + + "WHERE tickers_tickerGroups.ttEventType Is Null " + + "AND tickers_tickerGroups.ttEventDate Is Null"); + } private void executeCommand(string commandToBeExecuted) |
|
From: marco\.milletti\@l <mar...@li...> - 2005-08-24 07:40:12
|
> At 10:20 AM 8/23/2005 +0200, you wrote:
> > >
> > this.checkDateForR=
eport_createDirIfNotPresent(dirNameWhereToSaveBestGenomes);
> > > ! =
ObjectArchiver.Archive(new
> > OptimizationOutput(this.startDateTim=
e.DateTime,
> > >
> > !
> > this.endDateTime.DateTime,
> > >
> > =
!
> > this.endOfDayTimerHandler.BestGenomes),
> > > =
dirNameWhereToSaveBestGenomes +
> > > =
fileName + ".bgn");
> > > --- 244,248 ----
> > > //=
> > >
> > this.checkDateForReport_createDirIfNotPresent(dirNameWhereT=
oSaveBestGenomes);
> > > ! ObjectArchiver.Archive(new Optimizati=
onOutput(),
> > > dirNameWhereToSaveBest=
Genomes +
> > > fileName + ".bgn");
> >=
> >Forse mi =E8 sfuggito qualcosa: ma adesso i bestGenomes che io salvo=
> >nell'handler che fine fanno?
>
> Cacchio... scusa, credo di aver=
dimenticato un passaggio. Come vedi ho
> tolto i firstDateDate e lastD=
ateTime che, a livello di OptimizationOutput
> non hanno piu' senso.=0D
=
> Adesso funziona cosi': l'OptimizationOutput deve essere creato all'iniz=
io,
> poi ogni volta si aggiunge un GenomeRepresentation all'Optimizati=
onOutput;
> alla fine si salva.
> Non avevo capito che RunEfficientPor=
tfolio salvasse sempre i genoma. Puoi
> fare le modifiche del caso?
=0D
=
OK, ci penso io.=0A=0A=0A=0A_____________________________________________=
_______________=0A6X velocizzare la tua navigazione a 56k? 6X Web Acceler=
ator di Libero!=0AScaricalo su INTERNET GRATIS 6X http://www.libero.it=0A=
|
|
From: Glauco S. <gl...@my...> - 2005-08-23 16:53:50
|
At 10:20 AM 8/23/2005 +0200, you wrote: > >=20 >= this.checkDateForReport_createDirIfNotPresent(dirNameWhereToSaveBestGenomes= ); > > ! ObjectArchiver.Archive(new=20 > OptimizationOutput(this.startDateTime.DateTime, > >=20 > !=20 > this.endDateTime.DateTime, > >=20 > !=20 > this.endOfDayTimerHandler.BestGenomes), > > dirNameWhereToSaveBestGenomes + > > fileName + ".bgn"); > > --- 244,248 ---- > > // > >=20 >= this.checkDateForReport_createDirIfNotPresent(dirNameWhereToSaveBestGenomes= ); > > ! ObjectArchiver.Archive(new OptimizationOutput(), > > dirNameWhereToSaveBestGenomes + > > fileName + ".bgn"); > >Forse mi =E8 sfuggito qualcosa: ma adesso i bestGenomes che io salvo=20 >nell'handler che fine fanno? Cacchio... scusa, credo di aver dimenticato un passaggio. Come vedi ho=20 tolto i firstDateDate e lastDateTime che, a livello di OptimizationOutput=20 non hanno piu' senso. Adesso funziona cosi': l'OptimizationOutput deve essere creato all'inizio,= =20 poi ogni volta si aggiunge un GenomeRepresentation all'OptimizationOutput;= =20 alla fine si salva. Non avevo capito che RunEfficientPortfolio salvasse sempre i genoma. Puoi=20 fare le modifiche del caso? |
|
From: marco\.milletti\@l <mar...@li...> - 2005-08-23 08:20:54
|
> this.checkDateForReport_createDirIfNotPresent(dirNameWhereToSav=
eBestGenomes);
> ! ObjectArchiver.Archive(new OptimizationOutput=
(this.startDateTime.DateTime,
> ! =
this.endDateTime.DateTime,
> ! =
this.endOfDayTimerHandler.BestGenomes),
> =
dirNameWhereToSaveBestGenomes +
> =
fileName + ".bgn");
> --- 244,248 ----
> //=0D
=
> this.checkDateForReport_createDirIfNotPresent(dirNameWhereToSav=
eBestGenomes);
> ! ObjectArchiver.Archive(new OptimizationOutput=
(),
> dirNameWhereToSaveBestGenomes + =0D
=
> fileName + ".bgn");
Forse mi =E8 sfu=
ggito qualcosa: ma adesso i bestGenomes che io salvo nell'handler che fin=
e fanno?
=0A=0A=0A=0A___________________________________________________=
_________=0ALibero Flat, sempre a 4 Mega a 19,95 euro al mese! =0AAbbonat=
i subito su http://www.libero.it=0A=0A
|
|
From: Glauco S. <gla...@us...> - 2005-08-22 22:27:14
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination/WalkForwardTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11871/b7_Scripts/WalkForwardTesting/LinearCombination/WalkForwardTest Modified Files: WalkForwardOpenToCloseDailyStrategy.cs Log Message: The public property OptimizationOutput has been added. It will contain the best genomes, one for each optimization process Index: WalkForwardOpenToCloseDailyStrategy.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination/WalkForwardTest/WalkForwardOpenToCloseDailyStrategy.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WalkForwardOpenToCloseDailyStrategy.cs 11 Aug 2005 23:02:03 -0000 1.1 --- WalkForwardOpenToCloseDailyStrategy.cs 22 Aug 2005 22:27:07 -0000 1.2 *************** *** 56,59 **** --- 56,67 ---- private GeneticOptimizer geneticOptimizer; + private OptimizationOutput optimizationOutput; + + /// best genomes, one for each optimization process + public OptimizationOutput OptimizationOutput + { + get { return this.optimizationOutput; } + } + public WalkForwardOpenToCloseDailyStrategy( Account account , string tickerGroupID , int numDaysForInSampleOptimization , *************** *** 153,156 **** --- 161,175 ---- " - " + DateTime.Now.ToString() ); } + private void addGenomeToBestGenomes( Genome genome, + DateTime firstOptimizationDate , + DateTime lastOptimizationDate ) + { + if( this.optimizationOutput == null) + this.optimizationOutput = new OptimizationOutput(); + + this.optimizationOutput.Add( new GenomeRepresentation( genome , + firstOptimizationDate , + lastOptimizationDate ) ); + } private void oneHourAfterMarketCloseEventHandler_set_signedTickersFromLastOptimization( DateTime currentDate ) *************** *** 165,172 **** this.getSetOfTickersToBeOptimized( optimizationFirstDate , optimizationLastDate ); GenomeManagerForEfficientCTOPortfolio genManEfficientCTOPortfolio = new GenomeManagerForEfficientCTOPortfolio( setOfTickersToBeOptimized , ! currentDate.AddDays( this.numDaysForInSampleOptimization - 1 ) , currentDate , this.numberOfTickersToBeChosen , --- 184,193 ---- this.getSetOfTickersToBeOptimized( optimizationFirstDate , optimizationLastDate ); + Console.WriteLine( "Number of tickers to be optimized: " + + setOfTickersToBeOptimized.Rows.Count.ToString() ); GenomeManagerForEfficientCTOPortfolio genManEfficientCTOPortfolio = new GenomeManagerForEfficientCTOPortfolio( setOfTickersToBeOptimized , ! currentDate.AddDays( -this.numDaysForInSampleOptimization + 1 ) , currentDate , this.numberOfTickersToBeChosen , *************** *** 188,192 **** this.signedTickersFromLastOptimization = (string[])this.geneticOptimizer.BestGenome.Meaning; ! } public void OneHourAfterMarketCloseEventHandler( Object sender , --- 209,214 ---- this.signedTickersFromLastOptimization = (string[])this.geneticOptimizer.BestGenome.Meaning; ! this.addGenomeToBestGenomes( geneticOptimizer.BestGenome , ! optimizationFirstDate , optimizationLastDate ); } public void OneHourAfterMarketCloseEventHandler( Object sender , |
|
From: Glauco S. <gla...@us...> - 2005-08-22 22:25:42
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11670/b7_Scripts/WalkForwardTesting/LinearCombination Modified Files: MainForm.cs Log Message: optimizationOutput is used in place of bestGenomes Index: MainForm.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination/MainForm.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MainForm.cs 10 Aug 2005 16:49:20 -0000 1.5 --- MainForm.cs 22 Aug 2005 22:25:31 -0000 1.6 *************** *** 49,57 **** private GeneticOptimizer GO; ! /// <summary> ! /// bestGenomes[ i ] contains an array list with the best genomes ! /// for generation i ! /// </summary> ! private ArrayList bestGenomes; private System.Windows.Forms.MainMenu mainMenu1; --- 49,53 ---- private GeneticOptimizer GO; ! private OptimizationOutput optimizationOutput; private System.Windows.Forms.MainMenu mainMenu1; *************** *** 189,195 **** newGenerationEventHandler_updateProgressBar( newGenerationEventArgs ); ArrayList generation = newGenerationEventArgs.Generation; ! if ( this.bestGenomes.Count == 0 ) // this is the first generation created and this.bestGenomes is still empty ! this.bestGenomes.Add( new GenomeRepresentation( (Genome)generation[ generation.Count - 1 ] , this.firstDate , --- 185,191 ---- newGenerationEventHandler_updateProgressBar( newGenerationEventArgs ); ArrayList generation = newGenerationEventArgs.Generation; ! if ( this.optimizationOutput.Count == 0 ) // this is the first generation created and this.bestGenomes is still empty ! this.optimizationOutput.Add( new GenomeRepresentation( (Genome)generation[ generation.Count - 1 ] , this.firstDate , *************** *** 198,205 **** for ( int i=0 ; i < generation.Count ; i++ ) if ( ((Genome)generation[ i ]).Fitness > ! ((GenomeRepresentation)this.bestGenomes[ ! this.bestGenomes.Count - 1 ]).Fitness ) // generation[ i ] is a genome better than the best already stored ! this.bestGenomes.Add( new GenomeRepresentation( (Genome)generation[ i ] , this.firstDate , --- 194,201 ---- for ( int i=0 ; i < generation.Count ; i++ ) if ( ((Genome)generation[ i ]).Fitness > ! ((GenomeRepresentation)this.optimizationOutput[ ! this.optimizationOutput.Count - 1 ]).Fitness ) // generation[ i ] is a genome better than the best already stored ! this.optimizationOutput.Add( new GenomeRepresentation( (Genome)generation[ i ] , this.firstDate , *************** *** 212,217 **** new VisualObjectArchiver(); OptimizationOutput optimizationOutput = ! new OptimizationOutput( this.firstDate , this.lastDate , ! this.bestGenomes ); visualObjectArchiver.Save( optimizationOutput , "bgn" , "Save best genomes" ); --- 208,212 ---- new VisualObjectArchiver(); OptimizationOutput optimizationOutput = ! new OptimizationOutput(); visualObjectArchiver.Save( optimizationOutput , "bgn" , "Save best genomes" ); *************** *** 223,227 **** private void createOptimizedGenomes() { ! this.bestGenomes = new ArrayList(); // DataTable setOfTickersToBeOptimized = // this.getSetOfTickersToBeOptimized_quickly(); --- 218,222 ---- private void createOptimizedGenomes() { ! this.optimizationOutput = new OptimizationOutput(); // DataTable setOfTickersToBeOptimized = // this.getSetOfTickersToBeOptimized_quickly(); *************** *** 260,273 **** private void loadBestGenomesFromDisk() { ! if ( this.bestGenomes == null ) { VisualObjectArchiver visualObjectArchiver = new VisualObjectArchiver(); ! OptimizationOutput optimizationOutput = (OptimizationOutput)visualObjectArchiver.Load( "Load best genomes" , "bgn" , "Load Genomes"); ! this.firstDate = optimizationOutput.FirstDate; ! this.lastDate = optimizationOutput.LastDate; ! this.bestGenomes = optimizationOutput.BestGenomes; } } --- 255,271 ---- private void loadBestGenomesFromDisk() { ! if ( this.optimizationOutput == null ) { VisualObjectArchiver visualObjectArchiver = new VisualObjectArchiver(); ! this.optimizationOutput = (OptimizationOutput)visualObjectArchiver.Load( "Load best genomes" , "bgn" , "Load Genomes"); ! if ( this.optimizationOutput.Count == 0 ) ! throw new Exception( "The loaded optimization output contains no element!" ); ! this.firstDate = ((GenomeRepresentation)( ! this.optimizationOutput[ 0 ])).FirstOptimizationDate; ! this.lastDate = ((GenomeRepresentation)( ! this.optimizationOutput[ 0 ])).LastOptimizationDate; } } *************** *** 275,280 **** { TestDisplayer testDisplayer = new TestDisplayer( ! this.firstDate , this.lastDate , this.bestGenomes ); ! this.bestGenomes = null; testDisplayer.Show(); } --- 273,278 ---- { TestDisplayer testDisplayer = new TestDisplayer( ! this.firstDate , this.lastDate , this.optimizationOutput ); ! this.optimizationOutput = null; testDisplayer.Show(); } |
|
From: Glauco S. <gla...@us...> - 2005-08-22 22:24:36
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11532/b7_Scripts/WalkForwardTesting/LinearCombination Modified Files: VisualObjectArchiver.cs Log Message: A default file suffix is supported now Index: VisualObjectArchiver.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination/VisualObjectArchiver.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VisualObjectArchiver.cs 13 Jul 2005 16:50:27 -0000 1.1 --- VisualObjectArchiver.cs 22 Aug 2005 22:24:28 -0000 1.2 *************** *** 62,66 **** --- 62,69 ---- this.saveFileDialog = new SaveFileDialog(); this.saveFileDialog.DefaultExt = suffix; + this.saveFileDialog.Filter = suffix + " files (*."+ + suffix + ")|*." + suffix; this.saveFileDialog.Title = title; + this.saveFileDialog.FileName = title; this.saveFileDialog.InitialDirectory = initialDirectory; this.saveFileDialog.AddExtension = true; *************** *** 85,92 **** System.Configuration.ConfigurationSettings.AppSettings["ReportsArchive"] ); } ! private string getPath( string title ) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Title = title; openFileDialog.Multiselect = false; openFileDialog.CheckFileExists = true; --- 88,97 ---- System.Configuration.ConfigurationSettings.AppSettings["ReportsArchive"] ); } ! private string getPath( string title , string suffix ) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Title = title; + openFileDialog.Filter = suffix + " files (*."+ + suffix + ")|*." + suffix; openFileDialog.Multiselect = false; openFileDialog.CheckFileExists = true; *************** *** 97,101 **** string title , string initialDirectory ) { ! string chosenPath = this.getPath( title ); return ObjectArchiver.Extract( chosenPath ); } --- 102,106 ---- string title , string initialDirectory ) { ! string chosenPath = this.getPath( title , suffix ); return ObjectArchiver.Extract( chosenPath ); } |
|
From: Glauco S. <gla...@us...> - 2005-08-22 22:23:24
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination/WalkForwardTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11390/b7_Scripts/WalkForwardTesting/LinearCombination/WalkForwardTest Modified Files: RunWalkForwardLinearCombination.cs Log Message: A default title is provided to the OptimizationOuput's save form Index: RunWalkForwardLinearCombination.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination/WalkForwardTest/RunWalkForwardLinearCombination.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RunWalkForwardLinearCombination.cs 11 Aug 2005 23:01:27 -0000 1.1 --- RunWalkForwardLinearCombination.cs 22 Aug 2005 22:23:16 -0000 1.2 *************** *** 59,63 **** private HistoricalEndOfDayTimer historicalEndOfDayTimer; private Account account; ! private IEndOfDayStrategy endOfDayStrategy; public RunWalkForwardLinearCombination(string tickerGroupID, --- 59,63 ---- private HistoricalEndOfDayTimer historicalEndOfDayTimer; private Account account; ! private WalkForwardOpenToCloseDailyStrategy endOfDayStrategy; public RunWalkForwardLinearCombination(string tickerGroupID, *************** *** 155,158 **** --- 155,172 ---- // @"C:\Documents and Settings\Glauco\Desktop\reports\runOneRank.qPr" ); report.Show(); + string title = DateTime.Now.Year.ToString() + "_" + + DateTime.Now.Month.ToString() + "_" + + DateTime.Now.Day.ToString() + "_" + + DateTime.Now.Hour.ToString() + "_" + + DateTime.Now.Minute.ToString() + "_" + + DateTime.Now.Second.ToString() + "_" + + "numDayInSample" + this.numDaysForInSampleOptimization + + "_numEligTick" + this.numberOfEligibleTickers + + "_numDayLiq" + this.numDaysForLiquidity + + "_numTickInPortfolio" + this.numberOfTickersToBeChosen; + VisualObjectArchiver visualObjectArchiver = + new VisualObjectArchiver(); + visualObjectArchiver.Save( this.endOfDayStrategy.OptimizationOutput , + "bgn" , title ); } } |
|
From: Glauco S. <gla...@us...> - 2005-08-22 22:21:47
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11132/b7_Scripts/WalkForwardTesting/LinearCombination Modified Files: OptimizationOutput.cs Log Message: - an ArrayList is inherited now - private members (and corresponding properties) firstDate and lastDate have been removed Index: OptimizationOutput.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination/OptimizationOutput.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OptimizationOutput.cs 23 Jul 2005 17:54:32 -0000 1.1 --- OptimizationOutput.cs 22 Aug 2005 22:21:39 -0000 1.2 *************** *** 31,57 **** /// </summary> [Serializable] ! public class OptimizationOutput { ! private DateTime firstDate; ! public DateTime FirstDate ! { ! get { return this.firstDate; } ! } ! private DateTime lastDate; ! public DateTime LastDate ! { ! get { return this.lastDate; } ! } ! private ArrayList bestGenomes; ! public ArrayList BestGenomes { - get { return this.bestGenomes; } } ! public OptimizationOutput( DateTime firstDate , ! DateTime lastDate , ArrayList bestGenomes ) { ! this.firstDate = firstDate; ! this.lastDate = lastDate; ! this.bestGenomes = bestGenomes; } } --- 31,50 ---- /// </summary> [Serializable] ! public class OptimizationOutput : ArrayList { ! // public ArrayList BestGenomes ! // { ! // get { return this.bestGenomes; } ! // } ! public OptimizationOutput() { } ! /// <summary> ! /// Adds a genome representation ! /// </summary> ! /// <param name="genomeRepresentation"></param> ! public void Add( GenomeRepresentation genomeRepresentation ) { ! base.Add( genomeRepresentation ); } } |
|
From: Glauco S. <gla...@us...> - 2005-08-22 22:17:52
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10320/b7_Scripts/TickerSelectionTesting Modified Files: RunEfficientPortfolio.cs Log Message: A better constructor for OptimizationOutput is used now Index: RunEfficientPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/RunEfficientPortfolio.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** RunEfficientPortfolio.cs 3 Aug 2005 18:55:11 -0000 1.13 --- RunEfficientPortfolio.cs 22 Aug 2005 22:17:43 -0000 1.14 *************** *** 244,250 **** // this.checkDateForReport_createDirIfNotPresent(dirNameWhereToSaveBestGenomes); ! ObjectArchiver.Archive(new OptimizationOutput(this.startDateTime.DateTime, ! this.endDateTime.DateTime, ! this.endOfDayTimerHandler.BestGenomes), dirNameWhereToSaveBestGenomes + fileName + ".bgn"); --- 244,248 ---- // this.checkDateForReport_createDirIfNotPresent(dirNameWhereToSaveBestGenomes); ! ObjectArchiver.Archive(new OptimizationOutput(), dirNameWhereToSaveBestGenomes + fileName + ".bgn"); |
|
From: Marco M. <mi...@us...> - 2005-08-21 10:11:25
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25492/b7_Scripts Modified Files: Scripts.prjx Log Message: Updated #develop projects files. Index: Scripts.prjx =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/Scripts.prjx,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Scripts.prjx 8 Aug 2005 19:16:17 -0000 1.10 --- Scripts.prjx 21 Aug 2005 10:11:11 -0000 1.11 *************** *** 50,53 **** --- 50,57 ---- <File name=".\WalkForwardTesting\LinearCombination\OpenToCloseWeeklyStrategy.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> <File name=".\WalkForwardTesting\LinearCombination\OpenToCloseDailyStrategy.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> + <File name=".\EvaluatingOptimizationTechnique" subtype="Directory" buildaction="Compile" dependson="" data="" /> + <File name=".\EvaluatingOptimizationTechnique\EfficientPortfolio" subtype="Directory" buildaction="Compile" dependson="" data="" /> + <File name=".\EvaluatingOptimizationTechnique\OptimizationTechniqueEvaluator.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> + <File name=".\EvaluatingOptimizationTechnique\EfficientPortfolio\RunTestingOptimizationOpenToClose.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> </Contents> <References> |