Gernating the Generic Trading System
====================================

The aim here is to generate the generic Technical analysis
trading platform which is efficient, flexible and straight to
extend and modify.

The technical trading system will recover the source market data,
evaluate the technical indicators and then generate trading
signals based apon these indicaors. Since the components used
for this generic technical analysis trading platform are loosely
coupled you will be able to modify the basic application in
accordance with your data archive, custom trading indicators
and technical trading systems.

DataBase Structure
------------------

We provide some example data with the platform which can be used
in order to generate a working template TA system.


Three steps to running the example
----------------------------------

1. Installing our Tables (MySQL Only)

In order to create the database structure from which you are able
to load the output results, you will need to run the `create.sql'
scripts in the `Data' subdirectory. Open the MySQL prompt from
the `Data' subdirectory and:

    a) Select (or create and then select) a database you can spare
       for tables named AMD, BEAS, DELL, IBM, MSFT, ORCL, and RATE.
       For example, if you have decided using the `test' database,
       you would optinally type the SQL command to create it
       (unless it already exists):
       
           CREATE DATABASE test;
       
       and then, you would type the following to select it:
       
           USE DATABASE
    
    b) Run the `create.sql' SQL script located in the `Data'
       subdirectory of the current directory by typing at the
       same MySQL prompt the following:

           source create.sql
       
       If this fails, make sure you have started the MySQL prompt
       from the `Data' subdirectory (this is where the database
       files for this example are stored).

2. Configuring the Database Connection

Edit the Java source code file by filling out JDBC information
about your database, such as:

    a. Driver Name (e.g. com.jdbc.mysql.Driver)
    b. JDBC Url (e.g. jdbc:mysql://localhost/test)
    c. Username and Password

If you are unsure whether you have a JDBC Driver for your Database,
skip this step and try running the example with the predefined
values. If that fails, you will need to probably download the
latest driver.

3. Running the example

    Run the `compile' script (compile.sh for Linux, compile.bat
    for Windows) to compile the Java source code, and then
    the `run' script to see the results.
 

Uninstalling the Source Data
----------------------------

To delete all the tables used in this example, open the MySQL
prompt from the `Data' subdirectory, select the database where
you created the tables, and run the following:

    source delete.sql


The Database Mediator
---------------------

Through the use of our Mediator in order to communicate between the
different components of the trading system. These components
include:

1) Source data - The is the data concerning the underlying asset
which can be read directly from the market. This data should be
stored within a SQL database and will generally consist of:

| Time Periods | Price | Low | High | Volume |

where:

Time Period - is the ID of the period over which that rows data
corresponds to
Price - Usual the last recorded price with the period
Low - The lowest traded price within the period
High - The highest Traded Price with the period
Volume - The volume which was traded within the period

2) Business Components - These are the classes/modules which contain
the business logic. In particular, the technical indicators and the
trading signal generators.

