quantproject-developers Mailing List for QuantProject (Page 122)
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...> - 2004-12-27 18:24:01
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29542/b7_Scripts/TickerSelectionTesting Modified Files: EndOfDayTimerHandler.cs RunEfficientCTOPortfolio.cs Log Message: Updated script for TickerSelection Testing, using Efficient portfolio theory Index: EndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandler.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EndOfDayTimerHandler.cs 20 Dec 2004 20:25:11 -0000 1.4 --- EndOfDayTimerHandler.cs 27 Dec 2004 18:23:51 -0000 1.5 *************** *** 73,76 **** --- 73,104 ---- #region MarketOpenEventHandler + + private void marketOpenEventHandler_orderChosenTickers_addToOrderList_forTicker( + string ticker ) + { + + double cashForSinglePosition = this.account.CashAmount / this.numberOfTickersToBeChosen; + long quantity = + Convert.ToInt64( Math.Floor( cashForSinglePosition / this.account.DataStreamer.GetCurrentBid( ticker ) ) ); + Order order = new Order( OrderType.MarketBuy , new Instrument( ticker ) , quantity ); + this.orders.Add(order); + } + + private void marketOpenEventHandler_orderChosenTickers_addToOrderList() + { + foreach ( string ticker in this.chosenTickers ) + { + //if ( !this.account.Contains( ticker ) ) + //{ + marketOpenEventHandler_orderChosenTickers_addToOrderList_forTicker( ticker ); + //} + } + } + + private void marketOpenEventHandler_orderChosenTickers() + { + this.marketOpenEventHandler_orderChosenTickers_addToOrderList(); + } + /// <summary> /// Handles a "Market Open" event. *************** *** 81,87 **** Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! if(this.account.Transactions.Count == 0) ! this.account.AddCash(endOfDayTimingEventArgs.EndOfDayDateTime, ! 16000); foreach(object item in this.orders) { --- 109,117 ---- Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! if(this.orders.Count == 0 && this.account.Transactions.Count == 0) ! this.account.AddCash(16000); ! ! this.marketOpenEventHandler_orderChosenTickers(); ! foreach(object item in this.orders) { *************** *** 112,130 **** } } ! private void marketCloseEventHandler_openPosition( ! string ticker ) ! { ! double maxPositionValue = this.account.CashAmount / this.numberOfTickersToBeChosen; ! long sharesToBeBought = Convert.ToInt64( ! Math.Floor( maxPositionValue / ! this.account.DataStreamer.GetCurrentAsk( ticker ) ) ); ! this.account.AddOrder( new Order( OrderType.MarketBuy , ! new Instrument( ticker ) , sharesToBeBought ) ); ! } ! private void marketCloseEventHandler_openPositions() ! { ! foreach ( string ticker in this.chosenTickers ) ! this.marketCloseEventHandler_openPosition( ticker ); ! } public void MarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) --- 142,146 ---- } } ! public void MarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) *************** *** 132,136 **** this.marketCloseEventHandler_closePositions(); - //fiveMinutesBeforeMarketCloseEventHandler_openPositions(); } --- 148,151 ---- *************** *** 138,191 **** #region OneHourAfterMarketCloseEventHandler ! private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_closePositions( ! IEndOfDayTimer endOfDayTimer ) ! { ! foreach ( Position position in this.account.Portfolio ) ! foreach(string ticker in this.chosenTickers) ! { ! if (position.Instrument.Key == ticker ) ! { ! this.account.ClosePosition( position ); ! } ! } ! ! } ! private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions_forTicker( ! string ticker ) ! { ! double cashForSinglePosition = this.account.CashAmount / this.numberOfTickersToBeChosen; ! long quantity = ! Convert.ToInt64( Math.Floor( cashForSinglePosition / this.account.DataStreamer.GetCurrentBid( ticker ) ) ); ! Order order = new Order( OrderType.MarketBuy , new Instrument( ticker ) , quantity ); ! this.orders.Add(order); ! } ! private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions() ! { ! foreach ( string ticker in this.chosenTickers ) ! if ( !this.account.Contains( ticker ) ) ! { ! oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions_forTicker( ticker ); ! } ! } ! private void oneHourAfterMarketCloseEventHandler_orderChosenTickers( ! IEndOfDayTimer endOfDayTimer ) ! { ! //this.oneHourAfterMarketCloseEventHandler_orderChosenTickers_closePositions( endOfDayTimer ); ! this.oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions(); ! } ! /// <summary> ! /// Handles a "One hour after market close" event. ! /// </summary> ! /// <param name="sender"></param> ! /// <param name="eventArgs"></param> ! public void OneHourAfterMarketCloseEventHandler( ! Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) ! { ! this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime); ! this.orders.Clear(); ! oneHourAfterMarketCloseEventHandler_orderChosenTickers( ( IEndOfDayTimer ) sender ); ! } ! ! private void setTickers(DateTime currentDate) { --- 153,157 ---- #region OneHourAfterMarketCloseEventHandler ! private void setTickers(DateTime currentDate) { *************** *** 204,207 **** --- 170,187 ---- this.chosenTickers = (string[])GO.BestGenome.Meaning; } + + /// <summary> + /// Handles a "One hour after market close" event. + /// </summary> + /// <param name="sender"></param> + /// <param name="eventArgs"></param> + public void OneHourAfterMarketCloseEventHandler( + Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) + { + this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime); + //sets tickers to be chosen next Market Open event + this.orders.Clear(); + } + #endregion Index: RunEfficientCTOPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/RunEfficientCTOPortfolio.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RunEfficientCTOPortfolio.cs 20 Dec 2004 20:25:12 -0000 1.3 --- RunEfficientCTOPortfolio.cs 27 Dec 2004 18:23:51 -0000 1.4 *************** *** 79,84 **** new DateTime( 2004 , 10 , 4 ) , EndOfDaySpecificTime.FiveMinutesBeforeMarketClose ); this.endDateTime = new EndOfDayDateTime( ! new DateTime( 2004 , 10 , 10 ) , EndOfDaySpecificTime.OneHourAfterMarketClose ); ! this.numIntervalDays = 1; } #region Run --- 79,84 ---- new DateTime( 2004 , 10 , 4 ) , EndOfDaySpecificTime.FiveMinutesBeforeMarketClose ); this.endDateTime = new EndOfDayDateTime( ! new DateTime( 2004 , 10 , 20 ) , EndOfDaySpecificTime.OneHourAfterMarketClose ); ! this.numIntervalDays = 7; } #region Run |
|
From: Glauco S. <gla...@us...> - 2004-12-26 17:47:40
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7141 Modified Files: QuantProject.suo Log Message: - bug fixed: totalDays is properly computed, now - bug fixed: at the beginning, cash is added now Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 Binary files /tmp/cvsS1nV9t and /tmp/cvsqwTtgG differ |
|
From: Glauco S. <gla...@us...> - 2004-12-26 17:47:36
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7141/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: RunWalkForwardOneRank.cs Log Message: - bug fixed: totalDays is properly computed, now - bug fixed: at the beginning, cash is added now Index: RunWalkForwardOneRank.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/RunWalkForwardOneRank.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RunWalkForwardOneRank.cs 20 Dec 2004 00:14:53 -0000 1.4 --- RunWalkForwardOneRank.cs 26 Dec 2004 17:47:20 -0000 1.5 *************** *** 62,69 **** this.reportTable = new ReportTable( "Summary_Reports" ); this.startDateTime = new EndOfDayDateTime( ! new DateTime( 2002 , 1 , 1 ) , EndOfDaySpecificTime.FiveMinutesBeforeMarketClose ); this.endDateTime = new EndOfDayDateTime( ! new DateTime( 2002 , 12 , 31 ) , EndOfDaySpecificTime.OneHourAfterMarketClose ); ! this.numIntervalDays = 7; } #region Run --- 62,71 ---- this.reportTable = new ReportTable( "Summary_Reports" ); this.startDateTime = new EndOfDayDateTime( ! new DateTime( 2002 , 1 , 1 ) , EndOfDaySpecificTime.MarketOpen ); ! // this.endDateTime = new EndOfDayDateTime( ! // new DateTime( 2002 , 12 , 31 ) , EndOfDaySpecificTime.OneHourAfterMarketClose ); this.endDateTime = new EndOfDayDateTime( ! new DateTime( 2002 , 2 , 28 ) , EndOfDaySpecificTime.OneHourAfterMarketClose ); ! this.numIntervalDays = 7; } #region Run *************** *** 102,106 **** this.startDateTime.DateTime )).TotalDays ); double totalDays = Convert.ToDouble( ((TimeSpan)( this.endDateTime.DateTime - ! this.startDateTime.DateTime )).TotalDays ); if ( Math.Floor( elapsedDays / totalDays * 100 ) > Math.Floor( ( elapsedDays - 1 ) / totalDays * 100 ) ) --- 104,108 ---- this.startDateTime.DateTime )).TotalDays ); double totalDays = Convert.ToDouble( ((TimeSpan)( this.endDateTime.DateTime - ! this.startDateTime.DateTime )).TotalDays + 1); if ( Math.Floor( elapsedDays / totalDays * 100 ) > Math.Floor( ( elapsedDays - 1 ) / totalDays * 100 ) ) *************** *** 112,115 **** --- 114,123 ---- } } + public void marketOpenEventHandler( + Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) + { + if ( this.account.Transactions.Count == 0 ) + this.account.AddCash( 30000 ); + } public void oneHourAfterMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) *************** *** 123,126 **** --- 131,136 ---- this.account.EndOfDayTimer.Stop(); this.progressBarForm.Close(); + Report report = new Report( this.account ); + report.Show( "WFT One Rank" , this.numIntervalDays , this.endDateTime , "MSFT" ); } } *************** *** 128,136 **** public override void Run() { - Report report; run_initializeEndOfDayTimer(); run_initializeAccount(); run_initializeEndOfDayTimerHandler(); run_initializeProgressHandlers(); this.endOfDayTimer.OneHourAfterMarketClose += new OneHourAfterMarketCloseEventHandler( --- 138,147 ---- public override void Run() { run_initializeEndOfDayTimer(); run_initializeAccount(); run_initializeEndOfDayTimerHandler(); run_initializeProgressHandlers(); + this.endOfDayTimer.MarketOpen += + new MarketOpenEventHandler( this.marketOpenEventHandler ); this.endOfDayTimer.OneHourAfterMarketClose += new OneHourAfterMarketCloseEventHandler( *************** *** 144,149 **** this.progressBarForm.Show(); this.endOfDayTimer.Start(); - report = new Report( this.account ); - report.Show( "WFT One Rank" , this.numIntervalDays , this.startDateTime , "MSFT" ); } #endregion --- 155,158 ---- |
|
From: Glauco S. <gla...@us...> - 2004-12-26 17:44:02
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/OneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/b7_Scripts/SimpleTesting/OneRank Modified Files: OneRank.cs Log Message: - the static method MaxBuyableShares has been added - bug fixed: it was AddHours, now it is AddDays Index: OneRank.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/OneRank/OneRank.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OneRank.cs 20 Dec 2004 00:14:03 -0000 1.4 --- OneRank.cs 26 Dec 2004 17:43:53 -0000 1.5 *************** *** 40,43 **** --- 40,50 ---- private DateTime lastDateTime; + + public static long MaxBuyableShares( string ticker , double cashAmount, IDataStreamer dataStreamer ) + { + return Convert.ToInt64( + Math.Floor( cashAmount / dataStreamer.GetCurrentAsk( ticker ) ) ); + } + private void marketOpenEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) *************** *** 54,58 **** this.account.Key ); EndOfDayDateTime yesterdayAtClose = new ! EndOfDayDateTime( this.account.EndOfDayTimer.GetCurrentTime().DateTime.AddHours( - 1 ) , EndOfDaySpecificTime.MarketClose ); double yesterdayMarketValueAtClose = HistoricalDataProvider.GetMarketValue( --- 61,65 ---- this.account.Key ); EndOfDayDateTime yesterdayAtClose = new ! EndOfDayDateTime( this.account.EndOfDayTimer.GetCurrentTime().DateTime.AddDays( - 1 ) , EndOfDaySpecificTime.MarketClose ); double yesterdayMarketValueAtClose = HistoricalDataProvider.GetMarketValue( *************** *** 64,70 **** // today close is higher than yesterday close and no position // is kept in portfolio, yet ! sharesToBeBought = Convert.ToInt64( ! Math.Floor( this.account.CashAmount / ! this.account.DataStreamer.GetCurrentAsk( this.account.Key ) ) ); this.account.AddOrder( new Order( OrderType.MarketBuy , new Instrument( this.account.Key ) , sharesToBeBought ) ); --- 71,76 ---- // today close is higher than yesterday close and no position // is kept in portfolio, yet ! sharesToBeBought = MaxBuyableShares( this.account.Key , ! this.account.CashAmount , this.account.DataStreamer ); this.account.AddOrder( new Order( OrderType.MarketBuy , new Instrument( this.account.Key ) , sharesToBeBought ) ); |
|
From: Glauco S. <gla...@us...> - 2004-12-26 17:42:18
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6180/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: EndOfDayTimerHandler.cs Log Message: - The strategy has been fixed: now a ticker is chosen only if today's close is higher than yesterday's close. - OneRank.MaxBuyableShares is used now Index: EndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/EndOfDayTimerHandler.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EndOfDayTimerHandler.cs 20 Dec 2004 00:26:58 -0000 1.2 --- EndOfDayTimerHandler.cs 26 Dec 2004 17:42:08 -0000 1.3 *************** *** 29,32 **** --- 29,33 ---- using QuantProject.Business.Timing; using QuantProject.Data.DataProviders; + using QuantProject.Scripts.SimpleTesting; namespace QuantProject.Scripts.WalkForwardTesting.WalkForwardOneRank *************** *** 153,158 **** endOfDayTimingEventArgs.EndOfDayDateTime.DateTime ); } ! this.chosenTickers.SetTickers( this.bestPerformingTickers ); ! oneHourAfterMarketCloseEventHandler_orderChosenTickers( ( IEndOfDayTimer ) sender ); } #endregion --- 154,158 ---- endOfDayTimingEventArgs.EndOfDayDateTime.DateTime ); } ! // oneHourAfterMarketCloseEventHandler_orderChosenTickers( ( IEndOfDayTimer ) sender ); } #endregion *************** *** 165,169 **** --- 165,172 ---- private void fiveMinutesBeforeMarketCloseEventHandler_closePositions() { + ArrayList tickers = new ArrayList(); foreach ( string ticker in this.account.Portfolio.Keys ) + tickers.Add( ticker ); + foreach ( string ticker in tickers ) fiveMinutesBeforeMarketCloseEventHandler_closePosition( ticker ); } *************** *** 172,178 **** { double maxPositionValue = this.account.CashAmount / this.numberOfTickersToBeChosen; ! long sharesToBeBought = Convert.ToInt64( ! Math.Floor( maxPositionValue / ! this.account.DataStreamer.GetCurrentAsk( ticker ) ) ); this.account.AddOrder( new Order( OrderType.MarketBuy , new Instrument( ticker ) , sharesToBeBought ) ); --- 175,180 ---- { double maxPositionValue = this.account.CashAmount / this.numberOfTickersToBeChosen; ! long sharesToBeBought = OneRank.MaxBuyableShares( ticker , ! maxPositionValue , this.account.DataStreamer ); this.account.AddOrder( new Order( OrderType.MarketBuy , new Instrument( ticker ) , sharesToBeBought ) ); *************** *** 180,183 **** --- 182,186 ---- private void fiveMinutesBeforeMarketCloseEventHandler_openPositions() { + this.chosenTickers.SetTickers( this.bestPerformingTickers , this.account ); foreach ( string ticker in this.chosenTickers.Keys ) this.fiveMinutesBeforeMarketCloseEventHandler_openPosition( ticker ); |
|
From: Glauco S. <gla...@us...> - 2004-12-26 17:40:08
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5830/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: ChosenTickers.cs Log Message: The strategy has been fixed: now a ticker is chosen only if today's close is higher than yesterday's close. Index: ChosenTickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/ChosenTickers.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ChosenTickers.cs 20 Dec 2004 00:24:21 -0000 1.2 --- ChosenTickers.cs 26 Dec 2004 17:39:59 -0000 1.3 *************** *** 23,26 **** --- 23,31 ---- using System.Collections; + using QuantProject.Business.Financial.Accounting; + using QuantProject.Business.Timing; + using QuantProject.Data; + using QuantProject.Data.DataProviders; + namespace QuantProject.Scripts.WalkForwardTesting.WalkForwardOneRank { *************** *** 37,49 **** } #region SetTickers ! private void setTickers_build( BestPerformingTickers bestPerformingTickers ) { ! SortedList sortedList = new SortedList(); ! foreach ( string ticker in bestPerformingTickers.Keys ) ! sortedList.Add( ticker , ( ( ComparableAccount )bestPerformingTickers[ ticker ]).Goodness ); ! for ( int n=0; n<=this.numberTickersToBeChosen ; n++ ) { ! string key = (string)sortedList.GetKey( n ); ! this.Add( key , key ); } } --- 42,71 ---- } #region SetTickers ! private void setTickers_build_handleTicker( string ticker , Account account ) { ! double todayMarketValueAtClose = account.DataStreamer.GetCurrentBid( ! ticker ); ! EndOfDayDateTime yesterdayAtClose = new ! EndOfDayDateTime( account.EndOfDayTimer.GetCurrentTime().DateTime.AddDays( - 1 ) , ! EndOfDaySpecificTime.MarketClose ); ! double yesterdayMarketValueAtClose = HistoricalDataProvider.GetMarketValue( ! ticker , ! yesterdayAtClose.GetNearestExtendedDateTime() ); ! if ( todayMarketValueAtClose > yesterdayMarketValueAtClose ) ! // today close is higher than yesterday close ! this.Add( ticker , ticker ); ! } ! private void setTickers_build( BestPerformingTickers bestPerformingTickers , ! Account account ) ! { ! int index = bestPerformingTickers.Count - 1; ! while ( ( this.Count < this.numberTickersToBeChosen ) && ! ( index >= 0) ) { ! string ticker = ((Account)bestPerformingTickers[ index ]).Key; ! if ( account.DataStreamer.IsExchanged( ticker ) ) ! setTickers_build_handleTicker( ticker , ! account ); ! index--; } } *************** *** 52,59 **** /// </summary> /// <param name="dateTime"></param> ! public void SetTickers( BestPerformingTickers bestPerformingTickers ) { this.Clear(); ! this.setTickers_build( bestPerformingTickers ); } #endregion --- 74,82 ---- /// </summary> /// <param name="dateTime"></param> ! public void SetTickers( BestPerformingTickers bestPerformingTickers , ! Account account ) { this.Clear(); ! this.setTickers_build( bestPerformingTickers , account ); } #endregion |
|
From: Glauco S. <gla...@us...> - 2004-12-26 17:37:43
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5434/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: BestPerformingTickers.cs Log Message: It was an HashTable, it is an ArrayList, now. Index: BestPerformingTickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/BestPerformingTickers.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BestPerformingTickers.cs 20 Dec 2004 00:20:05 -0000 1.4 --- BestPerformingTickers.cs 26 Dec 2004 17:37:34 -0000 1.5 *************** *** 35,39 **** /// The collection of best performing tickers, among the eligible ones /// </summary> ! public class BestPerformingTickers : Hashtable,IProgressNotifier { private int numberBestPerformingTickers; --- 35,39 ---- /// The collection of best performing tickers, among the eligible ones /// </summary> ! public class BestPerformingTickers : ArrayList,IProgressNotifier { private int numberBestPerformingTickers; *************** *** 73,76 **** --- 73,77 ---- OneRank oneRank = new OneRank( account , dateTime.AddDays( this.numberDaysForPerformanceCalculation ) ); + double goodness = account.Goodness; // forces Goodness computation here (for a better ProgressBar effect) this.eligibleAccounts.Add( account ); } *************** *** 89,94 **** } this.eligibleAccounts.Sort(); ! for ( int index=0 ; index < this.numberBestPerformingTickers ; index++ ) ! this.Add( ((Account)this.eligibleAccounts[ index ]).Key , this.eligibleAccounts[ index ] ); } /// <summary> --- 90,95 ---- } this.eligibleAccounts.Sort(); ! for ( int index=this.numberBestPerformingTickers - 1 ; index >= 0 ; index-- ) ! this.Add( this.eligibleAccounts[ index ] ); } /// <summary> |
|
From: Marco M. <mi...@us...> - 2004-12-20 20:25:24
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15522/b7_Scripts/TickerSelectionTesting Modified Files: EndOfDayTimerHandler.cs RunEfficientCTOPortfolio.cs Log Message: Updated script for TickerSelection Testing, using Efficient portfolio theory Index: EndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandler.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EndOfDayTimerHandler.cs 17 Dec 2004 19:49:09 -0000 1.3 --- EndOfDayTimerHandler.cs 20 Dec 2004 20:25:11 -0000 1.4 *************** *** 91,107 **** #endregion ! #region FiveMinutesBeforeMarketCloseEventHandler ! private void fiveMinutesBeforeMarketCloseEventHandler_closePosition( string ticker ) { this.account.ClosePosition( ticker ); } ! private void fiveMinutesBeforeMarketCloseEventHandler_closePositions() { ! foreach ( string ticker in this.account.Portfolio.Keys ) ! fiveMinutesBeforeMarketCloseEventHandler_closePosition( ticker ); } ! private void fiveMinutesBeforeMarketCloseEventHandler_openPosition( string ticker ) { --- 91,116 ---- #endregion ! #region MarketCloseEventHandler ! private void marketCloseEventHandler_closePosition( string ticker ) { this.account.ClosePosition( ticker ); } ! private void marketCloseEventHandler_closePositions() { ! if(this.chosenTickers != null) ! { ! foreach( string ticker in this.chosenTickers) ! { ! for(int i = 0; i<this.account.Portfolio.Keys.Count; i++) ! { ! if(this.account.Portfolio[ticker]!=null) ! marketCloseEventHandler_closePosition( ticker ); ! } ! } ! } } ! private void marketCloseEventHandler_openPosition( string ticker ) { *************** *** 113,125 **** new Instrument( ticker ) , sharesToBeBought ) ); } ! private void fiveMinutesBeforeMarketCloseEventHandler_openPositions() { foreach ( string ticker in this.chosenTickers ) ! this.fiveMinutesBeforeMarketCloseEventHandler_openPosition( ticker ); } ! public void FiveMinutesBeforeMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! this.fiveMinutesBeforeMarketCloseEventHandler_closePositions(); //fiveMinutesBeforeMarketCloseEventHandler_openPositions(); } --- 122,135 ---- new Instrument( ticker ) , sharesToBeBought ) ); } ! private void marketCloseEventHandler_openPositions() { foreach ( string ticker in this.chosenTickers ) ! this.marketCloseEventHandler_openPosition( ticker ); } ! public void MarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! ! this.marketCloseEventHandler_closePositions(); //fiveMinutesBeforeMarketCloseEventHandler_openPositions(); } *************** *** 181,193 **** { TickerSelector mostLiquid = new TickerSelector(SelectionType.Liquidity, ! false, "STOCKMI", currentDate, currentDate.AddDays(60), this.numberOfEligibleTickers); this.eligibleTickers = mostLiquid.GetTableOfSelectedTickers(); IGenomeManager genManEfficientCTOPortfolio = ! new GenomeManagerForEfficientCTOPortfolio(this.eligibleTickers,currentDate, ! currentDate.AddDays(60), this.numberOfTickersToBeChosen, 0.005, 0.05); GeneticOptimizer GO = new GeneticOptimizer(genManEfficientCTOPortfolio); //GO.KeepOnRunningUntilConvergenceIsReached = true; ! GO.GenerationNumber = 4; GO.MutationRate = 0.05; GO.Run(false); --- 191,203 ---- { TickerSelector mostLiquid = new TickerSelector(SelectionType.Liquidity, ! false, "STOCKMI", currentDate.AddDays(-30), currentDate, this.numberOfEligibleTickers); this.eligibleTickers = mostLiquid.GetTableOfSelectedTickers(); IGenomeManager genManEfficientCTOPortfolio = ! new GenomeManagerForEfficientCTOPortfolio(this.eligibleTickers,currentDate.AddDays(-30), ! currentDate, this.numberOfTickersToBeChosen, 0.005, 0.05); GeneticOptimizer GO = new GeneticOptimizer(genManEfficientCTOPortfolio); //GO.KeepOnRunningUntilConvergenceIsReached = true; ! GO.GenerationNumber = 2; GO.MutationRate = 0.05; GO.Run(false); Index: RunEfficientCTOPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/RunEfficientCTOPortfolio.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RunEfficientCTOPortfolio.cs 14 Dec 2004 21:25:46 -0000 1.2 --- RunEfficientCTOPortfolio.cs 20 Dec 2004 20:25:12 -0000 1.3 *************** *** 77,84 **** this.reportTable = new ReportTable( "Summary_Reports" ); this.startDateTime = new EndOfDayDateTime( ! new DateTime( 2002 , 1 , 1 ) , EndOfDaySpecificTime.FiveMinutesBeforeMarketClose ); this.endDateTime = new EndOfDayDateTime( ! new DateTime( 2002 , 3 , 31 ) , EndOfDaySpecificTime.OneHourAfterMarketClose ); ! this.numIntervalDays = 7; } #region Run --- 77,84 ---- this.reportTable = new ReportTable( "Summary_Reports" ); this.startDateTime = new EndOfDayDateTime( ! new DateTime( 2004 , 10 , 4 ) , EndOfDaySpecificTime.FiveMinutesBeforeMarketClose ); this.endDateTime = new EndOfDayDateTime( ! new DateTime( 2004 , 10 , 10 ) , EndOfDaySpecificTime.OneHourAfterMarketClose ); ! this.numIntervalDays = 1; } #region Run *************** *** 163,167 **** --- 163,179 ---- */ #endregion + + private void checkDateForReport(Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs) + { + Report report; + + if(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime>=this.endDateTime.DateTime ) + { + this.endOfDayTimer.Stop(); + report = new Report( this.account ); + report.Show("CTO_Portfolio" , this.numIntervalDays , this.startDateTime , "CTO_Portfolio" ); + } + } public override void Run() { *************** *** 169,173 **** //this.run_FindBestPortfolioForNextTrade(); - Report report; run_initializeEndOfDayTimer(); run_initializeAccount(); --- 181,184 ---- *************** *** 178,185 **** this.endOfDayTimerHandler.MarketOpenEventHandler); ! this.endOfDayTimer.FiveMinutesBeforeMarketClose += ! new FiveMinutesBeforeMarketCloseEventHandler( ! this.endOfDayTimerHandler.FiveMinutesBeforeMarketCloseEventHandler ); ! this.endOfDayTimer.OneHourAfterMarketClose += new OneHourAfterMarketCloseEventHandler( --- 189,200 ---- this.endOfDayTimerHandler.MarketOpenEventHandler); ! this.endOfDayTimer.MarketClose += ! new MarketCloseEventHandler( ! this.endOfDayTimerHandler.MarketCloseEventHandler); ! ! this.endOfDayTimer.MarketClose += ! new MarketCloseEventHandler( ! this.checkDateForReport); ! this.endOfDayTimer.OneHourAfterMarketClose += new OneHourAfterMarketCloseEventHandler( *************** *** 191,197 **** //this.progressBarForm.Show(); this.endOfDayTimer.Start(); - report = new Report( this.account ); - report.Show("CTO_Portfolio" , this.numIntervalDays , this.startDateTime , "CTO_Portfolio" ); - } --- 206,209 ---- |
|
From: Glauco S. <gla...@us...> - 2004-12-20 00:31:32
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32102 Modified Files: QuantProject.suo Log Message: no message Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 Binary files /tmp/cvsgt3gj7 and /tmp/cvsGJ5G83 differ |
|
From: Glauco S. <gla...@us...> - 2004-12-20 00:29:14
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a05_Timing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31639/b4_Business/a05_Timing Modified Files: HistoricalEndOfDayTimer.cs Log Message: Bug fixed: this.currentTime is now assigned with a copy of this.startDateTime Index: HistoricalEndOfDayTimer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a05_Timing/HistoricalEndOfDayTimer.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HistoricalEndOfDayTimer.cs 13 Dec 2004 01:47:27 -0000 1.2 --- HistoricalEndOfDayTimer.cs 20 Dec 2004 00:29:05 -0000 1.3 *************** *** 71,75 **** { this.isActive = true; ! this.currentTime = this.startDateTime; while ( this.isActive ) { --- 71,75 ---- { this.isActive = true; ! this.currentTime = this.startDateTime.Copy(); while ( this.isActive ) { |
|
From: Glauco S. <gla...@us...> - 2004-12-20 00:27:10
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31143/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: EndOfDayTimerHandler.cs Log Message: Bug fixed: foreach now iterates through this.chosenTickers.Keys Index: EndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/EndOfDayTimerHandler.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EndOfDayTimerHandler.cs 29 Nov 2004 14:27:51 -0000 1.1 --- EndOfDayTimerHandler.cs 20 Dec 2004 00:26:58 -0000 1.2 *************** *** 123,127 **** private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions() { ! foreach ( string ticker in this.chosenTickers ) if ( !this.account.Contains( ticker ) ) { --- 123,127 ---- private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions() { ! foreach ( string ticker in this.chosenTickers.Keys ) if ( !this.account.Contains( ticker ) ) { *************** *** 180,184 **** private void fiveMinutesBeforeMarketCloseEventHandler_openPositions() { ! foreach ( string ticker in this.chosenTickers ) this.fiveMinutesBeforeMarketCloseEventHandler_openPosition( ticker ); } --- 180,184 ---- private void fiveMinutesBeforeMarketCloseEventHandler_openPositions() { ! foreach ( string ticker in this.chosenTickers.Keys ) this.fiveMinutesBeforeMarketCloseEventHandler_openPosition( ticker ); } |
|
From: Glauco S. <gla...@us...> - 2004-12-20 00:25:26
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a05_Timing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30744/b4_Business/a05_Timing Modified Files: EndOfDayDateTime.cs Log Message: The Copy method has been added Index: EndOfDayDateTime.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a05_Timing/EndOfDayDateTime.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EndOfDayDateTime.cs 29 Nov 2004 14:38:17 -0000 1.1 --- EndOfDayDateTime.cs 20 Dec 2004 00:25:12 -0000 1.2 *************** *** 92,95 **** --- 92,105 ---- return returnValue; } + /// <summary> + /// Returns a deep copy of the current instance + /// </summary> + /// <returns></returns> + public EndOfDayDateTime Copy() + { + return new EndOfDayDateTime( + new DateTime( this.dateTime.Year , this.dateTime.Month , this.dateTime.Day ) , + this.endOfDaySpecificTime ); + } #region MoveNext private EndOfDaySpecificTime getNextSpecificTime( ) |
|
From: Glauco S. <gla...@us...> - 2004-12-20 00:24:30
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30566/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: ChosenTickers.cs Log Message: Bug fixed: better use for SortedList now (ComparableAccount is used as IComparer) Index: ChosenTickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/ChosenTickers.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ChosenTickers.cs 29 Nov 2004 14:29:52 -0000 1.1 --- ChosenTickers.cs 20 Dec 2004 00:24:21 -0000 1.2 *************** *** 41,48 **** SortedList sortedList = new SortedList(); foreach ( string ticker in bestPerformingTickers.Keys ) ! sortedList.Add( ( ( ComparableAccount )bestPerformingTickers[ ticker ]).Goodness , ! ticker ); for ( int n=0; n<=this.numberTickersToBeChosen ; n++ ) ! this.Add( sortedList.GetByIndex( n ) , 1 ); } /// <summary> --- 41,50 ---- SortedList sortedList = new SortedList(); foreach ( string ticker in bestPerformingTickers.Keys ) ! sortedList.Add( ticker , ( ( ComparableAccount )bestPerformingTickers[ ticker ]).Goodness ); for ( int n=0; n<=this.numberTickersToBeChosen ; n++ ) ! { ! string key = (string)sortedList.GetKey( n ); ! this.Add( key , key ); ! } } /// <summary> |
|
From: Glauco S. <gla...@us...> - 2004-12-20 00:20:20
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29783/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: BestPerformingTickers.cs Log Message: - The historicalEndOfDayTimer starts from a EndOfDaySpecificTime.MarketOpen now - private variables now are properly cleaned up for subsequent SetTickers calls Index: BestPerformingTickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/BestPerformingTickers.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BestPerformingTickers.cs 15 Dec 2004 23:17:24 -0000 1.3 --- BestPerformingTickers.cs 20 Dec 2004 00:20:05 -0000 1.4 *************** *** 67,71 **** new HistoricalEndOfDayTimer( new EndOfDayDateTime( dateTime.AddYears( -1 ).AddDays( -1 ) , ! EndOfDaySpecificTime.FiveMinutesBeforeMarketClose ) ); ComparableAccount account = new ComparableAccount( ticker , historicalEndOfDayTimer , new HistoricalEndOfDayDataStreamer( historicalEndOfDayTimer ) , --- 67,71 ---- new HistoricalEndOfDayTimer( new EndOfDayDateTime( dateTime.AddYears( -1 ).AddDays( -1 ) , ! EndOfDaySpecificTime.MarketOpen ) ); ComparableAccount account = new ComparableAccount( ticker , historicalEndOfDayTimer , new HistoricalEndOfDayDataStreamer( historicalEndOfDayTimer ) , *************** *** 73,77 **** OneRank oneRank = new OneRank( account , dateTime.AddDays( this.numberDaysForPerformanceCalculation ) ); - account.Key = ticker; this.eligibleAccounts.Add( account ); } --- 73,76 ---- *************** *** 99,104 **** --- 98,105 ---- public void SetTickers( EligibleTickers eligibleTickers , DateTime dateTime ) { + this.calculatedTickers = 0; this.NewProgress( this , new NewProgressEventArgs( 0 , 100 ) ); this.Clear(); + this.eligibleAccounts.Clear(); this.setTickers_build( eligibleTickers , dateTime ); this.lastUpdate = dateTime; |
|
From: Glauco S. <gla...@us...> - 2004-12-20 00:15:05
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28316/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: RunWalkForwardOneRank.cs Log Message: The out of sample progress bar is handled in a better way now Index: RunWalkForwardOneRank.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/RunWalkForwardOneRank.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RunWalkForwardOneRank.cs 5 Dec 2004 02:49:50 -0000 1.3 --- RunWalkForwardOneRank.cs 20 Dec 2004 00:14:53 -0000 1.4 *************** *** 101,111 **** long elapsedDays = Convert.ToInt64( ((TimeSpan)( endOfDayTimer.GetCurrentTime().DateTime - this.startDateTime.DateTime )).TotalDays ); ! long totalDays = Convert.ToInt64( ((TimeSpan)( this.endDateTime.DateTime - this.startDateTime.DateTime )).TotalDays ); if ( Math.Floor( elapsedDays / totalDays * 100 ) > Math.Floor( ( elapsedDays - 1 ) / totalDays * 100 ) ) // a new out of sample time percentage point has been elapsed this.progressBarForm.ProgressBarOutOfSample.Value = Convert.ToInt16( Math.Floor( elapsedDays / totalDays * 100 ) ); } public void oneHourAfterMarketCloseEventHandler( --- 101,114 ---- long elapsedDays = Convert.ToInt64( ((TimeSpan)( endOfDayTimer.GetCurrentTime().DateTime - this.startDateTime.DateTime )).TotalDays ); ! double totalDays = Convert.ToDouble( ((TimeSpan)( this.endDateTime.DateTime - this.startDateTime.DateTime )).TotalDays ); if ( Math.Floor( elapsedDays / totalDays * 100 ) > Math.Floor( ( elapsedDays - 1 ) / totalDays * 100 ) ) + { // a new out of sample time percentage point has been elapsed this.progressBarForm.ProgressBarOutOfSample.Value = Convert.ToInt16( Math.Floor( elapsedDays / totalDays * 100 ) ); + this.progressBarForm.ProgressBarOutOfSample.Refresh(); + } } public void oneHourAfterMarketCloseEventHandler( |
|
From: Glauco S. <gla...@us...> - 2004-12-20 00:14:12
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/OneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27792/b7_Scripts/SimpleTesting/OneRank Modified Files: OneRank.cs Log Message: A parameter name is changed from account to account1 (strange debugging behavior was arising with the previous naming) Index: OneRank.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/OneRank/OneRank.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OneRank.cs 13 Dec 2004 01:50:43 -0000 1.3 --- OneRank.cs 20 Dec 2004 00:14:03 -0000 1.4 *************** *** 90,96 **** /// <param name="account">Account with which to run the strategy</param> /// <param name="lastDateTime">Date to stop the strategy</param> ! public OneRank( Account account , DateTime lastDateTime ) { ! this.account = account; this.lastDateTime = lastDateTime; this.account.EndOfDayTimer.MarketOpen += --- 90,96 ---- /// <param name="account">Account with which to run the strategy</param> /// <param name="lastDateTime">Date to stop the strategy</param> ! public OneRank( Account account1 , DateTime lastDateTime ) { ! this.account = account1; this.lastDateTime = lastDateTime; this.account.EndOfDayTimer.MarketOpen += |
|
From: Glauco S. <gla...@us...> - 2004-12-20 00:10:03
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26854/b7_Scripts Modified Files: b7_Scripts.csproj Log Message: Minor automatic changes Index: b7_Scripts.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/b7_Scripts.csproj,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** b7_Scripts.csproj 14 Dec 2004 21:21:41 -0000 1.15 --- b7_Scripts.csproj 20 Dec 2004 00:09:52 -0000 1.16 *************** *** 248,256 **** /> <File - RelPath = "WalkForwardTesting\WalkForwardOneRank\ProgressBarForm.resx" - DependentUpon = "ProgressBarForm.cs" - BuildAction = "EmbeddedResource" - /> - <File RelPath = "WalkForwardTesting\WalkForwardOneRank\RunWalkForwardOneRank.cs" SubType = "Code" --- 248,251 ---- |
|
From: Glauco S. <gla...@us...> - 2004-12-20 00:10:02
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26854/b5_Presentation Modified Files: b5_Presentation.csproj Log Message: Minor automatic changes Index: b5_Presentation.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/b5_Presentation.csproj,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** b5_Presentation.csproj 15 Dec 2004 23:12:27 -0000 1.15 --- b5_Presentation.csproj 20 Dec 2004 00:09:51 -0000 1.16 *************** *** 159,163 **** <File RelPath = "Charting\Chart.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 159,163 ---- <File RelPath = "Charting\Chart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> |
|
From: Glauco S. <gla...@us...> - 2004-12-20 00:10:01
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26854/b3_Data Modified Files: b3_Data.csproj Log Message: Minor automatic changes Index: b3_Data.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/b3_Data.csproj,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** b3_Data.csproj 15 Dec 2004 23:12:26 -0000 1.19 --- b3_Data.csproj 20 Dec 2004 00:09:51 -0000 1.20 *************** *** 144,148 **** <File RelPath = "ExtendedDataTable.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 144,148 ---- <File RelPath = "ExtendedDataTable.cs" ! SubType = "Component" BuildAction = "Compile" /> |
|
From: Marco M. <mi...@us...> - 2004-12-17 19:49:32
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22301/b7_Scripts/TickerSelectionTesting Modified Files: EndOfDayTimerHandler.cs Log Message: Updated EndOfDayTimerHandler for TickerSelection Testing, using Efficient portfolio theory Index: EndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandler.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EndOfDayTimerHandler.cs 15 Dec 2004 23:21:41 -0000 1.2 --- EndOfDayTimerHandler.cs 17 Dec 2004 19:49:09 -0000 1.3 *************** *** 50,53 **** --- 50,54 ---- private Account account; + private ArrayList orders; public int NumberOfEligibleTickers *************** *** 68,72 **** this.numberOfTickersToBeChosen = numberOfTickersToBeChosen; this.account = account; ! } --- 69,73 ---- this.numberOfTickersToBeChosen = numberOfTickersToBeChosen; this.account = account; ! this.orders = new ArrayList(); } *************** *** 83,88 **** this.account.AddCash(endOfDayTimingEventArgs.EndOfDayDateTime, 16000); ! ! //this.account.ExecuteActiveOrders(); } #endregion --- 84,91 ---- this.account.AddCash(endOfDayTimingEventArgs.EndOfDayDateTime, 16000); ! foreach(object item in this.orders) ! { ! this.account.AddOrder((Order)item); ! } } #endregion *************** *** 145,149 **** Convert.ToInt64( Math.Floor( cashForSinglePosition / this.account.DataStreamer.GetCurrentBid( ticker ) ) ); Order order = new Order( OrderType.MarketBuy , new Instrument( ticker ) , quantity ); ! this.account.AddOrder( order ); } private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions() --- 148,152 ---- Convert.ToInt64( Math.Floor( cashForSinglePosition / this.account.DataStreamer.GetCurrentBid( ticker ) ) ); Order order = new Order( OrderType.MarketBuy , new Instrument( ticker ) , quantity ); ! this.orders.Add(order); } private void oneHourAfterMarketCloseEventHandler_orderChosenTickers_openPositions() *************** *** 170,174 **** { this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime); ! //this.account.ClearOrders(); oneHourAfterMarketCloseEventHandler_orderChosenTickers( ( IEndOfDayTimer ) sender ); } --- 173,177 ---- { this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime); ! this.orders.Clear(); oneHourAfterMarketCloseEventHandler_orderChosenTickers( ( IEndOfDayTimer ) sender ); } |
|
From: Glauco S. <gla...@us...> - 2004-12-15 23:24:44
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv372 Modified Files: QuantProject.suo Log Message: Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 Binary files /tmp/cvsnlf1zW and /tmp/cvs98sW68 differ |
|
From: Glauco S. <gla...@us...> - 2004-12-15 23:24:17
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataProviders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv307/b3_Data/DataProviders Modified Files: HistoricalDataProvider.cs Log Message: GetMarketValue( string , DateTime , BarComponent ) has been fixed Index: HistoricalDataProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/HistoricalDataProvider.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HistoricalDataProvider.cs 13 Dec 2004 01:42:42 -0000 1.4 --- HistoricalDataProvider.cs 15 Dec 2004 23:24:08 -0000 1.5 *************** *** 159,167 **** { //DateTime dateTime = ! return Convert.ToDouble( ! ( (History) ((Hashtable) ! cachedHistories[ instrumentKey ])[ barComponent ] ).GetByIndex( ! ( (History) ((Hashtable) cachedHistories[ instrumentKey ])[ barComponent ] ! ).IndexOfKeyOrPrevious( dateTime ) ) ); } --- 159,163 ---- { //DateTime dateTime = ! return GetMarketValue( instrumentKey , new ExtendedDateTime( dateTime , barComponent ) ); } |
|
From: Glauco S. <gla...@us...> - 2004-12-15 23:21:52
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32233/b7_Scripts/TickerSelectionTesting Modified Files: EndOfDayTimerHandler.cs Log Message: - this.account.ExecuteActiveOrders() has been commented out - this.account.ClearOrders() has been commented out Index: EndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandler.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EndOfDayTimerHandler.cs 14 Dec 2004 21:21:41 -0000 1.1 --- EndOfDayTimerHandler.cs 15 Dec 2004 23:21:41 -0000 1.2 *************** *** 84,88 **** 16000); ! this.account.ExecuteActiveOrders(); } #endregion --- 84,88 ---- 16000); ! //this.account.ExecuteActiveOrders(); } #endregion *************** *** 170,174 **** { this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime); ! this.account.ClearOrders(); oneHourAfterMarketCloseEventHandler_orderChosenTickers( ( IEndOfDayTimer ) sender ); } --- 170,174 ---- { this.setTickers(endOfDayTimingEventArgs.EndOfDayDateTime.DateTime); ! //this.account.ClearOrders(); oneHourAfterMarketCloseEventHandler_orderChosenTickers( ( IEndOfDayTimer ) sender ); } |
|
From: Glauco S. <gla...@us...> - 2004-12-15 23:20:07
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31647/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: ComparableAccount.cs Log Message: - The constructor has been changed - The Goodness calculation has been fixed Index: ComparableAccount.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/ComparableAccount.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ComparableAccount.cs 29 Nov 2004 14:32:10 -0000 1.1 --- ComparableAccount.cs 15 Dec 2004 23:19:56 -0000 1.2 *************** *** 24,27 **** --- 24,30 ---- using QuantProject.Business.Financial.Accounting; using QuantProject.Business.Financial.Accounting.Reporting; + using QuantProject.Business.Financial.Ordering; + using QuantProject.Business.Timing; + using QuantProject.Data.DataProviders; namespace QuantProject.Scripts.WalkForwardTesting.WalkForwardOneRank *************** *** 46,64 **** get { return this.goodness(); } } ! public ComparableAccount() { - // - // TODO: Add constructor logic here - // } - private double goodness() { double returnValue; ! if ( this.accountReport.Summary.MaxEquityDrawDown >= this.maxAcceptableDrawDown ) returnValue = Double.MinValue; else ! // max draw down is acceptable ! returnValue = this.accountReport.Summary.TotalPnl / this.accountReport.Summary.BuyAndHoldPercentageReturn; return returnValue; --- 49,69 ---- get { return this.goodness(); } } ! public ComparableAccount( string accountName , IEndOfDayTimer endOfDayTimer , ! IDataStreamer dataStreamer , IOrderExecutor orderExecutor ) : base( accountName , ! endOfDayTimer , dataStreamer , orderExecutor ) { } private double goodness() { double returnValue; ! if ( this.accountReport == null ) ! this.accountReport = this.CreateReport( this.Key , 7 , ! this.EndOfDayTimer.GetCurrentTime() , this.Key ); ! if ( ( this.accountReport.Summary.MaxEquityDrawDown >= this.maxAcceptableDrawDown ) ! || ( this.accountReport.Summary.TotalPnl <= this.accountReport.Summary.BuyAndHoldPercentageReturn ) ) returnValue = Double.MinValue; else ! // max draw down is acceptable and the strategy is better than buy and hold ! returnValue = this.accountReport.Summary.TotalPnl - this.accountReport.Summary.BuyAndHoldPercentageReturn; return returnValue; |
|
From: Glauco S. <gla...@us...> - 2004-12-15 23:17:34
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31099/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: BestPerformingTickers.cs Log Message: ComparableAccount(s) are used now, instead of Account(s) Index: BestPerformingTickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/BestPerformingTickers.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BestPerformingTickers.cs 5 Dec 2004 02:44:37 -0000 1.2 --- BestPerformingTickers.cs 15 Dec 2004 23:17:24 -0000 1.3 *************** *** 68,72 **** new EndOfDayDateTime( dateTime.AddYears( -1 ).AddDays( -1 ) , EndOfDaySpecificTime.FiveMinutesBeforeMarketClose ) ); ! Account account = new Account( ticker , historicalEndOfDayTimer , new HistoricalEndOfDayDataStreamer( historicalEndOfDayTimer ) , new HistoricalEndOfDayOrderExecutor( historicalEndOfDayTimer ) ); --- 68,72 ---- new EndOfDayDateTime( dateTime.AddYears( -1 ).AddDays( -1 ) , EndOfDaySpecificTime.FiveMinutesBeforeMarketClose ) ); ! ComparableAccount account = new ComparableAccount( ticker , historicalEndOfDayTimer , new HistoricalEndOfDayDataStreamer( historicalEndOfDayTimer ) , new HistoricalEndOfDayOrderExecutor( historicalEndOfDayTimer ) ); |