Difference between revisions of "Begin"

From MultiCharts
Jump to navigation Jump to search
Line 12: Line 12:
  
 
Where: [[CS]] - conditional statement
 
Where: [[CS]] - conditional statement
            I - conditional instructions
+
 
 +
I - conditional instructions
  
 
==== Example ====
 
==== Example ====

Revision as of 12:30, 20 January 2012

Used in combination with End to group instructions for conditional execution; a Begin must always be followed by an End. Begin and End can be used with Then, Else, For, and While conditional statements.

Begin should not be followed by a semicolon (;), code lines within an instruction group should end with a semicolon (;), and only the last instance of End within the same conditional execution statement should be followed by a semicolon (;).

Usage

CS Begin
I1;
I2;
I3;
End;

Where: CS - conditional statement

I - conditional instructions

Example

If UpTrend is true then buy, otherwise sell short:

If UpTrend Then Begin
Buy Next Bar Market;
End
Else Begin
SellShort Next Bar Market;
End;