[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging PairsVie
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2009-03-09 17:45:31
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2765/b7_Scripts/WalkForwardTesting/PairsTrading/Logging Modified Files: PairsViewer.cs Log Message: - a DateTimePicker has been added to chose the final date time for the chart - tickers are now displayed, each with its own line colour Index: PairsViewer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging/PairsViewer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PairsViewer.cs 7 Mar 2009 04:20:35 -0000 1.1 --- PairsViewer.cs 9 Mar 2009 17:45:13 -0000 1.2 *************** *** 46,50 **** WeightedPosition firstWeightedPosition , WeightedPosition secondWeightedPosition , ! DateTime firstDateTime ) { // --- 46,50 ---- WeightedPosition firstWeightedPosition , WeightedPosition secondWeightedPosition , ! DateTime dateTime ) { // *************** *** 56,83 **** this.firstWeightedPosition = firstWeightedPosition; this.secondWeightedPosition = secondWeightedPosition; ! this.dateTimePicker.Value = firstDateTime; } ! ! #region ButtonShowClick ! ! #region getHistory ! ! #region addItemsToHistory ! private DateTime getFirstDateTime() { ! DateTime firstDateTime = ! this.dateTimePicker.Value.AddMinutes( -10 ); // HistoricalEndOfDayTimer.GetMarketOpen( // this.dateTimePicker.Value.AddDays( 1 ) ); return firstDateTime; } ! private DateTime getLastDateTime() { ! DateTime firstDateTime = this.getFirstDateTime(); DateTime lastDateTime = HistoricalEndOfDayTimer.GetMarketClose( firstDateTime ); return lastDateTime; ! } private void addItemToHistory( WeightedPosition weightedPosition , DateTime dateTime , History history ) --- 56,88 ---- this.firstWeightedPosition = firstWeightedPosition; this.secondWeightedPosition = secondWeightedPosition; ! this.dateTimePickerForFirstDateTime.Value = ! this.initializeFirstDateTime( dateTime ); ! this.textBoxGreenTicker.Text = firstWeightedPosition.Ticker; ! this.textBoxRedTicker.Text = secondWeightedPosition.Ticker; ! ! this.dateTimePickerForLastDateTime.Value = this.initializeLastDateTime(); } ! private DateTime initializeFirstDateTime( DateTime dateTime ) { ! DateTime firstDateTime = dateTime.AddMinutes( -10 ); // HistoricalEndOfDayTimer.GetMarketOpen( // this.dateTimePicker.Value.AddDays( 1 ) ); return firstDateTime; } ! private DateTime initializeLastDateTime() { ! DateTime firstDateTime = this.dateTimePickerForFirstDateTime.Value; DateTime lastDateTime = HistoricalEndOfDayTimer.GetMarketClose( firstDateTime ); return lastDateTime; ! } ! ! #region ButtonShowClick ! ! #region getHistory ! ! #region addItemsToHistory ! private void addItemToHistory( WeightedPosition weightedPosition , DateTime dateTime , History history ) *************** *** 96,101 **** private void addItemsToHistory( WeightedPosition weightedPosition , History history ) { ! DateTime currentDateTime = this.getFirstDateTime(); ! DateTime lastDateTime = this.getLastDateTime(); while ( currentDateTime <= lastDateTime ) { --- 101,106 ---- private void addItemsToHistory( WeightedPosition weightedPosition , History history ) { ! DateTime currentDateTime = this.dateTimePickerForFirstDateTime.Value; ! DateTime lastDateTime = this.dateTimePickerForLastDateTime.Value; while ( currentDateTime <= lastDateTime ) { |