quantproject-developers Mailing List for QuantProject (Page 110)
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...> - 2005-04-24 16:21:50
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22428/b1_ADT Modified Files: ConstantsProvider.cs Log Message: - MinForDifferentGains has been changed to a more reasonable value Index: ConstantsProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ConstantsProvider.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ConstantsProvider.cs 17 Apr 2005 23:05:42 -0000 1.8 --- ConstantsProvider.cs 24 Apr 2005 16:21:39 -0000 1.9 *************** *** 23,27 **** public static double MaxDifferenceForCloseToCloseRatios = 0.005; // threshold above which the equity line gain and the benchmark gain are considered different ! public static double MinForDifferentGains = 0.01; // max num days allowed by the data source (yahoo) public static double MaxNumDaysDownloadedAtEachConnection = 200; --- 23,27 ---- public static double MaxDifferenceForCloseToCloseRatios = 0.005; // threshold above which the equity line gain and the benchmark gain are considered different ! public static double MinForDifferentGains = 0.0003; // max num days allowed by the data source (yahoo) public static double MaxNumDaysDownloadedAtEachConnection = 200; |
|
From: Glauco S. <gla...@us...> - 2005-04-24 15:52:31
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6436/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: RunWalkForwardOneRank.cs Log Message: - The progress bar form is in a new thread now (far better now) - IWalkForwardProgressNotifier interface is implemented ( InSampleNewProgress and OutOfSampleNewProgress events are exposed now) Index: RunWalkForwardOneRank.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/RunWalkForwardOneRank.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RunWalkForwardOneRank.cs 30 Mar 2005 23:40:59 -0000 1.8 --- RunWalkForwardOneRank.cs 24 Apr 2005 15:52:23 -0000 1.9 *************** *** 24,27 **** --- 24,29 ---- using System.Collections; using System.Data; + using System.Threading; + using QuantProject.ADT; using QuantProject.ADT.FileManaging; *************** *** 44,48 **** /// when a fixed time span has elapsed. /// </summary> ! public class RunWalkForwardOneRank : Script { private IHistoricalQuoteProvider historicalQuoteProvider = --- 46,50 ---- /// when a fixed time span has elapsed. /// </summary> ! public class RunWalkForwardOneRank : Script , IWalkForwardProgressNotifier { private IHistoricalQuoteProvider historicalQuoteProvider = *************** *** 63,67 **** public RunWalkForwardOneRank() { - this.progressBarForm = new ProgressBarForm(); this.reportTable = new ReportTable( "Summary_Reports" ); this.startDateTime = new EndOfDayDateTime( --- 65,68 ---- *************** *** 71,74 **** --- 72,79 ---- this.numIntervalDays = 1; } + + public event NewProgressEventHandler InSampleNewProgress; + public event NewProgressEventHandler OutOfSampleNewProgress; + #region Run private void run_initializeEndOfDayTimer() *************** *** 95,101 **** Object sender , NewProgressEventArgs eventArgs ) { ! this.progressBarForm.ProgressBarInSample.Value = eventArgs.CurrentProgress; ! this.progressBarForm.ProgressBarInSample.Refresh(); } private void run_initializeProgressHandlers() { --- 100,118 ---- Object sender , NewProgressEventArgs eventArgs ) { ! this.InSampleNewProgress( this , eventArgs ); } + #region + private void run_initializeProgressBar_newThread() + { + this.progressBarForm = new ProgressBarForm( this ); + this.progressBarForm.ShowDialog(); + } + private void run_initializeProgressBar() + { + Thread thread = new Thread(new ThreadStart(run_initializeProgressBar_newThread)); + // thread.IsBackground = true; + thread.Start(); + } + #endregion private void run_initializeProgressHandlers() { *************** *** 115,121 **** { // a new out of sample time percentage point has been elapsed ! this.progressBarForm.ProgressBarOutOfSample.Value = ! Convert.ToInt16( Math.Floor( elapsedDays / totalDays * 100 ) ); ! this.progressBarForm.ProgressBarOutOfSample.Refresh(); } } --- 132,139 ---- { // a new out of sample time percentage point has been elapsed ! int currentProgress = Convert.ToInt16( Math.Floor( elapsedDays / totalDays * 100 ) ); ! NewProgressEventArgs newProgressEventArgs = ! new NewProgressEventArgs( currentProgress , 100 ); ! this.OutOfSampleNewProgress( this , newProgressEventArgs ); } } *************** *** 134,138 **** // the simulation has reached the ending date this.account.EndOfDayTimer.Stop(); ! this.progressBarForm.Close(); ObjectArchiver.Archive( this.account , @"C:\Documents and Settings\Glauco\Desktop\reports\final.qP" ); --- 152,156 ---- // the simulation has reached the ending date this.account.EndOfDayTimer.Stop(); ! // this.progressBarForm.Close(); ObjectArchiver.Archive( this.account , @"C:\Documents and Settings\Glauco\Desktop\reports\final.qP" ); *************** *** 151,154 **** --- 169,173 ---- run_initializeAccount(); run_initializeEndOfDayTimerHandler(); + run_initializeProgressBar(); run_initializeProgressHandlers(); this.endOfDayTimer.MarketOpen += *************** *** 163,167 **** new FiveMinutesBeforeMarketCloseEventHandler( this.endOfDayTimerHandler.FiveMinutesBeforeMarketCloseEventHandler ); ! this.progressBarForm.Show(); this.endOfDayTimer.Start(); } --- 182,186 ---- new FiveMinutesBeforeMarketCloseEventHandler( this.endOfDayTimerHandler.FiveMinutesBeforeMarketCloseEventHandler ); ! // this.progressBarForm.Show(); this.endOfDayTimer.Start(); } |
|
From: Glauco S. <gla...@us...> - 2005-04-24 15:49:13
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5446/b7_Scripts Modified Files: b7_Scripts.csproj Log Message: Added WalkForwardTesting\WalkForwardOneRank\IWalkForwardProgressNotifier.cs Index: b7_Scripts.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/b7_Scripts.csproj,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** b7_Scripts.csproj 11 Apr 2005 18:52:32 -0000 1.24 --- b7_Scripts.csproj 24 Apr 2005 15:49:03 -0000 1.25 *************** *** 234,237 **** --- 234,242 ---- /> <File + RelPath = "WalkForwardTesting\WalkForwardOneRank\IWalkForwardProgressNotifier.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "WalkForwardTesting\WalkForwardOneRank\ProgressBarForm.cs" SubType = "Form" |
|
From: Glauco S. <gla...@us...> - 2005-04-24 15:48:03
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5185/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Added Files: IWalkForwardProgressNotifier.cs Log Message: Interface to be implemented by time consuming walk forwarding scripts --- NEW FILE: IWalkForwardProgressNotifier.cs --- /* QuantProject - Quantitative Finance Library IWalkForwardProgressNotifier.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; namespace QuantProject.Scripts.WalkForwardTesting.WalkForwardOneRank { /// <summary> /// Interface to be implemented by time consuming walk forwarding scripts /// </summary> public interface IWalkForwardProgressNotifier { event NewProgressEventHandler InSampleNewProgress; event NewProgressEventHandler OutOfSampleNewProgress; } } |
|
From: Marco M. <mi...@us...> - 2005-04-20 17:40:00
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5207/b4_Business Modified Files: b4_Business.csproj Log Message: The project file now points to Account.cs to the right position Index: b4_Business.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** b4_Business.csproj 17 Apr 2005 23:03:07 -0000 1.23 --- b4_Business.csproj 20 Apr 2005 17:39:40 -0000 1.24 *************** *** 258,261 **** --- 258,266 ---- /> <File + RelPath = "a1_Financial\a2_Accounting\Account.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a1_Financial\a2_Accounting\AccountReportRecord.cs" SubType = "Code" *************** *** 443,451 **** /> <File - RelPath = "a1_Financial\a2_Accounting\h5_Reporting\Tables\Account.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "a1_Financial\a2_Accounting\h5_Reporting\Tables\Equity.cs" SubType = "Code" --- 448,451 ---- |
|
From: Marco M. <mi...@us...> - 2005-04-19 18:45:03
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26416/Downloader/TickerSelectors Modified Files: TickerSelectorForm.cs Log Message: Updated visual interface for ITickerSelector objects Index: TickerSelectorForm.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors/TickerSelectorForm.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TickerSelectorForm.cs 14 Apr 2005 18:40:05 -0000 1.13 --- TickerSelectorForm.cs 19 Apr 2005 18:44:52 -0000 1.14 *************** *** 588,592 **** this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); else ! returnValue = new SelectorByWinningOpenToClose(this.textBoxGroupID.Text, this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); --- 588,592 ---- this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); else ! returnValue = new SelectorByWinningOpenToClose(this.tableOfSelectedTickers, this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); |
|
From: Marco M. <mi...@us...> - 2005-04-19 18:33:53
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19749/b7_Scripts/TickerSelectionTesting Modified Files: GenomeManagerForEfficientPortfolio.cs Log Message: Fixed bug in GetFitnessValue method. Now short portfolios should be correctly computed. Index: GenomeManagerForEfficientPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/GenomeManagerForEfficientPortfolio.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GenomeManagerForEfficientPortfolio.cs 14 Apr 2005 18:38:28 -0000 1.5 --- GenomeManagerForEfficientPortfolio.cs 19 Apr 2005 18:33:43 -0000 1.6 *************** *** 126,130 **** else//only short orders are permitted //returnValue = normal.GetProbability(-this.targetPerformance*1.25,-this.targetPerformance*0.75); ! returnValue = normal.GetProbability(this.targetPerformance); } return returnValue; --- 126,130 ---- else//only short orders are permitted //returnValue = normal.GetProbability(-this.targetPerformance*1.25,-this.targetPerformance*0.75); ! returnValue = normal.GetProbability(-this.targetPerformance); } return returnValue; |
|
From: Marco M. <mi...@us...> - 2005-04-19 18:31:28
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/Selectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18801/b3_Data/Selectors Modified Files: SelectorByWinningOpenToClose.cs Log Message: SelectorByWinningOpenToClose class has been completed now Index: SelectorByWinningOpenToClose.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/Selectors/SelectorByWinningOpenToClose.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SelectorByWinningOpenToClose.cs 14 Apr 2005 18:33:22 -0000 1.1 --- SelectorByWinningOpenToClose.cs 19 Apr 2005 18:31:19 -0000 1.2 *************** *** 69,76 **** if(this.setOfTickersToBeSelected == null) ! return QuantProject.DataAccess.Tables.Quotes.GetTickersByWinningOpenToClose(this.isOrderedInASCMode, this.groupID, this.firstQuoteDate, this.lastQuoteDate, this.maxNumOfReturnedTickers); else ! return new DataTable(); } public void SelectAllTickers() --- 69,77 ---- if(this.setOfTickersToBeSelected == null) ! return QuantProject.DataAccess.Tables.Quotes.GetTickersByOpenToCloseWinningDays(this.isOrderedInASCMode, this.groupID, this.firstQuoteDate, this.lastQuoteDate, this.maxNumOfReturnedTickers); else ! return QuantProject.Data.DataTables.Quotes.GetTickersByOpenToCloseWinningDays(this.isOrderedInASCMode, ! this.setOfTickersToBeSelected, this.firstQuoteDate, this.lastQuoteDate, this.maxNumOfReturnedTickers); } public void SelectAllTickers() |
|
From: Marco M. <mi...@us...> - 2005-04-19 18:31:05
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17822/b2_DataAccess/Tables Modified Files: Quotes.cs Log Message: Added and fixed methods for the SelectorByWinningOpenToClose class. Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Quotes.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Quotes.cs 14 Apr 2005 18:33:05 -0000 1.23 --- Quotes.cs 19 Apr 2005 18:30:40 -0000 1.24 *************** *** 591,599 **** /// <summary> ! /// returns tickers having raw close greater than raw open ! /// at the given interval of days (within the given group of tickers). ! /// Tickers are ordered by raw close to open ratio. /// </summary> ! public static DataTable GetTickersByWinningOpenToClose( bool orderInASCMode, string groupID, DateTime firstQuoteDate, DateTime lastQuoteDate, --- 591,599 ---- /// <summary> ! /// returns tickers counting how many times raw close is greater than raw open ! /// for the given interval of days (within the given group of tickers). ! /// Tickers are ordered by the number of days raw open is greater than raw close /// </summary> ! public static DataTable GetTickersByOpenToCloseWinningDays( bool orderInASCMode, string groupID, DateTime firstQuoteDate, DateTime lastQuoteDate, *************** *** 601,605 **** { string sql = "SELECT TOP " + maxNumOfReturnedTickers + " quotes.quTicker, tickers.tiCompanyName, " + ! "quotes.quClose/quotes.quOpen AS CloseToOpenRatio " + "FROM (quotes INNER JOIN tickers ON quotes.quTicker=tickers.tiTicker) " + "INNER JOIN tickers_tickerGroups ON tickers.tiTicker=tickers_tickerGroups.ttTiId " + --- 601,605 ---- { string sql = "SELECT TOP " + maxNumOfReturnedTickers + " quotes.quTicker, tickers.tiCompanyName, " + ! "Count(quotes.quClose) AS CloseToOpenWinningDays " + "FROM (quotes INNER JOIN tickers ON quotes.quTicker=tickers.tiTicker) " + "INNER JOIN tickers_tickerGroups ON tickers.tiTicker=tickers_tickerGroups.ttTiId " + *************** *** 608,612 **** "AND " + "tickers_tickerGroups.ttTgId='" + groupID + "' " + "AND " + "quotes.quClose > quotes.quOpen " + ! "ORDER BY quotes.quClose/quotes.quOpen"; string sortDirection = " DESC"; if(orderInASCMode) --- 608,613 ---- "AND " + "tickers_tickerGroups.ttTgId='" + groupID + "' " + "AND " + "quotes.quClose > quotes.quOpen " + ! "GROUP BY quotes.quTicker, tickers.tiCompanyName " + ! "ORDER BY Count(quotes.quClose)"; string sortDirection = " DESC"; if(orderInASCMode) *************** *** 785,788 **** --- 786,815 ---- } + /// <summary> + /// Returns number of days for which raw close was greater than raw open + /// for the given interval of days (for the given ticker). + /// </summary> + public static int GetNumberOfOpenToCloseWinningDays(string ticker, + DateTime firstQuoteDate, + DateTime lastQuoteDate) + { + DataTable dt; + int returnValue = 0; + string sql = "SELECT Count(quotes.quClose) AS CloseToOpenWinningDays " + + "FROM quotes WHERE " + + "quotes.quDate Between " + SQLBuilder.GetDateConstant(firstQuoteDate) + " " + + "AND " + SQLBuilder.GetDateConstant(lastQuoteDate) + " " + + "AND " + "quotes.quTicker='" + ticker + "' " + + "AND quotes.quClose > quotes.quOpen"; + + dt = SqlExecutor.GetDataTable( sql ); + if(dt.Rows.Count > 0) + returnValue = (int)dt.Rows[0][0]; + + return returnValue; + } + + + #region GetHashValue private string getHashValue_getQuoteString_getRowString_getSingleValueString( Object value ) |
|
From: Marco M. <mi...@us...> - 2005-04-19 18:30:59
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataTables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17822/b3_Data/DataTables Modified Files: Quotes.cs Log Message: Added and fixed methods for the SelectorByWinningOpenToClose class. Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataTables/Quotes.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Quotes.cs 30 Mar 2005 16:02:54 -0000 1.14 --- Quotes.cs 19 Apr 2005 18:30:48 -0000 1.15 *************** *** 339,343 **** } } ! private History history; /// <summary> --- 339,369 ---- } } ! ! /// <summary> ! /// returns tickers counting how many times raw close is greater than raw open ! /// for the given interval of days (within the given table of tickers). ! /// Tickers are ordered by the number of days raw open is greater than raw close ! /// </summary> ! public static DataTable GetTickersByOpenToCloseWinningDays( bool orderByASC, ! DataTable setOfTickers, ! DateTime firstQuoteDate, ! DateTime lastQuoteDate, ! long maxNumOfReturnedTickers) ! { ! if(!setOfTickers.Columns.Contains("NumOpenCloseWinningDays")) ! setOfTickers.Columns.Add("NumOpenCloseWinningDays", System.Type.GetType("System.Double")); ! foreach(DataRow row in setOfTickers.Rows) ! { ! row["NumOpenCloseWinningDays"] = ! QuantProject.DataAccess.Tables.Quotes.GetNumberOfOpenToCloseWinningDays((string)row[0], ! firstQuoteDate, lastQuoteDate); ! } ! DataTable returnValue = ExtendedDataTable.CopyAndSort(setOfTickers,"NumOpenCloseWinningDays", orderByASC); ! ExtendedDataTable.DeleteRows(returnValue, maxNumOfReturnedTickers); ! return returnValue; ! } ! ! ! private History history; /// <summary> |
|
From: Marco M. <mi...@us...> - 2005-04-19 18:27:09
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16820/b4_Business Modified Files: Business.prjx Log Message: Updated #develope project files. Index: Business.prjx =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/Business.prjx,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Business.prjx 11 Apr 2005 18:45:48 -0000 1.2 --- Business.prjx 19 Apr 2005 18:26:57 -0000 1.3 *************** *** 84,87 **** --- 84,91 ---- <File name=".\a4_Scripting\Script.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> <File name=".\a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\BenchmarkPercentageReturn.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> + <File name=".\a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\NumberLosingPeriods.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> + <File name=".\a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\NumberWinningPeriods.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> + <File name=".\a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\PercentageWinningPeriods.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> + <File name=".\a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\NumberEvenPeriods.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> </Contents> <References> |
|
From: Marco M. <mi...@us...> - 2005-04-19 18:27:09
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16820/b1_ADT Modified Files: ADT.prjx Log Message: Updated #develope project files. Index: ADT.prjx =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ADT.prjx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ADT.prjx 17 Mar 2005 18:45:02 -0000 1.1 --- ADT.prjx 19 Apr 2005 18:26:57 -0000 1.2 *************** *** 28,31 **** --- 28,33 ---- <File name=".\Statistics\IPdfDefiner.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> <File name=".\Statistics\NormalDistribution.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> + <File name=".\Histories\PreviousInterpolator.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> + <File name=".\Histories\IInterpolatonMethod.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> </Contents> <References /> |
|
From: Marco M. <mar...@li...> - 2005-04-18 20:59:06
|
>>Purtroppo ci mette una VALANGA di tempo. >>Non a caso, infatti, il file config viene letto all'avvio e poi non vie= ne=20 >>pi=F9 cunato. >> >>Allora come si potrebbe fare? >Apri una finestra con un pulsante. Se si preme il pulsante, salva il rep= ort=20 >fino al punto elaborato e poi si ferma. Insomma, tra un po' bisogner=E0 sporcarsi le mani con la programmazione=20 multi - thread ... (perch=E8 mi sembra che di questo si tratti, o no?) Mi =E8 venuto in mente che si potrebbe anche mettere un tempo massimo di=20 esecuzione (poniamo 50 ore): se mi sono stufato e non ha ancora finito, sposto l'ora in avanti in modo= da=20 fargli superare il limite, cos=EC si ferma e mi salva il report fino a quel punto. Vedi qualche controindicazione ? |
|
From: Glauco S. <gl...@my...> - 2005-04-18 14:57:33
|
At 12:54 PM 4/18/2005 +0200, you wrote: >Purtroppo ci mette una VALANGA di tempo. >Non a caso, infatti, il file config viene letto all'avvio e poi non viene= =20 >pi=F9 cunato. > >Allora come si potrebbe fare? Apri una finestra con un pulsante. Se si preme il pulsante, salva il report= =20 fino al punto elaborato e poi si ferma. |
|
From: marco\.milletti\@l <mar...@li...> - 2005-04-18 10:54:27
|
> At 11:16 PM 4/17/2005 +0200, you wrote: > >Ho semplicemente aggiunto u= na modifica al codice del mio script in cui dico: > >"ferma il timer qua= ndo la data finale =E8 raggiunta oppure se esiste un certo > >file (uno = qualunque: basta che sia un file con quel certo nome ...) nella > >direc= tory dell'exe". > > Occhio che se deve controllare ogni volta l'esiste= nza di un file, temo che > impieghi un sacco di tempo (deve accedere a = disco). Mi saprai dire. Purtroppo ci mette una VALANGA di tempo. Non = a caso, infatti, il file config viene letto all'avvio e poi non viene pi=F9= cunato. Allora come si potrebbe fare? > >Se aggiungo 'sto file, lo= script si interrompe e il report viene > >serializzato fino a quel punt= o (come se la data > >finale fosse effettivamente raggiunta). > >Beh, e= ffettivamente non ho pensato a fermare l'esecuzione per poi > >riprende= rla dal punto interrotto ... ma credo che si potrebbe fare. > >Basterebb= e serializzare l'account per poi passarlo allo script e quindi > >ripren= dere da quel punto. > > > > > > > > > > > >------------------------= ------------------------------- > >SF email is sponsored by - The IT Pro= duct Guide > >Read honest & candid reviews on hundreds of IT Products fr= om real users. > >Discover which products truly live up to the hype. Sta= rt reading now. > >_______________________________________________ > >Q= uantproject-developers mailing list > >Qua...@li...= rceforge.net > >https://lists.sourceforge.net/lists/listinfo/quantprojec= t-developers > > > > ---------------------------------------------= ---------- > SF email is sponsored by - The IT Product Guide > Read hon= est & candid reviews on hundreds of IT Products from real users. > Disco= ver which products truly live up to the hype. Start reading now. > http:= //ads.osdn.com/?ad_ide95&alloc_id=14396&op=0A=0A=0A=0A___________________= _________________________________________=0A6X velocizzare la tua navigaz= ione a 56k? 6X Web Accelerator di Libero!=0AScaricalo su INTERNET GRATIS = 6X http://www.libero.it=0A |
|
From: Glauco S. <gla...@us...> - 2005-04-17 23:15:25
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3889/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Modified Files: NumberWinningPeriods.cs Log Message: Single type values are converted to double, now. Index: NumberWinningPeriods.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/NumberWinningPeriods.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NumberWinningPeriods.cs 17 Apr 2005 22:11:22 -0000 1.1 --- NumberWinningPeriods.cs 17 Apr 2005 23:15:15 -0000 1.2 *************** *** 44,50 **** (double)this.summary.AccountReport.EquityHistory.GetByIndex( i ); double benchmarkGain = ! ( (double)this.summary.AccountReport.BenchmarkEquityLine.GetByIndex( i + 1 ) - ! (double)this.summary.AccountReport.BenchmarkEquityLine.GetByIndex( i ) ) / ! (double)this.summary.AccountReport.BenchmarkEquityLine.GetByIndex( i ); if ( ( equityHistoryGain - benchmarkGain ) > ConstantsProvider.MinForDifferentGains ) this.summary.NumberWinningPeriods++; --- 44,50 ---- (double)this.summary.AccountReport.EquityHistory.GetByIndex( i ); double benchmarkGain = ! ( Convert.ToDouble( this.summary.AccountReport.BenchmarkEquityLine.GetByIndex( i + 1 ) ) - ! Convert.ToDouble( this.summary.AccountReport.BenchmarkEquityLine.GetByIndex( i ) ) ) / ! Convert.ToDouble( this.summary.AccountReport.BenchmarkEquityLine.GetByIndex( i ) ); if ( ( equityHistoryGain - benchmarkGain ) > ConstantsProvider.MinForDifferentGains ) this.summary.NumberWinningPeriods++; |
|
From: Glauco S. <gla...@us...> - 2005-04-17 23:05:55
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30941/b1_ADT Modified Files: ConstantsProvider.cs Log Message: - added MinForDifferentGains Index: ConstantsProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ConstantsProvider.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ConstantsProvider.cs 1 Aug 2004 00:28:54 -0000 1.7 --- ConstantsProvider.cs 17 Apr 2005 23:05:42 -0000 1.8 *************** *** 22,25 **** --- 22,27 ---- public static double MaxDifferenceForAdjustedValues = 0.01; public static double MaxDifferenceForCloseToCloseRatios = 0.005; + // threshold above which the equity line gain and the benchmark gain are considered different + public static double MinForDifferentGains = 0.01; // max num days allowed by the data source (yahoo) public static double MaxNumDaysDownloadedAtEachConnection = 200; |
|
From: Glauco S. <gla...@us...> - 2005-04-17 23:05:12
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30722/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables Modified Files: Summary.cs Log Message: - added NumberWinningPeriods - added NumberLosingPeriods - added NumberEvenPeriods - added PercentageWinningPeriods Index: Summary.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables/Summary.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Summary.cs 30 Mar 2005 23:40:59 -0000 1.14 --- Summary.cs 17 Apr 2005 23:05:02 -0000 1.15 *************** *** 19,23 **** private double totalPnl; private double benchmarkPercentageReturn; ! private double finalAccountValue; private long intervalDays; private MaxEquityDrawDown maxEquityDrawDown; --- 19,23 ---- private double totalPnl; private double benchmarkPercentageReturn; ! private double finalAccountValue; private long intervalDays; private MaxEquityDrawDown maxEquityDrawDown; *************** *** 56,59 **** --- 56,69 ---- public double ReturnOnAccount; public double AnnualSystemPercentageReturn; + public int NumberWinningPeriods; + public int NumberLosingPeriods; + public int NumberEvenPeriods; + public double PercentageWinningPeriods + { + get + { + return this.NumberWinningPeriods*100/(this.NumberWinningPeriods+this.NumberLosingPeriods); + } + } public double MaxEquityDrawDown { *************** *** 145,151 **** getSummary_setRow( new TotalNetProfit( this ) , summaryDataTable ); getSummary_setRow( new ReturnOnAccount( this ) , summaryDataTable ); ! getSummary_setRow( new BenchmarkPercentageReturn( this , this.historicalQuoteProvider ) , summaryDataTable ); ! getSummary_setRow( new AnnualSystemPercentageReturn( this ) , summaryDataTable ); this.maxEquityDrawDown = new MaxEquityDrawDown( this ); getSummary_setRow( this.maxEquityDrawDown , summaryDataTable ); --- 155,166 ---- getSummary_setRow( new TotalNetProfit( this ) , summaryDataTable ); getSummary_setRow( new ReturnOnAccount( this ) , summaryDataTable ); ! getSummary_setRow( new BenchmarkPercentageReturn( this , this.historicalQuoteProvider ) , summaryDataTable ); ! getSummary_setRow( new NumberWinningPeriods( this ) , summaryDataTable ); ! getSummary_setRow( new NumberLosingPeriods( this ) , summaryDataTable ); ! getSummary_setRow( new NumberEvenPeriods( this ) , summaryDataTable ); ! getSummary_setRow( new PercentageWinningPeriods( this ) , summaryDataTable ); ! //this.getSummary_setRows_forEquityVsBenchmarkComparison(); ! getSummary_setRow( new AnnualSystemPercentageReturn( this ) , summaryDataTable ); this.maxEquityDrawDown = new MaxEquityDrawDown( this ); getSummary_setRow( this.maxEquityDrawDown , summaryDataTable ); |
|
From: Glauco S. <gla...@us...> - 2005-04-17 23:05:11
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30722/b5_Presentation/Reporting/WindowsForm Modified Files: SummaryTabPage.cs Log Message: - added NumberWinningPeriods - added NumberLosingPeriods - added NumberEvenPeriods - added PercentageWinningPeriods Index: SummaryTabPage.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/SummaryTabPage.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SummaryTabPage.cs 30 Mar 2005 23:40:58 -0000 1.4 --- SummaryTabPage.cs 17 Apr 2005 23:05:02 -0000 1.5 *************** *** 35,39 **** { // constant values for label's placement ! private int labelRows = 8; private int xForLabels = 17; private int textLabelsWidth = 180; --- 35,39 ---- { // constant values for label's placement ! private int labelRows = 10; private int xForLabels = 17; private int textLabelsWidth = 180; *************** *** 54,57 **** --- 54,65 ---- private System.Windows.Forms.Label lblTotalCommission; private System.Windows.Forms.Label lblValTotalCommission; + private System.Windows.Forms.Label lblNumberWinningPeriods; + private System.Windows.Forms.Label lblValNumberWinningPeriods; + private System.Windows.Forms.Label lblNumberLosingPeriods; + private System.Windows.Forms.Label lblValNumberLosingPeriods; + private System.Windows.Forms.Label lblNumberEvenPeriods; + private System.Windows.Forms.Label lblValNumberEvenPeriods; + private System.Windows.Forms.Label lblPercentageWinningPeriods; + private System.Windows.Forms.Label lblValPercentageWinningPeriods; private System.Windows.Forms.Label lblTotalNumberOfTrades; private System.Windows.Forms.Label lblValTotalNumberOfTrades; *************** *** 135,138 **** --- 143,154 ---- this.lblTotalCommission = new System.Windows.Forms.Label(); this.lblValTotalCommission = new System.Windows.Forms.Label(); + this.lblNumberWinningPeriods = new System.Windows.Forms.Label(); + this.lblValNumberWinningPeriods = new System.Windows.Forms.Label(); + this.lblNumberLosingPeriods = new System.Windows.Forms.Label(); + this.lblValNumberLosingPeriods = new System.Windows.Forms.Label(); + this.lblNumberEvenPeriods = new System.Windows.Forms.Label(); + this.lblValNumberEvenPeriods = new System.Windows.Forms.Label(); + this.lblPercentageWinningPeriods = new System.Windows.Forms.Label(); + this.lblValPercentageWinningPeriods = new System.Windows.Forms.Label(); this.lblTotalNumberOfTrades = new System.Windows.Forms.Label(); this.lblValTotalNumberOfTrades = new System.Windows.Forms.Label(); *************** *** 210,213 **** --- 226,256 ---- this.addValueLabel( this.lblValTotalCommission , "lblValTotalCommission" ); // + // lblNumberWinningPeriods + // + this.addTextLabel( this.lblNumberWinningPeriods , "lblNumberWinningPeriods" , + "Number Winning Periods:" ); + // + // lblValNumberWinningPeriods + // + this.addValueLabel( this.lblValNumberWinningPeriods , "lblValNumberWinningPeriods" ); + // + // lblNumberLosingPeriods + // + this.addTextLabel( this.lblNumberLosingPeriods , "lblNumberWinningPeriods" , + "Number Losing Periods:" ); + // + // lblValNumberLosingPeriods + // + this.addValueLabel( this.lblValNumberLosingPeriods , "lblValNumberLosingPeriods" ); + // + // lblPercentageWinningPeriods + // + this.addTextLabel( this.lblPercentageWinningPeriods , "lblPercentageWinningPeriods" , + "% Winning Periods:" ); + // + // lblValPercentageWinningPeriods + // + this.addValueLabel( this.lblValPercentageWinningPeriods , "lblValPercentageWinningPeriods" ); + // // lblTotalNumberOfTrades // *************** *** 315,318 **** --- 358,367 ---- this.lblValTotalCommission.Text = FormatProvider.ConvertToStringWithTwoDecimals( this.accountReport.Summary.TotalCommissionAmount ); + this.lblValNumberWinningPeriods.Text = + this.accountReport.Summary.NumberWinningPeriods.ToString(); + this.lblValNumberLosingPeriods.Text = + this.accountReport.Summary.NumberLosingPeriods.ToString(); + this.lblValPercentageWinningPeriods.Text = + FormatProvider.ConvertToStringWithTwoDecimals( this.accountReport.Summary.PercentageWinningPeriods ); this.lblValTotalNumberOfTrades.Text = FormatProvider.ConvertToStringWithTwoDecimals( this.accountReport.Summary.TotalNumberOfTrades ); |
|
From: Glauco S. <gla...@us...> - 2005-04-17 23:03:16
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29812/b4_Business Modified Files: b4_Business.csproj Log Message: - added h5_Reporting\SummaryRows\NumberEvenPeriods.cs - added h5_Reporting\SummaryRows\NumberLosingPeriods.cs - added h5_Reporting\SummaryRows\NumberWinningPeriods.cs - added h5_Reporting\SummaryRows\PercentageWinningPeriods.cs Index: b4_Business.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** b4_Business.csproj 30 Mar 2005 23:45:28 -0000 1.22 --- b4_Business.csproj 17 Apr 2005 23:03:07 -0000 1.23 *************** *** 258,266 **** /> <File - RelPath = "a1_Financial\a2_Accounting\Account.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "a1_Financial\a2_Accounting\AccountReportRecord.cs" SubType = "Code" --- 258,261 ---- *************** *** 378,381 **** --- 373,386 ---- /> <File + RelPath = "a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\NumberEvenPeriods.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\NumberLosingPeriods.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\NumberWinningLongTrades.cs" SubType = "Code" *************** *** 383,386 **** --- 388,396 ---- /> <File + RelPath = "a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\NumberWinningPeriods.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\NumberWinningShortTrades.cs" SubType = "Code" *************** *** 393,396 **** --- 403,411 ---- /> <File + RelPath = "a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\PercentageWinningPeriods.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\ReturnOnAccount.cs" SubType = "Code" *************** *** 428,431 **** --- 443,451 ---- /> <File + RelPath = "a1_Financial\a2_Accounting\h5_Reporting\Tables\Account.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a1_Financial\a2_Accounting\h5_Reporting\Tables\Equity.cs" SubType = "Code" |
|
From: Glauco S. <gl...@my...> - 2005-04-17 23:00:54
|
At 11:16 PM 4/17/2005 +0200, you wrote: >Ho semplicemente aggiunto una modifica al codice del mio script in cui= dico: >"ferma il timer quando la data finale =E8 raggiunta oppure se esiste un= certo >file (uno qualunque: basta che sia un file con quel certo nome ...) nella >directory dell'exe". Occhio che se deve controllare ogni volta l'esistenza di un file, temo che= =20 impieghi un sacco di tempo (deve accedere a disco). Mi saprai dire. >Se aggiungo 'sto file, lo script si interrompe e il report viene >serializzato fino a quel punto (come se la data >finale fosse effettivamente raggiunta). >Beh, effettivamente non ho pensato a fermare l'esecuzione per poi >riprenderla dal punto interrotto ... ma credo che si potrebbe fare. >Basterebbe serializzare l'account per poi passarlo allo script e quindi >riprendere da quel punto. > > > > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >_______________________________________________ >Quantproject-developers mailing list >Qua...@li... >https://lists.sourceforge.net/lists/listinfo/quantproject-developers |
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1805/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Added Files: PercentageWinningPeriods.cs NumberWinningPeriods.cs NumberLosingPeriods.cs NumberEvenPeriods.cs Log Message: Account report rummary rows that compute the Equity Line vs Benchmark comparison --- NEW FILE: NumberEvenPeriods.cs --- /* QuantProject - Quantitative Finance Library NumberEvenPeriods.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.Data; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting.Reporting.Tables; using QuantProject.Business.Financial.Instruments; namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryRows { /// <summary> /// Summary row that computes the Equity Line vs Benchmark comparison /// </summary> [Serializable] public class NumberEvenPeriods : SummaryRow { public NumberEvenPeriods( Summary summary ) { this.rowDescription = "# even periods"; this.rowValue = summary.NumberEvenPeriods; } } } --- NEW FILE: NumberWinningPeriods.cs --- /* QuantProject - Quantitative Finance Library NumberWinningPeriods.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.Data; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting.Reporting.Tables; using QuantProject.Business.Financial.Instruments; namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryRows { /// <summary> /// Summary row that computes the Equity Line vs Benchmark comparison /// </summary> [Serializable] public class NumberWinningPeriods : SummaryRow { private Summary summary; private void setWinningLosingAndEvenPeriods_forPeriod( int i ) { double equityHistoryGain = ( (double)this.summary.AccountReport.EquityHistory.GetByIndex( i + 1 ) - (double)this.summary.AccountReport.EquityHistory.GetByIndex( i ) ) / (double)this.summary.AccountReport.EquityHistory.GetByIndex( i ); double benchmarkGain = ( (double)this.summary.AccountReport.BenchmarkEquityLine.GetByIndex( i + 1 ) - (double)this.summary.AccountReport.BenchmarkEquityLine.GetByIndex( i ) ) / (double)this.summary.AccountReport.BenchmarkEquityLine.GetByIndex( i ); if ( ( equityHistoryGain - benchmarkGain ) > ConstantsProvider.MinForDifferentGains ) this.summary.NumberWinningPeriods++; else { if ( ( benchmarkGain - equityHistoryGain ) > ConstantsProvider.MinForDifferentGains ) this.summary.NumberLosingPeriods++; else this.summary.NumberEvenPeriods++; } } public void SetWinningLosingAndEvenPeriods() { this.summary.NumberWinningPeriods = 0; this.summary.NumberLosingPeriods = 0; this.summary.NumberEvenPeriods = 0; for ( int i=0; i<this.summary.AccountReport.EquityHistory.Count - 1 ; i++ ) this.setWinningLosingAndEvenPeriods_forPeriod( i ); } public NumberWinningPeriods( Summary summary ) { this.summary = summary; this.SetWinningLosingAndEvenPeriods(); this.rowDescription = "# winning periods"; this.rowValue = this.summary.NumberWinningPeriods; } } } --- NEW FILE: NumberLosingPeriods.cs --- /* QuantProject - Quantitative Finance Library NumberLosingPeriods.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.Data; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting.Reporting.Tables; using QuantProject.Business.Financial.Instruments; namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryRows { /// <summary> /// Summary row that computes the Equity Line vs Benchmark comparison /// </summary> [Serializable] public class NumberLosingPeriods : SummaryRow { public NumberLosingPeriods( Summary summary ) { this.rowDescription = "# losing periods"; this.rowValue = summary.NumberLosingPeriods; } } } --- NEW FILE: PercentageWinningPeriods.cs --- /* QuantProject - Quantitative Finance Library PercentageWinningPeriods.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.Data; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting.Reporting.Tables; using QuantProject.Business.Financial.Instruments; namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryRows { /// <summary> /// Summary row that computes the Equity Line vs Benchmark comparison /// </summary> [Serializable] public class PercentageWinningPeriods : SummaryRow { public PercentageWinningPeriods( Summary summary ) { this.rowDescription = "# losing periods"; this.rowValue = summary.PercentageWinningPeriods; } } } |
|
From: Marco M. <mar...@li...> - 2005-04-17 21:16:48
|
----- Original Message -----=20 From: "Glauco Siliprandi" <gl...@my...> To: <qua...@li...> Sent: Sunday, April 17, 2005 6:04 PM Subject: [Quantproject-developers] Re: [Quantproject-developers]=20 QuantProject/b7_Scripts/TickerSelectionTesting=20 RunEfficientPortfolio.cs,1.3,1.4 > At 01:36 PM 4/17/2005 +0000, you wrote: >>Now very long script can be stopped (and report or account saved to dis= k=20 >>up to that moment) by adding a "flag" file in the bin dir. > > Come fai a salvare lo stato dell'esecuzione per poi riprendere da quel=20 > punto? E' una funzionalita' di .Net? Mi spiego meglio (rileggendomi in inglese sembrerebbe che abbia creato=20 qualcosa di generale: in realt=E0 riguarda solo il mio script). Mi =E8 capitato di dover fermare uno script molto lungo (avevo settato in= =20 maniera un esagerata l'ottimizzatore genetico): purtroppo non c'era modo di fargl= i=20 serializzare l'account fino a quel momento (insomma: niente report ...). Mi sembra di=20 capire infatti che non si pu=F2 modificare il codice sorgente c# durante l'esecuzione in modalit=E0 debug. Con C++ mi pare invece di aver = letto=20 che si pu=F2 fare. Ho semplicemente aggiunto una modifica al codice del mio script in cui di= co: "ferma il timer quando la data finale =E8 raggiunta oppure se esiste un c= erto=20 file (uno qualunque: basta che sia un file con quel certo nome ...) nella= =20 directory dell'exe". Se aggiungo 'sto file, lo script si interrompe e il report viene=20 serializzato fino a quel punto (come se la data finale fosse effettivamente raggiunta). Beh, effettivamente non ho pensato a fermare l'esecuzione per poi=20 riprenderla dal punto interrotto ... ma credo che si potrebbe fare. Basterebbe serializzare l'account per poi passarlo allo script e quindi=20 riprendere da quel punto. |
|
From: Glauco S. <gl...@my...> - 2005-04-17 16:05:08
|
At 01:36 PM 4/17/2005 +0000, you wrote: >Now very long script can be stopped (and report or account saved to disk >up to that moment) by adding a "flag" file in the bin dir. Come fai a salvare lo stato dell'esecuzione per poi riprendere da quel punto? E' una funzionalita' di .Net? |
|
From: Marco M. <mi...@us...> - 2005-04-17 13:36:47
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28085/b7_Scripts/TickerSelectionTesting Modified Files: RunEfficientPortfolio.cs Log Message: Now very long script can be stopped (and report or account saved to disk up to that moment) by adding a "flag" file in the bin dir. Index: RunEfficientPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/RunEfficientPortfolio.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RunEfficientPortfolio.cs 11 Apr 2005 18:52:32 -0000 1.3 --- RunEfficientPortfolio.cs 17 Apr 2005 13:36:37 -0000 1.4 *************** *** 25,28 **** --- 25,29 ---- using System.Collections; using System.Data; + using System.Windows.Forms; using QuantProject.ADT; using QuantProject.ADT.Optimizing.Genetic; *************** *** 155,159 **** //Report report; ! if(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime>=this.endDateTime.DateTime ) { this.endOfDayTimer.Stop(); --- 156,164 ---- //Report report; ! if(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime>=this.endDateTime.DateTime || ! File.Exists(Application.ExecutablePath.Substring(0, Application.ExecutablePath.LastIndexOf('\\')) ! + @"\StopScript.txt")) ! //If you want to stop timer and save script until now, create ! //in bin dir a file named "StopScript.txt" { this.endOfDayTimer.Stop(); |