quantproject-developers Mailing List for QuantProject (Page 144)
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: <gla...@pr...> - 2004-01-26 10:22:24
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Charting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18649 Added Files: Chart.cs Log Message: Base class for QuantProject charting capabilities. Single interface point to the scpl library: all the scpl dependent code must be written within this class. --- NEW FILE: Chart.cs --- /* QuantProject - Quantitative Finance Library Chart.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.Collections; using System.Drawing; using scpl; using QuantProject.ADT.Histories; namespace QuantProject.Presentation.Charting { /// <summary> /// Base class for QuantProject charting capabilities. Single interface point to /// the scpl library. All scpl dependent code must be written within this class. /// </summary> public class Chart : scpl.Windows.PlotSurface2D { private ArrayList chartPlots; public Chart() { this.chartPlots = new ArrayList(); // this.Paint += new System.Windows.Forms.PaintEventHandler(this.Chart_Paint); } public new void Clear() { this.chartPlots.Clear(); base.Clear(); } /// <summary> /// Adds a new ChartPlot to the Chart, using default values for the Color, /// the StartDateTime and the EndDateTime /// </summary> /// <param name="history">History for the new ChartPlot</param> public void Add( History history ) { ChartPlot chartPlot = new ChartPlot( history ); this.chartPlots.Add( chartPlot ); } /// <summary> /// Adds a new ChartPlot to the Chart, using the given arguments for the Color, /// the StartDate and the EndDate /// </summary> /// <param name="history">History for the new Chart Plot</param> /// <param name="color">Color for the new Chart Plot</param> /// <param name="startDateTime">StartDateTime for the new Chart Plot</param> /// <param name="endDateTime">EndDateTime for the new Chart Plot</param> public void Add( History history , Color color , DateTime startDateTime , DateTime endDateTime ) { ChartPlot chartPlot = new ChartPlot( history , color , startDateTime , endDateTime ); this.chartPlots.Add( chartPlot ); } #region "OnPaint" private void onPaint_addLinePlot( ChartPlot chartPlot ) { int npt=chartPlot.History.Count; int startIndex = chartPlot.History.IndexOfKeyOrPrevious( chartPlot.StartDateTime ); int endIndex = chartPlot.History.IndexOfKeyOrPrevious( chartPlot.EndDateTime ); int plotLength = endIndex - startIndex + 1; float [] x = new float[ plotLength ]; float [] y = new float[ plotLength ]; float step=1.0F; for ( int i=startIndex ; i<=endIndex ; i++ ) { x[i-startIndex]=i*step; y[i-startIndex]=(float)chartPlot.History.GetByIndex( i ); } LinePlot lp=new LinePlot( new ArrayAdapter(x,y) ); Pen p=new Pen( chartPlot.Color ); lp.Pen=p; // base.Clear(); this.Add(lp); } protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Console.WriteLine( "Chart.OnPaint()" ); foreach ( ChartPlot chartPlot in this.chartPlots ) onPaint_addLinePlot( chartPlot ); base.OnPaint( e ); } #endregion } } |
|
From: <gla...@pr...> - 2004-01-26 08:50:39
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Charting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18365/Charting Log Message: Directory /cvsroot/quantproject/QuantProject/b5_Presentation/Charting added to the repository |
|
From: <gla...@pr...> - 2004-01-26 05:32:25
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20985/Downloader/QuotesEditor Modified Files: QuotesEditor.cs Log Message: Added the Validation TabPage with the OHLC and the CloseToClose sub TabPages Index: QuotesEditor.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/QuotesEditor.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QuotesEditor.cs 21 Dec 2003 21:24:22 -0000 1.1 --- QuotesEditor.cs 25 Jan 2004 15:42:39 -0000 1.2 *************** *** 4,18 **** using System.ComponentModel; using System.Windows.Forms; ! namespace QuantProject.Applications.Downloader.QuotesEditor { /// <summary> ! /// Summary description for QuotesEditor. /// </summary> public class QuotesEditor : System.Windows.Forms.Form { private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPageChart; ! private System.Windows.Forms.TabPage tabPageDataGrid; /// <summary> /// Required designer variable. --- 4,35 ---- using System.ComponentModel; using System.Windows.Forms; + using scpl; + using QuantProject.ADT.Histories; + using QuantProject.Data; + using QuantProject.Applications.Downloader.Validate; ! namespace QuantProject.Applications.Downloader { /// <summary> ! /// Windows form editor for quotes of a single ticker /// </summary> public class QuotesEditor : System.Windows.Forms.Form { + private double suspiciousRatio = 8; + + private string ticker; + private ValidateDataTable validateDataTable = new ValidateDataTable(); + private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPageChart; ! private System.Windows.Forms.TabPage tabPageQuotes; ! private System.Windows.Forms.TabPage tabPageValidation; ! private System.Windows.Forms.TextBox textBoxTicker; ! private System.Windows.Forms.TabControl tabControl2; ! private System.Windows.Forms.TabPage tabPageOHLC; ! private System.Windows.Forms.TabPage tabPageCloseToClose; ! private QuantProject.Applications.Downloader.QuotesChart quotesChart; ! private QuantProject.Applications.Downloader.OHLCuserControl openHighLowCloseUserControl; ! private QuantProject.Applications.Downloader.CloseToCloseUserControl closeToCloseUserControl; /// <summary> /// Required designer variable. *************** *** 20,24 **** private System.ComponentModel.Container components = null; ! public QuotesEditor() { // --- 37,41 ---- private System.ComponentModel.Container components = null; ! public QuotesEditor( string ticker ) { // *************** *** 27,33 **** InitializeComponent(); ! // ! // TODO: Add any constructor code after InitializeComponent call ! // } --- 44,48 ---- InitializeComponent(); ! this.ticker = ticker; } *************** *** 56,61 **** this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPageChart = new System.Windows.Forms.TabPage(); ! this.tabPageDataGrid = new System.Windows.Forms.TabPage(); this.tabControl1.SuspendLayout(); this.SuspendLayout(); // --- 71,89 ---- this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPageChart = new System.Windows.Forms.TabPage(); ! this.quotesChart = new QuantProject.Applications.Downloader.QuotesChart(); ! this.tabPageQuotes = new System.Windows.Forms.TabPage(); ! this.tabPageValidation = new System.Windows.Forms.TabPage(); ! this.tabControl2 = new System.Windows.Forms.TabControl(); ! this.tabPageOHLC = new System.Windows.Forms.TabPage(); ! this.openHighLowCloseUserControl = new QuantProject.Applications.Downloader.OHLCuserControl(); ! this.tabPageCloseToClose = new System.Windows.Forms.TabPage(); ! this.closeToCloseUserControl = new QuantProject.Applications.Downloader.CloseToCloseUserControl(); ! this.textBoxTicker = new System.Windows.Forms.TextBox(); this.tabControl1.SuspendLayout(); + this.tabPageChart.SuspendLayout(); + this.tabPageValidation.SuspendLayout(); + this.tabControl2.SuspendLayout(); + this.tabPageOHLC.SuspendLayout(); + this.tabPageCloseToClose.SuspendLayout(); this.SuspendLayout(); // *************** *** 64,100 **** this.tabControl1.Controls.AddRange(new System.Windows.Forms.Control[] { this.tabPageChart, ! this.tabPageDataGrid}); ! this.tabControl1.Location = new System.Drawing.Point(8, 8); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; ! this.tabControl1.Size = new System.Drawing.Size(552, 264); this.tabControl1.TabIndex = 0; // // tabPageChart // this.tabPageChart.Location = new System.Drawing.Point(4, 22); this.tabPageChart.Name = "tabPageChart"; ! this.tabPageChart.Size = new System.Drawing.Size(544, 238); ! this.tabPageChart.TabIndex = 0; this.tabPageChart.Text = "Chart"; // ! // tabPageDataGrid // ! this.tabPageDataGrid.Location = new System.Drawing.Point(4, 22); ! this.tabPageDataGrid.Name = "tabPageDataGrid"; ! this.tabPageDataGrid.Size = new System.Drawing.Size(544, 238); ! this.tabPageDataGrid.TabIndex = 1; ! this.tabPageDataGrid.Text = "Quotes"; // // QuotesEditor // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(576, 273); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.tabControl1}); this.Name = "QuotesEditor"; this.Text = "QuotesEditor"; - this.Load += new System.EventHandler(this.QuotesEditor_Load); this.tabControl1.ResumeLayout(false); this.ResumeLayout(false); --- 92,230 ---- this.tabControl1.Controls.AddRange(new System.Windows.Forms.Control[] { this.tabPageChart, ! this.tabPageQuotes, ! this.tabPageValidation}); ! this.tabControl1.Location = new System.Drawing.Point(8, 40); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; ! this.tabControl1.Size = new System.Drawing.Size(688, 320); this.tabControl1.TabIndex = 0; // // tabPageChart // + this.tabPageChart.Controls.AddRange(new System.Windows.Forms.Control[] { + this.quotesChart}); this.tabPageChart.Location = new System.Drawing.Point(4, 22); this.tabPageChart.Name = "tabPageChart"; ! this.tabPageChart.Size = new System.Drawing.Size(680, 294); ! this.tabPageChart.TabIndex = 2; this.tabPageChart.Text = "Chart"; + this.tabPageChart.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageChart_Paint); // ! // quotesChart // ! this.quotesChart.AllowSelection = false; ! this.quotesChart.BackColor = System.Drawing.SystemColors.ControlLightLight; ! this.quotesChart.HorizontalEdgeLegendPlacement = scpl.Legend.Placement.Inside; ! this.quotesChart.LegendBorderStyle = scpl.Legend.BorderType.Shadow; ! this.quotesChart.LegendXOffset = 10F; ! this.quotesChart.LegendYOffset = 1F; ! this.quotesChart.Location = new System.Drawing.Point(8, 8); ! this.quotesChart.Name = "quotesChart"; ! this.quotesChart.Padding = 10; ! this.quotesChart.PlotBackColor = System.Drawing.Color.White; ! this.quotesChart.ShowLegend = false; ! this.quotesChart.Size = new System.Drawing.Size(664, 288); ! this.quotesChart.TabIndex = 0; ! this.quotesChart.Title = ""; ! this.quotesChart.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); ! this.quotesChart.VerticalEdgeLegendPlacement = scpl.Legend.Placement.Outside; ! this.quotesChart.XAxis1 = null; ! this.quotesChart.XAxis2 = null; ! this.quotesChart.YAxis1 = null; ! this.quotesChart.YAxis2 = null; ! // ! // tabPageQuotes ! // ! this.tabPageQuotes.Location = new System.Drawing.Point(4, 22); ! this.tabPageQuotes.Name = "tabPageQuotes"; ! this.tabPageQuotes.Size = new System.Drawing.Size(680, 294); ! this.tabPageQuotes.TabIndex = 0; ! this.tabPageQuotes.Text = "Quotes"; ! this.tabPageQuotes.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageChart_Paint); ! // ! // tabPageValidation ! // ! this.tabPageValidation.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.tabControl2}); ! this.tabPageValidation.Location = new System.Drawing.Point(4, 22); ! this.tabPageValidation.Name = "tabPageValidation"; ! this.tabPageValidation.Size = new System.Drawing.Size(680, 294); ! this.tabPageValidation.TabIndex = 1; ! this.tabPageValidation.Text = "Validation"; ! this.tabPageValidation.Click += new System.EventHandler(this.tabPageValidation_Click); ! this.tabPageValidation.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageValidation_Paint); ! // ! // tabControl2 ! // ! this.tabControl2.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.tabPageOHLC, ! this.tabPageCloseToClose}); ! this.tabControl2.Location = new System.Drawing.Point(8, 8); ! this.tabControl2.Multiline = true; ! this.tabControl2.Name = "tabControl2"; ! this.tabControl2.RightToLeft = System.Windows.Forms.RightToLeft.No; ! this.tabControl2.SelectedIndex = 0; ! this.tabControl2.Size = new System.Drawing.Size(664, 280); ! this.tabControl2.TabIndex = 0; ! // ! // tabPageOHLC ! // ! this.tabPageOHLC.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.openHighLowCloseUserControl}); ! this.tabPageOHLC.Location = new System.Drawing.Point(4, 22); ! this.tabPageOHLC.Name = "tabPageOHLC"; ! this.tabPageOHLC.Size = new System.Drawing.Size(656, 254); ! this.tabPageOHLC.TabIndex = 0; ! this.tabPageOHLC.Text = "OHLC"; ! this.tabPageOHLC.Click += new System.EventHandler(this.tabPageOHLC_Click); ! this.tabPageOHLC.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageOHLC_Paint); ! // ! // openHighLowCloseUserControl ! // ! this.openHighLowCloseUserControl.Location = new System.Drawing.Point(8, 8); ! this.openHighLowCloseUserControl.Name = "openHighLowCloseUserControl"; ! this.openHighLowCloseUserControl.Size = new System.Drawing.Size(646, 244); ! this.openHighLowCloseUserControl.TabIndex = 0; ! // ! // tabPageCloseToClose ! // ! this.tabPageCloseToClose.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.closeToCloseUserControl}); ! this.tabPageCloseToClose.Location = new System.Drawing.Point(4, 22); ! this.tabPageCloseToClose.Name = "tabPageCloseToClose"; ! this.tabPageCloseToClose.Size = new System.Drawing.Size(656, 254); ! this.tabPageCloseToClose.TabIndex = 1; ! this.tabPageCloseToClose.Text = "Close To Close"; ! this.tabPageCloseToClose.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageCloseToClose_Paint); ! // ! // closeToCloseUserControl ! // ! this.closeToCloseUserControl.Location = new System.Drawing.Point(8, 8); ! this.closeToCloseUserControl.Name = "closeToCloseUserControl"; ! this.closeToCloseUserControl.Size = new System.Drawing.Size(646, 244); ! this.closeToCloseUserControl.TabIndex = 0; ! // ! // textBoxTicker ! // ! this.textBoxTicker.Location = new System.Drawing.Point(288, 8); ! this.textBoxTicker.Name = "textBoxTicker"; ! this.textBoxTicker.TabIndex = 1; ! this.textBoxTicker.Text = "CCE"; // // QuotesEditor // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(704, 365); this.Controls.AddRange(new System.Windows.Forms.Control[] { + this.textBoxTicker, this.tabControl1}); this.Name = "QuotesEditor"; this.Text = "QuotesEditor"; this.tabControl1.ResumeLayout(false); + this.tabPageChart.ResumeLayout(false); + this.tabPageValidation.ResumeLayout(false); + this.tabControl2.ResumeLayout(false); + this.tabPageOHLC.ResumeLayout(false); + this.tabPageCloseToClose.ResumeLayout(false); this.ResumeLayout(false); *************** *** 102,109 **** #endregion ! private void QuotesEditor_Load(object sender, System.EventArgs e) { } } } --- 232,281 ---- #endregion ! ! #region tabPageChart ! private void tabPageChart_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! this.quotesChart.Ticker = this.textBoxTicker.Text; ! // quotesChart.PaintingHandler( this.textBoxTicker.Text ); ! } ! ! #endregion ! #region tabPageValidation ! private void tabPageValidation_Click(object sender, System.EventArgs e) ! { ! } ! ! private void tabPageValidation_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! this.validateDataTable.Clear(); ! this.validateDataTable.AddRows( this.textBoxTicker.Text , this.suspiciousRatio ); ! this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! this.closeToCloseUserControl.ValidateDataTable = this.validateDataTable; ! this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; ! } ! ! #endregion ! #region tabPageOHLC ! private void tabPageOHLC_Click(object sender, System.EventArgs e) { } + + private void tabPageOHLC_Paint(object sender, System.Windows.Forms.PaintEventArgs e) + { + // this.openHighLowCloseDataGrid.DataBind( this.validateDataTable ); + } + #endregion + + private void openHighLowCloseUserControl_Paint(object sender, System.Windows.Forms.PaintEventArgs e) + { + this.openHighLowCloseUserControl.PaintingHandler(); + } + + private void tabPageCloseToClose_Paint(object sender, System.Windows.Forms.PaintEventArgs e) + { + this.closeToCloseUserControl.PaintingHandler(); + } + } } |
|
From: <gla...@pr...> - 2004-01-26 04:39:28
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Charting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20889 Added Files: CharPlot.cs Log Message: Single plot to be charted by the Chart class --- NEW FILE: CharPlot.cs --- /* QuantProject - Quantitative Finance Library DataBase.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.Drawing; using QuantProject.ADT.Histories; namespace QuantProject.Presentation.Charting { /// <summary> /// Single plot to be charted by the Chart class /// </summary> public class ChartPlot { private History history; private Color color; private DateTime startDateTime; private DateTime endDateTime; public Color Color { get { return this.color; } set { this.color = value; } } public DateTime StartDateTime { get { return this.startDateTime; } set { this.startDateTime = value; } } public DateTime EndDateTime { get { return this.endDateTime; } set { this.endDateTime = value; } } public History History { get { return this.history; } set { this.history = value; } } public ChartPlot( History history ) { this.history = history; this.color = Color.Red; this.startDateTime = (DateTime)this.history.GetKey( 0 ); this.endDateTime = (DateTime)this.history.GetKey( this.history.Count - 1 ); } public ChartPlot( History history , Color color , DateTime startDateTime , DateTime endDateTime ) { this.history = history; this.color = color; this.startDateTime = startDateTime; this.endDateTime = endDateTime; } } } |
|
From: <gla...@pr...> - 2004-01-26 02:21:27
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11413/Downloader/QuotesEditor Added Files: QuotesChart.cs Log Message: Base class for single ticker charting --- NEW FILE: QuotesChart.cs --- /* QuantProject - Quantitative Finance Library QuotesChart.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.Drawing; using scpl; using scpl.Windows; using QuantProject.ADT.Histories; using QuantProject.Data; using QuantProject.Presentation.Charting; namespace QuantProject.Applications.Downloader { /// <summary> /// Base class for single ticker charting /// </summary> public class QuotesChart : Chart { protected string ticker; public string Ticker { get { return this.ticker; } set { this.ticker = value; } } public QuotesChart() { // // TODO: Add constructor logic here // } protected override void OnPaint( System.Windows.Forms.PaintEventArgs e ) { Console.WriteLine( "QuotesChart.PaintingHandler()" ); this.Clear(); this.Add( DataProvider.GetCloseHistory( this.ticker ) ); base.OnPaint( e ); } } } |
|
From: <gla...@pr...> - 2004-01-26 00:06:49
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23264/b5_Presentation Modified Files: b5_Presentation.csproj Log Message: Added the Charting namespace, with the Chart and the ChartPlot classes Index: b5_Presentation.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/b5_Presentation.csproj,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** b5_Presentation.csproj 13 Oct 2003 21:59:35 -0000 1.1.1.1 --- b5_Presentation.csproj 25 Jan 2004 15:53:08 -0000 1.2 *************** *** 70,74 **** <Reference Name = "System.XML" ! AssemblyName = "System.XML" HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll" /> --- 70,74 ---- <Reference Name = "System.XML" ! AssemblyName = "System.Xml" HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll" /> *************** *** 107,110 **** --- 107,125 ---- HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Windows.Forms.dll" /> + <Reference + Name = "scpl" + AssemblyName = "scpl" + HintPath = "..\..\lib\scpl.dll" + /> + <Reference + Name = "b1_ADT" + Project = "{B8A01161-3698-4591-B1EF-90F5FC7D8DBA}" + Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" + /> + <Reference + Name = "System.Drawing" + AssemblyName = "System.Drawing" + HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Drawing.dll" + /> </References> </Build> *************** *** 117,120 **** --- 132,145 ---- /> <File + RelPath = "Charting\CharPlot.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Charting\Chart.cs" + SubType = "UserControl" + BuildAction = "Compile" + /> + <File RelPath = "MicrosoftExcel\ExcelManager.cs" SubType = "Code" |
|
From: <mi...@pr...> - 2004-01-23 04:47:45
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12428/Downloader/Validate Modified Files: QuotesToBeValidated.cs ValidateDataGrid.cs ValidateDataTable.cs Log Message: Added new constructors, methods on overload and new members in order to interact with TickerViewer object Index: QuotesToBeValidated.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/QuotesToBeValidated.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** QuotesToBeValidated.cs 21 Dec 2003 21:18:53 -0000 1.4 --- QuotesToBeValidated.cs 22 Jan 2004 23:46:57 -0000 1.5 *************** *** 24,28 **** public QuotesToBeValidated( string tickerIsLike ) ! { // this.selectStatement = // "select * from quotes where quTicker like '" + tickerIsLike + "'"; --- 24,28 ---- public QuotesToBeValidated( string tickerIsLike ) ! { // this.selectStatement = // "select * from quotes where quTicker like '" + tickerIsLike + "'"; *************** *** 39,43 **** Console.WriteLine( exception.ToString() ); } ! } // public delegate void SuspiciousDataRowEventHandler( --- 39,64 ---- Console.WriteLine( exception.ToString() ); } ! } ! ! public QuotesToBeValidated(DataTable tableOfTickersToBeValidated) ! { ! this.oleDbDataAdapter = ! new OleDbDataAdapter( "" , ConnectionProvider.OleDbConnection ); ! foreach(DataRow row in tableOfTickersToBeValidated.Rows) ! { ! this.oleDbDataAdapter.SelectCommand.CommandText = ! "select * from quotes where quTicker = '" + ! (string)row[0] + "'"; ! try ! { ! this.oleDbDataAdapter.Fill( this ); ! } ! catch (Exception exception) ! { ! Console.WriteLine( exception.ToString() ); ! } ! } ! ! } // public delegate void SuspiciousDataRowEventHandler( Index: ValidateDataGrid.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/ValidateDataGrid.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ValidateDataGrid.cs 21 Dec 2003 21:17:46 -0000 1.2 --- ValidateDataGrid.cs 22 Jan 2004 23:47:00 -0000 1.3 *************** *** 1,4 **** --- 1,5 ---- using System; using System.Windows.Forms; + using System.Data; namespace QuantProject.Applications.Downloader.Validate *************** *** 56,59 **** --- 57,71 ---- return this.validateDataTable; } + public ValidateDataTable Validate(DataTable dataTable, string suspiciousRatio ) + { + this.validateDataTable = new ValidateDataTable(dataTable); + this.DataSource = validateDataTable; + if ( this.TableStyles.Count == 0 ) + // styles have not been defined yet + validate_setTableStyle(); + validateDataTable.AddRows(Convert.ToDouble( suspiciousRatio ) ); + return this.validateDataTable; + } + #endregion } Index: ValidateDataTable.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/ValidateDataTable.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ValidateDataTable.cs 21 Dec 2003 21:16:04 -0000 1.5 --- ValidateDataTable.cs 22 Jan 2004 23:47:02 -0000 1.6 *************** *** 16,19 **** --- 16,20 ---- private OleDbCommandBuilder oleDbCommandBuilder; private OleDbDataAdapter oleDbDataAdapter; + private DataTable tableOfTickersToBeValidated; public ValidateDataTable() *************** *** 27,32 **** --- 28,47 ---- this.oleDbDataAdapter.Fill( this ); this.TableName = "quotes"; + } + public ValidateDataTable(DataTable tableOfTickers) + { + this.tableOfTickersToBeValidated = tableOfTickers; + + this.selectStatement = + "select * from quotes where 1=2"; + this.oleDbDataAdapter = + new OleDbDataAdapter( selectStatement , ConnectionProvider.OleDbConnection ); + this.oleDbCommandBuilder = new OleDbCommandBuilder( oleDbDataAdapter ); + this.oleDbDataAdapter.UpdateCommand = this.oleDbCommandBuilder.GetUpdateCommand(); + this.oleDbDataAdapter.Fill( this ); + this.TableName = "quotes"; + } /// <summary> /// Adds quotesRow to the ValidateDataTable *************** *** 53,57 **** this.AcceptChanges(); } ! /// <summary> /// Commits the ValidateDataTable changes to the database --- 68,81 ---- this.AcceptChanges(); } ! public void AddRows(double suspiciousRatio ) ! { ! QuotesToBeValidated quotesToBeValidated = new QuotesToBeValidated(this.tableOfTickersToBeValidated); ! quotesToBeValidated.SuspiciousRatio = suspiciousRatio; ! quotesToBeValidated.SuspiciousDataRow += ! new SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler ); ! // new QuotesToBeValidated.SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler ); ! quotesToBeValidated.Validate(); ! this.AcceptChanges(); ! } /// <summary> /// Commits the ValidateDataTable changes to the database |
|
From: <mi...@pr...> - 2004-01-23 04:33:11
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9774/Downloader Modified Files: Downloader.csproj Added Files: TickerViewer.cs Log Message: The object TickerViewer makes now easier to validate tickers' quotes. It is now possible to validate only tickers selected with the mouse in the Data Grid area (by clicking on "validate current rows" in the context menu - right click with the mouse). --- NEW FILE: TickerViewer.cs --- /* QuantDownloader - Quantitative Finance Library TickerViewer.cs Copyright (C) 2003 Marco Milletti 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.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Data.OleDb; using QuantProject.DataAccess; namespace QuantProject.Applications.Downloader { /// <summary> /// It finds tickers that match criteria entered by the user /// </summary> public class TickerViewer : System.Windows.Forms.Form { private System.Windows.Forms.TextBox textBoxStringToFind; private System.Windows.Forms.Label label1; private System.Windows.Forms.ToolTip toolTip1; private System.Windows.Forms.DataGrid dataGrid1; private System.Windows.Forms.Button buttonFindTickers; private System.ComponentModel.IContainer components; private OleDbConnection oleDbConnection; private OleDbDataAdapter oleDbDataAdapter; private System.Windows.Forms.ContextMenu contextMenuTickerViewer; private System.Windows.Forms.MenuItem menuItemValidateCurrentRows; private DataTable tableTickers; public TickerViewer() { InitializeComponent(); this.oleDbConnection = ConnectionProvider.OleDbConnection; this.oleDbConnection.Open(); this.tableTickers = new DataTable("tickers"); this.dataGrid1.DataSource = this.tableTickers; this.setStyle_dataGrid1(); this.dataGrid1.Visible = false; //the datagrid is still empty at this point } /// <summary> /// clean up /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if(components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// <summary> /// do not modify the content with the editor /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.textBoxStringToFind = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.dataGrid1 = new System.Windows.Forms.DataGrid(); this.buttonFindTickers = new System.Windows.Forms.Button(); this.contextMenuTickerViewer = new System.Windows.Forms.ContextMenu(); this.menuItemValidateCurrentRows = new System.Windows.Forms.MenuItem(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); this.SuspendLayout(); // // textBoxStringToFind // this.textBoxStringToFind.Location = new System.Drawing.Point(48, 8); this.textBoxStringToFind.Name = "textBoxStringToFind"; this.textBoxStringToFind.Size = new System.Drawing.Size(160, 20); this.textBoxStringToFind.TabIndex = 0; this.textBoxStringToFind.Text = ""; this.toolTip1.SetToolTip(this.textBoxStringToFind, "Type chars to filter tickers (you can use % and _ ) "); // // label1 // this.label1.Location = new System.Drawing.Point(8, 8); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(40, 24); this.label1.TabIndex = 1; this.label1.Text = "Find ..."; // // dataGrid1 // this.dataGrid1.ContextMenu = this.contextMenuTickerViewer; this.dataGrid1.DataMember = ""; this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Bottom; this.dataGrid1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dataGrid1.Location = new System.Drawing.Point(0, 46); this.dataGrid1.Name = "dataGrid1"; this.dataGrid1.Size = new System.Drawing.Size(288, 432); this.dataGrid1.TabIndex = 2; // // buttonFindTickers // this.buttonFindTickers.Location = new System.Drawing.Point(216, 8); this.buttonFindTickers.Name = "buttonFindTickers"; this.buttonFindTickers.Size = new System.Drawing.Size(64, 24); this.buttonFindTickers.TabIndex = 3; this.buttonFindTickers.Text = "Go"; this.buttonFindTickers.Click += new System.EventHandler(this.buttonFindTickers_Click); // // contextMenuTickerViewer // this.contextMenuTickerViewer.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItemValidateCurrentRows}); // // menuItemValidateCurrentRows // this.menuItemValidateCurrentRows.Index = 0; this.menuItemValidateCurrentRows.Text = "Validate current rows"; this.menuItemValidateCurrentRows.Click += new System.EventHandler(this.menuItemValidateCurrentRows_Click); // // TickerViewer // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(288, 478); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.buttonFindTickers, this.dataGrid1, this.label1, this.textBoxStringToFind}); this.Name = "TickerViewer"; this.Text = "TickerViewer"; this.Closed += new System.EventHandler(this.TickerViewer_Closed); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); this.ResumeLayout(false); } #endregion #region Style for dataGrid1 private void setStyle_dataGrid1() { DataGridTableStyle dataGrid1TableStyle = new DataGridTableStyle(); dataGrid1TableStyle.MappingName = "tickers"; dataGrid1TableStyle.ColumnHeadersVisible = true; dataGrid1TableStyle.ReadOnly = true; dataGrid1TableStyle.SelectionBackColor = Color.DimGray ; DataGridTextBoxColumn columnStyle = new DataGridTextBoxColumn(); columnStyle.MappingName = "tiTicker"; columnStyle.HeaderText = "Ticker"; columnStyle.TextBox.Enabled = false; dataGrid1TableStyle.GridColumnStyles.Add(columnStyle); this.dataGrid1.TableStyles.Add(dataGrid1TableStyle); columnStyle.NullText = ""; } #endregion private void TickerViewer_Closed(object sender, System.EventArgs e) { this.oleDbConnection.Close(); } private void buttonFindTickers_Click(object sender, System.EventArgs e) { try { string criteria = "SELECT * FROM tickers WHERE tiTicker LIKE '" + this.textBoxStringToFind.Text + "'"; oleDbDataAdapter = new OleDbDataAdapter(criteria, this.oleDbConnection); this.tableTickers.Clear(); oleDbDataAdapter.Fill(this.tableTickers); this.dataGrid1.Refresh(); if (this.dataGrid1.Visible == false && this.tableTickers.Rows.Count != 0) //there are some rows to show and the grid is not visible { this.dataGrid1.Visible = true; } else if(this.tableTickers.Rows.Count == 0) // there aren't rows to show { this.dataGrid1.Visible = false; } } catch(Exception ex) { MessageBox.Show(ex.ToString()); } finally { ; } } private DataTable getTableOfSelectedTickers() { DataTable dataTableOfDataGrid1 = (DataTable)this.dataGrid1.DataSource; DataTable tableOfSelectedTickers = dataTableOfDataGrid1.Copy(); tableOfSelectedTickers.Clear(); // so the two tables have the same structure int indexOfRow = 0; while(indexOfRow != dataTableOfDataGrid1.Rows.Count) { if(this.dataGrid1.IsSelected(indexOfRow)) { DataRow dataRow = tableOfSelectedTickers.NewRow(); dataRow[0] = (string)dataTableOfDataGrid1.Rows[indexOfRow][0]; tableOfSelectedTickers.Rows.Add(dataRow); } indexOfRow++; } return tableOfSelectedTickers; } private void menuItemValidateCurrentRows_Click(object sender, System.EventArgs e) { QuantProject.Applications.Downloader.Validate.ValidateForm validateForm = new Validate.ValidateForm(this.getTableOfSelectedTickers()); validateForm.Show(); } } } Index: Downloader.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Downloader.csproj,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Downloader.csproj 21 Dec 2003 21:28:29 -0000 1.9 --- Downloader.csproj 22 Jan 2004 23:28:07 -0000 1.10 *************** *** 146,167 **** /> <File ! RelPath = "WebDownloader.cs" SubType = "Form" BuildAction = "Compile" /> <File ! RelPath = "WebDownloader.resx" ! DependentUpon = "WebDownloader.cs" BuildAction = "EmbeddedResource" /> <File ! RelPath = "QuotesEditor\QuotesEditor.cs" SubType = "Form" BuildAction = "Compile" /> <File ! RelPath = "QuotesEditor\QuotesEditor.resx" ! DependentUpon = "QuotesEditor.cs" ! BuildAction = "EmbeddedResource" /> <File --- 146,167 ---- /> <File ! RelPath = "TickerViewer.cs" SubType = "Form" BuildAction = "Compile" /> <File ! RelPath = "TickerViewer.resx" ! DependentUpon = "TickerViewer.cs" BuildAction = "EmbeddedResource" /> <File ! RelPath = "WebDownloader.cs" SubType = "Form" BuildAction = "Compile" /> <File ! RelPath = "QuotesEditor\QuotesEditor.cs" ! SubType = "Form" ! BuildAction = "Compile" /> <File *************** *** 176,179 **** --- 176,184 ---- /> <File + RelPath = "Validate\QuotesToBeValidated.resx" + DependentUpon = "QuotesToBeValidated.cs" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "Validate\SospiciousDataRowEventArgs.cs" SubType = "Code" *************** *** 186,189 **** --- 191,199 ---- /> <File + RelPath = "Validate\ValidateDataGrid.resx" + DependentUpon = "ValidateDataGrid.cs" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "Validate\ValidateDataTable.cs" SubType = "Component" *************** *** 191,194 **** --- 201,209 ---- /> <File + RelPath = "Validate\ValidateDataTable.resx" + DependentUpon = "ValidateDataTable.cs" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "Validate\ValidateForm.cs" SubType = "Form" |
|
From: <mi...@pr...> - 2004-01-22 23:52:41
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13252/Downloader Modified Files: Main.cs Log Message: Added new menu item to call TickerViewer object Index: Main.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Main.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Main.cs 9 Dec 2003 22:30:12 -0000 1.4 --- Main.cs 22 Jan 2004 23:51:49 -0000 1.5 *************** *** 24,27 **** --- 24,30 ---- private System.Windows.Forms.MenuItem menuValidate; private System.Windows.Forms.MenuItem subMenuValidateGo; + private System.Windows.Forms.MenuItem menuItemOpen; + private System.Windows.Forms.MenuItem menuItemTickerViewer; + private System.Windows.Forms.MenuItem menuItemTickerGroupsViewer; /// <summary> /// Required designer variable. *************** *** 63,155 **** private void InitializeComponent() { ! this.mainMenu1 = new System.Windows.Forms.MainMenu(); ! this.menuImport = new System.Windows.Forms.MenuItem(); ! this.subMenuFromTheWeb = new System.Windows.Forms.MenuItem(); ! this.menuValidate = new System.Windows.Forms.MenuItem(); ! this.subMenuValidateGo = new System.Windows.Forms.MenuItem(); ! this.menuItem1 = new System.Windows.Forms.MenuItem(); ! this.menuItem2 = new System.Windows.Forms.MenuItem(); ! this.menuItem5 = new System.Windows.Forms.MenuItem(); ! this.menuItem3 = new System.Windows.Forms.MenuItem(); ! this.menuItem4 = new System.Windows.Forms.MenuItem(); ! 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.menuImport, ! this.menuValidate}); ! // ! // menuImport ! // ! this.menuImport.Index = 0; ! this.menuImport.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.subMenuFromTheWeb}); ! this.menuImport.Text = "Import"; ! // ! // subMenuFromTheWeb ! // ! this.subMenuFromTheWeb.Index = 0; ! this.subMenuFromTheWeb.Text = "From the Web"; ! this.subMenuFromTheWeb.Click += new System.EventHandler(this.menuItem10_Click); ! // ! // menuValidate ! // ! this.menuValidate.Index = 1; ! this.menuValidate.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.subMenuValidateGo}); ! this.menuValidate.Text = "Validate"; ! // ! // subMenuValidateGo ! // ! this.subMenuValidateGo.Index = 0; ! this.subMenuValidateGo.Text = "Go"; ! this.subMenuValidateGo.Click += new System.EventHandler(this.subMenuValidateGo_Click); ! // ! // menuItem1 ! // ! this.menuItem1.Index = -1; ! this.menuItem1.Text = ""; ! // ! // menuItem2 ! // ! this.menuItem2.Index = -1; ! this.menuItem2.Text = ""; ! // ! // menuItem5 ! // ! this.menuItem5.Index = -1; ! this.menuItem5.Text = ""; ! // ! // menuItem3 ! // ! this.menuItem3.Index = -1; ! this.menuItem3.Text = ""; ! // ! // menuItem4 ! // ! this.menuItem4.Index = -1; ! this.menuItem4.Text = ""; ! // ! // menuItem6 ! // ! this.menuItem6.Index = -1; ! this.menuItem6.Text = ""; ! // ! // menuItem7 ! // ! this.menuItem7.Index = -1; ! this.menuItem7.Text = ""; ! // ! // Principale ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(292, 273); ! this.Menu = this.mainMenu1; ! this.Name = "Principale"; ! this.Text = "Principale"; ! } #endregion --- 66,181 ---- private void InitializeComponent() { ! this.mainMenu1 = new System.Windows.Forms.MainMenu(); ! this.menuItemOpen = new System.Windows.Forms.MenuItem(); ! this.menuItemTickerViewer = new System.Windows.Forms.MenuItem(); ! this.menuItemTickerGroupsViewer = new System.Windows.Forms.MenuItem(); ! this.menuImport = new System.Windows.Forms.MenuItem(); ! this.subMenuFromTheWeb = new System.Windows.Forms.MenuItem(); ! this.menuValidate = new System.Windows.Forms.MenuItem(); ! this.subMenuValidateGo = new System.Windows.Forms.MenuItem(); ! this.menuItem1 = new System.Windows.Forms.MenuItem(); ! this.menuItem2 = new System.Windows.Forms.MenuItem(); ! this.menuItem5 = new System.Windows.Forms.MenuItem(); ! this.menuItem3 = new System.Windows.Forms.MenuItem(); ! this.menuItem4 = new System.Windows.Forms.MenuItem(); ! 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 ! // ! this.menuItemOpen.Index = 0; ! this.menuItemOpen.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.menuItemTickerViewer, ! this.menuItemTickerGroupsViewer}); ! this.menuItemOpen.Text = "Open"; ! // ! // menuItemTickerViewer ! // ! this.menuItemTickerViewer.Index = 0; ! this.menuItemTickerViewer.Text = "Ticker Viewer"; ! this.menuItemTickerViewer.Click += new System.EventHandler(this.menuItemTickerViewer_Click); ! // ! // menuItemTickerGroupsViewer ! // ! this.menuItemTickerGroupsViewer.Index = 1; ! this.menuItemTickerGroupsViewer.Text = "Ticker-Groups Viewer"; ! // ! // menuImport ! // ! this.menuImport.Index = 1; ! this.menuImport.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.subMenuFromTheWeb}); ! this.menuImport.Text = "Import"; ! // ! // subMenuFromTheWeb ! // ! this.subMenuFromTheWeb.Index = 0; ! this.subMenuFromTheWeb.Text = "From the Web"; ! this.subMenuFromTheWeb.Click += new System.EventHandler(this.menuItem10_Click); ! // ! // menuValidate ! // ! this.menuValidate.Index = 2; ! this.menuValidate.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.subMenuValidateGo}); ! this.menuValidate.Text = "Validate"; ! // ! // subMenuValidateGo ! // ! this.subMenuValidateGo.Index = 0; ! this.subMenuValidateGo.Text = "Go"; ! this.subMenuValidateGo.Click += new System.EventHandler(this.subMenuValidateGo_Click); ! // ! // menuItem1 ! // ! this.menuItem1.Index = -1; ! this.menuItem1.Text = ""; ! // ! // menuItem2 ! // ! this.menuItem2.Index = -1; ! this.menuItem2.Text = ""; ! // ! // menuItem5 ! // ! this.menuItem5.Index = -1; ! this.menuItem5.Text = ""; ! // ! // menuItem3 ! // ! this.menuItem3.Index = -1; ! this.menuItem3.Text = ""; ! // ! // menuItem4 ! // ! this.menuItem4.Index = -1; ! this.menuItem4.Text = ""; ! // ! // menuItem6 ! // ! this.menuItem6.Index = -1; ! this.menuItem6.Text = ""; ! // ! // menuItem7 ! // ! this.menuItem7.Index = -1; ! this.menuItem7.Text = ""; ! // ! // Principale ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(232, 177); ! this.Menu = this.mainMenu1; ! this.Name = "Principale"; ! this.Text = "Principale"; ! } #endregion *************** *** 200,203 **** --- 226,235 ---- } + private void menuItemTickerViewer_Click(object sender, System.EventArgs e) + { + TickerViewer tickerViewer = new TickerViewer(); + tickerViewer.Show(); + } + } } |
|
From: <mi...@pr...> - 2004-01-22 23:44:35
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11953/Downloader/Validate Modified Files: ValidateForm.cs Log Message: Added new constructor and new members in order to interact with TickerViewer object Index: ValidateForm.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/ValidateForm.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ValidateForm.cs 18 Dec 2003 18:29:51 -0000 1.3 --- ValidateForm.cs 22 Jan 2004 23:43:19 -0000 1.4 *************** *** 17,20 **** --- 17,21 ---- private System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1; private ValidateDataTable validateDataTable; + private DataTable tableOfTickersToBeValidated; private System.Data.OleDb.OleDbCommand oleDbSelectCommand1; private System.Data.OleDb.OleDbCommand oleDbInsertCommand1; *************** *** 26,29 **** --- 27,31 ---- private System.Windows.Forms.Label labelSuspiciousRatio; private QuantProject.Applications.Downloader.Validate.ValidateDataGrid validateDataGrid; + private System.Windows.Forms.Button buttonGoValidateCurrentSelection; /// <summary> /// Required designer variable. *************** *** 37,42 **** // InitializeComponent(); ! } /// <summary> /// Clean up any resources being used. --- 39,59 ---- // InitializeComponent(); ! this.buttonGoValidateCurrentSelection.Visible = false; ! this.tableOfTickersToBeValidated = null; + } + + public ValidateForm(DataTable dataTable) + { + InitializeComponent(); + this.labelTickerIsLike.Visible = false; + this.textBoxTickerIsLike.Visible = false; + this.buttonGo.Visible = false; + this.Text = "Validate current selection"; + //the data to be validated comes from the data table + // these two members are not used if the object is created + // with the data table + this.tableOfTickersToBeValidated = dataTable; + } /// <summary> /// Clean up any resources being used. *************** *** 61,260 **** private void InitializeComponent() { ! this.textBoxTickerIsLike = new System.Windows.Forms.TextBox(); ! this.labelTickerIsLike = new System.Windows.Forms.Label(); ! this.buttonGo = new System.Windows.Forms.Button(); ! 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.validateDataGrid = new QuantProject.Applications.Downloader.Validate.ValidateDataGrid(); ! this.buttonCommitAndRefresh = new System.Windows.Forms.Button(); ! this.textBoxSuspiciousRatio = new System.Windows.Forms.TextBox(); ! this.labelSuspiciousRatio = new System.Windows.Forms.Label(); ! ((System.ComponentModel.ISupportInitialize)(this.validateDataGrid)).BeginInit(); ! this.SuspendLayout(); ! // ! // textBoxTickerIsLike ! // ! this.textBoxTickerIsLike.Location = new System.Drawing.Point(120, 16); ! this.textBoxTickerIsLike.Name = "textBoxTickerIsLike"; ! this.textBoxTickerIsLike.TabIndex = 0; ! this.textBoxTickerIsLike.Text = "CCE"; ! // ! // labelTickerIsLike ! // ! this.labelTickerIsLike.Location = new System.Drawing.Point(24, 16); ! this.labelTickerIsLike.Name = "labelTickerIsLike"; ! this.labelTickerIsLike.Size = new System.Drawing.Size(80, 16); ! this.labelTickerIsLike.TabIndex = 1; ! this.labelTickerIsLike.Text = "Ticker is Like:"; ! this.labelTickerIsLike.TextAlign = System.Drawing.ContentAlignment.MiddleRight; ! // ! // buttonGo ! // ! this.buttonGo.Location = new System.Drawing.Point(512, 16); ! this.buttonGo.Name = "buttonGo"; ! this.buttonGo.TabIndex = 2; ! this.buttonGo.Text = "Go"; ! this.buttonGo.Click += new System.EventHandler(this.buttonGo_Click); ! // ! // 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("Ticker", "Ticker"), ! new System.Data.Common.DataColumnMapping("TheDate", "TheDate"), ! new System.Data.Common.DataColumnMapping("TheOpen", "TheOpen"), ! new System.Data.Common.DataColumnMapping("High", "High"), ! new System.Data.Common.DataColumnMapping("Low", "Low"), ! new System.Data.Common.DataColumnMapping("TheClose", "TheClose"), ! new System.Data.Common.DataColumnMapping("Volume", "Volume"), ! new System.Data.Common.DataColumnMapping("AdjOpen", "AdjOpen"), ! new System.Data.Common.DataColumnMapping("AdjHigh", "AdjHigh"), ! new System.Data.Common.DataColumnMapping("AdjLow", "AdjLow"), ! new System.Data.Common.DataColumnMapping("AdjClose", "AdjClose"), ! new System.Data.Common.DataColumnMapping("AdjVolume", "AdjVolume"), ! new System.Data.Common.DataColumnMapping("ErrorDescription", "ErrorDescription")})}); ! this.oleDbDataAdapter1.UpdateCommand = this.oleDbUpdateCommand1; ! // ! // oleDbDeleteCommand1 ! // ! this.oleDbDeleteCommand1.CommandText = @"DELETE FROM quotes WHERE (quDate = ?) AND (quTicker = ?) AND (quAdjustedClose = ? OR ? IS NULL AND quAdjustedClose IS NULL) AND (quAdjustedHigh = ? OR ? IS NULL AND quAdjustedHigh IS NULL) AND (quAdjustedLow = ? OR ? IS NULL AND quAdjustedLow IS NULL) AND (quAdjustedOpen = ? OR ? IS NULL AND quAdjustedOpen IS NULL) AND (quAdjustedVolume = ? OR ? IS NULL AND quAdjustedVolume IS NULL) AND (quClose = ? OR ? IS NULL AND quClose 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)"; ! 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)), "TheDate", 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)), "Ticker", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedClose1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedHigh1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedLow1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedOpen1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedVolume", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedVolume1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", 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)), "TheClose", 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)), "TheClose", 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)), "High", 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)), "High", 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)), "Low", 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)), "Low", 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)), "TheOpen", 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)), "TheOpen", System.Data.DataRowVersion.Original, null)); ! // ! // oleDbInsertCommand1 ! // ! this.oleDbInsertCommand1.CommandText = "INSERT INTO quotes(quTicker, quDate, quOpen, quHigh, quLow, quClose, quVolume, qu" + ! "AdjustedOpen, quAdjustedHigh, quAdjustedLow, quAdjustedClose, quAdjustedVolume) " + ! "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, "Ticker")); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quDate", System.Data.OleDb.OleDbType.DBDate, 0, "TheDate")); ! 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)), "TheOpen", System.Data.DataRowVersion.Current, null)); ! 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)), "High", 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)), "Low", System.Data.DataRowVersion.Current, null)); ! 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)), "TheClose", System.Data.DataRowVersion.Current, null)); ! 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)), "Volume", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedVolume", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", System.Data.DataRowVersion.Current, null)); ! // ! // oleDbSelectCommand1 ! // ! this.oleDbSelectCommand1.CommandText = @"SELECT quTicker AS Ticker, quDate AS TheDate, quOpen AS TheOpen, quHigh AS High, quLow AS Low, quClose AS TheClose, quVolume AS Volume, quAdjustedOpen AS AdjOpen, quAdjustedHigh AS AdjHigh, quAdjustedLow AS AdjLow, quAdjustedClose AS AdjClose, quAdjustedVolume AS AdjVolume, '' AS ErrorDescription FROM quotes ORDER BY quTicker, quDate"; ! // ! // oleDbUpdateCommand1 ! // ! this.oleDbUpdateCommand1.CommandText = @"UPDATE quotes SET quTicker = ?, quDate = ?, quOpen = ?, quHigh = ?, quLow = ?, quClose = ?, quVolume = ?, quAdjustedOpen = ?, quAdjustedHigh = ?, quAdjustedLow = ?, quAdjustedClose = ?, quAdjustedVolume = ? WHERE (quDate = ?) AND (quTicker = ?) AND (quAdjustedClose = ? OR ? IS NULL AND quAdjustedClose IS NULL) AND (quAdjustedHigh = ? OR ? IS NULL AND quAdjustedHigh IS NULL) AND (quAdjustedLow = ? OR ? IS NULL AND quAdjustedLow IS NULL) AND (quAdjustedOpen = ? OR ? IS NULL AND quAdjustedOpen IS NULL) AND (quAdjustedVolume = ? OR ? IS NULL AND quAdjustedVolume IS NULL) AND (quClose = ? OR ? IS NULL AND quClose 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)"; ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, "Ticker")); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quDate", System.Data.OleDb.OleDbType.DBDate, 0, "TheDate")); ! 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)), "TheOpen", System.Data.DataRowVersion.Current, null)); ! 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)), "High", 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)), "Low", System.Data.DataRowVersion.Current, 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)), "TheClose", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.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)), "Volume", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedVolume", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", System.Data.DataRowVersion.Current, 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)), "TheDate", 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)), "Ticker", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedClose1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedHigh1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedLow1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedOpen1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedVolume", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedVolume1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", 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)), "TheClose", 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)), "TheClose", 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)), "High", 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)), "High", 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)), "Low", 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)), "Low", 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)), "TheOpen", 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)), "TheOpen", System.Data.DataRowVersion.Original, null)); ! // ! // validateDataGrid ! // ! this.validateDataGrid.DataMember = ""; ! this.validateDataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText; ! this.validateDataGrid.Location = new System.Drawing.Point(16, 56); ! this.validateDataGrid.Name = "validateDataGrid"; ! this.validateDataGrid.PreferredColumnWidth = 50; ! this.validateDataGrid.Size = new System.Drawing.Size(696, 224); ! this.validateDataGrid.TabIndex = 3; ! // ! // buttonCommitAndRefresh ! // ! this.buttonCommitAndRefresh.Location = new System.Drawing.Point(272, 296); ! this.buttonCommitAndRefresh.Name = "buttonCommitAndRefresh"; ! this.buttonCommitAndRefresh.Size = new System.Drawing.Size(152, 23); ! this.buttonCommitAndRefresh.TabIndex = 4; ! this.buttonCommitAndRefresh.Text = "Commit && Refresh"; ! this.buttonCommitAndRefresh.Click += new System.EventHandler(this.buttonCommitAndRefresh_Click); ! // ! // textBoxSuspiciousRatio ! // ! this.textBoxSuspiciousRatio.Location = new System.Drawing.Point(344, 16); ! this.textBoxSuspiciousRatio.Name = "textBoxSuspiciousRatio"; ! this.textBoxSuspiciousRatio.TabIndex = 5; ! this.textBoxSuspiciousRatio.Text = "5"; ! // ! // labelSuspiciousRatio ! // ! this.labelSuspiciousRatio.Location = new System.Drawing.Point(224, 16); ! this.labelSuspiciousRatio.Name = "labelSuspiciousRatio"; ! this.labelSuspiciousRatio.Size = new System.Drawing.Size(120, 16); ! this.labelSuspiciousRatio.TabIndex = 6; ! this.labelSuspiciousRatio.Text = "Suspicious ratio:"; ! this.labelSuspiciousRatio.TextAlign = System.Drawing.ContentAlignment.MiddleRight; ! // ! // ValidateForm ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(720, 341); ! this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.labelSuspiciousRatio, ! this.textBoxSuspiciousRatio, ! this.buttonCommitAndRefresh, ! this.validateDataGrid, ! this.buttonGo, ! this.labelTickerIsLike, ! this.textBoxTickerIsLike}); ! this.Name = "ValidateForm"; ! this.Text = "Validate"; ! ((System.ComponentModel.ISupportInitialize)(this.validateDataGrid)).EndInit(); ! this.ResumeLayout(false); ! } #endregion --- 78,287 ---- private void InitializeComponent() { ! this.textBoxTickerIsLike = new System.Windows.Forms.TextBox(); ! this.labelTickerIsLike = new System.Windows.Forms.Label(); ! this.buttonGo = new System.Windows.Forms.Button(); ! 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.validateDataGrid = new QuantProject.Applications.Downloader.Validate.ValidateDataGrid(); ! this.buttonCommitAndRefresh = new System.Windows.Forms.Button(); ! this.textBoxSuspiciousRatio = new System.Windows.Forms.TextBox(); ! this.labelSuspiciousRatio = new System.Windows.Forms.Label(); ! this.buttonGoValidateCurrentSelection = new System.Windows.Forms.Button(); ! ((System.ComponentModel.ISupportInitialize)(this.validateDataGrid)).BeginInit(); ! this.SuspendLayout(); ! // ! // textBoxTickerIsLike ! // ! this.textBoxTickerIsLike.Location = new System.Drawing.Point(120, 16); ! this.textBoxTickerIsLike.Name = "textBoxTickerIsLike"; ! this.textBoxTickerIsLike.TabIndex = 0; ! this.textBoxTickerIsLike.Text = "CCE"; ! // ! // labelTickerIsLike ! // ! this.labelTickerIsLike.Location = new System.Drawing.Point(24, 16); ! this.labelTickerIsLike.Name = "labelTickerIsLike"; ! this.labelTickerIsLike.Size = new System.Drawing.Size(80, 16); ! this.labelTickerIsLike.TabIndex = 1; ! this.labelTickerIsLike.Text = "Ticker is Like:"; ! this.labelTickerIsLike.TextAlign = System.Drawing.ContentAlignment.MiddleRight; ! // ! // buttonGo ! // ! this.buttonGo.Location = new System.Drawing.Point(464, 16); ! this.buttonGo.Name = "buttonGo"; ! this.buttonGo.TabIndex = 2; ! this.buttonGo.Text = "Go"; ! this.buttonGo.Click += new System.EventHandler(this.buttonGo_Click); ! // ! // 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("Ticker", "Ticker"), ! new System.Data.Common.DataColumnMapping("TheDate", "TheDate"), ! new System.Data.Common.DataColumnMapping("TheOpen", "TheOpen"), ! new System.Data.Common.DataColumnMapping("High", "High"), ! new System.Data.Common.DataColumnMapping("Low", "Low"), ! new System.Data.Common.DataColumnMapping("TheClose", "TheClose"), ! new System.Data.Common.DataColumnMapping("Volume", "Volume"), ! new System.Data.Common.DataColumnMapping("AdjOpen", "AdjOpen"), ! new System.Data.Common.DataColumnMapping("AdjHigh", "AdjHigh"), ! new System.Data.Common.DataColumnMapping("AdjLow", "AdjLow"), ! new System.Data.Common.DataColumnMapping("AdjClose", "AdjClose"), ! new System.Data.Common.DataColumnMapping("AdjVolume", "AdjVolume"), ! new System.Data.Common.DataColumnMapping("ErrorDescription", "ErrorDescription")})}); ! this.oleDbDataAdapter1.UpdateCommand = this.oleDbUpdateCommand1; ! // ! // oleDbDeleteCommand1 ! // ! this.oleDbDeleteCommand1.CommandText = @"DELETE FROM quotes WHERE (quDate = ?) AND (quTicker = ?) AND (quAdjustedClose = ? OR ? IS NULL AND quAdjustedClose IS NULL) AND (quAdjustedHigh = ? OR ? IS NULL AND quAdjustedHigh IS NULL) AND (quAdjustedLow = ? OR ? IS NULL AND quAdjustedLow IS NULL) AND (quAdjustedOpen = ? OR ? IS NULL AND quAdjustedOpen IS NULL) AND (quAdjustedVolume = ? OR ? IS NULL AND quAdjustedVolume IS NULL) AND (quClose = ? OR ? IS NULL AND quClose 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)"; ! 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)), "TheDate", 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)), "Ticker", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedClose1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedHigh1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedLow1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedOpen1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedVolume", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", System.Data.DataRowVersion.Original, null)); ! this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedVolume1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", 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)), "TheClose", 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)), "TheClose", 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)), "High", 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)), "High", 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)), "Low", 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)), "Low", 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)), "TheOpen", 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)), "TheOpen", System.Data.DataRowVersion.Original, null)); ! // ! // oleDbInsertCommand1 ! // ! this.oleDbInsertCommand1.CommandText = "INSERT INTO quotes(quTicker, quDate, quOpen, quHigh, quLow, quClose, quVolume, qu" + ! "AdjustedOpen, quAdjustedHigh, quAdjustedLow, quAdjustedClose, quAdjustedVolume) " + ! "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, "Ticker")); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quDate", System.Data.OleDb.OleDbType.DBDate, 0, "TheDate")); ! 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)), "TheOpen", System.Data.DataRowVersion.Current, null)); ! 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)), "High", 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)), "Low", System.Data.DataRowVersion.Current, null)); ! 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)), "TheClose", System.Data.DataRowVersion.Current, null)); ! 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)), "Volume", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Current, null)); ! this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedVolume", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", System.Data.DataRowVersion.Current, null)); ! // ! // oleDbSelectCommand1 ! // ! this.oleDbSelectCommand1.CommandText = @"SELECT quTicker AS Ticker, quDate AS TheDate, quOpen AS TheOpen, quHigh AS High, quLow AS Low, quClose AS TheClose, quVolume AS Volume, quAdjustedOpen AS AdjOpen, quAdjustedHigh AS AdjHigh, quAdjustedLow AS AdjLow, quAdjustedClose AS AdjClose, quAdjustedVolume AS AdjVolume, '' AS ErrorDescription FROM quotes ORDER BY quTicker, quDate"; ! // ! // oleDbUpdateCommand1 ! // ! this.oleDbUpdateCommand1.CommandText = @"UPDATE quotes SET quTicker = ?, quDate = ?, quOpen = ?, quHigh = ?, quLow = ?, quClose = ?, quVolume = ?, quAdjustedOpen = ?, quAdjustedHigh = ?, quAdjustedLow = ?, quAdjustedClose = ?, quAdjustedVolume = ? WHERE (quDate = ?) AND (quTicker = ?) AND (quAdjustedClose = ? OR ? IS NULL AND quAdjustedClose IS NULL) AND (quAdjustedHigh = ? OR ? IS NULL AND quAdjustedHigh IS NULL) AND (quAdjustedLow = ? OR ? IS NULL AND quAdjustedLow IS NULL) AND (quAdjustedOpen = ? OR ? IS NULL AND quAdjustedOpen IS NULL) AND (quAdjustedVolume = ? OR ? IS NULL AND quAdjustedVolume IS NULL) AND (quClose = ? OR ? IS NULL AND quClose 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)"; ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quTicker", System.Data.OleDb.OleDbType.VarWChar, 8, "Ticker")); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quDate", System.Data.OleDb.OleDbType.DBDate, 0, "TheDate")); ! 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)), "TheOpen", System.Data.DataRowVersion.Current, null)); ! 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)), "High", 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)), "Low", System.Data.DataRowVersion.Current, 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)), "TheClose", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.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)), "Volume", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Current, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("quAdjustedVolume", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", System.Data.DataRowVersion.Current, 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)), "TheDate", 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)), "Ticker", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedClose", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedClose1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjClose", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedHigh", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedHigh1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjHigh", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedLow", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedLow1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjLow", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedOpen", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedOpen1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjOpen", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedVolume", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", System.Data.DataRowVersion.Original, null)); ! this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_quAdjustedVolume1", System.Data.OleDb.OleDbType.Single, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(7)), ((System.Byte)(0)), "AdjVolume", 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)), "TheClose", 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)), "TheClose", 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)), "High", 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)), "High", 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)), "Low", 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)), "Low", 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)), "TheOpen", 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)), "TheOpen", System.Data.DataRowVersion.Original, null)); ! // ! // validateDataGrid ! // ! this.validateDataGrid.DataMember = ""; ! this.validateDataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText; ! this.validateDataGrid.Location = new System.Drawing.Point(16, 56); ! this.validateDataGrid.Name = "validateDataGrid"; ! this.validateDataGrid.PreferredColumnWidth = 50; ! this.validateDataGrid.Size = new System.Drawing.Size(696, 224); ! this.validateDataGrid.TabIndex = 3; ! // ! // buttonCommitAndRefresh ! // ! this.buttonCommitAndRefresh.Location = new System.Drawing.Point(272, 296); ! this.buttonCommitAndRefresh.Name = "buttonCommitAndRefresh"; ! this.buttonCommitAndRefresh.Size = new System.Drawing.Size(152, 23); ! this.buttonCommitAndRefresh.TabIndex = 4; ! this.buttonCommitAndRefresh.Text = "Commit && Refresh"; ! this.buttonCommitAndRefresh.Click += new System.EventHandler(this.buttonCommitAndRefresh_Click); ! // ! // textBoxSuspiciousRatio ! // ! this.textBoxSuspiciousRatio.Location = new System.Drawing.Point(344, 16); ! this.textBoxSuspiciousRatio.Name = "textBoxSuspiciousRatio"; ! this.textBoxSuspiciousRatio.TabIndex = 5; ! this.textBoxSuspiciousRatio.Text = "5"; ! // ! // labelSuspiciousRatio ! // ! this.labelSuspiciousRatio.Location = new System.Drawing.Point(224, 16); ! this.labelSuspiciousRatio.Name = "labelSuspiciousRatio"; ! this.labelSuspiciousRatio.Size = new System.Drawing.Size(120, 16); ! this.labelSuspiciousRatio.TabIndex = 6; ! this.labelSuspiciousRatio.Text = "Suspicious ratio:"; ! this.labelSuspiciousRatio.TextAlign = System.Drawing.ContentAlignment.MiddleRight; ! // ! // buttonGoValidateCurrentSelection ! // ! this.buttonGoValidateCurrentSelection.Location = new System.Drawing.Point(552, 16); ! this.buttonGoValidateCurrentSelection.Name = "buttonGoValidateCurrentSelection"; ! this.buttonGoValidateCurrentSelection.TabIndex = 7; ! this.buttonGoValidateCurrentSelection.Text = "Go"; ! this.buttonGoValidateCurrentSelection.Click += new System.EventHandler(this.buttonGoValidateCurrentSelection_Click); ! // ! // ValidateForm ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(720, 341); ! this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.buttonGoValidateCurrentSelection, ! this.labelSuspiciousRatio, ! this.textBoxSuspiciousRatio, ! this.buttonCommitAndRefresh, ! this.validateDataGrid, ! this.buttonGo, ! this.labelTickerIsLike, ! this.textBoxTickerIsLike}); ! this.Name = "ValidateForm"; ! this.Text = "Validate"; ! ((System.ComponentModel.ISupportInitialize)(this.validateDataGrid)).EndInit(); ! this.ResumeLayout(false); ! } #endregion *************** *** 280,283 **** --- 307,316 ---- // validateDataTable.AddRows( textBoxTickerIsLike.Text , Convert.ToDouble( this.textBoxSuspiciousRatio.Text ) ); } + private void buttonGoValidateCurrentSelection_Click(object sender, System.EventArgs e) + { + this.validateDataTable = this.validateDataGrid.Validate(this.tableOfTickersToBeValidated, + this.textBoxSuspiciousRatio.Text); + } + #endregion *************** *** 289,292 **** --- 322,327 ---- } + + } } |
|
From: <gla...@us...> - 2004-01-17 19:10:17
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess
In directory sc8-pr-cvs1:/tmp/cvs-serv11507/b2_DataAccess
Modified Files:
DataBaseVersionManager.cs
Log Message:
- removed commented code
- fixed syntax for CREATE TABLE tickerGroups
- fixed syntax for CREATE TABLE quotesFromSecondarySources
Index: DataBaseVersionManager.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** DataBaseVersionManager.cs 17 Jan 2004 15:47:08 -0000 1.5
--- DataBaseVersionManager.cs 17 Jan 2004 19:10:14 -0000 1.6
***************
*** 97,129 ****
private void createTables()
{
- //<<<<<<< DataBaseVersionManager.cs
- // string command =
- // "create table validatedTickers " +
- // "( vtTicker TEXT(8) , vtStartDate DATETIME , vtEndDate DATETIME , vtDate DATETIME, " +
- // "CONSTRAINT myKey PRIMARY KEY ( vtTicker ) )";
- // OleDbCommand oleDbCommand = new OleDbCommand( command , this.oleDbConnection );
- // oleDbCommand.ExecuteNonQuery();
- // oleDbCommand.CommandText =
- // "create table validatedTickers " +
- // "( vvTicker TEXT(8) , vvStartDate DATETIME , vvEndDate DATETIME , " +
- // "vvHashValue TEXT(50) , vvEditDate DATETIME, " +
- // "vvCloseToCloseRatio BIT , vvRangeToRangeRatio BIT , " +
- // "CONSTRAINT myKey PRIMARY KEY ( vvTicker ) )";
- // oleDbCommand.ExecuteNonQuery();
- // oleDbCommand.CommandText =
- // "create table quotesFromOtherSources " +
- // "(qsTicker TEXT(8) , " +
- // "qsDate DATETIME , " +
- // "qsSource SHORT , " +
- // "qsOpen SINGLE , " +
- // "qsHigh SINGLE , " +
- // "qsLow SINGLE , " +
- // "qsClose SINGLE , " +
- // "qsVolume SINGLE , " +
- // "qsAdjustedClose SINGLE , " +
- // "qsAdjustedCloseToCloseRatio DOUBLE " +
- // "qsEditDate DATETIME , " +
- // "CONSTRAINT myKey PRIMARY KEY ( qsTicker , qsDate , qsSource ) )";
- //=======
this.executeCommand("CREATE TABLE tickers (tiTicker TEXT(8))");
this.executeCommand("CREATE TABLE quotes (quTicker TEXT(8), quDate DATETIME, " +
--- 97,100 ----
***************
*** 137,141 ****
// validating, updating data from the web, testing strategies
this.executeCommand("CREATE TABLE tickerGroups " +
! "( tgId TEXT(8) , tgDescription(100), tgTgId TEXT(8))");
// where to store the relation between a ticker and a group
// NOTE that a group can be created inside another group and
--- 108,112 ----
// validating, updating data from the web, testing strategies
this.executeCommand("CREATE TABLE tickerGroups " +
! "( tgId TEXT(8) , tgDescription TEXT(100), tgTgId TEXT(8))");
// where to store the relation between a ticker and a group
// NOTE that a group can be created inside another group and
***************
*** 178,185 ****
"qsVolume SINGLE , " +
"qsAdjustedClose SINGLE , " +
! "qsAdjustedCloseToCloseRatio DOUBLE " +
"qsEditDate DATETIME , " +
"CONSTRAINT myKey PRIMARY KEY ( qsTicker , qsDate , qsSource ) )" );
- // >>>>>>> 1.4
}
--- 149,155 ----
"qsVolume SINGLE , " +
"qsAdjustedClose SINGLE , " +
! "qsAdjustedCloseToCloseRatio DOUBLE , " +
"qsEditDate DATETIME , " +
"CONSTRAINT myKey PRIMARY KEY ( qsTicker , qsDate , qsSource ) )" );
}
***************
*** 220,225 ****
catch(Exception ex)
{
! string notUsed = ex.ToString();// to avoid warning after compilation
! }
}
--- 190,195 ----
catch(Exception ex)
{
! string notUsed = ex.ToString();// to avoid warning after compilation
! }
}
|
|
From: <gla...@us...> - 2004-01-17 15:47:11
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess
In directory sc8-pr-cvs1:/tmp/cvs-serv27982/b2_DataAccess
Modified Files:
DataBaseVersionManager.cs
Log Message:
- Added CREATE TABLE for visuallyValidatedTickers
- Added CREATE TABLE for validatedTickers
- Added CREATE TABLE for quotesFromSecondarySources
Index: DataBaseVersionManager.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DataBaseVersionManager.cs 16 Jan 2004 19:17:00 -0000 1.4
--- DataBaseVersionManager.cs 17 Jan 2004 15:47:08 -0000 1.5
***************
*** 97,100 ****
--- 97,129 ----
private void createTables()
{
+ //<<<<<<< DataBaseVersionManager.cs
+ // string command =
+ // "create table validatedTickers " +
+ // "( vtTicker TEXT(8) , vtStartDate DATETIME , vtEndDate DATETIME , vtDate DATETIME, " +
+ // "CONSTRAINT myKey PRIMARY KEY ( vtTicker ) )";
+ // OleDbCommand oleDbCommand = new OleDbCommand( command , this.oleDbConnection );
+ // oleDbCommand.ExecuteNonQuery();
+ // oleDbCommand.CommandText =
+ // "create table validatedTickers " +
+ // "( vvTicker TEXT(8) , vvStartDate DATETIME , vvEndDate DATETIME , " +
+ // "vvHashValue TEXT(50) , vvEditDate DATETIME, " +
+ // "vvCloseToCloseRatio BIT , vvRangeToRangeRatio BIT , " +
+ // "CONSTRAINT myKey PRIMARY KEY ( vvTicker ) )";
+ // oleDbCommand.ExecuteNonQuery();
+ // oleDbCommand.CommandText =
+ // "create table quotesFromOtherSources " +
+ // "(qsTicker TEXT(8) , " +
+ // "qsDate DATETIME , " +
+ // "qsSource SHORT , " +
+ // "qsOpen SINGLE , " +
+ // "qsHigh SINGLE , " +
+ // "qsLow SINGLE , " +
+ // "qsClose SINGLE , " +
+ // "qsVolume SINGLE , " +
+ // "qsAdjustedClose SINGLE , " +
+ // "qsAdjustedCloseToCloseRatio DOUBLE " +
+ // "qsEditDate DATETIME , " +
+ // "CONSTRAINT myKey PRIMARY KEY ( qsTicker , qsDate , qsSource ) )";
+ //=======
this.executeCommand("CREATE TABLE tickers (tiTicker TEXT(8))");
this.executeCommand("CREATE TABLE quotes (quTicker TEXT(8), quDate DATETIME, " +
***************
*** 109,117 ****
this.executeCommand("CREATE TABLE tickerGroups " +
"( tgId TEXT(8) , tgDescription(100), tgTgId TEXT(8))");
! // where to store the relation between a ticker and a group
! // NOTE that a group can be created inside another group and
! // a ticker can belong to one or more groups
! this.executeCommand("CREATE TABLE tickers_tickerGroups " +
! "( ttTgId TEXT(8) , ttTiId TEXT(8))");
}
--- 138,185 ----
this.executeCommand("CREATE TABLE tickerGroups " +
"( tgId TEXT(8) , tgDescription(100), tgTgId TEXT(8))");
! // where to store the relation between a ticker and a group
! // NOTE that a group can be created inside another group and
! // a ticker can belong to one or more groups
! this.executeCommand("CREATE TABLE tickers_tickerGroups " +
! "( ttTgId TEXT(8) , ttTiId TEXT(8))");
! // validatedTickers will contain a record for each ticker whose quotes have already
! // been validated. The quotes are meant to be ok from vtStartDate to vtEndDate.
! this.executeCommand( "CREATE TABLE validatedTickers " +
! "( vtTicker TEXT(8) , vtStartDate DATETIME , vtEndDate DATETIME , vtEditDate DATETIME, " +
! "CONSTRAINT myKey PRIMARY KEY ( vtTicker ) )" );
! // visuallyValidatedTickers will contain a record for each ticker whose
! // quotes with suspicious ratios have been validated.
! // Field list:
! // vvTicker: validated ticker
! // vvStartDate: starting date of the time span being visually validated
! // vvEndDate: ending date of the time span being visually validated
! // vvHashValue: hash value for the visually validated quotes
! // vvCloseToCloseRatio: the close to close ratio has been checked to be acceptable
! // vvRangeToRangeRatio: the High-Low range ratio has been checked to be acceptable
! // vvDate: Last date this record has been added/modified
! this.executeCommand( "CREATE TABLE visuallyValidatedTickers " +
! "( vvTicker TEXT(8) , vvStartDate DATETIME , vvEndDate DATETIME , " +
! "vvHashValue TEXT(50) , vvEditDate DATETIME, " +
! "vvCloseToCloseRatio BIT , vvRangeToRangeRatio BIT , " +
! "CONSTRAINT myKey PRIMARY KEY ( vvTicker ) )" );
! // quotesFromSecondarySources will contain quotes coming from sources different
! // from the main one. It will be used for confirming and thus validation purposes.
! // Field descriptions:
! // qsSource: 1 = manually inserted; 2 = automatically downloaded/imported
! // qsEditDate: last date this record has been added/modified
! this.executeCommand( "create table quotesFromSecondarySources " +
! "(qsTicker TEXT(8) , " +
! "qsDate DATETIME , " +
! "qsSource SHORT , " +
! "qsOpen SINGLE , " +
! "qsHigh SINGLE , " +
! "qsLow SINGLE , " +
! "qsClose SINGLE , " +
! "qsVolume SINGLE , " +
! "qsAdjustedClose SINGLE , " +
! "qsAdjustedCloseToCloseRatio DOUBLE " +
! "qsEditDate DATETIME , " +
! "CONSTRAINT myKey PRIMARY KEY ( qsTicker , qsDate , qsSource ) )" );
! // >>>>>>> 1.4
}
|
|
From: <mi...@us...> - 2004-01-16 19:17:03
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess
In directory sc8-pr-cvs1:/tmp/cvs-serv14860/b2_DataAccess
Modified Files:
DataBaseVersionManager.cs
Log Message:
The management of the database has been simplified.
The class will update the existing database to the last structure designed in the project.
Index: DataBaseVersionManager.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DataBaseVersionManager.cs 3 Jan 2004 19:01:43 -0000 1.3
--- DataBaseVersionManager.cs 16 Jan 2004 19:17:00 -0000 1.4
***************
*** 46,61 ****
public class DataBaseVersionManager
{
- private OleDbDataAdapter oleDbDataAdapter;
- private DataTable dataTable_version;
- private string selectString;
- private string updateString;
- private int databaseVersion;
private OleDbConnection oleDbConnection;
delegate void updatingMethodHandler();
! private SortedList updatingMethods;
#region "DataBaseVersionManager"
/// <summary>
! /// The method initialize a populate updatingMethods, a SortedList
/// that contains all the delegates that encapsulate all methods
/// whose function is to modify the structure of the database.
--- 46,56 ----
public class DataBaseVersionManager
{
private OleDbConnection oleDbConnection;
delegate void updatingMethodHandler();
! private ArrayList updatingMethods;
#region "DataBaseVersionManager"
/// <summary>
! /// The method initialize a populate updatingMethods, an ArrayList
/// that contains all the delegates that encapsulate all methods
/// whose function is to modify the structure of the database.
***************
*** 65,74 ****
private void initialize_updatingMethods()
{
! this.updatingMethods = new SortedList();
! //After adding a new private method to the class, write
! //the following code, paying attention to the version number:
! //this.updatingMethods.Add(yourVersionNumber,
! // new updatingMethodHandler(this.yourMethodName))
! this.updatingMethods.Add( 2 , new updatingMethodHandler(this.updateToVersion2) );
}
public DataBaseVersionManager(OleDbConnection oleDbConnection)
--- 60,74 ----
private void initialize_updatingMethods()
{
! this.updatingMethods = new ArrayList();
! // After adding a new private method to the class (e.g. dropConstraints o
! // or similar) write similar code to the following:
! this.updatingMethods.Add(new updatingMethodHandler(this.createDatabase));
! this.updatingMethods.Add(new updatingMethodHandler(this.createTables));
! this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddPrimaryKeys));
! this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddForeignKeys));
! this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddIndexes));
! this.updatingMethods.Add(new updatingMethodHandler(this.alterTablesAddColumns));
! this.updatingMethods.Add(new updatingMethodHandler(this.dropTables));
!
}
public DataBaseVersionManager(OleDbConnection oleDbConnection)
***************
*** 78,88 ****
this.oleDbConnection = oleDbConnection;
this.oleDbConnection.Open();
- this.selectString = "SELECT * FROM version";
- this.updateString = "UPDATE version SET veId = ?";
- this.oleDbDataAdapter = new OleDbDataAdapter(selectString, this.oleDbConnection);
- this.oleDbDataAdapter.UpdateCommand = new OleDbCommand(this.updateString,this.oleDbConnection);
- this.oleDbDataAdapter.UpdateCommand.Parameters.Add("@veId", OleDbType.Integer);
- this.oleDbDataAdapter.UpdateCommand.Parameters["@veId"].SourceColumn = "veId";
- this.dataTable_version = new DataTable();
this.initialize_updatingMethods();
}
--- 78,81 ----
***************
*** 96,146 ****
#endregion
#region "updating methods"
! private void updateToVersion2()
{
! string command =
! "create table validatedTickers " +
! "( vtTicker TEXT(8) , vtStartDate DATETIME , vtEndDate DATETIME , vtDate DATETIME, " +
! "CONSTRAINT myKey PRIMARY KEY ( vtTicker ) )";
! OleDbCommand oleDbCommand = new OleDbCommand( command , this.oleDbConnection );
! oleDbCommand.ExecuteNonQuery();
}
#endregion
#region "UpdateDataBaseStructure"
! private int getDataBaseVersionNumber()
! {
! this.dataTable_version.Clear();
! this.oleDbDataAdapter.Fill(this.dataTable_version);
! DataRow dataRow = this.dataTable_version.Rows[0];
! return (int)dataRow["veId"];
! }
! private void setNewDataBaseVersionNumber(int newVersionNumber)
! {
! this.dataTable_version.Rows[0]["veId"] = newVersionNumber;
! this.oleDbDataAdapter.Update(this.dataTable_version);
! this.dataTable_version.AcceptChanges();
! }
! private void executeMethod(DictionaryEntry itemContainingMethod)
! {
! this.databaseVersion = this.getDataBaseVersionNumber();
! int differenceBetweenNewVersionAndDataBaseVersion =
! (int)itemContainingMethod.Key - this.databaseVersion;
! if(differenceBetweenNewVersionAndDataBaseVersion == 1)
! //db's structure can be updated by the method contained in the item
! {
! updatingMethodHandler handler = (updatingMethodHandler)itemContainingMethod.Value;
! handler();
! //it calls the method that modifies the db structure
! this.setNewDataBaseVersionNumber((int)itemContainingMethod.Key);
! }
! }
! public void UpdateDataBaseStructure()
{
try
{
! foreach (DictionaryEntry method in this.updatingMethods)
{
! this.executeMethod(method);
}
this.oleDbConnection.Close();
--- 89,171 ----
#endregion
+
#region "updating methods"
! private void createDatabase()
! {
! //TODO code to create an empty DB if user doesn't select the QuantProject.mdb;
! }
! private void createTables()
{
! this.executeCommand("CREATE TABLE tickers (tiTicker TEXT(8))");
! this.executeCommand("CREATE TABLE quotes (quTicker TEXT(8), quDate DATETIME, " +
! "quOpen REAL, quHigh REAL, quLow REAL, quClose REAL, " +
! "quVolume INTEGER, quAdjustedClose REAL, quAdjustedCloseToCloseRatio FLOAT)");
! // table where to store the time period for which tickers' quotes have been validated
! this.executeCommand("CREATE TABLE validatedTickers " +
! "( vtTicker TEXT(8) , vtStartDate DATETIME , vtEndDate DATETIME , vtDate DATETIME)");
! // table of groups where you can collect tickers.
! // Groups are used to simplify operations like:
! // validating, updating data from the web, testing strategies
! this.executeCommand("CREATE TABLE tickerGroups " +
! "( tgId TEXT(8) , tgDescription(100), tgTgId TEXT(8))");
! // where to store the relation between a ticker and a group
! // NOTE that a group can be created inside another group and
! // a ticker can belong to one or more groups
! this.executeCommand("CREATE TABLE tickers_tickerGroups " +
! "( ttTgId TEXT(8) , ttTiId TEXT(8))");
}
+
+ private void alterTablesAddPrimaryKeys()
+ {
+ this.executeCommand("ALTER TABLE tickers ADD CONSTRAINT PKtiTicker PRIMARY KEY (tiTicker)");
+ this.executeCommand("ALTER TABLE quotes ADD CONSTRAINT PKquTicker_quDate " +
+ "PRIMARY KEY (quTicker, quDate)");
+
+ this.executeCommand("ALTER TABLE validatedTickers ADD CONSTRAINT myKey PRIMARY KEY ( vtTicker )");
+ this.executeCommand("ALTER TABLE tickers_tickerGroups " +
+ "ADD CONSTRAINT PKttTgId_ttTiId PRIMARY KEY ( ttTgId, ttTiId)");
+ }
+ private void alterTablesAddForeignKeys()
+ {
+ // add code here for adding foreign keys to existing tables;
+ }
+ private void alterTablesAddColumns()
+ {
+ //add code here for adding columns to existing tables;
+ }
+ private void alterTablesAddIndexes()
+ {
+ //add code here for adding indexes to existing tables;
+ }
+
+ private void dropTables()
+ {
+ this.executeCommand("DROP TABLE version");
+ }
+ private void executeCommand(string commandToBeExecuted)
+ {
+ try
+ {
+ OleDbCommand oleDbCommand = new OleDbCommand( commandToBeExecuted , this.oleDbConnection );
+ int checkCommandExecution = oleDbCommand.ExecuteNonQuery();
+ }
+ catch(Exception ex)
+ {
+ string notUsed = ex.ToString();// to avoid warning after compilation
+ }
+ }
+
#endregion
+
#region "UpdateDataBaseStructure"
! public void UpdateDataBaseStructure()
{
try
{
! foreach (Object method in this.updatingMethods)
{
! updatingMethodHandler handler = (updatingMethodHandler)method;
! handler();
}
this.oleDbConnection.Close();
***************
*** 153,156 ****
--- 178,182 ----
}
#endregion
+
}
}
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTSimpleTest_2
In directory sc8-pr-cvs1:/tmp/cvs-serv12998/b7_Scripts/SimpleTesting/MSFTSimpleTest_2
Modified Files:
AsMSFTsimpleTest_2.cs RunMSFTsimpleTest_2.cs
TsMSFTsimpleTest_2.cs
Log Message:
Implemented the script, whose purpose is only to test the program's behaviour.
Index: AsMSFTsimpleTest_2.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTSimpleTest_2/AsMSFTsimpleTest_2.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AsMSFTsimpleTest_2.cs 20 Dec 2003 18:31:36 -0000 1.1
--- AsMSFTsimpleTest_2.cs 11 Jan 2004 19:15:21 -0000 1.2
***************
*** 41,45 ****
//
}
! }
! //TODO: override of the base methods
}
--- 41,123 ----
//
}
! public override ArrayList GetOrdersForCurrentVirtualOrder( Order virtualOrder )
! {
! ArrayList orders = new ArrayList();
! switch(virtualOrder.Type)
! {
! case OrderType.MarketBuy:
! if(virtualOrder.Quantity != 0)
! {
! if ( this.account.Portfolio.IsShort( virtualOrder.Instrument ) )
! orders.Add( new Order( OrderType.MarketCover ,
! virtualOrder.Instrument ,
! (long) - ((Position)this.account.Portfolio[ virtualOrder.Instrument.Key ]).Quantity ,
! virtualOrder.ExtendedDateTime ) );
!
! if ( !this.account.Portfolio.IsLong( virtualOrder.Instrument ) )
! orders.Add( new Order( OrderType.MarketBuy ,
! virtualOrder.Instrument ,
! virtualOrder.Instrument.GetMaxBuyableQuantity(
! this.account.CashAmount +
! this.account.Portfolio.GetMarketValue( virtualOrder.ExtendedDateTime ) ,
! virtualOrder.ExtendedDateTime ) , virtualOrder.ExtendedDateTime ) );
! }
! else
! //it is a special order that acts in order to close any open position
! {
! if ( this.account.Portfolio.IsShort( virtualOrder.Instrument ) )
! orders.Add( new Order( OrderType.MarketCover ,
! virtualOrder.Instrument ,
! -(long) this.account.Portfolio.GetPosition( virtualOrder.Instrument ).Quantity ,
! virtualOrder.ExtendedDateTime ) );
!
! if ( this.account.Portfolio.IsLong( virtualOrder.Instrument ) )
! orders.Add( new Order( OrderType.MarketSell ,
! virtualOrder.Instrument ,
! (long) this.account.Portfolio.GetPosition( virtualOrder.Instrument ).Quantity ,
! virtualOrder.ExtendedDateTime ) );
! }
! break;
!
! case OrderType.MarketSell:
! if ( this.account.Portfolio.IsLong( virtualOrder.Instrument ) )
! orders.Add( new Order( OrderType.MarketSell ,
! virtualOrder.Instrument ,
! (long) this.account.Portfolio.GetPosition( virtualOrder.Instrument ).Quantity ,
! virtualOrder.ExtendedDateTime ) );
! if ( !this.account.Portfolio.IsShort( virtualOrder.Instrument ) )
! orders.Add( new Order( OrderType.MarketSellShort ,
! virtualOrder.Instrument ,
! virtualOrder.Instrument.GetMaxBuyableQuantity(
! this.account.CashAmount +
! this.account.Portfolio.GetMarketValue( virtualOrder.ExtendedDateTime ) ,
! virtualOrder.ExtendedDateTime ) ,
! virtualOrder.ExtendedDateTime ) );
! break;
! default:
! break;
! }
! return orders;
! }
!
! public override Orders GetOrders( Signal signal )
! {
! // This is the default account strategy. You may wish to override it.
! // It assumes the signal contains a single virtual order and it invests
! // all the available cash according to such virtual order. It assumes
! // the account will always contain a single position (long or short)
! // determined by the last signal.
! Orders orders = new Orders();
! foreach ( Order virtualOrder in signal )
! {
! ArrayList ordersForCurrentVirtualOrder =
! this.GetOrdersForCurrentVirtualOrder( virtualOrder );
! foreach( Order order in ordersForCurrentVirtualOrder )
! orders.Add( order );
! }
! return orders;
! }
!
! }
!
}
Index: RunMSFTsimpleTest_2.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTSimpleTest_2/RunMSFTsimpleTest_2.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RunMSFTsimpleTest_2.cs 20 Dec 2003 18:43:50 -0000 1.2
--- RunMSFTsimpleTest_2.cs 11 Jan 2004 19:15:21 -0000 1.3
***************
*** 50,54 ****
{
DateTime startDateTime = new DateTime( 2000 , 1 , 1 );
! DateTime endDateTime = new DateTime( 2000 , 12 , 31 );
QuoteCache.Add( new Instrument( "MSFT" ) , BarComponent.Open );
QuoteCache.Add( new Instrument( "MSFT" ) , BarComponent.Close );
--- 50,54 ----
{
DateTime startDateTime = new DateTime( 2000 , 1 , 1 );
! DateTime endDateTime = new DateTime( 2000 , 12 , 29 );
QuoteCache.Add( new Instrument( "MSFT" ) , BarComponent.Open );
QuoteCache.Add( new Instrument( "MSFT" ) , BarComponent.Close );
Index: TsMSFTsimpleTest_2.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTSimpleTest_2/TsMSFTsimpleTest_2.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TsMSFTsimpleTest_2.cs 20 Dec 2003 18:43:50 -0000 1.2
--- TsMSFTsimpleTest_2.cs 11 Jan 2004 19:15:21 -0000 1.3
***************
*** 45,99 ****
}
! private History microsoftCloseHistory;
! private History microsoftCloseHistorySimpleAverage;
! private History microsoftCloseHistoryStandardDeviation;
!
! public override void InitializeData()
! {
! microsoftCloseHistory = QuoteCache.GetCloseHistory( "MSFT" );
! microsoftCloseHistoryStandardDeviation =
! microsoftCloseHistory.GetFunctionHistory (Function.StandardDeviation,5,
! new DateTime(2000,1,1),
! new DateTime(2000,12,31));
! microsoftCloseHistorySimpleAverage =
! microsoftCloseHistory.GetFunctionHistory (Function.SimpleAverage,5,
! new DateTime(2000,1,1),
! new DateTime(2000,12,31));
! }
! public override Signals GetSignals( ExtendedDateTime extendedDateTime )
! {
! Signals signals = new Signals();
! if ( extendedDateTime.BarComponent == BarComponent.Close &&
! microsoftCloseHistoryStandardDeviation.IsDecreased(extendedDateTime.DateTime))
{
! Signal signal = new Signal();
! if ( this.microsoftCloseHistorySimpleAverage.IsDecreased(extendedDateTime.DateTime) )
! {
!
! signal.Add( new Order( OrderType.MarketSell , new Instrument( "MSFT" ) , 1 ,
! new ExtendedDateTime(
! new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
! BarComponent.Open ) ) );
! signals.Add( signal );
!
! }
! else
! {
! signal.Add( new Order( OrderType.MarketBuy , new Instrument( "MSFT" ) , 1 ,
! new ExtendedDateTime( new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
! BarComponent.Open ) ) );
! signals.Add( signal );
! }
}
! else
! //no signal given by the history of standard deviation
{
! // TODO:...
! //if there's an open position, return a signal to close it the next market day
}
-
- return signals;
- }
}
}
--- 45,104 ----
}
! private History microsoftCloseHistory;
! private History microsoftCloseHistorySimpleAverage;
! private History microsoftCloseHistoryStandardDeviation;
! public override void InitializeData()
{
! microsoftCloseHistory = QuoteCache.GetCloseHistory( "MSFT" );
!
! microsoftCloseHistoryStandardDeviation =
! microsoftCloseHistory.GetFunctionHistory (Function.StandardDeviation,5,
! (DateTime)this.microsoftCloseHistory.GetKey(0),
! (DateTime)this.microsoftCloseHistory.GetKey(this.microsoftCloseHistory.Count - 1));
! microsoftCloseHistorySimpleAverage =
! microsoftCloseHistory.GetFunctionHistory (Function.SimpleAverage,5,
! (DateTime)this.microsoftCloseHistory.GetKey(0),
! (DateTime)this.microsoftCloseHistory.GetKey(this.microsoftCloseHistory.Count - 1));
}
!
! public override Signals GetSignals( ExtendedDateTime extendedDateTime )
{
! Signals signals = new Signals();
! Signal signal = new Signal();
! if ( extendedDateTime.BarComponent == BarComponent.Close)
! {
! if(microsoftCloseHistoryStandardDeviation.IsDecreased(extendedDateTime.DateTime))
! {
! if ( this.microsoftCloseHistorySimpleAverage.IsDecreased(extendedDateTime.DateTime) )
! {
!
! signal.Add( new Order( OrderType.MarketSell , new Instrument( "MSFT" ) , 1 ,
! new ExtendedDateTime(
! new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
! BarComponent.Open ) ) );
! signals.Add( signal );
!
! }
! else
! {
! signal.Add( new Order( OrderType.MarketBuy , new Instrument( "MSFT" ) , 1 ,
! new ExtendedDateTime( new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
! BarComponent.Open ) ) );
! signals.Add( signal );
! }
! }
! else
! //if no signal is given by the history of standard deviation
! //add a special signal to be managed by the account strategy
! {
! signal.Add( new Order( OrderType.MarketBuy , new Instrument( "MSFT" ) , 0 ,
! new ExtendedDateTime( new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
! BarComponent.Open ) ) );
! signals.Add( signal );
! }
! }
! return signals;
}
}
}
|
|
From: <mi...@us...> - 2004-01-11 19:09:15
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Histories
In directory sc8-pr-cvs1:/tmp/cvs-serv11865/b1_ADT/Histories
Modified Files:
History.cs
Log Message:
Fixed some bugs in methods:
- GetFunctionHistory
- IsDecreased
Index: History.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Histories/History.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** History.cs 20 Dec 2003 18:37:43 -0000 1.5
--- History.cs 11 Jan 2004 19:09:11 -0000 1.6
***************
*** 90,99 ****
return (DateTime) this.GetKey( this.IndexOfKeyOrPrevious( dateTime ) + 1 );
}
! //millo
public DateTime GetDay( DateTime initialDateTime, int numberOfDaysAhead )
{
if ( this.IndexOfKey( initialDateTime ) >= ( this.Count - numberOfDaysAhead ) )
! // return the last dateTime in the history
! return (DateTime) this.GetKey(this.Count -1);
else
return (DateTime) this.GetKey( this.IndexOfKeyOrPrevious( initialDateTime ) + numberOfDaysAhead );
--- 90,103 ----
return (DateTime) this.GetKey( this.IndexOfKeyOrPrevious( dateTime ) + 1 );
}
! //millo - fixed method
public DateTime GetDay( DateTime initialDateTime, int numberOfDaysAhead )
{
if ( this.IndexOfKey( initialDateTime ) >= ( this.Count - numberOfDaysAhead ) )
! // initial dateTime + n° of days ahead > the last dateTime in History
! {
! DateTime dateTime;
! dateTime = (DateTime)this.GetKey(this.Count -1);
! return dateTime.AddDays(this.IndexOfKey(initialDateTime) + numberOfDaysAhead - this.Count);
! }
else
return (DateTime) this.GetKey( this.IndexOfKeyOrPrevious( initialDateTime ) + numberOfDaysAhead );
***************
*** 104,108 ****
/// <summary>
! /// Gets a History object base on a statistical available function
/// </summary>
/// <remarks>
--- 108,112 ----
/// <summary>
! /// Gets a History object based on a statistical available function
/// </summary>
/// <remarks>
***************
*** 139,143 ****
( ((IComparable)this.GetKey( currentHistoryIndex )).CompareTo( endDateTime ) <= 0 ) )
{
! DateTime dateTime = (DateTime)this.GetKey( currentHistoryIndex );
if (Math.Floor(currentHistoryIndex/onEachPeriodOf) == periodIndex &&
cursorThroughDataArray < onEachPeriodOf)
--- 143,147 ----
( ((IComparable)this.GetKey( currentHistoryIndex )).CompareTo( endDateTime ) <= 0 ) )
{
!
if (Math.Floor(currentHistoryIndex/onEachPeriodOf) == periodIndex &&
cursorThroughDataArray < onEachPeriodOf)
***************
*** 146,151 ****
data[cursorThroughDataArray] = Convert.ToDouble(this.GetByIndex(currentHistoryIndex));
cursorThroughDataArray++;
currentHistoryIndex++;
! //POSSIBLY: simpleAverage.Add(this.GetKey( currentHistoryIndex ), null);
}
else
--- 150,156 ----
data[cursorThroughDataArray] = Convert.ToDouble(this.GetByIndex(currentHistoryIndex));
cursorThroughDataArray++;
+ functionHistory.Add(this.GetKey( currentHistoryIndex ), null);
currentHistoryIndex++;
!
}
else
***************
*** 154,164 ****
{
cursorThroughDataArray = 0;
switch (functionToBeCalculated)
{
case Function.SimpleAverage:
! functionHistory.Add( dateTime , BasicFunctions.SimpleAverage(data) );
break;
case Function.StandardDeviation :
! functionHistory.Add( dateTime , BasicFunctions.StdDev(data) );
break;
}
--- 159,174 ----
{
cursorThroughDataArray = 0;
+ DateTime dateTime = (DateTime)this.GetKey( currentHistoryIndex - onEachPeriodOf);
switch (functionToBeCalculated)
{
case Function.SimpleAverage:
! functionHistory.SetByIndex(currentHistoryIndex - onEachPeriodOf,
! BasicFunctions.SimpleAverage(data));
! //functionHistory.Add( dateTime , BasicFunctions.SimpleAverage(data) );
break;
case Function.StandardDeviation :
! functionHistory.SetByIndex(currentHistoryIndex - onEachPeriodOf,
! BasicFunctions.StdDev(data));
! //functionHistory.Add( dateTime , BasicFunctions.StdDev(data) );
break;
}
***************
*** 173,199 ****
/// <summary>
! /// It returns true if the value of the current History item is
! /// less than the previous History item
/// </summary>
/// <param name="dateTime">The date key for current History item</param>
public bool IsDecreased(DateTime dateTime)
{
! bool isDecreased;
int index = this.IndexOfKey(dateTime);
! if ( index <= 0 )
isDecreased = false;
else
{
! isDecreased = Convert.ToDouble( this[ dateTime ]) <
! Convert.ToDouble( this.GetByIndex(index - 1) );
}
return isDecreased;
-
-
}
-
-
-
-
--- 183,212 ----
/// <summary>
! /// It returns true if the current History item value is not null
! /// and is less than the immediate previous History item whose value is not null
/// </summary>
/// <param name="dateTime">The date key for current History item</param>
public bool IsDecreased(DateTime dateTime)
{
! bool isDecreased = false;
int index = this.IndexOfKey(dateTime);
! int previousIndex = index - 1;
! if ( index <= 0)
isDecreased = false;
else
{
! if(this.GetByIndex(index) != null)
! {
! while (this.GetByIndex(previousIndex) == null)
! {
! previousIndex --;
! }
!
! isDecreased = Convert.ToDouble( this.GetByIndex(index)) <
! Convert.ToDouble( this.GetByIndex(previousIndex) );
! }
}
return isDecreased;
}
|
|
From: <mi...@us...> - 2004-01-11 19:07:52
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1:/tmp/cvs-serv11560/b2_DataAccess Modified Files: DataBaseLocator.cs Log Message: Added GPL reminder to the class Index: DataBaseLocator.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseLocator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DataBaseLocator.cs 10 Nov 2003 19:05:45 -0000 1.1 --- DataBaseLocator.cs 11 Jan 2004 19:07:44 -0000 1.2 *************** *** 1,2 **** --- 1,24 ---- + /* + QuantProject - Quantitative Finance Library + + DataBaseLocator.cs + Copyright (C) 2003 + Marco Milletti + + 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.Xml; |
|
From: <gla...@us...> - 2004-01-03 19:02:16
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1:/tmp/cvs-serv27909 Modified Files: QuantProject.suo Log Message: Added the method to update the database to version 2 Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 Binary files /tmp/cvsudluxr and /tmp/cvsayD8JI differ |
|
From: <gla...@us...> - 2004-01-03 19:01:47
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess
In directory sc8-pr-cvs1:/tmp/cvs-serv27816/b2_DataAccess
Modified Files:
DataBaseVersionManager.cs
Log Message:
Added the method to update the database to version 2
Index: DataBaseVersionManager.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DataBaseVersionManager.cs 3 Jan 2004 16:20:37 -0000 1.2
--- DataBaseVersionManager.cs 3 Jan 2004 19:01:43 -0000 1.3
***************
*** 70,74 ****
//this.updatingMethods.Add(yourVersionNumber,
// new updatingMethodHandler(this.yourMethodName))
!
}
public DataBaseVersionManager(OleDbConnection oleDbConnection)
--- 70,74 ----
//this.updatingMethods.Add(yourVersionNumber,
// new updatingMethodHandler(this.yourMethodName))
! this.updatingMethods.Add( 2 , new updatingMethodHandler(this.updateToVersion2) );
}
public DataBaseVersionManager(OleDbConnection oleDbConnection)
***************
*** 95,98 ****
--- 95,111 ----
#endregion
+
+ #region "updating methods"
+ private void updateToVersion2()
+ {
+ string command =
+ "create table validatedTickers " +
+ "( vtTicker TEXT(8) , vtStartDate DATETIME , vtEndDate DATETIME , vtDate DATETIME, " +
+ "CONSTRAINT myKey PRIMARY KEY ( vtTicker ) )";
+ OleDbCommand oleDbCommand = new OleDbCommand( command , this.oleDbConnection );
+ oleDbCommand.ExecuteNonQuery();
+ }
+ #endregion
+
#region "UpdateDataBaseStructure"
private int getDataBaseVersionNumber()
|
|
From: <gla...@us...> - 2004-01-03 16:22:44
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1:/tmp/cvs-serv32561 Modified Files: QuantProject.suo Log Message: Code has been cleaned up to reach a buildable and runnable application. Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 Binary files /tmp/cvsag4SyA and /tmp/cvs0wsnO0 differ |
|
From: <gla...@us...> - 2004-01-03 16:20:41
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess
In directory sc8-pr-cvs1:/tmp/cvs-serv32120/b2_DataAccess
Modified Files:
DataBaseVersionManager.cs
Log Message:
Minor readability improvements have been
performed: private methods have been grouped
using a region for each public method.
Index: DataBaseVersionManager.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DataBaseVersionManager.cs 1 Jan 2004 19:07:12 -0000 1.1
--- DataBaseVersionManager.cs 3 Jan 2004 16:20:37 -0000 1.2
***************
*** 55,58 ****
--- 55,75 ----
private SortedList updatingMethods;
+ #region "DataBaseVersionManager"
+ /// <summary>
+ /// The method initialize a populate updatingMethods, a SortedList
+ /// that contains all the delegates that encapsulate all methods
+ /// whose function is to modify the structure of the database.
+ /// The key in the sortedList is the new version number that signs
+ /// the database after the execution of the encapsulated method
+ /// </summary>
+ private void initialize_updatingMethods()
+ {
+ this.updatingMethods = new SortedList();
+ //After adding a new private method to the class, write
+ //the following code, paying attention to the version number:
+ //this.updatingMethods.Add(yourVersionNumber,
+ // new updatingMethodHandler(this.yourMethodName))
+
+ }
public DataBaseVersionManager(OleDbConnection oleDbConnection)
{
***************
*** 77,80 ****
--- 94,126 ----
}
+ #endregion
+ #region "UpdateDataBaseStructure"
+ private int getDataBaseVersionNumber()
+ {
+ this.dataTable_version.Clear();
+ this.oleDbDataAdapter.Fill(this.dataTable_version);
+ DataRow dataRow = this.dataTable_version.Rows[0];
+ return (int)dataRow["veId"];
+ }
+ private void setNewDataBaseVersionNumber(int newVersionNumber)
+ {
+ this.dataTable_version.Rows[0]["veId"] = newVersionNumber;
+ this.oleDbDataAdapter.Update(this.dataTable_version);
+ this.dataTable_version.AcceptChanges();
+ }
+ private void executeMethod(DictionaryEntry itemContainingMethod)
+ {
+ this.databaseVersion = this.getDataBaseVersionNumber();
+ int differenceBetweenNewVersionAndDataBaseVersion =
+ (int)itemContainingMethod.Key - this.databaseVersion;
+ if(differenceBetweenNewVersionAndDataBaseVersion == 1)
+ //db's structure can be updated by the method contained in the item
+ {
+ updatingMethodHandler handler = (updatingMethodHandler)itemContainingMethod.Value;
+ handler();
+ //it calls the method that modifies the db structure
+ this.setNewDataBaseVersionNumber((int)itemContainingMethod.Key);
+ }
+ }
public void UpdateDataBaseStructure()
{
***************
*** 92,147 ****
this.oleDbConnection.Close();
}
-
- }
-
- private int getDataBaseVersionNumber()
- {
- this.dataTable_version.Clear();
- this.oleDbDataAdapter.Fill(this.dataTable_version);
- DataRow dataRow = this.dataTable_version.Rows[0];
- return (int)dataRow["veId"];
- }
-
-
- private void setNewDataBaseVersionNumber(int newVersionNumber)
- {
- this.dataTable_version.Rows[0]["veId"] = newVersionNumber;
- this.oleDbDataAdapter.Update(this.dataTable_version);
- this.dataTable_version.AcceptChanges();
- }
- /// <summary>
- /// The method initialize a populate updatingMethods, a SortedList
- /// that contains all the delegates that encapsulate all methods
- /// whose function is to modify the structure of the database.
- /// The key in the sortedList is the new version number that signs
- /// the database after the execution of the encapsulated method
- /// </summary>
- private void initialize_updatingMethods()
- {
- this.updatingMethods = new SortedList();
- //After adding a new private method to the class, write
- //the following code, paying attention to the version number:
- //this.updatingMethods.Add(yourVersionNumber,
- // new updatingMethodHandler(this.yourMethodName))
-
- }
-
- private void executeMethod(DictionaryEntry itemContainingMethod)
- {
- this.databaseVersion = this.getDataBaseVersionNumber();
- int differenceBetweenNewVersionAndDataBaseVersion =
- (int)itemContainingMethod.Key - this.databaseVersion;
- if(differenceBetweenNewVersionAndDataBaseVersion == 1)
- //db's structure can be updated by the method contained in the item
- {
- updatingMethodHandler handler = (updatingMethodHandler)itemContainingMethod.Value;
- handler();
- //it calls the method that modifies the db structure
- this.setNewDataBaseVersionNumber((int)itemContainingMethod.Key);
- }
-
}
!
!
}
}
--- 138,143 ----
this.oleDbConnection.Close();
}
}
! #endregion
}
}
|
|
From: <gla...@us...> - 2004-01-03 16:17:45
|
Update of /cvsroot/quantproject/QuantProject/b3_Data
In directory sc8-pr-cvs1:/tmp/cvs-serv31680/b3_Data
Modified Files:
DataProvider.cs
Log Message:
The GetCloseHistory method has been improved:
if the requested ticker history was not cached yet,
an error happened. Now the ticker is automatically
added to the cached list and the history is read
from the database on the fly.
Index: DataProvider.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProvider.cs,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -C2 -d -r1.1.1.2 -r1.2
*** DataProvider.cs 13 Oct 2003 21:58:09 -0000 1.1.1.2
--- DataProvider.cs 3 Jan 2004 16:17:41 -0000 1.2
***************
*** 91,94 ****
--- 91,101 ----
public static History GetCloseHistory( string instrumentKey )
{
+ if ( ( !cachedHistories.Contains( instrumentKey ) ) ||
+ ( !((Hashtable)cachedHistories[ instrumentKey ]).Contains( BarComponent.Close ) ) )
+ {
+ Add( instrumentKey , BarComponent.Close );
+ ((Hashtable)cachedHistories[ instrumentKey ])[ BarComponent.Close ] =
+ DataBase.GetHistory( instrumentKey , BarComponent.Close );
+ }
return (History)((Hashtable)cachedHistories[ instrumentKey ])[
BarComponent.Close ];
|
|
From: <gla...@us...> - 2004-01-03 16:13:54
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess
In directory sc8-pr-cvs1:/tmp/cvs-serv31132/b2_DataAccess
Modified Files:
DataBase.cs
Log Message:
GetHistories has been fixed to work with the new
quotes table (now adjusted open, adjusted high
and adjusted close are computed values: they
are not stored into the database anymore).
Index: DataBase.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBase.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DataBase.cs 21 Dec 2003 21:09:57 -0000 1.3
--- DataBase.cs 3 Jan 2004 16:13:49 -0000 1.4
***************
*** 46,50 ****
}
! #region "GetHistories"
private static string getFieldName( BarComponent barComponent )
{
--- 46,54 ----
}
! /// <summary>
! /// Returns the field name corresponding to the bar component
! /// </summary>
! /// <param name="barComponent">Discriminates among Open, High, Low and Closure</param>
! /// <returns>Field name corresponding to the bar component</returns>
private static string getFieldName( BarComponent barComponent )
{
***************
*** 53,57 ****
{
case BarComponent.Open:
! fieldName = "quAdjustedOpen";
break;
case BarComponent.High:
--- 57,61 ----
{
case BarComponent.Open:
! fieldName = "quOpen";
break;
case BarComponent.High:
***************
*** 69,72 ****
--- 73,124 ----
return fieldName;
}
+
+ #region "GetHistory"
+ private static History getHistory_try( string instrumentKey , BarComponent barComponent )
+ {
+ History history = new History();
+ string commandString =
+ "select * from quotes where quTicker='" + instrumentKey + "'";
+ OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter( commandString , oleDbConnection );
+ DataTable dataTable = new DataTable();
+ oleDbDataAdapter.Fill( dataTable );
+ history.Import( dataTable , "quDate" , getFieldName( barComponent ) );
+ return history;
+ }
+ /// <summary>
+ /// Returns the full history for the instrument and the specified bar component
+ /// </summary>
+ /// <param name="instrumentKey">Identifier (ticker) for the instrument whose story
+ /// has to be returned</param>
+ /// <param name="barComponent">Discriminates among Open, High, Low and Closure</param>
+ /// <returns>The history for the given instrument and bar component</returns>
+ public static History GetHistory( string instrumentKey , BarComponent barComponent )
+ {
+ History history;
+ try
+ {
+ history = getHistory_try( instrumentKey , barComponent );
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show( ex.ToString() );
+ history = null;
+ }
+ return history;
+ }
+ #endregion
+
+ #region "GetHistories"
+ private static Single getHistories_try_getValue( DataRow dataRow , DateTime dateTime ,
+ BarComponent barComponent )
+ {
+ Single returnValue;
+ if ( barComponent == BarComponent.Close )
+ returnValue = (Single)dataRow[ getFieldName( barComponent ) ];
+ else
+ returnValue = (Single)dataRow[ getFieldName( barComponent ) ] *
+ (Single)dataRow[ "quAdjustedClose" ] / (Single)dataRow[ "quClose" ];
+ return returnValue;
+ }
private static Hashtable getHistories_try( string instrumentKey , Hashtable barComponents , DateTime startDateTime , DateTime endDateTime )
{
***************
*** 84,88 ****
foreach ( BarComponent barComponent in barComponents.Keys )
((History) histories[ barComponent ]).Add( (DateTime) dataRow[ "quDate" ] ,
! dataRow[ getFieldName( barComponent ) ] );
return histories;
}
--- 136,142 ----
foreach ( BarComponent barComponent in barComponents.Keys )
((History) histories[ barComponent ]).Add( (DateTime) dataRow[ "quDate" ] ,
! getHistories_try_getValue( dataRow , (DateTime) dataRow[ "quDate" ] , barComponent ) );
! // ((History) histories[ barComponent ]).Add( (DateTime) dataRow[ "quDate" ] ,
! // dataRow[ getFieldName( barComponent ) ] );
return histories;
}
|
|
From: <gla...@us...> - 2004-01-03 16:06:05
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess
In directory sc8-pr-cvs1:/tmp/cvs-serv30092/b2_DataAccess
Modified Files:
ConnectionProvider.cs
Log Message:
DataBaseVersionManager now is invoked only
when the connection is created.
Index: ConnectionProvider.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/ConnectionProvider.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ConnectionProvider.cs 1 Jan 2004 19:10:39 -0000 1.2
--- ConnectionProvider.cs 3 Jan 2004 16:05:59 -0000 1.3
***************
*** 56,63 ****
@";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False";
oleDbConnection = new OleDbConnection( connectionString );
}
! DataBaseVersionManager dataBaseVersionManager = new DataBaseVersionManager(oleDbConnection);
! dataBaseVersionManager.UpdateDataBaseStructure();
! return oleDbConnection;
}
}
--- 56,63 ----
@";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False";
oleDbConnection = new OleDbConnection( connectionString );
+ DataBaseVersionManager dataBaseVersionManager = new DataBaseVersionManager(oleDbConnection);
+ dataBaseVersionManager.UpdateDataBaseStructure();
}
! return oleDbConnection;
}
}
|
|
From: <mi...@us...> - 2004-01-02 23:31:13
|
Update of /cvsroot/quantproject/mdb In directory sc8-pr-cvs1:/tmp/cvs-serv18828 Modified Files: QuantProject.mdb Log Message: Added table version (for the management of the database's structure) Index: QuantProject.mdb =================================================================== RCS file: /cvsroot/quantproject/mdb/QuantProject.mdb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsHln4TP and /tmp/cvseTtpAw differ |
|
From: <mi...@us...> - 2004-01-01 19:10:44
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess
In directory sc8-pr-cvs1:/tmp/cvs-serv21246/b2_DataAccess
Modified Files:
ConnectionProvider.cs
Log Message:
The connection provider now calls the UpdateDataBaseStructure method of the DataBaseVersionManager object.
Index: ConnectionProvider.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/ConnectionProvider.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ConnectionProvider.cs 21 Dec 2003 21:08:39 -0000 1.1
--- ConnectionProvider.cs 1 Jan 2004 19:10:39 -0000 1.2
***************
*** 23,26 ****
--- 23,27 ----
using System;
using System.Data.OleDb;
+ using QuantProject.DataAccess;
namespace QuantProject.DataAccess
***************
*** 56,60 ****
oleDbConnection = new OleDbConnection( connectionString );
}
! return oleDbConnection;
}
}
--- 57,63 ----
oleDbConnection = new OleDbConnection( connectionString );
}
! DataBaseVersionManager dataBaseVersionManager = new DataBaseVersionManager(oleDbConnection);
! dataBaseVersionManager.UpdateDataBaseStructure();
! return oleDbConnection;
}
}
|