quantproject-developers Mailing List for QuantProject (Page 59)
Brought to you by:
glauco_1
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(103) |
Dec
(67) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(52) |
Feb
(9) |
Mar
(69) |
Apr
(53) |
May
(80) |
Jun
(23) |
Jul
(24) |
Aug
(112) |
Sep
(9) |
Oct
|
Nov
(58) |
Dec
(93) |
| 2005 |
Jan
(90) |
Feb
(93) |
Mar
(61) |
Apr
(56) |
May
(37) |
Jun
(61) |
Jul
(55) |
Aug
(68) |
Sep
(25) |
Oct
(46) |
Nov
(41) |
Dec
(37) |
| 2006 |
Jan
(33) |
Feb
(7) |
Mar
(19) |
Apr
(27) |
May
(73) |
Jun
(49) |
Jul
(83) |
Aug
(66) |
Sep
(45) |
Oct
(16) |
Nov
(15) |
Dec
(7) |
| 2007 |
Jan
(14) |
Feb
(33) |
Mar
|
Apr
(21) |
May
|
Jun
(34) |
Jul
(18) |
Aug
(100) |
Sep
(39) |
Oct
(55) |
Nov
(12) |
Dec
(2) |
| 2008 |
Jan
(120) |
Feb
(133) |
Mar
(129) |
Apr
(104) |
May
(42) |
Jun
(2) |
Jul
(52) |
Aug
(99) |
Sep
(134) |
Oct
|
Nov
(137) |
Dec
(48) |
| 2009 |
Jan
(48) |
Feb
(55) |
Mar
(61) |
Apr
(3) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(51) |
Sep
|
Oct
(7) |
Nov
|
Dec
|
| 2010 |
Jan
(7) |
Feb
(1) |
Mar
(145) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
|
| 2011 |
Jan
(78) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(88) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Marco M. <mi...@us...> - 2008-02-06 23:02:07
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25708/a2_Strategies/Eligibles Modified Files: EligibleTickers.cs Log Message: Added Tickers property, for getting an array of string containing the eligible tickers Index: EligibleTickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles/EligibleTickers.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EligibleTickers.cs 19 Jan 2008 17:40:15 -0000 1.1 --- EligibleTickers.cs 6 Feb 2008 23:01:28 -0000 1.2 *************** *** 31,34 **** --- 31,49 ---- public class EligibleTickers : System.Collections.CollectionBase { + private string[] tickers; + public string[] Tickers + { + get + { + if(this.tickers == null) + { + this.tickers = new string[this.Count]; + for(int i = 0;i<this.Count; i++) + this.tickers[i] = this[i]; + } + return this.tickers; + } + } + /// <summary> /// *************** *** 56,60 **** this.checkParameter( dataRow ); this.addTicker_actually( (string)dataRow[ 0 ] ); ! } private void addTickers( DataTable dtTickers ) { foreach ( DataRow dataRow in dtTickers.Rows ) --- 71,76 ---- this.checkParameter( dataRow ); this.addTicker_actually( (string)dataRow[ 0 ] ); ! } ! private void addTickers( DataTable dtTickers ) { foreach ( DataRow dataRow in dtTickers.Rows ) |
|
From: Marco M. <mi...@us...> - 2008-02-06 22:59:34
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24777/a2_Strategies/Eligibles Added Files: ByPriceMostLiquidAlwaysQuoted.cs Log Message: Added new IEligiblesSelector class "ByPriceMostLiquidAlwaysQuoted" for a selections on tickers to be used before in sample optimization process. The implementation for the Description property has to be done ... --- NEW FILE: ByPriceMostLiquidAlwaysQuoted.cs --- /* QuantProject - Quantitative Finance Library ByPriceMostLiquidAlwaysQuoted.cs Copyright (C) 2008 Marco Milletti This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Data; using QuantProject.ADT.Messaging; using QuantProject.Business.Strategies.ReturnsManagement.Time; using QuantProject.Business.Timing; using QuantProject.Data.Selectors; namespace QuantProject.Business.Strategies.Eligibles { /// <summary> /// Implements IEligiblesSelector for selecting a given max number of tickers through /// the following step-by-step selecting process: /// -step 1: all tickers belonging to a given group /// are selected (the group can be "temporized": that is tickers /// are returned depending on the time the selection is requested: /// the group SP 500 should be like that); /// -step 2: from tickers selected by step 1, the most liquid /// are selected (not more than a given max number); /// -step 3: from tickers selected by step 2, the ones that are /// always quoted at all market days are selected (not more than a given max number); /// </summary> public class ByPriceMostLiquidAlwaysQuoted : IEligiblesSelector { public event NewMessageHandler NewMessage; private bool temporizedGroup; private string tickersGroupID; private int maxNumberOfEligibleTickersToBeChosen; private int numOfDaysForAverageOpenRawPriceComputation; private double minPrice; private double maxPrice; private string description; public string Description { get{ return "Change me!"; } } public ByPriceMostLiquidAlwaysQuoted( string tickersGroupID , bool temporizedGroup, int maxNumberOfEligibleTickersToBeChosen, int numOfDaysForAverageOpenRawPriceComputation, double minPrice, double maxPrice) { this.temporizedGroup = temporizedGroup; this.tickersGroupID = tickersGroupID; this.maxNumberOfEligibleTickersToBeChosen = maxNumberOfEligibleTickersToBeChosen; this.numOfDaysForAverageOpenRawPriceComputation = numOfDaysForAverageOpenRawPriceComputation; this.minPrice = minPrice; this.maxPrice = maxPrice; } private EligibleTickers getEligibleTickers_actually( EndOfDayHistory endOfDayHistory ) { DateTime currentDate = endOfDayHistory.LastEndOfDayDateTime.DateTime; SelectorByGroup group; if(this.temporizedGroup) //the group is "temporized": returned set of tickers // depend on time group = new SelectorByGroup(this.tickersGroupID, currentDate); else//the group is not temporized group = new SelectorByGroup(this.tickersGroupID); DataTable tickersFromGroup = group.GetTableOfSelectedTickers(); int numOfTickersInGroupAtCurrentDate = tickersFromGroup.Rows.Count; SelectorByAverageRawOpenPrice byPrice = new SelectorByAverageRawOpenPrice(tickersFromGroup,false, currentDate.AddDays(-this.numOfDaysForAverageOpenRawPriceComputation), currentDate, numOfTickersInGroupAtCurrentDate, this.minPrice,this.maxPrice, 0.0001,100); SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity(byPrice.GetTableOfSelectedTickers(), false, endOfDayHistory.FirstEndOfDayDateTime.DateTime, currentDate, this.maxNumberOfEligibleTickersToBeChosen); SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = new SelectorByQuotationAtEachMarketDay(mostLiquidSelector.GetTableOfSelectedTickers(), false, endOfDayHistory.History, this.maxNumberOfEligibleTickersToBeChosen); return new EligibleTickers( quotedAtEachMarketDayFromLastSelection.GetTableOfSelectedTickers() ); } private void getEligibleTickers_sendNewMessage( EligibleTickers eligibleTickers ) { string message = "Number of Eligible tickers: " + eligibleTickers.Count; NewMessageEventArgs newMessageEventArgs = new NewMessageEventArgs( message ); if(this.NewMessage != null) this.NewMessage( this , newMessageEventArgs ); } /// <summary> /// Returns the eligible tickers /// </summary> /// <returns></returns> public EligibleTickers GetEligibleTickers( EndOfDayHistory endOfDayHistory ) { EligibleTickers eligibleTickers = this.getEligibleTickers_actually( endOfDayHistory ); this.getEligibleTickers_sendNewMessage( eligibleTickers ); return eligibleTickers; } } } |
|
From: Marco M. <mi...@us...> - 2008-02-06 22:56:54
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23339/a2_Strategies/Eligibles Modified Files: MostLiquidAndLessVolatile.cs Log Message: Added Description property to the IEligiblesSelector interface. The implementation for the Description property has to be done ... Index: MostLiquidAndLessVolatile.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles/MostLiquidAndLessVolatile.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MostLiquidAndLessVolatile.cs 19 Jan 2008 17:43:04 -0000 1.1 --- MostLiquidAndLessVolatile.cs 6 Feb 2008 22:56:37 -0000 1.2 *************** *** 42,45 **** --- 42,53 ---- private int maxNumberOfEligibleTickersToBeChosen; + private string description; + public string Description + { + get{ + return "Change me!"; + } + } + /// <summary> /// Selects the most liquid and less volatile within the given |
|
From: Marco M. <mi...@us...> - 2008-02-06 22:55:41
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22908/a2_Strategies/Eligibles Modified Files: IEligiblesSelector.cs Log Message: Added Description property to the IEligiblesSelector interface Index: IEligiblesSelector.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles/IEligiblesSelector.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IEligiblesSelector.cs 19 Jan 2008 17:41:11 -0000 1.1 --- IEligiblesSelector.cs 6 Feb 2008 22:55:35 -0000 1.2 *************** *** 47,50 **** --- 47,56 ---- EligibleTickers GetEligibleTickers( EndOfDayHistory endOfDayHistory ); + + /// <summary> + /// short text description for the eligiblesSelector + /// (it might be used for saving logs for strategies) + /// </summary> + string Description { get; } } } |
|
From: Marco M. <mi...@us...> - 2008-02-06 22:53:59
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22045/a2_Strategies Modified Files: Benchmark.cs Log Message: Added GetEndOfDayHistory method. Index: Benchmark.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Benchmark.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Benchmark.cs 19 Jan 2008 17:33:45 -0000 1.1 --- Benchmark.cs 6 Feb 2008 22:53:54 -0000 1.2 *************** *** 99,102 **** --- 99,133 ---- } + /// <summary> + /// Returns the EndOfDayHistory of the benchmark + /// between the two given EndOfDayDateTimes + /// </summary> + public EndOfDayHistory GetEndOfDayHistory( + EndOfDayDateTime firstEndOfDayDateTime, + EndOfDayDateTime lastEndOfDayDateTime ) + { + if( lastEndOfDayDateTime.IsLessThanOrEqualTo(firstEndOfDayDateTime) ) + throw new Exception("lastEndOfDayDateTime has to be greater than " + + "firstEndOfDayDateTime !!"); + EndOfDayHistory endOfDayHistory = new EndOfDayHistory(); + EndOfDayDateTime endOfDayDateTimeToAddToHistory = + firstEndOfDayDateTime.Copy(); + while( endOfDayDateTimeToAddToHistory.IsLessThanOrEqualTo(lastEndOfDayDateTime) ) + { + if( this.isExchanged( endOfDayDateTimeToAddToHistory ) ) + { + endOfDayHistory.Add( endOfDayDateTimeToAddToHistory, endOfDayDateTimeToAddToHistory ); + endOfDayDateTimeToAddToHistory = + endOfDayDateTimeToAddToHistory.GetNextMarketStatusSwitch(); + } + else + { + endOfDayDateTimeToAddToHistory = + endOfDayDateTimeToAddToHistory.GetNextMarketStatusSwitch(); + } + } + return endOfDayHistory; + } + } } |
|
From: Marco M. <mi...@us...> - 2008-02-06 22:51:31
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21099/a2_Strategies Modified Files: AccountManager.cs Log Message: Improved description for one parameter in OpenPositions method Index: AccountManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/AccountManager.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AccountManager.cs 6 Feb 2008 20:42:12 -0000 1.5 --- AccountManager.cs 6 Feb 2008 22:51:22 -0000 1.6 *************** *** 86,94 **** /// opening positions provided by the given weightedPositions /// </summary> static public void OpenPositions(WeightedPositions weightedPositions, ! Account account, double cashToAdd) { ! if(account.CashAmount == 0.0 && account.Transactions.Count == 0) ! account.AddCash(cashToAdd); if(weightedPositions == null || account == null) throw new Exception("Both parameters have to be set to valid objects!"); --- 86,98 ---- /// opening positions provided by the given weightedPositions /// </summary> + /// <param name="weightedPositions"></param> + /// <param name="account"></param> + /// <param name="initialCashForTheAccount">The initial cash for the account + /// with no transactions at all (totally empty account)</param> static public void OpenPositions(WeightedPositions weightedPositions, ! Account account, double initialCashIfTheAccountIsEmpty) { ! if(account.Transactions.Count == 0) ! account.AddCash(initialCashIfTheAccountIsEmpty); if(weightedPositions == null || account == null) throw new Exception("Both parameters have to be set to valid objects!"); |
|
From: Marco M. <mi...@us...> - 2008-02-06 20:42:16
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28657/a2_Strategies Modified Files: AccountManager.cs Log Message: Added a new Overloaded method for OpenPositions: it is now possible to add cash. Index: AccountManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/AccountManager.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AccountManager.cs 14 Jan 2008 23:23:05 -0000 1.4 --- AccountManager.cs 6 Feb 2008 20:42:12 -0000 1.5 *************** *** 83,103 **** } /// <summary> ! /// Modifies the state for the given account, ! /// opening positions provided by the given weightedPositions ! /// </summary> ! static public void OpenPositions(WeightedPositions weightedPositions, ! Account account) ! { if(account.CashAmount == 0.0 && account.Transactions.Count == 0) ! account.AddCash(15000); if(weightedPositions == null || account == null) throw new Exception("Both parameters have to be set to valid objects!"); orders.Clear(); double valueToInvestInPositions = account.CashAmount; ! foreach(WeightedPosition weightedPosition in weightedPositions.Values) ! addWeightedPositionToOrderList( weightedPosition, account, valueToInvestInPositions ); ! foreach(object item in orders) ! account.AddOrder( (Order)item ); ! } #endregion --- 83,113 ---- } /// <summary> ! /// Modifies the state for the given account, ! /// opening positions provided by the given weightedPositions ! /// </summary> ! static public void OpenPositions(WeightedPositions weightedPositions, ! Account account, double cashToAdd) ! { if(account.CashAmount == 0.0 && account.Transactions.Count == 0) ! account.AddCash(cashToAdd); if(weightedPositions == null || account == null) throw new Exception("Both parameters have to be set to valid objects!"); orders.Clear(); double valueToInvestInPositions = account.CashAmount; ! foreach(WeightedPosition weightedPosition in weightedPositions.Values) ! addWeightedPositionToOrderList( weightedPosition, account, valueToInvestInPositions ); ! foreach(object item in orders) ! account.AddOrder( (Order)item ); ! } ! ! /// <summary> ! /// Modifies the state for the given account, ! /// opening positions provided by the given weightedPositions ! /// </summary> ! static public void OpenPositions(WeightedPositions weightedPositions, ! Account account) ! { ! OpenPositions(weightedPositions, account, 15000); ! } #endregion |
|
From: Marco M. <mi...@us...> - 2008-02-06 20:40:30
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27773/a1_Financial/a2_Accounting/h5_Reporting/Tables Added Files: StatisticsSummary.cs Log Message: Added new tab page to Report: StatisticsSummary and the skeleton file for a new row for this Tab Page (AverageReturnOnMonday, that has not been implemented yet) --- NEW FILE: StatisticsSummary.cs --- using System; using System.Data; using System.Reflection; using System.Runtime.Serialization; using QuantProject.ADT; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Instruments; using QuantProject.Business.Financial.Accounting.Reporting; using QuantProject.Business.Financial.Accounting.Reporting.StatisticsSummaryRows; namespace QuantProject.Business.Financial.Accounting.Reporting.Tables { /// <summary> /// Summary description for StatisticsSummary. /// </summary> [Serializable] public class StatisticsSummary : ReportTable, ISerializable { private AccountReport accountReport; private IHistoricalQuoteProvider historicalQuoteProvider; private AverageReturnOnMonday averageReturnOnMonday; public AccountReport AccountReport { get { return accountReport; } } public AverageReturnOnMonday AverageReturnOnMonday { get { return this.averageReturnOnMonday; } } private void statisticsSummary( AccountReport accountReport ) { this.accountReport = accountReport; this.getStatisticsSummary(); } public StatisticsSummary( AccountReport accountReport ) : base( accountReport.Name + " - StatisticsSummary" ) { this.statisticsSummary( accountReport ); } public StatisticsSummary( AccountReport accountReport , IHistoricalQuoteProvider historicalDataProvider ) : base( accountReport.Name + " - StatisticsSummary" ) { this.historicalQuoteProvider = historicalDataProvider; this.statisticsSummary( accountReport ); } #region Serialization /// <summary> /// This constructor allows custom deserialization (see the ISerializable /// interface documentation) /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected StatisticsSummary( SerializationInfo info , StreamingContext context ) : base( "Summary" ) { // get the set of serializable members for this class and its base classes Type thisType = this.GetType(); MemberInfo[] mi = FormatterServices.GetSerializableMembers( thisType , context); // deserialize the fields from the info object for (Int32 i = 0 ; i < mi.Length; i++) { FieldInfo fieldInfo = (FieldInfo) mi[i]; // set the field to the deserialized value try { fieldInfo.SetValue( this , info.GetValue( fieldInfo.Name, fieldInfo.FieldType ) ); } catch(Exception ex) {ex = ex;} } } /// <summary> /// serialize the set of serializable members for this class and base classes /// </summary> /// <param name="info"></param> /// <param name="context"></param> void ISerializable.GetObjectData( SerializationInfo info, StreamingContext context) { // get the set of serializable members for this class and base classes Type thisType = this.GetType(); MemberInfo[] mi = FormatterServices.GetSerializableMembers( thisType , context); // serialize the fields to the info object for (Int32 i = 0 ; i < mi.Length; i++) { info.AddValue(mi[i].Name, ((FieldInfo) mi[i]).GetValue(this)); } } #endregion #region "getStatisticsSummary" private void getStatisticsSummary() { if ( this.accountReport.Equity.DataTable.Rows.Count == 0 ) throw new Exception( "A StatisticsSummary computation has been requested, but the equity line is empty" ); this.averageReturnOnMonday = new AverageReturnOnMonday(this); } #endregion } } |
|
From: Marco M. <mi...@us...> - 2008-02-06 20:40:28
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/StatisticsSummaryRows In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27773/a1_Financial/a2_Accounting/h5_Reporting/StatisticsSummaryRows Added Files: AverageReturnOnMonday.cs Log Message: Added new tab page to Report: StatisticsSummary and the skeleton file for a new row for this Tab Page (AverageReturnOnMonday, that has not been implemented yet) --- NEW FILE: AverageReturnOnMonday.cs --- /* QuantProject - Quantitative Finance Library AverageReturnOnMonday.cs Copyright (C) 2008 Marco Milletti This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Collections; using QuantProject.ADT.Histories; using QuantProject.ADT.Statistics; using QuantProject.Data.DataTables; using QuantProject.Business.Financial.Accounting.Reporting.Tables; using QuantProject.Business.Financial.Accounting.Reporting.SummaryRows; namespace QuantProject.Business.Financial.Accounting.Reporting.StatisticsSummaryRows { /// <summary> /// Summary row containing the average return of the strategy on Monday /// </summary> [Serializable] public class AverageReturnOnMonday : DoubleSummaryRow { public AverageReturnOnMonday( StatisticsSummary statisticsSummary ) : base( 2 ) { this.rowDescription = "Average return on Monday"; // int totalNumberOfTransactions = statisticsSummary.AccountReport.TransactionTable.DataTable.Rows.Count; //it has to be implemented yet // History marketDays = Quotes.GetMarketDays( // statisticsSummary.AccountReport.Benchmark, // statisticsSummary.AccountReport.StartDateTime, // statisticsSummary.AccountReport.EndDateTime.DateTime); // DateTime date; // for(int i = 0; i<marketDays.Count; i++) // { // date = marketDays.GetDateTime(i); // } // this.rowValue = (double)totalNumberOfTransactions / (double)marketDays.Count; } } } |
|
From: Marco M. <mi...@us...> - 2008-02-06 20:37:26
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26359/a1_Financial/a2_Accounting/h5_Reporting Modified Files: AccountReport.cs Log Message: Added code for deserialization. Index: AccountReport.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/AccountReport.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** AccountReport.cs 28 Jan 2008 21:30:58 -0000 1.20 --- AccountReport.cs 6 Feb 2008 20:37:19 -0000 1.21 *************** *** 26,30 **** --- 26,32 ---- using System.Collections; using System.Reflection; + using System.Runtime.Serialization; using System.Runtime.InteropServices; + using QuantProject.ADT; using QuantProject.ADT.Histories; *************** *** 41,45 **** /// </summary> [Serializable] ! public class AccountReport { private Account account; --- 43,47 ---- /// </summary> [Serializable] ! public class AccountReport : ISerializable { private Account account; *************** *** 57,60 **** --- 59,63 ---- private EquityLine equityLine; private Tables.Summary summary; + private Tables.StatisticsSummary statisticsSummary; public string Name *************** *** 118,121 **** --- 121,128 ---- get { return summary; } } + public Tables.StatisticsSummary StatisticsSummary + { + get { return this.statisticsSummary; } + } public DateTime StartDateTime { *************** *** 300,307 **** --- 307,362 ---- //this.summary = getSummary( reportName ); this.summary = new Tables.Summary( this , historicalQuoteProvider ); + this.statisticsSummary = new Tables.StatisticsSummary( this, historicalQuoteProvider ); return this; } #endregion + #region Serialization + + /// <summary> + /// This constructor allows custom deserialization (see the ISerializable + /// interface documentation) + /// </summary> + /// <param name="info"></param> + /// <param name="context"></param> + protected AccountReport( SerializationInfo info , StreamingContext context ) : + base( ) + { + // get the set of serializable members for this class and its base classes + Type thisType = this.GetType(); + MemberInfo[] mi = FormatterServices.GetSerializableMembers( + thisType , context); + + // deserialize the fields from the info object + for (Int32 i = 0 ; i < mi.Length; i++) + { + FieldInfo fieldInfo = (FieldInfo) mi[i]; + // set the field to the deserialized value + try + { + fieldInfo.SetValue( this , + info.GetValue( fieldInfo.Name, fieldInfo.FieldType ) ); + } + catch(Exception ex) + {ex = ex;} + } + } + + void ISerializable.GetObjectData( + SerializationInfo info, StreamingContext context) + { + // get the set of serializable members for this class and base classes + Type thisType = this.GetType(); + MemberInfo[] mi = + FormatterServices.GetSerializableMembers( thisType , context); + + // serialize the fields to the info object + for (Int32 i = 0 ; i < mi.Length; i++) + { + info.AddValue(mi[i].Name, ((FieldInfo) mi[i]).GetValue(this)); + } + } + #endregion + public AccountReport Create( string reportName , long numDaysForInterval , EndOfDayDateTime endDateTime ) |
|
From: Marco M. <mi...@us...> - 2008-02-06 20:34:27
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/OutOfSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24728/OutOfSample Log Message: Directory /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/OutOfSample added to the repository |
|
From: Marco M. <mi...@us...> - 2008-02-06 20:34:06
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/StatisticsSummaryRows In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24288/StatisticsSummaryRows Log Message: Directory /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/StatisticsSummaryRows added to the repository |
|
From: Marco M. <mi...@us...> - 2008-01-30 23:12:54
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/TickersRelationships In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5267 Added Files: MissingCorrelationException.cs Log Message: MissingCorrelationException has been added --- NEW FILE: MissingCorrelationException.cs --- /* QuantProject - Quantitative Finance Library MissingCorrelationException.cs Copyright (C) 2008 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.Business.Strategies.TickersRelationships { /// <summary> /// Thrown when a correlation is requested for two given tickers, /// but it has not be computed by the CorrelationProvider /// </summary> public class MissingCorrelationException : Exception { private string firstTicker; private string secondTicker; public override string Message { get { return "Missing correlation for tickers: " + this.firstTicker + " , " + this.secondTicker; } } public MissingCorrelationException( string firstTicker , string secondTicker ) { this.firstTicker = firstTicker; this.secondTicker = secondTicker; } } } |
|
From: Marco M. <mi...@us...> - 2008-01-30 23:11:38
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/TickersRelationships In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4811/b4_Business/a2_Strategies/TickersRelationships Modified Files: CorrelationProvider.cs Log Message: GetPearsonCorrelation method has been improved (control and efficiency) Index: CorrelationProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/TickersRelationships/CorrelationProvider.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CorrelationProvider.cs 14 Jan 2008 23:02:30 -0000 1.1 --- CorrelationProvider.cs 30 Jan 2008 23:11:32 -0000 1.2 *************** *** 178,182 **** public double GetPearsonCorrelation(string firstTicker, string secondTicker) { ! double returnValue = -2.0; if( this.pearsonCorrelations == null ) this.getOrderedTickersPearsonCorrelations_setCorrelations(); --- 178,182 ---- public double GetPearsonCorrelation(string firstTicker, string secondTicker) { ! double returnValue = double.NaN; if( this.pearsonCorrelations == null ) this.getOrderedTickersPearsonCorrelations_setCorrelations(); *************** *** 188,195 **** (this.pearsonCorrelations[i].FirstTicker == secondTicker && this.pearsonCorrelations[i].SecondTicker == firstTicker) ) ! returnValue = this.pearsonCorrelations[i].CorrelationValue; } ! ! return returnValue; } --- 188,200 ---- (this.pearsonCorrelations[i].FirstTicker == secondTicker && this.pearsonCorrelations[i].SecondTicker == firstTicker) ) ! { ! returnValue = this.pearsonCorrelations[i].CorrelationValue; ! i = this.pearsonCorrelations.Length;//exit from for ! } } ! if( double.IsNaN(returnValue) ) ! throw new MissingCorrelationException(firstTicker, secondTicker); ! ! return returnValue; } |
|
From: Glauco S. <gla...@us...> - 2008-01-28 21:51:03
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a07_DataProviders In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15622/b4_Business/a07_DataProviders Modified Files: HistoricalRawQuoteProvider.cs Log Message: The ShortDescription property is overridden and implemented Index: HistoricalRawQuoteProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a07_DataProviders/HistoricalRawQuoteProvider.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HistoricalRawQuoteProvider.cs 16 Sep 2007 21:54:40 -0000 1.3 --- HistoricalRawQuoteProvider.cs 28 Jan 2008 21:50:56 -0000 1.4 *************** *** 34,37 **** --- 34,45 ---- public class HistoricalRawQuoteProvider : HistoricalQuoteProvider { + public override string ShortDescription + { + get + { + return "raw"; + } + } + public HistoricalRawQuoteProvider() { |
|
From: Glauco S. <gla...@us...> - 2008-01-28 21:50:46
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a07_DataProviders In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15587/b4_Business/a07_DataProviders Modified Files: HistoricalAdjustedQuoteProvider.cs Log Message: The ShortDescription property is overridden and implemented Index: HistoricalAdjustedQuoteProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a07_DataProviders/HistoricalAdjustedQuoteProvider.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HistoricalAdjustedQuoteProvider.cs 7 Oct 2007 13:13:52 -0000 1.4 --- HistoricalAdjustedQuoteProvider.cs 28 Jan 2008 21:50:40 -0000 1.5 *************** *** 34,37 **** --- 34,45 ---- public class HistoricalAdjustedQuoteProvider : HistoricalQuoteProvider { + public override string ShortDescription + { + get + { + return "adj"; + } + } + public HistoricalAdjustedQuoteProvider() { |
|
From: Glauco S. <gla...@us...> - 2008-01-28 21:49:54
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a07_DataProviders In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15113/b4_Business/a07_DataProviders Modified Files: HistoricalQuoteProvider.cs Log Message: The read only ShortDescription property is now given as an abstract property Index: HistoricalQuoteProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a07_DataProviders/HistoricalQuoteProvider.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HistoricalQuoteProvider.cs 7 Oct 2007 13:14:19 -0000 1.3 --- HistoricalQuoteProvider.cs 28 Jan 2008 21:49:46 -0000 1.4 *************** *** 33,36 **** --- 33,38 ---- public abstract class HistoricalQuoteProvider : IHistoricalQuoteProvider { + public abstract string ShortDescription { get; } + public HistoricalQuoteProvider() { |
|
From: Glauco S. <gla...@us...> - 2008-01-28 21:48:09
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a07_DataProviders In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14236/b4_Business/a07_DataProviders Modified Files: IHistoricalQuoteProvider.cs Log Message: The read only ShortDescription property is now requested by the interface Index: IHistoricalQuoteProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a07_DataProviders/IHistoricalQuoteProvider.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IHistoricalQuoteProvider.cs 16 Sep 2007 21:49:27 -0000 1.2 --- IHistoricalQuoteProvider.cs 28 Jan 2008 21:48:01 -0000 1.3 *************** *** 50,53 **** --- 50,57 ---- EndOfDayHistory GetEndOfDayQuotes( string ticker , EndOfDayHistory endOfDayHistory ); + /// <summary> + /// Short description: it might be used for file names + /// </summary> + string ShortDescription { get; } } } |
|
From: Glauco S. <gla...@us...> - 2008-01-28 21:47:06
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/FixedLengthTwoPhases In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13900/b7_Scripts/WalkForwardTesting/FixedLengthTwoPhases Modified Files: FixedLengthTwoPhasesStrategy.cs Log Message: The property DescriptionForLogFileName has been improved Index: FixedLengthTwoPhasesStrategy.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/FixedLengthTwoPhases/FixedLengthTwoPhasesStrategy.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FixedLengthTwoPhasesStrategy.cs 19 Jan 2008 18:37:15 -0000 1.1 --- FixedLengthTwoPhasesStrategy.cs 28 Jan 2008 21:47:02 -0000 1.2 *************** *** 81,87 **** { string descriptionForLogFileName = ! "WFOTC_" + ! "oS_" + this.numDaysBeetweenEachOtpimization + "_" + ! this.inSampleChooser.Description; return descriptionForLogFileName; } --- 81,88 ---- { string descriptionForLogFileName = ! "WFFLPT_" + ! "nmDysBtwnOptmztns_" + this.numDaysBeetweenEachOtpimization + ! "_iS_" + this.inSampleChooser.Description + ! "_oS_longOnly"; return descriptionForLogFileName; } |
|
From: Glauco S. <gla...@us...> - 2008-01-28 21:45:35
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/FixedLengthTwoPhases In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13305/b7_Scripts/WalkForwardTesting/FixedLengthTwoPhases Modified Files: FixedLengthTwoPhasesMain.cs Log Message: - the private method showReport() now uses the AccountReport created by the backtester - a new tickers' group has been added, in order to perform really fast backtesting Index: FixedLengthTwoPhasesMain.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/FixedLengthTwoPhases/FixedLengthTwoPhasesMain.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FixedLengthTwoPhasesMain.cs 27 Jan 2008 02:30:30 -0000 1.2 --- FixedLengthTwoPhasesMain.cs 28 Jan 2008 21:45:31 -0000 1.3 *************** *** 71,80 **** EndOfDayStrategyBackTester endOfDayStrategyBackTester ) { ! DateTime lastReportDateTime = ExtendedDateTime.Min( ! lastDateTimeRequestedForTheScript , ! endOfDayStrategyBackTester.EndOfDayTimer.GetCurrentTime().DateTime ); Report report = new Report( ! endOfDayStrategyBackTester.Account , ! endOfDayStrategyBackTester.HistoricalQuoteProvider ); report.Create( endOfDayStrategyBackTester.DescriptionForLogFileName , 1 , new EndOfDayDateTime( lastReportDateTime , --- 71,82 ---- EndOfDayStrategyBackTester endOfDayStrategyBackTester ) { ! // DateTime lastReportDateTime = ExtendedDateTime.Min( ! // lastDateTimeRequestedForTheScript , ! // endOfDayStrategyBackTester.EndOfDayTimer.GetCurrentTime().DateTime ); ! DateTime lastReportDateTime = ! endOfDayStrategyBackTester.ActualLastDateTime; Report report = new Report( ! endOfDayStrategyBackTester.AccountReport , ! true ); report.Create( endOfDayStrategyBackTester.DescriptionForLogFileName , 1 , new EndOfDayDateTime( lastReportDateTime , *************** *** 89,101 **** double cashToStart = 30000; ! // int numberOfPortfolioPositions = 4; ! // int inSampleDays = 90; ! // string tickersGroupId = "SP500"; // uncomment the following three lines for faster scripts ! int numberOfPortfolioPositions = 2; ! int inSampleDays = 30; ! // string tickersGroupId = "millo"; ! string tickersGroupId = "fastTest"; Benchmark benchmark = new Benchmark( "MSFT" ); --- 91,103 ---- double cashToStart = 30000; ! int numberOfPortfolioPositions = 2; ! int inSampleDays = 90; ! string tickersGroupId = "SP500"; // uncomment the following three lines for faster scripts ! // int numberOfPortfolioPositions = 2; ! // int inSampleDays = 30; ! //// string tickersGroupId = "millo"; ! // string tickersGroupId = "fastTest"; Benchmark benchmark = new Benchmark( "MSFT" ); *************** *** 116,121 **** double mutationRate = 0.02; double elitismRate = 0.001; ! int populationSizeForGeneticOptimizer = 3000; ! int generationNumberForGeneticOptimizer = 5; int seedForRandomGenerator = QuantProject.ADT.ConstantsProvider.SeedForRandomGenerator; --- 118,123 ---- double mutationRate = 0.02; double elitismRate = 0.001; ! int populationSizeForGeneticOptimizer = 30000; ! int generationNumberForGeneticOptimizer = 8; int seedForRandomGenerator = QuantProject.ADT.ConstantsProvider.SeedForRandomGenerator; *************** *** 143,148 **** DateTime firstDateTime = new DateTime( 2001 , 1 , 2 ); ! DateTime lastDateTime = new DateTime( 2001 , 1 , 7 ); ! double maxRunningHours = 0.2; EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( --- 145,150 ---- DateTime firstDateTime = new DateTime( 2001 , 1 , 2 ); ! DateTime lastDateTime = new DateTime( 2004 , 12 , 31 ); ! double maxRunningHours = 7; EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( |
|
From: Glauco S. <gla...@us...> - 2008-01-28 21:41:56
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/FixedLengthTwoPhases/InSampleChoosers/Genetic In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11624/b7_Scripts/WalkForwardTesting/FixedLengthTwoPhases/InSampleChoosers/Genetic Modified Files: FixedLengthTwoPhasesGeneticChooser.cs Log Message: The property Description has been improved Index: FixedLengthTwoPhasesGeneticChooser.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/FixedLengthTwoPhases/InSampleChoosers/Genetic/FixedLengthTwoPhasesGeneticChooser.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FixedLengthTwoPhasesGeneticChooser.cs 19 Jan 2008 18:41:03 -0000 1.1 --- FixedLengthTwoPhasesGeneticChooser.cs 28 Jan 2008 21:41:52 -0000 1.2 *************** *** 64,68 **** get { ! string description = "geneticOTCCTO"; return description; } --- 64,71 ---- get { ! string description = "genetic_" + ! "longOnly_" + ! "gnrtnSz_" + this.populationSizeForGeneticOptimizer + ! "_gnrtnNmbr_" + this.generationNumberForGeneticOptimizer; return description; } |
|
From: Glauco S. <gla...@us...> - 2008-01-28 21:40:41
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11193/b1_ADT Modified Files: ExtendedDateTime.cs Log Message: The new method public static string GetCompleteShortDescriptionForFileName( DateTime dateTime ) has been added Index: ExtendedDateTime.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ExtendedDateTime.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExtendedDateTime.cs 27 Jan 2008 02:29:36 -0000 1.5 --- ExtendedDateTime.cs 28 Jan 2008 21:40:38 -0000 1.6 *************** *** 105,108 **** --- 105,109 ---- /// <summary> /// Returns a DateTime short description suitable for file names (no slashes) + /// hours, minutes and seconds are NOT displayed /// </summary> /// <returns></returns> *************** *** 117,120 **** --- 118,136 ---- } /// <summary> + /// Returns a DateTime short description suitable for file names (no slashes) + /// hours, minutes and seconds are displayed also + /// </summary> + /// <returns></returns> + public static string GetCompleteShortDescriptionForFileName( + DateTime dateTime ) + { + string stringForFileName = + GetShortDescriptionForFileName( dateTime ) + "_" + + dateTime.Hour.ToString() + "_" + + dateTime.Minute.ToString().PadLeft( 2 , '0' ) + "_" + + dateTime.Second.ToString().PadLeft( 2 , '0' ); + return stringForFileName; + } + /// <summary> /// Returns the earliest date /// </summary> |
|
From: Glauco S. <gla...@us...> - 2008-01-28 21:39:46
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10735/b4_Business/a2_Strategies Modified Files: EndOfDayStrategyBackTester.cs Log Message: - the ActualLastDateTime property has been added - the property AccountReport has been added - the property DescriptionForLogFileName has been improved - an AccountReport is now created when the backtest is completed Index: EndOfDayStrategyBackTester.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/EndOfDayStrategyBackTester.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EndOfDayStrategyBackTester.cs 27 Jan 2008 02:27:46 -0000 1.2 --- EndOfDayStrategyBackTester.cs 28 Jan 2008 21:39:42 -0000 1.3 *************** *** 28,31 **** --- 28,32 ---- using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting; + using QuantProject.Business.Financial.Accounting.Reporting; using QuantProject.Business.Financial.Ordering; using QuantProject.Business.Strategies.Logging; *************** *** 52,57 **** --- 53,61 ---- private DateTime startingTimeForScript; private IEndOfDayTimer endOfDayTimer; + private DateTime actualLastDateTime; private Account account; + private AccountReport accountReport; private BackTestLog backTestLog; + private DateTime realDateTimeWhenTheBackTestIsStopped; public IHistoricalQuoteProvider HistoricalQuoteProvider *************** *** 63,69 **** get { return this.benchmark; } } public Account Account { ! get { return this.account; } } public BackTestLog Log --- 67,100 ---- get { return this.benchmark; } } + /// <summary> + /// Returns the dimulated DateTime when the backtest is stopped + /// (not the real time) + /// </summary> + public DateTime ActualLastDateTime + { + get + { + this.checkThisPropertyRequiresBacktestIsCompleted(); + return this.actualLastDateTime; + } + } public Account Account { ! get ! { ! return this.account; ! } ! } ! /// <summary> ! /// Once the backtest is completed, this property returns the ! /// AccountReport for the internal Account ! /// </summary> ! public AccountReport AccountReport ! { ! get ! { ! this.checkThisPropertyRequiresBacktestIsCompleted(); ! return this.accountReport; ! } } public BackTestLog Log *************** *** 89,97 **** { string description = ! this.backTestID + "_" + "from_" + ExtendedDateTime.GetShortDescriptionForFileName( this.firstDateTime ) + "_to_" + ! ExtendedDateTime.GetShortDescriptionForFileName( this.lastDateTime ) + "_strtgy_" + this.endOfDayStrategy.DescriptionForLogFileName; return description; --- 120,132 ---- { string description = ! ExtendedDateTime.GetCompleteShortDescriptionForFileName( ! this.realDateTimeWhenTheBackTestIsStopped ) + "_" + "from_" + ExtendedDateTime.GetShortDescriptionForFileName( this.firstDateTime ) + "_to_" + ! ExtendedDateTime.GetShortDescriptionForFileName( this.actualLastDateTime ) + ! "_annlRtrn_" + this.AccountReport.Summary.AnnualSystemPercentageReturn.FormattedValue + ! "_maxDD_" + this.AccountReport.Summary.MaxEquityDrawDown.FormattedValue + ! "_qtPrvdr_" + this.historicalQuoteProvider.ShortDescription + "_strtgy_" + this.endOfDayStrategy.DescriptionForLogFileName; return description; *************** *** 99,102 **** --- 134,145 ---- } + private void checkThisPropertyRequiresBacktestIsCompleted() + { + if ( this.actualLastDateTime == DateTime.MinValue ) + // the timer has not been stopped yet + throw new Exception( "This property cannot be invoked " + + "while the backtest is still running!" ); + } + public EndOfDayStrategyBackTester( string backTestID , IEndOfDayStrategyForBacktester endOfDayStrategy , *************** *** 120,123 **** --- 163,168 ---- this.backTestLog = new BackTestLog( backTestID , firstDateTime , lastDateTime , benchmark ); + this.actualLastDateTime = DateTime.MinValue; + this.realDateTimeWhenTheBackTestIsStopped = DateTime.MinValue; } *************** *** 237,247 **** Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! DateTime currentTime = ! ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime; ! if ( this.isTimeToStop( currentTime ) ) { // either the simulation has reached the ending date or // too much time elapsed since the simulation started this.endOfDayTimer.Stop(); // this.progressBarForm.Close(); // ObjectArchiver.Archive( this.account , --- 282,302 ---- Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! EndOfDayDateTime currentEndOfDayDateTime = ! ( ( IEndOfDayTimer )sender ).GetCurrentTime(); ! DateTime currentDateTime = currentEndOfDayDateTime.DateTime; ! if ( this.isTimeToStop( currentDateTime ) ) { // either the simulation has reached the ending date or // too much time elapsed since the simulation started + this.actualLastDateTime = + ExtendedDateTime.Min( this.lastDateTime , currentDateTime ); this.endOfDayTimer.Stop(); + this.realDateTimeWhenTheBackTestIsStopped = DateTime.Now; + this.accountReport = this.account.CreateReport( + "" , + 1 , currentEndOfDayDateTime , this.benchmark.Ticker , + this.historicalQuoteProvider ); + this.accountReport.Name = this.DescriptionForLogFileName; + // this.progressBarForm.Close(); // ObjectArchiver.Archive( this.account , |
|
From: Glauco S. <gla...@us...> - 2008-01-28 21:31:05
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6910/b4_Business/a1_Financial/a2_Accounting/h5_Reporting Modified Files: AccountReport.cs Log Message: The Name property can also be written now Index: AccountReport.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/AccountReport.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AccountReport.cs 27 Jan 2008 02:25:43 -0000 1.19 --- AccountReport.cs 28 Jan 2008 21:30:58 -0000 1.20 *************** *** 60,65 **** public string Name { ! get { return reportName; } ! } public EndOfDayDateTime EndDateTime { --- 60,66 ---- public string Name { ! get { return this.reportName; } ! set { this.reportName = value; } ! } public EndOfDayDateTime EndDateTime { |
|
From: Glauco S. <gla...@us...> - 2008-01-27 02:35:19
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23549/b5_Presentation/Reporting/WindowsForm Modified Files: Report.cs Log Message: Now the accountReport description is used for: - the title of the report's form - the default file name for the save dialogs Index: Report.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/Report.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Report.cs 31 May 2006 14:31:32 -0000 1.17 --- Report.cs 27 Jan 2008 02:35:15 -0000 1.18 *************** *** 132,135 **** --- 132,136 ---- this.Width = 700; this.Height = 500; + this.Text = this.accountReport.Description; this.reportTabControl = new ReportTabControl( this.accountReport , showBenchmark ); *************** *** 239,242 **** --- 240,245 ---- //menu item clicked by the user this.saveFileDialog.CheckPathExists = true; + + this.saveFileDialog.FileName = this.Text; } |