quantproject-developers Mailing List for QuantProject (Page 93)
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-03-14 15:02:22
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1087 Added Files: WFLagChosenTickers.cs Log Message: est driving positions and tickers in portfolio, with respect to the lag strategy --- NEW FILE: WFLagChosenTickers.cs --- /* QuantProject - Quantitative Finance Library WFLagChosenTickers.cs Copyright (C) 2003 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Collections; using QuantProject.ADT; using QuantProject.ADT.Collections; using QuantProject.ADT.Optimizing.Genetic; using QuantProject.Business.Timing; namespace QuantProject.Scripts.WalkForwardTesting.WalkForwardLag { /// <summary> /// Best driving positions and tickers in portfolio, /// with respect to the lag strategy /// </summary> public class WFLagChosenTickers : IProgressNotifier { public event NewProgressEventHandler NewProgress; private WFLagEligibleTickers eligibleTickers; private int numberOfDrivingPositions; private int numberOfPositionsToBeChosen; private int inSampleDays; private IEndOfDayTimer endOfDayTimer; private int generationNumberForGeneticOptimizer; private int populationSizeForGeneticOptimizer; private QPHashtable drivingPositions; private QPHashtable portfolioPositions; public QPHashtable DrivingPositions { get { return this.drivingPositions; } } public QPHashtable PortfolioPositions { get { return this.portfolioPositions; } } public WFLagChosenTickers( int numberOfDrivingPositions , int numberOfPositionsToBeChosen , int inSampleDays , IEndOfDayTimer endOfDayTimer , int generationNumberForGeneticOptimizer , int populationSizeForGeneticOptimizer ) { this.eligibleTickers = eligibleTickers; this.numberOfDrivingPositions = numberOfDrivingPositions; this.numberOfPositionsToBeChosen = numberOfPositionsToBeChosen; this.inSampleDays = inSampleDays; this.endOfDayTimer = endOfDayTimer; this.generationNumberForGeneticOptimizer = generationNumberForGeneticOptimizer; this.populationSizeForGeneticOptimizer = populationSizeForGeneticOptimizer; } #region SetSignedTickers // private void setSignedTickers_clearPositions() // { // this.drivingPositions.Clear(); // this.portfolioPositions.Clear(); // } private void newGenerationEventHandler( object sender , NewGenerationEventArgs e ) { this.NewProgress( sender , new NewProgressEventArgs( e.GenerationCounter , e.GenerationNumber ) ); } private void setSignedTickers_setTickersFromGenome( WFLagGenomeManager genomeManager , Genome genome ) { WFLagSignedTickers wFLagSignedTickers = ( WFLagSignedTickers )genomeManager.Decode( genome ); this.drivingPositions = wFLagSignedTickers.DrivingPositions; this.portfolioPositions = wFLagSignedTickers.PortfolioPositions; } public void SetSignedTickers( WFLagEligibleTickers eligibleTickers ) { // this.setSignedTickers_clearPositions(); DateTime firstDate = this.endOfDayTimer.GetCurrentTime().DateTime.AddDays( -( this.inSampleDays - 1 ) ); WFLagGenomeManager genomeManager = new WFLagGenomeManager( eligibleTickers.EligibleTickers , firstDate , this.endOfDayTimer.GetCurrentTime().DateTime , this.numberOfDrivingPositions , this.numberOfPositionsToBeChosen ); GeneticOptimizer geneticOptimizer = new GeneticOptimizer( genomeManager , this.populationSizeForGeneticOptimizer , this.generationNumberForGeneticOptimizer , ConstantsProvider.SeedForRandomGenerator ); geneticOptimizer.NewGeneration += new NewGenerationEventHandler( this.newGenerationEventHandler ); geneticOptimizer.Run( false ); this.setSignedTickers_setTickersFromGenome( genomeManager , geneticOptimizer.BestGenome ); } #endregion } } |
|
From: Glauco S. <gla...@us...> - 2006-03-14 15:01:43
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv579 Added Files: WFLagCandidates.cs Log Message: Set of candidates for the next optimization (close to close returns are computed and stored here). --- NEW FILE: WFLagCandidates.cs --- /* QuantProject - Quantitative Finance Library WFLagCandidates.cs Copyright (C) 2003 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Collections; using System.Data; using QuantProject.Data.DataTables; namespace QuantProject.Scripts.WalkForwardTesting.WalkForwardLag { /// <summary> /// Set of candidates for the next optimization /// (close to close returns are computed and stored here). /// </summary> public class WFLagCandidates { private DataTable eligibleTickers; private DateTime firstQuoteDate; private DateTime lastQuoteDate; private Hashtable closeToCloseReturns; public WFLagCandidates( DataTable eligibleTickers , DateTime firstQuoteDate , DateTime lastQuoteDate ) { this.eligibleTickers = eligibleTickers; this.firstQuoteDate = firstQuoteDate; this.lastQuoteDate = lastQuoteDate; } /// <summary> /// arrays of close to close returns, one for each ticker /// </summary> /// <param name="signedTickers">tickers</param> /// <returns></returns> public float[][] GetTickersReturns( ICollection tickers ) { if ( this.closeToCloseReturns == null ) this.set_closeToCloseReturns(); float[][] tickersReturns = new float[ tickers.Count ][]; int i = 0; foreach ( string ticker in tickers ) { tickersReturns[ i ] = (float[])this.closeToCloseReturns[ ticker ]; i++; } return tickersReturns; } #region set_closeToCloseReturns private float[] getCloseToCloseTickerReturns( string ticker ) { Quotes tickerQuotes = new Quotes( ticker , this.firstQuoteDate , this.lastQuoteDate ); float[] tickerAdjustedCloses = QuantProject.Data.ExtendedDataTable.GetArrayOfFloatFromColumn( tickerQuotes , "quAdjustedClose"); float[] closeToCloseTickerReturns = new float[ tickerAdjustedCloses.Length ]; int i = 0; //index for ratesOfReturns array for( int idx = 0 ; idx < tickerAdjustedCloses.Length - 1 ; idx++ ) { closeToCloseTickerReturns[ i ] = tickerAdjustedCloses[ idx + 1 ] / tickerAdjustedCloses[ idx ] - 1; i++; } return closeToCloseTickerReturns; } private void set_closeToCloseReturns() { this.closeToCloseReturns = new Hashtable(); for( int i = 0 ; i < this.eligibleTickers.Rows.Count ; i++ ) { string ticker = (string)this.eligibleTickers.Rows[ i ][ 0 ]; this.closeToCloseReturns[ ticker ] = this.getCloseToCloseTickerReturns( ticker ); } } #endregion // private void retrieveData() // { // this.closeToCloseReturns = // new double[ this.eligibleTickers.Rows.Count ]; // for(int i = 0; i<this.eligibleTickers.Rows.Count; i++) // { // string ticker = (string)this.eligibleTickers.Rows[i][0]; // this.closeToCloseReturns[i] = new WFLagCandidate( ticker, // this.getArrayOfRatesOfReturn( ticker ) ); // // this.closeToCloseReturns[i] = new CandidateProperties( ticker, // // this.getArrayOfRatesOfReturn( ticker ) ); // } // } } } |
|
From: Glauco S. <gla...@us...> - 2006-03-14 14:59:38
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32399 Added Files: RunWalkForwardLag.cs Log Message: Script to test the Lag strategy on many tickers, chosing the best group when a fixed time span has elapsed. --- NEW FILE: RunWalkForwardLag.cs --- /* QuantProject - Quantitative Finance Library RunWalkForwardLag.cs Copyright (C) 2003 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using QuantProject.ADT; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting; using QuantProject.Business.Financial.Ordering; using QuantProject.Business.Scripting; using QuantProject.Business.Timing; using QuantProject.Presentation.Reporting.WindowsForm; namespace QuantProject.Scripts.WalkForwardTesting.WalkForwardLag { /// <summary> /// Script to test the Lag strategy on many tickers, chosing the best group /// when a fixed time span has elapsed. /// </summary> public class RunWalkForwardLag : Script { private string tickerGroupID; private int numberEligibleTickers; private int numberOfPortfolioPositions; private int numberOfDrivingPositions; private int numberDaysForInSampleOptimization; private int numDaysBetweenEachOptimization; private int generationNumberForGeneticOptimizer; private int populationSizeForGeneticOptimizer; private string benchmark; private DateTime firstDateTime; private DateTime lastDateTime; private double maxRunningHours; private IHistoricalQuoteProvider historicalQuoteProvider; private IEndOfDayTimer endOfDayTimer; private DateTime startingTimeForScript; private Account account; private WFLagEndOfDayTimerHandler endOfDayTimerHandler; public event NewProgressEventHandler InSampleNewProgress; public RunWalkForwardLag( string tickerGroupID , int numberEligibleTickers , int numberOfPortfolioPositions , int numberOfDrivingPositions , int numberDaysForInSampleOptimization , int numDaysBetweenEachOptimization , int generationNumberForGeneticOptimizer , int populationSizeForGeneticOptimizer , string benchmark , DateTime firstDateTime , DateTime lastDateTime , double maxRunningHours ) { this.tickerGroupID = tickerGroupID; this.numberEligibleTickers = numberEligibleTickers; this.numberOfPortfolioPositions = numberOfPortfolioPositions; this.numberOfDrivingPositions = numberOfDrivingPositions; this.numberDaysForInSampleOptimization = numberDaysForInSampleOptimization; this.numDaysBetweenEachOptimization = numDaysBetweenEachOptimization; this.generationNumberForGeneticOptimizer = generationNumberForGeneticOptimizer; this.populationSizeForGeneticOptimizer = populationSizeForGeneticOptimizer; this.benchmark = benchmark; this.firstDateTime = firstDateTime; this.lastDateTime = lastDateTime; this.maxRunningHours = maxRunningHours; } private void run_initializeHistoricalQuoteProvider() { this.historicalQuoteProvider = new HistoricalAdjustedQuoteProvider(); } private void run_initializeEndOfDayTimer() { EndOfDayDateTime endOfDayDateTime = new EndOfDayDateTime( firstDateTime , EndOfDaySpecificTime.MarketOpen ); this.endOfDayTimer = new IndexBasedEndOfDayTimer( endOfDayDateTime , this.benchmark ); } private void run_initializeAccount() { this.account = new Account( "WalkForwardLag" , this.endOfDayTimer , new HistoricalEndOfDayDataStreamer( this.endOfDayTimer , this.historicalQuoteProvider ) , new HistoricalEndOfDayOrderExecutor( this.endOfDayTimer , this.historicalQuoteProvider ) ); } private void run_initializeEndOfDayTimerHandler() { this.endOfDayTimerHandler = new WFLagEndOfDayTimerHandler( this.tickerGroupID , this.benchmark , this.numberEligibleTickers , this.numberOfPortfolioPositions , this.numberOfDrivingPositions , this.numberDaysForInSampleOptimization , this.numDaysBetweenEachOptimization , this.account , this.generationNumberForGeneticOptimizer , this.populationSizeForGeneticOptimizer ); } private void inSampleNewProgressEventHandler( Object sender , NewProgressEventArgs eventArgs ) { if ( !(this.InSampleNewProgress == null) ) this.InSampleNewProgress( this , eventArgs ); Console.WriteLine( eventArgs.CurrentProgress.ToString() + " / " + eventArgs.Goal.ToString() + " - " + DateTime.Now.ToString() ); } private void run_initializeProgressHandlers() { this.endOfDayTimerHandler.InSampleNewProgress += new InSampleNewProgressEventHandler( this.inSampleNewProgressEventHandler ); } public void marketOpenEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { if ( this.account.Transactions.Count == 0 ) this.account.AddCash( 30000 ); } private void oneHourAfterMarketCloseEventHandler_handleProgessBarForm( IEndOfDayTimer endOfDayTimer ) { string progress = "Current out of sample date:" + endOfDayTimer.GetCurrentTime().DateTime.ToString() + " - " + "First date:" + this.firstDateTime.ToString() + " - " + "Last date:" + this.lastDateTime.ToString(); Console.WriteLine( progress ); } public void oneHourAfterMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { if ( ( ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime > this.lastDateTime ) || ( DateTime.Now >= this.startingTimeForScript.AddHours( this.maxRunningHours ) ) ) { // either the simulation has reached the ending date or // too much time elapsed since the simulation started this.account.EndOfDayTimer.Stop(); // this.progressBarForm.Close(); // ObjectArchiver.Archive( this.account , // @"C:\Documents and Settings\Glauco\Desktop\reports\final.qP" ); DateTime lastReportDateTime = this.lastDateTime; if ( ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime < lastReportDateTime ) lastReportDateTime = ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime; Report report = new Report( this.account , this.historicalQuoteProvider ); report.Create( "Walk Forward Lag" , 1 , new EndOfDayDateTime( lastReportDateTime , EndOfDaySpecificTime.OneHourAfterMarketClose ) , this.benchmark ); // WFMultiOneRankReportDebugger wFMultiOneRankReportDebugger = // new WFMultiOneRankReportDebugger( this.numberOfPortfolioPositions , // this.numberDaysForInSampleOptimization , this.benchmark ); // report.TransactionGrid.MouseUp += // new MouseEventHandler( // wFMultiOneRankReportDebugger.MouseClickEventHandler ); report.Show(); } else // the simulation has not reached the ending date, yet this.oneHourAfterMarketCloseEventHandler_handleProgessBarForm( ( IEndOfDayTimer )sender ); } private void run_addEventHandlers() { this.endOfDayTimer.MarketOpen += new MarketOpenEventHandler( this.marketOpenEventHandler ); this.endOfDayTimer.FiveMinutesBeforeMarketClose += new FiveMinutesBeforeMarketCloseEventHandler( this.endOfDayTimerHandler.FiveMinutesBeforeMarketCloseEventHandler ); this.endOfDayTimer.OneHourAfterMarketClose += new OneHourAfterMarketCloseEventHandler( this.endOfDayTimerHandler.OneHourAfterMarketCloseEventHandler ); this.endOfDayTimer.OneHourAfterMarketClose += new OneHourAfterMarketCloseEventHandler( this.oneHourAfterMarketCloseEventHandler ); } public override void Run() { this.startingTimeForScript = DateTime.Now; run_initializeHistoricalQuoteProvider(); run_initializeEndOfDayTimer(); run_initializeAccount(); run_initializeEndOfDayTimerHandler(); // run_initializeProgressBar(); run_initializeProgressHandlers(); run_addEventHandlers(); // this.progressBarForm.Show(); this.endOfDayTimer.Start(); } } } |
|
From: Glauco S. <gla...@us...> - 2006-03-14 14:57:41
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31243/WalkForwardLag Log Message: Directory /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag added to the repository |
|
From: Glauco S. <gla...@us...> - 2006-03-14 14:54:03
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29006/b7_Scripts/WalkForwardTesting/LinearCombination Modified Files: LinearCombinationTest.cs Log Message: MSFT is used as a benchmark, now. Index: LinearCombinationTest.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearCombination/LinearCombinationTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LinearCombinationTest.cs 8 Jan 2006 23:33:52 -0000 1.4 --- LinearCombinationTest.cs 14 Mar 2006 14:53:54 -0000 1.5 *************** *** 121,125 **** new IndexBasedEndOfDayTimer( new EndOfDayDateTime( this.firstDate , ! EndOfDaySpecificTime.MarketOpen ) , "DYN" ); run_setHistoricalQuoteProvider(); this.account = new Account( "LinearCombination" , historicalEndOfDayTimer , --- 121,125 ---- new IndexBasedEndOfDayTimer( new EndOfDayDateTime( this.firstDate , ! EndOfDaySpecificTime.MarketOpen ) , "MSFT" ); run_setHistoricalQuoteProvider(); this.account = new Account( "LinearCombination" , historicalEndOfDayTimer , *************** *** 148,152 **** report.Create( "Linear Combination" , 1 , new EndOfDayDateTime( this.lastDate , EndOfDaySpecificTime.MarketClose ) , ! "^SPX" ); // ObjectArchiver.Archive( report.AccountReport , // @"C:\Documents and Settings\Glauco\Desktop\reports\runOneRank.qPr" ); --- 148,152 ---- report.Create( "Linear Combination" , 1 , new EndOfDayDateTime( this.lastDate , EndOfDaySpecificTime.MarketClose ) , ! "MSFT" ); // ObjectArchiver.Archive( report.AccountReport , // @"C:\Documents and Settings\Glauco\Desktop\reports\runOneRank.qPr" ); |
|
From: Glauco S. <gla...@us...> - 2006-03-14 14:53:15
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28741/b4_Business/a1_Financial/a2_Accounting Modified Files: Portfolio.cs Log Message: Portfolio now extends a QuantProject.ADT.Collections.QPHashtable, instead of a System.Collections.Hashtable. This way, debugging will be easier. Index: Portfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/Portfolio.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Portfolio.cs 26 Nov 2005 23:57:20 -0000 1.9 --- Portfolio.cs 14 Mar 2006 14:53:13 -0000 1.10 *************** *** 25,29 **** --- 25,31 ---- using System.Collections; using System.Diagnostics; + using QuantProject.ADT; + using QuantProject.ADT.Collections; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Instruments; *************** *** 37,41 **** /// </summary> [Serializable] ! public class Portfolio : Hashtable { public ICollection Positions --- 39,43 ---- /// </summary> [Serializable] ! public class Portfolio : QPHashtable { public ICollection Positions |
|
From: Glauco S. <gla...@us...> - 2006-03-14 14:51:15
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27419/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank Modified Files: RunWalkForwardMultiOneRank.cs Log Message: Fixed bug: now the last report date is properly computed. Index: RunWalkForwardMultiOneRank.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank/RunWalkForwardMultiOneRank.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RunWalkForwardMultiOneRank.cs 19 Feb 2006 17:53:01 -0000 1.3 --- RunWalkForwardMultiOneRank.cs 14 Mar 2006 14:51:12 -0000 1.4 *************** *** 195,199 **** Report report = new Report( this.account , this.historicalQuoteProvider ); report.Create( "WFT One Rank" , 1 , ! new EndOfDayDateTime( this.lastDateTime , EndOfDaySpecificTime.OneHourAfterMarketClose ) , this.benchmark ); --- 195,199 ---- Report report = new Report( this.account , this.historicalQuoteProvider ); report.Create( "WFT One Rank" , 1 , ! new EndOfDayDateTime( lastReportDateTime , EndOfDaySpecificTime.OneHourAfterMarketClose ) , this.benchmark ); |
|
From: Glauco S. <gla...@us...> - 2006-03-14 14:48:23
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25990/b7_Scripts/WalkForwardTesting Modified Files: IWalkForwardProgressNotifier.cs Log Message: InSampleNewProgressEventHandler has been moved here from InSampleNewProgressEventHandler Index: IWalkForwardProgressNotifier.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/IWalkForwardProgressNotifier.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IWalkForwardProgressNotifier.cs 19 Nov 2005 13:46:10 -0000 1.1 --- IWalkForwardProgressNotifier.cs 14 Mar 2006 14:48:20 -0000 1.2 *************** *** 27,30 **** --- 27,33 ---- namespace QuantProject.Scripts.WalkForwardTesting { + public delegate void InSampleNewProgressEventHandler( + Object sender , NewProgressEventArgs eventArgs ); + /// <summary> /// Interface to be implemented by time consuming walk forwarding scripts |
|
From: Glauco S. <gla...@us...> - 2006-03-14 14:48:03
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25570/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank Modified Files: WFMultiOneRankEndOfDayTimerHandler.cs Log Message: InSampleNewProgressEventHandler has been moved to IWalkForwardProgressNotifier.cs Index: WFMultiOneRankEndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank/WFMultiOneRankEndOfDayTimerHandler.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WFMultiOneRankEndOfDayTimerHandler.cs 19 Feb 2006 17:49:42 -0000 1.3 --- WFMultiOneRankEndOfDayTimerHandler.cs 14 Mar 2006 14:47:52 -0000 1.4 *************** *** 34,40 **** namespace QuantProject.Scripts.WalkForwardTesting.WalkForwardMultiOneRank { - public delegate void InSampleNewProgressEventHandler( - Object sender , NewProgressEventArgs eventArgs ); - /// <summary> /// Implements OneHourAfterMarketCloseEventHandler and FiveMinutesBeforeMarketCloseEventHandler. --- 34,37 ---- |
|
From: Glauco S. <gla...@us...> - 2006-03-14 14:13:49
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4694/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank Modified Files: WFMultiOneRankGenomeManager.cs Log Message: Minor change: removed useless blanks Index: WFMultiOneRankGenomeManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank/WFMultiOneRankGenomeManager.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WFMultiOneRankGenomeManager.cs 11 Dec 2005 18:04:17 -0000 1.2 --- WFMultiOneRankGenomeManager.cs 14 Mar 2006 14:13:41 -0000 1.3 *************** *** 2,6 **** QuantProject - Quantitative Finance Library ! WFMultiOneRankChosenTickers.cs Copyright (C) 2003 Glauco Siliprandi --- 2,6 ---- QuantProject - Quantitative Finance Library ! WFMultiOneRankGenomeManager.cs Copyright (C) 2003 Glauco Siliprandi *************** *** 143,147 **** //the investment is assumed to be equally divided for each ticker return ( currentReturn / this.GenomeSize ); ! } private double[] getFitnessValue_getLinearCombinationReturns( int[] tickersIdx ) --- 143,147 ---- //the investment is assumed to be equally divided for each ticker return ( currentReturn / this.GenomeSize ); ! } private double[] getFitnessValue_getLinearCombinationReturns( int[] tickersIdx ) *************** *** 149,154 **** double[] returnValue = new double[ this.setOfCandidates[ 0 ].ArrayOfRatesOfReturn.Length ]; ! for( int i = 0; i < returnValue.Length ; i++ ) ! { foreach( int tickerIdx in tickersIdx ) returnValue[ i ] += --- 149,154 ---- double[] returnValue = new double[ this.setOfCandidates[ 0 ].ArrayOfRatesOfReturn.Length ]; ! for( int i = 0; i < returnValue.Length ; i++ ) ! { foreach( int tickerIdx in tickersIdx ) returnValue[ i ] += *************** *** 159,162 **** --- 159,163 ---- } #endregion + private double[] getFitnessValue_getStrategyReturnForCurrentCandidates( double[] linearCombinationReturns ) |
|
From: Glauco S. <gla...@us...> - 2006-02-19 18:03:51
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25895/b4_Business/a1_Financial/a2_Accounting/h5_Reporting Modified Files: AccountReport.cs Log Message: Minor code formatting improvement Index: AccountReport.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/AccountReport.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** AccountReport.cs 11 Jan 2006 18:38:10 -0000 1.17 --- AccountReport.cs 19 Feb 2006 18:03:44 -0000 1.18 *************** *** 158,168 **** { dataRow[ "AccountCash" ] = this.accountCopy.CashAmount; ! dataRow[ "PortfolioValue" ] = this.accountCopy.Portfolio.GetMarketValue( ! endOfDayDateTime , this.historicalQuoteProvider ); ! dataRow[ "AccountValue" ] = (double)dataRow[ "AccountCash" ] + (double)dataRow[ "PortfolioValue" ]; ! dataRow[ "PnL" ] = (double)dataRow[ "AccountValue" ] + ! this.accountCopy.Transactions.TotalWithdrawn - ! this.accountCopy.Transactions.TotalAddedCash; } private void addTransactionRow( EndOfDayTransaction transaction , --- 158,170 ---- { dataRow[ "AccountCash" ] = this.accountCopy.CashAmount; ! ! dataRow[ "PortfolioValue" ] = this.accountCopy.Portfolio.GetMarketValue( ! endOfDayDateTime , this.historicalQuoteProvider ); ! ! dataRow[ "AccountValue" ] = (double)dataRow[ "AccountCash" ] + (double)dataRow[ "PortfolioValue" ]; ! dataRow[ "PnL" ] = (double)dataRow[ "AccountValue" ] + ! this.accountCopy.Transactions.TotalWithdrawn - ! this.accountCopy.Transactions.TotalAddedCash; } private void addTransactionRow( EndOfDayTransaction transaction , |
|
From: Glauco S. <gla...@us...> - 2006-02-19 17:59:31
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataProviders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22908/b3_Data/DataProviders Modified Files: HistoricalDataProvider.cs Log Message: Performance testing code has been removed. Index: HistoricalDataProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/HistoricalDataProvider.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** HistoricalDataProvider.cs 11 Jan 2006 18:24:33 -0000 1.10 --- HistoricalDataProvider.cs 19 Feb 2006 17:59:27 -0000 1.11 *************** *** 251,262 **** { double returnValue; - int firstSecond = DateTime.Now.Second; - int firstMillisecond = DateTime.Now.Millisecond; double adjustedClose = privateCache.GetQuote( instrumentKey , extendedDateTime.DateTime , QuoteField.AdjustedClose ); - int secondSecond = DateTime.Now.Second; - int secondMillisecond = DateTime.Now.Millisecond; - int elapsedMillisecond = ( secondSecond - firstSecond ) * - 1000 + ( secondMillisecond - firstMillisecond ); if ( extendedDateTime.BarComponent == BarComponent.Close ) returnValue = adjustedClose; --- 251,256 ---- |
|
From: Glauco S. <gla...@us...> - 2006-02-19 17:58:19
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataTables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22478/b3_Data/DataTables Modified Files: Quotes.cs Log Message: The method GetFollowingDate( DateTime quoteDate , int followingDays ) has been improved: now an exception is thrown when no quote is available at the requested following date. Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataTables/Quotes.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Quotes.cs 8 Jan 2006 23:38:43 -0000 1.23 --- Quotes.cs 19 Feb 2006 17:58:13 -0000 1.24 *************** *** 767,773 **** { setHistory(); ! return (DateTime) history.GetKey( Math.Max( 0 , ! history.IndexOfKeyOrPrevious( quoteDate ) + ! followingDays ) ); } --- 767,786 ---- { setHistory(); ! int indexOfKeyOrPrevious = ! history.IndexOfKeyOrPrevious( quoteDate ); ! DateTime followingDate; ! try ! { ! followingDate = (DateTime) history.GetKey( Math.Max( 0 , ! indexOfKeyOrPrevious + followingDays ) ); ! } ! catch ( ArgumentOutOfRangeException exception ) ! { ! string message = exception.Message; ! throw new Exception( "Quotes.GetFollowingDate() error: there is not " + ! "a date for quoteDate=" + quoteDate.ToString() + ! " and followingDays=" + followingDays ); ! } ! return followingDate; } |
|
From: Glauco S. <gla...@us...> - 2006-02-19 17:54:40
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20932/b5_Presentation/Reporting/WindowsForm Modified Files: ReportShower.cs Log Message: minor code formatting improvement Index: ReportShower.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/ReportShower.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReportShower.cs 13 Mar 2005 23:38:40 -0000 1.2 --- ReportShower.cs 19 Feb 2006 17:54:36 -0000 1.3 *************** *** 208,216 **** throw new Exception("Benchmark symbol is requested!"); this.report.Clear(); this.report.Show(this.reportName.Text, (int)this.numDaysForEquityLine.Value, new EndOfDayDateTime(this.endingDate.Value, EndOfDaySpecificTime.MarketClose), this.benchmark.Text); ! } catch(Exception ex) --- 208,218 ---- throw new Exception("Benchmark symbol is requested!"); this.report.Clear(); + System.Console.WriteLine( DateTime.Now ); this.report.Show(this.reportName.Text, (int)this.numDaysForEquityLine.Value, new EndOfDayDateTime(this.endingDate.Value, EndOfDaySpecificTime.MarketClose), this.benchmark.Text); ! System.Console.WriteLine( DateTime.Now ); ! } catch(Exception ex) |
|
From: Glauco S. <gla...@us...> - 2006-02-19 17:53:09
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20153/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank Modified Files: RunWalkForwardMultiOneRank.cs Log Message: maxRunningHours is better handled now Index: RunWalkForwardMultiOneRank.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank/RunWalkForwardMultiOneRank.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RunWalkForwardMultiOneRank.cs 27 Nov 2005 00:03:05 -0000 1.2 --- RunWalkForwardMultiOneRank.cs 19 Feb 2006 17:53:01 -0000 1.3 *************** *** 67,74 **** private WFMultiOneRankEndOfDayTimerHandler endOfDayTimerHandler; - private Account account; - private IEndOfDayTimer endOfDayTimer; public RunWalkForwardMultiOneRank( --- 67,73 ---- private WFMultiOneRankEndOfDayTimerHandler endOfDayTimerHandler; private Account account; private IEndOfDayTimer endOfDayTimer; + private DateTime startingTimeForScript; public RunWalkForwardMultiOneRank( *************** *** 109,112 **** --- 108,112 ---- this.historicalQuoteProvider = new HistoricalAdjustedQuoteProvider(); + this.startingTimeForScript = DateTime.Now; } private void run_initializeEndOfDayTimer() *************** *** 132,135 **** --- 132,136 ---- new WFMultiOneRankEndOfDayTimerHandler( this.tickerGroupID , + this.benchmark , this.numberEligibleTickers , this.numberOfPortfolioPositions , *************** *** 177,182 **** Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! if ( ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime > ! this.lastDateTime ) { // the simulation has reached the ending date --- 178,185 ---- Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! if ( ( ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime > ! this.lastDateTime ) || ! ( DateTime.Now >= ! this.startingTimeForScript.AddHours( this.maxRunningHours ) ) ) { // the simulation has reached the ending date *************** *** 185,188 **** --- 188,196 ---- // ObjectArchiver.Archive( this.account , // @"C:\Documents and Settings\Glauco\Desktop\reports\final.qP" ); + DateTime lastReportDateTime = this.lastDateTime; + if ( ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime < + lastReportDateTime ) + lastReportDateTime = + ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime; Report report = new Report( this.account , this.historicalQuoteProvider ); report.Create( "WFT One Rank" , 1 , |
|
From: Glauco S. <gla...@us...> - 2006-02-19 17:50:35
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19255/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank Modified Files: WFMultiOneRankEligibleTickers.cs Log Message: Benchmark is better handled now. Index: WFMultiOneRankEligibleTickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank/WFMultiOneRankEligibleTickers.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WFMultiOneRankEligibleTickers.cs 12 Nov 2005 18:40:00 -0000 1.1 --- WFMultiOneRankEligibleTickers.cs 19 Feb 2006 17:50:29 -0000 1.2 *************** *** 34,38 **** public class WFMultiOneRankEligibleTickers { ! string tickerGroupID; private int numberEligibleTickersToBeChosen; private int numberDaysForPerformanceCalculation; --- 34,39 ---- public class WFMultiOneRankEligibleTickers { ! private string tickerGroupID; ! private string benchmark; private int numberEligibleTickersToBeChosen; private int numberDaysForPerformanceCalculation; *************** *** 48,51 **** --- 49,53 ---- public WFMultiOneRankEligibleTickers( string tickerGroupID , + string benchmark , int numberEligibleTickersToBeChosen , int numberDaysForPerformanceCalculation , *************** *** 53,56 **** --- 55,59 ---- { this.tickerGroupID = tickerGroupID; + this.benchmark = benchmark; this.numberEligibleTickersToBeChosen = numberEligibleTickersToBeChosen; this.numberDaysForPerformanceCalculation = numberDaysForPerformanceCalculation; *************** *** 78,82 **** new SelectorByQuotationAtEachMarketDay( eligibleTickers, false, dateTime.AddDays( - this.numberDaysForPerformanceCalculation ) , ! dateTime, this.numberEligibleTickersToBeChosen,"^SPX"); return quotedInEachMarketDay.GetTableOfSelectedTickers(); } --- 81,85 ---- new SelectorByQuotationAtEachMarketDay( eligibleTickers, false, dateTime.AddDays( - this.numberDaysForPerformanceCalculation ) , ! dateTime, this.numberEligibleTickersToBeChosen,this.benchmark ); return quotedInEachMarketDay.GetTableOfSelectedTickers(); } |
|
From: Glauco S. <gla...@us...> - 2006-02-19 17:49:50
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18822/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank Modified Files: WFMultiOneRankEndOfDayTimerHandler.cs Log Message: Benchmark is better handled now. Index: WFMultiOneRankEndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardMultiOneRank/WFMultiOneRankEndOfDayTimerHandler.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WFMultiOneRankEndOfDayTimerHandler.cs 27 Nov 2005 00:11:29 -0000 1.2 --- WFMultiOneRankEndOfDayTimerHandler.cs 19 Feb 2006 17:49:42 -0000 1.3 *************** *** 47,50 **** --- 47,51 ---- private string tickerGroupID; + private string benchmark; private int numberEligibleTickers; private int numberOfPositionsToBeChosen; *************** *** 88,91 **** --- 89,93 ---- public WFMultiOneRankEndOfDayTimerHandler( string tickerGroupID , + string benchmark , int numberEligibleTickers , int numberOfPositionsToBeChosen , *************** *** 96,99 **** --- 98,102 ---- { this.tickerGroupID = tickerGroupID; + this.benchmark = benchmark; this.numberEligibleTickers = numberEligibleTickers; this.numberOfPositionsToBeChosen = numberOfPositionsToBeChosen; *************** *** 108,111 **** --- 111,115 ---- this.eligibleTickers = new WFMultiOneRankEligibleTickers( this.tickerGroupID , + this.benchmark , numberEligibleTickers , inSampleWindowDays , this.account.EndOfDayTimer ); *************** *** 155,158 **** --- 159,164 ---- // this.eligibleTickers.SetTickers( endOfDayTimingEventArgs.EndOfDayDateTime.DateTime ); this.eligibleTickers.SetTickers(); + Console.WriteLine( "Number of Eligible tickers: " + + this.eligibleTickers.EligibleTickers.Rows.Count ); this.chosenTickers.SetTickers( this.eligibleTickers ); this.lastOptimizationDate = this.now().DateTime; |
|
From: Marco M. <mi...@us...> - 2006-01-22 09:53:22
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27449/Downloader Modified Files: TickerDownloader.cs Log Message: For too high volume data, a maximum value is stored. Index: TickerDownloader.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerDownloader.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TickerDownloader.cs 7 Oct 2005 16:52:28 -0000 1.17 --- TickerDownloader.cs 22 Jan 2006 09:53:13 -0000 1.18 *************** *** 202,206 **** myRow[ "quLow" ]=Double.Parse( LineIn[3] ); myRow[ "quClose" ]=Double.Parse( LineIn[4] ); ! myRow[ "quVolume" ]=Double.Parse( LineIn[5] ); myRow[ "quAdjustedClose" ]=Double.Parse( LineIn[6] ); --- 202,206 ---- myRow[ "quLow" ]=Double.Parse( LineIn[3] ); myRow[ "quClose" ]=Double.Parse( LineIn[4] ); ! myRow[ "quVolume" ]=Math.Min(Double.Parse( LineIn[5]),Convert.ToDouble(Int32.MaxValue)); myRow[ "quAdjustedClose" ]=Double.Parse( LineIn[6] ); |
|
From: Glauco S. <gla...@us...> - 2006-01-15 23:35:19
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23356 Modified Files: DataBase.cs Log Message: - GetQuote has been added - WasExchanged has been added Index: DataBase.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBase.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DataBase.cs 11 Jan 2006 18:36:02 -0000 1.7 --- DataBase.cs 15 Jan 2006 23:35:09 -0000 1.8 *************** *** 140,143 **** --- 140,185 ---- } #endregion + public static double GetQuote( string ticker , + QuoteField quoteField , DateTime dateTime ) + { + double quote = Double.MinValue; + string sqlQuery = + "select " + getFieldName( quoteField ) + " " + + "from quotes where (quTicker='" + ticker + "') " + + "and (quDate=" + SQLBuilder.GetDateConstant( dateTime ) + ")"; + DataTable quotes = new DataTable(); + try + { + quotes = SqlExecutor.GetDataTable( sqlQuery ); + } + catch (Exception ex) + { + MessageBox.Show( ex.ToString() ); + } + if ( quotes.Rows.Count == 0 ) + throw new MissingQuoteException( ticker , dateTime ); + else + quote = (double)( quotes.Rows[ 0 ][ 0 ] ); + return quote; + } + public static bool WasExchanged( string ticker , + ExtendedDateTime extendedDateTime ) + { + string sqlQuery = + "select * " + + "from quotes where (quTicker='" + ticker + "') " + + "and (quDate=" + + SQLBuilder.GetDateConstant( extendedDateTime.DateTime ) + ")"; + DataTable quotes = new DataTable(); + try + { + quotes = SqlExecutor.GetDataTable( sqlQuery ); + } + catch (Exception ex) + { + MessageBox.Show( ex.ToString() ); + } + return ( quotes.Rows.Count > 0 ); + } } } |
|
From: Glauco S. <gla...@us...> - 2006-01-11 18:47:23
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24411/b2_DataAccess Modified Files: b2_DataAccess.csproj Log Message: MissingQuoteException.cs has been added Index: b2_DataAccess.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/b2_DataAccess.csproj,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** b2_DataAccess.csproj 27 Aug 2005 19:20:26 -0000 1.16 --- b2_DataAccess.csproj 11 Jan 2006 18:47:15 -0000 1.17 *************** *** 113,116 **** --- 113,121 ---- /> <File + RelPath = "MissingQuoteException.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "OleDbSingleTableAdapter.cs" SubType = "Code" |
|
From: Glauco S. <gla...@us...> - 2006-01-11 18:46:21
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24064/b3_Data Modified Files: b3_Data.csproj Log Message: - DataProviders\Caching\ICache.cs has been added - DataProviders\Caching\SimpleCache.cs has been added Index: b3_Data.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/b3_Data.csproj,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** b3_Data.csproj 7 Jan 2006 11:03:45 -0000 1.35 --- b3_Data.csproj 11 Jan 2006 18:46:12 -0000 1.36 *************** *** 193,196 **** --- 193,201 ---- /> <File + RelPath = "DataProviders\Caching\ICache.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "DataProviders\Caching\MissingQuoteException.cs" SubType = "Code" *************** *** 198,201 **** --- 203,211 ---- /> <File + RelPath = "DataProviders\Caching\SimpleCache.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "DataTables\GroupQuotes.cs" SubType = "Component" |
|
From: Glauco S. <gla...@us...> - 2006-01-11 18:44:31
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/Caching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23468/b3_Data/DataProviders/Caching Added Files: SimpleCache.cs Log Message: Handles quote caching from mass storage to main memory --- NEW FILE: SimpleCache.cs --- /* QuantProject - Quantitative Finance Library Cache.cs Copyright (C) 2003 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using QuantProject.ADT; using QuantProject.DataAccess; namespace QuantProject.Data.DataProviders.Caching { /// <summary> /// Handles quote caching from mass storage to main memory /// </summary> public class SimpleCache : ICache { public SimpleCache() { // // TODO: Add constructor logic here // } public double GetQuote( string ticker , DateTime dateTime , QuoteField quoteField ) { double returnValue = double.MinValue; try { returnValue = DataBase.GetQuote( ticker , quoteField , dateTime ); } catch( QuantProject.DataAccess.MissingQuoteException ex ) { string message = ex.Message; // used to avoid warning throw new QuantProject.Data.DataProviders.Caching.MissingQuoteException( ticker , dateTime ); } return returnValue; } public bool WasExchanged( string ticker , ExtendedDateTime extendedDateTime ) { return DataBase.WasExchanged( ticker , extendedDateTime ); } } } |
|
From: Glauco S. <gla...@us...> - 2006-01-11 18:43:41
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23162/b2_DataAccess Added Files: MissingQuoteException.cs Log Message: Thrown when a quote is requested, but it is not present in the database --- NEW FILE: MissingQuoteException.cs --- /* QuantProject - Quantitative Finance Library MissingQuoteException.cs Copyright (C) 2003 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; namespace QuantProject.DataAccess { /// <summary> /// Thrown when a quote is requested, but it is not present in /// the database /// </summary> public class MissingQuoteException : Exception { private string ticker; private DateTime dateTime; public override string Message { get { return "Missing quote for ticker " + this.ticker + " for date " + this.dateTime.ToString(); } } public MissingQuoteException( string ticker , DateTime dateTime ) { this.ticker = ticker; this.dateTime = dateTime; } } } |
|
From: Glauco S. <gla...@us...> - 2006-01-11 18:42:02
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/Caching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22603/b3_Data/DataProviders/Caching Added Files: ICache.cs Log Message: Interface to be implemented by a cache --- NEW FILE: ICache.cs --- /* QuantProject - Quantitative Finance Library ICache.cs Copyright (C) 2004 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using QuantProject.ADT; using QuantProject.DataAccess; namespace QuantProject.Data.DataProviders.Caching { /// <summary> /// Interface to be implemented by a cache /// </summary> public interface ICache { double GetQuote( string ticker , DateTime dateTime , QuoteField quoteField ); bool WasExchanged( string ticker , ExtendedDateTime extendedDateTime ); } } |
|
From: Glauco S. <gla...@us...> - 2006-01-11 18:38:19
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21057/b4_Business/a1_Financial/a2_Accounting/h5_Reporting Modified Files: AccountReport.cs Log Message: Code has been formatted: tab are used instead of blanks Index: AccountReport.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/AccountReport.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** AccountReport.cs 15 Oct 2005 17:58:03 -0000 1.16 --- AccountReport.cs 11 Jan 2006 18:38:10 -0000 1.17 *************** *** 157,161 **** private void addBalanceItems ( EndOfDayDateTime endOfDayDateTime , DataRow dataRow ) { ! dataRow[ "AccountCash" ] = this.accountCopy.CashAmount; dataRow[ "PortfolioValue" ] = this.accountCopy.Portfolio.GetMarketValue( endOfDayDateTime , this.historicalQuoteProvider ); --- 157,161 ---- private void addBalanceItems ( EndOfDayDateTime endOfDayDateTime , DataRow dataRow ) { ! dataRow[ "AccountCash" ] = this.accountCopy.CashAmount; dataRow[ "PortfolioValue" ] = this.accountCopy.Portfolio.GetMarketValue( endOfDayDateTime , this.historicalQuoteProvider ); *************** *** 165,169 **** this.accountCopy.Transactions.TotalWithdrawn - this.accountCopy.Transactions.TotalAddedCash; ! } private void addTransactionRow( EndOfDayTransaction transaction , System.Data.DataTable detailedDataTable ) --- 165,169 ---- this.accountCopy.Transactions.TotalWithdrawn - this.accountCopy.Transactions.TotalAddedCash; ! } private void addTransactionRow( EndOfDayTransaction transaction , System.Data.DataTable detailedDataTable ) *************** *** 183,187 **** dataRow[ "Commission" ] = transaction.Commission.Value; addBalanceItems( transaction.EndOfDayDateTime , dataRow ); ! detailedDataTable.Rows.Add( dataRow ); } private void addRowsForTransactions( DateTime currentDateTime , --- 183,187 ---- dataRow[ "Commission" ] = transaction.Commission.Value; addBalanceItems( transaction.EndOfDayDateTime , dataRow ); ! detailedDataTable.Rows.Add( dataRow ); } private void addRowsForTransactions( DateTime currentDateTime , *************** *** 192,198 **** (ArrayList)this.account.Transactions[ currentDateTime ] ) { ! this.accountCopy.Add( transaction ); addTransactionRow( transaction , detailedDataTable ); ! } } private void addRowForPnl_actually( DateTime currentDate , --- 192,198 ---- (ArrayList)this.account.Transactions[ currentDateTime ] ) { ! this.accountCopy.Add( transaction ); addTransactionRow( transaction , detailedDataTable ); ! } } private void addRowForPnl_actually( DateTime currentDate , *************** *** 222,226 **** addRowsForTransactions( currentDate , detailedDataTable ); addRowForPnl( numDaysForInterval , currentDate , detailedDataTable ); ! currentDate = currentDate.AddDays( 1 ); } // foreach ( ArrayList transactionList in account.Transactions.Values ) --- 222,226 ---- addRowsForTransactions( currentDate , detailedDataTable ); addRowForPnl( numDaysForInterval , currentDate , detailedDataTable ); ! currentDate = currentDate.AddDays( 1 ); } // foreach ( ArrayList transactionList in account.Transactions.Values ) |