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
Array

The situation is handled differently when there are arrays. An array can be seen as a set of elements where each one of them is identify be a name (the same for all) and an index. This is not intended to be a deep mathematical discussion. We will try to explain some principles of the subject in a very simple way.

So, an array can be seen as a group of elements with the same name. In order to access a specific element, it is necessary to know its index which will identify it uniquely.

In this Programming language an array is treated as any other variable, the only difference is the use of the index to identify the element to use.

An array must be declared as such before it can be used, and the syntax is very similar to the one used for the other variables:

Dim "array name" As "array type"() = "default"

Let's see and example:

Dim MyArray As Numeric() = 10

The only difference compared with simple variables is the use of parenthesis "()" after the variable type declaration. This simple symbol will tell the command interpreter that the variable being declared has to be treated as an array.

In this example the default value is "10". This means that all elements value will have value of 10 if no otherwise specified.

NB An array is initialized the first time anyone of its elements is used. If it is never used, it will not be initialized. The reason as something to do with the dynamic dimensioning of array.

In many programming languages when declaring the arrays it is necessary to specify also the number of element they will have.

Not here, the dimensioning will happen automatically. If you want to access the element in the position 16 and assign to it a value of 9, there is no need to actually make sure the array has 16 elements, it would be enough to write the following :

MyArray(16) = 9

It will be the command interpreter to size correctly the array to have 16 elements.

NB Of course the index of an array cannot be a negative number. If for any reason the index is negative, is will be set automatically to zero. Therefore MyArray(-1) will be interpreted as MyArray(0).

Very Important:

A function can return an array result. There is only one thing to keep in mind. It as to be told to the interpreter, the result is going to be an array.

The symbol "()" it is used after the indication of the function type:

Function "function name" ( "arg 1" as "arg type" , "arg 2" as "arg type" , ...) as "function Type" ()

Let's see and example:

Function MC (PP As Numeric, UP As Numeric) As Numeric()

This function could be give the value of an array in the calling function:

MyArray() = MC(1, 10)
Notes on valorization between arrays:

To an operation like the following :

MyArray1() = MyArray2()

there are a few things to take into account. Let's suppose that the declaration of MyArray2() was done as follows:

Dim MyArray2 As Numeric() = 10

If the operation of assigning MyArray2() to MyArray1() is done before any other use of MyArray2() then MyArray1() is an empty array with no elements. This because the command interpreter has never accessed MyArray2() and did not initialized it or dimensioned it. In case of a situation like the one above, there is the need to initialize MyArray2() unless the aim is to assign MyArray1() to an empty array.

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