[Quantproject-developers] QuantProject/b3_Data DataProvider.cs,1.1.1.2,1.2
Brought to you by:
glauco_1
|
From: <gla...@us...> - 2004-01-03 16:17:45
|
Update of /cvsroot/quantproject/QuantProject/b3_Data
In directory sc8-pr-cvs1:/tmp/cvs-serv31680/b3_Data
Modified Files:
DataProvider.cs
Log Message:
The GetCloseHistory method has been improved:
if the requested ticker history was not cached yet,
an error happened. Now the ticker is automatically
added to the cached list and the history is read
from the database on the fly.
Index: DataProvider.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProvider.cs,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -C2 -d -r1.1.1.2 -r1.2
*** DataProvider.cs 13 Oct 2003 21:58:09 -0000 1.1.1.2
--- DataProvider.cs 3 Jan 2004 16:17:41 -0000 1.2
***************
*** 91,94 ****
--- 91,101 ----
public static History GetCloseHistory( string instrumentKey )
{
+ if ( ( !cachedHistories.Contains( instrumentKey ) ) ||
+ ( !((Hashtable)cachedHistories[ instrumentKey ]).Contains( BarComponent.Close ) ) )
+ {
+ Add( instrumentKey , BarComponent.Close );
+ ((Hashtable)cachedHistories[ instrumentKey ])[ BarComponent.Close ] =
+ DataBase.GetHistory( instrumentKey , BarComponent.Close );
+ }
return (History)((Hashtable)cachedHistories[ instrumentKey ])[
BarComponent.Close ];
|