[Quantproject-developers] QuantDownloader/Downloader/OpenTickDownloader BarQueueFiller.cs, 1.5, 1.
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:38:50
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8538/OpenTickDownloader Modified Files: BarQueueFiller.cs Log Message: a IOHLCRequester is now used instead of a IBarsSelector Index: BarQueueFiller.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/BarQueueFiller.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BarQueueFiller.cs 18 Jan 2009 18:27:09 -0000 1.5 --- BarQueueFiller.cs 29 Jan 2009 19:38:45 -0000 1.6 *************** *** 31,35 **** { public delegate void NewOHLCRequestEventHandler( ! int requestId , DateTime dateTimeForRequest , long barInterval ); /// <summary> --- 31,38 ---- { public delegate void NewOHLCRequestEventHandler( ! int requestId , ! DateTime dateTimeForFirstBarOpenInUTC , ! DateTime dateTimeForLastBarOpenInUTC , ! long barInterval ); /// <summary> *************** *** 43,47 **** public event NewMessageEventHandler NewMessage; ! private IBarsSelector barsSelector; private OTManager oTManager; --- 46,51 ---- public event NewMessageEventHandler NewMessage; ! private IOHLCRequester oHLCRequester; ! // private IBarsSelector barsSelector; private OTManager oTManager; *************** *** 73,77 **** /// downloaded bars</param> public BarQueueFiller( ! IBarsSelector barsSelector , IExchangeSelector exchangeSelector , OTManager oTManager , --- 77,81 ---- /// downloaded bars</param> public BarQueueFiller( ! IOHLCRequester oHLCRequester , IExchangeSelector exchangeSelector , OTManager oTManager , *************** *** 79,83 **** ) { ! this.barsSelector = barsSelector; this.exchangeSelector = exchangeSelector; this.exchangeSelector.NewMessage += --- 83,87 ---- ) { ! this.oHLCRequester = oHLCRequester; this.exchangeSelector = exchangeSelector; this.exchangeSelector.NewMessage += *************** *** 135,143 **** #region enqueueBar #region getBar ! private long getBar_getInterval( OTOHLC ohlc ) ! { ! int interval = 60; // TO DO use an internal list to handle this data ! return interval; ! } private Bar getBar( OTOHLC ohlc ) { --- 139,147 ---- #region enqueueBar #region getBar ! // private long getBar_getInterval( OTOHLC ohlc ) ! // { ! // int interval = 60; // TO DO use an internal list to handle this data ! // return interval; ! // } private Bar getBar( OTOHLC ohlc ) { *************** *** 146,150 **** string ticker = barRequest.Symbol; string exchange = barRequest.Exchange; ! long interval = this.getBar_getInterval( ohlc ); Bar bar = new Bar( ticker , --- 150,154 ---- string ticker = barRequest.Symbol; string exchange = barRequest.Exchange; ! long interval = barRequest.IntervalValueInSeconds; Bar bar = new Bar( ticker , *************** *** 189,218 **** #region fillQueue_requestBar private void fillQueue_requestBar_actually( ! BarIdentifier barIdentifier , string exchange ) { short numberOfMinutesInEachBar = Convert.ToInt16( Math.Round( ! Convert.ToDouble( barIdentifier.Interval / 60 ) ) ); ! DateTime dateTimeForBarOpenInUTC = TimeZoneManager.ConvertToUTC( ! barIdentifier.DateTimeForOpenInNewYorkTimeZone ); int requestId = this.oTManager.RequestHistData( ! exchange , barIdentifier.Ticker , ! dateTimeForBarOpenInUTC , ! dateTimeForBarOpenInUTC , OTHistoricalType.OhlcMinutely , numberOfMinutesInEachBar ); if ( this.NewOHLCRequest != null ) this.NewOHLCRequest( ! requestId , dateTimeForBarOpenInUTC , ! barIdentifier.Interval ); } private void fillQueue_requestBar( ! BarIdentifier barIdentifier ) { string exchange = ! this.exchangeSelector.SelectExchange( barIdentifier.Ticker ); if ( exchange != "" ) // the exchange has been actually selected ! this.fillQueue_requestBar_actually( barIdentifier , exchange ); } #endregion fillQueue_requestBar --- 193,225 ---- #region fillQueue_requestBar private void fillQueue_requestBar_actually( ! OHLCRequest oHLCRequest , string exchange ) { short numberOfMinutesInEachBar = Convert.ToInt16( Math.Round( ! Convert.ToDouble( oHLCRequest.BarIntervalInSeconds / 60 ) ) ); ! DateTime dateTimeForFirstBarOpenInUTC = TimeZoneManager.ConvertToUTC( ! oHLCRequest.DateTimeForFirstBarOpenInNewYorkTimeZone ); ! DateTime dateTimeForLastBarOpenInUTC = ! TimeZoneManager.ConvertToUTC( ! oHLCRequest.DateTimeForLastBarOpenInNewYorkTimeZone ); int requestId = this.oTManager.RequestHistData( ! exchange , oHLCRequest.Ticker , ! dateTimeForFirstBarOpenInUTC , ! dateTimeForLastBarOpenInUTC , OTHistoricalType.OhlcMinutely , numberOfMinutesInEachBar ); if ( this.NewOHLCRequest != null ) this.NewOHLCRequest( ! requestId , dateTimeForFirstBarOpenInUTC , dateTimeForLastBarOpenInUTC , ! oHLCRequest.BarIntervalInSeconds ); } private void fillQueue_requestBar( ! OHLCRequest oHLCRequest ) { string exchange = ! this.exchangeSelector.SelectExchange( oHLCRequest.Ticker ); if ( exchange != "" ) // the exchange has been actually selected ! this.fillQueue_requestBar_actually( oHLCRequest , exchange ); } #endregion fillQueue_requestBar *************** *** 220,226 **** private void fillQueue_requestBarsForEachMarketDay() { ! while ( !this.barsSelector.AreAllBarsAlredyGiven ) this.fillQueue_requestBar( ! this.barsSelector.GetNextBarIdentifier() ); } #endregion fillQueue_requestBarsForEachMarketDay --- 227,233 ---- private void fillQueue_requestBarsForEachMarketDay() { ! while ( !this.oHLCRequester.AreAllOHLCRequestsAlredyGiven ) this.fillQueue_requestBar( ! this.oHLCRequester.GetNextOHLCRequest() ); } #endregion fillQueue_requestBarsForEachMarketDay |