quantproject-developers Mailing List for QuantProject (Page 141)
Brought to you by:
glauco_1
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(103) |
Dec
(67) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(52) |
Feb
(9) |
Mar
(69) |
Apr
(53) |
May
(80) |
Jun
(23) |
Jul
(24) |
Aug
(112) |
Sep
(9) |
Oct
|
Nov
(58) |
Dec
(93) |
| 2005 |
Jan
(90) |
Feb
(93) |
Mar
(61) |
Apr
(56) |
May
(37) |
Jun
(61) |
Jul
(55) |
Aug
(68) |
Sep
(25) |
Oct
(46) |
Nov
(41) |
Dec
(37) |
| 2006 |
Jan
(33) |
Feb
(7) |
Mar
(19) |
Apr
(27) |
May
(73) |
Jun
(49) |
Jul
(83) |
Aug
(66) |
Sep
(45) |
Oct
(16) |
Nov
(15) |
Dec
(7) |
| 2007 |
Jan
(14) |
Feb
(33) |
Mar
|
Apr
(21) |
May
|
Jun
(34) |
Jul
(18) |
Aug
(100) |
Sep
(39) |
Oct
(55) |
Nov
(12) |
Dec
(2) |
| 2008 |
Jan
(120) |
Feb
(133) |
Mar
(129) |
Apr
(104) |
May
(42) |
Jun
(2) |
Jul
(52) |
Aug
(99) |
Sep
(134) |
Oct
|
Nov
(137) |
Dec
(48) |
| 2009 |
Jan
(48) |
Feb
(55) |
Mar
(61) |
Apr
(3) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(51) |
Sep
|
Oct
(7) |
Nov
|
Dec
|
| 2010 |
Jan
(7) |
Feb
(1) |
Mar
(145) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
|
| 2011 |
Jan
(78) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(88) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Marco M. <mi...@us...> - 2004-03-21 19:57:23
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8728/Downloader Modified Files: DataBaseImporter.cs Log Message: Downloaded quotes can now overwrite existing quotes in database (it may be useful ...) Index: DataBaseImporter.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/DataBaseImporter.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DataBaseImporter.cs 26 Jan 2004 15:57:15 -0000 1.4 --- DataBaseImporter.cs 21 Mar 2004 19:46:51 -0000 1.5 *************** *** 11,96 **** public class DataBaseImporter { ! private StreamReader streamReader; ! private OleDbConnection oleDbConnection; ! public DataBaseImporter( OleDbConnection oleDbConnection , StreamReader streamReader ) { this.streamReader = streamReader; ! this.oleDbConnection = oleDbConnection; } ! public void ImportTicker( string ticker ) { ! string Line; ! string[] LineIn; - string strAccessSelect = "Select * from quotes where 1=2"; - OleDbCommand myAccessCommand = new - OleDbCommand( strAccessSelect , oleDbConnection ); ! OleDbDataAdapter myDataAdapter = new ! OleDbDataAdapter( myAccessCommand ); ! OleDbCommandBuilder myCB = new OleDbCommandBuilder( myDataAdapter ); ! //Create Dataset and table ! DataSet myDataSet = new DataSet(); ! ! //Set MissingSchemaAction Property ! myDataAdapter.MissingSchemaAction = MissingSchemaAction.Add; ! ! ! //Set MissingMappingAction Property ! myDataAdapter.MissingMappingAction = MissingMappingAction.Passthrough; ! //Fill data adapter ! myDataAdapter.Fill( myDataSet , "Data" ); ! Line = streamReader.ReadLine(); ! Line = streamReader.ReadLine(); ! while ( Line != null ) ! { ! LineIn=Line.Split(','); ! ! DataRow myRow=myDataSet.Tables["Data"].NewRow(); ! myRow[ "quTicker" ] = ticker; ! myRow[ "quDate" ]=DateTime.Parse( LineIn[0] ); ! myRow[ "quOpen" ]=Double.Parse( LineIn[1] ); ! myRow[ "quHigh" ]=Double.Parse( LineIn[2] ); ! myRow[ "quLow" ]=Double.Parse( LineIn[3] ); ! myRow[ "quClose" ]=Double.Parse( LineIn[4] ); ! myRow[ "quVolume" ]=Double.Parse( LineIn[5] ); ! myRow[ "quAdjustedClose" ]=Double.Parse( LineIn[6] ); ! //myRow[ "quAdjustedOpen" ]=Convert.ToDouble(myRow[ "quOpen" ])* ! // (Convert.ToDouble(myRow[ "quAdjustedClose" ])/Convert.ToDouble(myRow[ "quOpen" ])); ! // myRow["date"]=DateTime.Parse(LineIn[0]); ! // myRow["time"]=DateTime.Parse(LineIn[1]); ! // myRow["sv1485ri"]=Double.Parse(LineIn[2]); ! // myRow["sv14856s"]=Double.Parse(LineIn[3]); ! // myRow["d4461"]=Double.Parse(LineIn[4]); ! // myRow["d6sf"]=Double.Parse(LineIn[5]); ! // myRow["d6sdp"]=Double.Parse(LineIn[6]); ! // myRow["oppai"]=Double.Parse(LineIn[7]); ! // myRow["oppbi"]=Double.Parse(LineIn[8]); ! // myRow["opps"]=Double.Parse(LineIn[9]); ! // myRow["o24hrtf"]=Double.Parse(LineIn[10]); ! // myRow["oif"]=Double.Parse(LineIn[11]); ! // myRow["otct"]=Double.Parse(LineIn[12]); ! // myRow["d1abt"]=Double.Parse(LineIn[13]); ! // myRow["d1bbt"]=Double.Parse(LineIn[14]); ! // myRow["d3bt"]=Double.Parse(LineIn[15]); ! // myRow["d2bt"]=Double.Parse(LineIn[16]); ! // myRow["d5bt"]=Double.Parse(LineIn[17]); ! // myRow["d6bt"]=Double.Parse(LineIn[18]); ! // myRow["cv1480cvpi"]=Double.Parse(LineIn[19]); ! // myRow["cv1481cvpi"]=Double.Parse(LineIn[20]); myDataSet.Tables["Data"].Rows.Add(myRow); ! ! Line = this.streamReader.ReadLine(); ! } ! ! myDataAdapter.Update(myDataSet, "Data"); ! ! } } } --- 11,134 ---- public class DataBaseImporter { ! private StreamReader streamReader; ! private OleDbConnection oleDbConnection; ! private OleDbDataAdapter oleDbDataAdapter; ! private OleDbCommand oleDbCommand; ! private bool overWriteExistingRecords; ! ! public DataBaseImporter( OleDbConnection oleDbConnection , StreamReader streamReader, ! bool overWriteExistingRecords) { this.streamReader = streamReader; ! this.oleDbConnection = oleDbConnection; ! this.oleDbDataAdapter = new OleDbDataAdapter(); ! this.oleDbCommand = new OleDbCommand("", this.oleDbConnection); ! this.overWriteExistingRecords = overWriteExistingRecords; } ! ! private void updateDataBase(OleDbDataAdapter myAdapter, DataSet myDataSet, ! string tableName) ! { ! try ! { ! myAdapter.Update(myDataSet, tableName); ! } ! catch(Exception ex) ! { ! // no consequences if there are some lines that are not inserted (due to key violation) ! string notUsed = ex.ToString(); ! } ! } ! private void deleteExistingQuote(string tickerToDelete, DateTime dateOfQuoteToDelete) { ! try ! { ! if(this.overWriteExistingRecords == false) ! return; ! this.oleDbDataAdapter.DeleteCommand = new OleDbCommand("DELETE * FROM quotes " + ! "WHERE quTicker ='" + ! tickerToDelete + "' AND " + ! "quDate =#" + ! dateOfQuoteToDelete + "#"); ! this.oleDbDataAdapter.DeleteCommand.ExecuteNonQuery(); ! } ! catch(Exception ex) ! { ! // no consequences if there are some lines that are not inserted (due to key violation) ! string notUsed = ex.ToString(); ! } ! } ! public void ImportTicker( string ticker ) ! { ! string Line; ! string[] LineIn; ! string strAccessSelect = "Select * from quotes where 1=2"; ! OleDbCommand myAccessCommand = new ! OleDbCommand( strAccessSelect , oleDbConnection ); ! OleDbDataAdapter myDataAdapter = new ! OleDbDataAdapter( myAccessCommand ); ! OleDbCommandBuilder myCB = new OleDbCommandBuilder( myDataAdapter ); ! DataSet myDataSet = new DataSet(); ! myDataAdapter.MissingSchemaAction = MissingSchemaAction.Add; ! myDataAdapter.MissingMappingAction = MissingMappingAction.Passthrough; ! myDataAdapter.Fill( myDataSet , "Data" ); ! Line = streamReader.ReadLine(); ! Line = streamReader.ReadLine(); ! ! while ( Line != null ) ! { ! LineIn=Line.Split(','); ! ! DataRow myRow=myDataSet.Tables["Data"].NewRow(); ! myRow[ "quTicker" ] = ticker; ! myRow[ "quDate" ]=DateTime.Parse( LineIn[0] ); ! myRow[ "quOpen" ]=Double.Parse( LineIn[1] ); ! myRow[ "quHigh" ]=Double.Parse( LineIn[2] ); ! myRow[ "quLow" ]=Double.Parse( LineIn[3] ); ! myRow[ "quClose" ]=Double.Parse( LineIn[4] ); ! myRow[ "quVolume" ]=Double.Parse( LineIn[5] ); ! myRow[ "quAdjustedClose" ]=Double.Parse( LineIn[6] ); ! //myRow[ "quAdjustedOpen" ]=Convert.ToDouble(myRow[ "quOpen" ])* ! // (Convert.ToDouble(myRow[ "quAdjustedClose" ])/Convert.ToDouble(myRow[ "quOpen" ])); + // myRow["date"]=DateTime.Parse(LineIn[0]); + // myRow["time"]=DateTime.Parse(LineIn[1]); + // myRow["sv1485ri"]=Double.Parse(LineIn[2]); + // myRow["sv14856s"]=Double.Parse(LineIn[3]); + // myRow["d4461"]=Double.Parse(LineIn[4]); + // myRow["d6sf"]=Double.Parse(LineIn[5]); + // myRow["d6sdp"]=Double.Parse(LineIn[6]); + // myRow["oppai"]=Double.Parse(LineIn[7]); + // myRow["oppbi"]=Double.Parse(LineIn[8]); + // myRow["opps"]=Double.Parse(LineIn[9]); + // myRow["o24hrtf"]=Double.Parse(LineIn[10]); + // myRow["oif"]=Double.Parse(LineIn[11]); + // myRow["otct"]=Double.Parse(LineIn[12]); + // myRow["d1abt"]=Double.Parse(LineIn[13]); + // myRow["d1bbt"]=Double.Parse(LineIn[14]); + // myRow["d3bt"]=Double.Parse(LineIn[15]); + // myRow["d2bt"]=Double.Parse(LineIn[16]); + // myRow["d5bt"]=Double.Parse(LineIn[17]); + // myRow["d6bt"]=Double.Parse(LineIn[18]); + // myRow["cv1480cvpi"]=Double.Parse(LineIn[19]); + // myRow["cv1481cvpi"]=Double.Parse(LineIn[20]); + myDataSet.Tables["Data"].Rows.Add(myRow); ! this.deleteExistingQuote(ticker, DateTime.Parse(LineIn[0])); ! //the corresponding record is deleted if in the web downloader form ! // the radio button "over Write existing record" is checked ! Line = this.streamReader.ReadLine(); ! } ! this.updateDataBase(myDataAdapter, myDataSet,"Data"); ! } ! } + } |
|
From: Marco M. <mi...@us...> - 2004-03-21 19:44:24
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6292/Downloader Modified Files: WebDownloader.cs Log Message: Useless code has been deleted and some methods renamed; added controls to the form in order to send messages to TickerDownloader and DataBaseImporter objects. Index: WebDownloader.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/WebDownloader.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** WebDownloader.cs 26 Jan 2004 15:57:15 -0000 1.8 --- WebDownloader.cs 21 Mar 2004 19:34:12 -0000 1.9 *************** *** 29,34 **** private System.Data.OleDb.OleDbCommand oleDbCommand1; public DataSet1 DsTickerCurrentlyDownloaded = new DataSet1(); ! private System.Windows.Forms.Button buttonDownloadQuotesOfSelectedTickers; ! private DataTable tableOfSelectedTickers; /// <summary> /// Required designer variable. --- 29,46 ---- private System.Data.OleDb.OleDbCommand oleDbCommand1; public DataSet1 DsTickerCurrentlyDownloaded = new DataSet1(); ! private System.Windows.Forms.Button buttonDownloadQuotesOfSelectedTickers; ! private DataTable tableOfSelectedTickers; ! internal System.Windows.Forms.Label labelNumberOfTickersToDownload; ! internal System.Windows.Forms.Label labelTickersLeft; ! private System.Windows.Forms.Label labelStartingDateTime; ! private System.Windows.Forms.DateTimePicker dateTimePickerStartingDate; ! private System.Windows.Forms.RadioButton radioButtonAllAvailableUntilNow; ! private System.Windows.Forms.GroupBox groupBoxWebDownloaderOptions; ! private System.Windows.Forms.GroupBox groupBoxUpdateDatabaseOptions; ! internal System.Windows.Forms.RadioButton radioButtonOverWriteYes; ! private System.Windows.Forms.RadioButton radioButtonOverWriteNo; ! private System.Windows.Forms.RadioButton radioButtonAllAvailableUntilNowSinceStartingDate; ! internal System.Windows.Forms.CheckBox checkBoxIsDicotomicSearchActivated; ! private System.Windows.Forms.RadioButton radioButtonDownloadBeforeMinAndAfterMax; /// <summary> /// Required designer variable. *************** *** 42,48 **** // InitializeComponent(); ! // this.Text = "Download quotes of all tickers in the database"; this.buttonDownloadQuotesOfSelectedTickers.Visible = false; // --- 54,65 ---- // InitializeComponent(); ! this.commonInitialization(); ! ! // this.Text = "Download quotes of all tickers in the database"; this.buttonDownloadQuotesOfSelectedTickers.Visible = false; + // TODO: retrieve number of all the tickers symbol stored in DB + this.labelNumberOfTickersToDownload.Visible = false; + this.labelTickersLeft.Visible = false; // *************** *** 55,63 **** // InitializeComponent(); ! // this.Text = "Download quotes of selected tickers"; this.button1.Visible = false; this.tableOfSelectedTickers = tableOfSelectedTickers; // --- 72,81 ---- // InitializeComponent(); ! this.commonInitialization(); // this.Text = "Download quotes of selected tickers"; this.button1.Visible = false; this.tableOfSelectedTickers = tableOfSelectedTickers; + this.labelNumberOfTickersToDownload.Text = Convert.ToString(tableOfSelectedTickers.Rows.Count); // *************** *** 78,81 **** --- 96,111 ---- base.Dispose( disposing ); } + + /// <summary> + /// common initialization of the controls of the form + /// </summary> + private void commonInitialization() + { + this.radioButtonAllAvailableUntilNow.Checked = true; + this.dateTimePickerStartingDate.Value = new DateTime(1980,1,1); + //this.dateTimePickerStartingDate.Refresh(); + this.radioButtonOverWriteNo.Checked = true; + } + #region Windows Form Designer generated code *************** *** 86,225 **** private void InitializeComponent() { ! this.button1 = new System.Windows.Forms.Button(); ! this.dataGrid1 = new System.Windows.Forms.DataGrid(); ! this.oleDbDataAdapter1 = new System.Data.OleDb.OleDbDataAdapter(); ! this.oleDbDeleteCommand1 = new System.Data.OleDb.OleDbCommand(); ! this.oleDbInsertCommand1 = new System.Data.OleDb.OleDbCommand(); ! this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand(); ! this.oleDbUpdateCommand1 = new System.Data.OleDb.OleDbCommand(); ! this.oleDbCommand1 = new System.Data.OleDb.OleDbCommand(); ! this.buttonDownloadQuotesOfSelectedTickers = new System.Windows.Forms.Button(); ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); ! this.SuspendLayout(); ! // ! // button1 ! // ! this.button1.Location = new System.Drawing.Point(48, 24); ! this.button1.Name = "button1"; ! this.button1.Size = new System.Drawing.Size(112, 32); ! this.button1.TabIndex = 0; ! this.button1.Text = "Download all Tickers\'quotes"; ! this.button1.Click += new System.EventHandler(this.button1_Click); ! // ! // dataGrid1 ! // ! this.dataGrid1.DataMember = ""; ! this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; ! this.dataGrid1.Location = new System.Drawing.Point(176, 16); ! this.dataGrid1.Name = "dataGrid1"; ! this.dataGrid1.Size = new System.Drawing.Size(336, 216); ! this.dataGrid1.TabIndex = 1; ! // ! // oleDbDataAdapter1 ! // ! this.oleDbDataAdapter1.DeleteCommand = this.oleDbDeleteCommand1; ! this.oleDbDataAdapter1.InsertCommand = this.oleDbInsertCommand1; ! this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1; ! this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] { ! new System.Data.Common.DataTableMapping("Table", "quotes", new System.Data.Common.DataColumnMapping[] { ! new System.Data.Common.DataColumnMapping("quId", "quId"), ! new System.Data.Common.DataColumnMapping("quTicker", "quTicker"), ! new System.Data.Common.DataColumnMapping("quDate", "quDate"), ! new System.Data.Common.DataColumnMapping("quOpen", "quOpen"), ! new System.Data.Common.DataColumnMapping("quHigh", "quHigh"), ! new System.Data.Common.DataColumnMapping("quLow", "quLow"), ! new System.Data.Common.DataColumnMapping("quClose", "quClose")})}); ! this.oleDbDataAdapter1.UpdateCommand = this.oleDbUpdateCommand1; ! // ! // oleDbDeleteCommand1 ! // ! this.oleDbDeleteCommand1.CommandText = @"DELETE FROM quotes WHERE (quId = ?) AND (quClose = ? OR ? IS NULL AND quClose IS NULL) AND (quDate = ? OR ? IS NULL AND quDate IS NULL) AND (quHigh = ? OR ? IS NULL AND quHigh IS NULL) AND (quLow = ? OR ? IS NULL AND quLow IS NULL) AND (quOpen = ? OR ? IS NULL AND quOpen IS NULL) AND (quTicker = ? OR ? IS NULL AND quTicker IS NULL)"; ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(10)), ((System.Byte)(0)), "quId", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quClose1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quDate", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quDate", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quHigh1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quLow1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quOpen1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quTicker", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quTicker1", System.Data.OleDb.OleDbType.VarWChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quTicker", System.Data.DataRowVersion.Original, null)); ! // ! // oleDbInsertCommand1 ! // ! this.oleDbInsertCommand1.CommandText = "INSERT INTO quotes (quClose, quDate, quHigh, quLow, quOpen, quTicker, quVolume) V" + ! "ALUES (?, ?, ?, ?, ?, ?, ?)"; ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quDate", System.Data.OleDb.OleDbType.DBDate, 0, "quDate")); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, "quTicker")); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quVolume", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(10)), ((System.Byte)(0)), "quVolume", System.Data.DataRowVersion.Current, null)); ! // ! // oleDbSelectCommand1 ! // ! this.oleDbSelectCommand1.CommandText = "SELECT quClose, quDate, quHigh, quLow, quOpen, quTicker FROM quotes"; ! // ! // oleDbUpdateCommand1 ! // ! this.oleDbUpdateCommand1.CommandText = @"UPDATE quotes SET quClose = ?, quDate = ?, quHigh = ?, quLow = ?, quOpen = ?, quTicker = ? WHERE (quId = ?) AND (quClose = ? OR ? IS NULL AND quClose IS NULL) AND (quDate = ? OR ? IS NULL AND quDate IS NULL) AND (quHigh = ? OR ? IS NULL AND quHigh IS NULL) AND (quLow = ? OR ? IS NULL AND quLow IS NULL) AND (quOpen = ? OR ? IS NULL AND quOpen IS NULL) AND (quTicker = ? OR ? IS NULL AND quTicker IS NULL)"; ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quDate", System.Data.OleDb.OleDbType.DBDate, 0, "quDate")); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, "quTicker")); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(10)), ((System.Byte)(0)), "quId", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quClose1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quDate", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quDate", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quHigh1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quLow1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quOpen1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quTicker", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quTicker1", System.Data.OleDb.OleDbType.VarWChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quTicker", System.Data.DataRowVersion.Original, null)); ! // ! // oleDbCommand1 ! // ! this.oleDbCommand1.CommandText = "DELETE quotes.* FROM quotes INNER JOIN tickers ON quotes.quTicker = tickers.tiTic" + ! "ker"; ! // ! // buttonDownloadQuotesOfSelectedTickers ! // ! this.buttonDownloadQuotesOfSelectedTickers.Location = new System.Drawing.Point(48, 80); ! this.buttonDownloadQuotesOfSelectedTickers.Name = "buttonDownloadQuotesOfSelectedTickers"; ! this.buttonDownloadQuotesOfSelectedTickers.Size = new System.Drawing.Size(112, 32); ! this.buttonDownloadQuotesOfSelectedTickers.TabIndex = 2; ! this.buttonDownloadQuotesOfSelectedTickers.Text = "Download quotes"; ! this.buttonDownloadQuotesOfSelectedTickers.Click += new System.EventHandler(this.buttonDownloadQuotesOfSelectedTickers_Click); ! // ! // WebDownloader ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(592, 285); ! this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.buttonDownloadQuotesOfSelectedTickers, ! this.dataGrid1, ! this.button1}); ! this.Name = "WebDownloader"; ! this.Text = "Form1"; ! this.Load += new System.EventHandler(this.Form1_Load); ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); ! this.ResumeLayout(false); ! } #endregion ! /// <summary> ! /// The main entry point for the application. ! /// </summary> private void downloadQuotes_addRecord_toDatabase( string tiTicker , StreamReader sr) { --- 116,386 ---- private void InitializeComponent() { ! this.button1 = new System.Windows.Forms.Button(); ! this.dataGrid1 = new System.Windows.Forms.DataGrid(); ! this.oleDbDataAdapter1 = new System.Data.OleDb.OleDbDataAdapter(); ! this.oleDbDeleteCommand1 = new System.Data.OleDb.OleDbCommand(); ! this.oleDbInsertCommand1 = new System.Data.OleDb.OleDbCommand(); ! this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand(); ! this.oleDbUpdateCommand1 = new System.Data.OleDb.OleDbCommand(); ! this.oleDbCommand1 = new System.Data.OleDb.OleDbCommand(); ! this.buttonDownloadQuotesOfSelectedTickers = new System.Windows.Forms.Button(); ! this.labelNumberOfTickersToDownload = new System.Windows.Forms.Label(); ! this.labelTickersLeft = new System.Windows.Forms.Label(); ! this.dateTimePickerStartingDate = new System.Windows.Forms.DateTimePicker(); ! this.labelStartingDateTime = new System.Windows.Forms.Label(); ! this.radioButtonAllAvailableUntilNow = new System.Windows.Forms.RadioButton(); ! this.radioButtonAllAvailableUntilNowSinceStartingDate = new System.Windows.Forms.RadioButton(); ! this.groupBoxWebDownloaderOptions = new System.Windows.Forms.GroupBox(); ! this.checkBoxIsDicotomicSearchActivated = new System.Windows.Forms.CheckBox(); ! this.groupBoxUpdateDatabaseOptions = new System.Windows.Forms.GroupBox(); ! this.radioButtonDownloadBeforeMinAndAfterMax = new System.Windows.Forms.RadioButton(); ! this.radioButtonOverWriteNo = new System.Windows.Forms.RadioButton(); ! this.radioButtonOverWriteYes = new System.Windows.Forms.RadioButton(); ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); ! this.groupBoxWebDownloaderOptions.SuspendLayout(); ! this.groupBoxUpdateDatabaseOptions.SuspendLayout(); ! this.SuspendLayout(); ! // ! // button1 ! // ! this.button1.Location = new System.Drawing.Point(88, 320); ! this.button1.Name = "button1"; ! this.button1.Size = new System.Drawing.Size(112, 32); ! this.button1.TabIndex = 0; ! this.button1.Text = "Download all Tickers\'quotes"; ! this.button1.Click += new System.EventHandler(this.button1_Click); ! // ! // dataGrid1 ! // ! this.dataGrid1.DataMember = ""; ! this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; ! this.dataGrid1.Location = new System.Drawing.Point(304, 8); ! this.dataGrid1.Name = "dataGrid1"; ! this.dataGrid1.Size = new System.Drawing.Size(272, 432); ! this.dataGrid1.TabIndex = 1; ! // ! // oleDbDataAdapter1 ! // ! this.oleDbDataAdapter1.DeleteCommand = this.oleDbDeleteCommand1; ! this.oleDbDataAdapter1.InsertCommand = this.oleDbInsertCommand1; ! this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1; ! this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] { ! new System.Data.Common.DataTableMapping("Table", "quotes", new System.Data.Common.DataColumnMapping[] { ! new System.Data.Common.DataColumnMapping("quId", "quId"), ! new System.Data.Common.DataColumnMapping("quTicker", "quTicker"), ! new System.Data.Common.DataColumnMapping("quDate", "quDate"), ! new System.Data.Common.DataColumnMapping("quOpen", "quOpen"), ! new System.Data.Common.DataColumnMapping("quHigh", "quHigh"), ! new System.Data.Common.DataColumnMapping("quLow", "quLow"), ! new System.Data.Common.DataColumnMapping("quClose", "quClose")})}); ! this.oleDbDataAdapter1.UpdateCommand = this.oleDbUpdateCommand1; ! // ! // oleDbDeleteCommand1 ! // ! this.oleDbDeleteCommand1.CommandText = @"DELETE FROM quotes WHERE (quId = ?) AND (quClose = ? OR ? IS NULL AND quClose IS NULL) AND (quDate = ? OR ? IS NULL AND quDate IS NULL) AND (quHigh = ? OR ? IS NULL AND quHigh IS NULL) AND (quLow = ? OR ? IS NULL AND quLow IS NULL) AND (quOpen = ? OR ? IS NULL AND quOpen IS NULL) AND (quTicker = ? OR ? IS NULL AND quTicker IS NULL)"; ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(10)), ((System.Byte)(0)), "quId", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quClose1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quDate", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quDate", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quHigh1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quLow1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quOpen1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quTicker", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quTicker1", System.Data.OleDb.OleDbType.VarWChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quTicker", System.Data.DataRowVersion.Original, null)); ! // ! // oleDbInsertCommand1 ! // ! this.oleDbInsertCommand1.CommandText = "INSERT INTO quotes (quClose, quDate, quHigh, quLow, quOpen, quTicker, quVolume) V" + ! "ALUES (?, ?, ?, ?, ?, ?, ?)"; ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quDate", System.Data.OleDb.OleDbType.DBDate, 0, "quDate")); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, "quTicker")); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quVolume", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(10)), ((System.Byte)(0)), "quVolume", System.Data.DataRowVersion.Current, null)); ! // ! // oleDbSelectCommand1 ! // ! this.oleDbSelectCommand1.CommandText = "SELECT quClose, quDate, quHigh, quLow, quOpen, quTicker FROM quotes"; ! // ! // oleDbUpdateCommand1 ! // ! this.oleDbUpdateCommand1.CommandText = @"UPDATE quotes SET quClose = ?, quDate = ?, quHigh = ?, quLow = ?, quOpen = ?, quTicker = ? WHERE (quId = ?) AND (quClose = ? OR ? IS NULL AND quClose IS NULL) AND (quDate = ? OR ? IS NULL AND quDate IS NULL) AND (quHigh = ? OR ? IS NULL AND quHigh IS NULL) AND (quLow = ? OR ? IS NULL AND quLow IS NULL) AND (quOpen = ? OR ? IS NULL AND quOpen IS NULL) AND (quTicker = ? OR ? IS NULL AND quTicker IS NULL)"; ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quDate", System.Data.OleDb.OleDbType.DBDate, 0, "quDate")); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, "quTicker")); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(10)), ((System.Byte)(0)), "quId", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quClose1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quDate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quDate", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quDate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quDate", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quHigh1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quLow1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quOpen1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "quOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quTicker", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quTicker1", System.Data.OleDb.OleDbType.VarWChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "quTicker", System.Data.DataRowVersion.Original, null)); ! // ! // oleDbCommand1 ! // ! this.oleDbCommand1.CommandText = "DELETE quotes.* FROM quotes INNER JOIN tickers ON quotes.quTicker = tickers.tiTic" + ! "ker"; ! // ! // buttonDownloadQuotesOfSelectedTickers ! // ! this.buttonDownloadQuotesOfSelectedTickers.Location = new System.Drawing.Point(88, 360); ! this.buttonDownloadQuotesOfSelectedTickers.Name = "buttonDownloadQuotesOfSelectedTickers"; ! this.buttonDownloadQuotesOfSelectedTickers.Size = new System.Drawing.Size(112, 32); ! this.buttonDownloadQuotesOfSelectedTickers.TabIndex = 2; ! this.buttonDownloadQuotesOfSelectedTickers.Text = "Download quotes"; ! this.buttonDownloadQuotesOfSelectedTickers.Click += new System.EventHandler(this.buttonDownloadQuotesOfSelectedTickers_Click); ! // ! // labelNumberOfTickersToDownload ! // ! this.labelNumberOfTickersToDownload.Location = new System.Drawing.Point(152, 408); ! this.labelNumberOfTickersToDownload.Name = "labelNumberOfTickersToDownload"; ! this.labelNumberOfTickersToDownload.Size = new System.Drawing.Size(48, 24); ! this.labelNumberOfTickersToDownload.TabIndex = 4; ! this.labelNumberOfTickersToDownload.Text = "0"; ! // ! // labelTickersLeft ! // ! this.labelTickersLeft.Location = new System.Drawing.Point(8, 408); ! this.labelTickersLeft.Name = "labelTickersLeft"; ! this.labelTickersLeft.Size = new System.Drawing.Size(136, 24); ! this.labelTickersLeft.TabIndex = 5; ! this.labelTickersLeft.Text = "Tickers Left to download:"; ! // ! // dateTimePickerStartingDate ! // ! this.dateTimePickerStartingDate.Location = new System.Drawing.Point(96, 104); ! this.dateTimePickerStartingDate.Name = "dateTimePickerStartingDate"; ! this.dateTimePickerStartingDate.Size = new System.Drawing.Size(184, 20); ! this.dateTimePickerStartingDate.TabIndex = 6; ! // ! // labelStartingDateTime ! // ! this.labelStartingDateTime.Location = new System.Drawing.Point(8, 104); ! this.labelStartingDateTime.Name = "labelStartingDateTime"; ! this.labelStartingDateTime.Size = new System.Drawing.Size(80, 23); ! this.labelStartingDateTime.TabIndex = 8; ! this.labelStartingDateTime.Text = "Starting date"; ! // ! // radioButtonAllAvailableUntilNow ! // ! this.radioButtonAllAvailableUntilNow.Location = new System.Drawing.Point(8, 24); ! this.radioButtonAllAvailableUntilNow.Name = "radioButtonAllAvailableUntilNow"; ! this.radioButtonAllAvailableUntilNow.Size = new System.Drawing.Size(272, 24); ! this.radioButtonAllAvailableUntilNow.TabIndex = 10; ! this.radioButtonAllAvailableUntilNow.Text = "All available quotes until now, since starting date"; ! this.radioButtonAllAvailableUntilNow.CheckedChanged += new System.EventHandler(this.radioButtonAllAvailableUntilNow_CheckedChanged); ! // ! // radioButtonAllAvailableUntilNowSinceStartingDate ! // ! this.radioButtonAllAvailableUntilNowSinceStartingDate.Location = new System.Drawing.Point(8, 56); ! this.radioButtonAllAvailableUntilNowSinceStartingDate.Name = "radioButtonAllAvailableUntilNowSinceStartingDate"; ! this.radioButtonAllAvailableUntilNowSinceStartingDate.Size = new System.Drawing.Size(272, 24); ! this.radioButtonAllAvailableUntilNowSinceStartingDate.TabIndex = 12; ! this.radioButtonAllAvailableUntilNowSinceStartingDate.Text = "Change starting date"; ! // ! // groupBoxWebDownloaderOptions ! // ! this.groupBoxWebDownloaderOptions.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.radioButtonAllAvailableUntilNowSinceStartingDate, ! this.radioButtonAllAvailableUntilNow}); ! this.groupBoxWebDownloaderOptions.Location = new System.Drawing.Point(8, 8); ! this.groupBoxWebDownloaderOptions.Name = "groupBoxWebDownloaderOptions"; ! this.groupBoxWebDownloaderOptions.Size = new System.Drawing.Size(288, 88); ! this.groupBoxWebDownloaderOptions.TabIndex = 13; ! this.groupBoxWebDownloaderOptions.TabStop = false; ! this.groupBoxWebDownloaderOptions.Text = "Web Downloader options (source: Yahoo)"; ! // ! // checkBoxIsDicotomicSearchActivated ! // ! this.checkBoxIsDicotomicSearchActivated.Checked = true; ! this.checkBoxIsDicotomicSearchActivated.CheckState = System.Windows.Forms.CheckState.Checked; ! this.checkBoxIsDicotomicSearchActivated.Location = new System.Drawing.Point(16, 288); ! this.checkBoxIsDicotomicSearchActivated.Name = "checkBoxIsDicotomicSearchActivated"; ! this.checkBoxIsDicotomicSearchActivated.Size = new System.Drawing.Size(272, 24); ! this.checkBoxIsDicotomicSearchActivated.TabIndex = 13; ! this.checkBoxIsDicotomicSearchActivated.Text = "Use dicotomic search"; ! // ! // groupBoxUpdateDatabaseOptions ! // ! this.groupBoxUpdateDatabaseOptions.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.radioButtonDownloadBeforeMinAndAfterMax, ! this.radioButtonOverWriteNo, ! this.radioButtonOverWriteYes}); ! this.groupBoxUpdateDatabaseOptions.Location = new System.Drawing.Point(8, 136); ! this.groupBoxUpdateDatabaseOptions.Name = "groupBoxUpdateDatabaseOptions"; ! this.groupBoxUpdateDatabaseOptions.Size = new System.Drawing.Size(288, 144); ! this.groupBoxUpdateDatabaseOptions.TabIndex = 14; ! this.groupBoxUpdateDatabaseOptions.TabStop = false; ! this.groupBoxUpdateDatabaseOptions.Text = "Update Database options"; ! // ! // radioButtonDownloadBeforeMinAndAfterMax ! // ! this.radioButtonDownloadBeforeMinAndAfterMax.Enabled = false; ! this.radioButtonDownloadBeforeMinAndAfterMax.Location = new System.Drawing.Point(16, 24); ! this.radioButtonDownloadBeforeMinAndAfterMax.Name = "radioButtonDownloadBeforeMinAndAfterMax"; ! this.radioButtonDownloadBeforeMinAndAfterMax.Size = new System.Drawing.Size(248, 32); ! this.radioButtonDownloadBeforeMinAndAfterMax.TabIndex = 2; ! this.radioButtonDownloadBeforeMinAndAfterMax.Text = "Download only quotes that come before first quote or after last quote in database" + ! ""; ! // ! // radioButtonOverWriteNo ! // ! this.radioButtonOverWriteNo.Location = new System.Drawing.Point(16, 64); ! this.radioButtonOverWriteNo.Name = "radioButtonOverWriteNo"; ! this.radioButtonOverWriteNo.Size = new System.Drawing.Size(248, 32); ! this.radioButtonOverWriteNo.TabIndex = 1; ! this.radioButtonOverWriteNo.Text = "Download all quotes, adding to database only the missing ones"; ! // ! // radioButtonOverWriteYes ! // ! this.radioButtonOverWriteYes.Location = new System.Drawing.Point(16, 104); ! this.radioButtonOverWriteYes.Name = "radioButtonOverWriteYes"; ! this.radioButtonOverWriteYes.Size = new System.Drawing.Size(248, 32); ! this.radioButtonOverWriteYes.TabIndex = 0; ! this.radioButtonOverWriteYes.Text = "Download all quotes, overwriting the existing ones in database"; ! // ! // WebDownloader ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(584, 446); ! this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.groupBoxUpdateDatabaseOptions, ! this.groupBoxWebDownloaderOptions, ! this.labelStartingDateTime, ! this.dateTimePickerStartingDate, ! this.labelTickersLeft, ! this.labelNumberOfTickersToDownload, ! this.buttonDownloadQuotesOfSelectedTickers, ! this.dataGrid1, ! this.button1, ! this.checkBoxIsDicotomicSearchActivated}); ! this.Name = "WebDownloader"; ! this.Text = "Web downloader"; ! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); ! this.groupBoxWebDownloaderOptions.ResumeLayout(false); ! this.groupBoxUpdateDatabaseOptions.ResumeLayout(false); ! this.ResumeLayout(false); ! } #endregion ! #region Code not used anymore ! /* ! private void downloadQuotes_addRecord_toDatabase( string tiTicker , StreamReader sr) { *************** *** 262,266 **** } ! private void downloadQuotes_deleteFrom_quotes() { --- 423,428 ---- } ! ! private void downloadQuotes_deleteFrom_quotes() { *************** *** 271,281 **** "C:\\Documents and Settings\\Glauco\\My Documents\\Visual Studio Projects\\QuantProject\\csvFiles\\quotes.csv" , true); } ! ! private void downloadQuotes_createTickerDataSet( DataSet ds ) ! { ! System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1=new OleDbDataAdapter( "select * from tickers" , this.OleDbConnection1); ! oleDbDataAdapter1.Fill(ds); ! } ! private void downloadQuotes_forTicker_writeFile( string quTicker) { HttpWebRequest Req = (HttpWebRequest)WebRequest.Create("http:" + "//table.finance.yahoo.com/table.csv?a=1&b=1&c=1990&d=5&e=12&f=2003&s=" + quTicker + "&y=0&g=d&ignore=.csv"); --- 433,438 ---- "C:\\Documents and Settings\\Glauco\\My Documents\\Visual Studio Projects\\QuantProject\\csvFiles\\quotes.csv" , true); } ! ! private void downloadQuotes_forTicker_writeFile( string quTicker) { HttpWebRequest Req = (HttpWebRequest)WebRequest.Create("http:" + "//table.finance.yahoo.com/table.csv?a=1&b=1&c=1990&d=5&e=12&f=2003&s=" + quTicker + "&y=0&g=d&ignore=.csv"); *************** *** 337,341 **** --- 494,503 ---- downloadQuotes_forTicker_importFile( quTicker ); } + + */ + #endregion + + private void downloadQuotes_withTickerDataSet_create_dsTickerCurrentlyDownloaded( DataTable dt ) { *************** *** 348,356 **** this.dataGrid1.DataSource = this.DsTickerCurrentlyDownloaded.Tables[ "Tickers" ]; } - } private void downloadQuotes_withTickerDataSet( DataSet ds ) { downloadQuotes_withTickerDataSet_create_dsTickerCurrentlyDownloaded( ds.Tables[0] ); foreach (DataRow myRow in ds.Tables[0].Rows) --- 510,518 ---- this.dataGrid1.DataSource = this.DsTickerCurrentlyDownloaded.Tables[ "Tickers" ]; } } private void downloadQuotes_withTickerDataSet( DataSet ds ) { + Cursor.Current = Cursors.WaitCursor; downloadQuotes_withTickerDataSet_create_dsTickerCurrentlyDownloaded( ds.Tables[0] ); foreach (DataRow myRow in ds.Tables[0].Rows) *************** *** 358,366 **** //if (this.dsTickerCurrentlyDownloaded.Tables[ "Tickers" ].Rows.Count>5) // Monitor.Wait( this.dsTickerCurrentlyDownloaded.Tables[ "Tickers" ] ); - TickerDownloader qd = new TickerDownloader( this , myRow , myRow["tiTicker"].ToString() , ds.Tables[0].Rows.Count ); //Thread newThread = new Thread( new ThreadStart( qd.downloadTicker)); //newThread.Start(); ! qd.downloadTicker(); //newThread.Join(); //qd.downloadTicker(); --- 520,535 ---- //if (this.dsTickerCurrentlyDownloaded.Tables[ "Tickers" ].Rows.Count>5) // Monitor.Wait( this.dsTickerCurrentlyDownloaded.Tables[ "Tickers" ] ); TickerDownloader qd = new TickerDownloader( this , myRow , myRow["tiTicker"].ToString() , ds.Tables[0].Rows.Count ); //Thread newThread = new Thread( new ThreadStart( qd.downloadTicker)); //newThread.Start(); ! if(this.radioButtonAllAvailableUntilNowSinceStartingDate.Checked) ! { ! qd.DownloadTicker(this.dateTimePickerStartingDate.Value); ! } ! else ! { ! qd.DownloadTicker(); ! } ! Cursor.Current = Cursors.Default; //newThread.Join(); //qd.downloadTicker(); *************** *** 368,433 **** //ImportQuotesCsv iqc = new ImportQuotesCsv(); } ! ! private void downloadQuotes() { DataSet ds=new DataSet(); - //downloadQuotes_deleteFrom_quotes() - csv files aren't used anymore; downloadQuotes_createTickerDataSet( ds ); - //this.OleDbConnection1.Open(); downloadQuotes_withTickerDataSet( ds ); this.OleDbConnection1.Close(); } ! private void downloadQuotes(DataTable tableOfSelectedTickers) ! { ! DataSet ds=new DataSet(); ! ds.Tables.Add(tableOfSelectedTickers); ! //this.OleDbConnection1.Open(); ! downloadQuotes_withTickerDataSet( ds ); ! this.OleDbConnection1.Close(); ! } ! ! private void openDbAndExecuteNonQuery() ! { ! try ! { ! Cursor.Current = Cursors.WaitCursor; ! this.OleDbConnection1.Open(); ! oleDbCommand1.Connection = this.OleDbConnection1; ! this.oleDbCommand1.ExecuteNonQuery(); ! ! } ! catch(Exception ex) ! { ! MessageBox.Show(ex.ToString()); ! } ! ! finally ! { ! this.OleDbConnection1.Close(); ! Cursor.Current = Cursors.Default; ! } ! ! } private void button1_Click(object sender, System.EventArgs e) { ! this.openDbAndExecuteNonQuery(); ! downloadQuotes(); } ! private void Form1_Load(object sender, System.EventArgs e) { ! } ! private void buttonDownloadQuotesOfSelectedTickers_Click(object sender, System.EventArgs e) ! { ! this.openDbAndExecuteNonQuery(); ! downloadQuotes(this.tableOfSelectedTickers); ! ! } ! } ! } --- 537,613 ---- //ImportQuotesCsv iqc = new ImportQuotesCsv(); } ! ! private void downloadQuotes_createTickerDataSet( DataSet ds ) ! { ! System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1=new OleDbDataAdapter( "select * from tickers" , this.OleDbConnection1); ! oleDbDataAdapter1.Fill(ds); ! } ! ! private void downloadQuotesOfAllTickers() { DataSet ds=new DataSet(); downloadQuotes_createTickerDataSet( ds ); downloadQuotes_withTickerDataSet( ds ); this.OleDbConnection1.Close(); } + ! private void downloadQuotesOfSelectedTickers() ! { ! DataSet ds=new DataSet(); ! ds.Tables.Add(this.tableOfSelectedTickers); ! downloadQuotes_withTickerDataSet( ds ); ! this.OleDbConnection1.Close(); ! } ! ! private void openDbAndSetOleDbCommand() ! { ! try ! { ! Cursor.Current = Cursors.WaitCursor; ! this.OleDbConnection1.Open(); ! oleDbCommand1.Connection = this.OleDbConnection1; ! //this.oleDbCommand1.ExecuteNonQuery(); ! // NOTE that the execution of the previous line ! // causes the deletion of all records in quotes ! ! ! } ! catch(Exception ex) ! { ! MessageBox.Show(ex.ToString()); ! } ! ! finally ! { ! this.OleDbConnection1.Close(); ! Cursor.Current = Cursors.Default; ! } ! ! } private void button1_Click(object sender, System.EventArgs e) { ! this.openDbAndSetOleDbCommand(); ! this.downloadQuotesOfAllTickers(); } ! private void buttonDownloadQuotesOfSelectedTickers_Click(object sender, System.EventArgs e) { ! this.openDbAndSetOleDbCommand(); ! this.downloadQuotesOfSelectedTickers(); } ! private void radioButtonAllAvailableUntilNow_CheckedChanged(object sender, System.EventArgs e) ! { ! if(this.radioButtonAllAvailableUntilNow.Checked == true) ! { ! this.dateTimePickerStartingDate.Enabled = false; ! } ! else ! { ! this.dateTimePickerStartingDate.Enabled = true; ! } ! } } + } |
|
From: Marco M. <mi...@us...> - 2004-03-21 19:40:38
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5757/Downloader Modified Files: TickerDownloader.cs Log Message: Useless code has been deleted and some methods renamed; added methods to perform dicotomic search on tickers'quotes Index: TickerDownloader.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerDownloader.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TickerDownloader.cs 30 Nov 2003 22:38:51 -0000 1.2 --- TickerDownloader.cs 21 Mar 2004 19:30:28 -0000 1.3 *************** *** 17,27 **** private string p_quTicker; private int p_numRows; ! private DateTime startDate = new DateTime( 2000 , 1 , 1 ); private DateTime endDate = DateTime.Today; private int endDay = DateTime.Now.Day; private int endMonth = DateTime.Now.Month; private int endYear = DateTime.Now.Year; public TickerDownloader( WebDownloader myForm, DataRow currentDataTickerRow, string quTicker , int numRows ) { p_myForm = myForm; p_currentDataTickerRow = currentDataTickerRow; --- 17,29 ---- private string p_quTicker; private int p_numRows; ! private DateTime startDate; private DateTime endDate = DateTime.Today; private int endDay = DateTime.Now.Day; private int endMonth = DateTime.Now.Month; private int endYear = DateTime.Now.Year; + private DateTime INITIAL_DATE = new DateTime(1980, 1, 1); public TickerDownloader( WebDownloader myForm, DataRow currentDataTickerRow, string quTicker , int numRows ) { + this.startDate = this.INITIAL_DATE; p_myForm = myForm; p_currentDataTickerRow = currentDataTickerRow; *************** *** 30,58 **** this.oleDbConnection1 = myForm.OleDbConnection1; } - private void addTickerTo_gridDataSet() - { - - DataRow newRow = p_myForm.DsTickerCurrentlyDownloaded.Tables[ "Tickers" ].NewRow(); - newRow[ "tiTicker" ] = p_quTicker; - newRow[ "currentState" ] = "Start"; - //lock( p_myForm.dsTickerCurrentlyDownloaded.Tables[ "Tickers" ].Rows ) - //{ - try - { - //MessageBox.Show( (p_myForm == null).ToString() ); - //MessageBox.Show( (p_myForm.dsTickerCurrentlyDownloaded == null).ToString() ); - //MessageBox.Show( (p_myForm.dsTickerCurrentlyDownloaded.Tables[ "Tickers" ] == null).ToString() ); - //MessageBox.Show( (p_myForm.dsTickerCurrentlyDownloaded.Tables[ "Tickers" ].Rows == null).ToString() ); - //MessageBox.Show( (newRow == null).ToString() ); - p_myForm.DsTickerCurrentlyDownloaded.Tables[ "Tickers" ].Rows.Add( newRow ); - } - catch (Exception ex) - { - MessageBox.Show( ex.ToString() ); - } - //} - p_myForm.dataGrid1.Refresh(); - } private void removeTickerFrom_gridDataSet() { --- 32,37 ---- this.oleDbConnection1 = myForm.OleDbConnection1; } + /* private void removeTickerFrom_gridDataSet() { *************** *** 65,68 **** --- 44,48 ---- p_myForm.dataGrid1.Refresh(); } + */ private void updateCurrentStatus( string newState ) { *************** *** 89,93 **** odc.ExecuteNonQuery(); } ! private void writeFile_tickerCsv_forNextTimeFrame( DateTime currBeginDate , DateTime currEndDate ) { int a = currBeginDate.Month - 1; --- 69,74 ---- odc.ExecuteNonQuery(); } ! ! private void importTickerForCurrentTimeFrame( DateTime currBeginDate , DateTime currEndDate ) { int a = currBeginDate.Month - 1; *************** *** 99,103 **** int numTrials = 1; - //updateCurrentStatus( " 1 " ); while (numTrials < 5) { --- 80,83 ---- *************** *** 107,139 **** HttpWebRequest Req = (HttpWebRequest)WebRequest.Create("http:" + "//table.finance.yahoo.com/table.csv?a=" + a + "&b=" + b + "&c=" + c +"&d=" + d + "&e=" + e + "&f=" + f + "&s=" + p_quTicker + "&y=0&g=d&ignore=.csv"); - Req.Method = "GET"; ! Req.Timeout = 10000; ! HttpWebResponse hwr = (HttpWebResponse)Req.GetResponse(); - - //updateCurrentStatus( " 2 " ); Stream strm = hwr.GetResponseStream(); - //updateCurrentStatus( " 3 " ); StreamReader sr = new StreamReader(strm); ! // StreamWriter sw=new StreamWriter( "C:\\Documents and Settings\\Glauco\\My Documents\\Visual Studio Projects\\QuantProject\\csvFiles\\" + p_quTicker + ".csv"); ! // sw.Write(myString); ! // sw.Close(); DataBaseImporter dataBaseImporter = ! new DataBaseImporter( this.oleDbConnection1 , sr ); dataBaseImporter.ImportTicker( p_quTicker ); sr.Close(); strm.Close(); ! ! ! // import_tickerCsv_into_quotesCsv(); ! updateCurrentStatus( d + "/" + e + "/" + f ); numTrials = 6 ; - //updateCurrentStatus( " scritto file! " ); } catch (Exception exception) { MessageBox.Show( exception.ToString() ); ! updateCurrentStatus( "Tentativo: " + numTrials ); numTrials++; if (numTrials > 5) --- 87,110 ---- HttpWebRequest Req = (HttpWebRequest)WebRequest.Create("http:" + "//table.finance.yahoo.com/table.csv?a=" + a + "&b=" + b + "&c=" + c +"&d=" + d + "&e=" + e + "&f=" + f + "&s=" + p_quTicker + "&y=0&g=d&ignore=.csv"); Req.Method = "GET"; ! Req.Timeout = 25000; HttpWebResponse hwr = (HttpWebResponse)Req.GetResponse(); Stream strm = hwr.GetResponseStream(); StreamReader sr = new StreamReader(strm); ! DataBaseImporter dataBaseImporter = ! new DataBaseImporter( this.oleDbConnection1 , sr, this.p_myForm.radioButtonOverWriteYes.Checked ); dataBaseImporter.ImportTicker( p_quTicker ); sr.Close(); strm.Close(); ! hwr.Close(); ! ! updateCurrentStatus( d + "/" + e + "/" + f ); numTrials = 6 ; } catch (Exception exception) { MessageBox.Show( exception.ToString() ); ! updateCurrentStatus( "Trial: " + numTrials ); numTrials++; if (numTrials > 5) *************** *** 142,147 **** } } ! private void writeFile_tickerCsv() { DateTime currBeginDate = new DateTime(); currBeginDate = startDate; --- 113,122 ---- } } ! ! private void setTimeFrameAndImportTickerForEachTimeFrame(double numDaysOfTimeFrame) { + if(numDaysOfTimeFrame == 0) + return; + DateTime currBeginDate = new DateTime(); currBeginDate = startDate; *************** *** 149,188 **** { DateTime currEndDate = new DateTime(); ! if ( DateTime.Compare( DateTime.Today , currBeginDate.AddDays( 200 ) ) < 0 ) currEndDate = DateTime.Today; else ! currEndDate = currBeginDate.AddDays( 200 ); ! writeFile_tickerCsv_forNextTimeFrame( currBeginDate , currEndDate ); currBeginDate = currEndDate.AddDays( 1 ); } } ! private void import_tickerCsv_into_quotesCsv() { ! string sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + ! "C:\\Documents and Settings\\Glauco\\My Documents\\Visual Studio Projects\\QuantProject\\csvFiles\\" + ! ";Extended Properties=\"Text;HDR=YES;FMT=Delimited\""; ! ! System.Data.OleDb.OleDbConnection objConn = new System.Data.OleDb.OleDbConnection(sConnectionString); ! objConn.Open(); ! System.Data.OleDb.OleDbCommand odCommand = new System.Data.OleDb.OleDbCommand(); ! odCommand.Connection = objConn; try { ! odCommand.CommandText = "insert into quotes.csv SELECT '" + p_quTicker + "' as Ticker, * FROM " + p_quTicker + ".csv"; ! odCommand.ExecuteNonQuery(); ! } catch (Exception ex) { MessageBox.Show( ex.ToString() ); } ! objConn.Close(); } ! public void downloadTicker() ! { { ! addTickerTo_gridDataSet(); ! writeFile_tickerCsv(); //Monitor.Pulse( p_myForm.dsTickerCurrentlyDownloaded.Tables[ "Tickers" ] ); } } } --- 124,288 ---- { DateTime currEndDate = new DateTime(); ! if ( DateTime.Compare( DateTime.Today , currBeginDate.AddDays( numDaysOfTimeFrame ) ) < 0 ) currEndDate = DateTime.Today; else ! currEndDate = currBeginDate.AddDays( numDaysOfTimeFrame ); ! this.importTickerForCurrentTimeFrame ( currBeginDate , currEndDate ); currBeginDate = currEndDate.AddDays( 1 ); } } ! ! private void addTickerTo_gridDataSet() { ! DataRow newRow = p_myForm.DsTickerCurrentlyDownloaded.Tables[ "Tickers" ].NewRow(); ! newRow[ "tiTicker" ] = p_quTicker; ! newRow[ "currentState" ] = "Searching ..."; try { ! p_myForm.DsTickerCurrentlyDownloaded.Tables[ "Tickers" ].Rows.Add( newRow ); ! p_myForm.labelNumberOfTickersToDownload.Text = ! Convert.ToString(Convert.ToInt16(p_myForm.labelNumberOfTickersToDownload.Text) - 1); ! } catch (Exception ex) { MessageBox.Show( ex.ToString() ); } ! p_myForm.dataGrid1.Refresh(); } ! ! public void DownloadTicker() { ! // update grid in webdownloader form ! addTickerTo_gridDataSet(); ! /* if(tickerIsInDatabase && p_myForm.UpdateFlagYes) ! { ! // try to import ticker before the first quote ! ! // try to import ticker after the last quote ! } ! else ! // tickers'quotes are downloaded for the first time ! {*/ ! if(this.p_myForm.checkBoxIsDicotomicSearchActivated.Checked == true) ! this.startDate = firstAvailableDateOnYahoo(this.INITIAL_DATE, this.endDate); ! setTimeFrameAndImportTickerForEachTimeFrame(200); ! ! //} ! //Monitor.Pulse( p_myForm.dsTickerCurrentlyDownloaded.Tables[ "Tickers" ] ); } + public void DownloadTicker(DateTime startingDate) + { + this.INITIAL_DATE = startingDate; + this.DownloadTicker(); + + } + + + private bool isAtLeastOneDateAvailable(StreamReader streamReader, int daysToBeTested) + { + string Line; + Line = streamReader.ReadLine(); + // column headers are read + Line = streamReader.ReadLine(); + //actual values are read + bool isOneDateAvailableInNextDaysToBeTested = false; + int numDays = 1; + while(numDays < daysToBeTested) + { + if(Line != null) + { + isOneDateAvailableInNextDaysToBeTested = true; + numDays = daysToBeTested + 1; + } + numDays++; + + } + return isOneDateAvailableInNextDaysToBeTested; + + } + + + private bool getResponseForTimeWindow( DateTime initialDateOfTheTimeWindow, + int daysOfTheTimeWindow ) + { + int a = initialDateOfTheTimeWindow.Month - 1; + int b = initialDateOfTheTimeWindow.Day; + int c = initialDateOfTheTimeWindow.Year; + DateTime endDateOfTheTimeWindow = initialDateOfTheTimeWindow.AddDays(daysOfTheTimeWindow); + int d = endDateOfTheTimeWindow.Month - 1; + int e = endDateOfTheTimeWindow.Day; + int f = endDateOfTheTimeWindow.Year; + HttpWebRequest Req; + HttpWebResponse hwr; + Stream strm; + StreamReader sr; + bool response = false; + int numTrials = 1; + while(numTrials < 5) + { + try + { + Req = (HttpWebRequest)WebRequest.Create("http:" + "//table.finance.yahoo.com/table.csv?a=" + + a + "&b=" + b + "&c=" + c +"&d=" + d + "&e=" + e + "&f=" + f + "&s=" + p_quTicker + "&y=0&g=d&ignore=.csv"); + Req.Method = "GET"; + Req.Timeout = 20000; + hwr = (HttpWebResponse)Req.GetResponse(); + strm = hwr.GetResponseStream(); + sr = new StreamReader(strm); + response = this.isAtLeastOneDateAvailable(sr, daysOfTheTimeWindow ); + sr.Close(); + strm.Close(); + hwr.Close(); + numTrials = 6; + } + catch (Exception exception) + { + MessageBox.Show( exception.ToString() + "\n\n for: " + initialDateOfTheTimeWindow.ToString()); + numTrials++; + } + } + return response; + } + private DateTime getMiddleDate(DateTime startingDate, + DateTime endingDate) + { + DateTime middleDate; + double differenceInDays = endingDate.Subtract(startingDate).Days; + middleDate = startingDate.AddDays(differenceInDays / 2); + return middleDate; + } + + + private DateTime firstAvailableDateOnYahoo(DateTime startingDate, + DateTime endingDate) + { + + if(startingDate == this.INITIAL_DATE) + // at the first call, when the actual parameters are INITIAL_DATE and now + // the dicotomic search may be useless ... + if(getResponseForTimeWindow(startingDate, 10) == true) + { + return startingDate; + } + + DateTime middleDate = getMiddleDate(startingDate, endingDate); + + if(endingDate.Subtract(startingDate).Days <= 10) + { + return startingDate; + } + else + { + if (getResponseForTimeWindow(middleDate, 10) == true) + { + return firstAvailableDateOnYahoo(startingDate, middleDate); + } + else + { + return firstAvailableDateOnYahoo(middleDate, endingDate); + } + } + } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:18:40
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6929 Modified Files: QuantProject.suo Log Message: no message Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 Binary files /tmp/cvsawl6nE and /tmp/cvsmcVeYm differ |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:16:15
|
Update of /cvsroot/quantproject/QuantDownloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6443 Modified Files: QuantDownloader.suo Log Message: - added the ValidationDataGrid class - added the ValidationGridTabPage class - added the ValidationTabControl class - added the ValidationTabPage class - added the VisualValidationChart class - added the VisualValidationDataGrid class - added the VisualValidationTabPage class - added the CloseToCloseDataGrid class - added the CloseToCloseTabPage class - added the OHLCtabPage class - added the RangeToRangeChart class - added the RangeToRangeDataGrid class - added the RangeToRangeTabPage class Index: QuantDownloader.suo =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/QuantDownloader.suo,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 Binary files /tmp/cvsq49Yxf and /tmp/cvscjELjF differ |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:15:53
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6403/Downloader Modified Files: Downloader.csproj Log Message: - added the ValidationDataGrid class - added the ValidationGridTabPage class - added the ValidationTabControl class - added the ValidationTabPage class - added the VisualValidationChart class - added the VisualValidationDataGrid class - added the VisualValidationTabPage class - added the CloseToCloseDataGrid class - added the CloseToCloseTabPage class - added the OHLCtabPage class - added the RangeToRangeChart class - added the RangeToRangeDataGrid class - added the RangeToRangeTabPage class Index: Downloader.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Downloader.csproj,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Downloader.csproj 4 Feb 2004 19:27:10 -0000 1.12 --- Downloader.csproj 21 Mar 2004 17:05:45 -0000 1.13 *************** *** 237,241 **** <File RelPath = "QuotesEditor\QuotesChart.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 237,241 ---- <File RelPath = "QuotesEditor\QuotesChart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> *************** *** 246,251 **** /> <File RelPath = "QuotesEditor\CloseToClose\CloseToCloseChart.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 246,291 ---- /> <File + RelPath = "QuotesEditor\QuotesEditor.resx" + DependentUpon = "QuotesEditor.cs" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "QuotesEditor\ValidationDataGrid.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File + RelPath = "QuotesEditor\ValidationGridTabPage.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File + RelPath = "QuotesEditor\ValidationTabControl.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File + RelPath = "QuotesEditor\ValidationTabPage.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File + RelPath = "QuotesEditor\VisualValidationChart.cs" + SubType = "UserControl" + BuildAction = "Compile" + /> + <File + RelPath = "QuotesEditor\VisualValidationDataGrid.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File + RelPath = "QuotesEditor\VisualValidationTabPage.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File RelPath = "QuotesEditor\CloseToClose\CloseToCloseChart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> *************** *** 256,266 **** /> <File ! RelPath = "QuotesEditor\CloseToClose\CloseToCloseUserControl.cs" ! SubType = "UserControl" BuildAction = "Compile" /> <File ! RelPath = "QuotesEditor\CloseToClose\CloseToCloseUserControl.resx" ! DependentUpon = "CloseToCloseUserControl.cs" BuildAction = "EmbeddedResource" /> --- 296,311 ---- /> <File ! RelPath = "QuotesEditor\CloseToClose\CloseToCloseDataGrid.resx" ! DependentUpon = "CloseToCloseDataGrid.cs" ! BuildAction = "EmbeddedResource" ! /> ! <File ! RelPath = "QuotesEditor\CloseToClose\CloseToCloseTabPage.cs" ! SubType = "Component" BuildAction = "Compile" /> <File ! RelPath = "QuotesEditor\CloseToClose\CloseToCloseTabPage.resx" ! DependentUpon = "CloseToCloseTabPage.cs" BuildAction = "EmbeddedResource" /> *************** *** 271,274 **** --- 316,324 ---- /> <File + RelPath = "QuotesEditor\OHLC\OHLCtabPage.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File RelPath = "QuotesEditor\OHLC\OHLCuserControl.cs" SubType = "UserControl" *************** *** 281,284 **** --- 331,349 ---- /> <File + RelPath = "QuotesEditor\RangeToRange\RangeToRangeChart.cs" + SubType = "UserControl" + BuildAction = "Compile" + /> + <File + RelPath = "QuotesEditor\RangeToRange\RangeToRangeDataGrid.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File + RelPath = "QuotesEditor\RangeToRange\RangeToRangeTabPage.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File RelPath = "Validate\IValidator.cs" SubType = "Code" |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:11:02
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/CloseToClose In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5372/CloseToClose Modified Files: CloseToCloseChart.cs Log Message: Displays the charts for the quotes within the interval around the quotes with suspicious Close To Close ratio Index: CloseToCloseChart.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/CloseToClose/CloseToCloseChart.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CloseToCloseChart.cs 25 Jan 2004 14:49:10 -0000 1.1 --- CloseToCloseChart.cs 21 Mar 2004 17:00:53 -0000 1.2 *************** *** 74,78 **** Console.WriteLine( "CloseToCloseChart.OnPaint()" ); this.Clear(); ! this.history = DataProvider.GetCloseHistory( this.ticker ); this.onPaint_setTimeInterval(); this.Add( this.history , Color.Red , this.startDateTime , this.endDateTime ); --- 74,78 ---- Console.WriteLine( "CloseToCloseChart.OnPaint()" ); this.Clear(); ! this.history = DataProvider.GetCloseHistory( ((QuotesEditor)this.FindForm()).Ticker ); this.onPaint_setTimeInterval(); this.Add( this.history , Color.Red , this.startDateTime , this.endDateTime ); |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:10:15
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/CloseToClose In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5201/CloseToClose Modified Files: CloseToCloseDataGrid.cs Log Message: Contains the quotes with suspicious close to close ratio Index: CloseToCloseDataGrid.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/CloseToClose/CloseToCloseDataGrid.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CloseToCloseDataGrid.cs 25 Jan 2004 14:53:06 -0000 1.1 --- CloseToCloseDataGrid.cs 21 Mar 2004 17:00:02 -0000 1.2 *************** *** 24,27 **** --- 24,28 ---- using System.Data; using System.Windows.Forms; + using QuantProject.DataAccess.Tables; using QuantProject.Applications.Downloader.Validate; *************** *** 31,53 **** /// Contains the quotes with suspicious close to close ratio /// </summary> ! public class CloseToCloseDataGrid : QuotesDataGrid { public CloseToCloseDataGrid() - { - } - public void DataBind( ValidateDataTable validateDataTable ) { ! DataView dataView = new DataView( validateDataTable ); ! dataView.RowFilter = "ValidationWarning=" + ! Convert.ToInt16( ValidationWarning.SuspiciousCloseToCloseRatio ); ! for (int i=0; i<TableStyles[ "quotes" ].GridColumnStyles.Count; i++) { DataGridColumnStyle dataGridColumnStyle = this.TableStyles[ "quotes" ].GridColumnStyles[i]; if ( ( dataGridColumnStyle.HeaderText != "Date" ) && ! ( dataGridColumnStyle.HeaderText != "Close" ) ) this.TableStyles[ "quotes" ].GridColumnStyles.Remove( dataGridColumnStyle ); } this.DataSource = dataView; } ! } } --- 32,128 ---- /// Contains the quotes with suspicious close to close ratio /// </summary> ! public class CloseToCloseDataGrid : ValidationDataGrid { + private DataView dataView; + + private bool styleIsDefined = false; + public CloseToCloseDataGrid() { ! } ! #region setStyles ! private void setStyles_set_DataGridBoolColumn_FalseValueChanged(object sender, EventArgs e) ! { ! MessageBox.Show( "Prova" ); ! } ! private void setStyles_set_DataGridBoolColumn() ! { ! DataGridBoolColumn dataGridBoolColumn = new DataGridBoolColumn(); ! dataGridBoolColumn.MappingName = "CloseToCloseHasBeenVisuallyValidated"; ! dataGridBoolColumn.HeaderText = "Ok?"; ! dataGridBoolColumn.Width = 30; ! dataGridBoolColumn.AllowNull = false; ! // quiiii!!!!! ! // dataGridBoolColumn. += ! // new System.EventHandler( this.setStyles_set_DataGridBoolColumn_FalseValueChanged ); ! this.TableStyles[ "quotes" ].GridColumnStyles.Add( dataGridBoolColumn ); ! this.styleIsDefined = true; ! } ! public void setStyles() ! { ! // this.TableStyles.Clear(); ! int i=0; ! while (i<TableStyles[ "quotes" ].GridColumnStyles.Count) { DataGridColumnStyle dataGridColumnStyle = this.TableStyles[ "quotes" ].GridColumnStyles[i]; if ( ( dataGridColumnStyle.HeaderText != "Date" ) && ! ( dataGridColumnStyle.HeaderText != "Adj. Close" ) ) this.TableStyles[ "quotes" ].GridColumnStyles.Remove( dataGridColumnStyle ); + else + i++; } + setStyles_set_DataGridBoolColumn(); + } + #endregion + public override void DataBind() + { + ValidateDataTable validateDataTable = ((QuotesEditor)this.FindForm()).ValidateDataTable; + this.dataView = new DataView( validateDataTable ); + this.dataView.RowFilter = "ValidationWarning=" + + Convert.ToInt16( ValidationWarning.SuspiciousCloseToCloseRatio ); this.DataSource = dataView; + this.dataView.AllowNew = false; + this.setStyles(); } ! private void confirmVisualValidation() ! { ! VisuallyValidatedTickers.ValidateCloseToClose( ((QuotesEditor)this.FindForm()).Ticker ); ! } ! protected override void OnClick( EventArgs e ) ! { ! Console.WriteLine( "CloseToCloseDataGrid.OnClick()" ); ! if (this.TableStyles[0].GridColumnStyles[this.CurrentCell.ColumnNumber] is ! DataGridBoolColumn) ! { ! 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 close to close ratios have been visually validated ! if ( MessageBox.Show( this , "You have visually validated all the suspicious " + ! "quotes, with respect to the close to close ratio. 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 ) ! { ! Console.WriteLine( "CloseToCloseDataGrid.OnPaint()" ); ! if ( !this.styleIsDefined ) ! // no style has been defined yet ! this.DataBind(); ! base.OnPaint( e ); ! } ! } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:10:07
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/CloseToClose In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5092/CloseToClose Added Files: CloseToCloseTabPage.cs Log Message: This TabPage will contain the Close to Close visual validation controls --- NEW FILE: CloseToCloseTabPage.cs --- using System; using System.Drawing; using System.Windows.Forms; using QuantProject.Applications.Downloader.Validate; namespace QuantProject.Applications.Downloader { /// <summary> /// This TabPage will contain the Close to /// Close visual validation controls /// </summary> public class CloseToCloseTabPage : ValidationGridTabPage { private CloseToCloseDataGrid closeToCloseDataGrid; private CloseToCloseChart closeToCloseChart; private int closeToCloseDataGridWidth = 150; // private ValidateDataTable validateDataTable; private string ticker; public string Ticker { get { return this.ticker; } set { this.ticker = value; } } public CloseToCloseTabPage() { this.Text = "Close To Close"; initializeCloseToCloseDataGrid(); initializeCloseToCloseChart(); } #region initializeCloseToCloseDataGrid private void closeToCloseDataGrid_mouseUp(object sender, MouseEventArgs e) { Console.WriteLine( this.closeToCloseDataGrid[ this.closeToCloseDataGrid.CurrentRowIndex , 0 ] ); this.closeToCloseChart.SuspiciousDateTime = (DateTime)this.closeToCloseDataGrid[ this.closeToCloseDataGrid.CurrentRowIndex , 0 ]; this.closeToCloseChart.Invalidate(); } private void initializeCloseToCloseDataGrid() { this.closeToCloseDataGrid = new CloseToCloseDataGrid(); this.dataGrid = this.closeToCloseDataGrid; this.closeToCloseDataGrid.Location = new Point( 0 , 0 ); this.closeToCloseDataGrid.Width = this.closeToCloseDataGridWidth; this.closeToCloseDataGrid.MouseUp += new MouseEventHandler( this.closeToCloseDataGrid_mouseUp ); this.Controls.Add( this.closeToCloseDataGrid ); } #endregion private void initializeCloseToCloseChart() { this.closeToCloseChart = new CloseToCloseChart(); this.closeToCloseChart.Location = new Point( closeToCloseDataGridWidth + 5 , 0 ); this.Controls.Add( this.closeToCloseChart ); } protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Console.WriteLine( "CloseToClosePageTab.OnPaint()" ); this.closeToCloseDataGrid.DataBind(); if ( this.closeToCloseDataGrid.VisibleRowCount > 0 ) { this.closeToCloseChart.Ticker = this.ticker; this.closeToCloseChart.SuspiciousDateTime = (DateTime)this.closeToCloseDataGrid[ this.closeToCloseDataGrid.CurrentRowIndex , 0 ]; this.closeToCloseDataGrid.Height = this.Height - 10; this.closeToCloseChart.Width = this.Width - this.closeToCloseDataGridWidth - 5; this.closeToCloseChart.Height = this.Height - 10; } base.OnPaint( e ); } /// <summary> /// clears the contained objects /// </summary> public void Clear() { this.closeToCloseDataGrid.DataSource = null; } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:08:48
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/OHLC In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4855/OHLC Added Files: OHLCtabPage.cs Log Message: This TabPage will contain the Open High Low Close inconsistencies --- NEW FILE: OHLCtabPage.cs --- using System; using System.Data; using System.Drawing; using System.Windows.Forms; using QuantProject.Applications.Downloader.Validate; namespace QuantProject.Applications.Downloader { /// <summary> /// This TabPage will contain the Open High Low Close inconsistencies /// </summary> public class OHLCtabPage : ValidationGridTabPage { private OHLCdataGrid ohlcDataGrid; public OHLCtabPage() { this.Text = "OHLC"; initialize_ohlcDataGrid(); this.dataGrid = this.ohlcDataGrid; } private void initialize_ohlcDataGrid() { this.ohlcDataGrid = new OHLCdataGrid(); this.ohlcDataGrid.Location = new Point( 0 , 0 ); this.Controls.Add( this.ohlcDataGrid ); } protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { this.ohlcDataGrid.Width = this.Parent.Width - 10; this.ohlcDataGrid.DataBind(); base.OnPaint( e ); } /// <summary> /// clears the contained objects /// </summary> public void Clear() { this.ohlcDataGrid.DataSource = null; } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:07:51
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/RangeToRange In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4495/RangeToRange Added Files: RangeToRangeChart.cs Log Message: VisualValidationChart to contain charts for quotes with Range to Range suspicious ratios --- NEW FILE: RangeToRangeChart.cs --- using System; using System.Drawing; using QuantProject.ADT.Histories; using QuantProject.Data; using QuantProject.Presentation.Charting; namespace QuantProject.Applications.Downloader { /// <summary> /// VisualValidationChart to contain charts for quotes with /// Range to Range suspicious ratios /// </summary> public class RangeToRangeChart : VisualValidationChart { public RangeToRangeChart() { // // TODO: Add constructor logic here // } protected override void addHistories() { History lowHistory = DataProvider.GetLowHistory( ((QuotesEditor)this.FindForm()).Ticker ); this.add( lowHistory , Color.Green ); History highHistory = DataProvider.GetHighHistory( ((QuotesEditor)this.FindForm()).Ticker ); this.add( highHistory , Color.Blue ); } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:06:19
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/RangeToRange In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4270/RangeToRange Added Files: RangeToRangeDataGrid.cs Log Message: VisualValidationDataGrid to contain quotes with Range to Range suspicious ratios --- NEW FILE: RangeToRangeDataGrid.cs --- using System; using QuantProject.Applications.Downloader.Validate; namespace QuantProject.Applications.Downloader { /// <summary> /// VisualValidationDataGrid to contain quotes with /// Range to Range suspicious ratios /// </summary> public class RangeToRangeDataGrid : VisualValidationDataGrid { public RangeToRangeDataGrid() { this.validationWarning = ValidationWarning.SuspiciousRangeToRangeRatio; } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:04:47
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/RangeToRange In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3899/RangeToRange Added Files: RangeToRangeTabPage.cs Log Message: VisualValidationTabPage to contain Range to Range suspicious ratios --- NEW FILE: RangeToRangeTabPage.cs --- using System; namespace QuantProject.Applications.Downloader { /// <summary> /// VisualValidationTabPage to contain Range to Range /// suspicious ratios /// </summary> public class RangeToRangeTabPage : VisualValidationTabPage { public RangeToRangeTabPage() { this.Text = "Range To Range"; this.VisualValidationDataGrid = new RangeToRangeDataGrid(); this.dataGrid = this.VisualValidationDataGrid; this.VisualValidationChart = new RangeToRangeChart(); } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:03:34
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3602 Added Files: ValidationDataGrid.cs Log Message: DataGrid to be displayed within a ValidationGridTabPage --- NEW FILE: ValidationDataGrid.cs --- using System; namespace QuantProject.Applications.Downloader { /// <summary> /// DataGrid to be displayed within a ValidationGridTabPage /// </summary> public abstract class ValidationDataGrid : QuotesDataGrid { public ValidationDataGrid() { // // TODO: Add constructor logic here // } public abstract void DataBind(); } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:02:50
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3437 Added Files: ValidationGridTabPage.cs Log Message: Validation TabPage that will contain a DataGrid containing suspicious quotes. --- NEW FILE: ValidationGridTabPage.cs --- using System; using System.Data; using System.Windows.Forms; namespace QuantProject.Applications.Downloader { /// <summary> /// Validation TabPage that will contain a DataGrid containing /// suspicious quotes. /// </summary> public class ValidationGridTabPage : TabPage { protected ValidationDataGrid dataGrid; public ValidationGridTabPage() { // // TODO: Add constructor logic here // } public int SetGrid() { this.dataGrid.DataBind(); return ((DataView)this.dataGrid.DataSource).Count; } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:01:31
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3130 Added Files: ValidationTabControl.cs Log Message: TabControl to contain a TabPage for each kind of validation to be performed --- NEW FILE: ValidationTabControl.cs --- using System; using System.Windows.Forms; using QuantProject.Applications.Downloader.Validate; namespace QuantProject.Applications.Downloader { /// <summary> /// TabControl to contain a TabPage for each kind of validation to /// be performed /// </summary> public class ValidationTabControl : TabControl { private OHLCtabPage oHLCtabPage = new OHLCtabPage(); private CloseToCloseTabPage closeToCloseTabPage = new CloseToCloseTabPage(); private RangeToRangeTabPage rangeToRangeTabPage = new RangeToRangeTabPage(); public ValidationTabControl() { this.Controls.Add( oHLCtabPage ); this.Controls.Add( closeToCloseTabPage ); this.Controls.Add( rangeToRangeTabPage ); this.Anchor = AnchorStyles.Top|AnchorStyles.Bottom|AnchorStyles.Left|AnchorStyles.Right; // this.SetStyle( ControlStyles.UserPaint , true ); } /// <summary> /// clears all the contained tab pages and removes them /// </summary> public void Clear() { this.oHLCtabPage.Clear(); this.closeToCloseTabPage.Clear(); this.rangeToRangeTabPage.Clear(); // this.RemoveAll(); } public void Rebuild() { int i=0; if ( oHLCtabPage.SetGrid() != 0 ) i++; // this.Controls.Add( oHLCtabPage ); if ( closeToCloseTabPage.SetGrid() != 0 ) i++; // this.Controls.Add( closeToCloseTabPage ); if ( rangeToRangeTabPage.SetGrid() != 0 ) i++; // this.Controls.Add( rangeToRangeTabPage ); } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 17:00:25
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2893 Added Files: ValidationTabPage.cs Log Message: TabPage for the QuotesEditor, containing a TabControl with a distinct tab for each kind of validation warning --- NEW FILE: ValidationTabPage.cs --- using System; using System.Windows.Forms; using QuantProject.Applications.Downloader.Validate; namespace QuantProject.Applications.Downloader { /// <summary> /// TabPage for the QuotesEditor, containing a TabControl with /// a distinct tab for each kind of validation warning /// </summary> public class ValidationTabPage : TabPage { private ValidateDataTable validateDataTable = new ValidateDataTable(); private string ticker; private double suspiciousRatio; public string Ticker { get { return this.ticker; } set { this.ticker = value; } } public double SuspiciousRatio { get { return this.suspiciousRatio; } set { this.suspiciousRatio = value; } } public ValidationTabPage() { this.Text = "Validation"; } protected override void OnParentChanged( EventArgs e ) { base.OnEnter( e ); this.validateDataTable.Rows.Clear(); this.validateDataTable.AddRows( this.ticker , this.suspiciousRatio ); } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:58:20
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1925 Added Files: VisualValidationChart.cs Log Message: Chart used for (record by record) visual validation --- NEW FILE: VisualValidationChart.cs --- using System; using System.Collections; using System.Drawing; using QuantProject.ADT.Histories; using QuantProject.Presentation.Charting; namespace QuantProject.Applications.Downloader { /// <summary> /// Chart used for (record by record) visual validation /// </summary> public abstract class VisualValidationChart : Chart { private DateTime suspiciousDateTime; // protected ArrayList histories; protected DateTime startDateTime = DateTime.MinValue; protected DateTime endDateTime = DateTime.MinValue; public DateTime SuspiciousDateTime { get { return this.suspiciousDateTime; } set { this.suspiciousDateTime = value; this.Invalidate(); } } public VisualValidationChart() { // // TODO: Add constructor logic here // } protected void add( History history , Color color ) { if ( this.startDateTime == DateTime.MinValue ) // the startDateTime is not computed yet this.onPaint_setTimeInterval( history ); this.Add( history , color , this.startDateTime , this.endDateTime ); } protected abstract void addHistories(); #region OnPaint private void onPaint_setTimeInterval( History history ) { // 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 ); 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) { Console.WriteLine( "VisualValidationChart.OnPaint()" ); this.Clear(); this.addHistories(); // this.history = DataProvider.GetCloseHistory( ((QuotesEditor)this.FindForm()).Ticker ); // this.onPaint_setTimeInterval(); // this.Add( history , Color.Red , this.startDateTime , this.endDateTime ); base.OnPaint( e ); } #endregion } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:57:34
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1787 Added Files: VisualValidationDataGrid.cs Log Message: DataGrid used for (record by record) visual validation --- NEW FILE: VisualValidationDataGrid.cs --- /* QuantProject - Quantitative Finance Library QuotesDataGrid.cs Copyright (C) 2003 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Data; using System.Windows.Forms; using QuantProject.Applications.Downloader.Validate; using QuantProject.DataAccess.Tables; namespace QuantProject.Applications.Downloader { /// <summary> /// DataGrid used for (record by record) visual validation /// </summary> public class VisualValidationDataGrid : ValidationDataGrid { private DataView dataView; private bool styleIsDefined = false; protected string confirmMessage; protected ValidationWarning validationWarning; public VisualValidationDataGrid() { // // TODO: Add constructor logic here // } #region setStyles private void setStyles_set_DataGridBoolColumn_FalseValueChanged(object sender, EventArgs e) { MessageBox.Show( "Prova" ); } private void setStyles_set_DataGridBoolColumn() { DataGridBoolColumn dataGridBoolColumn = new DataGridBoolColumn(); dataGridBoolColumn.MappingName = "CloseToCloseHasBeenVisuallyValidated"; dataGridBoolColumn.HeaderText = "Ok?"; dataGridBoolColumn.Width = 30; dataGridBoolColumn.AllowNull = false; // quiiii!!!!! // dataGridBoolColumn. += // new System.EventHandler( this.setStyles_set_DataGridBoolColumn_FalseValueChanged ); this.TableStyles[ "quotes" ].GridColumnStyles.Add( dataGridBoolColumn ); this.styleIsDefined = true; } public void setStyles() { // this.TableStyles.Clear(); int i=0; while (i<TableStyles[ "quotes" ].GridColumnStyles.Count) { DataGridColumnStyle dataGridColumnStyle = this.TableStyles[ "quotes" ].GridColumnStyles[i]; if ( ( dataGridColumnStyle.HeaderText != "Date" ) && ( dataGridColumnStyle.HeaderText != "Adj. Close" ) ) this.TableStyles[ "quotes" ].GridColumnStyles.Remove( dataGridColumnStyle ); else i++; } setStyles_set_DataGridBoolColumn(); } #endregion public override void DataBind() { ValidateDataTable validateDataTable = ((QuotesEditor)this.FindForm()).ValidateDataTable; this.dataView = new DataView( validateDataTable ); this.dataView.RowFilter = "ValidationWarning=" + Convert.ToInt16( this.validationWarning ); this.DataSource = dataView; this.dataView.AllowNew = false; 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 ); } protected override void OnClick( EventArgs e ) { Console.WriteLine( "VisualValidationDataGrid.OnClick()" ); base.OnClick( e ); ((VisualValidationTabPage)this.Parent).VisualValidationChart.SuspiciousDateTime = (DateTime)this[ this.CurrentRowIndex , 0 ]; // ((VisualValidationTabPage)this.Parent).Invalidate( true ); if (this.TableStyles[0].GridColumnStyles[this.CurrentCell.ColumnNumber] is DataGridBoolColumn) { 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 + ". 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 ) { if ( !this.styleIsDefined ) // no style has been defined yet this.DataBind(); base.OnPaint( e ); } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:56:01
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1632 Added Files: VisualValidationTabPage.cs Log Message: Generic TabPage containing a DataGrid and a Chart for visual validation --- NEW FILE: VisualValidationTabPage.cs --- using System; using System.Drawing; using System.Windows.Forms; using QuantProject.Presentation.Charting; namespace QuantProject.Applications.Downloader { /// <summary> /// Generic TabPage containing a DataGrid and a Chart /// for visual validation /// </summary> public class VisualValidationTabPage : ValidationGridTabPage { public VisualValidationDataGrid VisualValidationDataGrid; public VisualValidationChart VisualValidationChart; protected int VisualValidationDataGridWidth = 150; public VisualValidationTabPage() { } #region initializeCloseToCloseDataGrid // private void initializeVisualValidationDataGrid_mouseUp(object sender, MouseEventArgs e) // { // Console.WriteLine( this.VisualValidationDataGrid[ this.VisualValidationDataGrid.CurrentRowIndex , 0 ] ); // this.VisualValidationChart.SuspiciousDateTime = // (DateTime)this.VisualValidationDataGrid[ this.VisualValidationDataGrid.CurrentRowIndex , 0 ]; // this.VisualValidationChart.Invalidate(); // } private void initializeVisualValidationDataGrid() { // this.VisualValidationDataGrid = new CloseToCloseDataGrid(); this.VisualValidationDataGrid.Location = new Point( 0 , 0 ); this.VisualValidationDataGrid.Width = this.VisualValidationDataGridWidth; // this.VisualValidationDataGrid.MouseUp += // new MouseEventHandler( this.initializeVisualValidationDataGrid_mouseUp ); this.Controls.Add( this.VisualValidationDataGrid ); } #endregion private void initializeCloseToCloseChart() { // this.VisualValidationChart = new CloseToCloseChart(); this.VisualValidationChart.Location = new Point( VisualValidationDataGridWidth + 5 , 0 ); this.Controls.Add( this.VisualValidationChart ); } protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { initializeVisualValidationDataGrid(); initializeCloseToCloseChart(); this.VisualValidationDataGrid.DataBind(); // this.VisualValidationChart.Ticker = this.ticker; if ( this.VisualValidationDataGrid.CurrentRowIndex >= 0 ) this.VisualValidationChart.SuspiciousDateTime = (DateTime)this.VisualValidationDataGrid[ this.VisualValidationDataGrid.CurrentRowIndex , 0 ]; this.VisualValidationDataGrid.Height = this.Height - 10; this.VisualValidationChart.Width = this.Width - this.VisualValidationDataGridWidth - 5; this.VisualValidationChart.Height = this.Height - 10; base.OnPaint( e ); } /// <summary> /// clears the contained objects /// </summary> public void Clear() { this.VisualValidationDataGrid.DataSource = null; } // protected override void OnMouseUp( MouseEventArgs e ) // { // Console.WriteLine( this.VisualValidationDataGrid[ this.VisualValidationDataGrid.CurrentRowIndex , 0 ] ); // this.VisualValidationChart.SuspiciousDateTime = // (DateTime)this.VisualValidationDataGrid[ this.VisualValidationDataGrid.CurrentRowIndex , 0 ]; // this.VisualValidationChart.Invalidate(); // } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:55:13
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/RangeToRange In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1500/RangeToRange Log Message: Directory /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/RangeToRange added to the repository |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:50:44
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv503/Downloader Modified Files: Main.cs Log Message: Added the menu item to invoke the QuotesEditor Index: Main.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Main.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Main.cs 4 Feb 2004 19:27:10 -0000 1.6 --- Main.cs 21 Mar 2004 16:39:58 -0000 1.7 *************** *** 27,30 **** --- 27,31 ---- private System.Windows.Forms.MenuItem menuItemTickerViewer; private System.Windows.Forms.MenuItem menuItemTickerGroupsViewer; + private System.Windows.Forms.MenuItem menuItemQuotesEditor; /// <summary> /// Required designer variable. *************** *** 81,91 **** this.menuItem6 = new System.Windows.Forms.MenuItem(); this.menuItem7 = new System.Windows.Forms.MenuItem(); // // mainMenu1 // this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.menuItemOpen, ! this.menuImport, ! this.menuValidate}); // // menuItemOpen --- 82,93 ---- this.menuItem6 = new System.Windows.Forms.MenuItem(); this.menuItem7 = new System.Windows.Forms.MenuItem(); + this.menuItemQuotesEditor = new System.Windows.Forms.MenuItem(); // // mainMenu1 // this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.menuItemOpen, ! this.menuImport, ! this.menuValidate}); // // menuItemOpen *************** *** 93,98 **** this.menuItemOpen.Index = 0; this.menuItemOpen.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.menuItemTickerViewer, ! this.menuItemTickerGroupsViewer}); this.menuItemOpen.Text = "Open"; // --- 95,101 ---- this.menuItemOpen.Index = 0; this.menuItemOpen.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.menuItemTickerViewer, ! this.menuItemTickerGroupsViewer, ! this.menuItemQuotesEditor}); this.menuItemOpen.Text = "Open"; // *************** *** 113,117 **** this.menuImport.Index = 1; this.menuImport.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.subMenuFromTheWeb}); this.menuImport.Text = "Import"; // --- 116,120 ---- this.menuImport.Index = 1; this.menuImport.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.subMenuFromTheWeb}); this.menuImport.Text = "Import"; // *************** *** 126,130 **** this.menuValidate.Index = 2; this.menuValidate.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.subMenuValidateGo}); this.menuValidate.Text = "Validate"; // --- 129,133 ---- this.menuValidate.Index = 2; this.menuValidate.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.subMenuValidateGo}); this.menuValidate.Text = "Validate"; // *************** *** 170,173 **** --- 173,182 ---- this.menuItem7.Text = ""; // + // menuItemQuotesEditor + // + this.menuItemQuotesEditor.Index = 2; + this.menuItemQuotesEditor.Text = "Quotes Editor"; + this.menuItemQuotesEditor.Click += new System.EventHandler(this.menuItemQuotesEditor_Click); + // // Principale // *************** *** 205,210 **** //try { ! Application.Run(new Principale()); //togli il commento per riavere la windows application ! //new RunMSFTsimpleTest().Run(); } //catch ( Exception ex ) --- 214,220 ---- //try { ! Application.Run(new Principale()); //togli il commento per riavere il downloader ! // Application.Run(new QuotesEditor( "RYVYX" )); ! // Application.Run(new TestScpl()); } //catch ( Exception ex ) *************** *** 239,242 **** --- 249,258 ---- } + private void menuItemQuotesEditor_Click(object sender, System.EventArgs e) + { + QuotesEditor quotesEditor = new QuotesEditor( "MSFT" ); + quotesEditor.ShowDialog(); + } + } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:46:28
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/OHLC In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32307/Downloader/QuotesEditor/OHLC Modified Files: OHLCdataGrid.cs Log Message: - The DataBind method does not require the ValidateDataTable parameter anymore - The DataGrid is docked to the parent size now Index: OHLCdataGrid.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/OHLC/OHLCdataGrid.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OHLCdataGrid.cs 25 Jan 2004 15:46:40 -0000 1.2 --- OHLCdataGrid.cs 21 Mar 2004 16:35:50 -0000 1.3 *************** *** 31,46 **** /// Contains the quotes with Open High Low Close inconsistency /// </summary> ! public class OHLCdataGrid : QuotesDataGrid { - private DataTable openHighLowCloseDataTable; public OHLCdataGrid() { } ! public void DataBind( ValidateDataTable validateDataTable ) { ! this.openHighLowCloseDataTable = validateDataTable.Clone(); ! string select = "1=1"; ! DataRow[] dataRows = validateDataTable.Select( ! select ); DataView dataView = new DataView( validateDataTable ); dataView.RowFilter = "ValidationWarning=" + --- 31,44 ---- /// Contains the quotes with Open High Low Close inconsistency /// </summary> ! public class OHLCdataGrid : ValidationDataGrid { public OHLCdataGrid() { + // this.Dock = DockStyle.Fill; + this.Anchor = AnchorStyles.Top|AnchorStyles.Bottom|AnchorStyles.Left|AnchorStyles.Right; } ! public override void DataBind() { ! ValidateDataTable validateDataTable = ((QuotesEditor)this.FindForm()).ValidateDataTable; DataView dataView = new DataView( validateDataTable ); dataView.RowFilter = "ValidationWarning=" + |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:42:40
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/OHLC In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31494/Downloader/QuotesEditor/OHLC Modified Files: OHLCuserControl.cs Log Message: The openHighLowCloseDataGrid.DataBind method does not require the ValidateDataTable parameter anymore Index: OHLCuserControl.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/OHLC/OHLCuserControl.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OHLCuserControl.cs 25 Jan 2004 14:45:44 -0000 1.1 --- OHLCuserControl.cs 21 Mar 2004 16:32:31 -0000 1.2 *************** *** 63,67 **** public void PaintingHandler() { ! this.openHighLowCloseDataGrid.DataBind( this.ValidateDataTable ); } --- 63,67 ---- public void PaintingHandler() { ! this.openHighLowCloseDataGrid.DataBind(); } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:41:02
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31086/Downloader/QuotesEditor Modified Files: QuotesChart.cs Log Message: The chart width depends on the parent width now Index: QuotesChart.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/QuotesChart.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QuotesChart.cs 25 Jan 2004 14:59:52 -0000 1.1 --- QuotesChart.cs 21 Mar 2004 16:30:53 -0000 1.2 *************** *** 56,59 **** --- 56,60 ---- this.Clear(); this.Add( DataProvider.GetCloseHistory( this.ticker ) ); + this.Width = this.Parent.Width - 15; base.OnPaint( e ); } |