quantproject-developers Mailing List for QuantProject (Page 22)
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: Glauco S. <gla...@us...> - 2009-02-04 20:01:00
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/ExchangeSelectors/MostLiquid In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv420/OpenTickDownloader/ExchangeSelectors/MostLiquid Modified Files: MostLiquidExchangeSelectorForSingleTicker.cs Log Message: oTManager is given as a parameter, now Index: MostLiquidExchangeSelectorForSingleTicker.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/ExchangeSelectors/MostLiquid/MostLiquidExchangeSelectorForSingleTicker.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MostLiquidExchangeSelectorForSingleTicker.cs 29 Jan 2009 19:43:00 -0000 1.3 --- MostLiquidExchangeSelectorForSingleTicker.cs 4 Feb 2009 20:00:56 -0000 1.4 *************** *** 115,121 **** // } public MostLiquidExchangeSelectorForSingleTicker( ! string ticker ) { ! this.oTManager = new OTManager(); this.oTManager.NewMessage += new NewMessageEventHandler( --- 115,121 ---- // } public MostLiquidExchangeSelectorForSingleTicker( ! OTManager oTManager , string ticker ) { ! this.oTManager = oTManager; this.oTManager.NewMessage += new NewMessageEventHandler( *************** *** 293,296 **** --- 293,301 ---- // exchangeCode , this.ticker ); int requestId = + // this.oTManager.RequestHistData( + // exchangeCode , this.ticker , + // new DateTime( 2008 , 02 , 07, 15 , 0 , 0 ) , + // new DateTime( 2008 , 02 , 28, 15 , 0 , 0 ) , + // OTHistoricalType.OhlcMinutely , 1 ); this.oTManager.RequestHistData( exchangeCode , this.ticker |
|
From: Glauco S. <gla...@us...> - 2009-02-04 19:57:13
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/ExchangeSelectors/MostLiquid In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32437/OpenTickDownloader/ExchangeSelectors/MostLiquid Modified Files: MostLiquidExchangeSelector.cs Log Message: some static OTManager's methods have been changed and are instance method now Index: MostLiquidExchangeSelector.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/ExchangeSelectors/MostLiquid/MostLiquidExchangeSelector.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MostLiquidExchangeSelector.cs 9 Jul 2008 22:19:20 -0000 1.1 --- MostLiquidExchangeSelector.cs 4 Feb 2009 19:57:08 -0000 1.2 *************** *** 51,55 **** // public event NewOHLCRequestEventHandler NewOHLCRequest; ! // private OTManager oTManager; /// <summary> /// if non empty, contains the full path to the file where --- 51,55 ---- // public event NewOHLCRequestEventHandler NewOHLCRequest; ! private OTManager oTManager; /// <summary> /// if non empty, contains the full path to the file where *************** *** 75,79 **** public MostLiquidExchangeSelector() { ! // this.oTManager = oTManager; // this.logFileName = ""; this.mostLiquidExchange = new Hashtable(); --- 75,79 ---- public MostLiquidExchangeSelector() { ! this.oTManager = new OTManager(); // this.logFileName = ""; this.mostLiquidExchange = new Hashtable(); *************** *** 101,104 **** --- 101,105 ---- mostLiquidExchangeSelectorForSingleTicker = new MostLiquidExchangeSelectorForSingleTicker( + this.oTManager , ticker ); mostLiquidExchangeSelectorForSingleTicker.NewMessage += |
|
From: Glauco S. <gla...@us...> - 2009-02-04 19:56:33
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/DatabaseManagement In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32305/OpenTickDownloader/DatabaseManagement Modified Files: DataBaseWriter.cs Log Message: a performance optimization has been applied: when the thread wakes up, it writes to the database all the bars available in the queue (in the previous revision it wrote just one bar in a single thread quantum) Index: DataBaseWriter.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/DatabaseManagement/DataBaseWriter.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DataBaseWriter.cs 18 Jan 2009 18:40:33 -0000 1.6 --- DataBaseWriter.cs 4 Feb 2009 19:56:21 -0000 1.7 *************** *** 57,84 **** #region writeToDataBase ! #region writeToDataBaseIfEnoughBars ! private bool isThereEnoughBarsInTheQueue() ! { ! bool isThereEnoughBars; ! lock( this.barQueue ) ! { ! isThereEnoughBars = ! ( this.barQueue.Queue.Count >= ! this.maxNumberOfBarsToBeWrittenWithASingleSqlCommand ); ! } ! return isThereEnoughBars; ! } #region writeToDataBaseActually ! private Bar dequeue() ! { ! Bar bar; ! lock( this.barQueue ) ! { ! bar = this.barQueue.Queue.Dequeue(); ! } ! return bar; ! } #region writeToDataBaseActually --- 57,85 ---- #region writeToDataBase ! #region writeToDataBaseBarsInTheQueue ! // private bool isThereEnoughBarsInTheQueue() ! // { ! // bool isThereEnoughBars; ! // lock( this.barQueue ) ! // { ! // isThereEnoughBars = ! // ( this.barQueue.Queue.Count >= ! // this.maxNumberOfBarsToBeWrittenWithASingleSqlCommand ); ! // } ! // return isThereEnoughBars; ! // } #region writeToDataBaseActually ! // private Bar dequeue() ! // { ! //// Bar bar; ! //// lock( this.barQueue ) ! //// { ! //// bar = this.barQueue.Queue.Dequeue(); ! //// } ! // Bar bar = this.barQueue.Dequeue(); ! // return bar; ! // } #region writeToDataBaseActually *************** *** 99,103 **** { Bars.AddBar( ! bar.Ticker , bar.Exchange , dateTimeForOpenInESTTime , bar.Interval , bar.Open , bar.High , bar.Low , bar.Close , bar.Volume ); } --- 100,104 ---- { Bars.AddBar( ! bar.Ticker , bar.Exchange , dateTimeForOpenInESTTime , bar.IntervalValueInSeconds , bar.Open , bar.High , bar.Low , bar.Close , bar.Volume ); } *************** *** 105,109 **** { this.throwExceptionIfOtherThanBarAlreadyInTheDatabase( ! bar.Ticker , bar.Exchange , dateTimeForOpenInESTTime , bar.Interval , exception ); } --- 106,110 ---- { this.throwExceptionIfOtherThanBarAlreadyInTheDatabase( ! bar.Ticker , bar.Exchange , dateTimeForOpenInESTTime , bar.IntervalValueInSeconds , exception ); } *************** *** 124,128 **** private void writeToDataBaseActually() { ! Bar bar = this.dequeue(); this.writeToDataBaseActually( bar ); this.riseDatabaseUpdatedEvent( bar ); --- 125,129 ---- private void writeToDataBaseActually() { ! Bar bar = this.barQueue.Dequeue(); this.writeToDataBaseActually( bar ); this.riseDatabaseUpdatedEvent( bar ); *************** *** 130,139 **** #endregion writeToDataBaseActually ! private void writeToDataBaseIfEnoughBars() { ! if ( this.isThereEnoughBarsInTheQueue() ) this.writeToDataBaseActually(); } ! #endregion writeToDataBaseIfEnoughBars private void writeToDataBase() --- 131,141 ---- #endregion writeToDataBaseActually ! private void writeToDataBaseBarsInTheQueue() { ! while ( this.barQueue.Count > 0 ) ! // at least one bar is in the queue this.writeToDataBaseActually(); } ! #endregion writeToDataBaseBarsInTheQueue private void writeToDataBase() *************** *** 141,146 **** while ( !this.areAllBarsWrittenToDatabase ) { ! this.writeToDataBaseIfEnoughBars(); ! Thread.Sleep( 15 ); } } --- 143,148 ---- while ( !this.areAllBarsWrittenToDatabase ) { ! this.writeToDataBaseBarsInTheQueue(); ! Thread.Sleep( 5 ); } } |
|
From: Glauco S. <gla...@us...> - 2009-02-04 19:53:49
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32044/OpenTickDownloader Modified Files: BarsDownloader.cs Log Message: some static OTManager's methods have been changed and are instance method now Index: BarsDownloader.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/BarsDownloader.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BarsDownloader.cs 29 Jan 2009 19:40:27 -0000 1.4 --- BarsDownloader.cs 4 Feb 2009 19:53:45 -0000 1.5 *************** *** 77,80 **** --- 77,81 ---- this.openTickUser = openTickUser; this.openTickPassword = openTickPassword; + this.oTManager = new OTManager(); } *************** *** 161,168 **** public void DownloadBars() { ! OTManager.OnLogin += new OnLoginEventHandler( this.onLoginEventHandler ); ! OTManager.SubmitLogin( this.openTickUser , this.openTickPassword ); } --- 162,169 ---- public void DownloadBars() { ! this.oTManager.OnLogin += new OnLoginEventHandler( this.onLoginEventHandler ); ! this.oTManager.SubmitLogin( this.openTickUser , this.openTickPassword ); } |
|
From: Glauco S. <gla...@us...> - 2009-02-04 19:52:47
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OTManagement In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31923/OpenTickDownloader/OTManagement Modified Files: BarRequest.cs Log Message: intervalValueInSeconds is now an int (it was a short in the previous revision) Index: BarRequest.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OTManagement/BarRequest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BarRequest.cs 29 Jan 2009 19:39:37 -0000 1.2 --- BarRequest.cs 4 Feb 2009 19:52:41 -0000 1.3 *************** *** 33,37 **** private string symbol; private DateTime dateTimeForOpenInUTC; ! private short intervalValueInSeconds; public string Exchange { --- 33,37 ---- private string symbol; private DateTime dateTimeForOpenInUTC; ! private int intervalValueInSeconds; public string Exchange { *************** *** 44,48 **** get { return dateTimeForOpenInUTC; } } ! public short IntervalValueInSeconds { get { return this.intervalValueInSeconds; } } --- 44,48 ---- get { return dateTimeForOpenInUTC; } } ! public int IntervalValueInSeconds { get { return this.intervalValueInSeconds; } } *************** *** 51,55 **** string symbol , DateTime dateTimeForOpenInUTC , ! short intervalValueInSeconds ) { this.exchange = exchange; --- 51,55 ---- string symbol , DateTime dateTimeForOpenInUTC , ! int intervalValueInSeconds ) { this.exchange = exchange; |
|
From: Glauco S. <gla...@us...> - 2009-02-04 19:52:02
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31792 Modified Files: QuantDownloader_SD.csproj Log Message: OpenTickDownloader\OTManagement\OTIntervalValueCalculator.cs has been added Index: QuantDownloader_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuantDownloader_SD.csproj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** QuantDownloader_SD.csproj 29 Jan 2009 19:36:45 -0000 1.8 --- QuantDownloader_SD.csproj 4 Feb 2009 19:51:52 -0000 1.9 *************** *** 72,75 **** --- 72,76 ---- <Compile Include="OpenTickDownloader\OHLCRequesters\OHLCRequesterForConsecutiveBars.cs" /> <Compile Include="OpenTickDownloader\OTManagement\BarRequest.cs" /> + <Compile Include="OpenTickDownloader\OTManagement\OTIntervalValueCalculator.cs" /> <Compile Include="OpenTickDownloader\OTManagement\OTManager.cs" /> <Compile Include="OpenTickDownloader\OTTickerDownloader.cs" /> |
|
From: Glauco S. <gla...@us...> - 2009-02-04 19:51:22
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31733 Modified Files: BarQueue.cs Log Message: The class has been changed to be thread safe by itself (it was caller's responsability in the previous revision) Index: BarQueue.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/BarQueue.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BarQueue.cs 9 Jul 2008 22:07:33 -0000 1.1 --- BarQueue.cs 4 Feb 2009 19:51:18 -0000 1.2 *************** *** 3,7 **** BarQueue.cs ! Copyright (C) 2008 Glauco Siliprandi --- 3,7 ---- BarQueue.cs ! Copyright (C) 2008 Glauco Siliprandi *************** *** 19,23 **** 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; --- 19,23 ---- 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; *************** *** 29,33 **** public delegate void NewChunkOfBarsToBeWrittenWithASingleSqlCommandEventHandler(); ! /// <summary> /// Keeps a queue of bars, rises events when needed. --- 29,33 ---- public delegate void NewChunkOfBarsToBeWrittenWithASingleSqlCommandEventHandler(); ! /// <summary> /// Keeps a queue of bars, rises events when needed. *************** *** 37,41 **** public event NewChunkOfBarsToBeWrittenWithASingleSqlCommandEventHandler NewChunkOfBarsToBeWrittenWithASingleSqlCommand; ! // private Queue<Bar> barQueue; private int numberOfBarsToBeWrittenWithASingleSqlCommand; --- 37,41 ---- public event NewChunkOfBarsToBeWrittenWithASingleSqlCommandEventHandler NewChunkOfBarsToBeWrittenWithASingleSqlCommand; ! // private Queue<Bar> barQueue; private int numberOfBarsToBeWrittenWithASingleSqlCommand; *************** *** 44,50 **** private Queue<Bar> queue; ! public Queue<Bar> Queue { ! get { return this.queue; } } --- 44,63 ---- private Queue<Bar> queue; ! // public Queue<Bar> Queue ! // { ! // get { return this.queue; } ! // } ! ! public int Count { ! get ! { ! int count; ! lock ( ((System.Collections.ICollection)(this.queue)).SyncRoot ) ! { ! count = this.queue.Count; ! } ! return count; ! } } *************** *** 61,64 **** --- 74,87 ---- #region Enqueue + + private void enqueueThreadSafely( Bar bar ) + { + lock ( ((System.Collections.ICollection)(this.queue)).SyncRoot ) + { + this.queue.Enqueue( bar ); + } + } + + #region enqueue_handleChunkOfBarsToBeWrittenToDatabase private void riseNewChunkOfBarsToBeWrittenWithASingleSqlCommand() { *************** *** 74,83 **** this.riseNewChunkOfBarsToBeWrittenWithASingleSqlCommand(); } public void Enqueue( Bar bar ) { ! this.Queue.Enqueue( bar ); this.enqueue_handleChunkOfBarsToBeWrittenToDatabase(); } #endregion Enqueue } } --- 97,122 ---- this.riseNewChunkOfBarsToBeWrittenWithASingleSqlCommand(); } + #endregion enqueue_handleChunkOfBarsToBeWrittenToDatabase + public void Enqueue( Bar bar ) { ! this.enqueueThreadSafely( bar ); this.enqueue_handleChunkOfBarsToBeWrittenToDatabase(); } #endregion Enqueue + + /// <summary> + /// thread safe bar dequeue + /// </summary> + /// <returns></returns> + public Bar Dequeue() + { + Bar bar; + lock ( ((System.Collections.ICollection)(this.queue)).SyncRoot ) + { + bar = this.queue.Dequeue(); + } + return bar; + } } } |
|
From: Glauco S. <gla...@us...> - 2009-02-04 19:50:00
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31517 Modified Files: Bar.cs Log Message: IntervalValueInSeconds is now used instead of Interval Index: Bar.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/Bar.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Bar.cs 9 Jul 2008 22:06:56 -0000 1.1 --- Bar.cs 4 Feb 2009 19:49:51 -0000 1.2 *************** *** 33,37 **** private string exchange; private DateTime dateTimeForOpenInUTCTime; ! private long interval; private double open; private double high; --- 33,37 ---- private string exchange; private DateTime dateTimeForOpenInUTCTime; ! private long intervalValueInSeconds; private double open; private double high; *************** *** 53,59 **** get { return this.dateTimeForOpenInUTCTime; } } ! public long Interval { ! get { return this.interval; } } public double Open --- 53,59 ---- get { return this.dateTimeForOpenInUTCTime; } } ! public long IntervalValueInSeconds { ! get { return this.intervalValueInSeconds; } } public double Open *************** *** 93,97 **** this.exchange = exchange; this.dateTimeForOpenInUTCTime = dateTimeForOpenInUTCTime; ! this.interval = interval; this.open = open; this.high = high; --- 93,97 ---- this.exchange = exchange; this.dateTimeForOpenInUTCTime = dateTimeForOpenInUTCTime; ! this.intervalValueInSeconds = interval; this.open = open; this.high = high; |
|
From: Glauco S. <gla...@us...> - 2009-02-04 19:48:24
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OTManagement In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31357 Added Files: OTIntervalValueCalculator.cs Log Message: Computes the interval values for the given OTHistoricalType --- NEW FILE: OTIntervalValueCalculator.cs --- /* QuantProject - Quantitative Finance Library OTIntervalValueCalculator.cs Copyright (C) 2009 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 OTFeed_NET; namespace QuantProject.Applications.Downloader.OpenTickDownloader { /// <summary> /// Computes the interval values for the given OTHistoricalType /// </summary> public class OTIntervalValueCalculator { public OTIntervalValueCalculator() { } /// <summary> /// returns the number of seconds for the given oTHistoricalType /// </summary> /// <param name="oTHistoricalType"></param> /// <returns></returns> public static int GetIntervalValueInSeconds( OTHistoricalType oTHistoricalType ) { int intervalValueInSeconds; switch ( oTHistoricalType ) { case OTHistoricalType.OhlcMinutely: intervalValueInSeconds = 60; break; case OTHistoricalType.OhlcHourly: intervalValueInSeconds = 3600; break; case OTHistoricalType.OhlcDaily: intervalValueInSeconds = 3600*24; break; case OTHistoricalType.OhlcWeekly: intervalValueInSeconds = 3600*24*7; break; // case OTHistoricalType.OhlcMonthly: // intervalValueInSeconds = 3600*24*31; // approximation: the most common case is chosen // break; // case OTHistoricalType.OhlcYearly: // intervalValueInSeconds = 3600*24*365; // approximation: the most common case is chosen // break; default: throw new Exception( "The given oTHistoricalType is not expected" ); } return intervalValueInSeconds; } } } |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:48:35
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9501/OpenTickDownloader Modified Files: OTTickerDownloader.cs Log Message: A new constructor has been added: the goal is to let the class use either a BarsSelectorBasedOHLCRequester or a OHLCRequesterForConsecutiveBars. In this revision only the constructor that builds a BarsSelectorBasedOHLCRequester works (that's pretty much the same behavior of the previous revision). An actually new capability would be given by the OHLCRequesterForConsecutiveBars, but it doesn't work yet. Index: OTTickerDownloader.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OTTickerDownloader.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OTTickerDownloader.cs 11 Jan 2009 20:37:47 -0000 1.7 --- OTTickerDownloader.cs 29 Jan 2009 19:48:32 -0000 1.8 *************** *** 44,49 **** --- 44,54 ---- { private string[] tickersToDownload; + private List<Time> dailyTimes; private DateTime firstDate; + + private DateTime dateTimeForFirstBarOpenInNewYorkTimeZone; + private DateTime dateTimeForLastBarOpenInNewYorkTimeZone; + /// <summary> /// number of seconds in each bar *************** *** 64,68 **** private IExchangeSelector exchangeSelector; ! private IBarsSelector barsSelector; private BarsDownloader barsDownloader; private MessageManager messageManager; --- 69,73 ---- private IExchangeSelector exchangeSelector; ! private IOHLCRequester oHLCRequester; private BarsDownloader barsDownloader; private MessageManager messageManager; *************** *** 130,133 **** --- 135,167 ---- } + public OTTickerDownloader( + string[] tickersToDownload, + DateTime dateTimeForFirstBarOpenInNewYorkTimeZone, + DateTime dateTimeForLastBarOpenInNewYorkTimeZone, + int barInterval , + string openTickUser, + string openTickPassword) + { + this.otTickerDownloader_checkParameters(tickersToDownload, + firstDate, + dateTimeForFirstBarOpenInNewYorkTimeZone, + false, + false, + false, + openTickUser, + openTickPassword); + this.tickersToDownload = tickersToDownload; + this.dailyTimes = null; + this.dateTimeForFirstBarOpenInNewYorkTimeZone = dateTimeForFirstBarOpenInNewYorkTimeZone; + this.dateTimeForLastBarOpenInNewYorkTimeZone = dateTimeForLastBarOpenInNewYorkTimeZone; + this.barInterval = barInterval; + this.dateTimeForOverWritingQuotes = DateTime.MaxValue; + this.checkForMissingQuotes = false; + this.overwriteAllQuotesInDatabase = false; + this.downloadOnlySuccessiveQuotesToTheLastQuoteInDatabase = false; + this.openTickUser = openTickUser; + this.openTickPassword = openTickPassword; + } + public event DownloadingStartedEventHandler DownloadingStarted; public event DatabaseUpdatedEventHandler DatabaseUpdated; *************** *** 171,175 **** return date; } ! private void setBarsSelector() { DateTime firstDateForBarsSelector = --- 205,210 ---- return date; } ! #region oHLCRequester ! private void setOHLCRequester_forSpecificDailyTimes() { DateTime firstDateForBarsSelector = *************** *** 179,200 **** if ( this.checkForMissingQuotes ) // only missing quotes are to be downloaded ! this.barsSelector = ! new MissingDailyBarsSelector( ! this.tickersToDownload , ! this.setBarsSelector_getDate( this.firstDate ) , ! this.setBarsSelector_getDate( DateTime.Now ) , ! this.barInterval , ! this.dailyTimes ); else // all quotes are to be downloaded, even if they // are in the database already ! this.barsSelector = ! new DailyBarsSelector( ! this.tickersToDownload , ! this.setBarsSelector_getDate( this.firstDate ) , ! this.setBarsSelector_getDate( DateTime.Now ) , ! this.barInterval , ! this.dailyTimes ); } private void setExchangeSelector() { --- 214,256 ---- if ( this.checkForMissingQuotes ) // only missing quotes are to be downloaded ! this.oHLCRequester = ! new BarsSelectorBasedOHLCRequester( ! new MissingDailyBarsSelector( ! this.tickersToDownload , ! this.setBarsSelector_getDate( this.firstDate ) , ! this.setBarsSelector_getDate( DateTime.Now ) , ! this.barInterval , ! this.dailyTimes ) ); else // all quotes are to be downloaded, even if they // are in the database already ! this.oHLCRequester = ! new BarsSelectorBasedOHLCRequester( ! new DailyBarsSelector( ! this.tickersToDownload , ! this.setBarsSelector_getDate( this.firstDate ) , ! this.setBarsSelector_getDate( DateTime.Now ) , ! this.barInterval , ! this.dailyTimes ) ); } + private void setOHLCRequester_forAllDailyBars() + { + this.oHLCRequester = + new OHLCRequesterForConsecutiveBars( + this.tickersToDownload , + this.dateTimeForFirstBarOpenInNewYorkTimeZone , + this.dateTimeForLastBarOpenInNewYorkTimeZone , + this.barInterval ); + } + private void setOHLCRequester() + { + if ( this.dailyTimes != null ) + // only some specific daily times have been requested + this.setOHLCRequester_forSpecificDailyTimes(); + else + // all daily bars have been requested + this.setOHLCRequester_forAllDailyBars(); + } + #endregion oHLCRequester private void setExchangeSelector() { *************** *** 225,229 **** this.barsDownloader = new BarsDownloader( ! this.barsSelector , this.exchangeSelector , this.openTickUser , --- 281,285 ---- this.barsDownloader = new BarsDownloader( ! this.oHLCRequester , this.exchangeSelector , this.openTickUser , *************** *** 269,273 **** private void downloadTickersActually() { ! this.setBarsSelector(); this.setExchangeSelector(); this.setBarsDownloaderAndRunIt(); --- 325,329 ---- private void downloadTickersActually() { ! this.setOHLCRequester(); this.setExchangeSelector(); this.setBarsDownloaderAndRunIt(); |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:45:18
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OTManagement In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9244/OpenTickDownloader/OTManagement Modified Files: OTManager.cs Log Message: code changed because the class BarRequest has 4 parameters now (it had 3 in the previous revision) Index: OTManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OTManagement/OTManager.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OTManager.cs 11 Jan 2009 20:38:14 -0000 1.4 --- OTManager.cs 29 Jan 2009 19:45:12 -0000 1.5 *************** *** 152,156 **** this.onOTClientError_logMessage( error ); if ( this.OnError != null ) ! this.OnError( error ); } #endregion onOTClientError_actually --- 152,156 ---- this.onOTClientError_logMessage( error ); if ( this.OnError != null ) ! this.OnError( error ); } #endregion onOTClientError_actually *************** *** 214,218 **** { this.onMessageEventHandler_logMessage( oTMessage ); ! this.onMessageEventHandler_riseOnEndOfDataIfTheCase( oTMessage ); } #endregion onMessageEventHandler_actually --- 214,218 ---- { this.onMessageEventHandler_logMessage( oTMessage ); ! this.onMessageEventHandler_riseOnEndOfDataIfTheCase( oTMessage ); } #endregion onMessageEventHandler_actually *************** *** 328,332 **** DownloaderConstants.MAX_NUMBER_OF_PENDING_REQUESTS_FOR_A_SINGLE_OTMANAGER ); } ! return areThereTooMany; } --- 328,332 ---- DownloaderConstants.MAX_NUMBER_OF_PENDING_REQUESTS_FOR_A_SINGLE_OTMANAGER ); } ! return areThereTooMany; } *************** *** 360,364 **** exchange , symbol , ! startingDateInUTC ); lock ( this.pendingBarRequests ) { --- 360,365 ---- exchange , symbol , ! startingDateInUTC , ! intervalValue ); lock ( this.pendingBarRequests ) { *************** *** 404,414 **** // Thread.Sleep( 10 ); int requestId = ! this.requestHistDataWithoutTooManyPendentBarRequests( ! exchange , ! symbol , ! startingDateInUTC , ! endingDateInUTC , ! oTHistoricalType , ! intervalValue ); return requestId; } --- 405,415 ---- // Thread.Sleep( 10 ); int requestId = ! this.requestHistDataWithoutTooManyPendentBarRequests( ! exchange , ! symbol , ! startingDateInUTC , ! endingDateInUTC , ! oTHistoricalType , ! intervalValue ); return requestId; } |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:43:07
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/ExchangeSelectors/MostLiquid In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9004/OpenTickDownloader/ExchangeSelectors/MostLiquid Modified Files: MostLiquidExchangeSelectorForSingleTicker.cs Log Message: code changed because the delegate NewOHLCRequestEventHandler has 4 parameters now (it had 3 in the previous revision) Index: MostLiquidExchangeSelectorForSingleTicker.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/ExchangeSelectors/MostLiquid/MostLiquidExchangeSelectorForSingleTicker.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MostLiquidExchangeSelectorForSingleTicker.cs 20 Jul 2008 20:35:29 -0000 1.2 --- MostLiquidExchangeSelectorForSingleTicker.cs 29 Jan 2009 19:43:00 -0000 1.3 *************** *** 284,288 **** if ( this.NewOHLCRequest != null ) this.NewOHLCRequest( ! requestId , this.startingDate , barInterval ); } #endregion riseNewOHLCRequestEvent --- 284,288 ---- if ( this.NewOHLCRequest != null ) this.NewOHLCRequest( ! requestId , this.startingDate , this.endingDate , barInterval ); } #endregion riseNewOHLCRequestEvent |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:40:32
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8751/OpenTickDownloader Modified Files: BarsDownloader.cs Log Message: a IOHLCRequester is now used instead of a IBarsSelector Index: BarsDownloader.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/BarsDownloader.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BarsDownloader.cs 11 Jan 2009 20:38:14 -0000 1.3 --- BarsDownloader.cs 29 Jan 2009 19:40:27 -0000 1.4 *************** *** 41,45 **** public event DatabaseUpdatedEventHandler DatabaseUpdated; ! private IBarsSelector barsSelector; private IExchangeSelector exchangeSelector; private string openTickUser; --- 41,45 ---- public event DatabaseUpdatedEventHandler DatabaseUpdated; ! private IOHLCRequester oHLCRequester; private IExchangeSelector exchangeSelector; private string openTickUser; *************** *** 67,71 **** /// to be downloaded every day</param> public BarsDownloader( ! IBarsSelector barsSelector , IExchangeSelector exchangeSelector , string openTickUser , --- 67,71 ---- /// to be downloaded every day</param> public BarsDownloader( ! IOHLCRequester oHLCRequester , IExchangeSelector exchangeSelector , string openTickUser , *************** *** 73,77 **** ) { ! this.barsSelector = barsSelector; this.exchangeSelector = exchangeSelector; this.openTickUser = openTickUser; --- 73,77 ---- ) { ! this.oHLCRequester = oHLCRequester; this.exchangeSelector = exchangeSelector; this.openTickUser = openTickUser; *************** *** 89,97 **** #region initializeBarQueueFiller private void newOHLCRequestEventHandler( ! int requestID , DateTime dateTimeForRequestInUTC , long barInterval ) { if ( this.NewOHLCRequest != null ) this.NewOHLCRequest( ! requestID , dateTimeForRequestInUTC , barInterval ); } private void newMessageEventHandler( --- 89,99 ---- #region initializeBarQueueFiller private void newOHLCRequestEventHandler( ! int requestID , DateTime dateTimeForFirstBarOpenInUTC , ! DateTime dateTimeForLastBarOpenInUTC , long barInterval ) { if ( this.NewOHLCRequest != null ) this.NewOHLCRequest( ! requestID , dateTimeForFirstBarOpenInUTC , ! dateTimeForLastBarOpenInUTC , barInterval ); } private void newMessageEventHandler( *************** *** 105,109 **** this.barQueueFiller = new BarQueueFiller( ! this.barsSelector , this.exchangeSelector , this.oTManager , --- 107,111 ---- this.barQueueFiller = new BarQueueFiller( ! this.oHLCRequester , this.exchangeSelector , this.oTManager , |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:39:42
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OTManagement In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8630/OpenTickDownloader/OTManagement Modified Files: BarRequest.cs Log Message: the property public short IntervalValueInSeconds has been added Index: BarRequest.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OTManagement/BarRequest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BarRequest.cs 9 Jul 2008 22:20:39 -0000 1.1 --- BarRequest.cs 29 Jan 2009 19:39:37 -0000 1.2 *************** *** 3,7 **** BarRequest.cs ! Copyright (C) 2008 Glauco Siliprandi --- 3,7 ---- BarRequest.cs ! Copyright (C) 2008 Glauco Siliprandi *************** *** 19,23 **** 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; --- 19,23 ---- 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; *************** *** 30,37 **** public class BarRequest { ! private string exchange; private string symbol; private DateTime dateTimeForOpenInUTC; ! public string Exchange { get { return exchange; } --- 30,38 ---- public class BarRequest { ! private string exchange; private string symbol; private DateTime dateTimeForOpenInUTC; ! private short intervalValueInSeconds; ! public string Exchange { get { return exchange; } *************** *** 43,54 **** get { return dateTimeForOpenInUTC; } } public BarRequest( string exchange , string symbol , ! DateTime dateTimeForOpenInUTC ) { this.exchange = exchange; this.symbol = symbol; this.dateTimeForOpenInUTC = dateTimeForOpenInUTC; } } --- 44,60 ---- get { return dateTimeForOpenInUTC; } } + public short IntervalValueInSeconds { + get { return this.intervalValueInSeconds; } + } public BarRequest( string exchange , string symbol , ! DateTime dateTimeForOpenInUTC , ! short intervalValueInSeconds ) { this.exchange = exchange; this.symbol = symbol; this.dateTimeForOpenInUTC = dateTimeForOpenInUTC; + this.intervalValueInSeconds = intervalValueInSeconds; } } |
|
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 |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:37:52
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/BarsSelectors In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8414/OpenTickDownloader/BarsSelectors Modified Files: BarIdentifier.cs Log Message: interval has been renamed to barIntervalInSeconds Index: BarIdentifier.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/BarsSelectors/BarIdentifier.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BarIdentifier.cs 9 Jul 2008 22:11:45 -0000 1.1 --- BarIdentifier.cs 29 Jan 2009 19:37:41 -0000 1.2 *************** *** 33,37 **** private string ticker; private DateTime dateTimeForOpenInNewYorkTimeZone; ! private long interval; public string Ticker { --- 33,37 ---- private string ticker; private DateTime dateTimeForOpenInNewYorkTimeZone; ! private long barIntervalInSeconds; public string Ticker { *************** *** 41,46 **** get { return this.dateTimeForOpenInNewYorkTimeZone; } } ! public long Interval { ! get { return this.interval; } } --- 41,46 ---- get { return this.dateTimeForOpenInNewYorkTimeZone; } } ! public long BarIntervalInSeconds { ! get { return this.barIntervalInSeconds; } } *************** *** 62,66 **** this.dateTimeForOpenInNewYorkTimeZone = dateTimeForOpenInNewYorkTimeZone; ! this.interval = interval; } } --- 62,66 ---- this.dateTimeForOpenInNewYorkTimeZone = dateTimeForOpenInNewYorkTimeZone; ! this.barIntervalInSeconds = interval; } } |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:36:52
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8317 Modified Files: QuantDownloader_SD.csproj Log Message: - OpenTickDownloader\OHLCRequesters\BarsSelectorBasedOHLCRequester.cs has been added - OpenTickDownloader\OHLCRequesters\OHLCRequest.cs has been added - OpenTickDownloader\OHLCRequesters\IOHLCRequester.cs has been added - OpenTickDownloader\OHLCRequesters\OHLCRequesterForConsecutiveBars.cs has been added Index: QuantDownloader_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuantDownloader_SD.csproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** QuantDownloader_SD.csproj 30 Dec 2008 00:35:57 -0000 1.7 --- QuantDownloader_SD.csproj 29 Jan 2009 19:36:45 -0000 1.8 *************** *** 67,70 **** --- 67,74 ---- <Compile Include="OpenTickDownloader\ExchangeSelectors\MostLiquid\MostLiquidExchangeSelector.cs" /> <Compile Include="OpenTickDownloader\ExchangeSelectors\MostLiquid\MostLiquidExchangeSelectorForSingleTicker.cs" /> + <Compile Include="OpenTickDownloader\OHLCRequesters\BarsSelectorBasedOHLCRequester.cs" /> + <Compile Include="OpenTickDownloader\OHLCRequesters\OHLCRequest.cs" /> + <Compile Include="OpenTickDownloader\OHLCRequesters\IOHLCRequester.cs" /> + <Compile Include="OpenTickDownloader\OHLCRequesters\OHLCRequesterForConsecutiveBars.cs" /> <Compile Include="OpenTickDownloader\OTManagement\BarRequest.cs" /> <Compile Include="OpenTickDownloader\OTManagement\OTManager.cs" /> *************** *** 132,135 **** --- 136,140 ---- <Folder Include="OpenTickDownloader\ExchangeSelectors" /> <Folder Include="OpenTickDownloader\ExchangeSelectors\MostLiquid" /> + <Folder Include="OpenTickDownloader\OHLCRequesters" /> <Folder Include="OpenTickDownloader\OTManagement" /> <Folder Include="OpenTickDownloader\TimeZoneManaging" /> |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:35:36
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OHLCRequesters In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8161 Added Files: OHLCRequesterForConsecutiveBars.cs Log Message: Throws out a single OHLCRequest for every ticker in the given array: such request requests all available bars in the given period --- NEW FILE: OHLCRequesterForConsecutiveBars.cs --- /* QuantProject - Quantitative Finance Library OHLCRequesterForConsecutiveBars.cs Copyright (C) 2009 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; namespace QuantProject.Applications.Downloader.OpenTickDownloader { /// <summary> /// Throws out a single OHLCRequest for every ticker in the given array: such request requests /// all available bars in the given period /// </summary> public class OHLCRequesterForConsecutiveBars : IOHLCRequester { private string[] tickersToBeDownloaded; private DateTime dateTimeForFirstBarOpenInNewYorkTimeZone; private DateTime dateTimeForLastBarOpenInNewYorkTimeZone; private int barIntervalInSeconds; private int indexForTheNextTickerToRequestFor; public bool AreAllOHLCRequestsAlredyGiven { get { bool areAllAlreadyGiven = ( indexForTheNextTickerToRequestFor >= this.tickersToBeDownloaded.Length ); return areAllAlreadyGiven; } } /// <summary> /// Throws out a single OHLCRequest for every ticker in the given array: such request requests /// all available bars in the given period /// </summary> /// <param name="ticker"></param> /// <returns></returns> public OHLCRequesterForConsecutiveBars( string[] tickersToDownload , DateTime dateTimeForFirstBarOpenInNewYorkTimeZone , DateTime dateTimeForLastBarOpenInNewYorkTimeZone , int barIntervalInSeconds ) { this.tickersToBeDownloaded = tickersToDownload; this.dateTimeForFirstBarOpenInNewYorkTimeZone = dateTimeForFirstBarOpenInNewYorkTimeZone; this.dateTimeForLastBarOpenInNewYorkTimeZone = dateTimeForLastBarOpenInNewYorkTimeZone; this.barIntervalInSeconds = barIntervalInSeconds; this.indexForTheNextTickerToRequestFor = 0; } #region GetNextOHLCRequest private OHLCRequest getOHLCRequest( string ticker ) { OHLCRequest ohlcRequest = new OHLCRequest( ticker , this.dateTimeForFirstBarOpenInNewYorkTimeZone , this.dateTimeForLastBarOpenInNewYorkTimeZone , this.barIntervalInSeconds ); return ohlcRequest; } public OHLCRequest GetNextOHLCRequest() { string ticker = this.tickersToBeDownloaded[ this.indexForTheNextTickerToRequestFor ]; OHLCRequest ohlcRequest = this.getOHLCRequest( ticker ); this.indexForTheNextTickerToRequestFor++; return ohlcRequest; } #endregion GetNextOHLCRequest } } |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:35:02
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OHLCRequesters In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8102 Added Files: BarsSelectorBasedOHLCRequester.cs Log Message: Throws out a single OHLCRequest for every single bar selected by the IBarSelector --- NEW FILE: BarsSelectorBasedOHLCRequester.cs --- /* QuantProject - Quantitative Finance Library BarsSelectorBasedOHLCRequester.cs Copyright (C) 2009 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; namespace QuantProject.Applications.Downloader.OpenTickDownloader { /// <summary> /// Throws out a single OHLCRequest for every single bar selected by /// the IBarSelector /// </summary> public class BarsSelectorBasedOHLCRequester : IOHLCRequester { private IBarsSelector barsSelector; public bool AreAllOHLCRequestsAlredyGiven { get { bool areAllAlreadyGiven = this.barsSelector.AreAllBarsAlredyGiven; return areAllAlreadyGiven; } } public BarsSelectorBasedOHLCRequester( IBarsSelector barsSelector ) { this.barsSelector = barsSelector; } public OHLCRequest GetNextOHLCRequest() { BarIdentifier barIdentifier = this.barsSelector.GetNextBarIdentifier(); OHLCRequest ohlcRequest = new OHLCRequest( barIdentifier.Ticker , barIdentifier.DateTimeForOpenInNewYorkTimeZone , barIdentifier.DateTimeForOpenInNewYorkTimeZone , barIdentifier.BarIntervalInSeconds ); return ohlcRequest; } } } |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:34:18
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OHLCRequesters In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8048 Added Files: OHLCRequest.cs Log Message: Identifies a set of consecutive OpenHighLowClose bar to be requested (the exchange is not considered) --- NEW FILE: OHLCRequest.cs --- /* QuantProject - Quantitative Finance Library OHLCRequest.cs Copyright (C) 2009 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; namespace QuantProject.Applications.Downloader.OpenTickDownloader { /// <summary> /// Identifies a set of consecutive OpenHighLowClose bar to be requested /// (the exchange is not considered) /// </summary> public class OHLCRequest { private string ticker; private DateTime dateTimeForFirstBarOpenInNewYorkTimeZone; private DateTime dateTimeForLastBarOpenInNewYorkTimeZone; private long barIntervalInSeconds; public string Ticker { get { return this.ticker; } } /// <summary> /// date time for the first bar requested /// </summary> public DateTime DateTimeForFirstBarOpenInNewYorkTimeZone { get { return this.dateTimeForFirstBarOpenInNewYorkTimeZone; } } /// <summary> /// date time for the last bar requested /// </summary> public DateTime DateTimeForLastBarOpenInNewYorkTimeZone { get { return this.dateTimeForLastBarOpenInNewYorkTimeZone; } } public long BarIntervalInSeconds { get { return this.barIntervalInSeconds; } } /// <summary> /// Identifies an OpenHighLowClose bar bar to be requested /// (the exchange is not considered) /// </summary> /// <param name="ticker">the ticker the bar is referred to</param> /// <param name="dateTimeForFirstBarOpenInNewYorkTimeZone">date time when the first bar begins</param> /// <param name="dateTimeForLastBarOpenInNewYorkTimeZone">date time when the last bar begins</param> /// <param name="barIntervalInSeconds">number or seconds between the /// bar's open and the bar's close (in other words, the bar's /// length, in seconds)</param> public OHLCRequest( string ticker , DateTime dateTimeForFirstBarOpenInNewYorkTimeZone , DateTime dateTimeForLastBarOpenInNewYorkTimeZone , long barIntervalInSeconds ) { this.ticker = ticker; this.dateTimeForFirstBarOpenInNewYorkTimeZone = dateTimeForFirstBarOpenInNewYorkTimeZone; this.dateTimeForLastBarOpenInNewYorkTimeZone = dateTimeForLastBarOpenInNewYorkTimeZone; this.barIntervalInSeconds = barIntervalInSeconds; } } } |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:33:40
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OHLCRequesters In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7962 Added Files: IOHLCRequester.cs Log Message: Interface to be implemented by OHLC requesters. A OHLC requester selector selects some consecutive OpenHighLowClose bars (that then will be downloaded) --- NEW FILE: IOHLCRequester.cs --- /* QuantProject - Quantitative Finance Library IOHLCRequester.cs Copyright (C) 2009 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; namespace QuantProject.Applications.Downloader.OpenTickDownloader { /// <summary> /// Interface to be implemented by OHLC requesters. A OHLC requester /// selector selects some consecutive OpenHighLowClose bars (that then /// will be downloaded) /// </summary> public interface IOHLCRequester { /// <summary> /// returns the next OHLCRequest (for the historical OHLC bar /// to be requested) /// </summary> /// <returns></returns> OHLCRequest GetNextOHLCRequest(); /// <summary> /// true iif all bars have already been selected and /// signaled outside /// </summary> bool AreAllOHLCRequestsAlredyGiven { get; } } } |
|
From: Glauco S. <gla...@us...> - 2009-01-29 19:31:47
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OHLCRequesters In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7794/OHLCRequesters Log Message: Directory /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/OHLCRequesters added to the repository |
|
From: Glauco S. <gla...@us...> - 2009-01-22 18:59:45
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14843/b2_DataAccess Modified Files: SQLBuilder.cs Log Message: The method GetFormatFunctionForTime() has become public, now Index: SQLBuilder.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/SQLBuilder.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SQLBuilder.cs 4 Jan 2009 17:51:12 -0000 1.6 --- SQLBuilder.cs 22 Jan 2009 18:59:32 -0000 1.7 *************** *** 164,171 **** // } ! #region getFilterForTime_actually ! ! #region getFormatFunctionForTime ! private static string getFormatFunctionForTime( string dateTimeFieldName ) { string formatFunctionForTime = null; --- 164,173 ---- // } ! /// <summary> ! /// builds a database dependent DateTime format function for the given field name ! /// </summary> ! /// <param name="dateTimeFieldName"></param> ! /// <returns></returns> ! public static string GetFormatFunctionForTime( string dateTimeFieldName ) { string formatFunctionForTime = null; *************** *** 184,189 **** return formatFunctionForTime; } - #endregion getFormatFunctionForTime private static string getSqlStringForComparisonOperator( SqlComparisonOperator sqlComparisonOperator ) --- 186,191 ---- return formatFunctionForTime; } + #region getFilterForTime_actually private static string getSqlStringForComparisonOperator( SqlComparisonOperator sqlComparisonOperator ) *************** *** 216,220 **** // "(Format([baDateTimeForOpen],'hh.mm.ss')" + "(" + ! SQLBuilder.getFormatFunctionForTime( "baDateTimeForOpen" ) + SQLBuilder.getSqlStringForComparisonOperator( sqlComparisonOperator ) + SQLBuilder.GetTimeConstant( time ) + ")"; --- 218,222 ---- // "(Format([baDateTimeForOpen],'hh.mm.ss')" + "(" + ! SQLBuilder.GetFormatFunctionForTime( "baDateTimeForOpen" ) + SQLBuilder.getSqlStringForComparisonOperator( sqlComparisonOperator ) + SQLBuilder.GetTimeConstant( time ) + ")"; |
|
From: Glauco S. <gla...@us...> - 2009-01-22 18:59:02
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14805/b2_DataAccess Modified Files: DataBase.cs Log Message: the method getFilterForDailyTimes() now returnes a "in (...)" sql where clause. In the previous revision, the method returned a list of "or" where clauses. The resulting sql statement is much shorter, now Index: DataBase.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBase.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** DataBase.cs 14 Jan 2009 23:37:51 -0000 1.15 --- DataBase.cs 22 Jan 2009 18:58:46 -0000 1.16 *************** *** 209,232 **** #region getFilterForDailyTimes - // #region getFilterForDailyTime - // private getFilterForDailyTime( DateTime dateTime ) - // { - // string filterForDailyTime = - // "(Format([baDateTimeForOpen],'hh:mm:ss')>='" + - // this.getSqlTimeConstantForFirstDailyBar() + "')"; - // } - // #endregion getFilterForDailyTime - private static string getFilterForDailyTimes( List< Time > dailyTimes ) { ! string filterForDailyTimes = ""; foreach( Time time in dailyTimes ) filterForDailyTimes = filterForDailyTimes + ! SQLBuilder.GetFilterForTime( ! "baDateTimeForOpen" , SqlComparisonOperator.Equal , time ) + ! " or "; filterForDailyTimes = filterForDailyTimes.Substring( ! 0 , filterForDailyTimes.Length - " or ".Length ); return filterForDailyTimes; } --- 209,224 ---- #region getFilterForDailyTimes private static string getFilterForDailyTimes( List< Time > dailyTimes ) { ! string filterForDailyTimes = ! SQLBuilder.GetFormatFunctionForTime( "baDateTimeForOpen" ) + " in ( "; foreach( Time time in dailyTimes ) filterForDailyTimes = filterForDailyTimes + ! SQLBuilder.GetTimeConstant( time ) + ! " , "; filterForDailyTimes = filterForDailyTimes.Substring( ! 0 , filterForDailyTimes.Length - " , ".Length ); ! filterForDailyTimes += " )"; return filterForDailyTimes; } |
|
From: Glauco S. <gla...@us...> - 2009-01-18 18:40:42
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/DatabaseManagement In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26397/Downloader/OpenTickDownloader/DatabaseManagement Modified Files: DataBaseWriter.cs Log Message: The sleep time between two database writing has been lower down from 50 milliseconds to 15 milliseconds Index: DataBaseWriter.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/OpenTickDownloader/DatabaseManagement/DataBaseWriter.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DataBaseWriter.cs 14 Jan 2009 23:32:39 -0000 1.5 --- DataBaseWriter.cs 18 Jan 2009 18:40:33 -0000 1.6 *************** *** 142,146 **** { this.writeToDataBaseIfEnoughBars(); ! Thread.Sleep( 50 ); } } --- 142,146 ---- { this.writeToDataBaseIfEnoughBars(); ! Thread.Sleep( 15 ); } } |