What is it
Users have expressed demand to connect to databases, and Wealth-Lab listened: this provider helps connect to any ADO.NET compatible datasource. Out of the box, a typical PC with .NET framework supports Oracle, OleDb, ODBC, SQL Server and SQL Compact.
Features
- Supports historical and real-time data
- For static and streaming quotes, can query different databases
- The provider is optimized for MS SQL Server (uses asynchronous methods)
- If other database installs its .NET driver in the system, the provider can autodetect and support it - for example: SQLite, Firebird, MySQL etc.
- Every data request is live, the data only exists in your database (and can't be edited in WL)
- Supports Market Manager
Creating a new DataSet
To work with a database containing some data, you need to create a new static DataSet first. Pick the appropriate Provider from the list of available ones (e.g.
System.Data.OleDb/ODBC for Excel, Access, text files and lots more,
System.Data.SqlClient for SQL Server etc.), compose a connection string, and you're ready for the next step.
Usually, this is a no-brainer for the database guys, but should you feel lost in connection strings, clicking the bluish
Connection string Help label will try to guess what kind of database you're trying to connect to, using the bits and pieces of your connection string and/or selected provider, and take you to the relevant page of the
connectionstrings.com site.
- Your connection string should include a database name.
- Your connection string must not include curly braces i.e. { }
A rule of thumb is to first type in a connection string and only then proceed with selecting a provider. When you're finished with this step, the provider will populate the
Table name dropdown box with the list of tables found. Select the one you need to make the provider fill the other boxes with available fields. Upon defining a field to serve as
Security Name, the "Symbols" area is populated with found tickers.
Note: when database contains thousands of symbols, this step may take a while (several minutes). Please be patient.
Match available fields to DateTime, Open, High, Low and Close. Volume and Named Series are optional.
Note: for symbol names, you should use the
varchar() type, not
text. The provider won't let you confuse a DateTime field for prices and vice versa. To finish creation of your DataSet, select a bar scale and interval.
 New DataSet Wizard |
Setting up Streaming quotes
It's possible to use one source for static data while getting your streaming quotes from a different database (provided that the symbol exists in both). Setting up the provider for Streaming quotes is a two-step process:
- At any time, only one data source for streaming quotes can be defined. It's a global setting. To specify a database to use for real-time quotes, open the Data Manager tool, switch to the Database provider's tab, and repeat there all steps taken when completing the "New DataSet Wizard". For streaming quotes, only the Close price is required, Volume is optional.
 Configure streaming source |
- Finally, set "Database provider" as your current streaming provider in the Wealth-Lab's Preferences dialog, Streaming.
Note: you need to restart WL6 after
changing Streaming settings.
Bonus
See this KB article on how easily you can import a bunch of CSV files to use with the Database provider:
Bulk import of data in CSV files to a SQL Server database
Usage Notes and Limitations
| Driver={MySQL ODBC 5.1 Driver}; | incorrect |
| Driver=MySQL ODBC 5.1 Driver; | correct |
| Driver={Microsoft Access Driver (*.mdb, *.accdb)}; | incorrect |
| Driver=Microsoft Access Driver (*.mdb, *.accdb); | correct |