Insider 3000 :  Features  |  Forum  |  Help on Line  |  FAQ  |  Download  
Home  |   Trading Systems and Indicators  |   Upcoming release news  |   News
Order Insider 3000   |   Resellers - Agents
English    English    Italiano
    Open security
Workgroups
Data file Explorer
Layout
    Windows
Inner Windows
Tooltips
AutoRefresh
Print Chart
    Zoom
Zoom
    Control Panel
Introduction
Charts Properties
Windows Properties
Grids properties
Indicators Properties
Studies Properties
Trading Systems Properties
    Indicators and Studies
Adding an indicator
Modifying an Indicator
Transfer indicator between windows
Deleting an indicator
Adding Studies
Modifying an object
Deleting, coping, cutting, pasting an Object
Indicators Lists
    Data files Management
Introduction
Creating, deleting and modifying Archives
File Format
Historical DDE
Web Server
Archives Update
Edit periods
Deleting periods range
Copy Data to Clipboard
Text file import Wizard
Export data on text file Wizard
Rollover Wizard
Scheduled export on text file
    Analysis
User Indicators Management
Trading Systems Management
Explorers management
Real time alerts windows
Graphical alerts
Pivots Explorer
Candlestick Rules
Candlestick forecaster
Candlesticks signals on chart
Trading systems signals on chart
Statistics
Export - Import source code
    Real time data providers
Providers
    Find Window
Find Window
    Programming language
Introduction
Operators
Data types
Functions
Function, EndFunction
Return
Variables declaration: Dim
Comments
Warnings
The MAIN function
If, Then ... Else
Goto ... label
For ... Next
Do Until ... Loop
Select ... Case
Array
Error Handling
Module variables
Costants
Include (including secondary modules)
Properties
Option (trading systems options)
PRICE keyword (for trading systems)
DATABASE keyword
Special Functions (they change their output depending on the context)
System functions available in the programming language
Indicators Functions
Data Functions
Math Functions
Analysis tools Functions
Date Functions
Boolean Functions
String Functions
Other Functions
Programming Language Editor
    Send Email
Send Mail - Mailer
    Real Time - DDE
Introduction
Subscriptions
Data receiving
    Real Time - Web Server
Introduction
Web Server configuration
Subscriptions
Data receiving
    Real Time - Txt
Introduction
Text file configuration
Subscriptions
Data receiving
    Mailer
Introduction
Mailer Configuration
Emails list
DATABASE keyword

Using the Database keyword it is possible to have access to data of a specific security inside a workgroup.
This is useful to verify if a security responds to several rules when validating a trading system signal. Also when building a trading system on different time frames.


To use external data is it necessary to declare it first. Declaration is done at the beginning of the module, outside any function, where all other module variables are declared.
The syntax is the following:

Database DatabaseName ( "Workgroup Name", "Security symbol", "Compression Type", Minutes Periods other compression)

For Example:

Database Microsoft("Nasdaq", "MSFT", "N")

open a database named "Microsoft" assigning to it security data contained on the workgroup "Nasdaq" for the symbol "MSFT". Data have normal compression "N".

Arguments Compression Type and Minutes/Periods other compression are optional.

If Compression Type is not defined, then the default compression is "N" (Normal).

Possible compressions are:

N => Normal
D => Daily
W => Weekly
M => Monthly
Y => Yearly
MIN => Minutes
O => Other

The argument Minutes/Periods other compression is used, therefore is mandatory only in the case the choosen compression is Minutes (MIN) or Other (O).

Once the database has been declared it is possible to use it inside any functions, accessing the data using the standard function:

DbValue (Data array, "Database Name", By date (optional))

returns the numeric array or the value of Data Array calculated referring to the security specified on the database declaration

and where:

Data Array is a numeric array. It can be a data array, like Close, an indicator function etc.

Database Name is the name of the previously declared database which is used to calculate the Data Array

By date defines if the numeric value is being calculated based on the current period date or not.
By date will avoid to obtain wrong values. It could happen that the two data sets are not aligned and a period from the security being elaborated do not match the period of the security from the external data declared in the Database. In practise could occur that the current period does not have a corresponding date/time period on the external security. If "By date" is set to True, the function will try to find a corresponding period on the external security by Date/Time and will not try to match just its position.
Default is True. The parameter is ignored when DbValue returns an array.

For Example:

Database Microsoft("Nasdaq", "MSFT", "N")

Function Main()
Dim dMyValue As Numeric
Dim Msclose As Numeric()
Dim MyRsi As Numeric()

dMyValue = DbValue(Close, "Microsoft")

Msclose = DbValue(Close, "Microsoft")

MyRsi = DbValue(Rsi(Close, 14), "Microsoft")

EndFunction

The line:

Database Microsoft("Nasdaq", "MSFT", "N")

open a database named "Microsoft" assigning to it security data contained on the workgroup "Nasdaq" for the symbol "MSFT". Data have normal compression "N".

The line:

dMyValue = DbValue(Close, "Microsoft")

assigns the close value of Microsoft for the current date/time to the numeric variable dMyValue

The line:

dMyValue = DbValue(Close, "Microsoft", False)

assigns the close value of Microsoft for the position of the current period to the numeric variable dMyValue

The line:

Msclose = DbValue(Close, "Microsoft")

assigns Microsoft close array to the numeric array Msclose

The line:

MyRsi = DbValue(Rsi(Close, 14), "Microsoft")

assigns the array of the RSI indicator calculated on the Microsoft close to the numeric array MyRsi

Another example:

To see if the external Microsoft security for the data being elaborated has a RSI value grater than 70 we could write:

If (DbValue(Rsi(Close, 14), "Microsoft") > 70) Then



It is possible to calculate any numeric expression using the external data set with the standard function:

DbExp (Expression, "Database Name", By date (optional))

which returns the value of Expression calculated based on the security specified on the database declaration

and where:

Expression is any numerical expression

Database Name is the name of the previously declared database which is used to calculate the Expression

By date defines if the numeric value is being calculated based on the current period date or not.
By date will avoid to obtain wrong values. It could happen that the two data sets are not aligned and a period from the security being elaborated do not match the period of the security from the external data declared in the Database. In practise could occur that the current period does not have a corresponding date/time period on the external security. If "By date" is set to True, the function will try to find a corresponding period on the external security by Date/Time and will not try to match just its position. The default is True.

For Example:

The line:

dMyValue = DbExp((High - Close) * 2 - Rsi(Close, 14), "Microsoft")

assign the value of (High - Close) * 2 - Rsi(Close, 14), calculated using Microsoft data for the date/time period being elaborated, to the dMyValue numeric variable

Contact us    Collaboration
TraderSoft s.r.l. 2003-2010 - P.Iva 03808860286 - Copyright