quantproject-developers Mailing List for QuantProject (Page 140)
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: Glauco S. <gla...@us...> - 2004-03-28 22:12:38
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18223/Downloader/QuotesEditor Modified Files: VisualValidationDataGrid.cs Log Message: Now each quote is visually validated by itself (all or none were the two only options with the previous version) Index: VisualValidationDataGrid.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/VisualValidationDataGrid.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VisualValidationDataGrid.cs 21 Mar 2004 16:46:51 -0000 1.1 --- VisualValidationDataGrid.cs 28 Mar 2004 22:01:05 -0000 1.2 *************** *** 32,36 **** /// DataGrid used for (record by record) visual validation /// </summary> ! public class VisualValidationDataGrid : ValidationDataGrid { private DataView dataView; --- 32,36 ---- /// DataGrid used for (record by record) visual validation /// </summary> ! public abstract class VisualValidationDataGrid : ValidationDataGrid { private DataView dataView; *************** *** 93,105 **** this.setStyles(); } ! private void confirmVisualValidation() ! { ! VisuallyValidatedTickers.ValidateCloseToClose( ((QuotesEditor)this.FindForm()).Ticker ); ! } protected override void OnMouseUp(MouseEventArgs e) { ! Console.WriteLine( "VisualValidationDataGrid.OnMouseUp() " + ! this[ this.CurrentRowIndex , 0 ].ToString() ); ! ((VisualValidationTabPage)this.Parent).VisualValidationChart.Invalidate( true ); base.OnMouseUp( e ); } --- 93,105 ---- this.setStyles(); } ! protected abstract void confirmVisualValidation( string ticker , DateTime quoteDate ); ! // { ! // VisuallyValidatedTickers.ValidateCloseToClose( ((QuotesEditor)this.FindForm()).Ticker ); ! // } protected override void OnMouseUp(MouseEventArgs e) { ! // Console.WriteLine( "VisualValidationDataGrid.OnMouseUp() " + ! // this[ this.CurrentRowIndex , 0 ].ToString() ); ! // ((VisualValidationTabPage)this.Parent).VisualValidationChart.Invalidate( true ); base.OnMouseUp( e ); } *************** *** 116,129 **** this[this.CurrentCell] = !System.Convert.ToBoolean(this[this.CurrentCell]); this.Select( true , true ); - } - // DataView checkedDataView = new DataView( ((QuotesEditor)this.FindForm()).ValidateDataTable ); - // checkedDataView.RowFilter = "(" + this.dataView.RowFilter + - // " AND (CloseToCloseHasBeenVisuallyValidated=true))"; - int checkedItems = 0; - for (int rowIndex=0 ; rowIndex<this.dataView.Count ; rowIndex++) - if ( (bool)this[ rowIndex , 2] ) - checkedItems++; - if ( checkedItems == this.dataView.Count ) - // all suspicious data rows have been visually validated if ( MessageBox.Show( this , "You have visually validated all the suspicious " + "quotes, with respect to the " + this.confirmMessage + --- 116,119 ---- *************** *** 135,139 **** MessageBoxDefaultButton.Button1 ) == DialogResult.Yes ) // the user asked to write the visual validation to the database ! this.confirmVisualValidation(); } protected override void OnPaint( PaintEventArgs e ) --- 125,153 ---- MessageBoxDefaultButton.Button1 ) == DialogResult.Yes ) // the user asked to write the visual validation to the database ! { ! this.confirmVisualValidation( ((QuotesEditor)this.FindForm()).Ticker , ! (DateTime)this[ this.CurrentCell.RowNumber , 0 ] ); ! ((QuotesEditor)this.FindForm()).Renew(); ! } ! } ! // DataView checkedDataView = new DataView( ((QuotesEditor)this.FindForm()).ValidateDataTable ); ! // checkedDataView.RowFilter = "(" + this.dataView.RowFilter + ! // " AND (CloseToCloseHasBeenVisuallyValidated=true))"; ! // int checkedItems = 0; ! // for (int rowIndex=0 ; rowIndex<this.dataView.Count ; rowIndex++) ! // if ( (bool)this[ rowIndex , 2] ) ! // checkedItems++; ! // if ( checkedItems == this.dataView.Count ) ! // // all suspicious data rows have been visually validated ! // if ( MessageBox.Show( this , "You have visually validated all the suspicious " + ! // "quotes, with respect to the " + this.confirmMessage + ! // ". Do you confirm your " + ! // "visual validation to be permanentely stored into the database?" , ! // "Visual Validation Confirmation" , ! // MessageBoxButtons.YesNo , ! // MessageBoxIcon.Question , ! // MessageBoxDefaultButton.Button1 ) == DialogResult.Yes ) ! // // the user asked to write the visual validation to the database ! // this.confirmVisualValidation(); } protected override void OnPaint( PaintEventArgs e ) |
|
From: Glauco S. <gla...@us...> - 2004-03-28 22:09:18
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17292/Downloader/QuotesEditor Modified Files: VisualValidationChart.cs Log Message: ConstantsProvider.PrecedingDaysForVisualValidation is used instead of the 20 constant Index: VisualValidationChart.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/VisualValidationChart.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VisualValidationChart.cs 24 Mar 2004 18:23:32 -0000 1.2 --- VisualValidationChart.cs 28 Mar 2004 21:57:55 -0000 1.3 *************** *** 2,5 **** --- 2,6 ---- using System.Collections; using System.Drawing; + using QuantProject.ADT; using QuantProject.ADT.Histories; using QuantProject.Presentation.Charting; *************** *** 13,16 **** --- 14,18 ---- { private DateTime suspiciousDateTime; + private int precedingDays; // protected ArrayList histories; *************** *** 28,31 **** --- 30,39 ---- } + public int PrecedingDays + { + get { return this.precedingDays; } + set { this.precedingDays = value; } + } + public VisualValidationChart() { *************** *** 53,59 **** // this.history.IndexOfKeyOrPrevious( this.suspiciousDateTime ) ) + 20 ); this.startDateTime = (DateTime) history.GetKey( Math.Max( 0 , ! history.IndexOfKeyOrPrevious( this.suspiciousDateTime ) - 20 ) ); this.endDateTime = (DateTime) history.GetKey( Math.Min( history.Count - 1 , ! history.IndexOfKeyOrPrevious( this.suspiciousDateTime ) ) + 20 ); } protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) --- 61,69 ---- // this.history.IndexOfKeyOrPrevious( this.suspiciousDateTime ) ) + 20 ); this.startDateTime = (DateTime) history.GetKey( Math.Max( 0 , ! history.IndexOfKeyOrPrevious( this.suspiciousDateTime ) - ! ConstantsProvider.PrecedingDaysForVisualValidation ) ); this.endDateTime = (DateTime) history.GetKey( Math.Min( history.Count - 1 , ! history.IndexOfKeyOrPrevious( this.suspiciousDateTime ) ) + ! ConstantsProvider.PrecedingDaysForVisualValidation ); } protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
|
From: Glauco S. <gla...@us...> - 2004-03-28 22:07:30
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16927/Downloader/Validate Modified Files: ValidateDataTable.cs Log Message: Tab formatting has been changed Index: ValidateDataTable.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/ValidateDataTable.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ValidateDataTable.cs 21 Mar 2004 16:22:57 -0000 1.10 --- ValidateDataTable.cs 28 Mar 2004 21:56:03 -0000 1.11 *************** *** 6,60 **** namespace QuantProject.Applications.Downloader.Validate { ! /// <summary> ! /// DataTable to be bound to the Validate form DataGrid. It will ! /// contain all data validation errors with descriptions and it will ! /// be used to fetch user input data fixing and to apply updates to the database. ! /// </summary> ! public class ValidateDataTable : DataTable ! { ! private string selectStatement; ! private OleDbCommandBuilder oleDbCommandBuilder; ! private OleDbDataAdapter oleDbDataAdapter; ! private DataTable tableOfTickersToBeValidated; ! public ValidateDataTable() ! { ! //<<<<<<< ValidateDataTable.cs ! // this.selectStatement = ! // "select * from quotes where 1=2"; ! // this.oleDbDataAdapter = ! // new OleDbDataAdapter( selectStatement , ConnectionProvider.OleDbConnection ); ! // this.oleDbCommandBuilder = new OleDbCommandBuilder( oleDbDataAdapter ); ! // this.oleDbDataAdapter.UpdateCommand = this.oleDbCommandBuilder.GetUpdateCommand(); ! // this.oleDbDataAdapter.Fill( this ); ! // this.Columns.Add( new DataColumn( "CloseToCloseHasBeenVisuallyValidated" , ! // System.Type.GetType( "System.Boolean" ) ) ); ! // ! // this.TableName = "quotes"; ! ////<<<<<<< ValidateDataTable.cs ! // this.Columns.Add( "ValidationWarning" , ! // ValidationWarning.OpenHighLowCloseLogicalInconsistency.GetType() ); ! //======= ! // ! //>>>>>>> 1.6 ! //======= ! initializeValidateDataTable(); ! //>>>>>>> 1.8 ! } ! public ValidateDataTable(DataTable tableOfTickers) ! { ! initializeValidateDataTable(); ! // specific code used by this constructor ! // the table member is used when the validation procedure ! // is called by the tickerViewer object ! this.tableOfTickersToBeValidated = tableOfTickers; ! } ! #region initializeValidateDataTable private void initializeValidateDataTable() { ! this.selectStatement = "select * from quotes where 1=2"; this.oleDbDataAdapter = --- 6,60 ---- namespace QuantProject.Applications.Downloader.Validate { ! /// <summary> ! /// DataTable to be bound to the Validate form DataGrid. It will ! /// contain all data validation errors with descriptions and it will ! /// be used to fetch user input data fixing and to apply updates to the database. ! /// </summary> ! public class ValidateDataTable : DataTable ! { ! private string selectStatement; ! private OleDbCommandBuilder oleDbCommandBuilder; ! private OleDbDataAdapter oleDbDataAdapter; ! private DataTable tableOfTickersToBeValidated; ! public ValidateDataTable() ! { ! //<<<<<<< ValidateDataTable.cs ! // this.selectStatement = ! // "select * from quotes where 1=2"; ! // this.oleDbDataAdapter = ! // new OleDbDataAdapter( selectStatement , ConnectionProvider.OleDbConnection ); ! // this.oleDbCommandBuilder = new OleDbCommandBuilder( oleDbDataAdapter ); ! // this.oleDbDataAdapter.UpdateCommand = this.oleDbCommandBuilder.GetUpdateCommand(); ! // this.oleDbDataAdapter.Fill( this ); ! // this.Columns.Add( new DataColumn( "CloseToCloseHasBeenVisuallyValidated" , ! // System.Type.GetType( "System.Boolean" ) ) ); ! // ! // this.TableName = "quotes"; ! ////<<<<<<< ValidateDataTable.cs ! // this.Columns.Add( "ValidationWarning" , ! // ValidationWarning.OpenHighLowCloseLogicalInconsistency.GetType() ); ! //======= ! // ! //>>>>>>> 1.6 ! //======= ! initializeValidateDataTable(); ! //>>>>>>> 1.8 ! } ! public ValidateDataTable(DataTable tableOfTickers) ! { ! initializeValidateDataTable(); ! // specific code used by this constructor ! // the table member is used when the validation procedure ! // is called by the tickerViewer object ! this.tableOfTickersToBeValidated = tableOfTickers; ! } ! #region initializeValidateDataTable private void initializeValidateDataTable() { ! this.selectStatement = "select * from quotes where 1=2"; this.oleDbDataAdapter = *************** *** 63,71 **** this.oleDbDataAdapter.UpdateCommand = this.oleDbCommandBuilder.GetUpdateCommand(); this.oleDbDataAdapter.Fill( this ); ! DataColumn dataColumn = new DataColumn( "CloseToCloseHasBeenVisuallyValidated" , ! System.Type.GetType( "System.Boolean" ) ); ! dataColumn.DefaultValue = false; ! this.Columns.Add( dataColumn ); ! this.TableName = "quotes"; //<<<<<<< ValidateDataTable.cs this.Columns.Add( "ValidationWarning" , --- 63,71 ---- this.oleDbDataAdapter.UpdateCommand = this.oleDbCommandBuilder.GetUpdateCommand(); this.oleDbDataAdapter.Fill( this ); ! DataColumn dataColumn = new DataColumn( "CloseToCloseHasBeenVisuallyValidated" , ! System.Type.GetType( "System.Boolean" ) ); ! dataColumn.DefaultValue = false; ! this.Columns.Add( dataColumn ); ! this.TableName = "quotes"; //<<<<<<< ValidateDataTable.cs this.Columns.Add( "ValidationWarning" , *************** *** 76,131 **** //>>>>>>> 1.6 } ! #endregion ! /// <summary> ! /// Adds quotesRow to the ValidateDataTable ! /// </summary> ! /// <param name="quotesRow">Row of quotes to added</param> ! private void suspiciousDataRowEventHandler( Object sender , ! SuspiciousDataRowEventArgs eventArgs ) ! { ! DataRow quotesRow = eventArgs.DataRow; ! DataRow dataRow = this.NewRow(); ! foreach (DataColumn dataColumn in quotesRow.Table.Columns ) ! dataRow[ dataColumn.ColumnName ] = quotesRow[ dataColumn ]; ! dataRow[ "ValidationWarning" ] = eventArgs.ValidationWarning; ! this.Rows.Add( dataRow ); ! //this.Rows.Add( quotesRow ); ! } ! public void AddRows( string tickerIsLike , double suspiciousRatio ) ! { ! QuotesToBeValidated quotesToBeValidated = new QuotesToBeValidated( tickerIsLike ); ! quotesToBeValidated.SuspiciousRatio = suspiciousRatio; ! quotesToBeValidated.SuspiciousDataRow += ! new SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler ); ! // new QuotesToBeValidated.SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler ); ! quotesToBeValidated.Validate(); ! this.AcceptChanges(); ! } ! public void AddRows(double suspiciousRatio ) ! { ! QuotesToBeValidated quotesToBeValidated = new QuotesToBeValidated(this.tableOfTickersToBeValidated); ! quotesToBeValidated.SuspiciousRatio = suspiciousRatio; ! quotesToBeValidated.SuspiciousDataRow += ! new SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler ); ! // new QuotesToBeValidated.SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler ); ! quotesToBeValidated.Validate(); ! this.AcceptChanges(); } - /// <summary> - /// Commits the ValidateDataTable changes to the database - /// </summary> - public void Update() - { - try - { - this.oleDbDataAdapter.Update( this ); - this.AcceptChanges(); - } - catch (Exception exception) - { - Console.WriteLine( exception.ToString() ); - } - } - } } --- 76,131 ---- //>>>>>>> 1.6 } ! #endregion ! /// <summary> ! /// Adds quotesRow to the ValidateDataTable ! /// </summary> ! /// <param name="quotesRow">Row of quotes to added</param> ! private void suspiciousDataRowEventHandler( Object sender , ! SuspiciousDataRowEventArgs eventArgs ) ! { ! DataRow quotesRow = eventArgs.DataRow; ! DataRow dataRow = this.NewRow(); ! foreach (DataColumn dataColumn in quotesRow.Table.Columns ) ! dataRow[ dataColumn.ColumnName ] = quotesRow[ dataColumn ]; ! dataRow[ "ValidationWarning" ] = eventArgs.ValidationWarning; ! this.Rows.Add( dataRow ); ! //this.Rows.Add( quotesRow ); ! } ! public void AddRows( string tickerIsLike , double suspiciousRatio ) ! { ! QuotesToBeValidated quotesToBeValidated = new QuotesToBeValidated( tickerIsLike ); ! quotesToBeValidated.SuspiciousRatio = suspiciousRatio; ! quotesToBeValidated.SuspiciousDataRow += ! new SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler ); ! // new QuotesToBeValidated.SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler ); ! quotesToBeValidated.Validate(); ! this.AcceptChanges(); ! } ! public void AddRows(double suspiciousRatio ) ! { ! QuotesToBeValidated quotesToBeValidated = new QuotesToBeValidated(this.tableOfTickersToBeValidated); ! quotesToBeValidated.SuspiciousRatio = suspiciousRatio; ! quotesToBeValidated.SuspiciousDataRow += ! new SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler ); ! // new QuotesToBeValidated.SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler ); ! quotesToBeValidated.Validate(); ! this.AcceptChanges(); ! } ! /// <summary> ! /// Commits the ValidateDataTable changes to the database ! /// </summary> ! public void Update() ! { ! try ! { ! this.oleDbDataAdapter.Update( this ); ! this.AcceptChanges(); ! } ! catch (Exception exception) ! { ! Console.WriteLine( exception.ToString() ); ! } ! } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:48:06
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/RangeToRange In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32718/Downloader/QuotesEditor/RangeToRange Modified Files: RangeToRangeDataGrid.cs Log Message: Implemented the confirmVisualValidation abstract method Index: RangeToRangeDataGrid.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/RangeToRange/RangeToRangeDataGrid.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RangeToRangeDataGrid.cs 21 Mar 2004 16:56:11 -0000 1.1 --- RangeToRangeDataGrid.cs 28 Mar 2004 20:36:42 -0000 1.2 *************** *** 1,9 **** using System; using QuantProject.Applications.Downloader.Validate; namespace QuantProject.Applications.Downloader { /// <summary> ! /// VisualValidationDataGrid to contain quotes with /// Range to Range suspicious ratios /// </summary> --- 1,10 ---- using System; using QuantProject.Applications.Downloader.Validate; + using QuantProject.DataAccess.Tables; namespace QuantProject.Applications.Downloader { /// <summary> ! /// VisualValidationDataGrid to contain quotes with /// Range to Range suspicious ratios /// </summary> *************** *** 14,17 **** --- 15,24 ---- this.validationWarning = ValidationWarning.SuspiciousRangeToRangeRatio; } + override protected void confirmVisualValidation( string ticker , DateTime quoteDate ) + { + // VisuallyValidatedTickers.ValidateRangeToRange( ((QuotesEditor)this.FindForm()).Ticker ); + Quotes quotes = new Quotes( ticker ); + VisuallyValidatedQuotes.ValidateRangeToRange( quotes , quoteDate ); + } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:41:23
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31058/Downloader/QuotesEditor Modified Files: QuotesEditor.cs Log Message: - added a private tickerQuotes DataTable: all validation features will work on these quotes - suspiciousRatio is provided by the ConstantProvider class now - added the Renew method to refresh the form when some visual validation is applied Index: QuotesEditor.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/QuotesEditor.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** QuotesEditor.cs 24 Mar 2004 18:25:10 -0000 1.4 --- QuotesEditor.cs 28 Mar 2004 20:30:00 -0000 1.5 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Data; using System.Drawing; using System.Collections; *************** *** 5,8 **** --- 6,10 ---- using System.Windows.Forms; using scpl; + using QuantProject.ADT; using QuantProject.ADT.Histories; using QuantProject.Data; *************** *** 16,23 **** public class QuotesEditor : System.Windows.Forms.Form { ! private double suspiciousRatio = 3; ! private ValidateDataTable validateDataTable; ! private CloseToCloseTabPage closeToCloseTabPage = new CloseToCloseTabPage(); private ValidationTabPage validationTabPage = new ValidationTabPage(); private ValidationTabControl validationTabControl = new ValidationTabControl(); --- 18,25 ---- public class QuotesEditor : System.Windows.Forms.Form { ! private DataTable tickerQuotes; private ValidateDataTable validateDataTable; ! private DataTable quotesTable; ! // private CloseToCloseTabPage closeToCloseTabPage = new CloseToCloseTabPage(); private ValidationTabPage validationTabPage = new ValidationTabPage(); private ValidationTabControl validationTabControl = new ValidationTabControl(); *************** *** 28,31 **** --- 30,40 ---- private System.Windows.Forms.TextBox textBoxTicker; private QuantProject.Applications.Downloader.QuotesChart quotesChart; + + public DataTable QuotesTable + { + get { return this.quotesTable; } + set { this.quotesTable = value; } + } + /// <summary> /// Required designer variable. *************** *** 39,46 **** this.validateDataTable = new ValidateDataTable(); } - this.validateDataTable.Clear(); this.validateDataTable.Rows.Clear(); this.validateDataTable.AddRows( this.textBoxTicker.Text , ! this.suspiciousRatio ); } --- 48,55 ---- this.validateDataTable = new ValidateDataTable(); } this.validateDataTable.Rows.Clear(); + // this.validateDataTable.Clear(); this.validateDataTable.AddRows( this.textBoxTicker.Text , ! ConstantsProvider.SuspiciousRatio ); } *************** *** 57,251 **** } ! public string Ticker ! { ! get { return this.textBoxTicker.Text; } ! } ! public QuotesEditor( string ticker ) ! { ! // ! // Required for Windows Form Designer support ! // ! InitializeComponent(); - this.tabControl1.Width = this.Width - 20; - this.tabControl1.Height = this.Height - 80; ! this.validationTabPage.Controls.Add( this.validationTabControl ); ! this.tabControl1.Controls.Add( this.validationTabPage ); ! this.textBoxTicker.Text = ticker; ! } ! /// <summary> ! /// Clean up any resources being used. ! /// </summary> ! protected override void Dispose( bool disposing ) ! { ! if( disposing ) ! { ! if(components != null) ! { ! components.Dispose(); ! } ! } ! base.Dispose( disposing ); ! } #region Windows Form Designer generated code ! /// <summary> ! /// Required method for Designer support - do not modify ! /// the contents of this method with the code editor. ! /// </summary> ! private void InitializeComponent() ! { ! this.tabControl1 = new System.Windows.Forms.TabControl(); ! this.tabPageChart = new System.Windows.Forms.TabPage(); ! this.quotesChart = new QuantProject.Applications.Downloader.QuotesChart(); ! this.tabPageQuotes = new System.Windows.Forms.TabPage(); ! this.textBoxTicker = new System.Windows.Forms.TextBox(); ! this.tabControl1.SuspendLayout(); ! this.tabPageChart.SuspendLayout(); ! this.SuspendLayout(); ! // ! // tabControl1 ! // ! this.tabControl1.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.tabPageChart, ! this.tabPageQuotes}); ! this.tabControl1.Location = new System.Drawing.Point(8, 40); ! this.tabControl1.Name = "tabControl1"; ! this.tabControl1.SelectedIndex = 0; ! this.tabControl1.Size = new System.Drawing.Size(688, 320); ! this.tabControl1.TabIndex = 0; ! // ! // tabPageChart ! // ! this.tabPageChart.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.quotesChart}); ! this.tabPageChart.Location = new System.Drawing.Point(4, 22); ! this.tabPageChart.Name = "tabPageChart"; ! this.tabPageChart.Size = new System.Drawing.Size(680, 294); ! this.tabPageChart.TabIndex = 2; ! this.tabPageChart.Text = "Chart"; ! this.tabPageChart.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageChart_Paint); ! // ! // quotesChart ! // ! this.quotesChart.AllowSelection = false; ! this.quotesChart.BackColor = System.Drawing.SystemColors.ControlLightLight; ! this.quotesChart.HorizontalEdgeLegendPlacement = scpl.Legend.Placement.Inside; ! this.quotesChart.LegendBorderStyle = scpl.Legend.BorderType.Shadow; ! this.quotesChart.LegendXOffset = 10F; ! this.quotesChart.LegendYOffset = 1F; ! this.quotesChart.Location = new System.Drawing.Point(8, 8); ! this.quotesChart.Name = "quotesChart"; ! this.quotesChart.Padding = 10; ! this.quotesChart.PlotBackColor = System.Drawing.Color.White; ! this.quotesChart.ShowLegend = false; ! this.quotesChart.Size = new System.Drawing.Size(664, 288); ! this.quotesChart.TabIndex = 0; ! this.quotesChart.Ticker = null; ! this.quotesChart.Title = ""; ! this.quotesChart.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); ! this.quotesChart.VerticalEdgeLegendPlacement = scpl.Legend.Placement.Outside; ! this.quotesChart.XAxis1 = null; ! this.quotesChart.XAxis2 = null; ! this.quotesChart.YAxis1 = null; ! this.quotesChart.YAxis2 = null; ! // ! // tabPageQuotes ! // ! this.tabPageQuotes.Location = new System.Drawing.Point(4, 22); ! this.tabPageQuotes.Name = "tabPageQuotes"; ! this.tabPageQuotes.Size = new System.Drawing.Size(680, 294); ! this.tabPageQuotes.TabIndex = 0; ! this.tabPageQuotes.Text = "Quotes"; ! this.tabPageQuotes.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageChart_Paint); ! // ! // textBoxTicker ! // ! this.textBoxTicker.Location = new System.Drawing.Point(288, 8); ! this.textBoxTicker.Name = "textBoxTicker"; ! this.textBoxTicker.TabIndex = 1; ! this.textBoxTicker.Text = "CCE"; ! this.textBoxTicker.Leave += new System.EventHandler(this.textBoxTicker_Leave); ! // ! // QuotesEditor ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(736, 373); ! this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.textBoxTicker, ! this.tabControl1}); ! this.Name = "QuotesEditor"; ! this.Text = "QuotesEditor"; ! this.tabControl1.ResumeLayout(false); ! this.tabPageChart.ResumeLayout(false); ! this.ResumeLayout(false); ! } #endregion #region tabPageChart ! private void tabPageChart_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! this.quotesChart.Ticker = this.textBoxTicker.Text; this.quotesChart.Invalidate(); ! // quotesChart.PaintingHandler( this.textBoxTicker.Text ); ! } #endregion #region tabPageValidation ! private void tabPageValidation_Click(object sender, System.EventArgs e) ! { ! this.validateDataTable.Rows.Clear(); ! this.validateDataTable.AddRows( this.textBoxTicker.Text , this.suspiciousRatio ); ! // this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! // this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; ! } #endregion #region tabPageOHLC ! private void tabPageOHLC_Click(object sender, System.EventArgs e) ! { ! } ! private void tabPageOHLC_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! // this.openHighLowCloseDataGrid.DataBind( this.validateDataTable ); ! } #endregion ! private void openHighLowCloseUserControl_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! // this.openHighLowCloseUserControl.PaintingHandler(); ! } ! private void tabPageCloseToClose_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! // this.closeToCloseUserControl.PaintingHandler(); ! } ! private void tabPageValidation_Enter(object sender, System.EventArgs e) ! { ! this.validateDataTable.Rows.Clear(); ! this.validateDataTable.AddRows( this.textBoxTicker.Text , this.suspiciousRatio ); ! // this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! // this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; ! } ! private void tabControl1_SelectedIndexChanged(object sender, System.EventArgs e) ! { ! if ( this.tabControl1.SelectedIndex == 2 ) ! { ! // this.validateDataTable.Rows.Clear(); ! // this.validateDataTable.AddRows( this.textBoxTicker.Text , this.suspiciousRatio ); ! // this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! // this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; ! } ! } private void textBoxTicker_Leave(object sender, System.EventArgs e) --- 66,259 ---- } ! public string Ticker ! { ! get { return this.textBoxTicker.Text; } ! } ! public QuotesEditor( string ticker ) ! { ! // ! // Required for Windows Form Designer support ! // ! InitializeComponent(); + this.addQuotesChart(); ! this.tabControl1.Width = this.Width - 20; ! this.tabControl1.Height = this.Height - 80; ! this.validationTabPage.Controls.Add( this.validationTabControl ); ! this.tabControl1.Controls.Add( this.validationTabPage ); ! this.textBoxTicker.Text = ticker; ! } ! ! private void addQuotesChart() ! { ! this.quotesChart = new QuotesChart(); ! this.quotesChart.Dock = DockStyle.Fill; ! this.tabPageChart.Controls.Add( this.quotesChart ); ! } ! ! /// <summary> ! /// populates the datatable for ticker quotes ! /// </summary> ! private void getTickerQuotes() ! { ! this.tickerQuotes = DataProvider.GetTickerQuotes( this.textBoxTicker.Text ); ! } ! ! /// <summary> ! /// rebuilds and redisplays the QuotesEditor ! /// </summary> ! public void Renew() ! { ! getTickerQuotes(); ! this.validationTabControl.Clear(); ! this.updateValidateDataTable(); ! // this.closeToCloseTabPage.Clear(); ! base.Invalidate(); ! } ! /// <summary> ! /// Clean up any resources being used. ! /// </summary> ! protected override void Dispose( bool disposing ) ! { ! if( disposing ) ! { ! if(components != null) ! { ! components.Dispose(); ! } ! } ! base.Dispose( disposing ); ! } #region Windows Form Designer generated code ! /// <summary> ! /// Required method for Designer support - do not modify ! /// the contents of this method with the code editor. ! /// </summary> ! private void InitializeComponent() ! { ! this.tabControl1 = new System.Windows.Forms.TabControl(); ! this.tabPageChart = new System.Windows.Forms.TabPage(); ! this.tabPageQuotes = new System.Windows.Forms.TabPage(); ! this.textBoxTicker = new System.Windows.Forms.TextBox(); ! this.tabControl1.SuspendLayout(); ! this.SuspendLayout(); ! // ! // tabControl1 ! // ! this.tabControl1.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.tabPageChart, ! this.tabPageQuotes}); ! this.tabControl1.Location = new System.Drawing.Point(8, 40); ! this.tabControl1.Name = "tabControl1"; ! this.tabControl1.SelectedIndex = 0; ! this.tabControl1.Size = new System.Drawing.Size(688, 320); ! this.tabControl1.TabIndex = 0; ! // ! // tabPageChart ! // ! this.tabPageChart.Location = new System.Drawing.Point(4, 22); ! this.tabPageChart.Name = "tabPageChart"; ! this.tabPageChart.Size = new System.Drawing.Size(680, 294); ! this.tabPageChart.TabIndex = 2; ! this.tabPageChart.Text = "Chart"; ! this.tabPageChart.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageChart_Paint); ! // ! // tabPageQuotes ! // ! this.tabPageQuotes.Location = new System.Drawing.Point(4, 22); ! this.tabPageQuotes.Name = "tabPageQuotes"; ! this.tabPageQuotes.Size = new System.Drawing.Size(680, 294); ! this.tabPageQuotes.TabIndex = 0; ! this.tabPageQuotes.Text = "Quotes"; ! this.tabPageQuotes.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageChart_Paint); ! // ! // textBoxTicker ! // ! this.textBoxTicker.Location = new System.Drawing.Point(288, 8); ! this.textBoxTicker.Name = "textBoxTicker"; ! this.textBoxTicker.TabIndex = 1; ! this.textBoxTicker.Text = "CCE"; ! this.textBoxTicker.Leave += new System.EventHandler(this.textBoxTicker_Leave); ! // ! // QuotesEditor ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(736, 373); ! this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.textBoxTicker, ! this.tabControl1}); ! this.Name = "QuotesEditor"; ! this.Text = "QuotesEditor"; ! this.tabControl1.ResumeLayout(false); ! this.ResumeLayout(false); ! } #endregion #region tabPageChart ! private void tabPageChart_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! this.quotesChart.Ticker = this.textBoxTicker.Text; this.quotesChart.Invalidate(); ! // quotesChart.PaintingHandler( this.textBoxTicker.Text ); ! } #endregion #region tabPageValidation ! private void tabPageValidation_Click(object sender, System.EventArgs e) ! { ! this.validateDataTable.Rows.Clear(); ! this.validateDataTable.AddRows( this.textBoxTicker.Text , ConstantsProvider.SuspiciousRatio ); ! // this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! // this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; ! } #endregion #region tabPageOHLC ! private void tabPageOHLC_Click(object sender, System.EventArgs e) ! { ! } ! private void tabPageOHLC_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! // this.openHighLowCloseDataGrid.DataBind( this.validateDataTable ); ! } #endregion ! private void openHighLowCloseUserControl_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! // this.openHighLowCloseUserControl.PaintingHandler(); ! } ! private void tabPageCloseToClose_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! // this.closeToCloseUserControl.PaintingHandler(); ! } ! private void tabPageValidation_Enter(object sender, System.EventArgs e) ! { ! this.validateDataTable.Rows.Clear(); ! this.validateDataTable.AddRows( this.textBoxTicker.Text , ConstantsProvider.SuspiciousRatio ); ! // this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! // this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; ! } ! private void tabControl1_SelectedIndexChanged(object sender, System.EventArgs e) ! { ! if ( this.tabControl1.SelectedIndex == 2 ) ! { ! // this.validateDataTable.Rows.Clear(); ! // this.validateDataTable.AddRows( this.textBoxTicker.Text , this.suspiciousRatio ); ! // this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! // this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; ! } ! } private void textBoxTicker_Leave(object sender, System.EventArgs e) |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:32:07
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29277/Downloader/QuotesEditor Modified Files: QuotesChart.cs Log Message: Now it is better docked to parent control Index: QuotesChart.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/QuotesChart.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QuotesChart.cs 21 Mar 2004 16:30:53 -0000 1.2 --- QuotesChart.cs 28 Mar 2004 20:20:44 -0000 1.3 *************** *** 56,60 **** this.Clear(); this.Add( DataProvider.GetCloseHistory( this.ticker ) ); - this.Width = this.Parent.Width - 15; base.OnPaint( e ); } --- 56,59 ---- |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:30:30
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/CloseToClose In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28859/Downloader/QuotesEditor/CloseToClose Modified Files: CloseToCloseChart.cs Log Message: ConstantsProvider.PrecedingDaysForVisualValidation is used instead of the 20 constant Index: CloseToCloseChart.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/CloseToClose/CloseToCloseChart.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CloseToCloseChart.cs 21 Mar 2004 17:00:53 -0000 1.2 --- CloseToCloseChart.cs 28 Mar 2004 20:19:07 -0000 1.3 *************** *** 24,27 **** --- 24,28 ---- using scpl; using scpl.Windows; + using QuantProject.ADT; using QuantProject.ADT.Histories; using QuantProject.Data; *************** *** 66,72 **** { this.startDateTime = (DateTime) this.history.GetKey( Math.Max( 0 , ! this.history.IndexOfKeyOrPrevious( this.suspiciousDateTime ) - 20 ) ); this.endDateTime = (DateTime) this.history.GetKey( Math.Min( this.history.Count - 1 , ! this.history.IndexOfKeyOrPrevious( this.suspiciousDateTime ) ) + 20 ); } protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) --- 67,75 ---- { this.startDateTime = (DateTime) this.history.GetKey( Math.Max( 0 , ! this.history.IndexOfKeyOrPrevious( this.suspiciousDateTime ) - ! ConstantsProvider.PrecedingDaysForVisualValidation ) ); this.endDateTime = (DateTime) this.history.GetKey( Math.Min( this.history.Count - 1 , ! this.history.IndexOfKeyOrPrevious( this.suspiciousDateTime ) ) + ! ConstantsProvider.PrecedingDaysForVisualValidation ); } protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:28:44
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28470 Modified Files: QuantProject.suo Log Message: no message Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 Binary files /tmp/cvsmHY4Kz and /tmp/cvsJemqbL differ |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:27:25
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28287/b2_DataAccess Modified Files: b2_DataAccess.csproj Log Message: - added the ValidationTypes class - added the VisuallyValidatedQuotes class Index: b2_DataAccess.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/b2_DataAccess.csproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** b2_DataAccess.csproj 21 Mar 2004 16:17:31 -0000 1.5 --- b2_DataAccess.csproj 28 Mar 2004 20:16:03 -0000 1.6 *************** *** 128,131 **** --- 128,136 ---- /> <File + RelPath = "ValidationTypes.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Tables\Quotes.cs" SubType = "Code" *************** *** 133,136 **** --- 138,146 ---- /> <File + RelPath = "Tables\VisuallyValidatedQuotes.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Tables\VisuallyValidatedTickers.cs" SubType = "Code" |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:23:42
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27476/b1_ADT Modified Files: b1_ADT.csproj Log Message: Added the ConstantsProvider class Index: b1_ADT.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/b1_ADT.csproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** b1_ADT.csproj 21 Mar 2004 16:18:41 -0000 1.5 --- b1_ADT.csproj 28 Mar 2004 20:12:16 -0000 1.6 *************** *** 93,96 **** --- 93,101 ---- /> <File + RelPath = "ConstantsProvider.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "ExtendedDateTime.cs" SubType = "Code" |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:21:27
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26783/b2_DataAccess/Tables Added Files: VisuallyValidatedQuotes.cs Log Message: Class to access the visuallyValidatedQuotes table --- NEW FILE: VisuallyValidatedQuotes.cs --- using System; using System.Data; using QuantProject.ADT; using QuantProject.DataAccess; namespace QuantProject.DataAccess.Tables { /// <summary> /// Class to access the visuallyValidatedQuotes table /// </summary> public class VisuallyValidatedQuotes { public VisuallyValidatedQuotes() { // // TODO: Add constructor logic here // } /// <summary> /// writes to the database the visual validation of the Close to Close suspicious ratios /// </summary> /// <param name="quotes">contains all the quotes for the ticker to be validated</param> /// <param name="quoteDate">date to be validated</param> public static void ValidateRangeToRange( Quotes quotes , DateTime quoteDate ) { try { SqlExecutor.ExecuteNonQuery( "delete * from visuallyValidatedQuotes where " + "vvTicker='" + quotes.Ticker + "' and " + "vvDate=" + SQLBuilder.GetDateConstant( quoteDate ) ); OleDbSingleTableAdapter oleDbSingleTableAdapter = new OleDbSingleTableAdapter( "select * from visuallyValidatedQuotes where 1=2" ); string hashValue = quotes.GetHashValue( quotes.GetPrecedingDate( quoteDate , ConstantsProvider.PrecedingDaysForVisualValidation ) , quotes.GetFollowingDate( quoteDate , ConstantsProvider.PrecedingDaysForVisualValidation ) ); oleDbSingleTableAdapter.DataTable.Rows.Add( oleDbSingleTableAdapter.DataTable.NewRow() ); oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvTicker" ] = quotes.Ticker; oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvDate" ] = quoteDate; oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvValidationType" ] = ValidationTypes.RangeToRangeRatio; oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvHashValue" ] = hashValue; oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvEditDate" ] = DateTime.Now; oleDbSingleTableAdapter.OleDbDataAdapter.Update( oleDbSingleTableAdapter.DataTable ); } catch ( Exception ex ) { string exceptionMessage = ex.Message + "\n" + ex.StackTrace; Console.WriteLine( exceptionMessage ); } } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:19:49
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26317/b2_DataAccess Added Files: ValidationTypes.cs Log Message: Types of visual validations --- NEW FILE: ValidationTypes.cs --- using System; namespace QuantProject.DataAccess { /// <summary> /// Types of visual validations /// </summary> public enum ValidationTypes { CloseToCloseRatio = 1 , RangeToRangeRatio = 2 } } |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:18:12
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25946/b1_ADT Added Files: ConstantsProvider.cs Log Message: Provides constants to be used by the whole application --- NEW FILE: ConstantsProvider.cs --- using System; namespace QuantProject.ADT { /// <summary> /// Provides constants to be used by the whole application /// </summary> public class ConstantsProvider { public ConstantsProvider() { // // TODO: Add constructor logic here // } public static int SuspiciousRatio = 3; public static int PrecedingDaysForVisualValidation = 20; } } |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:15:20
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25296/b2_DataAccess Modified Files: DataBaseVersionManager.cs Log Message: - added the visuallyValidatedQuotes table - removed the visuallyValidatedTickers table Index: DataBaseVersionManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DataBaseVersionManager.cs 21 Mar 2004 16:15:56 -0000 1.9 --- DataBaseVersionManager.cs 28 Mar 2004 20:03:57 -0000 1.10 *************** *** 100,106 **** "quOpen REAL, quHigh REAL, quLow REAL, quClose REAL, " + "quVolume INTEGER, quAdjustedClose REAL, quAdjustedCloseToCloseRatio FLOAT)"); - // table where to store the time period for which tickers' quotes have been validated - this.executeCommand("CREATE TABLE validatedTickers " + - "( vtTicker TEXT(8) , vtStartDate DATETIME , vtEndDate DATETIME , vtDate DATETIME)"); // table of groups where you can collect tickers. // Groups are used to simplify operations like: --- 100,103 ---- *************** *** 118,136 **** "( vtTicker TEXT(8) , vtStartDate DATETIME , vtEndDate DATETIME , vtEditDate DATETIME, " + "CONSTRAINT myKey PRIMARY KEY ( vtTicker ) )" ); ! // visuallyValidatedTickers will contain a record for each ticker whose ! // quotes with suspicious ratios have been validated. // Field list: ! // vvTicker: validated ticker ! // vvStartDate: starting date of the time span being visually validated ! // vvEndDate: ending date of the time span being visually validated // vvHashValue: hash value for the visually validated quotes ! // vvCloseToCloseRatio: the close to close ratio has been checked to be acceptable ! // vvRangeToRangeRatio: the High-Low range ratio has been checked to be acceptable ! // vvDate: Last date this record has been added/modified ! this.executeCommand( "CREATE TABLE visuallyValidatedTickers " + ! "( vvTicker TEXT(8) , vvStartDate DATETIME , vvEndDate DATETIME , " + ! "vvHashValue TEXT(50) , vvEditDate DATETIME, " + ! "vvCloseToCloseRatio BIT , vvRangeToRangeRatio BIT , " + ! "CONSTRAINT myKey PRIMARY KEY ( vvTicker ) )" ); // quotesFromSecondarySources will contain quotes coming from sources different // from the main one. It will be used for confirming and thus validation purposes. --- 115,130 ---- "( vtTicker TEXT(8) , vtStartDate DATETIME , vtEndDate DATETIME , vtEditDate DATETIME, " + "CONSTRAINT myKey PRIMARY KEY ( vtTicker ) )" ); ! // visuallyValidatedQuotes will contain a record for each ! // quote with suspicious ratio that has been validated. // Field list: ! // vvTicker: validated ticker ! // vvDate: validated quote date ! // vvValidationType: 1 = close to close ratio ; 2 = range to range ratio // vvHashValue: hash value for the visually validated quotes ! // vvEditDate: Last date this record has been added/modified ! this.executeCommand( "CREATE TABLE visuallyValidatedQuotes " + ! "( vvTicker TEXT(8) , vvDate DATETIME , vvValidationType INT , " + ! "vvHashValue TEXT(50) , vvEditDate DATETIME , " + ! "CONSTRAINT myKey PRIMARY KEY ( vvTicker , vvDate , vvValidationType ) )" ); // quotesFromSecondarySources will contain quotes coming from sources different // from the main one. It will be used for confirming and thus validation purposes. *************** *** 185,188 **** --- 179,183 ---- { this.executeCommand("DROP TABLE version"); + this.executeCommand("DROP TABLE visuallyValidatedTickers"); } private void executeCommand(string commandToBeExecuted) |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:13:11
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24948/b3_Data Modified Files: DataProvider.cs Log Message: The static method GetTickerQuotes has been added Index: DataProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProvider.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DataProvider.cs 21 Mar 2004 16:13:58 -0000 1.3 --- DataProvider.cs 28 Mar 2004 20:01:45 -0000 1.4 *************** *** 23,29 **** --- 23,31 ---- using System; using System.Collections; + using System.Data; using QuantProject.ADT; using QuantProject.ADT.Histories; using QuantProject.DataAccess; + using QuantProject.DataAccess.Tables; namespace QuantProject.Data *************** *** 133,136 **** --- 135,148 ---- ).IndexOfKeyOrPrevious( extendedDateTime.DateTime ) ) ); } + + /// <summary> + /// returns the quotes DataTable for the given ticker + /// </summary> + /// <param name="instrumentKey">ticker whose quotes are to be returned</param> + /// <returns></returns> + public static DataTable GetTickerQuotes( string instrumentKey ) + { + return Quotes.GetTickerQuotes( instrumentKey ); + } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:07:16
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24079/b2_DataAccess/Tables Modified Files: Quotes.cs Log Message: - now the constructor populates a private DataTable with quotes for a single ticker - most static methods have been changed to instance methods - added the Ticker read only property - the GetHashValue (non static now) has been changed to work on the private DataTable, rather than on the DataBase quotes (the reason is that the user is meant to validate the values it actully looks at, and to avoid to validate DataBase quotes that may have changed in the meanwhile) - GetHasValue has been overloaded to get the has value for a specific date range - added the GetPrecedingDate to return the date that comes a specific number of days before the argument date - added the GetFollowingDate to return the date that comes a specific number of days after the argument date Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Quotes.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Quotes.cs 18 Mar 2004 22:37:22 -0000 1.1 --- Quotes.cs 28 Mar 2004 19:55:54 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- using System.Text; using QuantProject.ADT; + using QuantProject.ADT.Histories; namespace QuantProject.DataAccess.Tables *************** *** 11,19 **** public class Quotes { ! public Quotes() { ! // ! // TODO: Add constructor logic here ! // } /// <summary> --- 12,29 ---- public class Quotes { ! private DataTable quotes; ! ! /// <summary> ! /// Gets the ticker whose quotes are contained into the Quotes object ! /// </summary> ! /// <returns></returns> ! public string Ticker { ! get{ return ((string)this.quotes.Rows[ 0 ][ "quTicker" ]); } ! } ! ! public Quotes( string ticker) ! { ! this.quotes = Quotes.GetTickerQuotes( ticker ); } /// <summary> *************** *** 40,44 **** } #region GetHashValue ! private static string getHashValue_getQuoteString_getRowString_getSingleValueString( Object value ) { string returnValue; --- 50,54 ---- } #region GetHashValue ! private string getHashValue_getQuoteString_getRowString_getSingleValueString( Object value ) { string returnValue; *************** *** 60,73 **** /// <param name="dataRow"></param> /// <returns></returns> ! private static StringBuilder getHashValue_getQuoteString_getRowString( DataRow dataRow ) { StringBuilder returnValue = new StringBuilder( "" ); ! foreach ( DataColumn dataColumn in dataRow.Table.Columns ) if ( dataColumn.ColumnName != "quTicker" ) returnValue.Append( getHashValue_getQuoteString_getRowString_getSingleValueString( ! dataRow[ dataColumn ] ) ); // returnValue += "ggg"; ! // returnValue += getHashValue_getQuoteString_getRowString_getSingleValueString( ! // dataRow[ dataColumn ] ); return returnValue; } --- 70,83 ---- /// <param name="dataRow"></param> /// <returns></returns> ! private StringBuilder getHashValue_getQuoteString_getRowString( DataRowView dataRow ) { StringBuilder returnValue = new StringBuilder( "" ); ! foreach ( DataColumn dataColumn in dataRow.DataView.Table.Columns ) if ( dataColumn.ColumnName != "quTicker" ) returnValue.Append( getHashValue_getQuoteString_getRowString_getSingleValueString( ! dataRow[ dataColumn.Ordinal ] ) ); // returnValue += "ggg"; ! // returnValue += getHashValue_getQuoteString_getRowString_getSingleValueString( ! // dataRow[ dataColumn ] ); return returnValue; } *************** *** 77,99 **** /// <param name="ticker"></param> /// <returns></returns> ! private static string getHashValue_getQuoteString( string ticker ) { StringBuilder returnValue = new StringBuilder( "" ); ! DataTable dataTable = SqlExecutor.GetDataTable( ! "select * from quotes where quTicker='" + ticker + "'" ); ! foreach ( DataRow dataRow in dataTable.Rows ) returnValue.Append( getHashValue_getQuoteString_getRowString( dataRow ) ); return returnValue.ToString(); } /// <summary> /// Computes the hash value for the quotes for the given ticker /// </summary> /// <param name="ticker">Ticker whose quotes must be hashed</param> /// <returns>Hash value for all the quotes for the given ticker</returns> ! public static string GetHashValue( string ticker ) { ! return HashProvider.GetHashValue( getHashValue_getQuoteString( ticker ) ); } - #endregion } } --- 87,175 ---- /// <param name="ticker"></param> /// <returns></returns> ! private string getHashValue_getQuoteString( DataView quotes ) { StringBuilder returnValue = new StringBuilder( "" ); ! foreach ( DataRowView dataRow in quotes ) returnValue.Append( getHashValue_getQuoteString_getRowString( dataRow ) ); return returnValue.ToString(); } /// <summary> + /// Computes the hash value for the contained quotes + /// </summary> + /// <returns>Hash value for all the quotes</returns> + public string GetHashValue() + { + DataView quotes = new DataView( this.quotes ); + return HashProvider.GetHashValue( getHashValue_getQuoteString( quotes ) ); + } + /// <summary> + /// Computes the hash value for the contained quotes + /// since startDate, to endDate + /// </summary> + /// <param name="startDate">date where hash begins being computed</param> + /// <param name="endDate">date where hash ends being computed</param> + /// <returns></returns> + public string GetHashValue( DateTime startDate , DateTime endDate ) + { + DataView quotes = new DataView( this.quotes ); + quotes.RowFilter = "( (quDate>=" + SQLBuilder.GetDateConstant( startDate ) + + ") and (quDate<=" + SQLBuilder.GetDateConstant( endDate ) + ") )"; + return HashProvider.GetHashValue( getHashValue_getQuoteString( quotes ) ); + } + #endregion + + /// <summary> /// Computes the hash value for the quotes for the given ticker /// </summary> /// <param name="ticker">Ticker whose quotes must be hashed</param> /// <returns>Hash value for all the quotes for the given ticker</returns> ! // public static string GetHashValue( string ticker ) ! // { ! // return HashProvider.GetHashValue( GetHashValue( GetTickerQuotes( ticker ) ) ); ! // } ! ! /// <summary> ! /// returns the quotes DataTable for the given ticker ! /// </summary> ! /// <param name="instrumentKey">ticker whose quotes are to be returned</param> ! /// <returns></returns> ! public static DataTable GetTickerQuotes( string instrumentKey ) { ! string sql = "select * from quotes where quTicker='" + instrumentKey + "' " + ! "order by quDate"; ! return SqlExecutor.GetDataTable( sql ); ! } ! ! /// <summary> ! /// returns the Date for the quote that is precedingDays before ! /// quoteDate ! /// </summary> ! /// <param name="quoteDate"></param> ! /// <param name="precedingDays"></param> ! /// <returns></returns> ! public DateTime GetPrecedingDate( DateTime quoteDate , int precedingDays ) ! { ! History history = new History(); ! history.Import( this.quotes , "quDate" , "quAdjustedClose" ); ! return (DateTime) history.GetKey( Math.Max( 0 , ! history.IndexOfKeyOrPrevious( quoteDate ) - ! precedingDays ) ); ! } ! ! /// <summary> ! /// returns the Date for the quote that is followingDays after ! /// quoteDate ! /// </summary> ! /// <param name="quoteDate"></param> ! /// <param name="precedingDays"></param> ! /// <returns></returns> ! public DateTime GetFollowingDate( DateTime quoteDate , int followingDays ) ! { ! History history = new History(); ! history.Import( this.quotes , "quDate" , "quAdjustedClose" ); ! return (DateTime) history.GetKey( Math.Max( 0 , ! history.IndexOfKeyOrPrevious( quoteDate ) - ! followingDays ) ); } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-28 19:56:45
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22134/b2_DataAccess/Tables Modified Files: VisuallyValidatedTickers.cs Log Message: Updated, but it is going to be removed, because the visuallyValidatedTickers table has been removed from the database Index: VisuallyValidatedTickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/VisuallyValidatedTickers.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VisuallyValidatedTickers.cs 21 Mar 2004 16:09:38 -0000 1.1 --- VisuallyValidatedTickers.cs 28 Mar 2004 19:45:23 -0000 1.2 *************** *** 1,4 **** --- 1,5 ---- using System; using System.Data; + using QuantProject.ADT; using QuantProject.DataAccess; *************** *** 31,37 **** try { OleDbSingleTableAdapter oleDbSingleTableAdapter = new OleDbSingleTableAdapter( "select * from visuallyValidatedTickers where vvTicker='" + ticker + "'" ); ! string hashValue = Quotes.GetHashValue( ticker ); if ( oleDbSingleTableAdapter.DataTable.Rows.Count == 0 ) // this ticker was not visually validated yet --- 32,39 ---- try { + Quotes quotes = new Quotes( ticker ); OleDbSingleTableAdapter oleDbSingleTableAdapter = new OleDbSingleTableAdapter( "select * from visuallyValidatedTickers where vvTicker='" + ticker + "'" ); ! string hashValue = quotes.GetHashValue(); if ( oleDbSingleTableAdapter.DataTable.Rows.Count == 0 ) // this ticker was not visually validated yet *************** *** 41,47 **** ( (string)oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvHashValue" ] != hashValue ) ) // this ticker was visually already validated, but with different values ! oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvRangeToRangeRatio" ] = true; oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvTicker" ] = ticker; ! oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvStartDate" ] = Quotes.GetStartDate( ticker ); oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvEndDate" ] = --- 43,49 ---- ( (string)oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvHashValue" ] != hashValue ) ) // this ticker was visually already validated, but with different values ! oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvRangeToRangeRatio" ] = false; oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvTicker" ] = ticker; ! oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvStartDate" ] = Quotes.GetStartDate( ticker ); oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvEndDate" ] = *************** *** 57,60 **** --- 59,101 ---- } } + /// <summary> + /// Writes to the database the visual validation of the Range to Range suspicious ratios + /// </summary> + /// <param name="ticker">ticker to be validated</param> + /// <param name="ticker">quoteDate to be validated</param> + public static void ValidateRangeToRange( string ticker , DateTime quoteDate) + { + try + { + Quotes quotes = new Quotes( ticker ); + OleDbSingleTableAdapter oleDbSingleTableAdapter = + new OleDbSingleTableAdapter( "select * from visuallyValidatedTickers where vvTicker='" + + ticker + "'" ); + string hashValue = quotes.GetHashValue( + quotes.GetPrecedingDate( quoteDate , ConstantsProvider.PrecedingDaysForVisualValidation ) , + quotes.GetFollowingDate( quoteDate , ConstantsProvider.PrecedingDaysForVisualValidation ) ); + if ( oleDbSingleTableAdapter.DataTable.Rows.Count == 0 ) + // this ticker was not visually validated yet + oleDbSingleTableAdapter.DataTable.Rows.Add( oleDbSingleTableAdapter.DataTable.NewRow() ); + else if ( ( (DateTime)oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvEndDate" ] != Quotes.GetEndDate( ticker ) ) || + ( (DateTime)oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvEndDate" ] != Quotes.GetEndDate( ticker ) ) || + ( (string)oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvHashValue" ] != hashValue ) ) + // this ticker was visually already validated, but with different values + oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvCloseToCloseRatio" ] = false; + oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvTicker" ] = ticker; + oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvStartDate" ] = + Quotes.GetStartDate( ticker ); + oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvEndDate" ] = + Quotes.GetEndDate( ticker ); + oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvHashValue" ] = hashValue; + oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvRangeToRangeRatio" ] = true; + oleDbSingleTableAdapter.OleDbDataAdapter.Update( oleDbSingleTableAdapter.DataTable ); + } + catch ( Exception ex ) + { + string exceptionMessage = ex.Message + "\n" + ex.StackTrace; + Console.WriteLine( exceptionMessage ); + } + } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-24 18:40:31
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25919/Downloader Modified Files: Downloader.csproj Log Message: Added the range to range validator Index: Downloader.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Downloader.csproj,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Downloader.csproj 21 Mar 2004 17:05:45 -0000 1.13 --- Downloader.csproj 24 Mar 2004 18:29:51 -0000 1.14 *************** *** 405,408 **** --- 405,413 ---- BuildAction = "Compile" /> + <File + RelPath = "Validate\Validators\RangeToRangeValidator.cs" + SubType = "Code" + BuildAction = "Compile" + /> </Include> </Files> |
|
From: Glauco S. <gla...@us...> - 2004-03-24 18:40:31
|
Update of /cvsroot/quantproject/QuantDownloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25919 Modified Files: QuantDownloader.suo Log Message: Added the range to range validator Index: QuantDownloader.suo =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/QuantDownloader.suo,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 Binary files /tmp/cvsmPQhfR and /tmp/cvss2UIVL differ |
|
From: Glauco S. <gla...@us...> - 2004-03-24 18:38:32
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate/Validators In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25476/Downloader/Validate/Validators Added Files: RangeToRangeValidator.cs Log Message: Searches for range to range divergences --- NEW FILE: RangeToRangeValidator.cs --- using System; using System.Data; using QuantProject.ADT.Histories; using QuantProject.Applications.Downloader.Validate; namespace QuantProject.Applications.Downloader.Validate.Validators { /// <summary> /// Searches for range to range divergences /// </summary> public class RangeToRangeValidator : IValidator { private DataTable dataTableToBeValidated; private double suspiciousRatio = 3; public double SuspiciousRatio { get { return this.suspiciousRatio; } set { this.suspiciousRatio = value; } } public RangeToRangeValidator() { // // TODO: Add constructor logic here // } public event SuspiciousDataRowEventHandler SuspiciousDataRow; #region "Validate" private int validate_currentTicker_set_rangeToRange( string currentTicker , int currentTickerStartingRowIndex , History rangeToRange ) { rangeToRange.Clear(); int localCurrentRowIndex = currentTickerStartingRowIndex + 1; rangeToRange.Add( this.dataTableToBeValidated.Rows[ currentTickerStartingRowIndex ][ "quDate" ] , null ); while ( ( localCurrentRowIndex < this.dataTableToBeValidated.Rows.Count ) && ( (string)this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quTicker" ] == currentTicker ) ) { double currentRange = ( Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quHigh" ] ) - Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quLow" ] ) ) * Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quAdjustedClose" ] ) / Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quClose" ] ); // double previousRange = // ( Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex - 1 ][ "quHigh" ] ) - // Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex - 1 ][ "quLow" ] ) ) * // Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex - 1 ][ "quAdjustedClose" ] ) / // Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex - 1 ][ "quClose" ] ); // rangeToRange.Add( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quDate" ] , // currentRange - previousRange ); rangeToRange.Add( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quDate" ] , currentRange ); localCurrentRowIndex++; } return localCurrentRowIndex; } private void validate_currentTicker_withHistories_validateRow( DataRow quoteRow , double currentValue , double averageValue ) { if ( Math.Abs( currentValue / averageValue ) > this.suspiciousRatio ) // the current close to close value is suspiciously larger // than the average close to close ratio this.SuspiciousDataRow( this , new SuspiciousDataRowEventArgs( quoteRow , ValidationWarning.SuspiciousRangeToRangeRatio ) ); } private void validate_currentTicker_withHistories( History rangeToRange , History rangeToRangeMovingAverage , int currentTickerStartingRowIndex , int nextTickerStartingRowIndex ) { for (int i = currentTickerStartingRowIndex ; i < nextTickerStartingRowIndex ; i++ ) if ( rangeToRangeMovingAverage.GetByIndex( i - currentTickerStartingRowIndex ) != null ) try { // validate_currentTicker_withHistories_validateRow( // this.dataTableToBeValidated.Rows[ i ] , // (double)rangeToRange.GetByIndex( i - currentTickerStartingRowIndex ) , // (double)rangeToRangeMovingAverage.GetByIndex( i - currentTickerStartingRowIndex ) ); validate_currentTicker_withHistories_validateRow( this.dataTableToBeValidated.Rows[ i ] , Convert.ToDouble(rangeToRange.GetByIndex( i - currentTickerStartingRowIndex )) , (double)(rangeToRangeMovingAverage.GetByIndex( i - currentTickerStartingRowIndex )) ); } catch (Exception ex) { Console.WriteLine( ex.ToString() ); } } private int validate_currentTicker( string currentTicker , int currentTickerStartingRowIndex ) { History rangeToRange = new History(); History rangeToRangeMovingAverage; int nextTickerStartingRowIndex = validate_currentTicker_set_rangeToRange( currentTicker , currentTickerStartingRowIndex , rangeToRange ); rangeToRangeMovingAverage = rangeToRange.GetSimpleMovingAverage( 20 ); validate_currentTicker_withHistories( rangeToRange , rangeToRangeMovingAverage , currentTickerStartingRowIndex , nextTickerStartingRowIndex ); return nextTickerStartingRowIndex; } /// <summary> /// Validates range to range divergencies /// </summary> /// <param name="dataTableToBeValidated">Quote rows to be validated</param> public void Validate( DataTable dataTableToBeValidated ) { int currentRowIndex = 0; string currentTicker; this.dataTableToBeValidated = dataTableToBeValidated; while ( currentRowIndex < dataTableToBeValidated.Rows.Count ) { currentTicker = (string)this.dataTableToBeValidated.Rows[ currentRowIndex ][ "quTicker" ]; currentRowIndex = validate_currentTicker( currentTicker , currentRowIndex ); } } #endregion } } |
|
From: Glauco S. <gla...@us...> - 2004-03-24 18:37:20
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate/Validators In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25249/Downloader/Validate/Validators Modified Files: MultiValidator.cs Log Message: added the range to range validation Index: MultiValidator.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/Validators/MultiValidator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MultiValidator.cs 16 Dec 2003 16:27:28 -0000 1.1 --- MultiValidator.cs 24 Mar 2004 18:26:39 -0000 1.2 *************** *** 44,60 **** oHLCvalidator.Validate( dataTable ); } ! /// <summary> ! /// Validates the Close to Close differencies ! /// </summary> ! /// <param name="dataTable">Quote rows to be validated</param> ! private void validate_CloseToClose( DataTable dataTable ) ! { ! CloseToCloseValidator closeToCloseValidator = new CloseToCloseValidator(); ! closeToCloseValidator.SuspiciousRatio = this.suspiciousRatio; ! closeToCloseValidator.SuspiciousDataRow += ! new SuspiciousDataRowEventHandler( suspiciousDataRowHandler ); ! closeToCloseValidator.Validate( dataTable ); ! } ! /// <summary> /// Validates the quotes rows /// </summary> --- 44,72 ---- oHLCvalidator.Validate( dataTable ); } ! /// <summary> ! /// Validates the Close to Close differencies ! /// </summary> ! /// <param name="dataTable">Quote rows to be validated</param> ! private void validate_CloseToClose( DataTable dataTable ) ! { ! CloseToCloseValidator closeToCloseValidator = new CloseToCloseValidator(); ! closeToCloseValidator.SuspiciousRatio = this.suspiciousRatio; ! closeToCloseValidator.SuspiciousDataRow += ! new SuspiciousDataRowEventHandler( suspiciousDataRowHandler ); ! closeToCloseValidator.Validate( dataTable ); ! } ! /// <summary> ! /// Validates the Range to Range differencies ! /// </summary> ! /// <param name="dataTable">Quote rows to be validated</param> ! private void validate_RangeToRange( DataTable dataTable ) ! { ! RangeToRangeValidator rangeToRangeValidator = new RangeToRangeValidator(); ! rangeToRangeValidator.SuspiciousRatio = this.suspiciousRatio; ! rangeToRangeValidator.SuspiciousDataRow += ! new SuspiciousDataRowEventHandler( suspiciousDataRowHandler ); ! rangeToRangeValidator.Validate( dataTable ); ! } ! /// <summary> /// Validates the quotes rows /// </summary> *************** *** 63,68 **** { this.validate_OHLC( dataTable ); ! this.validate_CloseToClose( dataTable ); ! } } #endregion --- 75,81 ---- { this.validate_OHLC( dataTable ); ! this.validate_CloseToClose( dataTable ); ! this.validate_RangeToRange( dataTable ); ! } } #endregion |
|
From: Glauco S. <gla...@us...> - 2004-03-24 18:35:49
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24858/Downloader/QuotesEditor Modified Files: QuotesEditor.cs Log Message: changed suspiciousRatio to 3, just for testing purposes (MSFT gives no suspicious range to range quotes with suspicious ratio set to 8) Index: QuotesEditor.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/QuotesEditor.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** QuotesEditor.cs 21 Mar 2004 16:25:58 -0000 1.3 --- QuotesEditor.cs 24 Mar 2004 18:25:10 -0000 1.4 *************** *** 16,20 **** public class QuotesEditor : System.Windows.Forms.Form { ! private double suspiciousRatio = 8; private ValidateDataTable validateDataTable; --- 16,20 ---- public class QuotesEditor : System.Windows.Forms.Form { ! private double suspiciousRatio = 3; private ValidateDataTable validateDataTable; |
|
From: Glauco S. <gla...@us...> - 2004-03-24 18:34:16
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24530/Downloader/QuotesEditor Modified Files: VisualValidationChart.cs Log Message: startDateTime and endDateTime were not updated: fixed. Index: VisualValidationChart.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/VisualValidationChart.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VisualValidationChart.cs 21 Mar 2004 16:47:36 -0000 1.1 --- VisualValidationChart.cs 24 Mar 2004 18:23:32 -0000 1.2 *************** *** 37,41 **** protected void add( History history , Color color ) { ! if ( this.startDateTime == DateTime.MinValue ) // the startDateTime is not computed yet this.onPaint_setTimeInterval( history ); --- 37,41 ---- protected void add( History history , Color color ) { ! // if ( this.startDateTime == DateTime.MinValue ) // the startDateTime is not computed yet this.onPaint_setTimeInterval( history ); |
|
From: Marco M. <mi...@us...> - 2004-03-21 20:04:28
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9942/Downloader Modified Files: TickerGroupsViewer.cs Log Message: Fixed bugs: now it's possible to select tickers and perform operations like downloading or validating quotes Index: TickerGroupsViewer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerGroupsViewer.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TickerGroupsViewer.cs 9 Feb 2004 17:21:06 -0000 1.2 --- TickerGroupsViewer.cs 21 Mar 2004 19:54:15 -0000 1.3 *************** *** 148,155 **** { DataTable tableOfSelectedTickers = new DataTable(); ! tableOfSelectedTickers.Columns.Add("tickerID"); ! tableOfSelectedTickers.Columns["tickerID"].Unique = true; ! tableOfSelectedTickers.Columns.Add("tickerCompanyName"); ! foreach(ListViewItem item in this.listViewGroupsAndTickers.SelectedItems) { if(item.Tag is System.String) --- 148,158 ---- { DataTable tableOfSelectedTickers = new DataTable(); ! DataColumn firstColumn = new DataColumn("tiTicker", System.Type.GetType("System.String")); ! DataColumn secondColumn = new DataColumn("tiCompanyName", System.Type.GetType("System.String")); ! firstColumn.Unique = true; ! tableOfSelectedTickers.Columns.Add(firstColumn); ! tableOfSelectedTickers.Columns.Add(secondColumn); ! ! foreach(ListViewItem item in this.listViewGroupsAndTickers.SelectedItems) { if(item.Tag is System.String) *************** *** 163,167 **** else // the item references to a node in the treeView : ! // so it represents a group of tickers { MessageBox.Show("NOT IMPLEMENTED YET"); --- 166,170 ---- else // the item references to a node in the treeView : ! // so it stands for a group of tickers { MessageBox.Show("NOT IMPLEMENTED YET"); |
|
From: Marco M. <mi...@us...> - 2004-03-21 20:00:40
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9192/Downloader Modified Files: TickerViewer.cs Log Message: Code has been cleaned; filter on tickers has been improved Index: TickerViewer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerViewer.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TickerViewer.cs 9 Feb 2004 17:23:00 -0000 1.5 --- TickerViewer.cs 21 Mar 2004 19:50:28 -0000 1.6 *************** *** 48,58 **** private System.Windows.Forms.MenuItem menuItemValidateCurrentRows; private System.Windows.Forms.MenuItem menuItemDownloadCurrentRows; - private System.Windows.Forms.Panel panel1; private System.Windows.Forms.TextBox textBoxStringToFindInName; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Splitter splitter1; private System.Windows.Forms.MenuItem menuItemCopySelectedTickersToClipboard; private DataTable tableTickers; --- 48,67 ---- private System.Windows.Forms.MenuItem menuItemValidateCurrentRows; private System.Windows.Forms.MenuItem menuItemDownloadCurrentRows; private System.Windows.Forms.TextBox textBoxStringToFindInName; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.MenuItem menuItemCopySelectedTickersToClipboard; + private System.Windows.Forms.Splitter splitter1; + private System.Windows.Forms.GroupBox groupBoxDateQuoteFilter; + private System.Windows.Forms.RadioButton radioButtonDateQuoteFilter; + private System.Windows.Forms.RadioButton radioButtonAnyTicker; + private System.Windows.Forms.DateTimePicker dateTimePickerFirstDate; + private System.Windows.Forms.DateTimePicker dateTimePickerLastDate; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.ComboBox comboBoxFirstOperator; + private System.Windows.Forms.ComboBox comboBoxSecondOperator; private DataTable tableTickers; *************** *** 61,69 **** InitializeComponent(); this.oleDbConnection = ConnectionProvider.OleDbConnection; this.tableTickers = new DataTable("tickers"); this.dataGrid1.DataSource = this.tableTickers; this.setStyle_dataGrid1(); - this.dataGrid1.Visible = false; - //the datagrid is still empty at this point } --- 70,77 ---- InitializeComponent(); this.oleDbConnection = ConnectionProvider.OleDbConnection; + this.oleDbDataAdapter = new OleDbDataAdapter("", this.oleDbConnection); this.tableTickers = new DataTable("tickers"); this.dataGrid1.DataSource = this.tableTickers; this.setStyle_dataGrid1(); } *************** *** 89,255 **** private void InitializeComponent() { ! this.components = new System.ComponentModel.Container(); ! this.textBoxStringToFind = new System.Windows.Forms.TextBox(); ! this.label1 = new System.Windows.Forms.Label(); ! this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); ! this.textBoxStringToFindInName = new System.Windows.Forms.TextBox(); ! this.dataGrid1 = new System.Windows.Forms.DataGrid(); ! this.contextMenuTickerViewer = new System.Windows.Forms.ContextMenu(); ! this.menuItemValidateCurrentRows = new System.Windows.Forms.MenuItem(); ! this.menuItemDownloadCurrentRows = new System.Windows.Forms.MenuItem(); ! this.buttonFindTickers = new System.Windows.Forms.Button(); ! this.panel1 = new System.Windows.Forms.Panel(); ! this.label3 = new System.Windows.Forms.Label(); ! this.label2 = new System.Windows.Forms.Label(); ! this.panel2 = new System.Windows.Forms.Panel(); ! this.splitter1 = new System.Windows.Forms.Splitter(); ! this.menuItemCopySelectedTickersToClipboard = new System.Windows.Forms.MenuItem(); ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); ! this.panel1.SuspendLayout(); ! this.panel2.SuspendLayout(); ! this.SuspendLayout(); ! // ! // textBoxStringToFind ! // ! this.textBoxStringToFind.Location = new System.Drawing.Point(16, 32); ! this.textBoxStringToFind.Name = "textBoxStringToFind"; ! this.textBoxStringToFind.Size = new System.Drawing.Size(136, 20); ! this.textBoxStringToFind.TabIndex = 0; ! this.textBoxStringToFind.Text = "%"; ! this.toolTip1.SetToolTip(this.textBoxStringToFind, "Type chars to filter tickers (you can use % and _ ) "); ! // ! // label1 ! // ! this.label1.Location = new System.Drawing.Point(16, 8); ! this.label1.Name = "label1"; ! this.label1.Size = new System.Drawing.Size(112, 16); ! this.label1.TabIndex = 1; ! this.label1.Text = "Find Ticker is like"; ! // ! // textBoxStringToFindInName ! // ! this.textBoxStringToFindInName.AllowDrop = true; ! this.textBoxStringToFindInName.Location = new System.Drawing.Point(16, 112); ! this.textBoxStringToFindInName.Name = "textBoxStringToFindInName"; ! this.textBoxStringToFindInName.Size = new System.Drawing.Size(136, 20); ! this.textBoxStringToFindInName.TabIndex = 4; ! this.textBoxStringToFindInName.Text = "%"; ! this.toolTip1.SetToolTip(this.textBoxStringToFindInName, "Type chars to filter companies (you can use % and _ ) "); ! // ! // dataGrid1 ! // ! this.dataGrid1.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) ! | System.Windows.Forms.AnchorStyles.Left) ! | System.Windows.Forms.AnchorStyles.Right); ! this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.None; ! this.dataGrid1.ContextMenu = this.contextMenuTickerViewer; ! this.dataGrid1.DataMember = ""; ! this.dataGrid1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); ! this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; ! this.dataGrid1.Name = "dataGrid1"; ! this.dataGrid1.Size = new System.Drawing.Size(270, 478); ! this.dataGrid1.TabIndex = 2; ! // ! // contextMenuTickerViewer ! // ! this.contextMenuTickerViewer.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.menuItemValidateCurrentRows, ! this.menuItemDownloadCurrentRows, ! this.menuItemCopySelectedTickersToClipboard}); ! // ! // menuItemValidateCurrentRows ! // ! this.menuItemValidateCurrentRows.Index = 0; ! this.menuItemValidateCurrentRows.Text = "Validate selected tickers"; ! this.menuItemValidateCurrentRows.Click += new System.EventHandler(this.menuItemValidateCurrentRows_Click); ! // ! // menuItemDownloadCurrentRows ! // ! this.menuItemDownloadCurrentRows.Index = 1; ! this.menuItemDownloadCurrentRows.Text = "Download quotes of selected tickers"; ! this.menuItemDownloadCurrentRows.Click += new System.EventHandler(this.menuItemDownloadCurrentRows_Click); ! // ! // buttonFindTickers ! // ! this.buttonFindTickers.Location = new System.Drawing.Point(56, 200); ! this.buttonFindTickers.Name = "buttonFindTickers"; ! this.buttonFindTickers.Size = new System.Drawing.Size(64, 24); ! this.buttonFindTickers.TabIndex = 3; ! this.buttonFindTickers.Text = "Go"; ! this.buttonFindTickers.Click += new System.EventHandler(this.buttonFindTickers_Click); ! // ! // panel1 ! // ! this.panel1.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.dataGrid1}); ! this.panel1.Dock = System.Windows.Forms.DockStyle.Left; ! this.panel1.Name = "panel1"; ! this.panel1.Size = new System.Drawing.Size(288, 478); ! this.panel1.TabIndex = 4; ! // ! // label3 ! // ! this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); ! this.label3.Location = new System.Drawing.Point(72, 64); ! this.label3.Name = "label3"; ! this.label3.Size = new System.Drawing.Size(48, 16); ! this.label3.TabIndex = 6; ! this.label3.Text = "AND"; ! // ! // label2 ! // ! this.label2.Location = new System.Drawing.Point(16, 88); ! this.label2.Name = "label2"; ! this.label2.Size = new System.Drawing.Size(136, 16); ! this.label2.TabIndex = 5; ! this.label2.Text = "Company Name is like"; ! // ! // panel2 ! // ! this.panel2.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.textBoxStringToFind, ! this.buttonFindTickers, ! this.textBoxStringToFindInName, ! this.label2, ! this.label3, ! this.label1}); ! this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; ! this.panel2.Location = new System.Drawing.Point(288, 0); ! this.panel2.Name = "panel2"; ! this.panel2.Size = new System.Drawing.Size(184, 478); ! this.panel2.TabIndex = 7; ! // ! // splitter1 ! // ! this.splitter1.BackColor = System.Drawing.SystemColors.Highlight; ! this.splitter1.Location = new System.Drawing.Point(288, 0); ! this.splitter1.Name = "splitter1"; ! this.splitter1.Size = new System.Drawing.Size(3, 478); ! this.splitter1.TabIndex = 8; ! this.splitter1.TabStop = false; ! // ! // menuItemCopySelectedTickersToClipboard ! // ! this.menuItemCopySelectedTickersToClipboard.Index = 2; ! this.menuItemCopySelectedTickersToClipboard.Text = "Copy selected tickers to clipboard"; ! this.menuItemCopySelectedTickersToClipboard.Click += new System.EventHandler(this.menuItemCopySelectedTickersToClipboard_Click); ! // ! // TickerViewer ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(472, 478); ! this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.splitter1, ! this.panel2, ! this.panel1}); ! this.Name = "TickerViewer"; ! this.Text = "Ticker Viewer"; ! this.Closed += new System.EventHandler(this.TickerViewer_Closed); ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); ! this.panel1.ResumeLayout(false); ! this.panel2.ResumeLayout(false); ! this.ResumeLayout(false); ! } #endregion --- 97,368 ---- private void InitializeComponent() { ! this.components = new System.ComponentModel.Container(); ! this.textBoxStringToFind = new System.Windows.Forms.TextBox(); ! this.label1 = new System.Windows.Forms.Label(); ! this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); ! this.textBoxStringToFindInName = new System.Windows.Forms.TextBox(); ! this.dataGrid1 = new System.Windows.Forms.DataGrid(); ! this.contextMenuTickerViewer = new System.Windows.Forms.ContextMenu(); ! this.menuItemValidateCurrentRows = new System.Windows.Forms.MenuItem(); ! this.menuItemDownloadCurrentRows = new System.Windows.Forms.MenuItem(); ! this.menuItemCopySelectedTickersToClipboard = new System.Windows.Forms.MenuItem(); ! this.buttonFindTickers = new System.Windows.Forms.Button(); ! this.label3 = new System.Windows.Forms.Label(); ! this.label2 = new System.Windows.Forms.Label(); ! this.panel2 = new System.Windows.Forms.Panel(); ! this.groupBoxDateQuoteFilter = new System.Windows.Forms.GroupBox(); ! this.label6 = new System.Windows.Forms.Label(); ! this.dateTimePickerLastDate = new System.Windows.Forms.DateTimePicker(); ! this.dateTimePickerFirstDate = new System.Windows.Forms.DateTimePicker(); ! this.radioButtonDateQuoteFilter = new System.Windows.Forms.RadioButton(); ! this.radioButtonAnyTicker = new System.Windows.Forms.RadioButton(); ! this.splitter1 = new System.Windows.Forms.Splitter(); ! this.label5 = new System.Windows.Forms.Label(); ! this.label7 = new System.Windows.Forms.Label(); ! this.comboBoxFirstOperator = new System.Windows.Forms.ComboBox(); ! this.comboBoxSecondOperator = new System.Windows.Forms.ComboBox(); ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); ! this.panel2.SuspendLayout(); ! this.groupBoxDateQuoteFilter.SuspendLayout(); ! this.SuspendLayout(); ! // ! // textBoxStringToFind ! // ! this.textBoxStringToFind.Location = new System.Drawing.Point(48, 40); ! this.textBoxStringToFind.Name = "textBoxStringToFind"; ! this.textBoxStringToFind.Size = new System.Drawing.Size(88, 20); ! this.textBoxStringToFind.TabIndex = 0; ! this.textBoxStringToFind.Text = "%"; ! this.toolTip1.SetToolTip(this.textBoxStringToFind, "Type chars to filter tickers (you can use % and _ ) "); ! // ! // label1 ! // ! this.label1.Location = new System.Drawing.Point(48, 16); ! this.label1.Name = "label1"; ! this.label1.Size = new System.Drawing.Size(96, 16); ! this.label1.TabIndex = 1; ! this.label1.Text = "Ticker is like"; ! // ! // textBoxStringToFindInName ! // ! this.textBoxStringToFindInName.AllowDrop = true; ! this.textBoxStringToFindInName.Location = new System.Drawing.Point(216, 40); ! this.textBoxStringToFindInName.Name = "textBoxStringToFindInName"; ! this.textBoxStringToFindInName.Size = new System.Drawing.Size(120, 20); ! this.textBoxStringToFindInName.TabIndex = 4; ! this.textBoxStringToFindInName.Text = "%"; ! this.toolTip1.SetToolTip(this.textBoxStringToFindInName, "Type chars to filter companies (you can use % and _ ) "); ! // ! // dataGrid1 ! // ! this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.None; ! this.dataGrid1.ContextMenu = this.contextMenuTickerViewer; ! this.dataGrid1.DataMember = ""; ! this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Left; ! this.dataGrid1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); ! this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; ! this.dataGrid1.Name = "dataGrid1"; ! this.dataGrid1.Size = new System.Drawing.Size(432, 478); ! this.dataGrid1.TabIndex = 2; ! // ! // contextMenuTickerViewer ! // ! this.contextMenuTickerViewer.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.menuItemValidateCurrentRows, ! this.menuItemDownloadCurrentRows, ! this.menuItemCopySelectedTickersToClipboard}); ! // ! // menuItemValidateCurrentRows ! // ! this.menuItemValidateCurrentRows.Index = 0; ! this.menuItemValidateCurrentRows.Text = "Validate selected tickers"; ! this.menuItemValidateCurrentRows.Click += new System.EventHandler(this.menuItemValidateCurrentRows_Click); ! // ! // menuItemDownloadCurrentRows ! // ! this.menuItemDownloadCurrentRows.Index = 1; ! this.menuItemDownloadCurrentRows.Text = "Download quotes of selected tickers"; ! this.menuItemDownloadCurrentRows.Click += new System.EventHandler(this.menuItemDownloadCurrentRows_Click); ! // ! // menuItemCopySelectedTickersToClipboard ! // ! this.menuItemCopySelectedTickersToClipboard.Index = 2; ! this.menuItemCopySelectedTickersToClipboard.Text = "Copy selected tickers to clipboard"; ! this.menuItemCopySelectedTickersToClipboard.Click += new System.EventHandler(this.menuItemCopySelectedTickersToClipboard_Click); ! // ! // buttonFindTickers ! // ! this.buttonFindTickers.Location = new System.Drawing.Point(136, 256); ! this.buttonFindTickers.Name = "buttonFindTickers"; ! this.buttonFindTickers.Size = new System.Drawing.Size(104, 24); ! this.buttonFindTickers.TabIndex = 3; ! this.buttonFindTickers.Text = "Find Tickers"; ! this.buttonFindTickers.Click += new System.EventHandler(this.buttonFindTickers_Click); ! // ! // label3 ! // ! this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); ! this.label3.Location = new System.Drawing.Point(160, 40); ! this.label3.Name = "label3"; ! this.label3.Size = new System.Drawing.Size(32, 16); ! this.label3.TabIndex = 6; ! this.label3.Text = "AND"; ! // ! // label2 ! // ! this.label2.Location = new System.Drawing.Point(216, 16); ! this.label2.Name = "label2"; ! this.label2.Size = new System.Drawing.Size(120, 16); ! this.label2.TabIndex = 5; ! this.label2.Text = "Company Name is like"; ! // ! // panel2 ! // ! this.panel2.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.groupBoxDateQuoteFilter, ! this.textBoxStringToFind, ! this.buttonFindTickers, ! this.textBoxStringToFindInName, ! this.label2, ! this.label3, ! this.label1}); ! this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; ! this.panel2.ForeColor = System.Drawing.SystemColors.ControlText; ! this.panel2.Location = new System.Drawing.Point(432, 0); ! this.panel2.Name = "panel2"; ! this.panel2.Size = new System.Drawing.Size(392, 478); ! this.panel2.TabIndex = 7; ! // ! // groupBoxDateQuoteFilter ! // ! this.groupBoxDateQuoteFilter.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.comboBoxSecondOperator, ! this.comboBoxFirstOperator, ! this.label7, ! this.label5, ! this.label6, ! this.dateTimePickerLastDate, ! this.dateTimePickerFirstDate, ! this.radioButtonDateQuoteFilter, ! this.radioButtonAnyTicker}); ! this.groupBoxDateQuoteFilter.Location = new System.Drawing.Point(8, 80); ! this.groupBoxDateQuoteFilter.Name = "groupBoxDateQuoteFilter"; ! this.groupBoxDateQuoteFilter.Size = new System.Drawing.Size(376, 160); ! this.groupBoxDateQuoteFilter.TabIndex = 14; ! this.groupBoxDateQuoteFilter.TabStop = false; ! this.groupBoxDateQuoteFilter.Text = "Quote filter"; ! // ! // label6 ! // ! this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); ! this.label6.Location = new System.Drawing.Point(24, 96); ! this.label6.Name = "label6"; ! this.label6.Size = new System.Drawing.Size(152, 16); ! this.label6.TabIndex = 17; ! this.label6.Text = "and last available quote is"; ! // ! // dateTimePickerLastDate ! // ! this.dateTimePickerLastDate.Enabled = false; ! this.dateTimePickerLastDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; ! this.dateTimePickerLastDate.Location = new System.Drawing.Point(288, 96); ! this.dateTimePickerLastDate.Name = "dateTimePickerLastDate"; ! this.dateTimePickerLastDate.Size = new System.Drawing.Size(88, 20); ! this.dateTimePickerLastDate.TabIndex = 15; ! // ! // dateTimePickerFirstDate ! // ! this.dateTimePickerFirstDate.Enabled = false; ! this.dateTimePickerFirstDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; ! this.dateTimePickerFirstDate.Location = new System.Drawing.Point(288, 64); ! this.dateTimePickerFirstDate.Name = "dateTimePickerFirstDate"; ! this.dateTimePickerFirstDate.Size = new System.Drawing.Size(88, 20); ! this.dateTimePickerFirstDate.TabIndex = 13; ! // ! // radioButtonDateQuoteFilter ! // ! this.radioButtonDateQuoteFilter.Location = new System.Drawing.Point(8, 56); ! this.radioButtonDateQuoteFilter.Name = "radioButtonDateQuoteFilter"; ! this.radioButtonDateQuoteFilter.Size = new System.Drawing.Size(184, 24); ! this.radioButtonDateQuoteFilter.TabIndex = 12; ! this.radioButtonDateQuoteFilter.Text = "Only tickers whose first quote is"; ! this.radioButtonDateQuoteFilter.CheckedChanged += new System.EventHandler(this.radioButtonDateQuoteFilter_CheckedChanged); ! // ! // radioButtonAnyTicker ! // ! this.radioButtonAnyTicker.Checked = true; ! this.radioButtonAnyTicker.Location = new System.Drawing.Point(8, 24); ! this.radioButtonAnyTicker.Name = "radioButtonAnyTicker"; ! this.radioButtonAnyTicker.Size = new System.Drawing.Size(248, 24); ! this.radioButtonAnyTicker.TabIndex = 10; ! this.radioButtonAnyTicker.TabStop = true; ! this.radioButtonAnyTicker.Text = "Any ticker, with or without quotes"; ! // ! // splitter1 ! // ! this.splitter1.BackColor = System.Drawing.SystemColors.Highlight; ! this.splitter1.Location = new System.Drawing.Point(432, 0); ! this.splitter1.Name = "splitter1"; ! this.splitter1.Size = new System.Drawing.Size(3, 478); ! this.splitter1.TabIndex = 8; ! this.splitter1.TabStop = false; ! // ! // label5 ! // ! this.label5.Location = new System.Drawing.Point(256, 64); ! this.label5.Name = "label5"; ! this.label5.Size = new System.Drawing.Size(32, 16); ! this.label5.TabIndex = 18; ! this.label5.Text = "than"; ! // ! // label7 ! // ! this.label7.Location = new System.Drawing.Point(256, 96); ! this.label7.Name = "label7"; ! this.label7.Size = new System.Drawing.Size(32, 16); ! this.label7.TabIndex = 20; ! this.label7.Text = "than"; ! // ! // comboBoxFirstOperator ! // ! this.comboBoxFirstOperator.Enabled = false; ! this.comboBoxFirstOperator.Items.AddRange(new object[] { ! "<=", ! ">="}); ! this.comboBoxFirstOperator.Location = new System.Drawing.Point(200, 64); ! this.comboBoxFirstOperator.Name = "comboBoxFirstOperator"; ! this.comboBoxFirstOperator.Size = new System.Drawing.Size(48, 21); ! this.comboBoxFirstOperator.TabIndex = 21; ! this.comboBoxFirstOperator.Text = ">="; ! // ! // comboBoxSecondOperator ! // ! this.comboBoxSecondOperator.Enabled = false; ! this.comboBoxSecondOperator.Items.AddRange(new object[] { ! "<=", ! ">="}); ! this.comboBoxSecondOperator.Location = new System.Drawing.Point(200, 96); ! this.comboBoxSecondOperator.Name = "comboBoxSecondOperator"; ! this.comboBoxSecondOperator.Size = new System.Drawing.Size(48, 21); ! this.comboBoxSecondOperator.TabIndex = 22; ! this.comboBoxSecondOperator.Text = "<="; ! // ! // TickerViewer ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(824, 478); ! this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.splitter1, ! this.panel2, ! this.dataGrid1}); ! this.Name = "TickerViewer"; ! this.Text = "Ticker Viewer"; ! this.Closed += new System.EventHandler(this.TickerViewer_Closed); ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); ! this.panel2.ResumeLayout(false); ! this.groupBoxDateQuoteFilter.ResumeLayout(false); ! this.ResumeLayout(false); ! } #endregion *************** *** 260,269 **** { DataGridTableStyle dataGrid1TableStyle = new DataGridTableStyle(); ! //this.dataGrid1.Width = 300; ! dataGrid1TableStyle.MappingName = "tickers"; dataGrid1TableStyle.ColumnHeadersVisible = true; dataGrid1TableStyle.ReadOnly = true; dataGrid1TableStyle.SelectionBackColor = Color.DimGray ; ! DataGridTextBoxColumn columnStyle_tiTicker = new DataGridTextBoxColumn(); columnStyle_tiTicker.MappingName = "tiTicker"; columnStyle_tiTicker.HeaderText = "Ticker"; --- 373,382 ---- { DataGridTableStyle dataGrid1TableStyle = new DataGridTableStyle(); ! dataGrid1TableStyle.MappingName = this.tableTickers.TableName; dataGrid1TableStyle.ColumnHeadersVisible = true; dataGrid1TableStyle.ReadOnly = true; dataGrid1TableStyle.SelectionBackColor = Color.DimGray ; ! ! DataGridTextBoxColumn columnStyle_tiTicker = new DataGridTextBoxColumn(); columnStyle_tiTicker.MappingName = "tiTicker"; columnStyle_tiTicker.HeaderText = "Ticker"; *************** *** 277,283 **** columnStyle_tiCompanyName.NullText = ""; columnStyle_tiCompanyName.Width = 150; ! dataGrid1TableStyle.GridColumnStyles.Add(columnStyle_tiTicker); dataGrid1TableStyle.GridColumnStyles.Add(columnStyle_tiCompanyName); this.dataGrid1.TableStyles.Add(dataGrid1TableStyle); } --- 390,412 ---- columnStyle_tiCompanyName.NullText = ""; columnStyle_tiCompanyName.Width = 150; ! DataGridTextBoxColumn columnStyle_FirstQuote = new DataGridTextBoxColumn(); ! columnStyle_FirstQuote.MappingName = "FirstQuote"; ! columnStyle_FirstQuote.HeaderText = "First Quote"; ! columnStyle_FirstQuote.TextBox.Enabled = false; ! columnStyle_FirstQuote.NullText = ""; ! columnStyle_FirstQuote.Width = 80; ! DataGridTextBoxColumn columnStyle_LastQuote = new DataGridTextBoxColumn(); ! columnStyle_LastQuote.MappingName = "LastQuote"; ! columnStyle_LastQuote.HeaderText = "Last Quote"; ! columnStyle_LastQuote.TextBox.Enabled = false; ! columnStyle_LastQuote.NullText = ""; ! columnStyle_LastQuote.Width = 80; ! ! dataGrid1TableStyle.GridColumnStyles.Add(columnStyle_tiTicker); dataGrid1TableStyle.GridColumnStyles.Add(columnStyle_tiCompanyName); + dataGrid1TableStyle.GridColumnStyles.Add(columnStyle_FirstQuote); + dataGrid1TableStyle.GridColumnStyles.Add(columnStyle_LastQuote); this.dataGrid1.TableStyles.Add(dataGrid1TableStyle); + } *************** *** 289,292 **** --- 418,455 ---- this.oleDbConnection.Close(); } + + #region buildSqlSelectString + private string buildSqlSelectString(bool anyTicker, DateTime firstDate, DateTime lastDate) + { + string sqlSelectString = ""; + if(anyTicker == true) + { + sqlSelectString = "SELECT tiTicker, tiCompanyName, Min(quotes.quDate) AS FirstQuote, Max(quotes.quDate) AS LastQuote " + + "FROM quotes RIGHT JOIN tickers ON quotes.quTicker = tickers.tiTicker " + + "WHERE tiTicker LIKE '" + + this.textBoxStringToFind.Text + "' " + + "AND tiCompanyName LIKE '" + + this.textBoxStringToFindInName.Text + "' " + + "GROUP BY tickers.tiTicker, tickers.tiCompanyName"; + } + else + { + if(firstDate.CompareTo(lastDate)>0) + throw new Exception("Last Date can't be previous of First date!"); + sqlSelectString = "SELECT tiTicker, tiCompanyName, Min(quotes.quDate) AS FirstQuote, Max(quotes.quDate) AS LastQuote " + + "FROM quotes INNER JOIN tickers ON quotes.quTicker = tickers.tiTicker " + + "WHERE tiTicker LIKE '" + + this.textBoxStringToFind.Text + "' " + + "AND tiCompanyName LIKE '" + + this.textBoxStringToFindInName.Text + "' " + + "GROUP BY tickers.tiTicker, tickers.tiCompanyName " + + "HAVING Min(quotes.quDate)" + this.comboBoxFirstOperator.Text + + "#" + firstDate + "# " + + "AND Max(quotes.quDate)" + this.comboBoxSecondOperator.Text + + "#" + lastDate + "#"; + } + return sqlSelectString; + } + #endregion private void buttonFindTickers_Click(object sender, System.EventArgs e) *************** *** 298,322 **** if(this.oleDbConnection.State != ConnectionState.Open) this.oleDbConnection.Open(); ! string criteria = "SELECT * FROM tickers WHERE tiTicker LIKE '" + ! this.textBoxStringToFind.Text + "'" + ! " AND tiCompanyName LIKE '" + ! this.textBoxStringToFindInName.Text + "'"; ! oleDbDataAdapter = new OleDbDataAdapter(criteria, this.oleDbConnection); ! this.tableTickers.Clear(); oleDbDataAdapter.Fill(this.tableTickers); ! this.dataGrid1.Refresh(); ! if (this.dataGrid1.Visible == false && ! this.tableTickers.Rows.Count != 0) ! //there are some rows to show and the grid is not visible ! { ! this.dataGrid1.Visible = true; ! } ! else if(this.tableTickers.Rows.Count == 0) ! // there aren't rows to show ! { ! this.dataGrid1.Visible = false; ! } ! } catch(Exception ex) { --- 461,478 ---- if(this.oleDbConnection.State != ConnectionState.Open) this.oleDbConnection.Open(); ! string sqlSelectString = this.buildSqlSelectString(this.radioButtonAnyTicker.Checked, ! this.dateTimePickerFirstDate.Value , ! this.dateTimePickerLastDate.Value); ! this.tableTickers.Clear(); ! this.oleDbDataAdapter.SelectCommand.CommandText = sqlSelectString; ! // these two lines in order to avoid "strange" exceptions ... ! this.dataGrid1.DataSource = null; ! this.dataGrid1.DataSource = this.tableTickers; ! // oleDbDataAdapter.Fill(this.tableTickers); ! ! this.dataGrid1.Refresh(); ! } catch(Exception ex) { *************** *** 380,384 **** return; } ! WebDownloader webDownloader = new WebDownloader(this.GetTableOfSelectedTickers()); webDownloader.Show(); } --- 536,540 ---- return; } ! WebDownloader webDownloader = new WebDownloader(tableOfSelectedTickers); webDownloader.Show(); } *************** *** 394,397 **** --- 550,571 ---- } + private void radioButtonDateQuoteFilter_CheckedChanged(object sender, System.EventArgs e) + { + if(this.radioButtonDateQuoteFilter.Checked == true) + { + this.dateTimePickerFirstDate.Enabled = true; + this.dateTimePickerLastDate.Enabled = true; + this.comboBoxFirstOperator.Enabled = true; + this.comboBoxSecondOperator.Enabled = true; + } + else + { + this.dateTimePickerFirstDate.Enabled = false; + this.dateTimePickerLastDate.Enabled = false; + this.comboBoxFirstOperator.Enabled = false; + this.comboBoxSecondOperator.Enabled = false; + } + } + |