quantproject-developers Mailing List for QuantProject (Page 123)
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...> - 2004-12-15 23:14:11
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30157/b4_Business/a1_Financial/a2_Accounting Modified Files: Account.cs Log Message: Set back to previous revision Index: Account.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/Account.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Account.cs 14 Dec 2004 21:30:14 -0000 1.9 --- Account.cs 15 Dec 2004 23:13:47 -0000 1.10 *************** *** 170,189 **** moneyAmount ); } ! public void ClearOrders() ! { ! this.activeOrders.Clear(); ! } public void AddOrder( Order order ) { ! this.activeOrders.Add(order); ! //this.orderExecutor.Execute( order ); } - public void ExecuteActiveOrders() - { - foreach(object order in this.activeOrders) - { - this.orderExecutor.Execute( (Order)order ); - } - } public bool Contains( Instrument instrument ) { --- 170,178 ---- moneyAmount ); } ! public void AddOrder( Order order ) { ! this.orderExecutor.Execute( order ); } public bool Contains( Instrument instrument ) { |
|
From: Glauco S. <gla...@us...> - 2004-12-15 23:12:37
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29799/b3_Data Modified Files: b3_Data.csproj Log Message: My vsnet environment, automatically added a reference to Microsoft.Office.Core Index: b3_Data.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/b3_Data.csproj,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** b3_Data.csproj 14 Dec 2004 21:31:45 -0000 1.18 --- b3_Data.csproj 15 Dec 2004 23:12:26 -0000 1.19 *************** *** 125,128 **** --- 125,136 ---- WrapperTool = "primary" /> + <Reference + Name = "Microsoft.Office.Core" + Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" + VersionMajor = "2" + VersionMinor = "3" + Lcid = "0" + WrapperTool = "primary" + /> </References> </Build> *************** *** 136,140 **** <File RelPath = "ExtendedDataTable.cs" ! SubType = "Component" BuildAction = "Compile" /> --- 144,148 ---- <File RelPath = "ExtendedDataTable.cs" ! SubType = "Code" BuildAction = "Compile" /> |
|
From: Glauco S. <gla...@us...> - 2004-12-15 23:12:35
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29799/b5_Presentation Modified Files: b5_Presentation.csproj Log Message: My vsnet environment, automatically added a reference to Microsoft.Office.Core Index: b5_Presentation.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/b5_Presentation.csproj,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** b5_Presentation.csproj 14 Dec 2004 21:31:45 -0000 1.14 --- b5_Presentation.csproj 15 Dec 2004 23:12:27 -0000 1.15 *************** *** 126,129 **** --- 126,137 ---- /> <Reference + Name = "Microsoft.Office.Core" + Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" + VersionMajor = "2" + VersionMinor = "3" + Lcid = "0" + WrapperTool = "primary" + /> + <Reference Name = "scpl" AssemblyName = "scpl" *************** *** 151,155 **** <File RelPath = "Charting\Chart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> --- 159,163 ---- <File RelPath = "Charting\Chart.cs" ! SubType = "Code" BuildAction = "Compile" /> |
|
From: Glauco S. <gla...@us...> - 2004-12-15 23:12:35
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29799/b4_Business Modified Files: b4_Business.csproj Log Message: My vsnet environment, automatically added a reference to Microsoft.Office.Core Index: b4_Business.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** b4_Business.csproj 14 Dec 2004 21:30:15 -0000 1.14 --- b4_Business.csproj 15 Dec 2004 23:12:26 -0000 1.15 *************** *** 130,133 **** --- 130,141 ---- WrapperTool = "primary" /> + <Reference + Name = "Microsoft.Office.Core" + Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" + VersionMajor = "2" + VersionMinor = "3" + Lcid = "0" + WrapperTool = "primary" + /> </References> </Build> |
|
From: Marco M. <mi...@us...> - 2004-12-14 21:32:25
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12941/b3_Data Modified Files: b3_Data.csproj Log Message: Index: b3_Data.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/b3_Data.csproj,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** b3_Data.csproj 13 Dec 2004 01:54:11 -0000 1.17 --- b3_Data.csproj 14 Dec 2004 21:31:45 -0000 1.18 *************** *** 125,136 **** WrapperTool = "primary" /> - <Reference - Name = "Microsoft.Office.Core" - Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" - VersionMajor = "2" - VersionMinor = "3" - Lcid = "0" - WrapperTool = "primary" - /> </References> </Build> --- 125,128 ---- |
|
From: Marco M. <mi...@us...> - 2004-12-14 21:32:04
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12941/b5_Presentation Modified Files: b5_Presentation.csproj Log Message: Index: b5_Presentation.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/b5_Presentation.csproj,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** b5_Presentation.csproj 5 Dec 2004 02:36:20 -0000 1.13 --- b5_Presentation.csproj 14 Dec 2004 21:31:45 -0000 1.14 *************** *** 126,137 **** /> <Reference - Name = "Microsoft.Office.Core" - Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" - VersionMajor = "2" - VersionMinor = "3" - Lcid = "0" - WrapperTool = "primary" - /> - <Reference Name = "scpl" AssemblyName = "scpl" --- 126,129 ---- |
|
From: Marco M. <mi...@us...> - 2004-12-14 21:30:26
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12398/b4_Business/a1_Financial/a2_Accounting Modified Files: Account.cs Log Message: Modified Add (Order order) method: now it is simply updated the activeOrders field (arrayList) Added new methods: - ClearOrders, for clearing all activeOrders; - ExecuteOrders, for execution of all active orders Index: Account.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/Account.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Account.cs 5 Dec 2004 02:42:45 -0000 1.8 --- Account.cs 14 Dec 2004 21:30:14 -0000 1.9 *************** *** 170,178 **** moneyAmount ); } ! public void AddOrder( Order order ) { ! this.orderExecutor.Execute( order ); } public bool Contains( Instrument instrument ) { --- 170,189 ---- moneyAmount ); } ! public void ClearOrders() ! { ! this.activeOrders.Clear(); ! } public void AddOrder( Order order ) { ! this.activeOrders.Add(order); ! //this.orderExecutor.Execute( order ); } + public void ExecuteActiveOrders() + { + foreach(object order in this.activeOrders) + { + this.orderExecutor.Execute( (Order)order ); + } + } public bool Contains( Instrument instrument ) { |
|
From: Marco M. <mi...@us...> - 2004-12-14 21:30:25
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12398/b4_Business Modified Files: b4_Business.csproj Log Message: Modified Add (Order order) method: now it is simply updated the activeOrders field (arrayList) Added new methods: - ClearOrders, for clearing all activeOrders; - ExecuteOrders, for execution of all active orders Index: b4_Business.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** b4_Business.csproj 5 Dec 2004 02:35:35 -0000 1.13 --- b4_Business.csproj 14 Dec 2004 21:30:15 -0000 1.14 *************** *** 130,141 **** WrapperTool = "primary" /> - <Reference - Name = "Microsoft.Office.Core" - Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" - VersionMajor = "2" - VersionMinor = "3" - Lcid = "0" - WrapperTool = "primary" - /> </References> </Build> --- 130,133 ---- |
|
From: Marco M. <mi...@us...> - 2004-12-14 21:27:19
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11712/b1_ADT/Optimizing/Genetic Modified Files: GeneticOptimizer.cs Log Message: Updated GeneticOptimizer class (minor changes) Index: GeneticOptimizer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Optimizing/Genetic/GeneticOptimizer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GeneticOptimizer.cs 1 Dec 2004 22:36:11 -0000 1.1 --- GeneticOptimizer.cs 14 Dec 2004 21:26:54 -0000 1.2 *************** *** 180,184 **** for (int i = 0; !this.IsConvergenceReached(); i++) { ! this.generateNewPopulation(true); } } --- 180,184 ---- for (int i = 0; !this.IsConvergenceReached(); i++) { ! this.generateNewPopulation(showOutputToConsole); } } *************** *** 187,191 **** for (int i = 0; i < this.generationNumber; i++) { ! this.generateNewPopulation(true); } } --- 187,191 ---- for (int i = 0; i < this.generationNumber; i++) { ! this.generateNewPopulation(showOutputToConsole); } } |
|
From: Marco M. <mi...@us...> - 2004-12-14 21:25:56
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11480/b7_Scripts/TickerSelectionTesting Modified Files: GenomeManagerForEfficientCTOPortfolio.cs RunEfficientCTOPortfolio.cs Log Message: Script based on efficient portfolio theory: modified GetFitnessValue implementation for the IGenomeManager used by this script. Now it is maximized a probability value. Index: GenomeManagerForEfficientCTOPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/GenomeManagerForEfficientCTOPortfolio.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenomeManagerForEfficientCTOPortfolio.cs 1 Dec 2004 22:40:03 -0000 1.1 --- GenomeManagerForEfficientCTOPortfolio.cs 14 Dec 2004 21:25:45 -0000 1.2 *************** *** 104,115 **** { //parameters used to balance the rate of return against variance ! double a=2.5, b=2.0; double portofolioVariance = this.getPortfolioVariance(genome.Genes()); double portfolioRateOfReturn = this.getPortfolioRateOfReturn(genome.Genes()); this.variance = portofolioVariance; this.rateOfReturn = portfolioRateOfReturn; ! ! double returnValue = System.Math.Pow(((this.targetStdDev*this.targetStdDev)/portofolioVariance),a)* ! System.Math.Pow(System.Math.Max(0.0,(portfolioRateOfReturn/this.targetPerformance)),b); return returnValue; } --- 104,116 ---- { //parameters used to balance the rate of return against variance ! //double a=2.5, b=2.0; double portofolioVariance = this.getPortfolioVariance(genome.Genes()); double portfolioRateOfReturn = this.getPortfolioRateOfReturn(genome.Genes()); this.variance = portofolioVariance; this.rateOfReturn = portfolioRateOfReturn; ! NormalDistribution normal = new NormalDistribution(portfolioRateOfReturn, Math.Sqrt(portofolioVariance)); ! double returnValue = normal.GetProbability(this.targetPerformance*0.5,this.targetPerformance*1.5); ! //double returnValue = System.Math.Pow(((this.targetStdDev*this.targetStdDev)/portofolioVariance),a)* ! //System.Math.Pow(System.Math.Max(0.0,(portfolioRateOfReturn/this.targetPerformance)),b); return returnValue; } *************** *** 154,157 **** --- 155,169 ---- public object Decode(Genome genome) { + + string[] arrayOfTickers = new string[genome.Genes().Length]; + int indexOfTicker; + for(int index = 0; index < genome.Genes().Length; index++) + { + indexOfTicker = (int)genome.Genes().GetValue(index); + arrayOfTickers[index] = (string)this.setOfTickers.Rows[indexOfTicker][0]; + } + return arrayOfTickers; + + /*old implementation, to be used for output to console string sequenceOfTickers = ""; object returnValue; *************** *** 164,167 **** --- 176,181 ---- System.Math.Sqrt(this.Variance) + ")"; return returnValue; + */ + } // end of implementation of IGenomeManager Index: RunEfficientCTOPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/RunEfficientCTOPortfolio.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RunEfficientCTOPortfolio.cs 1 Dec 2004 22:40:03 -0000 1.1 --- RunEfficientCTOPortfolio.cs 14 Dec 2004 21:25:46 -0000 1.2 *************** *** 22,47 **** using System; - using System.Data; - using QuantProject.ADT.Optimizing.Genetic; - - /* using System.Collections; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting.Reporting; using QuantProject.Business.Financial.Instruments; using QuantProject.Business.Strategies; using QuantProject.Business.Testing; ! using QuantProject.Data.DataTables; using QuantProject.Data.DataProviders; - using QuantProject.Presentation.Reporting.WindowsForm; - */ - using QuantProject.Business.Scripting; using QuantProject.Data.Selectors; using QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios; namespace QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios { /// <summary> ! /// Script to find the efficient close to open daily portfolio /// </summary> public class RunEfficientCTOPorfolio : Script --- 22,52 ---- using System; using System.Collections; + using System.Data; using QuantProject.ADT; + using QuantProject.ADT.Optimizing.Genetic; + using QuantProject.Business.Financial.Accounting; using QuantProject.Business.Financial.Accounting.Reporting; using QuantProject.Business.Financial.Instruments; + using QuantProject.Business.Financial.Ordering; + using QuantProject.Business.Scripting; using QuantProject.Business.Strategies; using QuantProject.Business.Testing; ! using QuantProject.Business.Timing; using QuantProject.Data.DataProviders; using QuantProject.Data.Selectors; using QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios; + using QuantProject.Presentation.Reporting.WindowsForm; + namespace QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios { /// <summary> ! /// Script to buy at open and sell at close ! /// the efficient close to open daily portfolio ! /// The efficient portfolio's generation rules ! /// (contained in the EndOfDayTimerHandler) are: ! /// - choose the most liquid tickers; ! /// - choose the most efficient portfolio among these tickers /// </summary> public class RunEfficientCTOPorfolio : Script *************** *** 49,64 **** //DateTime lastDate = DateTime.Now.Date; //DateTime firstDate = DateTime.Now.Date.AddDays(-60); DateTime lastDate = new DateTime(2004,11,25); DateTime firstDate = new DateTime(2004,9,25); public RunEfficientCTOPorfolio() { ! } #region Run ! public override void Run() { //"STOCKMI" --- 54,89 ---- //DateTime lastDate = DateTime.Now.Date; //DateTime firstDate = DateTime.Now.Date.AddDays(-60); + //these two members are used by the old script DateTime lastDate = new DateTime(2004,11,25); DateTime firstDate = new DateTime(2004,9,25); + // + private ReportTable reportTable; + private EndOfDayDateTime startDateTime; + private EndOfDayDateTime endDateTime; + private int numIntervalDays;// number of days for the equity line graph + + //private ProgressBarForm progressBarForm; + + private EndOfDayTimerHandler endOfDayTimerHandler; + + private Account account; + + private IEndOfDayTimer endOfDayTimer; public RunEfficientCTOPorfolio() { ! //this.progressBarForm = new ProgressBarForm(); ! this.reportTable = new ReportTable( "Summary_Reports" ); ! this.startDateTime = new EndOfDayDateTime( ! new DateTime( 2002 , 1 , 1 ) , EndOfDaySpecificTime.FiveMinutesBeforeMarketClose ); ! this.endDateTime = new EndOfDayDateTime( ! new DateTime( 2002 , 3 , 31 ) , EndOfDaySpecificTime.OneHourAfterMarketClose ); ! this.numIntervalDays = 7; } #region Run ! private void run_FindBestPortfolioForNextTrade() { //"STOCKMI" *************** *** 74,80 **** --- 99,199 ---- GO.MutationRate = 0.05; GO.Run(true); + //it has to be changed the decode implementation for this IGenomeManager System.Console.WriteLine("\n\nThe best solution found is: " + (string)GO.BestGenome.Meaning + " with {0} generations", GO.GenerationCounter); } + + private void run_initializeEndOfDayTimer() + { + this.endOfDayTimer = + new HistoricalEndOfDayTimer( this.startDateTime ); + } + private void run_initializeAccount() + { + this.account = new Account( "EfficientCloseToOpenPortfolio" , this.endOfDayTimer , + new HistoricalEndOfDayDataStreamer( this.endOfDayTimer ) , + new HistoricalEndOfDayOrderExecutor( this.endOfDayTimer ) ); + + } + private void run_initializeEndOfDayTimerHandler() + { + this.endOfDayTimerHandler = new EndOfDayTimerHandler(70,6,this.account ); + } + /* + private void inSampleNewProgressEventHandler( + Object sender , NewProgressEventArgs eventArgs ) + { + this.progressBarForm.ProgressBarInSample.Value = eventArgs.CurrentProgress; + this.progressBarForm.ProgressBarInSample.Refresh(); + } + private void run_initializeProgressHandlers() + { + this.endOfDayTimerHandler.InSampleNewProgress += + new InSampleNewProgressEventHandler( this.inSampleNewProgressEventHandler ); + } + */ + #region oneHourAfterMarketCloseEventHandler + /* + private void oneHourAfterMarketCloseEventHandler_handleProgessBarForm( + IEndOfDayTimer endOfDayTimer ) + { + long elapsedDays = Convert.ToInt64( ((TimeSpan)( endOfDayTimer.GetCurrentTime().DateTime - + this.startDateTime.DateTime )).TotalDays ); + long totalDays = Convert.ToInt64( ((TimeSpan)( this.endDateTime.DateTime - + this.startDateTime.DateTime )).TotalDays ); + if ( Math.Floor( elapsedDays / totalDays * 100 ) > + Math.Floor( ( elapsedDays - 1 ) / totalDays * 100 ) ) + // a new out of sample time percentage point has been elapsed + this.progressBarForm.ProgressBarOutOfSample.Value = + Convert.ToInt16( Math.Floor( elapsedDays / totalDays * 100 ) ); + } + public void oneHourAfterMarketCloseEventHandler( + Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) + { + this.oneHourAfterMarketCloseEventHandler_handleProgessBarForm( + ( IEndOfDayTimer )sender ); + if ( ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime > + this.endDateTime.DateTime ) + { + // the simulation has reached the ending date + this.account.EndOfDayTimer.Stop(); + this.progressBarForm.Close(); + } + } + */ + #endregion + + public override void Run() + { + //old script + //this.run_FindBestPortfolioForNextTrade(); + + Report report; + run_initializeEndOfDayTimer(); + run_initializeAccount(); + run_initializeEndOfDayTimerHandler(); + //run_initializeProgressHandlers(); + this.endOfDayTimer.MarketOpen += + new MarketOpenEventHandler( + this.endOfDayTimerHandler.MarketOpenEventHandler); + + this.endOfDayTimer.FiveMinutesBeforeMarketClose += + new FiveMinutesBeforeMarketCloseEventHandler( + this.endOfDayTimerHandler.FiveMinutesBeforeMarketCloseEventHandler ); + + this.endOfDayTimer.OneHourAfterMarketClose += + new OneHourAfterMarketCloseEventHandler( + this.endOfDayTimerHandler.OneHourAfterMarketCloseEventHandler ); + //this.endOfDayTimer.OneHourAfterMarketClose += + //new OneHourAfterMarketCloseEventHandler( + //this.oneHourAfterMarketCloseEventHandler ); + + //this.progressBarForm.Show(); + this.endOfDayTimer.Start(); + report = new Report( this.account ); + report.Show("CTO_Portfolio" , this.numIntervalDays , this.startDateTime , "CTO_Portfolio" ); + + + } #endregion } |
|
From: Marco M. <mi...@us...> - 2004-12-14 21:21:54
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10493/b7_Scripts Modified Files: b7_Scripts.csproj Log Message: Added EndOfDayTimerHandler in order to run a script based on the efficient portfolio theory Index: b7_Scripts.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/b7_Scripts.csproj,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** b7_Scripts.csproj 1 Dec 2004 22:40:03 -0000 1.14 --- b7_Scripts.csproj 14 Dec 2004 21:21:41 -0000 1.15 *************** *** 183,186 **** --- 183,191 ---- /> <File + RelPath = "TickerSelectionTesting\EndOfDayTimerHandler.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "TickerSelectionTesting\GenomeManagerForEfficientCTOPortfolio.cs" SubType = "Code" |
|
From: Marco M. <mi...@us...> - 2004-12-14 21:21:52
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10493/b7_Scripts/TickerSelectionTesting Added Files: EndOfDayTimerHandler.cs Log Message: Added EndOfDayTimerHandler in order to run a script based on the efficient portfolio theory --- NEW FILE: EndOfDayTimerHandler.cs --- /* QuantProject - Quantitative Finance Library EndOfDayTimerHandler.cs Copyright (C) 2003 Marco Milletti This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Data; using System.Collections; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting; using QuantProject.Business.Financial.Instruments; using QuantProject.Business.Financial.Ordering; using QuantProject.Business.Timing; using QuantProject.Data.DataProviders; using QuantProject.Data.Selectors; using QuantProject.ADT.Optimizing.Genetic; namespace QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios { /// <summary> /// Implements MarketOpenEventHandler, /// TwoMinutesBeforeMarketCloseEventHandler and OneHourAfterMarketCloseEventHandler /// These handlers contain the core strategy for the efficient close to open portfolio! /// </summary> public class EndOfDayTimerHandler { private DataTable eligibleTickers; private string[] chosenTickers; private int numberOfEligibleTickers; private int numberOfTickersToBeChosen; private Account account; public int NumberOfEligibleTickers { get { return this.numberOfEligibleTickers; } } public Account Account { get { return this.account; } } public EndOfDayTimerHandler(int numberOfEligibleTickers, int numberOfTickersToBeChosen, Account account ) { this.numberOfEligibleTickers = numberOfEligibleTickers; this.numberOfTickersToBeChosen = numberOfTickersToBeChosen; this.account = account; } #region MarketOpenEventHandler /// <summary> /// Handles a "Market Open" event. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> public void MarketOpenEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { if(this.account.Transactions.Count == 0) this.account.AddCash(endOfDayTimingEventArgs.EndOfDayDateTime, 16000); this.account.ExecuteActiveOrders(); } #endregion #region FiveMinutesBeforeMarketCloseEventHandler private void fiveMinutesBeforeMarketCloseEventHandler_closePosition( string ticker ) { this.account.ClosePosition( ticker ); } private void fiveMinutesBeforeMarketCloseEventHandler_closePositions() { foreach ( string ticker in this.account.Portfolio.Keys ) fiveMinutesBeforeMarketCloseEventHandler_closePosition( ticker ); } private void fiveMinutesBeforeMarketCloseEventHandler_openPosition( string ticker ) { double maxPositionValue = this.account.CashAmount / this.numberOfTickersToBeChosen; long sharesToBeBought = Convert.ToInt64( Math.Floor( maxPositionValue / this.account.DataStreamer.GetCurrentAsk( ticker ) ) ); this.account.AddOrder( new Order( OrderType.MarketBuy , new Instrument( ticker ) , sharesToBeBought ) ); } private void fiveMinutesBeforeMarketCloseEventHandler_openPositions() { foreach ( string ticker in this.chosenTickers ) this.fiveMinutesBeforeMarketCloseEventHandler_openPosition( ticker ); } public void FiveMinutesBeforeMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { this.fiveMinutesBeforeMarketCloseEventHandler_closePositions(); //fiveMinutesBeforeMarketCloseEventHandler_openPositions(); } #endregion #region OneHourAfterMarketCloseEventHandler private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_closePositions( IEndOfDayTimer endOfDayTimer ) { foreach ( Position position in this.account.Portfolio ) foreach(string ticker in this.chosenTickers) { if (position.Instrument.Key == ticker ) { this.account.ClosePosition( position ); } } } private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions_forTicker( string ticker ) { double cashForSinglePosition = this.account.CashAmount / this.numberOfTickersToBeChosen; long quantity = Convert.ToInt64( Math.Floor( cashForSinglePosition / this.account.DataStreamer.GetCurrentBid( ticker ) ) ); Order order = new Order( OrderType.MarketBuy , new Instrument( ticker ) , quantity ); this.account.AddOrder( order ); } private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions() { foreach ( string ticker in this.chosenTickers ) if ( !this.account.Contains( ticker ) ) { oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions_forTicker( ticker ); } } private void oneHourAfterMarketCloseEventHandler_orderChosenTickers( IEndOfDayTimer endOfDayTimer ) { //this.oneHourAfterMarketCloseEventHandler_orderChosenTickers_closePositions( endOfDayTimer ); this.oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions(); } /// <summary> /// Handles a "One hour after market close" event. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> public void OneHourAfterMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime); this.account.ClearOrders(); oneHourAfterMarketCloseEventHandler_orderChosenTickers( ( IEndOfDayTimer ) sender ); } private void setTickers(DateTime currentDate) { TickerSelector mostLiquid = new TickerSelector(SelectionType.Liquidity, false, "STOCKMI", currentDate, currentDate.AddDays(60), this.numberOfEligibleTickers); this.eligibleTickers = mostLiquid.GetTableOfSelectedTickers(); IGenomeManager genManEfficientCTOPortfolio = new GenomeManagerForEfficientCTOPortfolio(this.eligibleTickers,currentDate, currentDate.AddDays(60), this.numberOfTickersToBeChosen, 0.005, 0.05); GeneticOptimizer GO = new GeneticOptimizer(genManEfficientCTOPortfolio); //GO.KeepOnRunningUntilConvergenceIsReached = true; GO.GenerationNumber = 4; GO.MutationRate = 0.05; GO.Run(false); this.chosenTickers = (string[])GO.BestGenome.Meaning; } #endregion } } |
|
From: Marco M. <mi...@us...> - 2004-12-14 21:18:17
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Statistics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9650/b1_ADT/Statistics Added Files: CalculusApproximation.cs IPdfDefiner.cs NormalDistribution.cs Log Message: Added these classes to the project: - NormalDistribution, for probability computation; - CalculusApproximation, in order to calculate area between two points of given probability density function; - IPdfDefiner, interface used by the CalculusApproximation class --- NEW FILE: NormalDistribution.cs --- /* QuantProject - Quantitative Finance Library NormalDistribution.cs Copyright (C) 2003 Marco Milletti This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using QuantProject.ADT.Calculus; namespace QuantProject.ADT.Statistics { /// <summary> /// Class for the normal distribution /// </summary> public class NormalDistribution : IPdfDefiner { private double average; private double stdDeviation; private double infinity; private int numOfIntervalsForPDFIntegralApproximation; public NormalDistribution(double average, double stdDeviation) { if(stdDeviation < 0) throw new Exception("Standard deviation must be > 0!"); this.average = average; this.stdDeviation = stdDeviation; this.infinity = 15 * stdDeviation; this.numOfIntervalsForPDFIntegralApproximation = Convert.ToInt32(25*this.infinity); } /// <summary> /// gets the probability density function at point x /// for the current instance of normal distribution /// </summary> public double GetProbabilityDensityValue(double x) { double y; y = Math.Pow(Math.E,(-Math.Pow(x-this.average,2) /(2*this.stdDeviation*this.stdDeviation))) /(Math.Sqrt(2*Math.PI)*this.stdDeviation); return y; } // end of IPdfDefiner implementation /// <summary> /// gets the probability that the normal random variable with the /// current features is less or equal to y /// </summary> public double GetProbability(double y) { return this.GetProbability(-this.infinity, y); } /// <summary> /// gets the probability that the current normal random variable /// is between a and b /// </summary> public double GetProbability(double a, double b) { return CalculusApproximation.GetArea((IPdfDefiner)this,a,b, this.numOfIntervalsForPDFIntegralApproximation); } } } --- NEW FILE: CalculusApproximation.cs --- /* QuantProject - Quantitative Finance Library CalculusApproximation.cs Copyright (C) 2003 Marco Milletti This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using QuantProject.ADT.Statistics; namespace QuantProject.ADT.Calculus { /// <summary> /// Class providing static methods for calculus approximation /// </summary> public class CalculusApproximation { /// <summary> /// Computes area using a standard approximation method /// </summary> public static double GetArea(IPdfDefiner distributionWithPDF, double a, double b, int numInterval) { double h = 0; double area = 0; if (numInterval <= 0) throw new Exception("Number of intervals must be > 0!"); if (a > b) throw new Exception("< a > must be less than < b >"); h = (b - a)/numInterval; area = distributionWithPDF.GetProbabilityDensityValue(b); area += distributionWithPDF.GetProbabilityDensityValue(a); area = area/2; for (int conta = 1; conta < numInterval; conta++) { area += distributionWithPDF.GetProbabilityDensityValue(a+conta*h); } area = area * h; return area; } } } --- NEW FILE: IPdfDefiner.cs --- /* QuantProject - Quantitative Finance Library IPdfDefiner.cs Copyright (C) 2003 Marco Milletti This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; namespace QuantProject.ADT.Statistics { /// <summary> /// Interface for distribution that define a probability /// density function - PDF /// </summary> public interface IPdfDefiner { //gets the probability density function at point x double GetProbabilityDensityValue(double x); } } |
|
From: Marco M. <mi...@us...> - 2004-12-14 21:18:13
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9650/b1_ADT Modified Files: b1_ADT.csproj Log Message: Added these classes to the project: - NormalDistribution, for probability computation; - CalculusApproximation, in order to calculate area between two points of given probability density function; - IPdfDefiner, interface used by the CalculusApproximation class Index: b1_ADT.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/b1_ADT.csproj,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** b1_ADT.csproj 5 Dec 2004 19:14:56 -0000 1.11 --- b1_ADT.csproj 14 Dec 2004 21:18:04 -0000 1.12 *************** *** 193,200 **** --- 193,215 ---- /> <File + RelPath = "Statistics\CalculusApproximation.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Statistics\Function.cs" SubType = "Code" BuildAction = "Compile" /> + <File + RelPath = "Statistics\IPdfDefiner.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Statistics\NormalDistribution.cs" + SubType = "Code" + BuildAction = "Compile" + /> </Include> </Files> |
|
From: Glauco S. <gla...@us...> - 2004-12-13 01:57:04
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10852 Modified Files: QuantProject.suo Log Message: no message Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 Binary files /tmp/cvsbzZogi and /tmp/cvsNxqaDk differ |
|
From: Glauco S. <gla...@us...> - 2004-12-13 01:56:03
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataProviders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10694 Removed Files: HistoricalDataStreamer.cs Log Message: HistoricalDataStreamer.cs has been removed from the project. --- HistoricalDataStreamer.cs DELETED --- |
|
From: Glauco S. <gla...@us...> - 2004-12-13 01:54:20
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10331/b3_Data Modified Files: b3_Data.csproj Log Message: HistoricalDataStreamer.cs has been removed from the project. Index: b3_Data.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/b3_Data.csproj,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** b3_Data.csproj 5 Dec 2004 02:34:33 -0000 1.16 --- b3_Data.csproj 13 Dec 2004 01:54:11 -0000 1.17 *************** *** 158,166 **** /> <File - RelPath = "DataProviders\HistoricalDataStreamer.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "DataProviders\IDataStreamer.cs" SubType = "Code" --- 158,161 ---- |
|
From: Glauco S. <gla...@us...> - 2004-12-13 01:52:49
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10019/b4_Business/a1_Financial/a2_Accounting Modified Files: Portfolio.cs Log Message: Bug fixed: now positions are properly removed, when quantity goes to zero. Index: Portfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/Portfolio.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Portfolio.cs 29 Nov 2004 16:18:17 -0000 1.2 --- Portfolio.cs 13 Dec 2004 01:52:34 -0000 1.3 *************** *** 97,101 **** this.Add( instrument.Key , new Position( instrument , -quantity ) ) ; if ( this.GetPosition( instrument ).Quantity == 0 ) ! this.Remove( instrument ); } --- 97,101 ---- this.Add( instrument.Key , new Position( instrument , -quantity ) ) ; if ( this.GetPosition( instrument ).Quantity == 0 ) ! this.Remove( instrument.Key ); } *************** *** 115,118 **** --- 115,120 ---- this.remove( transaction.Instrument , transaction.Quantity ); break; + case TransactionType.AddCash: + break; default: errorArised = true; |
|
From: Glauco S. <gla...@us...> - 2004-12-13 01:50:56
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/OneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9704/b7_Scripts/SimpleTesting/OneRank Modified Files: OneRank.cs Log Message: Bug fixed: now the strategy checks if the instrument is actually traded, before acting. Index: OneRank.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/OneRank/OneRank.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OneRank.cs 5 Dec 2004 02:46:14 -0000 1.2 --- OneRank.cs 13 Dec 2004 01:50:43 -0000 1.3 *************** *** 48,53 **** this.account.AddCash( 10000 ); } ! private void fiveMinutesBeforeMarketCloseEventHandler( ! Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { long sharesToBeBought; --- 48,52 ---- this.account.AddCash( 10000 ); } ! private void fiveMinutesBeforeMarketCloseEventHandler_withTickerExchangedNow() { long sharesToBeBought; *************** *** 78,81 **** --- 77,88 ---- this.account.EndOfDayTimer.Stop(); } + private void fiveMinutesBeforeMarketCloseEventHandler( + Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) + { + + if ( this.account.DataStreamer.IsExchanged( this.account.Key ) ) + // the given ticker is currently exchanged + fiveMinutesBeforeMarketCloseEventHandler_withTickerExchangedNow(); + } /// <summary> /// Runs the OneRank strategy |
|
From: Glauco S. <gla...@us...> - 2004-12-13 01:48:57
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataProviders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9253/b3_Data/DataProviders Modified Files: IDataStreamer.cs Log Message: The IsExchanged method is added to the interface. Index: IDataStreamer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/IDataStreamer.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IDataStreamer.cs 29 Nov 2004 16:09:09 -0000 1.2 --- IDataStreamer.cs 13 Dec 2004 01:48:45 -0000 1.3 *************** *** 40,43 **** --- 40,50 ---- double GetCurrentBid( string ticker ); double GetCurrentAsk( string ticker ); + /// <summary> + /// true iif the given ticker is exchanged at the time + /// the method is invoked + /// </summary> + /// <param name="ticker"></param> + /// <returns></returns> + bool IsExchanged( string ticker ); } } |
|
From: Glauco S. <gla...@us...> - 2004-12-13 01:48:02
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a05_Timing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9024/b4_Business/a05_Timing Modified Files: HistoricalEndOfDayTimer.cs Log Message: Bug fixed: now each EndOfDaySpecificTime is properly fired, just once for each day. Index: HistoricalEndOfDayTimer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a05_Timing/HistoricalEndOfDayTimer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HistoricalEndOfDayTimer.cs 29 Nov 2004 14:43:31 -0000 1.1 --- HistoricalEndOfDayTimer.cs 13 Dec 2004 01:47:27 -0000 1.2 *************** *** 74,84 **** while ( this.isActive ) { ! if ( this.MarketOpen != null ) this.MarketOpen( this , new EndOfDayTimingEventArgs( this.currentTime ) ); ! if ( this.FiveMinutesBeforeMarketClose != null ) this.FiveMinutesBeforeMarketClose( this , new EndOfDayTimingEventArgs( this.currentTime ) ); ! if ( this.MarketClose != null ) this.MarketClose( this , new EndOfDayTimingEventArgs( this.currentTime ) ); ! if ( this.OneHourAfterMarketClose != null ) this.OneHourAfterMarketClose( this , new EndOfDayTimingEventArgs( this.currentTime ) ); this.currentTime.MoveNext(); --- 74,88 ---- while ( this.isActive ) { ! if ( ( this.MarketOpen != null ) && ( this.currentTime.EndOfDaySpecificTime == ! EndOfDaySpecificTime.MarketOpen ) ) this.MarketOpen( this , new EndOfDayTimingEventArgs( this.currentTime ) ); ! if ( ( this.FiveMinutesBeforeMarketClose != null ) && ( this.currentTime.EndOfDaySpecificTime == ! EndOfDaySpecificTime.FiveMinutesBeforeMarketClose ) ) this.FiveMinutesBeforeMarketClose( this , new EndOfDayTimingEventArgs( this.currentTime ) ); ! if ( ( this.MarketClose != null ) && ( this.currentTime.EndOfDaySpecificTime == ! EndOfDaySpecificTime.MarketClose ) ) this.MarketClose( this , new EndOfDayTimingEventArgs( this.currentTime ) ); ! if ( ( this.OneHourAfterMarketClose != null ) && ( this.currentTime.EndOfDaySpecificTime == ! EndOfDaySpecificTime.OneHourAfterMarketClose ) ) this.OneHourAfterMarketClose( this , new EndOfDayTimingEventArgs( this.currentTime ) ); this.currentTime.MoveNext(); |
|
From: Glauco S. <gla...@us...> - 2004-12-13 01:45:34
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a07_DataProviders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8641/b4_Business/a07_DataProviders Modified Files: HistoricalEndOfDayDataStreamer.cs Log Message: - Added the IsExchanged method Index: HistoricalEndOfDayDataStreamer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a07_DataProviders/HistoricalEndOfDayDataStreamer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HistoricalEndOfDayDataStreamer.cs 29 Nov 2004 14:45:07 -0000 1.1 --- HistoricalEndOfDayDataStreamer.cs 13 Dec 2004 01:45:17 -0000 1.2 *************** *** 84,87 **** --- 84,97 ---- /// <summary> + /// true iif the ticker was exchanged at the given date time + /// </summary> + /// <param name="ticker"></param> + /// <returns></returns> + public bool IsExchanged( string ticker ) + { + return HistoricalDataProvider.WasExchanged( ticker , + this.endOfDayTimer.GetCurrentTime().GetNearestExtendedDateTime() ); + } + /// <summary> /// Add a ticker whose quotes are to be monitored /// </summary> |
|
From: Glauco S. <gla...@us...> - 2004-12-13 01:44:56
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a3_Ordering In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8520/b4_Business/a1_Financial/a3_Ordering Modified Files: HistoricalEndOfDayOrderExecutor.cs Log Message: Bug fixed: now a new EndOfDayDateTime instance is created for each EndOfDayTransaction Index: HistoricalEndOfDayOrderExecutor.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a3_Ordering/HistoricalEndOfDayOrderExecutor.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HistoricalEndOfDayOrderExecutor.cs 29 Nov 2004 14:51:52 -0000 1.1 --- HistoricalEndOfDayOrderExecutor.cs 13 Dec 2004 01:44:42 -0000 1.2 *************** *** 54,58 **** EndOfDayTransaction endOfDayTransaction = new EndOfDayTransaction( TimedTransaction.GetTransactionType( order.Type ) , order.Instrument , ! order.Quantity , instrumentPrice , this.timer.GetCurrentTime() ); OrderFilled( this , new OrderFilledEventArgs( order , endOfDayTransaction ) ); } --- 54,60 ---- EndOfDayTransaction endOfDayTransaction = new EndOfDayTransaction( TimedTransaction.GetTransactionType( order.Type ) , order.Instrument , ! order.Quantity , instrumentPrice , ! new EndOfDayDateTime( this.timer.GetCurrentTime().DateTime , ! this.timer.GetCurrentTime().EndOfDaySpecificTime ) ); OrderFilled( this , new OrderFilledEventArgs( order , endOfDayTransaction ) ); } |
|
From: Glauco S. <gla...@us...> - 2004-12-13 01:42:54
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataProviders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8119/b3_Data/DataProviders Modified Files: HistoricalDataProvider.cs Log Message: - Added the IsExchanged method Index: HistoricalDataProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/HistoricalDataProvider.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HistoricalDataProvider.cs 29 Nov 2004 16:05:04 -0000 1.3 --- HistoricalDataProvider.cs 13 Dec 2004 01:42:42 -0000 1.4 *************** *** 147,150 **** --- 147,157 ---- ).IndexOfKeyOrPrevious( extendedDateTime.DateTime ) ) ); } + public static bool WasExchanged( string instrumentKey , ExtendedDateTime extendedDateTime ) + { + double marketValue = GetMarketValue( instrumentKey , extendedDateTime ); // forces caching if needed + return ( (History) ((Hashtable) + cachedHistories[ instrumentKey ])[ extendedDateTime.BarComponent ] ).ContainsKey( + extendedDateTime.DateTime ); + } public static double GetMarketValue( string instrumentKey , DateTime dateTime , |
|
From: Marco M. <mi...@us...> - 2004-12-05 19:15:24
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16285/b1_ADT Modified Files: b1_ADT.csproj Removed Files: ITickerReceiver.cs Log Message: Removed ITickerReceiver interface from ADT (the interface must be placed only into data layer - selectors) Index: b1_ADT.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/b1_ADT.csproj,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** b1_ADT.csproj 1 Dec 2004 22:36:10 -0000 1.10 --- b1_ADT.csproj 5 Dec 2004 19:14:56 -0000 1.11 *************** *** 123,131 **** /> <File - RelPath = "ITickerReceiver.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "Keyed.cs" SubType = "Code" --- 123,126 ---- --- ITickerReceiver.cs DELETED --- |