[Quantproject-developers] QuantDownloader/Downloader/Validate/Validators RangeToRangeValidator.cs,1.
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2004-04-01 16:08:17
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate/Validators In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13403/Downloader/Validate/Validators Modified Files: RangeToRangeValidator.cs Log Message: Now, a row is not suspicious if it has already been visually validated Index: RangeToRangeValidator.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/Validators/RangeToRangeValidator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RangeToRangeValidator.cs 24 Mar 2004 18:27:52 -0000 1.1 --- RangeToRangeValidator.cs 1 Apr 2004 15:56:18 -0000 1.2 *************** *** 1,5 **** --- 1,7 ---- using System; + using System.Collections; using System.Data; using QuantProject.ADT.Histories; + using QuantProject.DataAccess.Tables; using QuantProject.Applications.Downloader.Validate; *************** *** 14,17 **** --- 16,21 ---- private double suspiciousRatio = 3; + private ArrayList rangeToRangeVisuallyValidated; + public double SuspiciousRatio { *************** *** 46,56 **** Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quAdjustedClose" ] ) / Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quClose" ] ); - // double previousRange = - // ( Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex - 1 ][ "quHigh" ] ) - - // Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex - 1 ][ "quLow" ] ) ) * - // Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex - 1 ][ "quAdjustedClose" ] ) / - // Convert.ToDouble( this.dataTableToBeValidated.Rows[ localCurrentRowIndex - 1 ][ "quClose" ] ); - // rangeToRange.Add( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quDate" ] , - // currentRange - previousRange ); rangeToRange.Add( this.dataTableToBeValidated.Rows[ localCurrentRowIndex ][ "quDate" ] , currentRange ); localCurrentRowIndex++; --- 50,53 ---- *************** *** 61,67 **** DataRow quoteRow , double currentValue , double averageValue ) { ! if ( Math.Abs( currentValue / averageValue ) > this.suspiciousRatio ) // the current close to close value is suspiciously larger // than the average close to close ratio this.SuspiciousDataRow( this , new SuspiciousDataRowEventArgs( quoteRow , ValidationWarning.SuspiciousRangeToRangeRatio ) ); --- 58,66 ---- DataRow quoteRow , double currentValue , double averageValue ) { ! if ( ( Math.Abs( currentValue / averageValue ) > this.suspiciousRatio ) && ! ( this.rangeToRangeVisuallyValidated.IndexOf( quoteRow[ "quDate" ] ) < 0 ) ) // the current close to close value is suspiciously larger // than the average close to close ratio + // and it has not been visually validated yet this.SuspiciousDataRow( this , new SuspiciousDataRowEventArgs( quoteRow , ValidationWarning.SuspiciousRangeToRangeRatio ) ); *************** *** 76,83 **** try { - // validate_currentTicker_withHistories_validateRow( - // this.dataTableToBeValidated.Rows[ i ] , - // (double)rangeToRange.GetByIndex( i - currentTickerStartingRowIndex ) , - // (double)rangeToRangeMovingAverage.GetByIndex( i - currentTickerStartingRowIndex ) ); validate_currentTicker_withHistories_validateRow( this.dataTableToBeValidated.Rows[ i ] , --- 75,78 ---- *************** *** 92,95 **** --- 87,91 ---- private int validate_currentTicker( string currentTicker , int currentTickerStartingRowIndex ) { + this.rangeToRangeVisuallyValidated = VisuallyValidatedQuotes.GetRangeToRangeValidated( currentTicker ); History rangeToRange = new History(); History rangeToRangeMovingAverage; |