[Quantproject-developers] QuantDownloader/Downloader/TickerSelectors TickerSelectorForm.cs,1.9,1.10
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-03-08 19:14:16
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29253/Downloader/TickerSelectors Modified Files: TickerSelectorForm.cs Log Message: Advanced Ticker selection has been re-organized in a more rational and object-oriented way Now TickerDownloader compiles Index: TickerSelectorForm.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors/TickerSelectorForm.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TickerSelectorForm.cs 6 Jan 2005 18:59:54 -0000 1.9 --- TickerSelectorForm.cs 8 Mar 2005 19:13:49 -0000 1.10 *************** *** 36,40 **** { /// <summary> ! /// It is the user interface for the TickerSelector class /// </summary> public class TickerSelectorForm : System.Windows.Forms.Form, ITickerSelector --- 36,40 ---- { /// <summary> ! /// It is the user interface for the ITickerSelector chosen by user /// </summary> public class TickerSelectorForm : System.Windows.Forms.Form, ITickerSelector *************** *** 78,82 **** this.comboBoxAvailableSelectionRules.Items.Add("CloseToOpenLinearCorrelation"); this.comboBoxAvailableSelectionRules.Items.Add("AverageCloseToOpenPerformance"); ! this.comboBoxAvailableSelectionRules.Items.Add("QuotedInEachMarketDay"); } --- 78,82 ---- this.comboBoxAvailableSelectionRules.Items.Add("CloseToOpenLinearCorrelation"); this.comboBoxAvailableSelectionRules.Items.Add("AverageCloseToOpenPerformance"); ! this.comboBoxAvailableSelectionRules.Items.Add("QuotedAtEachMarketDay"); } *************** *** 354,370 **** { Cursor.Current = Cursors.WaitCursor; ! TickerSelector selector; ! if(this.textBoxGroupID.Text != "") ! selector= new TickerSelector(this.getTypeOfRuleSelectedByUser(), this.checkBoxASCMode.Checked, this.textBoxGroupID.Text, ! this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, ! Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! else ! selector= new TickerSelector(this.tableOfSelectedTickers, this.getTypeOfRuleSelectedByUser(), ! this.checkBoxASCMode.Checked, this.textBoxGroupID.Text, ! this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, ! Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! selector.MarketIndex = this.textBoxMarketIndex.Text; this.dataGrid1.DataSource = selector.GetTableOfSelectedTickers(); this.dataGrid1.Refresh(); --- 354,359 ---- { Cursor.Current = Cursors.WaitCursor; ! ITickerSelector selector; ! selector = this.getITickerSelector(); this.dataGrid1.DataSource = selector.GetTableOfSelectedTickers(); this.dataGrid1.Refresh(); *************** *** 377,407 **** } ! private SelectionType getTypeOfRuleSelectedByUser() { ! SelectionType typeSelected = SelectionType.Liquidity; if(this.comboBoxAvailableSelectionRules.Text == "Liquidity") ! typeSelected = SelectionType.Liquidity; else if (this.comboBoxAvailableSelectionRules.Text == "Performance") ! typeSelected = SelectionType.Performance; else if (this.comboBoxAvailableSelectionRules.Text == "CloseToCloseVolatility") ! typeSelected = SelectionType.CloseToCloseVolatility; else if (this.comboBoxAvailableSelectionRules.Text == "CloseToOpenVolatility") ! typeSelected = SelectionType.CloseToOpenVolatility; else if (this.comboBoxAvailableSelectionRules.Text == "AverageCloseToClosePerformance") ! typeSelected = SelectionType.AverageCloseToClosePerformance; else if (this.comboBoxAvailableSelectionRules.Text == "CloseToCloseLinearCorrelation") ! typeSelected = SelectionType.CloseToCloseLinearCorrelation; else if (this.comboBoxAvailableSelectionRules.Text == "CloseToOpenLinearCorrelation") ! typeSelected = SelectionType.CloseToOpenLinearCorrelation; else if (this.comboBoxAvailableSelectionRules.Text == "AverageCloseToOpenPerformance") ! typeSelected = SelectionType.AverageCloseToOpenPerformance; ! else if (this.comboBoxAvailableSelectionRules.Text == "QuotedInEachMarketDay") ! typeSelected = SelectionType.QuotedInEachMarketDay; ! return typeSelected; } private void comboBoxAvailableSelectionRules_SelectedValueChanged(object sender, System.EventArgs e) { ! if(this.comboBoxAvailableSelectionRules.Text == "QuotedInEachMarketDay") { this.checkBoxASCMode.Enabled = false; --- 366,482 ---- } ! private ITickerSelector getITickerSelector() { ! ITickerSelector returnValue = new SelectorByLiquidity(this.textBoxGroupID.Text, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text )); ! if(this.comboBoxAvailableSelectionRules.Text == "Liquidity") ! { ! if(this.textBoxGroupID.Text != "") ! returnValue = new SelectorByLiquidity(this.textBoxGroupID.Text, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text )); ! else ! returnValue = new SelectorByLiquidity(this.tableOfSelectedTickers, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! } else if (this.comboBoxAvailableSelectionRules.Text == "Performance") ! { ! if(this.textBoxGroupID.Text != "") ! returnValue = new SelectorByAbsolutePerformance(this.textBoxGroupID.Text, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! else ! returnValue = new SelectorByAbsolutePerformance(this.tableOfSelectedTickers, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! } else if (this.comboBoxAvailableSelectionRules.Text == "CloseToCloseVolatility") ! { ! if(this.textBoxGroupID.Text != "") ! returnValue = new SelectorByCloseToCloseVolatility(this.textBoxGroupID.Text, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! else ! returnValue = new SelectorByCloseToCloseVolatility(this.tableOfSelectedTickers, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! } else if (this.comboBoxAvailableSelectionRules.Text == "CloseToOpenVolatility") ! { ! if(this.textBoxGroupID.Text != "") ! returnValue = new SelectorByOpenToCloseVolatility (this.textBoxGroupID.Text, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! else ! returnValue = new SelectorByOpenToCloseVolatility (this.tableOfSelectedTickers, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! } else if (this.comboBoxAvailableSelectionRules.Text == "AverageCloseToClosePerformance") ! { ! if(this.textBoxGroupID.Text != "") ! returnValue = new SelectorByAverageCloseToClosePerformance(this.textBoxGroupID.Text, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! else ! returnValue = new SelectorByAverageCloseToClosePerformance(this.tableOfSelectedTickers, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! } else if (this.comboBoxAvailableSelectionRules.Text == "CloseToCloseLinearCorrelation") ! { ! if(this.textBoxGroupID.Text != "") ! returnValue = new SelectorByCloseToCloseLinearCorrelation (this.textBoxGroupID.Text, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! else ! returnValue = new SelectorByCloseToCloseLinearCorrelation(this.tableOfSelectedTickers, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! } else if (this.comboBoxAvailableSelectionRules.Text == "CloseToOpenLinearCorrelation") ! { ! if(this.textBoxGroupID.Text != "") ! returnValue = new SelectorByOpenToCloseLinearCorrelation (this.textBoxGroupID.Text, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! else ! returnValue = new SelectorByOpenToCloseLinearCorrelation (this.tableOfSelectedTickers, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! } else if (this.comboBoxAvailableSelectionRules.Text == "AverageCloseToOpenPerformance") ! { ! if(this.textBoxGroupID.Text != "") ! returnValue = new SelectorByAverageOpenToClosePerformance(this.textBoxGroupID.Text, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! else ! returnValue = new SelectorByAverageOpenToClosePerformance(this.tableOfSelectedTickers, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! } ! else if (this.comboBoxAvailableSelectionRules.Text == "QuotedAtEachMarketDay") ! { ! if(this.textBoxGroupID.Text != "") ! returnValue = new SelectorByQuotationAtEachMarketDay (this.textBoxGroupID.Text, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text), ! this.textBoxMarketIndex.Text); ! else ! returnValue = new SelectorByQuotationAtEachMarketDay(this.tableOfSelectedTickers, ! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text), ! this.textBoxMarketIndex.Text); ! } ! return returnValue; } private void comboBoxAvailableSelectionRules_SelectedValueChanged(object sender, System.EventArgs e) { ! if(this.comboBoxAvailableSelectionRules.Text == "QuotedAtEachMarketDay") { this.checkBoxASCMode.Enabled = false; |