quantproject-developers Mailing List for QuantProject (Page 146)
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: <mi...@us...> - 2003-12-18 21:18:34
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTSimpleTest_2
In directory sc8-pr-cvs1:/tmp/cvs-serv11385/b7_Scripts/SimpleTesting/MSFTSimpleTest_2
Added Files:
RunMSFTsimpleTest_2.cs TsMSFTsimpleTest_2.cs
Log Message:
Added tsMSFTsimpleTest_2.cs and runMSFTsimpleTest_2.cs within a dedicated folder.
These two files are equal to the files just removed from the repository.
--- NEW FILE: RunMSFTsimpleTest_2.cs ---
/*
QuantProject - Quantitative Finance Library
RunMSFTsimpleTest_2.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 QuantProject.ADT;
using QuantProject.ADT.Histories;
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Accounting;
using QuantProject.Business.Financial.Accounting.Reporting;
using QuantProject.Business.Financial.Instruments;
using QuantProject.Business.Testing;
using QuantProject.Business.Strategies;
using QuantProject.Business.Scripting;
using QuantProject.Presentation.MicrosoftExcel;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for runMSFTsimpleTest_2.
/// </summary>
public class RunMSFTsimpleTest_2 : Script
{
public RunMSFTsimpleTest_2()
{
//
// TODO: Add constructor logic here
//
}
public override void Run()
{
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 );
QuoteCache.SetCache( startDateTime , endDateTime );
TradingSystems tradingSystems = new TradingSystems();
tradingSystems.Add( new TsMSFTsimpleTest_2() );
Tester tester = new Tester(
new TestWindow( startDateTime , endDateTime ) ,
tradingSystems ,
10000 );
//tester.Parameters.Add( new Parameter( "SMAdays" , 10 , 10 , 2 ) );
//tester.Optimize();
//tester.OptimalParameters.ReportToConsole();
//tester.Parameters = tester.OptimalParameters;
//tester.Objective();
//tester.Account.ReportToConsole( endDateTime );
tester.Test();
((History)tester.Account.GetProfitNetLossHistory(
new ExtendedDateTime( endDateTime , BarComponent.Close ) ) ).ReportToConsole();
// tester.Account.AccountReport.ReportToExcel( "MSFT" ,
// new ExtendedDateTime( endDateTime , BarComponent.Close ) );
AccountReport accountReport = tester.Account.CreateReport( "MSFT" , 7 ,
new ExtendedDateTime( endDateTime , BarComponent.Close ) , "MSFT" );
ExcelManager.Add( accountReport );
ExcelManager.ShowReport();
}
}
}
--- NEW FILE: TsMSFTsimpleTest_2.cs ---
/*
QuantProject - Quantitative Finance Library
TsMSFTsimpleTest_2.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.Collections;
using QuantProject.ADT;
using QuantProject.ADT.Histories;
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Instruments;
using QuantProject.Business.Financial.Ordering;
using QuantProject.Business.Strategies;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for tsMSFTsimpleTest_2.
/// </summary>
public class TsMSFTsimpleTest_2 : TradingSystem
{
public TsMSFTsimpleTest_2()
{
//
// TODO: Add constructor logic here
//
}
private History microsoftCloseHistory;
private History microsoftCloseHistorySimpleAverage;
private History microsoftCloseHistoryStandardDeviation;
public override void InitializeData()
{
microsoftCloseHistory = QuoteCache.GetCloseHistory( "MSFT" );
microsoftCloseHistoryStandardDeviation =
microsoftCloseHistory.GetStandardDeviation(5, new DateTime(2000,1,1),new DateTime(2000,12,31));
microsoftCloseHistorySimpleAverage =
microsoftCloseHistory.GetSimpleAverage(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.MarketSellShort , new Instrument( "MSFT" ) , 1 ,
new ExtendedDateTime(
new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
BarComponent.Open ) ) );
signal.Add( new Order( OrderType.MarketCover , new Instrument( "MSFT" ) , 1 ,
new ExtendedDateTime(
new Instrument( "MSFT" ).GetMarketDay ( extendedDateTime.DateTime,5 ) ,
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 ) ) );
signal.Add( new Order( OrderType.MarketSell , new Instrument( "MSFT" ) , 1 ,
new ExtendedDateTime( new Instrument( "MSFT" ).GetMarketDay( extendedDateTime.DateTime,5 ) ,
BarComponent.Open ) ) );
signals.Add( signal );
}
}
return signals;
}
}
}
|
|
From: <mi...@us...> - 2003-12-18 21:14:01
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTsimpleTest In directory sc8-pr-cvs1:/tmp/cvs-serv10578/b7_Scripts/SimpleTesting/MSFTsimpleTest Removed Files: RunMSFTsimpleTest_2.cs TsMSFTsimpleTest_2.cs Log Message: Removed tsMSFTsimpleTest_2.cs and runMSFTsimpleTest_2.cs from previous position. These two files are now under a dedicated folder (with same names). --- RunMSFTsimpleTest_2.cs DELETED --- --- TsMSFTsimpleTest_2.cs DELETED --- |
|
From: <mi...@us...> - 2003-12-18 21:09:03
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Histories In directory sc8-pr-cvs1:/tmp/cvs-serv9647/b1_ADT/Histories Removed Files: Stat.cs Log Message: Removed file Stat.cs. The same functions are now in the new file BasicFunctions.cs under the Statistics folder. --- Stat.cs DELETED --- |
|
From: <mi...@us...> - 2003-12-18 21:07:21
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTSimpleTest_2 In directory sc8-pr-cvs1:/tmp/cvs-serv9347/MSFTSimpleTest_2 Log Message: Directory /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTSimpleTest_2 added to the repository |
|
From: <gla...@us...> - 2003-12-18 18:29:54
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate
In directory sc8-pr-cvs1:/tmp/cvs-serv8006/Downloader/Validate
Modified Files:
ValidateForm.cs
Log Message:
DataGrid1 now instantiates the ValidateDataGrid class
Index: ValidateForm.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/ValidateForm.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ValidateForm.cs 16 Dec 2003 15:46:17 -0000 1.2
--- ValidateForm.cs 18 Dec 2003 18:29:51 -0000 1.3
***************
*** 16,20 ****
private System.Windows.Forms.Button buttonGo;
private System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1;
- private System.Windows.Forms.DataGrid dataGrid1;
private ValidateDataTable validateDataTable;
private System.Data.OleDb.OleDbCommand oleDbSelectCommand1;
--- 16,19 ----
***************
*** 26,29 ****
--- 25,29 ----
private System.Windows.Forms.TextBox textBoxSuspiciousRatio;
private System.Windows.Forms.Label labelSuspiciousRatio;
+ private QuantProject.Applications.Downloader.Validate.ValidateDataGrid validateDataGrid;
/// <summary>
/// Required designer variable.
***************
*** 69,77 ****
this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbUpdateCommand1 = new System.Data.OleDb.OleDbCommand();
! this.dataGrid1 = new System.Windows.Forms.DataGrid();
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.dataGrid1)).BeginInit();
this.SuspendLayout();
//
--- 69,77 ----
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();
//
***************
*** 204,216 ****
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));
//
! // dataGrid1
//
! this.dataGrid1.DataMember = "";
! this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
! this.dataGrid1.Location = new System.Drawing.Point(16, 56);
! this.dataGrid1.Name = "dataGrid1";
! this.dataGrid1.PreferredColumnWidth = 50;
! this.dataGrid1.Size = new System.Drawing.Size(696, 224);
! this.dataGrid1.TabIndex = 3;
//
// buttonCommitAndRefresh
--- 204,216 ----
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
***************
*** 247,251 ****
this.textBoxSuspiciousRatio,
this.buttonCommitAndRefresh,
! this.dataGrid1,
this.buttonGo,
this.labelTickerIsLike,
--- 247,251 ----
this.textBoxSuspiciousRatio,
this.buttonCommitAndRefresh,
! this.validateDataGrid,
this.buttonGo,
this.labelTickerIsLike,
***************
*** 253,257 ****
this.Name = "ValidateForm";
this.Text = "Validate";
! ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false);
--- 253,257 ----
this.Name = "ValidateForm";
this.Text = "Validate";
! ((System.ComponentModel.ISupportInitialize)(this.validateDataGrid)).EndInit();
this.ResumeLayout(false);
***************
*** 259,268 ****
#endregion
private void buttonGo_Click(object sender, System.EventArgs e)
{
! this.validateDataTable = new ValidateDataTable();
! this.dataGrid1.DataSource = validateDataTable;
! validateDataTable.AddRows( textBoxTickerIsLike.Text , Convert.ToDouble( this.textBoxSuspiciousRatio.Text ) );
}
private void buttonCommitAndRefresh_Click(object sender, System.EventArgs e)
--- 259,285 ----
#endregion
+ #region "buttonGo_Click"
+ // private void buttonGo_Click_setTableStyle()
+ // {
+ // DataGridTableStyle dataGridTableStyle = new DataGridTableStyle();
+ // dataGridTableStyle.ColumnHeadersVisible = true;
+ // dataGridTableStyle.MappingName = "quotes";
+ // DataGridTextBoxColumn dataGridColumnStyle = new DataGridTextBoxColumn();
+ // dataGridColumnStyle.MappingName = "quTicker";
+ // dataGridColumnStyle.HeaderText = "Ticker";
+ // dataGridTableStyle.GridColumnStyles.Add( dataGridColumnStyle );
+ // this.dataGrid1.TableStyles.Add( dataGridTableStyle );
+ // }
private void buttonGo_Click(object sender, System.EventArgs e)
{
! this.validateDataTable = this.validateDataGrid.Validate( this.textBoxTickerIsLike.Text ,
! this.textBoxSuspiciousRatio.Text );
! // this.validateDataTable = new ValidateDataTable();
! // this.dataGrid1.DataSource = validateDataTable;
! // buttonGo_Click_setTableStyle();
! // validateDataTable.AddRows( textBoxTickerIsLike.Text , Convert.ToDouble( this.textBoxSuspiciousRatio.Text ) );
}
+ #endregion
+
private void buttonCommitAndRefresh_Click(object sender, System.EventArgs e)
|
|
From: <gla...@us...> - 2003-12-18 18:28:51
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate
In directory sc8-pr-cvs1:/tmp/cvs-serv7635/Downloader/Validate
Modified Files:
ValidateDataTable.cs
Log Message:
Added TableName
Index: ValidateDataTable.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/ValidateDataTable.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ValidateDataTable.cs 16 Dec 2003 15:53:43 -0000 1.3
--- ValidateDataTable.cs 18 Dec 2003 18:28:47 -0000 1.4
***************
*** 24,27 ****
--- 24,28 ----
this.oleDbDataAdapter.UpdateCommand = this.oleDbCommandBuilder.GetUpdateCommand();
this.oleDbDataAdapter.Fill( this );
+ this.TableName = "quotes";
}
|
|
From: <mi...@us...> - 2003-12-17 19:34:59
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Histories
In directory sc8-pr-cvs1:/tmp/cvs-serv24844/b1_ADT/Histories
Modified Files:
History.cs
Log Message:
Removed file Stat.cs. The same functions are now in the new file BasicFunctions.cs under the Statistics folder. Added new method to Instrument class and to the History class. Fixed some bugs
Index: History.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Histories/History.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** History.cs 17 Dec 2003 14:17:59 -0000 1.3
--- History.cs 17 Dec 2003 19:34:55 -0000 1.4
***************
*** 25,28 ****
--- 25,29 ----
using System.Data;
using QuantProject.ADT;
+ using QuantProject.ADT.Statistics;
***************
*** 89,92 ****
--- 90,103 ----
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 );
+ }
+ //millo
#region "Millo_1 - SimpleAverage and StandardDeviation"
***************
*** 109,112 ****
--- 120,124 ----
data[i] = Convert.ToDouble(this.GetByIndex(index));
i++;
+ index++;
//simpleAverage.Add(this.GetKey( index ), null);
}
***************
*** 114,120 ****
{
i = 0;
! simpleAverage.Add( dateTime , Stat.SimpleAverage(data) );
}
- index++;
checkValue = Math.Floor(index/onEachPeriodOf);//update checkValue
}
--- 126,131 ----
{
i = 0;
! simpleAverage.Add( dateTime , BasicFunctions.SimpleAverage(data) );
}
checkValue = Math.Floor(index/onEachPeriodOf);//update checkValue
}
***************
*** 140,143 ****
--- 151,155 ----
data[i] = Convert.ToDouble(this.GetByIndex(index));
i++;
+ index++;
//stdDev.Add(this.GetKey( index ), null);
}
***************
*** 145,151 ****
{
i = 0;
! stdDev.Add( dateTime , Stat.StdDev (data) );
}
- index++;
checkValue = Math.Floor(index/onEachPeriodOf);//update checkValue
}
--- 157,162 ----
{
i = 0;
! stdDev.Add( dateTime , BasicFunctions.StdDev (data) );
}
checkValue = Math.Floor(index/onEachPeriodOf);//update checkValue
}
|
|
From: <mi...@us...> - 2003-12-17 19:34:59
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a1_Instruments
In directory sc8-pr-cvs1:/tmp/cvs-serv24844/b4_Business/a1_Financial/a1_Instruments
Modified Files:
Instrument.cs
Log Message:
Removed file Stat.cs. The same functions are now in the new file BasicFunctions.cs under the Statistics folder. Added new method to Instrument class and to the History class. Fixed some bugs
Index: Instrument.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a1_Instruments/Instrument.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Instrument.cs 13 Oct 2003 21:58:21 -0000 1.1.1.1
--- Instrument.cs 17 Dec 2003 19:34:55 -0000 1.2
***************
*** 58,61 ****
--- 58,68 ----
return history.GetNextDay( dateTime );
}
+ //millo
+ public DateTime GetMarketDay( DateTime initialDateTime, int numberOfDaysAhead )
+ {
+ History history = DataProvider.GetOpenHistory( this.Key );
+ return history.GetDay(initialDateTime, numberOfDaysAhead );
+ }
+ //millo
}
}
|
|
From: <mi...@us...> - 2003-12-17 19:34:59
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv24844/b7_Scripts
Modified Files:
b7_Scripts.csproj
Log Message:
Removed file Stat.cs. The same functions are now in the new file BasicFunctions.cs under the Statistics folder. Added new method to Instrument class and to the History class. Fixed some bugs
Index: b7_Scripts.csproj
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/b7_Scripts.csproj,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** b7_Scripts.csproj 2 Dec 2003 19:11:16 -0000 1.7
--- b7_Scripts.csproj 17 Dec 2003 19:34:55 -0000 1.8
***************
*** 113,127 ****
/>
<File
! RelPath = "SimpleTesting\MSFTsimpleTest\RunMSFTsimpleTest_2.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "SimpleTesting\MSFTsimpleTest\TsMSFTsimpleTest.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "SimpleTesting\MSFTsimpleTest\TsMSFTsimpleTest_2.cs"
SubType = "Code"
BuildAction = "Compile"
--- 113,127 ----
/>
<File
! RelPath = "SimpleTesting\MSFTsimpleTest\TsMSFTsimpleTest.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "SimpleTesting\MSFTSimpleTest_2\RunMSFTsimpleTest_2.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "SimpleTesting\MSFTSimpleTest_2\TsMSFTsimpleTest_2.cs"
SubType = "Code"
BuildAction = "Compile"
|
|
From: <mi...@us...> - 2003-12-17 19:34:59
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Statistics
In directory sc8-pr-cvs1:/tmp/cvs-serv24844/b1_ADT/Statistics
Added Files:
BasicFunctions.cs
Log Message:
Removed file Stat.cs. The same functions are now in the new file BasicFunctions.cs under the Statistics folder. Added new method to Instrument class and to the History class. Fixed some bugs
--- NEW FILE: BasicFunctions.cs ---
/*
QuantProject - Quantitative Finance Library
BasicFunctions.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;
namespace QuantProject.ADT.Statistics
{
/// <summary>
/// Implements some basic statistical functions
/// </summary>
public class BasicFunctions
{
static public double Sum( double[] data )
{
double sum = 0;
for( int i = 0; i < data.Length ; i ++ )
{
sum += data[ i ];
}
return sum;
}
static public double SumOfSquares( double[] data )
{
double sumOfSquares = 0;
for( int i = 0; i < data.Length ; i ++ )
{
sumOfSquares += data[ i ]*data[ i ];
}
return sumOfSquares;
}
static public double SimpleAverage( double[] data )
{
return BasicFunctions.Sum(data)/data.Length;
}
static public double Variance( double[] data )
{
double sum = BasicFunctions.Sum(data);
double sumOfSquares = BasicFunctions.SumOfSquares(data);
return (sumOfSquares - sum*sum/data.Length)/data.Length;
}
static public double StdDev( double[] data )
{
return System.Math.Sqrt(BasicFunctions.Variance(data));
}
}
}
|
|
From: <mi...@us...> - 2003-12-17 19:34:59
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT
In directory sc8-pr-cvs1:/tmp/cvs-serv24844/b1_ADT
Modified Files:
b1_ADT.csproj
Log Message:
Removed file Stat.cs. The same functions are now in the new file BasicFunctions.cs under the Statistics folder. Added new method to Instrument class and to the History class. Fixed some bugs
Index: b1_ADT.csproj
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/b1_ADT.csproj,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** b1_ADT.csproj 2 Dec 2003 19:07:44 -0000 1.2
--- b1_ADT.csproj 17 Dec 2003 19:34:55 -0000 1.3
***************
*** 112,117 ****
BuildAction = "Compile"
/>
! <File
! RelPath = "Histories\Stat.cs"
SubType = "Code"
BuildAction = "Compile"
--- 112,117 ----
BuildAction = "Compile"
/>
! <File
! RelPath = "Statistics\BasicFunctions.cs"
SubType = "Code"
BuildAction = "Compile"
|
|
From: <mi...@us...> - 2003-12-17 19:34:58
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1:/tmp/cvs-serv24844 Modified Files: QuantProject.suo Log Message: Removed file Stat.cs. The same functions are now in the new file BasicFunctions.cs under the Statistics folder. Added new method to Instrument class and to the History class. Fixed some bugs Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 Binary files /tmp/cvsLisTX1 and /tmp/cvs2eFgBT differ |
|
From: <mi...@us...> - 2003-12-17 19:31:09
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Statistics In directory sc8-pr-cvs1:/tmp/cvs-serv24122/Statistics Log Message: Directory /cvsroot/quantproject/QuantProject/b1_ADT/Statistics added to the repository |
|
From: <gla...@us...> - 2003-12-17 14:18:02
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Histories
In directory sc8-pr-cvs1:/tmp/cvs-serv20743/b1_ADT/Histories
Modified Files:
History.cs
Log Message:
Added the Import method (imports DataTable "timed" row
values into an History
Index: History.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Histories/History.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** History.cs 2 Dec 2003 19:07:43 -0000 1.2
--- History.cs 17 Dec 2003 14:17:59 -0000 1.3
***************
*** 23,26 ****
--- 23,27 ----
using System;
using System.Collections;
+ using System.Data;
using QuantProject.ADT;
***************
*** 43,46 ****
--- 44,59 ----
}
+ /// <summary>
+ /// Imports DataTable data into this History object
+ /// </summary>
+ /// <param name="dataTable">Contains the data to be imported</param>
+ /// <param name="dateTimeColumnName">Name of the column containing the DateTime keys
+ /// to be imported</param>
+ /// <param name="valueColumnName">Name of the column containing the values to be imported</param>
+ public void Import( DataTable dataTable , string dateTimeColumnName , string valueColumnName )
+ {
+ foreach (DataRow dataRow in dataTable.Rows )
+ this.Add( dataRow[ dateTimeColumnName ] , dataRow[ valueColumnName ] );
+ }
/// <summary>
/// Add an history item, if no collision (contemporary events) is expected
|
|
From: <gla...@us...> - 2003-12-16 16:39:36
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader
In directory sc8-pr-cvs1:/tmp/cvs-serv28436
Modified Files:
Downloader.csproj
Log Message:
Added the following classes:
- CloseToCloseValidator
- MultiValidator
- OHLCvalidator
Added a reference to the ADT project
Index: Downloader.csproj
===================================================================
RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Downloader.csproj,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Downloader.csproj 12 Dec 2003 00:23:11 -0000 1.6
--- Downloader.csproj 16 Dec 2003 16:39:29 -0000 1.7
***************
*** 88,91 ****
--- 88,96 ----
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
+ <Reference
+ Name = "b1_ADT"
+ Project = "{B8A01161-3698-4591-B1EF-90F5FC7D8DBA}"
+ Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
+ />
</References>
</Build>
***************
*** 180,184 ****
BuildAction = "EmbeddedResource"
/>
! <Folder RelPath = "Validate\Validators\" />
</Include>
</Files>
--- 185,203 ----
BuildAction = "EmbeddedResource"
/>
! <File
! RelPath = "Validate\Validators\CloseToCloseValidator.cs"
! SubType = "Code"
! BuildAction = "Compile"
! />
! <File
! RelPath = "Validate\Validators\MultiValidator.cs"
! SubType = "Code"
! BuildAction = "Compile"
! />
! <File
! RelPath = "Validate\Validators\OHLCvalidator.cs"
! SubType = "Code"
! BuildAction = "Compile"
! />
</Include>
</Files>
|
|
From: <gla...@us...> - 2003-12-16 16:32:01
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate
In directory sc8-pr-cvs1:/tmp/cvs-serv27106/Validate
Modified Files:
QuotesToBeValidated.cs
Log Message:
Invokes the MultiValidator, to validate
itself.
Index: QuotesToBeValidated.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/QuotesToBeValidated.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** QuotesToBeValidated.cs 12 Dec 2003 00:16:14 -0000 1.2
--- QuotesToBeValidated.cs 16 Dec 2003 16:31:58 -0000 1.3
***************
*** 2,5 ****
--- 2,6 ----
using System.Data;
using System.Data.OleDb;
+ using QuantProject.Applications.Downloader.Validate.Validators;
namespace QuantProject.Applications.Downloader.Validate
***************
*** 12,15 ****
--- 13,24 ----
private string selectStatement;
private OleDbDataAdapter oleDbDataAdapter;
+
+ private double suspiciousRatio;
+
+ public double SuspiciousRatio
+ {
+ get { return this.suspiciousRatio; }
+ set { this.suspiciousRatio = value; }
+ }
public QuotesToBeValidated( string tickerIsLike )
***************
*** 30,80 ****
}
! public delegate void SuspiciousDataRowEventHandler(
! Object sender , SuspiciousDataRowEventArgs eventArgs );
public event SuspiciousDataRowEventHandler SuspiciousDataRow;
#region "Validate"
! #region "validate_currentQuotesRow_checkLogicalErrors"
! /// <summary>
! /// Adds a row if not ((Low <= Open) and (Open <= High) and (Low <= Close) and (Close <= High))
! /// </summary>
! /// <param name="quotesRow">Row of quotes to be checked</param>
! private void validate_currentQuotesRow_checkLogicalErrors_checkOHLC( DataRow quotesRow )
! {
! if (!
! ( ( Convert.ToDouble( quotesRow[ "quLow" ] ) <=
! ( Convert.ToDouble( quotesRow[ "quOpen" ] ) ) ) &&
! ( Convert.ToDouble( quotesRow[ "quOpen" ] ) <=
! ( Convert.ToDouble( quotesRow[ "quHigh" ] ) ) ) &&
! ( Convert.ToDouble( quotesRow[ "quLow" ] ) <=
! ( Convert.ToDouble( quotesRow[ "quClose" ] ) ) ) &&
! ( Convert.ToDouble( quotesRow[ "quClose" ] ) <=
! ( Convert.ToDouble( quotesRow[ "quHigh" ] ) ) )
! )
! )
! SuspiciousDataRow( this , new SuspiciousDataRowEventArgs( quotesRow ) );
! }
! /// <summary>
! /// Adds an error row if quotesRow doesn't respect logical constraints
! /// </summary>
! /// <param name="quotesRow">Row of quotes to be checked</param>
! private void validate_currentQuotesRow_checkLogicalErrors( DataRow quotesRow )
! {
! validate_currentQuotesRow_checkLogicalErrors_checkOHLC( quotesRow );
! }
! #endregion
! /// <summary>
! /// Adds errors for the current quotesRow (if any)
! /// </summary>
! /// <param name="quotesRow">Row of quotes to be checked</param>
! private void validate_currentQuotesRow( DataRow quotesRow )
{
! validate_currentQuotesRow_checkLogicalErrors( quotesRow );
}
public void Validate()
{
! foreach ( DataRow quotesRow in this.Rows )
! this.validate_currentQuotesRow( quotesRow );
}
}
--- 39,65 ----
}
! // public delegate void SuspiciousDataRowEventHandler(
! // Object sender , SuspiciousDataRowEventArgs eventArgs );
public event SuspiciousDataRowEventHandler SuspiciousDataRow;
#region "Validate"
! private void suspiciousDataRowHandler( Object sender ,
! SuspiciousDataRowEventArgs eventArgs )
{
! SuspiciousDataRow( this , eventArgs );
}
public void Validate()
{
! // QuantProject.Applications.Downloader.Validate.Validators.OHLCvalidator oHLCvalidator =
! // new QuantProject.Applications.Downloader.Validate.Validators.OHLCvalidator();
! // oHLCvalidator.SuspiciousDataRow +=
! // new SuspiciousDataRowEventHandler( suspiciousDataRowHandler );
! // oHLCvalidator.Validate( this );
! MultiValidator multiValidator = new MultiValidator();
! multiValidator.SuspiciousRatio = this.suspiciousRatio;
! multiValidator.SuspiciousDataRow +=
! new SuspiciousDataRowEventHandler( this.suspiciousDataRowHandler );
! multiValidator.Validate( this );
}
}
|
|
From: <gla...@us...> - 2003-12-16 16:27:31
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate/Validators
In directory sc8-pr-cvs1:/tmp/cvs-serv26137/Validate/Validators
Added Files:
MultiValidator.cs
Log Message:
Invokes several different validators and
bubbles up the SuspiciousRow events.
--- NEW FILE: MultiValidator.cs ---
using System;
using System.Data;
using QuantProject.Applications.Downloader.Validate;
using QuantProject.Applications.Downloader.Validate.Validators;
namespace QuantProject.Applications.Downloader.Validate.Validators
{
/// <summary>
/// Calls several different quotes' validators
/// </summary>
public class MultiValidator : IValidator
{
private double suspiciousRatio;
public double SuspiciousRatio
{
get { return this.suspiciousRatio; }
set { this.suspiciousRatio = value; }
}
public MultiValidator()
{
//
// TODO: Add constructor logic here
//
}
public event SuspiciousDataRowEventHandler SuspiciousDataRow;
#region "Validate"
private void suspiciousDataRowHandler( Object sender ,
SuspiciousDataRowEventArgs eventArgs )
{
SuspiciousDataRow( this , eventArgs );
}
/// <summary>
/// Validates the Open High Low Close consistencies
/// </summary>
/// <param name="dataTable">Quote rows to be validated</param>
private void validate_OHLC( DataTable dataTable )
{
OHLCvalidator oHLCvalidator = new OHLCvalidator();
oHLCvalidator.SuspiciousDataRow +=
new SuspiciousDataRowEventHandler( suspiciousDataRowHandler );
oHLCvalidator.Validate( dataTable );
}
/// <summary>
/// Validates the Close to Close differencies
/// </summary>
/// <param name="dataTable">Quote rows to be validated</param>
private void validate_CloseToClose( DataTable dataTable )
{
CloseToCloseValidator closeToCloseValidator = new CloseToCloseValidator();
closeToCloseValidator.SuspiciousRatio = this.suspiciousRatio;
closeToCloseValidator.SuspiciousDataRow +=
new SuspiciousDataRowEventHandler( suspiciousDataRowHandler );
closeToCloseValidator.Validate( dataTable );
}
/// <summary>
/// Validates the quotes rows
/// </summary>
/// <param name="dataTable">Contains the quotes rows to be validated</param>
public void Validate( DataTable dataTable )
{
this.validate_OHLC( dataTable );
this.validate_CloseToClose( dataTable );
}
}
#endregion
}
|
|
From: <gla...@us...> - 2003-12-16 16:24:12
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate/Validators
In directory sc8-pr-cvs1:/tmp/cvs-serv25430/Validate/Validators
Added Files:
OHLCvalidator.cs
Log Message:
Searches for inconsistent values among Open, High, Low and Close
--- NEW FILE: OHLCvalidator.cs ---
using System;
using System.Data;
using QuantProject.Applications.Downloader.Validate;
namespace QuantProject.Applications.Downloader.Validate.Validators
{
/// <summary>
/// Validates OHLC quotes values
/// </summary>
public class OHLCvalidator : IValidator
{
public event SuspiciousDataRowEventHandler SuspiciousDataRow;
public OHLCvalidator()
{
//
// TODO: Add constructor logic here
//
}
#region "Validate"
#region "validate_currentQuotesRow_checkLogicalErrors"
/// <summary>
/// Adds a row if not ((Low <= Open) and (Open <= High) and (Low <= Close) and (Close <= High))
/// </summary>
/// <param name="quotesRow">Row of quotes to be checked</param>
private void validate_currentQuotesRow_checkLogicalErrors_checkOHLC( DataRow quotesRow )
{
if (!
( ( Convert.ToDouble( quotesRow[ "quLow" ] ) <=
( Convert.ToDouble( quotesRow[ "quOpen" ] ) ) ) &&
( Convert.ToDouble( quotesRow[ "quOpen" ] ) <=
( Convert.ToDouble( quotesRow[ "quHigh" ] ) ) ) &&
( Convert.ToDouble( quotesRow[ "quLow" ] ) <=
( Convert.ToDouble( quotesRow[ "quClose" ] ) ) ) &&
( Convert.ToDouble( quotesRow[ "quClose" ] ) <=
( Convert.ToDouble( quotesRow[ "quHigh" ] ) ) )
)
)
SuspiciousDataRow( this , new SuspiciousDataRowEventArgs( quotesRow ) );
}
/// <summary>
/// Adds an error row if quotesRow doesn't respect logical constraints
/// </summary>
/// <param name="quotesRow">Row of quotes to be checked</param>
private void validate_currentQuotesRow_checkLogicalErrors( DataRow quotesRow )
{
validate_currentQuotesRow_checkLogicalErrors_checkOHLC( quotesRow );
}
#endregion
/// <summary>
/// Adds errors for the current quotesRow (if any)
/// </summary>
/// <param name="quotesRow">Row of quotes to be checked</param>
private void validate_currentQuotesRow( DataRow quotesRow )
{
validate_currentQuotesRow_checkLogicalErrors( quotesRow );
}
/// <summary>
/// Validates Open High Low Close consistencies
/// </summary>
/// <param name="dataTable">Quote rows to be validated</param>
public void Validate( DataTable dataTable )
{
foreach ( DataRow quotesRow in dataTable.Rows )
this.validate_currentQuotesRow( quotesRow );
}
}
#endregion
}
|
|
From: <gla...@us...> - 2003-12-16 15:53:46
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate
In directory sc8-pr-cvs1:/tmp/cvs-serv20102/Validate
Modified Files:
ValidateDataTable.cs
Log Message:
ValidateDataTable now sets the QuotesToBeValidated SuspiciousRatio property
Index: ValidateDataTable.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/ValidateDataTable.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ValidateDataTable.cs 12 Dec 2003 00:14:39 -0000 1.2
--- ValidateDataTable.cs 16 Dec 2003 15:53:43 -0000 1.3
***************
*** 40,48 ****
//this.Rows.Add( quotesRow );
}
! public void AddRows( string tickerIsLike )
{
QuotesToBeValidated quotesToBeValidated = new QuotesToBeValidated( tickerIsLike );
quotesToBeValidated.SuspiciousDataRow +=
! new QuotesToBeValidated.SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler );
quotesToBeValidated.Validate();
this.AcceptChanges();
--- 40,50 ----
//this.Rows.Add( quotesRow );
}
! public void AddRows( string tickerIsLike , double suspiciousRatio )
{
QuotesToBeValidated quotesToBeValidated = new QuotesToBeValidated( tickerIsLike );
+ quotesToBeValidated.SuspiciousRatio = suspiciousRatio;
quotesToBeValidated.SuspiciousDataRow +=
! new SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler );
! // new QuotesToBeValidated.SuspiciousDataRowEventHandler( suspiciousDataRowEventHandler );
quotesToBeValidated.Validate();
this.AcceptChanges();
|
|
From: <gla...@us...> - 2003-12-16 15:50:12
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate
In directory sc8-pr-cvs1:/tmp/cvs-serv19609/Validate
Modified Files:
IValidator.cs
Log Message:
A Validator class must implement this iterface
Index: IValidator.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/IValidator.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** IValidator.cs 12 Dec 2003 00:21:05 -0000 1.1
--- IValidator.cs 16 Dec 2003 15:50:08 -0000 1.2
***************
*** 1,6 ****
--- 1,10 ----
using System;
+ using System.Data;
namespace QuantProject.Applications.Downloader.Validate
{
+ public delegate void SuspiciousDataRowEventHandler(
+ Object sender , SuspiciousDataRowEventArgs eventArgs );
+
/// <summary>
/// Interface to be implemented by quotes validators
***************
*** 8,12 ****
public interface IValidator
{
! //event SuspiciousDataRow
! }
}
--- 12,17 ----
public interface IValidator
{
! event SuspiciousDataRowEventHandler SuspiciousDataRow;
! void Validate( DataTable dataTable );
! }
}
|
|
From: <gla...@us...> - 2003-12-16 15:49:27
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate/Validators
In directory sc8-pr-cvs1:/tmp/cvs-serv19435/Validate/Validators
Added Files:
CloseToCloseValidator.cs
Log Message:
Searches for day to day abnormal close differences
--- NEW FILE: CloseToCloseValidator.cs ---
using System;
using System.Data;
using QuantProject.ADT.Histories;
using QuantProject.Applications.Downloader.Validate;
namespace QuantProject.Applications.Downloader.Validate.Validators
{
/// <summary>
/// Searches for close to close divergences
/// </summary>
public class CloseToCloseValidator : IValidator
{
private DataTable dataTableToBeValidated;
private double suspiciousRatio = 2;
public double SuspiciousRatio
{
get { return this.suspiciousRatio; }
set { this.suspiciousRatio = value; }
}
public CloseToCloseValidator()
{
//
// TODO: Add constructor logic here
//
}
public event SuspiciousDataRowEventHandler SuspiciousDataRow;
#region "Validate"
private int validate_currentTicker_set_closeToClose(
string currentTicker , int currentTickerStartingRowIndex , History closeToClose )
{
closeToClose.Clear();
int localCurrentRowIndex = currentTickerStartingRowIndex + 1;
closeToClose.Add( this.dataTableToBeValidated.Rows[ currentTickerStartingRowIndex ][ "quDate" ] ,
null );
while ( ( localCurrentRowIndex < this.dataTableToBeValidated.Rows.Count ) &&
( (string)this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quTicker" ]
== currentTicker ) )
{
closeToClose.Add( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quDate" ] ,
Math.Abs(
Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quAdjustedClose" ] ) -
Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex - 1 ][ "quAdjustedClose" ] ) ) );
localCurrentRowIndex++;
}
return localCurrentRowIndex;
}
private void validate_currentTicker_withHistories_validateRow(
DataRow quoteRow , double currentValue , double averageValue )
{
if ( Math.Abs( currentValue / averageValue ) > this.suspiciousRatio )
// the current close to close value is suspiciously larger
// than the average close to close ratio
this.SuspiciousDataRow( this , new SuspiciousDataRowEventArgs( quoteRow ) );
}
private void validate_currentTicker_withHistories(
History closeToClose , History closeToCloseMovingAverage ,
int currentTickerStartingRowIndex , int nextTickerStartingRowIndex )
{
for (int i = currentTickerStartingRowIndex ; i < nextTickerStartingRowIndex ;
i++ )
if ( closeToCloseMovingAverage.GetByIndex( i - currentTickerStartingRowIndex ) != null )
try
{
// validate_currentTicker_withHistories_validateRow(
// this.dataTableToBeValidated.Rows[ i ] ,
// (double)closeToClose.GetByIndex( i - currentTickerStartingRowIndex ) ,
// (double)closeToCloseMovingAverage.GetByIndex( i - currentTickerStartingRowIndex ) );
validate_currentTicker_withHistories_validateRow(
this.dataTableToBeValidated.Rows[ i ] ,
Convert.ToDouble(closeToClose.GetByIndex( i - currentTickerStartingRowIndex )) ,
(double)(closeToCloseMovingAverage.GetByIndex( i - currentTickerStartingRowIndex )) );
}
catch (Exception ex)
{
Console.WriteLine( ex.ToString() );
}
}
private int validate_currentTicker( string currentTicker , int currentTickerStartingRowIndex )
{
History closeToClose = new History();
History closeToCloseMovingAverage;
int nextTickerStartingRowIndex =
validate_currentTicker_set_closeToClose( currentTicker , currentTickerStartingRowIndex ,
closeToClose );
closeToCloseMovingAverage = closeToClose.GetSimpleMovingAverage( 20 );
validate_currentTicker_withHistories( closeToClose , closeToCloseMovingAverage ,
currentTickerStartingRowIndex , nextTickerStartingRowIndex );
return nextTickerStartingRowIndex;
}
/// <summary>
/// Validates close to close divergencies
/// </summary>
/// <param name="dataTableToBeValidated">Quote rows to be validated</param>
public void Validate( DataTable dataTableToBeValidated )
{
int currentRowIndex = 0;
string currentTicker;
this.dataTableToBeValidated = dataTableToBeValidated;
while ( currentRowIndex < dataTableToBeValidated.Rows.Count )
{
currentTicker = (string)this.dataTableToBeValidated.Rows[ currentRowIndex ][ "quTicker" ];
currentRowIndex = validate_currentTicker( currentTicker , currentRowIndex );
}
}
#endregion
}
}
|
|
From: <gla...@us...> - 2003-12-16 15:47:38
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate/Validators In directory sc8-pr-cvs1:/tmp/cvs-serv19060/Validators Log Message: Directory /cvsroot/quantproject/QuantDownloader/Downloader/Validate/Validators added to the repository |
|
From: <gla...@us...> - 2003-12-16 15:46:21
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate
In directory sc8-pr-cvs1:/tmp/cvs-serv18834/Downloader/Validate
Modified Files:
ValidateForm.cs
Log Message:
Added the Suspicious Ratio text box
Index: ValidateForm.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/ValidateForm.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ValidateForm.cs 9 Dec 2003 22:16:33 -0000 1.1
--- ValidateForm.cs 16 Dec 2003 15:46:17 -0000 1.2
***************
*** 24,27 ****
--- 24,29 ----
private System.Windows.Forms.TextBox textBoxTickerIsLike;
private System.Windows.Forms.Button buttonCommitAndRefresh;
+ private System.Windows.Forms.TextBox textBoxSuspiciousRatio;
+ private System.Windows.Forms.Label labelSuspiciousRatio;
/// <summary>
/// Required designer variable.
***************
*** 69,72 ****
--- 71,76 ----
this.dataGrid1 = new System.Windows.Forms.DataGrid();
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.dataGrid1)).BeginInit();
this.SuspendLayout();
***************
*** 90,94 ****
// buttonGo
//
! this.buttonGo.Location = new System.Drawing.Point(368, 16);
this.buttonGo.Name = "buttonGo";
this.buttonGo.TabIndex = 2;
--- 94,98 ----
// buttonGo
//
! this.buttonGo.Location = new System.Drawing.Point(512, 16);
this.buttonGo.Name = "buttonGo";
this.buttonGo.TabIndex = 2;
***************
*** 219,222 ****
--- 223,242 ----
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
//
***************
*** 224,227 ****
--- 244,249 ----
this.ClientSize = new System.Drawing.Size(720, 341);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
+ this.labelSuspiciousRatio,
+ this.textBoxSuspiciousRatio,
this.buttonCommitAndRefresh,
this.dataGrid1,
***************
*** 241,245 ****
this.validateDataTable = new ValidateDataTable();
this.dataGrid1.DataSource = validateDataTable;
! validateDataTable.AddRows( textBoxTickerIsLike.Text );
}
--- 263,267 ----
this.validateDataTable = new ValidateDataTable();
this.dataGrid1.DataSource = validateDataTable;
! validateDataTable.AddRows( textBoxTickerIsLike.Text , Convert.ToDouble( this.textBoxSuspiciousRatio.Text ) );
}
|
|
From: <gla...@us...> - 2003-12-12 00:24:34
|
Update of /cvsroot/quantproject/QuantDownloader In directory sc8-pr-cvs1:/tmp/cvs-serv6834 Modified Files: QuantDownloader.suo Log Message: Data validation has been moved from the ValidateDataTable class to the QuotesToBeValidated class. Now an event base approach is used. Index: QuantDownloader.suo =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/QuantDownloader.suo,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 Binary files /tmp/cvsJ515iy and /tmp/cvsiTrFmW differ |
|
From: <gla...@us...> - 2003-12-12 00:23:14
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader
In directory sc8-pr-cvs1:/tmp/cvs-serv6650/Downloader
Modified Files:
Downloader.csproj
Log Message:
- Added IValidator.cs
- Added SospiciousDataRowEventArgs.cs
Index: Downloader.csproj
===================================================================
RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Downloader.csproj,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Downloader.csproj 9 Dec 2003 22:35:06 -0000 1.5
--- Downloader.csproj 12 Dec 2003 00:23:11 -0000 1.6
***************
*** 151,157 ****
/>
<File
! RelPath = "WebDownloader.resx"
! DependentUpon = "WebDownloader.cs"
! BuildAction = "EmbeddedResource"
/>
<File
--- 151,157 ----
/>
<File
! RelPath = "Validate\IValidator.cs"
! SubType = "Code"
! BuildAction = "Compile"
/>
<File
***************
*** 161,164 ****
--- 161,169 ----
/>
<File
+ RelPath = "Validate\SospiciousDataRowEventArgs.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Validate\ValidateDataTable.cs"
SubType = "Component"
***************
*** 175,178 ****
--- 180,184 ----
BuildAction = "EmbeddedResource"
/>
+ <Folder RelPath = "Validate\Validators\" />
</Include>
</Files>
|