[Quantproject-developers] QuantDownloader/Downloader/TickerSelectors TickerSelectorForm.cs,1.8,1.9
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-01-06 19:00:04
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13278/Downloader/TickerSelectors Modified Files: TickerSelectorForm.cs Log Message: Added QuotedInEachMarketDay type of selection for the TickerSelectorForm: it is now possible to retrieve tickers that have the same number of quotes (effectively traded) as a given market index (specified as a string property of the TickerSelector) Index: TickerSelectorForm.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors/TickerSelectorForm.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TickerSelectorForm.cs 22 Aug 2004 16:47:56 -0000 1.8 --- TickerSelectorForm.cs 6 Jan 2005 18:59:54 -0000 1.9 *************** *** 58,61 **** --- 58,63 ---- private System.Windows.Forms.Label label3; private System.Windows.Forms.CheckBox checkBoxASCMode; + private System.Windows.Forms.TextBox textBoxMarketIndex; + private System.Windows.Forms.Label labelMarketIndexKey; private DataTable tableOfSelectedTickers; *************** *** 69,86 **** this.comboBoxAvailableSelectionRules.Text = "Liquidity"; this.comboBoxAvailableSelectionRules.Items.Add("Liquidity"); - this.comboBoxAvailableSelectionRules.Text = "Performance"; this.comboBoxAvailableSelectionRules.Items.Add("Performance"); - this.comboBoxAvailableSelectionRules.Text = "CloseToCloseVolatility"; this.comboBoxAvailableSelectionRules.Items.Add("CloseToCloseVolatility"); - this.comboBoxAvailableSelectionRules.Text = "CloseToOpenVolatility"; this.comboBoxAvailableSelectionRules.Items.Add("CloseToOpenVolatility"); - this.comboBoxAvailableSelectionRules.Text = "AverageCloseToClosePerformance"; this.comboBoxAvailableSelectionRules.Items.Add("AverageCloseToClosePerformance"); - this.comboBoxAvailableSelectionRules.Text = "CloseToCloseLinearCorrelation"; this.comboBoxAvailableSelectionRules.Items.Add("CloseToCloseLinearCorrelation"); - this.comboBoxAvailableSelectionRules.Text = "CloseToOpenLinearCorrelation"; this.comboBoxAvailableSelectionRules.Items.Add("CloseToOpenLinearCorrelation"); - this.comboBoxAvailableSelectionRules.Text = "AverageCloseToOpenPerformance"; this.comboBoxAvailableSelectionRules.Items.Add("AverageCloseToOpenPerformance"); } --- 71,82 ---- this.comboBoxAvailableSelectionRules.Text = "Liquidity"; this.comboBoxAvailableSelectionRules.Items.Add("Liquidity"); this.comboBoxAvailableSelectionRules.Items.Add("Performance"); this.comboBoxAvailableSelectionRules.Items.Add("CloseToCloseVolatility"); this.comboBoxAvailableSelectionRules.Items.Add("CloseToOpenVolatility"); this.comboBoxAvailableSelectionRules.Items.Add("AverageCloseToClosePerformance"); this.comboBoxAvailableSelectionRules.Items.Add("CloseToCloseLinearCorrelation"); this.comboBoxAvailableSelectionRules.Items.Add("CloseToOpenLinearCorrelation"); this.comboBoxAvailableSelectionRules.Items.Add("AverageCloseToOpenPerformance"); + this.comboBoxAvailableSelectionRules.Items.Add("QuotedInEachMarketDay"); } *************** *** 125,128 **** --- 121,125 ---- this.panel2 = new System.Windows.Forms.Panel(); this.groupBoxSelectionRule = new System.Windows.Forms.GroupBox(); + this.checkBoxASCMode = new System.Windows.Forms.CheckBox(); this.label3 = new System.Windows.Forms.Label(); this.comboBoxAvailableSelectionRules = new System.Windows.Forms.ComboBox(); *************** *** 136,140 **** this.dateTimePickerFirstDate = new System.Windows.Forms.DateTimePicker(); this.splitter1 = new System.Windows.Forms.Splitter(); ! this.checkBoxASCMode = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); this.panel2.SuspendLayout(); --- 133,138 ---- this.dateTimePickerFirstDate = new System.Windows.Forms.DateTimePicker(); this.splitter1 = new System.Windows.Forms.Splitter(); ! this.textBoxMarketIndex = new System.Windows.Forms.TextBox(); ! this.labelMarketIndexKey = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); this.panel2.SuspendLayout(); *************** *** 177,180 **** --- 175,180 ---- // this.groupBoxSelectionRule.Controls.AddRange(new System.Windows.Forms.Control[] { + this.labelMarketIndexKey, + this.textBoxMarketIndex, this.checkBoxASCMode, this.label3, *************** *** 190,198 **** this.groupBoxSelectionRule.Location = new System.Drawing.Point(8, 16); this.groupBoxSelectionRule.Name = "groupBoxSelectionRule"; ! this.groupBoxSelectionRule.Size = new System.Drawing.Size(376, 184); this.groupBoxSelectionRule.TabIndex = 14; this.groupBoxSelectionRule.TabStop = false; this.groupBoxSelectionRule.Text = "Single Selection rule"; // // label3 // --- 190,206 ---- this.groupBoxSelectionRule.Location = new System.Drawing.Point(8, 16); this.groupBoxSelectionRule.Name = "groupBoxSelectionRule"; ! this.groupBoxSelectionRule.Size = new System.Drawing.Size(376, 216); this.groupBoxSelectionRule.TabIndex = 14; this.groupBoxSelectionRule.TabStop = false; this.groupBoxSelectionRule.Text = "Single Selection rule"; // + // checkBoxASCMode + // + this.checkBoxASCMode.Location = new System.Drawing.Point(176, 144); + this.checkBoxASCMode.Name = "checkBoxASCMode"; + this.checkBoxASCMode.Size = new System.Drawing.Size(152, 24); + this.checkBoxASCMode.TabIndex = 27; + this.checkBoxASCMode.Text = "Order by ASC mode"; + // // label3 // *************** *** 210,213 **** --- 218,222 ---- this.comboBoxAvailableSelectionRules.TabIndex = 25; this.comboBoxAvailableSelectionRules.Text = "comboBox1"; + this.comboBoxAvailableSelectionRules.SelectedValueChanged += new System.EventHandler(this.comboBoxAvailableSelectionRules_SelectedValueChanged); // // label2 *************** *** 284,294 **** this.splitter1.TabStop = false; // ! // checkBoxASCMode // ! this.checkBoxASCMode.Location = new System.Drawing.Point(176, 144); ! this.checkBoxASCMode.Name = "checkBoxASCMode"; ! this.checkBoxASCMode.Size = new System.Drawing.Size(152, 24); ! this.checkBoxASCMode.TabIndex = 27; ! this.checkBoxASCMode.Text = "Order by ASC mode"; // // TickerSelectorForm --- 293,313 ---- this.splitter1.TabStop = false; // ! // textBoxMarketIndex // ! this.textBoxMarketIndex.Location = new System.Drawing.Point(176, 176); ! this.textBoxMarketIndex.Name = "textBoxMarketIndex"; ! this.textBoxMarketIndex.Size = new System.Drawing.Size(88, 20); ! this.textBoxMarketIndex.TabIndex = 28; ! this.textBoxMarketIndex.Text = ""; ! this.textBoxMarketIndex.Visible = false; ! // ! // labelMarketIndexKey ! // ! this.labelMarketIndexKey.Location = new System.Drawing.Point(72, 176); ! this.labelMarketIndexKey.Name = "labelMarketIndexKey"; ! this.labelMarketIndexKey.Size = new System.Drawing.Size(96, 23); ! this.labelMarketIndexKey.TabIndex = 29; ! this.labelMarketIndexKey.Text = "Market index key:"; ! this.labelMarketIndexKey.Visible = false; // // TickerSelectorForm *************** *** 332,351 **** private void buttonSelectTickers_Click(object sender, System.EventArgs e) { ! 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)); ! this.dataGrid1.DataSource = selector.GetTableOfSelectedTickers(); ! this.dataGrid1.Refresh(); ! Cursor.Current = Cursors.Default; } --- 351,378 ---- private void buttonSelectTickers_Click(object sender, System.EventArgs e) { ! try ! { ! 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(); ! Cursor.Current = Cursors.Default; ! } ! catch(Exception ex) ! { ! MessageBox.Show(ex.ToString()); ! } } *************** *** 369,373 **** --- 396,419 ---- 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; + this.labelMarketIndexKey.Visible = true; + this.textBoxMarketIndex.Visible = true; + } + else + { + this.checkBoxASCMode.Enabled = true; + this.labelMarketIndexKey.Visible = false; + this.textBoxMarketIndex.Text = ""; + this.textBoxMarketIndex.Visible = false; + } } |