[Quantproject-developers] QuantDownloader/Downloader/OpenTickDownloader/BarsSelectors DailyBarsSel
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-07-20 20:31:57
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/BarsSelectors In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4714/Downloader/OpenTickDownloader/BarsSelectors Modified Files: DailyBarsSelector.cs Log Message: Some changes have been applied, to make this class become a base class that can be extended Index: DailyBarsSelector.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/BarsSelectors/DailyBarsSelector.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DailyBarsSelector.cs 9 Jul 2008 22:12:05 -0000 1.1 --- DailyBarsSelector.cs 20 Jul 2008 20:31:54 -0000 1.2 *************** *** 31,43 **** public class DailyBarsSelector : IBarsSelector { ! string[] tickers; ! DateTime firstDate; ! DateTime lastDate; /// <summary> /// lenght, in seconds, for a bar (60 for a one minute bar) /// </summary> ! int barInterval; ! DateTime firstBarOpenTimeInNewYorkTimeZone; ! int numberOfBarsToBeDownloadedForEachDay; /// <summary> --- 31,43 ---- public class DailyBarsSelector : IBarsSelector { ! private string[] tickers; ! protected DateTime firstDate; ! protected DateTime lastDate; /// <summary> /// lenght, in seconds, for a bar (60 for a one minute bar) /// </summary> ! protected int barInterval; ! protected DateTime firstBarOpenTimeInNewYorkTimeZone; ! protected int numberOfBarsToBeDownloadedForEachDay; /// <summary> *************** *** 45,49 **** /// </summary> private int currentTickerIndex; ! private DateTime currentDate; /// <summary> /// (0 based) current bar in the currentDate --- 45,49 ---- /// </summary> private int currentTickerIndex; ! protected DateTime currentDate; /// <summary> /// (0 based) current bar in the currentDate *************** *** 186,190 **** #region isTheCurrentBarSelectable ! private bool isAPossibleMarketDay( DateTime currentDate ) { bool isAPossibleMarkDay = --- 186,190 ---- #region isTheCurrentBarSelectable ! protected bool isAPossibleMarketDay( DateTime currentDate ) { bool isAPossibleMarkDay = *************** *** 221,232 **** #region GetNextBarIdentifier ! private string getCurrentTicker() { string currentTicker = this.tickers[ this.currentTickerIndex ]; return currentTicker; } ! private BarIdentifier getNextBarIdentifier_actually() { ! DateTime dateTimeForBarOpenInNewYorkTimeZone = new DateTime( currentDate.Year , --- 221,234 ---- #region GetNextBarIdentifier ! protected string getCurrentTicker() { string currentTicker = this.tickers[ this.currentTickerIndex ]; return currentTicker; } ! ! #region getNextBarIdentifier_actually ! protected DateTime getDateTimeForCurrentCandidateBarOpenInNewYorkTimeZone() { ! DateTime dateTimeForCurrentCandidateBarOpenInNewYorkTimeZone = new DateTime( currentDate.Year , *************** *** 237,247 **** this.firstBarOpenTimeInNewYorkTimeZone.Second ).AddSeconds( this.currentDailyBar * this.barInterval ); BarIdentifier barIdentifier = new BarIdentifier( this.getCurrentTicker() , ! dateTimeForBarOpenInNewYorkTimeZone , this.barInterval ); return barIdentifier; } public BarIdentifier GetNextBarIdentifier() { --- 239,257 ---- this.firstBarOpenTimeInNewYorkTimeZone.Second ).AddSeconds( this.currentDailyBar * this.barInterval ); + return dateTimeForCurrentCandidateBarOpenInNewYorkTimeZone; + } + private BarIdentifier getNextBarIdentifier_actually() + { + DateTime dateTimeForCurrentCandidateBarOpenInNewYorkTimeZone = + this.getDateTimeForCurrentCandidateBarOpenInNewYorkTimeZone(); BarIdentifier barIdentifier = new BarIdentifier( this.getCurrentTicker() , ! dateTimeForCurrentCandidateBarOpenInNewYorkTimeZone , this.barInterval ); return barIdentifier; } + #endregion getNextBarIdentifier_actually + public BarIdentifier GetNextBarIdentifier() { |