Home                           

 Try Investor/RT             

 Investor/RT Tour           

 Getting Started              

 What's New                  

 Testimonials                 

  Q&A - Broken down by Topic . . .      Complete List of Questions - All Topics
     Charts and Technical Indicators      TPO Charts
     RTL: Scans, Signals, and Custom Indicators      Importing and Exporting
     Trading Systems and Backtesting      Schedules
     Quotepages, Portfolios and Custom Columns      Alarms / Alerts
     Data: Historical Data, the Database, and Data Services      User Variables (T# and V#)
     Custom Instruments: Spreads and Pairs      General / Miscellaneous
     Controls, Windows, and the Button Indicator      Autotrading
     Slide Shows      Product Line

 
Q&A Home

Investor/RT Answer
Answers to Common Questions

   

Question

How do I best manage multiple databases in Investor/RT?
   

Answer

The Investor/RT database is a collection of 59 files that resides in a folder/directory named data_f. By default, Investor/RT looks for the data_f folder inside the Investor/RT startup folder. The startup folder is the folder where the Investor/RT application resides, e.g. the investrt folder. Investor/RT can be setup with multiple independent databases and the program can easily switch from one database to another. Some Investor/RT users, for example, have a lean database used for live trading. After market hours, they switch to another database that contains longer term historical data that they use for backtesting, experimentation, etc. The export/import features of Investor/RT make it easy to export signals, trading systems, historical data, etc. from one database to another.

It is easy to setup one or more alternate databases. Here is a step by step guide:
  1. Create a parent folder inside the investrt startup folder. Name the new folder with a short descriptive name. In this example, we will use the name "alt", short for alternate.
  2. Open the alt folder and create a folder inside it named data_f.
  3. Open the alt/data_f folder and create a folder inside it named backup_f.

    The folder investrt/data_f is the place where the "default" database is kept. investrt/alt/data_f is the place where the alternate database will be kept. Each data_f should contain a backup_f folder where backup images of the 59 data_f files are kept.
  4. With Investor/RT inactive, copy the 59 files from the default data_f into the investrt/alt/data_f folder.

You now have two independent databases setup and ready to use. Initially both database are identical of course. The default data_f is located directly inside the investrt folder; you can think of this one as the "investrt" database since investrt is the name of the parent folder containing that data_f. The other data_f folder is located inside the alt directory; it is the "alt" database; alt is the name of its parent folder/directory.

When you startup Investor/RT, it will startup using the database it was using when you last ran the program. You can check to see which database Investor/RT is using by opening the Data Feed Status window. Choose "Status" from the data feed menu, or right-click the heartbeat button at the right end of the main toolbar. At the bottom of the Data Feed status report you will see something like this:

Startup Folder: C:\investrt
Database Location: .\data_f
Backup Location: .\data_f\backup_f\

The ".\" notation means "the startup directory", so this indicates Investor/RT is running with the default data_f residing directly inside the investrt directory folder.

There are a variety ways to switch from one database to another.

  1. Use the File Menu. File-->Open-->Database...
  2. Use Setup: Preferences: Database. Click the Browse Button in the Database Location Section at the top of the window. Setup: Preferences: Database is the same window as Setup: Preferences: Backup.
  3. Create A Schedule containing the Database Function action "Open Database". A keyboard shortcut can be assigned to the schedule.
  4. Use the Run Schedule command in File Menu, to run a schedule that contains an Open Database action.

When switching databases, MS Windows users can designate a text string to be displayed in the Investor/RT task window title bar that will indicate which database is in use. For example, when using the "alt" database, go to Setup: Preferences: General and enter the string "Alternate DB" as the task window title string. When running with the normal default database, use "Default DB" for example. As you switch back and forth between the two databases, the task window title will always show you instantly which database is currently in use.

Under MS Windows there is a restrictive limit on the length of the path to the data_f folder that Investor/RT can handle. This is why using short folder/directory names is recommended. While generally it is a good idea to keep all databases inside the investrt startup directory, this is not necessary; you may place them anywhere you like as long as the path the database is not too long. The database folder(s) can reside on a different volume if you like, or on a RAM Disk volume, regardless of where the startup directory/folder resides. The advantage of keeping the alternate database inside the startup directory is that the path the database can then be specified as a "relative path" starting from the directory where the Investor/RT application resides. For example, if the startup directory is "C:\program files\investrt\ and the alternate database data_f is kept inside the startup directory in a folder named "alternate", then the absolute path to the database is:

C:\program files\investrt\alternate\data_f\

This path exceeds the path length limit however, since the path is located inside the startup directory, it can be specified as:

.\alternate\data_f\

When you use the various "browse" buttons in Investor/RT windows to locate the database folder, Investor/RT will automatically "reduce" the path to the database, if possible, to a relative path to avoid the path length restrictions.

If you want to have many databases for some reason, a nice technique is to create a folder inside the startup folder named simply "DB", short for database. Create as many folders inside the db folder as you wish, each with a short descriptive name. For example, create folders named small, medium, and large inside db. Setup each of the three as described above so that each contains a data_f folder with a backup_f inside it. Running with your default database, create scheduled named "Switch Small", "Switch Medium", and "Switch Large" with the appropriate Open Database actions. Switch to each of the databases in turn, and create a schedule within each of the three alternate databases to "Switch to Default DB". Keeping all databases inside a single DB folder makes it very convenient when browsing for the database you wish to use.

When running with an alternate database, all of the database utility function in the Control Menu will operate on the alternate database currently in use. Note however, that the MS Windows Start Menu commands "Database Maintenance" and "Verify Database" are specifically targeted at the default database in the Investor/RT startup directory/folder.

A special file named datapath.txt, located inside the admin folder, is used at startup to inform Investor/RT of the location of the database to use. If this file is not present in the admin folder, the default data_f inside the startup directory/folder is used. Thus, if you want to assure that Investor/RT starts up using the default data_f, simply delete this file from the admin before starting Investor/RT. Alternatively, you may edit (or create) the text file so its first line of text specifies the path to the parent folder that contains the data_f you wish to use. For example, a datapath.txt file with the first line in the file reading:

C:\investrt\db\small\

Will cause Investor/RT to start up using the data_f inside the small directory/folder. Macintosh users have the same facility, except that colons are used instead of backslashes in path names and the name of the hard drive is used instead of a drive letter like C:, e.g.

Macintosh HD:InvestorRT Folder:db:small:

The Macintosh version of Investor/RT does not have the same path length restrictions cite above for the MS Windows platform.