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
If, Then ... Else

The keyword If allows to choose which part of the code to execute depending on the test condition which can be True or False This could be translated in natural language as "if this happens, then execute this part of the code, else execute the other".

Let see how is the syntax of this instruction:

If Expression Then
    ...
    "Block of THEN instructions " executed if Expression = True
    ...
Else
    ...
    "Block of ELSE instructions " executed if Expression = False
    ...
EndIf

"Expression" evaluates to a Boolean value. The result must be either True or False. If Expression is True, the code identified as "Block of THEN instructions" will be executed. If Expression is False, the code identified as "Block of ELSE instructions" will be executed. In practice only the following could be written:

If Expression Then
    ...
    "Block of THEN instructions"
    ...
EndIf

In this case if Expression is False no code will be executed.

Of course inside these block of code, there could be other If instructions. These are called Nested control structures, when a If keyword is inside another THEN or ELSE block, like in this example.


If Expression1 Then
    If Expression2 Then
    ...
Else    
    ...
    Endif
Else
    if Expression3 Then
    ...
    Endif
Endif

In theory there is no limit of the number of nested instructions, but it is suggested to keep it as simple as possible, for code readability if nothing else.

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