<?xml version="1.0"?>
<dictionary>
  tag=MetaQuotesLanguage
  caption=MetaQuotes Language 4
  lang_params=Parameters:
  lang_sample=Sample:

  <styles>
  *           { font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size:1em; }
  body        { margin-top: 3px; margin-bottom: 3px; padding-left: 3px; padding-right: 3px; margin: 3px; padding: 3px; background-color:#fbfbfc; color:#626363; font-size:0.8em; }
  div, p      { margin:0px; padding: 0px; }
  p           { margin-bottom: 12px; }
  ul          { list-style-type: square; }
  a           { color:#42639C; }
  
  td.l_smb    { font: 12pt Wingdings; }
  td.d_smb    { font: 12pt Wingdings;background: #E8E8FF; }
  td.l_code   { border-right: 1px #a8afaa solid; }
  td.d_code   { border-right: 1px #a8afaa solid;background: #e8e8ff; }
  td.d_code_e { background: #e8e8ff; }
  table.symbols{font-family: tahoma; font-size: 8pt; border: thin solid #a8afaa;}
  
  .docmenu    { width:200px; margin-right:15px; border-right:1px solid #DADADA; background-color:#f6f9fd; padding-left:10px; padding-right:10px; margin-bottom:5px; }
  .doctext    { margin-right:15px; padding-left:10px; padding-right:0px; margin-bottom:5px; padding-bottom:10px; padding-top:6px; }
  .docnav     { clear:both; width:100%; text-align:right; padding-top:4px; border-top:1px solid #DADADA; }
  .docfunc    { color: #8A2BE2; }
  .doctable   { border-top:1px solid #DADADA;  }
  .docvar     { font-family: monospace; font-size: 10pt; font-weight:bold; margin-bottom: 4pt; }
  .doctabhdr  { font-weight:bold; padding: 0pt 4pt 0pt 0pt; margin: 8pt 2pt 2pt 2pt;  }
  .docmql4    { font-family: monospace; background-color: #F6F9FC; border: 1px #d8dfea solid; padding: 2pt 2pt 2pt 2pt; margin: 2pt 0pt 2pt 15pt; font-family: monospace; }
  .docparams  { background-color: #F6F9FC; border: 1px #d8dfea solid; font-family: Tahoma; font-size: 9pt; margin-left: 15pt; }
  .docenums    { background-color: #F6F9FC; border-top: 1px #d8dfea solid; border-left: 1px #d8dfea solid; font-family: Tahoma; font-size: 9pt; margin-left: 15pt; width: 95%; }
  .docenums th { vertical-align: top; background-color: #d8dfea; border-bottom: 1px #d8dfea solid; border-right: 1px #d8dfea solid;font-family: Tahoma; font-size: 9pt; }
  .docenums td { vertical-align: top; background-color: #F6F9FC; border-bottom: 1px #d8dfea solid; border-right: 1px #d8dfea solid;font-family: Tahoma; font-size: 9pt; }
  </styles>

  <group>
    tag=index
    caption=MQL4 Reference

    <content>
      <p>MetaQuotes Language 4 (MQL4) is a new built-in language for programming of trading
      strategies. This language allows to create your own Expert Advisors that make
      trading management automated and are perfectly suitable for implementing of one's
      own trade strategies. Besides, one can use MQL4 for creation of one's own Custom 
      Indicators, Scripts, and Libraries. You can start learning the language using Sergey Kovalyov's book named 
      <i>Programming in Algorithmic Language MQL4</i> published and supported by 
      <a target="_blank" href="http://www.metaquotes.net/?source=metaeditor_help">MetaQuotes Software Corp.</a>
      You can download the Book in .chm format at: <a href="http://www.mql4.com/files/mql4bookenglish.chm?source=metaeditor_help">http://www.mql4.com/files/mql4bookenglish.chm</a> (size 2.0 Mb).</p>
      
      <p>A large amount of functions necessary for analysis of the current and 
      previously income quotes, as well as basic arithmetic and logic operations are included in MQL4 
      structure. There are also basic indicators built in and commands of order 
      placement and control.</p>
      
      <p>The MetaEditor 4 (text editor) that highlights different constructions of MQL4 
      language is used for writing the program code. It helps users to orientate themselves in 
      the expert system text quite easily. We use MetaQuotes Language Dictionary as a Help System for MQL4 language. 
      An abridged guide contains functions divided into categories, operations, reserved words, and other language 
      constructions and allows finding the description of every element we use.</p>
      
      <p>Programs written in MetaQuotes Language 4 have different features and purposes:</p>
      <ul><li><p>
          <strong>Expert Advisor</strong> is a mechanical trading system (MTS) linked up to a certain chart. 
          An Advisor starts to run with every incoming tick for a given symbol. The Advisor will not be launched for a new, 
          tick if it is processing the previous one at this moment (i.e., the Advisor has not completed its operation yet).
          The Advisor can both inform you about a possibility to trade and trade at an account automatically sending orders 
          directly to the trade server. Like most trading systems, the terminal supports testing strategies on history data 
          with displaying trading in-and-out points in the chart.<br/>
          Experts are stored in <em>terminal_directory\experts</em>.</p></li>
        <li><p><strong>Custom Indicator</strong> is a technical indicator written independently in addition to those 
          already integrated into the client terminal. Like built-in indicators, they cannot trade automatically 
          and are intended for implementing of analytical functions only.<br/>
          Custom Indicators are stored in <em>terminal_directory\experts\indicators</em>.</p></li>
        <li><p><strong>Script</strong> is a program intended for a single execution of some actions. Unlike 
          Expert Advisors, Scripts are not run tickwise, but on request.<br/>
          Scripts are stored in <em>terminal_dictionary\experts\scripts</em>.</p></li>
        <li><p><strong>Library</strong> is a set of custom functions containing programs most frequently used. Libraries cannot start execution by itself.<br/>
          Libraries are recommended to be stored in <em>terminal_directory\experts\libraries</em>.</p></li>
        <li><p><strong>Included file</strong> is a source text of the most frequently used blocks of custom programs. 
          Such files can be included into the source texts of experts, scripts, custom indicators, and libraries at the compiling stage. 
          The use of included files is more preferable than the use of libraries because of additional burden occurring 
          at calling library functions.<br/>
          Included files are recommended to be stored in <em>terminal_directory\experts\include</em></p></li>
      </ul>
    </content>
    
  <group>
    tag=basis
    caption=Basics
    
    <content>
      <p>MetaQuotes Language 4 (MQL4) is a new integrated language for programming of trading strategies.
      This language allows users writing of their own programs (Expert Advisors) that automate trading management  
      and ideally suit for implementing of their own trading strategies. Besides, one can create one's own technical
      indicators (Custom Indicators), scripts, and libraries in MQL 4.</p>
    </content>
    
  <group>
    tag=basis_syntax
    caption=Syntax

    <content>
      <p>Syntax of MQL4 is much a C-like syntax, apart from some features:</p>
      <ul><li><p>no address arithmetic;</p></li>
      <li><p>no operator do ... while;</p></li>
      <li><p>no operator goto ...;</p></li>
      <li><p>no operation of [condition]?[expression 1]:[expression 2];</p></li>
      <li><p>no compound data types (structures);</p></li>
      <li><p>complex assignments are impossible; for example, val1=val2=0; arr[i++]=val; cond=(cnt=OrdersTotal)>0; etc.;</p></li>
      <li><p>calculation of a logical expression is always completed, never early terminated.</p></li>
      </ul>
    </content>
    
    <text>
      tag=basis_syntax_comments
      caption=Comments
      <content>
        <p>Multiline comments start with /* symbols and end with */ symbols. Such comments cannot be nested. Single 
        comments start with // symbols, end with the symbol of a new line and can be nested into multiline comments. Comments are 
        allowed where blank spaces are possible and tolerate any number of spaces.</p>
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">
// single comment

/*  multi-     
    line         // nested single comment
    comment 
*/</pre>
      </content>
    </text>

    <text>
      tag=basis_syntax_identifiers
      caption=Identifiers
      <content>
        <p>Identifiers are used as names of variables, functions, and data types.
        The length of an identifier cannot exceed 31 character.</p>
        <p>Symbols you can use: numbers from 0 to 9, Latin capital and small letters a to z, A to Z 
        (recognized as different symbols), the symbol of underlining (_). The first symbol cannot be 
        a number. The identifier must not coincide with any reserved word.</p>
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">NAME1 namel Total_5 Paper</pre>
      </content>
    </text>

    <text>
      tag=basis_syntax_reserved
      caption=Reserved words
      <content>
        <p>The identifiers listed below are fixed reserved words. A certain action is assigned to each 
        of them, and they cannot be used for other purposes:</p>
        
        <table cellspacing="0" cellpadding="4" border="0" class="docenums">
        <tr><th width="25%">Data types</th><th width="25%">Memory classes</th><th width="25%">Operators</th><th width="25%">Other</th></tr>
        <tr><td>bool</td><td>extern</td><td>break</td><td>false</td></tr>
        <tr><td>color</td><td>static</td><td>case</td><td>true</td></tr>
        <tr><td>datetime</td><td>&nbsp;</td><td>continue</td><td>&nbsp;</td></tr>
        <tr><td>double</td><td>&nbsp;</td><td>default</td><td>&nbsp;</td></tr>
        <tr><td>int</td><td>&nbsp;</td><td>else</td><td>&nbsp;</td></tr>
        <tr><td>string</td><td>&nbsp;</td><td>for</td><td>&nbsp;</td></tr>
        <tr><td>void</td><td>&nbsp;</td><td>if</td><td>&nbsp;</td></tr>
        <tr><td>&nbsp;</td><td>&nbsp;</td><td>return</td><td>&nbsp;</td></tr>
        <tr><td>&nbsp;</td><td>&nbsp;</td><td>switch</td><td>&nbsp;</td></tr>
        <tr><td>&nbsp;</td><td>&nbsp;</td><td>while</td><td>&nbsp;</td></tr>
        </table>
      </content>
    </text>
    </group>


    <group>
      tag=basis_types
      caption=Data types

    <content>
      <p>Any program operates with data. Data can be of different types depending on their purposes. For example,
      integer data are used to access to array components. Price data belong to those of double precision with floating point.
      This is related to the fact that no special data type is foreseen for price data in MQL 4.</p>
      <p>Data of different types are processed with different rates. Integer data are processed at the fastest.
      To process the double precision data, a special co-processor is used. However, because of complicity of internal presentation
      of data with floating point, they are processed slower than the integer ones. String data are processed at the longest because of 
      dynamic computer memory allocation/reallocation.</p>
      <p>The main data types are:</p>
      <ul><li><a href="help://basis_types_integer">Integer (int)</a></li>
          <li><a href="help://basis_types_bool">Boolean (bool)</a></li>
          <li><a href="help://basis_types_literal">Literals (char)</a></li>
          <li><a href="help://basis_types_string">Strings (string)</a></li>
          <li><a href="help://basis_types_double">Floating-point number (double)</a></li>
          <li><a href="help://basis_types_color">Color (color)</a></li>
          <li><a href="help://basis_types_datetime">Date and time (datetime)</a></li>
      </ul>
      <p>The <em>color</em> and <em>datetime</em> types make sense only to facilitate visualization 
      and enter those parameters that had been set from expert advisor property tab or custom indicator 
      &quot;Inputs&quot; tab. The data of <em>color</em> and <em>datetime</em> types are represented 
      as integer values. <em>int</em> and <em>double</em> are called arithmetic (numeric) types.</p>
      <p>Only implicit <a href="help://basis_types_casting">type casting</a> is used in <a href="help://basis_operations_expression">expressions</a>.</p>
    </content>

    <text>
      tag=basis_types_casting
      caption=Type casting
      <content>
        <p>Only implicit type casting is used in MQL 4 <a href="help://basis_operations_expression">expressions</a>. The type priority grows at casting:</p>
        <pre class="docmql4">
int  (bool,color,datetime);
double;
string;</pre>
        <p>Before operations (except for the assignment ones) are performed,  the data have been conversed 
        into the maximum priority type. Before assignment operations are performed, the data have been cast into the target type.</p>
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">
int    i = 1 / 2;     // no types casting, the result is 0
int    i = 1 / 2.0;   // the expression is cast to the double type, then is to the target type of int, the result is 0
double d = 1.0 / 2.0; // no types casting, the result is 0.5
double d = 1 / 2.0;   // the expression is cast to the double type that is the same as the target type, the result is 0.5
double d = 1 / 2;     // the expression of the int type is cast to the target type of double, the result is 0.0
string s = 1.0 / 8;   // the expression is cast to the double type, then is to the target type of string, the result is &quot;0.12500000&quot; (the string containing 10 characters)
string s = NULL;      // the constant of type int is cast to the target type of string, the result is &quot;0&quot; (the string containing 1 character)
string s = &quot;Ticket #&quot;+12345; // the expression is cast to the string type that is the same as the target type, the result is &quot;Ticket #12345&quot;
</pre>
        <p>Type casting is applied to not only constants, but also <a href="help://basis_variables">variables</a> of corresponding types.</p>
      </content>
    </text>

    <text>
      tag=basis_types_integer
      caption=Integer constants
      keywords=;int;
      <content>
        <p>Decimals: numbers from 0 to 9; zero must not be the first number.</p>
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">12, 111, -956 1007</pre>
        
        <p>Hexadecimals: numbers from 0 to 9, letters from a to f or A to F to represent the values 10 to 15; 
        they start with 0x or 0X.</p>
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">0x0A, 0x12, 0X12, 0x2f, 0xA3, 0Xa3, 0X7C7</pre>
        
        <p>Its internal representation is a long 4-byte integer number. Integer constants can assume values from -2147483648 to 2147483647. 
      If the constant exceeds this range, the result is undefined.</p>
      </content>
    </text>

    <text>
      tag=basis_types_literal
      caption=Literal constants
      <content>
        <p>Any single character enclosed in single quotes or a hexadecimal ASCII-code of a character looking 
        like '\x10' is a character constant of integer type. Some characters like a single quote ('), double quote 
        (&quot;) a question mark (?), a reverse slash (\), and control characters can be represented as a combination of 
        characters starting with a reverse slash (\) according to the table below:</p>
        <pre class="docmql4">line feed                NL (LF)  \n
horizontal tab           HT       \t
carriage return          CR       \r
reverse slash            \        \\
single quote             '        \'
double quote             "        \"
hexadecimal ASCII-code   hh      \xhh</pre>

        <p>If a character different from those listed above follows the reverse slash, the result will not be defined:</p>
        <pre class="docmql4">int a = 'A';
int b = '$';
int c = '&#xA9;'; // code 0xA9
int d = '\xAE';   // symbol code &#xAE;</pre>
        
   <p>Its internal representation is a long 4-byte integer number. Literal constants can assume values from 0 to 255. 
   If the constant exceeds this given range, the result is undefined.</p>
    </content>
    </text>
    
   <text>
      tag=basis_types_bool
      caption=Boolean constants
      keywords=;bool;true;false;
      <content>
        <p>Boolean constants may have the value of true or false, numeric representation of them is 1 or 0, 
        respectively. True or TRUE, False or FALSE can be used, as well.</p>
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">bool a = true;
bool b = false;
bool c = 1;</pre>
        <p>Its internal representation is a long 4-byte integer number. Boolean constants can assume the values of 0 or 1.</p>
      </content>
    </text>

    <text>
      tag=basis_types_double
      caption=Floating-point number constants (double)
      keywords=;double;
      <content>
        <p>Floating-point constants consist of an integer part, a point (.), and a fractional part. The integer 
        and the fractional parts represent sequences of decimal numbers.</p>
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">double a = 12.111;
double b = -956.1007;
double c = 0.0001;
double d = 16;</pre>
        <p>Its internal representation is a double-precision number of 8 bytes. Floating-point constants can assume values from -1.7 * e-308 to 1.7 * e308. If a 
        constant exceeds this range, the result is undefined.</p>
      </content>
    </text>

    <text>
      tag=basis_types_string
      caption=String constants
      keywords=;string;
      <content>
        <p>String constant is a sequence of ASCII-code characters enclosed in double quotes: &quot;Character constant&quot;.</p>
        
      <p>A string constant is an array of characters enclosed in quotes. It is of the string type. 
      If there is a need to insert a double quote (&quot;) into the string, a reverse slash (\) must be put before it. 
      Any special <a href="help://basis_types_literal">character constants</a> can be inserted into the string if they have a reverse slash (\) before them. 
      The length of a string constant lies between 0 and 255 characters. 
        If the string constant is longer, the superfluous characters on the right will be rejected, and compiler will alert correspondingly.</p>
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">
"This is a character string"
"Copyright symbol \t\xA9"
"this line contains a line feed symbol \n"
"C:\\Program Files\\MetaTrader 4"
"A" "1234567890" "0" "$"
</pre>
  <p>Its internal representation is a structure of 8 bytes. The first element of the structure is a long integer that contains 
        the size of the buffer distributed for the line. The second element of the structure is 32-order address of the buffer that contains the line.</p>
      </content>
    </text>

    <text>
      tag=basis_types_color
      caption=Color constants
      keywords=;color;
      <content>
<p>Color constants can be represented in three ways: literally, by integers, or by name (for named Web colors only).</p>

<p>Literal representation consists of three parts representing numerical rate values of three main color components: red,
green, blue. The constant starts with C and is enclosed in single quotes. Numerical rate values of a color component lie in the range 
from 0 to 255.</p>

<p>Integer-valued representation is written in a form of hexadecimal or a decimal number. A hexadecimal number looks 
like 0x00BBGGRR where RR is the rate of the red color component, GG - of the green one, and BB - of the blue one. Decimal constants 
are not directly reflected in RGB. They represent a decimal value of the hexadecimal integer representation.</p> 

<p>Specific colors reflect the so-called <a href="help://constants_colors">Web colors set</a>.</p>

<p class="doctabhdr">Examples:</p>
<pre class="docmql4">
// symbol constants
C'128,128,128'    // gray
C'0x00,0x00,0xFF' // blue
// named color
Red
Yellow
Black
// integer-valued representation
0xFFFFFF          // white
16777215          // white
0x008000          // green
32768             // green
</pre>

<p>Its internal representation is a long integer number of 4 bytes. The first byte will not be considered. The other three bytes contain RGB components.</p>
      </content>
    </text>

    <text>
      tag=basis_types_datetime
      caption=Datetime constants
      keywords=;datetime;
      <content>
<p>Datetime constants can be represented as a literal line consisting of 6 parts for values of year, month, 
date, hours, minutes, and seconds. The constant is enclosed in single quotes and starts with D.
Either date (year, month, date) or time (hours, minutes, seconds), or both can be skipped.
Datetime constant can vary from Jan 1, 1970 to Dec 31, 2037.</p>
<p class="doctabhdr">Examples:</p>
<pre class="docmql4">
D'2004.01.01 00:00'     // New Year
D'1980.07.19 12:30:27'
D'19.07.1980 12:30:27'
D'19.07.1980 12'        //equal to D'1980.07.19 12:00:00' 
D'01.01.2004'           //equal to D'01.01.2004 00:00:00'
D'12:30:27'             //equal to D'[compilation date] 12:30:27'
D''                     //equal to D'[compilation date] 00:00:00'</pre>
      
      <p>Its internal representation is a long integer number of 4 bytes. The value represents the amount of seconds  
        elapse from 00:00 Jan 1, 1970.</p>
      </content>
    </text>
  </group>


  <group>
    tag=basis_operations
    caption=Operations &amp; Expressions
    <content>
     Some characters and character sequences are of a special importance. These are so-called operation symbols, for example:
<pre class="docmql4">
+ - * / %     symbols of arithmetic operations
&amp;&amp; ||         symbols of logic operations
= += *=       symbols of assignment operations</pre>
     <p>Operation symbols are used in expressions and have sense when appopriate operands are given them<br/><br/>
     Punctuation marks are emphasized, as well. These are parentheses, braces, comma, colon, and semicolon.<br/><br/>
     Operation symbols, punctuation marks, spaces are used to separate language elements from each other.</p>
    </content>

    <text>
      tag=basis_operations_expression
      caption=Expressions
      <content>
<p>An expression consists of one or more operands and operation characters. An expression can be written in several lines.</p>
<p class="doctabhdr">Examples:</p>
<pre class="docmql4">
a++; b = 10;
x = (y * z) /
    (w + 2) + 127;</pre>
        <p>An expression that ends with a semicolon (;) is an operator.</p>
      </content>
    </text>

    <text>
      tag=basis_operations_math
      caption=Arithmetical operations
      keywords=;+;-;*;/;%;++;--;
      <content>
 <p>Arithmetical operations include additive and multiplicative operations:</p>
 <pre class="docmql4">
Sum of values                           i = j + 2;
Difference of values                    i = j - 3;
Changing the operation sign             x = - x;
Product of values                       z = 3 * x;
Division quotient                       i = j / 5;
Division remainder                      minutes = time % 60;
Adding 1 to the variable value          i++; 
Subtracting 1 from the variable value   k--;
</pre>
<p>The operations of adding/subtracting 1 (increment/decrement) cannot be used in expressions.</p>
<p class="doctabhdr">Examples:</p>
<pre class="docmql4">int a=3;
a++;              // valid expression
int b=(a++)*3;    // invalid expression
</pre>
      </content>
    </text>

    <text>
      tag=basis_operations_assign
      caption=Assignment operation
      keywords=+=;-=;*=;/=;%=;&gt;&gt;=;&lt;&lt;=;&amp;=;|=;^=;
      <content>
        <p>The value of the expression that includes the given operation is the value of the left operand after assignment.</p>
<pre class="docmql4">Assigning the y value to the x variable                   y = x;</pre><br/>
<p>The following operations unite arithmetic or bitwise operations with operation of assignment:</p>

<pre class="docmql4">
Adding x to the y variable                               y += x;
Subtracting x from the y variable                        y -= x;
Multiplying the y variable by x                          y *= x;
Dividing the y variable by x                             y /= x;
Module x value of y                                      y %= x;
Logical shift of y representation to the right by x bit  y &gt;&gt;= x;
Logical shift of y representation to the left by x bit   y &lt;&lt;= x;
Bitwise operation AND                                    y &amp;= x;
Bitwise operation OR                                     y |= x;
Bitwise operation exclusive OR 
of x and y binary notations                              y ^= x;</pre><br/>

 <p>There can be only one operation of assignment in an expression. Bitwise operations are performed with integer 
numbers only. The logical shift operation uses values of x less than 5 binary digits. The greater digits are rejected, 
so the shift is for the range of 0 to 31 bit. By %= operation (y value by module of x), the result sign is equal to the sign of divided number.</p>
      </content>
    </text>

    <text>
      tag=basis_operations_relation
      caption=Operations of relation
      keywords=;==;!=;&lt;;&gt;;&lt;=;&gt;=;
      <content>
<p>The logical value FALSE is represented with an integer zero value, while the logical value TRUE is 
represented with any value differing from zero.<br/>The value of expressions 
containing operations of relation or logical operations is 0 (FALSE) or 1 (TRUE).</p>
<pre class="docmql4">
True if a equals b                        a == b;
True if a does not equal b                a != b;
True if a is less than b                  a &lt; b;
True if a is greater than b               a &gt; b;
True if a is less than or equals b        a &lt;= b;
True if a is greater than or equals b     a &gt;= b;
</pre>
<p>Two unnormalized floating-point numbers cannot be linked by == or != operations. 
That is why it is necessary to subtract one from another, and the <a href="help://convert_NormalizeDouble">normalized</a> 
outcome needs to be compared to null.</p>
      </content>
    </text>

    <text>
      tag=basis_operations_bool
      caption=Boolean operations
      keywords=;||;&amp;&amp;;
      <content>
<p>Operand of logical negation (operation NOT displayed as exclamation mark) must be of arithmetic type. The result equals TRUE (1) if the operand value is FALSE (0); 
and it equals FALSE (0) if the operand differs from FALSE (0).</p>
        <pre class="docmql4">if(!a) Print(&quot;not 'a'&quot;);</pre><br/>

<p>Logical operation OR (||) of x and y values. The expression value is TRUE (1) if x or y value is true (not null).
Otherwise, it is FALSE (0). Logical expressions are calculated completely, i.e., the so-called "short estimate" method does not apply to them.</p>
    <pre class="docmql4">if(x&lt;0 || x&gt;=max_bars) Print(&quot;out of range&quot;);</pre><br/>
   
<p>Logical operation AND (&amp;&amp;) of x and y values. The expression value is TRUE (1) if both x and y values are ture (not null).
Otherwise, it is FALSE (0). </p>
<pre class="docmql4">if(p!=x &amp;&amp; p&gt;y) Print(&quot;TRUE&quot;);</pre>
      </content>
    </text>
      
    <text>
      tag=basis_operations_bit
      caption=Bitwise operations
      keywords=;&lt;&lt;;&gt;&gt;;~;!;^;&amp;;|;
      <content>
<p>Complement of the variable value up to one. The value of the expression contains 1 in all digits where n contains 0, 
and it contains 0 in all digits where n contains 1.</p>
        <pre class="docmql4">b = ~n;</pre><br/>
      
<p>Binary-coded representation of x is shifted to the right by y digits. The right shift is a logical one, 
i.e., the freed left-side bits will be filled with zeros.</p>
        <pre class="docmql4">x = x &gt;&gt; y;</pre><br/>

<p>The binary-coded representation of x is shifted to the right by y digits, the freed digits on the right will 
be filled with zeroes.</p>
        <pre class="docmql4">x = x &lt;&lt; y;</pre><br/>

<p>Bitwise operation AND of binary-coded x and y representations. The value of the expression contains 1 (TRUE) 
in all digits where both x and y do not contain zero; and it contains 0 (FALSE) in all other digits.</p>
        <pre class="docmql4">b = ((x &amp; y) != 0);</pre><br/>

<p>Bitwise operation OR of binary-coded x and y representations. The expression value contains 1 in all digits 
where x or y is not equal to 0, and it contains 0 in all other digits.</p>
        <pre class="docmql4">b = x | y;</pre><br/>

<p>Bitwise operation EXCLUSIVE OR of binary-coded x and y representations. The expression value contains 1 
in all digits where x and y have different binary values, and it contains 0 in all other digits.</p>
        <pre class="docmql4">b = x ^ y;</pre><br/>

        <p>Bitwise operations are executed with integers only.</p>
      </content>
    </text>

    <text>
      tag=basis_operations_other
      caption=Other operations
      <content>
<p><b>Indexing</b><br/>
At addressing to the i-th element of array, the expression value is the value of the variable with serial number of i.</p>
<p class="doctabhdr">Example:</p>
<pre class="docmql4">array[i] = 3; //Assign the value of 3 to the i-th element of the array.</pre><br/>

<p>Only an integer can be index of an array. Four-dimensional and below arrays are allowed. Each measurement is 
        indexed from 0 to <b>measurement size</b>-1. In particular case, for a one-dimensional array consisting of 50 elements,  
        the reference to the first element will look like array[0], that to the the last element will array[49].</p>

        <p>At access beyond the array, the executing subsystem will generate the error of <a href="help://constants_errors">ERR_ARRAY_INDEX_OUT_OF_RANGE</a> 
        that can be got through the <a href="help://check_GetLastError">GetLastError()</a> function.</p>

<p><b>Call for function with x1,x2,...,xn arguments.</b><br/>
Each argument can represent a constant, a variable, or an expression of the corresponding type. The arguments passed are separated by commas and must
be inside of parentheses, the opening parenthesis to follow the name of the called function.<br/><br/>
The expression value is the value returned by the function. If the returned value is of the void type, such function call cannot be 
placed to the right in the assignment operation. Please make sure that the expressions x1,x2,...,xn are executed exactly in this order.</p>
<p class="doctabhdr">Example:</p>
        <pre class="docmql4">double SL=Bid-25*Point;
int    ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,SL,Ask+25*Point,"My comment",123,0,Red);</pre><br/>
 

<p><b>Comma operation</b><br/>
Expressions separated by commas are executed from left to right. All side effects of the left expression calculation can 
appear before the right expression is calculated. The result type and value coincide with those of the right expression. The list 
of parameters to be passed (see above) can be considered as an example.</p>
        <p class="doctabhdr">Example:</p>
        <pre class="docmql4">for(i=0,j=99; i&lt;100; i++,j--) Print(array[i][j]);</pre>
      </content>
    </text>
   
    <text>
      tag=basis_operations_rules
      caption=Precedence rules
      <content>
<p>Each group of operations in the 
table has the same priority. The higher is the priority, the higher is the position of the group in the table. 
The precedence rules determine the grouping of operations and operands.</p>
<pre class="docmql4">
()     Function call                     From left to right
[]     Referencing to an array element
</pre>
<pre class="docmql4">
!      Logical negation                  From right to left
-      Sign changing operation
++     Increment
--     Decrement
~      Bitwise negation (complement)
</pre>
<pre class="docmql4">
&amp;      Bitwise operation AND             From left to right
|      Bitwise operation OR
^      Bitwise operation exclusive OR
&lt;&lt;     Left shift
&gt;&gt;     Right shift
</pre>
<pre class="docmql4">
*      Multiplication                    From left to right
/      Division
%      Module division
</pre>
<pre class="docmql4">
+      Addition                          From left to right
-      Subtraction
</pre>
<pre class="docmql4">
&lt;      Less than                         From left to right
&lt;=     Less than or equal
&gt;      Greater than
&gt;=     Greater than or equal
==     Equal                        
!=     Not equal
</pre>
<pre class="docmql4">||     Logical OR                        From left to right</pre>
<pre class="docmql4">&amp;&amp;     Logical AND                       From left to right</pre>

<pre class="docmql4">
=      Assignment                        From right to left
+=     Assignment addition
-=     Assignment subtraction
*=     Assignment multiplication
/=     Assignment division
%=     Assignment module
&gt;&gt;=    Assignment right shift
&lt;&lt;=    Assignment left shift
&amp;=     Assignment bitwise AND
|=     Assignment bitwise OR
^=     Assignment exclusive OR
</pre>
<pre class="docmql4">,      Comma                             From left to right</pre><br/>
<p>Parentheses that have higher priority are applied to change the execution order of the operations.<br/>
        <b>Attention:</b> Priority of performing operations in MQL4 differs to some extent from that conventional in the C language.</p>
      </content>
    </text>
  </group>



  <group>
    tag=basis_operators
    caption=Operators
    <content>
<p>Language operators describe some algorithmic operations that must be executed to accomplish a task. The program
body is a sequence of such operators. Operators following one by one are separated with a semicolon.<br/><br/>
One operator can occupy one or several lines. Two or more operators can be located in the same line. Operators 
that control over the execution order (if, if-else, switch, while and for) can be nested into each other.</p>
<p class="doctabhdr">Example:</p>
        <pre class="docmql4">
if(Month() == 12)
  if(Day() == 31) Print("Happy New Year!");</pre>
    </content>
   
    <text>
      tag=basis_operators_compound
      caption=Compound operator
      <content>
<p>A compound operator (a block) consists of one or more operators of any type enclosed in braces {}. The closing 
brace must not be followed by a semicolon (;).</p>
        <p class="doctabhdr">Example:</p>
        <pre class="docmql4">if(x==0)
  {
   Print("invalid position x=",x);
   return; 
  }</pre>
      </content>
    </text>

    <text>
      tag=basis_operators_expression
      caption=Expression operator
      <content>
       <p>Any expression followed by a semicolon (;) is an operator. Here are some examples of expression operators:</p>
       <p><b>Assignment operator</b>:</p>
       <pre class="docmql4"><i>Identifier=expression;</i>

x=3;
y=x=3; // error</pre>
      <p>Assignment operator can be used in an expression only once.</p>
      <p><b>Function call operator</b>:</p>
      <pre class="docmql4"><i>Function_name(argument1,..., argumentN);</i>
           
  FileClose(file);</pre><br/>

        <p><b>Empty operator</b><br/>
        It consists of a semicolon (;) only and used to denote a null body of a control operator.</p>
      </content>
    </text>

    <text>
      tag=basis_operators_break
      caption=Break operator
      keywords=;break;
      <content>
<p>A <em>break</em> operator terminates the execution of the nearest nested outward 
<a href="help://basis_operators_switch"><em>switch</em></a>, <a href="help://basis_operators_while"><em>while</em></a>, or  
<a href="help://basis_operators_for"><em>for</em></a> operator. The control is given to the operator that follows the terminated one. 
One of the purposes of this operator is to finish the looping execution when a certain value is assigned to a variable.</p>

<p class="doctabhdr">Example:</p>
<pre class="docmql4">// searching for the first zero element
for(i=0;i&lt;array_size;i++) 
  if((array[i]==0) 
    break;</pre>
      </content>
    </text>

    <text>
      tag=basis_operators_continue
      caption=Continue operator
      keywords=;continue;
      <content>
<p>A <em>continue</em> operator gives control to the beginning of the nearest outward cycle 
<a href="help://basis_operators_while"><em>while</em></a> or <a href="help://basis_operators_for"><em>for</em></a> operator,  
the next iteration being called. The purpose of this operator is opposite to that of <a href="help://basis_operators_break"><em>break</em></a> operator.</p>
<p class="doctabhdr">Example:</p>
<pre class="docmql4">// summary of nonzero elements of array
int func(int array[])
  {
   int array_size=ArraySize(array);
   int sum=0;
   for(int i=0;i&lt;array_size; i++)
     {
      if(a[i]==0) continue;
      sum+=a[i]; 
     }
   return(sum);
  }</pre>
      </content>
    </text>

    <text>
      tag=basis_operators_return
      caption=Return operator
      keywords=;return;
      <content>
<p>A <em>return</em> operator terminates the current function execution and returns the control to the calling program.
A <em>return(expression);</em> operator terminates the current function execution with result transmission. The operator expression 
must be enclosed in parentheses and should not contain an assignment operator.</p>
<p class="doctabhdr">Example:</p>
<pre class="docmql4">int CalcSum(int x, int y)
  {
   return(x+y);
  }</pre><br/>
  <p>In functions with the value of void type to be returned, the <em>return</em> operator must be used without the expression:</p>
        <pre class="docmql4">void SomeFunction()
  {
   Print("Hello!");
   return;    // this operator can be deleted
  }</pre>
        <p>The right brace of the function means implicit execution of the <em>return</em> operator without expression.</p>
      </content>
    </text>

    <text>
      tag=basis_operators_if
      caption=Conditional operator if-else
      keywords=;else;
      <content>
        <p>If the expression is true, operator1 is executed and the control is given to the operator that follows 
      operator2 (operator2 is not executed). If the expression is false, operator2 is executed.</p>
        <pre class="docmql4"><i>if (expression)
     operator1
else
     operator2</i></pre><br/>

        <p>The <em>else</em> part of the <em>if</em> operator can be omitted. Thus, a divergence may appear in nested 
      <em>if</em> operators with omitted <em>else</em> part. In this case, <em>else</em> addresses to the nearest previous 
        <em>if</em> operator in the same block that has no <em>else</em> part.</p>

        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">//   The else part refers to the second if operator:

  if(x&gt;1)
  if(y==2) z=5;
  else     z=6;
<br/>
//   The else part refers to the first if operator:
if(x&gt;l)
  {
   if(y==2) z=5;
  }
else        z=6;
<br/>

//   Nested operators 
if(x=='a')
  {
   y=1;
  }
else if(x=='b')
  {
   y=2;
   z=3;
  }
else if(x=='c')
  {
   y = 4;
  }
else Print(&quot;ERROR&quot;);</pre>
      </content>
    </text>

    <text>
      tag=basis_operators_switch
      caption=Switch operator
      keywords=;switch;case;default;
      <content>
       <p>It compares the expression value with constants in all variants of <em>case</em> and gives control to the 
      operator that corresponds with the expression value. Each variant of the <em>case</em> can be marked with an integer or 
      literal constant or with a constant expression. The constant expression cannot contain variables or function calls.
      Expression of the <em>switch</em> operator must be of integer type.</p>
        <pre class="docmql4"><i>switch(expression)
  {
   case constant: operators
   case constant: operators
     ...
   default: operators
  }</i></pre><br/>
  
<p>Operators connected with the <em>default</em> label are executed if none of the constants in <em>case</em> 
operators equals the expression value. The <em>default</em> variant must not be necessarily final. If none of the constants 
corresponds to the expression value and the <em>default</em> variant is not available, no actions are executed. The keyword 
<em>case</em> and the constant are just labels, and if operators are executed for some <em>case</em> variant, the program will 
further execute the operators of all following variants until <a href="help://basis_operators_break"><em>break</em></a> operator occurs. 
It makes it possible to bind a subsequence of operators with several variants.</p> 

<p>A constant expression is calculated during compilation. No two constants in one <em>switch</em> operator can have 
the same values.</p>

<p class="doctabhdr">Example:</p>
<pre class="docmql4">switch(x) 
  { 
   case 'A':
      Print(&quot;CASE A&quot;);
      break;
   case 'B':
   case 'C':
      Print(&quot;CASE B or C&quot;);
      break;
   default:
      Print(&quot;NOT A, B or C&quot;);
      break;
  }</pre>
      </content>
    </text>

    <text>
      tag=basis_operators_while
      caption=Cycle operator while
      keywords=;while;
      <content>
        <p>If the expression is true, the operator is executed until the expression becomes false. If the expression 
      is false, the control will be given to the next operator.</p>
        <pre class="docmql4"><i>while(expression) 
  operator;</i></pre><br/>
        <p>An expression value has been defined before the operator is executed. Therefore, if the expression is false 
      from the very beginning, the operator will not be executed at all.</p>
        <p class="doctabhdr">Example:</p>
        <pre class="docmql4">while(k&lt;n) 
  {
   y=y*x; 
   k++;
  }</pre>
      </content>
    </text>
      
    <text>
      tag=basis_operators_for
      caption=Cycle operator for
      keywords=;for;
      <content>
        <p><em>Expression1</em> describes the cycle initialization. <em>Expression2</em> is the conditional test for the cycle 
      termination. If it is true, the loop body <em>for</em> operator will be executed. The cycle repeats until <em>Expression2</em> 
      becomes false. If it is false, the cycle will be terminated, and the control will be given to the next operator. <em>Expression3</em> 
      is calculated after each iteration.</p>
      <pre class="docmql4"><i>for (Expression1; Expression2; Expression3)
   operator;</i></pre><br/>
   
        <p>The <em>for</em> operator is equivalent to the following succession of operators:</p>
        <pre class="docmql4"><i>Expression1;
while(Expression2)
  {
   operator;
   Expression3;
  };</i></pre><br/>
  
        <p>Any of the three or all three expressions can be absent in the <em>for</em> operator, but the semicolons (;) that 
separate them must not be omitted. If Expression2 is omitted, it is considered constantly true. The <em>for</em> (;;) operator is a 
continuous cycle equivalent to the <em>while(1)</em> operator. Either expression 1 or 3 can consist of several expressions combined by a comma operator ','.</p>

        <p class="doctabhdr">Examples:</p>
<pre class="docmql4">for(x=1;x&lt;=7;x++) Print(MathPower(x,2));<br/>
for(;;)
  {
   Print(MathPower(x,2));
   x++;
   if(x>10) break;
  }<br/>
for(i=0,j=n-l;i&lt;n;i++,j--) a[i]=a[j];</pre>
      </content>
    </text>
  </group>


  <group>
    tag=basis_functions
    caption=Functions
    <content>
      <p>Function is a named part of a program that can be called from other parts of the program so many times as 
      it is necessary. It consists of type definition for the value to be returned, name, formal parameters, and a composite operator  
      (block) of actions to be performed. Amount of passed parameters is limited and cannot exceed 64.</p>
      <p class="doctabhdr">Example:</p>
<pre class="docmql4">double                       // type of value to be returned
linfunc (double x, double a, double b) // function name and parameters list
{
                             // composite operator
   return (a + b);           // returned value
 }</pre>
 
      <p>The "return" operator can return the value of the expression included into this operator. If necessary, the 
      expression value can be transformed into the type of function result. A function that does not return values must be of "void" type.</p>
      <p class="doctabhdr">Example:</p>
<pre class="docmql4">
void errmesg(string s)
  {
   Print(&quot;error: &quot;+s);
  }</pre>

        <p>Parameters to be passed to the function can have default values that are defined by constants of the appropriate type.</p>
        <p class="doctabhdr">Example:</p>
        <pre class="docmql4">
int somefunc(double a, double d=0.0001, int n=5, bool b=true, string s="passed string")
  {
   Print(&quot;Required parameter a=&quot;,a);
   Print(&quot;The following parameters are transmitted: d=&quot;,d,&quot; n=&quot;,n,&quot; b=&quot;,b,&quot; s=&quot;,s);
   return (0);
  }</pre>
        <p>If the default value was assigned to a parameter, all follow-up parameters must have the default value, too.</p>
        <p class="doctabhdr">Example of a wrong declaration:</p>
        <pre class="docmql4">
int somefunc(double a, double d=0.0001, int n, bool b, string s="passed string")
  {
  }</pre>
    </content>

    <text>
      tag=basis_functions_call
      caption=Function call
      <content>
        <p>If a name that has not been described before appears in an expression and is followed by the left parenthesis,
      it will be contextually considered as the name of a function.</p>
        <pre class="docmql4"><i>function_name (x1, x2,..., xn)</i></pre><br/>
         
        <p>Arguments (<a href="help://basis_variables_formal">formal parameters</a>) are passed by value, i.e., 
      each expression <em>xl</em>, . . . , <em>xn</em> is calculated, and the value is passed to the function. The order of expressions calculation 
      and that of values loading are guaranteed. During the execution, the system checks the number and type of arguments given to the function. 
      Such way of addressing to the function is called a value call. Function call is an expression thy value of which is the value returned by the function. 
      The function type described above must correspond with the type of the returned value. The function can be declared or described in any part of the program
      on the global scope, i.e., outside other functions. The function cannot be declared or described inside of another function.</p>
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">
int start()
  {
   double some_array[4]={0.3, 1.4, 2.5, 3.6};
   double a=linfunc(some_array, 10.5, 8);
   //...
  }

double linfunc(double x[], double a, double b)
  {
   return (a*x[0] + b);
  }</pre><br/>

        <p>At calling of a function with default parameters, the list of parameters to be passed can be limited, 
      but not before the first default parameter.</p>
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">void somefunc(double init,double sec=0.0001,int level=10);  // function prototype
        
somefunc();                   // wrong call, the first required parameter must be presented.
somefunc(3.14);               // proper call
somefunc(3.14, 0.0002);       // proper call
somefunc(3.14, 0.0002, 10);   // proper call</pre><br/>

        <p>When calling a function, one may not skip parameters, even those having default values:</p>
        <pre class="docmql4">somefunc(3.14, , 10);         // wrong call. the second parameter was skipped.
        </pre>
      </content>
    </text>

    <text>
      tag=basis_functions_special
      caption=Special functions
      keywords=;init;deinit;start;
      <content>
        <p>There are three functions with pre-defined names in MQL4:<br/><br/>

        <b>init()</b> is a function to be called during the module initialization. If it is not available, no function will be called at initialization.<br/><br/>

        <b>start()</b> is the basic function. For experts, it is called after the next tick has income. For custom indicators, it is called 
      at recalculation after the indicator has been attached to the chart, at opening of the client terminal (if the indicator is attached to the chart), 
      and after the next tick has income, as well. For scripts, it is executed immediately after the script has been attached to the chart 
      and initialized. If there is no start() function in the module, the module (expert, script, or custom indicator) cannot be launched.<br/><br/>

        <b>deinit()</b> is a function to be called during deinitialization of the module. If it is not available, no function will be called at deinitialization.</p>

        <p>Pre-defined functions can have some parameters. However, no parameters will be taken from outside when these functions 
      are called by the client terminal, but the default values will be used. Functions of <em>start()</em>, <em>init()</em>, and 
        <em>deinit()</em> can be called from any point of the module according to the common rules, equally to other functions.</p>
        
        <p>It is not recommended to call <em>start()</em> function from <em>init()</em> function or to perform trade operations, 
      as chart data, market prices, etc. can be incomplete by the moment of the module initialization. The <em>init()</em> and 
      <em>deinit()</em> functions must finish their working as soon as possible and, in no case, shall they loop when trying to 
      start its full-fledged working before the <em>start()</em> function is called.</p>
      </content>
    </text>
  </group>


  <group>
    tag=basis_variables
    caption=Variables
    <content>
      <p>Variables must be declared before they are used. Unique names are used to identify variables. Descriptions of 
      variables are used for them to be defined and for types to be declared. Description is not an operator.</p>
      <p><b>The basic types are:</b></p>
      <ul>
          <li><a href="help://basis_types_bool">bool</a> - boolean values of <em>true</em> and <em>false</em>;</li>
          <li><a href="help://basis_types_string">string</a> - character strings;</li>
          <li><a href="help://basis_types_double">double</a> - double-precision numbers with floating point.</li>
      </ul>

<p class="doctabhdr">Examples:</p>
<pre class="docmql4">
string MessageBox;
int    Orders;
double SymbolPrice;
bool   bLog;
</pre><br/>

        <p><b>Additional types:</b></p>
        <ul><li><a href="help://basis_types_color">color</a> is an integer representing an RGB color;</li>
            <li><a href="help://basis_types_datetime">datetime</a> is date and time, an unsigned integer containing seconds that 
         have passed since 0.00 a.m. on 1 January, 1970.</li>

</ul>
        <p>Additional data types make sense only at the declaration of <a href="help://basis_variables_extern">input parameters</a> for their more convenient 
       representation in the properties window.</p>
        <p class="doctabhdr">Example:</p>
<pre class="docmql4">
datetime tBegin_Data   = D'2004.01.01 00:00';
color    cModify_Color = C'0x44,0xB9,0xE6';
</pre><br/>

        <p><b>Arrays</b></p>
<p>Array is the indexed sequence of the identical-type data.</p>
        <pre class="docmql4">int    a[50];       // A one-dimensional array of 50 integers.
double m[7][50];    // Two-dimensional array of seven arrays, 
                    //each of them consisting of 50 integers.
        </pre><br/>

        <p>Only an integer can be an <a href="help://basis_operations_other">array index</a>. No more than four-dimensional arrays
      are allowed. Numbering of array elements starts with 0. The last element of a one-dimensional array has the number which is 
      1 less than the array size. This means that call for the last element of an array consisting of 50 integers will appear as 
      a[49]. The same concerns multidimensional arrays: A dimension is indexed from 0 to the <b>dimension size</b>-1.
        The last element of a two-dimensional array from the example will appear as m[6][49].</p>

        <p>If there is an attempt to access out of the array range, the executing subsystem will generate error named 
        <a href="help://constants_errors">ERR_ARRAY_INDEX_OUT_OF_RANGE</a> that can be got using the <a href="help://check_GetLastError">GetLastError()</a> function.</p>
      </content>

    <text>
      tag=basis_variables_local
      caption=Local variables
      <content>
       <p>A variable declared inside any function is local. The scope of a local variable is limited to the
      function range inside which it is declared. A local variable can be initialized by outcome of any expression. Every call of 
      the function initializes a local variable. Local variables are stored in memory area of the corresponding function.</p>
<p class="doctabhdr">Example:</p>
        <pre class="docmql4">
int somefunc()
  {
   int ret_code=0;
   ....
   return(ret_code);
  }</pre><br/>
      </content>
    </text>
        
    <text>
      tag=basis_variables_formal
      caption=Formal parameters
      <content>

<p>Parameters <a href="help://basis_functions_call">passed to the function</a> are local. Scope is the function block. 
Formal parameters must have names differing from those of external variables and local variables defined within one 
function. In the block  of the function to the formal parameters some values can be assigned. Some values can be assigned to 
formal parameters in the function block.</p>
        <p class="doctabhdr">Example:</p>
        <pre class="docmql4">
void func(int x[], double y, bool z)
  {
   if(y&gt;0.0 &amp;&amp; !z)
      Print(x[0]);
   ...
  }</pre><br/>
<p>Formal parameters can be initialized by constants. In this case, the initializing value is considered as the default
value. Parameters, next to the intialized one, must also be initialized.</p>
        <p class="doctabhdr">Example:</p>
        <pre class="docmql4">void func(int x, double y = 0.0, bool z = true)
  {
   ...
  }</pre>

       <p>When calling such a function, the initialized parameters can be omitted, the defaults being substituted instead of them.</p>
       <p class="doctabhdr">Example:</p><pre class="docmql4">func(123, 0.5);</pre><br/>
       
       <p>MQL4-library functions <a href="help://basis_variables_extfunctions">imported</a> within other modules cannot have parameters initialized by default values.</p>
      
      <p>Parameters are passed by value, i.e., modifications of the corresponding local variable inside the called function 
      will not be shown in the calling function in any way. It is possible to pass arrays as parameters. However, for an array passed as parameter, 
      it is impossible to change values of its elements.</p>
      
      <p>It is also possible to pass parameters by reference. In this case, modification of such parameters will
      be shown in the corresponding variables in the called function passed by reference. Array elements cannot be passed by reference.
      Parameters can be passed by reference only within one module, such possibility being not provided for libraries.
      In order to inform that a parameter is passed by reference, it is necessary to put the &amp; modifier after the data type.</p>
       <p class="doctabhdr">Example:</p>
       <pre class="docmql4">
void func(int&amp; x, double&amp; y, double&amp; z[])
  {
   double calculated_tp;
   ...
   for(int i=0; i&lt;OrdersTotal(); i++)
     {
      if(i==ArraySize(z))       break;
      if(OrderSelect(i)==false) break;
      z[i]=OrderOpenPrice();
     }
   x=i;
   y=calculated_tp;
  }</pre><br/>
      <p>Arrays can be passed by reference, as well, all changes being shown in the source array. Unlike 
     simple parameters, arrays can be passed by reference into library functions, as well.<br/><br/>

      Parameters passed by reference cannot be initialized with defaults.<br/><br/>
      
      Into function cannot be passed more than 64 parameters.</p>
      </content>
    </text>

    <text>
      tag=basis_variables_static
      caption=Static variables
      keywords=;static;
      <content>
<p>The memory class of "static" defines a static variable. The specifier "static" is declared before a data type.</p> 
<p class="doctabhdr">Example:</p>
<pre class="docmql4">
int somefunc()
  {
   static int flag=10;
   ....
   return(flag);
  }</pre><br/>
      <p>Static variables are stored in the permanent memory, their values do not get lost when the function is exited. 
      Any variables in a block, except for formal parameters of the function, can be defined as static. The static variable can be 
      initialized by a constant of the corresponded type, unlike a simple local variable which can be initialized by any expression. 
      If there is no explicit initialization, the static variable is initialized with zero. Static variables are initialized only once 
      before calling of the "init()" function, that is at exit from the function inside which the static variable is declared, 
      the value of this variable not getting lost.</p>
      </content>
    </text>

    <text>
      tag=basis_variables_global
      caption=Global variables
      keywords=;static;
      <content>
      <p>Global variables are defined at the same level as functions, i.e. they are not local in any block.</p>
      <p class="doctabhdr">Example:</p>
<pre class="docmql4">int GlobalFlag=10;   // global variable

int start()
  {
   ...
  }</pre><br/>
  
        <p>Scope of global variables is the entire program. Global variables are accessible from all functions 
      defined in the program. They are initialized with zero if no other initial value is explicitly defined. A global 
      variable can be initialized only by a constant that corresponds with its type. Global variables can be initialized 
      only once after program loading into client terminal memory.</p>

        <p>Note: Variables declared at global level must not be mixed up with the Client Terminal global variables   
        that can be accessed unsing the <a href="help://globals"><em>GlobalVariable...()</em></a> functions.</p>
      </content>
    </text>

    <text>
      tag=basis_variables_extern
      caption=Defining extern variables
      keywords=;extern;
     <content>
        <p>The <em>extern</em> memory class defines an extern variable. The <em>extern</em> specifier 
      is declared before a data type. </p>
        <p class="doctabhdr">Example:</p>
<pre class="docmql4">extern double InputParameter1 = 1.0;
extern color  InputParameter2 = red;<br/>
int init()
  {
   ...
  }</pre><br/>
        <p>Extern variables determine inputs of the program, they are accessible from a program properties window.
        Arrays cannot represent themselves as extern variables.</p>
      </content>
    </text>

    <text>
      tag=basis_variables_initialization
      caption=Initialization of variables
      <content>
        <p>Any variable can be initialized at its defining. Any variable is initialized with zero (0) 
      if no other initial value is explicitly defined. Global and static variables can be initialized only by a constant 
      of the corresponding type. Local variables can be initialized by any expression, not only constant.</p>
      
        <p>Global and static variables are initialized only once. Local variables are initialized every 
      time by call of the corresponded functions.</p>
      <p class="doctabhdr">Examples:</p>
      <pre class="docmql4">
int    n       = 1;
double p       = MarketInfo(Symbol(),MODE_POINT);
string s       = "hello";
double f[]     = { 0.0, 0.236, 0.382, 0.5, 0.618, 1.0 };
int    a[4][4] = { 1, 1, 1, 1,  2, 2, 2, 2,  3, 3, 3, 3,  4, 4, 4, 4 };</pre><br/>

        <p>The list of array elements values must be enclosed in braces. Initializing values omitted are considered 
      as equal to 0. If the initializing array size is not defined, it will be defined by the compiler from the size of 
      the initializing sequence. Multidimensional arrays are initialized by a one-dimensional sequence, i.e. sequence without additional braces.
      All arrays, including those declared in the local scope, can be initialized with constants only.</p>
      </content>
    </text>
    
   <text>
      tag=basis_variables_extfunctions
      caption=External functions definition
      keywords=;import;#import;
      <content>
        <p>The type of external functions defined in another component of a program must be explicitly described. 
      The absence of such a definition may result in errors during the compilation, linkage, or execution of the program. 
      While describing an external object, the keyword of <em>#import</em> must be used with the reference to the module.</p>
        <pre class="docmql4">#import "user32.dll"
  int     MessageBoxA(int hWnd ,string szText,string szCaption,int nType);
  int     SendMessageA(int hWnd,int Msg,int wParam,int lParam);
#import "lib.ex4"
  double  round(double value);
#import</pre><br/>

        <p>Import can be used to easily describe functions called from external DLLs or compiled EX4 libraries.<br/><br/>
        Pointers to variables can be passed to imported dll functions. Data of the <em>string</em> type are passed as a pointer 
        to the corresponding memory block (one should keep in mind that internal representation of string data consists of two parts: 
        the memory block length and the memory block pointer). If there is a need to pass data of the <em>int</em> or <em>double</em>
        type, then the one-dimensional array of the corresponding type should be passed by reference as a parameter.</p>
        <p class="doctabhdr">Example:</p>
        <pre class="docmql4">
#import "some_lib.dll"
  void    PassIntegerByref(int&amp; OneInt[]);
#import
int start()
  {
   int array[1];
//...
   PassIntegerByref(array);
   Print(array[0]);
//...
  }
</pre>
      </content>
    </text>
  </group>


  <group>
    tag=basis_preprosessor
    caption=Preprocessor
    <content>
    Preprocessor is a special subsystem of MQL4 compiler that is intended for preparation of the program source code immediately 
    before the program is compiled.<br/><br/>
    Preprocessor allows enhancement of the source code readability. The code can be structured by including of specific
    files containing source codes of MQL4 programs. The possibility to assign mnemonic names to specific constants contributes to enhancement of the code readability.<br/><br/>
    Preprocessor also allows determining of specific parameters of MQL4 programs.<br/><br/>
    If the # symbol is used in the first line of the program, this line is a preprocessor directive.
    A preprocessor directive ends with a line feed character.
    </content>
    <text>
      tag=basis_preprosessor_constant
      caption=Constant declaration
      keywords=;#define;define;
      <content>
        <p>Using the <em>#define</em> construction, one can define the symbolic name or symbolic constant 
      at the program start to be the specific symbol string. Later on, the compiler will replace all appearances of this name 
      without quotation marks with the corresponding string. In fact, this name can be replaced by any absolutely arbitrary text, 
      not necessary with digits:</p>
        <pre class="docmql4"><i>#define identifier value</i></pre><br/>
        
        <p>The constant identifier conforms to the same rules as those regulating names of variables. 
      The value can be of any type:</p>
        <pre class="docmql4">#define ABC          100
#define PI           0.314
#define COMPANY_NAME "MetaQuotes Software Corp."<br/>
...<br/>

void ShowCopyright()
  {
   Print("Copyright &#169; 2001-2007, ",COMPANY_NAME);
   Print("http://www.metaquotes.net");
  }</pre>
      </content>
    </text>

    <text>
      tag=basis_preprosessor_compilation
      caption=Controlling compilation
        <keywords>
      ;#property;property;link;copyright;stacksize;indicator_chart_window;indicator_separate_window;indicator_buffers;
      ;indicator_minimum;indicator_maximum;indicator_color1;indicator_color2;indicator_color3;indicator_color4;
      ;indicator_color5;indicator_color6;indicator_color7;indicator_color8;indicator_level1;indicator_level2;
      ;indicator_level3;indicator_level4;indicator_level5;indicator_level6;indicator_level7;indicator_level8;
      ;indicator_levelcolor;indicator_levelwidth;indicator_levelstyle;show_confirm;show_inputs;
      </keywords>
      <content>
        <p>Every MQL4 program allows to specify additional specific parameters named <em>#property</em> 
      that help client terminal in proper servicing for programs without the necessity to launch them explicitly. 
      This concerns external settings of indicators, first of all.</p>
        <pre class="docmql4"><i>#property identifier value</i></pre><br/>
        
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Type</th><th width="75%">Description</th></tr>
        <tr><td>link</td><td>string</td><td>a link to the company website</td></tr>
        <tr><td>copyright</td><td>string</td><td>the company name</td></tr>
        <tr><td>stacksize</td><td>int</td><td>stack size</td></tr>
        <tr><td>library</td><td>&nbsp;</td><td>a library; no start function is assigned, non-referenced functions are not removed</td></tr>
        <tr><td>indicator_chart_window</td><td>void</td><td>show the indicator in the chart window</td></tr>
        <tr><td>indicator_separate_window</td><td>void</td><td>show the indicator in a separate window</td></tr>
        <tr><td>indicator_buffers</td><td>int</td><td>the number of buffers for calculation, up to 8</td></tr>
        <tr><td>indicator_minimum</td><td>double</td><td>the bottom scaling limit for a separate indicator window</td></tr>
        <tr><td>indicator_maximum</td><td>double</td><td>the top scaling limit for a separate indicator window</td></tr>
        <tr><td>indicator_colorN</td><td>color</td><td>the color for displaying line N, where N lies between 1 and 8</td></tr>
        <tr><td>indicator_widthN</td><td>int</td><td>width of the line N, where N lies between 1 and 8</td></tr>
        <tr><td>indicator_styleN</td><td>int</td><td>style of the line N, where N lies between 1 and 8</td></tr>
        <tr><td>indicator_levelN</td><td>double</td><td>predefined level N for separate window custom indicator, where N lies between 1 and 8</td></tr>
        <tr><td>indicator_levelcolor</td><td>color</td><td>level line color</td></tr>
        <tr><td>indicator_levelwidth</td><td>int</td><td>level line width</td></tr>
        <tr><td>indicator_levelstyle</td><td>int</td><td>level line style</td></tr>
        <tr><td>show_confirm</td><td>void</td><td>before script run message box with confirmation appears</td></tr>
        <tr><td>show_inputs</td><td>void</td><td>before script run its property sheet appears; disables show_confirm property</td></tr>
        </table><br/>
        
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">
#property link        "http://www.metaquotes.net"
#property copyright   "MetaQuotes Software Corp."
#property library
#property stacksize   1024</pre>
        <p>Compiler will write the declared values in the settings of the executed module.</p>
      </content>
    </text>

    <text>
      tag=basis_preprosessor_include
      caption=Including of files
      keywords=;include;
      <content>
        <p>The <em>#include</em> command line can be placed anywhere in the program, but usually all inclusions
      are placed at the beginning of the source code. Call format:</p>
      <pre class="docmql4"><i>#include &lt;file_name&gt;
#include &quot;file_name&quot;;</i></pre><br/>

        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">
#include &lt;WinUser32.mqh&gt;
#include "mylib.mqh"</pre><br/>

        <p>Preprocessor replaces this line with the content of the file WinUser32.mqh. Angle brackets mean that the <em>WinUser32.mqh</em> file will be 
taken from the default directory (usually <em>terminal_directory\experts\include</em>). The current directory is not searched.</p>
        
        <p>If the file name is enclosed in quotation marks, the search will be performed in the current directory 
      (where the main file of the source code is located). The standard directory is not searched in.</p>
      </content>
    </text>

    <text>
      tag=basis_preprosessor_import
      caption=Importing of functions
      keywords=;import;DLL;EX4;
      <content>
        <p>Functions are imported from compiled MQL4 modules (*.ex4 files) and from operating system modules (*.dll 
      files). The module name is specified in the <em>#import</em> directive. For compiler to be able to form the imported 
      function call and pass parameters in a proper way, the full description of functions is needed. Functions descriptions 
      follow the <em>#import &quot;module name&quot;</em> immediately. The new <em>#import</em> command (can be without 
      parameters) completes the imported functions description block.</p>
        <pre class="docmql4"><i>#import "file_name"
    func1 define;
    func2 define;
    ...
    funcN define;
#import</i></pre><br/>
<p>Imported functions must have their unique names. Functions having the same names cannot be imported simultaneously 
from different modules. Imported functions names may not coincide with those of built-in functions.</p>
<p>Since the imported functions are out of the module to be compiled, the compiler cannot check correctness of parameters 
passed. This is why, to avoid runtime errors, it is necessary to declare the compliance of types and order of parameters precisely.
The parameters passed to imported functions (both from EX4 and from DLL modules) cannot have values by default.</p>
        <p class="doctabhdr">Examples:</p>
        <pre class="docmql4">#import "user32.dll"
   int    MessageBoxA(int hWnd, string lpText, string lpCaption, int uType);<br/>
#import "stdlib.ex4"
   string ErrorDescription(int error_code);
   int    RGB(int red_value, int green_value, int blue_value);
   bool   CompareDoubles(double number1, double number2);
   string DoubleToStrMorePrecision(double number, int precision);
   string IntegerToHexString(int integer_number);<br/>
#import "ExpertSample.dll"
   int    GetIntValue(int);
   double GetDoubleValue(double);
   string GetStringValue(string);
   double GetArrayItemValue(double arr[], int, int);
   bool   SetArrayItemValue(double&amp; arr[], int,int, double);
   double GetRatesItemValue(double rates[][6], int, int, int);
   int    SortStringArray(string&amp; arr[], int);
   int    ProcessStringArray(string&amp; arr[], int);
#import</pre><br/>

        <p>For importing of functions during execution of an mql4 program, the so-called <em>late binding</em> is used. 
        This means that until the imported function has not been called, the corresponding module (ex4 or dll) will not be loaded.</p>

        <p>It is not recommended to use the fully qualified name of loaded module appearing as 
        <em>Drive:\Directory\FileName.Ext</em>. MQL4 libraries are loaded from the <em>terminal_dir\experts\libraries</em> folder.
        If the library has not been found, there will be an attempt to load a library from the <em>terminal_dir\experts</em> folder.</p>
      </content>
    </text>
  </group>
  </group>

  <group>
    tag=constants
    caption=Standard constants
    <content>
     <p>To simplify the program writing and to make program texts more convenient for perception, predefined standard constants are 
     forseen in MQL4.<br/><br/>
     Standard constants are similar to <a href="help://basis_preprosessor_constant">macro substitutions</a> and are of int type.<br/><br/>
     The constants are grouped by their purposes.</p>
    </content>

    <text>
      tag=constants_series
      caption=Series arrays
      keywords=;MODE_OPEN;MODE_LOW;MODE_HIGH;MODE_CLOSE;MODE_TIME;MODE_VOLUME;
      <content>
<p>Series array identifier used with <a href="help://array_ArrayCopySeries">ArrayCopySeries()</a>, 
<a href="help://series_iHighest">iHighest()</a> and <a href="help://series_iLowest">iLowest()</a> functions.<br/>
It can be any of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>MODE_OPEN</td><td>0</td><td>Open price.</td></tr>
<tr><td>MODE_LOW</td><td>1</td><td>Low price.</td></tr>
<tr><td>MODE_HIGH</td><td>2</td><td>High price.</td></tr>
<tr><td>MODE_CLOSE</td><td>3</td><td>Close price.</td></tr>
<tr><td>MODE_VOLUME</td><td>4</td><td>Volume, used in iLowest() and iHighest() functions.</td></tr>
<tr><td>MODE_TIME</td><td>5</td><td>Bar open time, used in ArrayCopySeries() function.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_timeframes
      caption=Timeframes
      keywords=;PERIOD_M1;PERIOD_M5;PERIOD_M15;PERIOD_H1;PERIOD_H4;PERIOD_D1;PERIOD_W1;PERIOD_MN1;
      <content>
<p>Timeframe of the chart (chart period). It can be any of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>PERIOD_M1</td><td>1</td><td>1 minute.</td></tr>
<tr><td>PERIOD_M5</td><td>5</td><td>5 minutes.</td></tr>
<tr><td>PERIOD_M15</td><td>15</td><td>15 minutes.</td></tr>
<tr><td>PERIOD_M30</td><td>30</td><td>30 minutes.</td></tr>
<tr><td>PERIOD_H1</td><td>60</td><td>1 hour.</td></tr>
<tr><td>PERIOD_H4</td><td>240</td><td>4 hour.</td></tr>
<tr><td>PERIOD_D1</td><td>1440</td><td>Daily.</td></tr>
<tr><td>PERIOD_W1</td><td>10080</td><td>Weekly.</td></tr>
<tr><td>PERIOD_MN1</td><td>43200</td><td>Monthly.</td></tr>
<tr><td>0 (zero)</td><td>0</td><td>Timeframe used on the chart.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_trading
      caption=Trade operations
      keywords=;OP_BUY;OP_SELL;OP_BUYLIMIT;OP_SELLLIMIT;OP_BUYSTOP;OP_SELLSTOP;
      <content>
<p>Operation type for the <a href="help://trading_OrderSend">OrderSend()</a> function.
It can be any of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>OP_BUY</td><td>0</td><td>Buying position.</td></tr>
<tr><td>OP_SELL</td><td>1</td><td>Selling position.</td></tr>
<tr><td>OP_BUYLIMIT</td><td>2</td><td>Buy limit pending position.</td></tr>
<tr><td>OP_SELLLIMIT</td><td>3</td><td>Sell limit pending position.</td></tr>
<tr><td>OP_BUYSTOP</td><td>4</td><td>Buy stop pending position.</td></tr>
<tr><td>OP_SELLSTOP</td><td>5</td><td>Sell stop pending position.</td></tr>
</table>
      </content>
    </text>
    
    <text>
      tag=constants_prices
      caption=Price constants
      keywords=;PRICE_CLOSE;PRICE_OPEN;PRICE_HIGH;PRICE_LOW;PRICE_MEDIAN;PRICE_TYPICAL;PRICE_WEIGHTED;
      <content>
<p>Applied price constants. It can be any of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>PRICE_CLOSE</td><td>0</td><td>Close price.</td></tr>
<tr><td>PRICE_OPEN</td><td>1</td><td>Open price.</td></tr>
<tr><td>PRICE_HIGH</td><td>2</td><td>High price.</td></tr>
<tr><td>PRICE_LOW</td><td>3</td><td>Low price.</td></tr>
<tr><td>PRICE_MEDIAN</td><td>4</td><td>Median price, (high+low)/2.</td></tr>
<tr><td>PRICE_TYPICAL</td><td>5</td><td>Typical price, (high+low+close)/3.</td></tr>
<tr><td>PRICE_WEIGHTED</td><td>6</td><td>Weighted close price, (high+low+close+close)/4.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_marketinfo
      caption=MarketInfo
      <keywords>
      ;MODE_BID;MODE_ASK;MODE_POINT;MODE_DIGITS;MODE_SPREAD;MODE_TIME;MODE_LOW;MODE_HIGH;MODE_TIME;MODE_STOPLEVEL;
      ;MODE_LOTSIZE;MODE_TICKVALUE;MODE_TICKSIZE;MODE_SWAPLONG;MODE_SWAPSHORT;MODE_STARTING;MODE_EXPIRATION;
      ;MODE_TRADEALLOWED;MODE_MINLOT;MODE_LOTSTEP;MODE_MAXLOT;MODE_SWAPTYPE;MODE_PROFITCALCMODE;MODE_MARGINCALCMODE;
      ;MODE_MARGININIT;MODE_MARGINMAINTENANCE;MODE_MARGINHEDGED;MODE_MARGINREQUIRED;MODE_FREEZELEVEL;
      </keywords>
      <content>
<p>Market information identifiers, used with <a href="help://common_MarketInfo">MarketInfo()</a> function.<br/>
It can be any of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>MODE_LOW</td><td>1</td><td>Low day price.</td></tr>
<tr><td>MODE_HIGH</td><td>2</td><td>High day price.</td></tr>
<tr><td>MODE_TIME</td><td>5</td><td>The last incoming tick time (last known server time).</td></tr>
<tr><td>MODE_BID</td><td>9</td><td>Last incoming bid price. For the current symbol, it is stored in the predefined variable <a href="help://predefined_variables_Bid">Bid</a></td></tr>
<tr><td>MODE_ASK</td><td>10</td><td>Last incoming ask price. For the current symbol, it is stored in the predefined variable <a href="help://predefined_variables_Ask">Ask</a></td></tr>
<tr><td>MODE_POINT</td><td>11</td><td>Point size in the quote currency. For the current symbol, it is stored in the predefined variable <a href="help://predefined_variables_Point">Point</a></td></tr>
<tr><td>MODE_DIGITS</td><td>12</td><td>Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable <a href="help://predefined_variables_Digits">Digits</a></td></tr>
<tr><td>MODE_SPREAD</td><td>13</td><td>Spread value in points.</td></tr>
<tr><td>MODE_STOPLEVEL</td><td>14</td><td>Stop level in points.</td></tr>
<tr><td>MODE_LOTSIZE</td><td>15</td><td>Lot size in the base currency.</td></tr>
<tr><td>MODE_TICKVALUE</td><td>16</td><td>Tick value in the deposit currency.</td></tr>
<tr><td>MODE_TICKSIZE</td><td>17</td><td>Tick size in the quote currency.</td></tr>
<tr><td>MODE_SWAPLONG</td><td>18</td><td>Swap of the long position.</td></tr>
<tr><td>MODE_SWAPSHORT</td><td>19</td><td>Swap of the short position.</td></tr>
<tr><td>MODE_STARTING</td><td>20</td><td>Market starting date (usually used for futures).</td></tr>
<tr><td>MODE_EXPIRATION</td><td>21</td><td>Market expiration date (usually used for futures).</td></tr>
<tr><td>MODE_TRADEALLOWED</td><td>22</td><td>Trade is allowed for the symbol.</td></tr>
<tr><td>MODE_MINLOT</td><td>23</td><td>Minimum permitted amount of a lot.</td></tr>
<tr><td>MODE_LOTSTEP</td><td>24</td><td>Step for changing lots.</td></tr>
<tr><td>MODE_MAXLOT</td><td>25</td><td>Maximum permitted amount of a lot.</td></tr>
<tr><td>MODE_SWAPTYPE</td><td>26</td><td>Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency.</td></tr>
<tr><td>MODE_PROFITCALCMODE</td><td>27</td><td>Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures.</td></tr>
<tr><td>MODE_MARGINCALCMODE</td><td>28</td><td>Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices.</td></tr>
<tr><td>MODE_MARGININIT</td><td>29</td><td>Initial margin requirements for 1 lot.</td></tr>
<tr><td>MODE_MARGINMAINTENANCE</td><td>30</td><td>Margin to maintain open positions calculated for 1 lot.</td></tr>
<tr><td>MODE_MARGINHEDGED</td><td>31</td><td>Hedged margin calculated for 1 lot.</td></tr>
<tr><td>MODE_MARGINREQUIRED</td><td>32</td><td>Free margin required to open 1 lot for buying.</td></tr>
<tr><td>MODE_FREEZELEVEL</td><td>33</td><td>Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_drawstyles
      caption=Drawing styles
      keywords=;DRAW_NONE;DRAW_LINE;DRAW_SECTION;DRAW_HISTOGRAM;DRAW_ARROW;STYLE_SOLID;STYLE_DASH;STYLE_DOT;STYLE_DASHDOT;STYLE_DASHDOTDOT;
      <content>
<p>Drawing shape style enumeration for <a href="help://customind_SetIndexStyle">SetIndexStyle()</a> function.</p>
<p>It can be any of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>DRAW_LINE</td><td>0</td><td>Drawing line.</td></tr>
<tr><td>DRAW_SECTION</td><td>1</td><td>Drawing sections.</td></tr>
<tr><td>DRAW_HISTOGRAM</td><td>2</td><td>Drawing histogram.</td></tr>
<tr><td>DRAW_ARROW</td><td>3</td><td>Drawing arrows (symbols).</td></tr>
<tr><td>DRAW_ZIGZAG</td><td>4</td><td>Drawing sections between even and odd indicator buffers.</td></tr>
<tr><td>DRAW_NONE</td><td>12</td><td>No drawing.</td></tr>
</table>
<p>Drawing style. Valid when width=1. It can be any of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>STYLE_SOLID</td><td>0</td><td>The pen is solid.</td></tr>
<tr><td>STYLE_DASH</td><td>1</td><td>The pen is dashed.</td></tr>
<tr><td>STYLE_DOT</td><td>2</td><td>The pen is dotted.</td></tr>
<tr><td>STYLE_DASHDOT</td><td>3</td><td>The pen has alternating dashes and dots.</td></tr>
<tr><td>STYLE_DASHDOTDOT</td><td>4</td><td>The pen has alternating dashes and double dots.</td></tr>
</table>
      </content>
    </text>

    
    <text>
      tag=constants_arrows
      caption=Arrow codes
      keywords=;SYMBOL_LEFTPRICE;SYMBOL_RIGHTPRICE;SYMBOL_THUMBSUP;SYMBOL_THUMBSDOWN;SYMBOL_ARROWUP;SYMBOL_ARROWDOWN;SYMBOL_STOPSIGN;SYMBOL_CHECKSIGN;
      <content>
<p>Predefined Arrow codes enumeration. Arrows code constants. It can be one of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>SYMBOL_THUMBSUP</td><td>67</td><td>Thumb up symbol (<span style="font: 12pt Wingdings;">&#67;</span>).</td></tr>
<tr><td>SYMBOL_THUMBSDOWN</td><td>68</td><td>Thumb down symbol (<span style="font: 12pt Wingdings;">&#68;</span>).</td></tr>
<tr><td>SYMBOL_ARROWUP</td><td>241</td><td>Arrow up symbol (<span style="font: 12pt Wingdings;">&#241;</span>).</td></tr>
<tr><td>SYMBOL_ARROWDOWN</td><td>242</td><td>Arrow down symbol (<span style="font: 12pt Wingdings;">&#242;</span>).</td></tr>
<tr><td>SYMBOL_STOPSIGN</td><td>251</td><td>Stop sign symbol (<span style="font: 12pt Wingdings;">&#251;</span>).</td></tr>
<tr><td>SYMBOL_CHECKSIGN</td><td>252</td><td>Check sign symbol (<span style="font: 12pt Wingdings;">&#252;</span>).</td></tr>
</table>
<p>Special Arrow codes that exactly points to price and time.
It can be one of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>&nbsp;</td><td>1</td><td>Upwards arrow with tip rightwards (<span style="font-family: Lucida Sans Unicode; font-size: 12pt;">&#8625;</span>).</td></tr>
<tr><td>&nbsp;</td><td>2</td><td>Downwards arrow with tip rightwards (<span style="font-family: Lucida Sans Unicode; font-size: 12pt;">&#8627;</span>).</td></tr>
<tr><td>&nbsp;</td><td>3</td><td>Left pointing triangle (<span style="font: 12pt Arial;">&#9668;</span>).</td></tr>
<tr><td>&nbsp;</td><td>4</td><td>En Dash symbol (&#8211;).</td></tr>
<tr><td>SYMBOL_LEFTPRICE</td><td>5</td><td>Left sided price label.</td></tr>
<tr><td>SYMBOL_RIGHTPRICE</td><td>6</td><td>Right sided price label.</td></tr>

</table>
      </content>
    </text>

    <text>
      tag=constants_wingdings
      caption=Wingdings
      <content>
<p>Wingdings font symbols used with Arrow objects.</p>
<table border="0" cellspacing="0" cellpadding="2" class="symbols">
<tr><td class="l_smb">&#32;</td><td class="l_code">32</td><td class="l_smb">&#33;</td><td class="l_code">33</td>
<td class="l_smb">&#34;</td><td class="l_code">34</td><td class="l_smb">&#35;</td><td class="l_code">35</td>
<td class="l_smb">&#36;</td><td class="l_code">36</td><td class="l_smb">&#37;</td><td class="l_code">37</td>
<td class="l_smb">&#38;</td><td class="l_code">38</td><td class="l_smb">&#39;</td><td class="l_code">39</td>
<td class="l_smb">&#40;</td><td class="l_code">40</td><td class="l_smb">&#41;</td><td class="l_code">41</td>
<td class="l_smb">&#42;</td><td class="l_code">42</td><td class="l_smb">&#43;</td><td class="l_code">43</td>
<td class="l_smb">&#44;</td><td class="l_code">44</td><td class="l_smb">&#45;</td><td class="l_code">45</td>
<td class="l_smb">&#46;</td><td class="l_code">46</td><td class="l_smb">&#47;</td><td>47</td></tr>
<tr><td class="d_smb">&#48;</td><td class="d_code">48</td><td class="d_smb">&#49;</td><td class="d_code">49</td>
<td class="d_smb">&#50;</td><td class="d_code">50</td><td class="d_smb">&#51;</td><td class="d_code">51</td>
<td class="d_smb">&#52;</td><td class="d_code">52</td><td class="d_smb">&#53;</td><td class="d_code">53</td>
<td class="d_smb">&#54;</td><td class="d_code">54</td><td class="d_smb">&#55;</td><td class="d_code">55</td>
<td class="d_smb">&#56;</td><td class="d_code">56</td><td class="d_smb">&#57;</td><td class="d_code">57</td>
<td class="d_smb">&#58;</td><td class="d_code">58</td><td class="d_smb">&#59;</td><td class="d_code">59</td>
<td class="d_smb">&#60;</td><td class="d_code">60</td><td class="d_smb">&#61;</td><td class="d_code">61</td>
<td class="d_smb">&#62;</td><td class="d_code">62</td><td class="d_smb">&#63;</td><td class="d_code_e">63</td></tr>
<tr><td class="l_smb">&#64;</td><td class="l_code">64</td><td class="l_smb">&#65;</td><td class="l_code">65</td>
<td class="l_smb">&#66;</td><td class="l_code">66</td><td class="l_smb">&#67;</td><td class="l_code">67</td>
<td class="l_smb">&#68;</td><td class="l_code">68</td><td class="l_smb">&#69;</td><td class="l_code">69</td>
<td class="l_smb">&#70;</td><td class="l_code">70</td><td class="l_smb">&#71;</td><td class="l_code">71</td>
<td class="l_smb">&#72;</td><td class="l_code">72</td><td class="l_smb">&#73;</td><td class="l_code">73</td>
<td class="l_smb">&#74;</td><td class="l_code">74</td><td class="l_smb">&#75;</td><td class="l_code">75</td>
<td class="l_smb">&#76;</td><td class="l_code">76</td><td class="l_smb">&#77;</td><td class="l_code">77</td>
<td class="l_smb">&#78;</td><td class="l_code">78</td><td class="l_smb">&#79;</td><td>79</td></tr>
<tr><td class="d_smb">&#80;</td><td class="d_code">80</td><td class="d_smb">&#81;</td><td class="d_code">81</td>
<td class="d_smb">&#82;</td><td class="d_code">82</td><td class="d_smb">&#83;</td><td class="d_code">83</td>
<td class="d_smb">&#84;</td><td class="d_code">84</td><td class="d_smb">&#85;</td><td class="d_code">85</td>
<td class="d_smb">&#86;</td><td class="d_code">86</td><td class="d_smb">&#87;</td><td class="d_code">87</td>
<td class="d_smb">&#88;</td><td class="d_code">88</td><td class="d_smb">&#89;</td><td class="d_code">89</td>
<td class="d_smb">&#90;</td><td class="d_code">90</td><td class="d_smb">&#91;</td><td class="d_code">91</td>
<td class="d_smb">&#92;</td><td class="d_code">92</td><td class="d_smb">&#93;</td><td class="d_code">93</td>
<td class="d_smb">&#94;</td><td class="d_code">94</td><td class="d_smb">&#95;</td><td class="d_code_e">95</td></tr>
<tr><td class="l_smb">&#96;</td><td class="l_code">96</td><td class="l_smb">&#97;</td><td class="l_code">97</td>
<td class="l_smb">&#98;</td><td class="l_code">98</td><td class="l_smb">&#99;</td><td class="l_code">99</td>
<td class="l_smb">&#100;</td><td class="l_code">100</td><td class="l_smb">&#101;</td><td class="l_code">101</td>
<td class="l_smb">&#102;</td><td class="l_code">102</td><td class="l_smb">&#103;</td><td class="l_code">103</td>
<td class="l_smb">&#104;</td><td class="l_code">104</td><td class="l_smb">&#105;</td><td class="l_code">105</td>
<td class="l_smb">&#106;</td><td class="l_code">106</td><td class="l_smb">&#107;</td><td class="l_code">107</td>
<td class="l_smb">&#108;</td><td class="l_code">108</td><td class="l_smb">&#109;</td><td class="l_code">109</td>
<td class="l_smb">&#110;</td><td class="l_code">110</td><td class="l_smb">&#111;</td><td>111</td></tr>
<tr><td class="d_smb">&#112;</td><td class="d_code">112</td><td class="d_smb">&#113;</td><td class="d_code">113</td>
<td class="d_smb">&#114;</td><td class="d_code">114</td><td class="d_smb">&#115;</td><td class="d_code">115</td>
<td class="d_smb">&#116;</td><td class="d_code">116</td><td class="d_smb">&#117;</td><td class="d_code">117</td>
<td class="d_smb">&#118;</td><td class="d_code">118</td><td class="d_smb">&#119;</td><td class="d_code">119</td>
<td class="d_smb">&#120;</td><td class="d_code">120</td><td class="d_smb">&#121;</td><td class="d_code">121</td>
<td class="d_smb">&#122;</td><td class="d_code">122</td><td class="d_smb">&#123;</td><td class="d_code">123</td>
<td class="d_smb">&#124;</td><td class="d_code">124</td><td class="d_smb">&#125;</td><td class="d_code">125</td>
<td class="d_smb">&#126;</td><td class="d_code">126</td><td class="d_smb">&#127;</td><td class="d_code_e">127</td></tr>
<tr><td class="l_smb">&#128;</td><td class="l_code">128</td><td class="l_smb">&#129;</td><td class="l_code">129</td>
<td class="l_smb">&#130;</td><td class="l_code">130</td><td class="l_smb">&#131;</td><td class="l_code">131</td>
<td class="l_smb">&#132;</td><td class="l_code">132</td><td class="l_smb">&#133;</td><td class="l_code">133</td>
<td class="l_smb">&#134;</td><td class="l_code">134</td><td class="l_smb">&#135;</td><td class="l_code">135</td>
<td class="l_smb">&#136;</td><td class="l_code">136</td><td class="l_smb">&#137;</td><td class="l_code">137</td>
<td class="l_smb">&#138;</td><td class="l_code">138</td><td class="l_smb">&#139;</td><td class="l_code">139</td>
<td class="l_smb">&#140;</td><td class="l_code">140</td><td class="l_smb">&#141;</td><td class="l_code">141</td>
<td class="l_smb">&#142;</td><td class="l_code">142</td><td class="l_smb">&#143;</td><td>143</td></tr>
<tr><td class="d_smb">&#144;</td><td class="d_code">144</td><td class="d_smb">&#145;</td><td class="d_code">145</td>
<td class="d_smb">&#146;</td><td class="d_code">146</td><td class="d_smb">&#147;</td><td class="d_code">147</td>
<td class="d_smb">&#148;</td><td class="d_code">148</td><td class="d_smb">&#149;</td><td class="d_code">149</td>
<td class="d_smb">&#150;</td><td class="d_code">150</td><td class="d_smb">&#151;</td><td class="d_code">151</td>
<td class="d_smb">&#152;</td><td class="d_code">152</td><td class="d_smb">&#153;</td><td class="d_code">153</td>
<td class="d_smb">&#154;</td><td class="d_code">154</td><td class="d_smb">&#155;</td><td class="d_code">155</td>
<td class="d_smb">&#156;</td><td class="d_code">156</td><td class="d_smb">&#157;</td><td class="d_code">157</td>
<td class="d_smb">&#158;</td><td class="d_code">158</td><td class="d_smb">&#159;</td><td class="d_code_e">159</td></tr>
<tr><td class="l_smb">&#160;</td><td class="l_code">160</td><td class="l_smb">&#161;</td><td class="l_code">161</td>
<td class="l_smb">&#162;</td><td class="l_code">162</td><td class="l_smb">&#163;</td><td class="l_code">163</td>
<td class="l_smb">&#164;</td><td class="l_code">164</td><td class="l_smb">&#165;</td><td class="l_code">165</td>
<td class="l_smb">&#166;</td><td class="l_code">166</td><td class="l_smb">&#167;</td><td class="l_code">167</td>
<td class="l_smb">&#168;</td><td class="l_code">168</td><td class="l_smb">&#169;</td><td class="l_code">169</td>
<td class="l_smb">&#170;</td><td class="l_code">170</td><td class="l_smb">&#171;</td><td class="l_code">171</td>
<td class="l_smb">&#172;</td><td class="l_code">172</td><td class="l_smb">&#173;</td><td class="l_code">173</td>
<td class="l_smb">&#174;</td><td class="l_code">174</td><td class="l_smb">&#175;</td><td>175</td></tr>
<tr><td class="d_smb">&#176;</td><td class="d_code">176</td><td class="d_smb">&#177;</td><td class="d_code">177</td>
<td class="d_smb">&#178;</td><td class="d_code">178</td><td class="d_smb">&#179;</td><td class="d_code">179</td>
<td class="d_smb">&#180;</td><td class="d_code">180</td><td class="d_smb">&#181;</td><td class="d_code">181</td>
<td class="d_smb">&#182;</td><td class="d_code">182</td><td class="d_smb">&#183;</td><td class="d_code">183</td>
<td class="d_smb">&#184;</td><td class="d_code">184</td><td class="d_smb">&#185;</td><td class="d_code">185</td>
<td class="d_smb">&#186;</td><td class="d_code">186</td><td class="d_smb">&#187;</td><td class="d_code">187</td>
<td class="d_smb">&#188;</td><td class="d_code">188</td><td class="d_smb">&#189;</td><td class="d_code">189</td>
<td class="d_smb">&#190;</td><td class="d_code">190</td><td class="d_smb">&#191;</td><td class="d_code_e">191</td></tr>
<tr><td class="l_smb">&#192;</td><td class="l_code">192</td><td class="l_smb">&#193;</td><td class="l_code">193</td>
<td class="l_smb">&#194;</td><td class="l_code">194</td><td class="l_smb">&#195;</td><td class="l_code">195</td>
<td class="l_smb">&#196;</td><td class="l_code">196</td><td class="l_smb">&#197;</td><td class="l_code">197</td>
<td class="l_smb">&#198;</td><td class="l_code">198</td><td class="l_smb">&#199;</td><td class="l_code">199</td>
<td class="l_smb">&#200;</td><td class="l_code">200</td><td class="l_smb">&#201;</td><td class="l_code">201</td>
<td class="l_smb">&#202;</td><td class="l_code">202</td><td class="l_smb">&#203;</td><td class="l_code">203</td>
<td class="l_smb">&#204;</td><td class="l_code">204</td><td class="l_smb">&#205;</td><td class="l_code">205</td>
<td class="l_smb">&#206;</td><td class="l_code">206</td><td class="l_smb">&#207;</td><td>207</td></tr>
<tr><td class="d_smb">&#208;</td><td class="d_code">208</td><td class="d_smb">&#209;</td><td class="d_code">209</td>
<td class="d_smb">&#210;</td><td class="d_code">210</td><td class="d_smb">&#211;</td><td class="d_code">211</td>
<td class="d_smb">&#212;</td><td class="d_code">212</td><td class="d_smb">&#213;</td><td class="d_code">213</td>
<td class="d_smb">&#214;</td><td class="d_code">214</td><td class="d_smb">&#215;</td><td class="d_code">215</td>
<td class="d_smb">&#216;</td><td class="d_code">216</td><td class="d_smb">&#217;</td><td class="d_code">217</td>
<td class="d_smb">&#218;</td><td class="d_code">218</td><td class="d_smb">&#219;</td><td class="d_code">219</td>
<td class="d_smb">&#220;</td><td class="d_code">220</td><td class="d_smb">&#221;</td><td class="d_code">221</td>
<td class="d_smb">&#222;</td><td class="d_code">222</td><td class="d_smb">&#223;</td><td class="d_code_e">223</td></tr>
<tr><td class="l_smb">&#224;</td><td class="l_code">224</td><td class="l_smb">&#225;</td><td class="l_code">225</td>
<td class="l_smb">&#226;</td><td class="l_code">226</td><td class="l_smb">&#227;</td><td class="l_code">227</td>
<td class="l_smb">&#228;</td><td class="l_code">228</td><td class="l_smb">&#229;</td><td class="l_code">229</td>
<td class="l_smb">&#230;</td><td class="l_code">230</td><td class="l_smb">&#231;</td><td class="l_code">231</td>
<td class="l_smb">&#232;</td><td class="l_code">232</td><td class="l_smb">&#233;</td><td class="l_code">233</td>
<td class="l_smb">&#234;</td><td class="l_code">234</td><td class="l_smb">&#235;</td><td class="l_code">235</td>
<td class="l_smb">&#236;</td><td class="l_code">236</td><td class="l_smb">&#237;</td><td class="l_code">237</td>
<td class="l_smb">&#238;</td><td class="l_code">238</td><td class="l_smb">&#239;</td><td>239</td></tr>
<tr><td class="d_smb">&#240;</td><td class="d_code">240</td><td class="d_smb">&#241;</td><td class="d_code">241</td>
<td class="d_smb">&#242;</td><td class="d_code">242</td><td class="d_smb">&#243;</td><td class="d_code">243</td>
<td class="d_smb">&#244;</td><td class="d_code">244</td><td class="d_smb">&#245;</td><td class="d_code">245</td>
<td class="d_smb">&#246;</td><td class="d_code">246</td><td class="d_smb">&#247;</td><td class="d_code">247</td>
<td class="d_smb">&#248;</td><td class="d_code">248</td><td class="d_smb">&#249;</td><td class="d_code">249</td>
<td class="d_smb">&#250;</td><td class="d_code">250</td><td class="d_smb">&#251;</td><td class="d_code">251</td>
<td class="d_smb">&#252;</td><td class="d_code">252</td><td class="d_smb">&#253;</td><td class="d_code">253</td>
<td class="d_smb">&#254;</td><td class="d_code">254</td><td class="d_smb">&#255;</td><td class="d_code_e">255</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_colors
      caption=Web colors
      <content>
      color type supported color constants.
      </content>
      <keywords>
        ;Black;DarkGreen;DarkSlateGray;Olive;Green;Teal;Navy;Purple;Maroon;Indigo;MidnightBlue;DarkBlue;
        ;DarkOliveGreen;SaddleBrown;ForestGreen;OliveDrab;SeaGreen;DarkGoldenrod;DarkSlateBlue;Sienna;MediumBlue;
        ;Brown;DarkTurquoise;DimGray;LightSeaGreen;DarkViolet;FireBrick;MediumVioletRed;MediumSeaGreen;
        ;Chocolate;Crimson;SteelBlue;Goldenrod;MediumSpringGreen;LawnGreen;CadetBlue;DarkOrchid;YellowGreen;
        ;LimeGreen;OrangeRed;DarkOrange;Orange;Gold;Yellow;Chartreuse;Lime;SpringGreen;Aqua;DeepSkyBlue;Blue;
        ;Magenta;Red;Gray;SlateGray;Peru;BlueViolet;LightSlateGray;DeepPink;MediumTurquoise;DodgerBlue;
        ;Turquoise;RoyalBlue;SlateBlue;DarkKhaki;IndianRed;MediumOrchid;GreenYellow;MediumAquamarine;
        ;DarkSeaGreen;Tomato;RosyBrown;Orchid;MediumPurple;PaleVioletRed;Coral;CornflowerBlue;DarkGray;
        ;SandyBrown;MediumSlateBlue;Tan;DarkSalmon;BurlyWood;HotPink;Salmon;Violet;LightCoral;SkyBlue;
        ;LightSalmon;Plum;Khaki;LightGreen;Aquamarine;Silver;LightSkyBlue;LightSteelBlue;LightBlue;
        ;PaleGreen;Thistle;PowderBlue;PaleGoldenrod;PaleTurquoise;LightGray;Wheat;NavajoWhite;Moccasin;LightPink;
        ;Gainsboro;PeachPuff;Pink;Bisque;LightGoldenrod;BlanchedAlmond;LemonChiffon;Beige;AntiqueWhite;PapayaWhip;
        ;Cornsilk;LightYellow;LightCyan;Linen;Lavender;MistyRose;OldLace;WhiteSmoke;Seashell;Ivory;
        ;Honeydew;AliceBlue;LavenderBlush;MintCream;Snow;White;
      </keywords>
      <content>
        <table style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma" cellspacing="1" cellpadding="2" bgcolor="#c0c0c0" border="0" width="96%">
        <tr align="center">
          <td style="background: black; color: white;" width="12.5%">Black</td>
          <td style="background: darkgreen; color: white" width="12.5%">DarkGreen</td>
          <td style="background: darkslategray; color: white" width="12.5%">DarkSlateGray</td>
          <td style="background: olive; color: white" width="12.5%">Olive</td>
          <td style="background: green; color: white" width="12.5%">Green</td>
          <td style="background: teal; color: white" width="12.5%">Teal</td>
          <td style="background: navy; color: white" width="12.5%">Navy</td>
          <td style="background: purple; color: white" width="12.5%">Purple</td></tr>
        <tr align="center">
          <td style="background: maroon; color: white">Maroon</td>
          <td style="background: indigo; color: white">Indigo</td>
          <td style="background: midnightblue; color: white">MidnightBlue</td>
          <td style="background: darkblue; color: white">DarkBlue</td>
          <td style="background: darkolivegreen; color: white">DarkOliveGreen</td>
          <td style="background: saddlebrown; color: white">SaddleBrown</td>
          <td style="background: forestgreen; color: white">ForestGreen</td>
          <td style="background: olivedrab; color: white">OliveDrab</td></tr>
        <tr align="center">
          <td style="background: seagreen; color: white">SeaGreen</td>
          <td style="background: darkgoldenrod; color: white">DarkGoldenrod</td>
          <td style="background: darkslateblue; color: white">DarkSlateBlue</td>
          <td style="background: sienna; color: white">Sienna</td>
          <td style="background: mediumblue; color: white">MediumBlue</td>
          <td style="background: brown; color: white">Brown</td>
          <td style="background: darkturquoise">DarkTurquoise</td>
          <td style="background: dimgray; color: white">DimGray</td></tr>
        <tr align="center">
          <td style="background: lightseagreen">LightSeaGreen</td>
          <td style="background: darkviolet; color: white">DarkViolet</td>
          <td style="background: firebrick; color: white">FireBrick</td>
          <td style="background: mediumvioletred; color: white">MediumVioletRed</td>
          <td style="background: mediumseagreen; color: white">MediumSeaGreen</td>
          <td style="background: chocolate; color: white">Chocolate</td>
          <td style="background: crimson; color: white">Crimson</td>
          <td style="background: steelblue; color: white">SteelBlue</td></tr>
        <tr align="center">
          <td style="background: goldenrod">Goldenrod</td>
          <td style="background: mediumspringgreen; color: black">MediumSpringGreen</td>
          <td style="background: lawngreen; color: black">LawnGreen</td>
          <td style="background: cadetblue; color: white">CadetBlue</td>
          <td style="background: darkorchid; color: white">DarkOrchid</td>
          <td style="background: yellowgreen; color: white">YellowGreen</td>
          <td style="background: limegreen; color: white">LimeGreen</td>
          <td style="background: orangered; color: white">OrangeRed</td></tr>
        <tr align="center">
          <td style="background: darkorange; color: white">DarkOrange</td>
          <td style="background: orange">Orange</td>
          <td style="background: gold">Gold</td>
          <td style="background: yellow">Yellow</td>
          <td style="background: chartreuse; color: black">Chartreuse</td>
          <td style="background: lime; color: black">Lime</td>
          <td style="background: springgreen; color: black">SpringGreen</td>
          <td style="background: aqua">Aqua</td></tr>
        <tr align="center">
          <td style="background: deepskyblue">DeepSkyBlue</td>
          <td style="background: blue; color: white">Blue</td>
          <td style="background: magenta">Magenta</td>
          <td style="background: red; color: white">Red</td>
          <td style="background: gray; color: white">Gray</td>
          <td style="background: slategray; color: white">SlateGray</td>
          <td style="background: peru; color: white">Peru</td>
          <td style="background: blueviolet; color: white">BlueViolet</td></tr>
        <tr align="center">
          <td style="background: lightslategray; color: white">LightSlateGray</td>
          <td style="background: deeppink; color: white">DeepPink</td>
          <td style="background: mediumturquoise">MediumTurquoise</td>
          <td style="background: dodgerblue; color: white">DodgerBlue</td>
          <td style="background: turquoise">Turquoise</td>
          <td style="background: royalblue; color: white">RoyalBlue</td>
          <td style="background: slateblue; color: white">SlateBlue</td>
          <td style="background: darkkhaki">DarkKhaki</td></tr>
        <tr align="center">
          <td style="background: indianred; color: white">IndianRed</td>
          <td style="background: mediumorchid">MediumOrchid</td>
          <td style="background: greenyellow">GreenYellow</td>
          <td style="background: mediumaquamarine">MediumAquamarine</td>
          <td style="background: darkseagreen; color: white">DarkSeaGreen</td>
          <td style="background: tomato; color: white">Tomato</td>
          <td style="background: rosybrown; color: white">RosyBrown</td>
          <td style="background: orchid">Orchid</td></tr>
        <tr align="center">
          <td style="background: mediumpurple; color: white">MediumPurple</td>
          <td style="background: palevioletred; color: white">PaleVioletRed</td>
          <td style="background: coral; color: white">Coral</td>
          <td style="background: cornflowerblue; color: white">CornflowerBlue</td>
          <td style="background: darkgray">DarkGray</td>
          <td style="background: sandybrown">SandyBrown</td>
          <td style="background: mediumslateblue; color: white">MediumSlateBlue</td>
          <td style="background: tan">Tan</td></tr>
        <tr align="center">
          <td style="background: darksalmon; color: white">DarkSalmon</td>
          <td style="background: burlywood">BurlyWood</td>
          <td style="background: hotpink">HotPink</td>
          <td style="background: salmon; color: white">Salmon</td>
          <td style="background: violet">Violet</td>
          <td style="background: lightcoral; color: white">LightCoral</td>
          <td style="background: skyblue">SkyBlue</td>
          <td style="background: lightsalmon">LightSalmon</td></tr>
        <tr align="center">
          <td style="background: plum">Plum</td>
          <td style="background: khaki">Khaki</td>
          <td style="background: lightgreen; color: black">LightGreen</td>
          <td style="background: aquamarine">Aquamarine</td>
          <td style="background: silver">Silver</td>
          <td style="background: lightskyblue">LightSkyBlue</td>
          <td style="background: lightsteelblue">LightSteelBlue</td>
          <td style="background: lightblue">LightBlue</td></tr>
        <tr align="center">
          <td style="background: palegreen; color: black">PaleGreen</td>
          <td style="background: thistle">Thistle</td>
          <td style="background: powderblue">PowderBlue</td>
          <td style="background: palegoldenrod">PaleGoldenrod</td>
          <td style="background: paleturquoise">PaleTurquoise</td>
          <td style="background: f0f8ff">LightGray</td>
          <td style="background: wheat">Wheat</td>
          <td style="background: navajowhite">NavajoWhite</td></tr>
        <tr align="center">
          <td style="background: moccasin">Moccasin</td>
          <td style="background: lightpink">LightPink</td>
          <td style="background: gainsboro">Gainsboro</td>
          <td style="background: peachpuff">PeachPuff</td>
          <td style="background: pink">Pink</td>
          <td style="background: bisque">Bisque</td>
          <td style="background: eedc82">LightGoldenrod</td>
          <td style="background: blanchedalmond">BlanchedAlmond</td></tr>
        <tr align="center">
          <td style="background: lemonchiffon">LemonChiffon</td>
          <td style="background: beige">Beige</td>
          <td style="background: antiquewhite">AntiqueWhite</td>
          <td style="background: papayawhip">PapayaWhip</td>
          <td style="background: cornsilk">Cornsilk</td>
          <td style="background: lightyellow">LightYellow</td>
          <td style="background: lightcyan">LightCyan</td>
          <td style="background: linen">Linen</td></tr>
        <tr align="center">
          <td style="background: lavender">Lavender</td>
          <td style="background: mistyrose">MistyRose</td>
          <td style="background: oldlace">OldLace</td>
          <td style="background: whitesmoke">WhiteSmoke</td>
          <td style="background: seashell">Seashell</td>
          <td style="background: ivory">Ivory</td>
          <td style="background: honeydew">Honeydew</td>
          <td style="background: aliceblue">AliceBlue</td></tr>
        <tr align="center">
          <td style="background: lavenderblush">LavenderBlush</td>
          <td style="background: mintcream">MintCream</td>
          <td style="background: snow">Snow</td>
          <td style="background: white">White</td>
          <td style="background: white"></td>
          <td style="background: white"></td>
          <td style="background: white"></td>
          <td style="background: white"></td></tr>
        </table>
      </content>
    </text>
    
    <text>
      tag=constants_lines
      caption=Indicator lines
      keywords=;MODE_MAIN;MODE_PLUSDI;MODE_MINUSDI;MODE_SIGNAL;MODE_UPPER;MODE_LOWER;
      <content>
<p>Indicator line identifiers used in <a href="help://indicators_iMACD">iMACD()</a>, <a href="help://indicators_iRVI">iRVI()</a>
and <a href="help://indicators_iStochastic">iStochastic()</a> indicators.<br/>
It can be one of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>MODE_MAIN</td><td>0</td><td>Base indicator line.</td></tr>
<tr><td>MODE_SIGNAL</td><td>1</td><td>Signal line.</td></tr>
</table>
<p>Indicator line identifiers used in <a href="help://indicators_iADX">iADX()</a> indicator.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>MODE_MAIN</td><td>0</td><td>Base indicator line.</td></tr>
<tr><td>MODE_PLUSDI</td><td>1</td><td>+DI indicator line.</td></tr>
<tr><td>MODE_MINUSDI</td><td>2</td><td>-DI indicator line.</td></tr>
</table>
<p>Indicator line identifiers used in <a href="help://indicators_iBands">iBands()</a>,
<a href="help://indicators_iEnvelopes">iEnvelopes()</a>, <a href="help://indicators_iEnvelopesOnArray">iEnvelopesOnArray()</a>, <a href="help://indicators_iFractals">iFractals()</a>
and <a href="help://indicators_iGator">iGator()</a> indicators.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>MODE_UPPER</td><td>1</td><td>Upper line.</td></tr>
<tr><td>MODE_LOWER</td><td>2</td><td>Lower line.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_ichimoku
      caption=Ichimoku Kinko Hyo
      keywords=;MODE_TENKANSEN;MODE_KIJUNSEN;MODE_SENKOUSPANA;MODE_SENKOUSPANB;MODE_CHINKOUSPAN;
      <content>
<p>Ichimoku Kinko Hyo identifiers used in <a href="help://indicators_iIchimoku">iIchimoku()</a> indicator call as source of requested data.<br/>
It can be one of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>MODE_TENKANSEN</td><td>1</td><td>Tenkan-sen.</td></tr>
<tr><td>MODE_KIJUNSEN</td><td>2</td><td>Kijun-sen.</td></tr>
<tr><td>MODE_SENKOUSPANA</td><td>3</td><td>Senkou Span A.</td></tr>
<tr><td>MODE_SENKOUSPANB</td><td>4</td><td>Senkou Span B.</td></tr>
<tr><td>MODE_CHINKOUSPAN</td><td>5</td><td>Chinkou Span.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_movings
      caption=Moving Average methods
      keywords=;MODE_SMA;MODE_EMA;MODE_SMMA;MODE_LWMA;
      <content>
<p>Moving Average calculation method used with <a href="help://indicators_iAlligator">iAlligator()</a>,
<a href="help://indicators_iEnvelopes">iEnvelopes()</a>, <a href="help://indicators_iEnvelopesOnArray">iEnvelopesOnArray</a>,
<a href="help://indicators_iForce">iForce()</a>, <a href="help://indicators_iGator">iGator()</a>,
<a href="help://indicators_iMA">iMA()</a>, <a href="help://indicators_iMAOnArray">iMAOnArray()</a>,
<a href="help://indicators_iStdDev">iStdDev()</a>, <a href="help://indicators_iStdDevOnArray">iStdDevOnArray()</a>,
<a href="help://indicators_iStochastic">iStochastic()</a> indicators.<br/>
It can be any of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>MODE_SMA</td><td>0</td><td>Simple moving average,</td></tr>
<tr><td>MODE_EMA</td><td>1</td><td>Exponential moving average,</td></tr>
<tr><td>MODE_SMMA</td><td>2</td><td>Smoothed moving average,</td></tr>
<tr><td>MODE_LWMA</td><td>3</td><td>Linear weighted moving average.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_messagebox
      caption=MessageBox
      <keywords>
;IDOK;IDCANCEL;IDABORT;IDRETRY;IDIGNORE;IDYES;IDNO;IDTRYAGAIN;IDCONTINUE;
;MB_OK;MB_OKCANCEL;MB_ABORTRETRYIGNORE;MB_YESNOCANCEL;MB_YESNO;MB_CANCELTRYCONTINUE;
;MB_ICONSTOP;MB_ICONERROR;MB_ICONHAND;MB_ICONQUESTION;MB_ICONEXCLAMATION;MB_ICONWARNING;
;MB_ICONINFORMATION;MB_ICONASTERISK;MB_DEFBUTTON1;MB_DEFBUTTON2;MB_DEFBUTTON3;MB_DEFBUTTON4;
      </keywords>
      <content>
<p>The <a href="help://common_MessageBox">MessageBox()</a> function return codes.<br/>
If a message box has a <b>Cancel</b> button, the function returns the IDCANCEL value if either
the ESC key is pressed or the <b>Cancel</b> button is selected. If the message box has no
<b>Cancel</b> button, pressing ESC has no effect.<br/>
Note: MessageBox return codes defined in the WinUser32.mqh file</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>IDOK</td><td>1</td><td><b>OK</b> button was selected.</td></tr>
<tr><td>IDCANCEL</td><td>2</td><td><b>Cancel</b> button was selected.</td></tr>
<tr><td>IDABORT</td><td>3</td><td><b>Abort</b> button was selected.</td></tr>
<tr><td>IDRETRY</td><td>4</td><td><b>Retry</b> button was selected.</td></tr>
<tr><td>IDIGNORE</td><td>5</td><td><b>Ignore</b> button was selected.</td></tr>
<tr><td>IDYES</td><td>6</td><td><b>Yes</b> button was selected.</td></tr>
<tr><td>IDNO</td><td>7</td><td><b>No</b> button was selected.</td></tr>
<tr><td>IDTRYAGAIN</td><td>10</td><td><b>Try Again</b> button was selected.</td></tr>
<tr><td>IDCONTINUE</td><td>11</td><td><b>Continue</b> button was selected.</td></tr>
</table><br/>
<p>The <a href="help://common_MessageBox">MessageBox</a> function flags specify the contents and behavior of the dialog box.
This value can be a combination of flags from the following groups of flags.<br/>
<br/>
To indicate the buttons displayed in the message box, specify one of the following values.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>MB_OK</td><td>0x00000000</td><td>The message box contains one push button: OK. This is the default.</td></tr>
<tr><td>MB_OKCANCEL</td><td>0x00000001</td><td>The message box contains two push buttons: OK and Cancel.</td></tr>
<tr><td>MB_ABORTRETRYIGNORE</td><td>0x00000002</td><td>The message box contains three push buttons: Abort, Retry, and Ignore.</td></tr>
<tr><td>MB_YESNOCANCEL</td><td>0x00000003</td><td>The message box contains three push buttons: Yes, No, and Cancel.</td></tr>
<tr><td>MB_YESNO</td><td>0x00000004</td><td>The message box contains two push buttons: Yes and No.</td></tr><tr><td>MB_RETRYCANCEL</td><td>0x00000005</td><td>The message box contains two push buttons: Retry and Cancel.</td></tr>
<tr><td>MB_CANCELTRYCONTINUE</td><td>0x00000006</td><td>Windows 2000: The message box contains three push buttons: Cancel, Try Again, Continue. Use this message box type instead of MB_ABORTRETRYIGNORE.</td></tr>
</table>
<p>To display an icon in the message box, specify one of the following values.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>MB_ICONSTOP, MB_ICONERROR, MB_ICONHAND</td><td>0x00000010</td><td>A stop-sign icon appears in the message box.</td></tr>
<tr><td>MB_ICONQUESTION</td><td>0x00000020</td><td>A question-mark icon appears in the message box.</td></tr>
<tr><td>MB_ICONEXCLAMATION, MB_ICONWARNING</td><td>0x00000030</td><td>An exclamation-point icon appears in the message box.</td></tr>
<tr><td>MB_ICONINFORMATION, MB_ICONASTERISK</td><td>0x00000040</td><td>An icon consisting of a lowercase letter i in a circle appears in the message box.</td></tr>
</table>
<p>To indicate the default button, specify one of the following values.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>MB_DEFBUTTON1</td><td>0x00000000</td><td>The first button is the default button. MB_DEFBUTTON1 is the default unless MB_DEFBUTTON2, MB_DEFBUTTON3, or MB_DEFBUTTON4 is specified.</td></tr>
<tr><td>MB_DEFBUTTON2</td><td>0x00000100</td><td>The second button is the default button.</td></tr>
<tr><td>MB_DEFBUTTON3</td><td>0x00000200</td><td>The third button is the default button.</td></tr>
<tr><td>MB_DEFBUTTON4</td><td>0x00000300</td><td>The fourth button is the default button.</td></tr>
</table>
        <p>MessageBox() function behavior flags are defined in the <em>WinUser32.mqh</em> file, this is why this heading file 
        must be included to programs through <em>#include &lt;WinUser32.mqh&gt;</em>. Not all possible flags are listed here. For more 
        details, please refer to Win32 API description.</p>
      </content>
    </text>

    <text>
      tag=constants_objects
      caption=Object types
      <keywords>
;OBJ_HLINE;OBJ_VLINE;OBJ_TREND;OBJ_TRENDBYANGLE;OBJ_REGRESSION;
;OBJ_CHANNEL;OBJ_STDDEVCHANNEL;OBJ_GANNLINE;OBJ_GANNFAN;OBJ_GANNGRID;OBJ_FIBO;
;OBJ_FIBOTIMES;OBJ_FIBOFAN;OBJ_FIBOARC;OBJ_EXPANSION;OBJ_FIBOCHANNEL;OBJ_RECTANGLE;
;OBJ_TRIANGLE;OBJ_ELLIPSE;OBJ_PITCHFORK;OBJ_CYCLES;OBJ_TEXT;OBJ_ARROW;OBJ_LABEL;
      </keywords>
      <content>
<p>Object type identifier constants used with
<a href="help://objects_ObjectCreate">ObjectCreate()</a>,
<a href="help://objects_ObjectsDeleteAll">ObjectsDeleteAll()</a>
and <a href="help://objects_ObjectType">ObjectType()</a> functions.
It can be any of the following values:<br/>
Objects can have 1-3 coordinates related to type.
</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>OBJ_VLINE</td><td>0</td><td>Vertical line. Uses time part of first coordinate.</td></tr>
<tr><td>OBJ_HLINE</td><td>1</td><td>Horizontal line. Uses price part of first coordinate.</td></tr>
<tr><td>OBJ_TREND</td><td>2</td><td>Trend line. Uses 2 coordinates.</td></tr>
<tr><td>OBJ_TRENDBYANGLE</td><td>3</td><td>Trend by angle. Uses 1 coordinate. To set angle of line use <a href="help://objects_ObjectSet">ObjectSet()</a> function.</td></tr>
<tr><td>OBJ_REGRESSION</td><td>4</td><td>Regression. Uses time parts of first two coordinates.</td></tr>
<tr><td>OBJ_CHANNEL</td><td>5</td><td>Channel. Uses 3 coordinates.</td></tr>
<tr><td>OBJ_STDDEVCHANNEL</td><td>6</td><td>Standard deviation channel. Uses time parts of first two coordinates.</td></tr>
<tr><td>OBJ_GANNLINE</td><td>7</td><td>Gann line. Uses 2 coordinate, but price part of second coordinate ignored.</td></tr>
<tr><td>OBJ_GANNFAN</td><td>8</td><td>Gann fan. Uses 2 coordinate, but price part of second coordinate ignored.</td></tr>
<tr><td>OBJ_GANNGRID</td><td>9</td><td>Gann grid. Uses 2 coordinate, but price part of second coordinate ignored.</td></tr>
<tr><td>OBJ_FIBO</td><td>10</td><td>Fibonacci retracement. Uses 2 coordinates.</td></tr>
<tr><td>OBJ_FIBOTIMES</td><td>11</td><td>Fibonacci time zones. Uses 2 coordinates.</td></tr>
<tr><td>OBJ_FIBOFAN</td><td>12</td><td>Fibonacci fan. Uses 2 coordinates.</td></tr>
<tr><td>OBJ_FIBOARC</td><td>13</td><td>Fibonacci arcs. Uses 2 coordinates.</td></tr>
<tr><td>OBJ_EXPANSION</td><td>14</td><td>Fibonacci expansions. Uses 3 coordinates.</td></tr>
<tr><td>OBJ_FIBOCHANNEL</td><td>15</td><td>Fibonacci channel. Uses 3 coordinates.</td></tr>
<tr><td>OBJ_RECTANGLE</td><td>16</td><td>Rectangle. Uses 2 coordinates.</td></tr>
<tr><td>OBJ_TRIANGLE</td><td>17</td><td>Triangle. Uses 3 coordinates.</td></tr>
<tr><td>OBJ_ELLIPSE</td><td>18</td><td>Ellipse. Uses 2 coordinates.</td></tr>
<tr><td>OBJ_PITCHFORK</td><td>19</td><td>Andrews pitchfork. Uses 3 coordinates.</td></tr>
<tr><td>OBJ_CYCLES</td><td>20</td><td>Cycles. Uses 2 coordinates.</td></tr>
<tr><td>OBJ_TEXT</td><td>21</td><td>Text. Uses 1 coordinate.</td></tr>
<tr><td>OBJ_ARROW</td><td>22</td><td>Arrows. Uses 1 coordinate.</td></tr>
<tr><td>OBJ_LABEL</td><td>23</td><td>Text label. Uses 1 coordinate in pixels.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_objects_properties
      caption=Object properties
      <keywords>
;OBJPROP_TIME1;OBJPROP_PRICE1;OBJPROP_TIME2;OBJPROP_PRICE2;OBJPROP_TIME3;OBJPROP_PRICE3;OBJPROP_COLOR;OBJPROP_DEVIATION;
;OBJPROP_STYLE;OBJPROP_WIDTH;OBJPROP_BACK;OBJPROP_RAY;OBJPROP_ELLIPSE;OBJPROP_SCALE;OBJPROP_ANGLE;OBJPROP_TIMEFRAMES;
;OBJPROP_ARROWCODE;OBJPROP_FONTSIZE;OBJPROP_CORNER;OBJPROP_XDISTANCE;OBJPROP_YDISTANCE;OBJPROP_FIBOLEVELS;OBJPROP_FIRSTLEVEL;
;OBJPROP_LEVELCOLOR;OBJPROP_LEVELSTYLE;OBJPROP_LEVELWIDTH;
      </keywords>
      <content>
<p>Object value index used with <a href="help://objects_ObjectGet">ObjectGet()</a> and <a href="help://objects_ObjectSet">ObjectSet()</a> functions. It can be any of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="7%">Value</th><th width="8%">Type</th><th width="70%">Description</th></tr>
<tr><td>OBJPROP_TIME1</td><td>0</td><td>datetime</td><td>Datetime value to set/get first coordinate time part.</td></tr>
<tr><td>OBJPROP_PRICE1</td><td>1</td><td>double</td><td>Double value to set/get first coordinate price part.</td></tr>
<tr><td>OBJPROP_TIME2</td><td>2</td><td>datetime</td><td>Datetime value to set/get second coordinate time part.</td></tr>
<tr><td>OBJPROP_PRICE2</td><td>3</td><td>double</td><td>Double value to set/get second coordinate price part.</td></tr>
<tr><td>OBJPROP_TIME3</td><td>4</td><td>datetime</td><td>Datetime value to set/get third coordinate time part.</td></tr>
<tr><td>OBJPROP_PRICE3</td><td>5</td><td>double</td><td>Double value to set/get third coordinate price part.</td></tr>
<tr><td>OBJPROP_COLOR</td><td>6</td><td>color</td><td>Color value to set/get object color.</td></tr>
<tr><td>OBJPROP_STYLE</td><td>7</td><td>int</td><td>Value is one of STYLE_SOLID, STYLE_DASH, STYLE_DOT, STYLE_DASHDOT, STYLE_DASHDOTDOT constants to set/get object line style.</td></tr>
<tr><td>OBJPROP_WIDTH</td><td>8</td><td>int</td><td>Integer value to set/get object line width. Can be from 1 to 5.</td></tr>
<tr><td>OBJPROP_BACK</td><td>9</td><td>bool</td><td>Boolean value to set/get background drawing flag for object.</td></tr>
<tr><td>OBJPROP_RAY</td><td>10</td><td>bool</td><td>Boolean value to set/get ray flag of object.</td></tr>
<tr><td>OBJPROP_ELLIPSE</td><td>11</td><td>bool</td><td>Boolean value to set/get ellipse flag for fibo arcs.</td></tr>
<tr><td>OBJPROP_SCALE</td><td>12</td><td>double</td><td>Double value to set/get scale object property.</td></tr>
<tr><td>OBJPROP_ANGLE</td><td>13</td><td>double</td><td>Double value to set/get angle object property in degrees.</td></tr>
<tr><td>OBJPROP_ARROWCODE</td><td>14</td><td>int</td><td>Integer value or <a href="help://constants_arrows">arrow enumeration</a> to set/get arrow code object property.</td></tr>
<tr><td>OBJPROP_TIMEFRAMES</td><td>15</td><td>int</td><td>Value can be one or combination (bitwise addition) of <a href="help://constants_objects_visible">object visibility constants</a> to set/get timeframe object property.</td></tr>
<tr><td>OBJPROP_DEVIATION</td><td>16</td><td>double</td><td>Double value to set/get deviation property for Standard deviation objects.</td></tr>
<tr><td>OBJPROP_FONTSIZE</td><td>100</td><td>int</td><td>Integer value to set/get font size for text objects.</td></tr>
<tr><td>OBJPROP_CORNER</td><td>101</td><td>int</td><td>Integer value to set/get anchor corner property for label objects. Must be from 0-3.</td></tr>
<tr><td>OBJPROP_XDISTANCE</td><td>102</td><td>int</td><td>Integer value to set/get anchor X distance object property in pixels.</td></tr>
<tr><td>OBJPROP_YDISTANCE</td><td>103</td><td>int</td><td>Integer value is to set/get anchor Y distance object property in pixels.</td></tr>
<tr><td>OBJPROP_FIBOLEVELS</td><td>200</td><td>int</td><td>Integer value to set/get Fibonacci object level count. Can be from 0 to 32.</td></tr>
<tr><td>OBJPROP_LEVELCOLOR</td><td>201</td><td>color</td><td>Color value to set/get object level line color.</td></tr>
<tr><td>OBJPROP_LEVELSTYLE</td><td>202</td><td>int</td><td>Value is one of STYLE_SOLID, STYLE_DASH, STYLE_DOT, STYLE_DASHDOT, STYLE_DASHDOTDOT constants to set/get object level line style.</td></tr>
<tr><td>OBJPROP_LEVELWIDTH</td><td>203</td><td>int</td><td>Integer value to set/get object level line width. Can be from 1 to 5.</td></tr>
<tr><td>OBJPROP_FIRSTLEVEL+<i>n</i></td><td>210+n</td><td>int</td><td>Integer value to set/get the value of Fibonacci object level with index <i>n</i>. Index <i>n</i> can be from 0 (number of levels -1), but not larger than 31.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_objects_visible
      caption=Object visibility
      <keywords>
;OBJ_PERIOD_M1;OBJ_PERIOD_M5;OBJ_PERIOD_M15;OBJ_PERIOD_M30;OBJ_PERIOD_H1;OBJ_PERIOD_H4;
;OBJ_PERIOD_D1;OBJ_PERIOD_W1;OBJ_PERIOD_MN1;OBJ_ALL_PERIODS;
      </keywords>
      <content>
<p>Timeframes where object may be shown. Used in <a href="help://objects_ObjectSet">ObjectSet()</a>
function to set OBJPROP_TIMEFRAMES property.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>OBJ_PERIOD_M1</td><td>0x0001</td><td>Object shown is only on 1-minute charts.</td></tr>
<tr><td>OBJ_PERIOD_M5</td><td>0x0002</td><td>Object shown is only on 5-minute charts.</td></tr>
<tr><td>OBJ_PERIOD_M15</td><td>0x0004</td><td>Object shown is only on 15-minute charts.</td></tr>
<tr><td>OBJ_PERIOD_M30</td><td>0x0008</td><td>Object shown is only on 30-minute charts.</td></tr>
<tr><td>OBJ_PERIOD_H1</td><td>0x0010</td><td>Object shown is only on 1-hour charts.</td></tr>
<tr><td>OBJ_PERIOD_H4</td><td>0x0020</td><td>Object shown is only on 4-hour charts.</td></tr>
<tr><td>OBJ_PERIOD_D1</td><td>0x0040</td><td>Object shown is only on daily charts.</td></tr>
<tr><td>OBJ_PERIOD_W1</td><td>0x0080</td><td>Object shown is only on weekly charts.</td></tr>
<tr><td>OBJ_PERIOD_MN1</td><td>0x0100</td><td>Object shown is only on monthly charts.</td></tr>
<tr><td>OBJ_ALL_PERIODS</td><td>0x01FF</td><td>Object shown is on all timeframes.</td></tr>
<tr><td>NULL</td><td>0</td><td>Object shown is on all timeframes.</td></tr>
<tr><td>EMPTY</td><td>-1</td><td>Hidden object on all timeframes.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_uninit
      caption=Uninitialize reason codes
      keywords=;REASON_REMOVE;REASON_RECOMPILE;REASON_CHARTCHANGE;REASON_CHARTCLOSE;REASON_PARAMETERS;REASON_ACCOUNT;
      <content>
<p>Uninitialize reason codes returned by <a href="help://check_UninitializeReason">UninitializeReason()</a> function. It can be any one of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>&nbsp;</td><td>0</td><td>Script finished its execution independently.</td></tr>
<tr><td>REASON_REMOVE</td><td>1</td><td>Expert removed from chart.</td></tr>
<tr><td>REASON_RECOMPILE</td><td>2</td><td>Expert recompiled.</td></tr>
<tr><td>REASON_CHARTCHANGE</td><td>3</td><td>symbol or timeframe changed on the chart.</td></tr>
<tr><td>REASON_CHARTCLOSE</td><td>4</td><td>Chart closed.</td></tr>
<tr><td>REASON_PARAMETERS</td><td>5</td><td>Inputs parameters was changed by user.</td></tr>
<tr><td>REASON_ACCOUNT</td><td>6</td><td>Other account activated.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_special
      caption=Special constants
      keywords=;NULL;EMPTY_VALUE;CLR_NONE;EMPTY;WHOLE_ARRAY;
      <content>
<p>Special constants used to indicate parameters and variables states.
It can be one of the following values:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>NULL</td><td>0</td><td>Indicates empty state of the string.</td></tr>
<tr><td>EMPTY</td><td>-1</td><td>Indicates empty state of the parameter.</td></tr>
<tr><td>EMPTY_VALUE</td><td>0x7FFFFFFF</td><td>Default custom indicator empty value.</td></tr>
<tr><td>CLR_NONE</td><td>0xFFFFFFFF</td><td>Indicates empty state of colors.</td></tr>
<tr><td>WHOLE_ARRAY</td><td>0</td><td>Used with array functions. Indicates that all array elements will be processed.</td></tr>
</table>
      </content>
    </text>

    <text>
      tag=constants_errors
      caption=Error codes
      <keywords>
;ERR_NO_ERROR;ERR_NO_RESULT;ERR_COMMON_ERROR;ERR_INVALID_TRADE_PARAMETERS;ERR_SERVER_BUSY;
;ERR_OLD_VERSION;ERR_NO_CONNECTION;ERR_NOT_ENOUGH_RIGHTS;ERR_TOO_FREQUENT_REQUESTS;ERR_MALFUNCTIONAL_TRADE;
;ERR_ACCOUNT_DISABLED;ERR_INVALID_ACCOUNT;ERR_TRADE_TIMEOUT;ERR_INVALID_PRICE;ERR_INVALID_STOPS;
;ERR_INVALID_TRADE_VOLUME;ERR_MARKET_CLOSED;ERR_TRADE_DISABLED;ERR_NOT_ENOUGH_MONEY;ERR_PRICE_CHANGED;
;ERR_OFF_QUOTES;ERR_BROKER_BUSY;ERR_REQUOTE;ERR_ORDER_LOCKED;ERR_LONG_POSITIONS_ONLY_ALLOWED;
;ERR_TOO_MANY_REQUESTS;ERR_TRADE_MODIFY_DENIED;ERR_TRADE_CONTEXT_BUSY;ERR_TRADE_EXPIRATION_DENIED;ERR_TRADE_TOO_MANY_ORDERS;
;ERR_NO_MQLERROR;ERR_WRONG_FUNCTION_POINTER;ERR_ARRAY_INDEX_OUT_OF_RANGE;
;ERR_NO_MEMORY_FOR_CALL_STACK;ERR_RECURSIVE_STACK_OVERFLOW;ERR_NOT_ENOUGH_STACK_FOR_PARAM;
;ERR_NO_MEMORY_FOR_PARAM_STRING;ERR_NO_MEMORY_FOR_TEMP_STRING;ERR_NOT_INITIALIZED_STRING;
;ERR_NOT_INITIALIZED_ARRAYSTRING;ERR_NO_MEMORY_FOR_ARRAYSTRING;ERR_TOO_LONG_STRING;ERR_REMAINDER_FROM_ZERO_DIVIDE;
;ERR_ZERO_DIVIDE;ERR_UNKNOWN_COMMAND;ERR_WRONG_JUMP;ERR_NOT_INITIALIZED_ARRAY;ERR_DLL_CALLS_NOT_ALLOWED;
;ERR_CANNOT_LOAD_LIBRARY;ERR_CANNOT_CALL_FUNCTION;ERR_EXTERNAL_CALLS_NOT_ALLOWED;
;ERR_NO_MEMORY_FOR_RETURNED_STR;ERR_SYSTEM_BUSY;ERR_INVALID_FUNCTION_PARAMSCNT;
;ERR_INVALID_FUNCTION_PARAMVALUE;ERR_STRING_FUNCTION_INTERNAL;ERR_SOME_ARRAY_ERROR;
;ERR_INCORRECT_SERIESARRAY_USING;ERR_CUSTOM_INDICATOR_ERROR;ERR_INCOMPATIBLE_ARRAYS;
;ERR_GLOBAL_VARIABLES_PROCESSING;ERR_GLOBAL_VARIABLE_NOT_FOUND;ERR_FUNC_NOT_ALLOWED_IN_TESTING;
;ERR_FUNCTION_NOT_CONFIRMED;ERR_SEND_MAIL_ERROR;ERR_STRING_PARAMETER_EXPECTED;ERR_INTEGER_PARAMETER_EXPECTED;
;ERR_DOUBLE_PARAMETER_EXPECTED;ERR_ARRAY_AS_PARAMETER_EXPECTED;ERR_END_OF_FILE;ERR_SOME_FILE_ERROR;
;ERR_WRONG_FILE_NAME;ERR_TOO_MANY_OPENED_FILES;ERR_CANNOT_OPEN_FILE;ERR_INCOMPATIBLE_FILEACCESS;
;ERR_NO_ORDER_SELECTED;ERR_UNKNOWN_SYMBOL;ERR_INVALID_PRICE_PARAM;ERR_INVALID_TICKET;ERR_TRADE_NOT_ALLOWED;
;ERR_LONGS_NOT_ALLOWED;ERR_SHORTS_NOT_ALLOWED;ERR_OBJECT_ALREADY_EXISTS;ERR_UNKNOWN_OBJECT_PROPERTY;
;ERR_OBJECT_DOES_NOT_EXIST;ERR_UNKNOWN_OBJECT_TYPE;ERR_NO_OBJECT_NAME;ERR_OBJECT_COORDINATES_ERROR;
;ERR_NO_SPECIFIED_SUBWINDOW;ERR_TRADE_MODIFY_DENIED;ERR_TRADE_CONTEXT_BUSY;ERR_TRADE_EXPIRATION_DENIED;
;ERR_SOME_OBJECT_ERROR,ERR_TRADE_ERROR,
      </keywords>
      <content>
<p>The <a href="help://check_GetLastError">GetLastError()</a> function return codes.
Error code constants defined at <b>stderror.mqh</b> file.
To print text messages use <i>ErrorDescription()</i> function defined at <b>stdlib.mqh</b> file.</p>
<pre class="docmql4">
#include &lt;stderror.mqh&gt;
#include &lt;stdlib.mqh&gt;

void SendMyMessage(string text)
  {
   int check;
   SendMail(&quot;some subject&quot;, text);
   check=GetLastError();
   if(check!=ERR_NO_ERROR) Print(&quot;Cannot send message, error: &quot;,ErrorDescription(check));
  }
</pre><br/>
<p>Error codes returned from trade server.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>ERR_NO_ERROR</td><td>0</td><td>No error returned.</td></tr>
<tr><td>ERR_NO_RESULT</td><td>1</td><td>No error returned, but the result is unknown.</td></tr>
<tr><td>ERR_COMMON_ERROR</td><td>2</td><td>Common error.</td></tr>
<tr><td>ERR_INVALID_TRADE_PARAMETERS</td><td>3</td><td>Invalid trade parameters.</td></tr>
<tr><td>ERR_SERVER_BUSY</td><td>4</td><td>Trade server is busy.</td></tr>
<tr><td>ERR_OLD_VERSION</td><td>5</td><td>Old version of the client terminal.</td></tr>
<tr><td>ERR_NO_CONNECTION</td><td>6</td><td>No connection with trade server.</td></tr>
<tr><td>ERR_NOT_ENOUGH_RIGHTS</td><td>7</td><td>Not enough rights.</td></tr>
<tr><td>ERR_TOO_FREQUENT_REQUESTS</td><td>8</td><td>Too frequent requests.</td></tr>
<tr><td>ERR_MALFUNCTIONAL_TRADE</td><td>9</td><td>Malfunctional trade operation.</td></tr>
<tr><td>ERR_ACCOUNT_DISABLED</td><td>64</td><td>Account disabled.</td></tr>
<tr><td>ERR_INVALID_ACCOUNT</td><td>65</td><td>Invalid account.</td></tr>
<tr><td>ERR_TRADE_TIMEOUT</td><td>128</td><td>Trade timeout.</td></tr>
<tr><td>ERR_INVALID_PRICE</td><td>129</td><td>Invalid price.</td></tr>
<tr><td>ERR_INVALID_STOPS</td><td>130</td><td>Invalid stops.</td></tr>
<tr><td>ERR_INVALID_TRADE_VOLUME</td><td>131</td><td>Invalid trade volume.</td></tr>
<tr><td>ERR_MARKET_CLOSED</td><td>132</td><td>Market is closed.</td></tr>
<tr><td>ERR_TRADE_DISABLED</td><td>133</td><td>Trade is disabled.</td></tr>
<tr><td>ERR_NOT_ENOUGH_MONEY</td><td>134</td><td>Not enough money.</td></tr>
<tr><td>ERR_PRICE_CHANGED</td><td>135</td><td>Price changed.</td></tr>
<tr><td>ERR_OFF_QUOTES</td><td>136</td><td>Off quotes.</td></tr>
<tr><td>ERR_BROKER_BUSY</td><td>137</td><td>Broker is busy.</td></tr>
<tr><td>ERR_REQUOTE</td><td>138</td><td>Requote.</td></tr>
<tr><td>ERR_ORDER_LOCKED</td><td>139</td><td>Order is locked.</td></tr>
<tr><td>ERR_LONG_POSITIONS_ONLY_ALLOWED</td><td>140</td><td>Long positions only allowed.</td></tr>
<tr><td>ERR_TOO_MANY_REQUESTS</td><td>141</td><td>Too many requests.</td></tr>
<tr><td>ERR_TRADE_MODIFY_DENIED</td><td>145</td><td>Modification denied because order too close to market.</td></tr>
<tr><td>ERR_TRADE_CONTEXT_BUSY</td><td>146</td><td>Trade context is busy.</td></tr>
<tr><td>ERR_TRADE_EXPIRATION_DENIED</td><td>147</td><td>Expirations are denied by broker.</td></tr>
<tr><td>ERR_TRADE_TOO_MANY_ORDERS</td><td>148</td><td>The amount of open and pending orders has reached the limit set by the broker.</td></tr>
<tr><td>ERR_TRADE_HEDGE_PROHIBITED</td><td>149</td><td>An attempt to open a position opposite to the existing one when hedging is disabled.</td></tr>
<tr><td>ERR_TRADE_PROHIBITED_BY_FIFO</td><td>150</td><td>An attempt to close a position contravening the FIFO rule.</td></tr>
</table><br/>
<p>MQL4 run time error codes</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
<tr><td>ERR_NO_MQLERROR</td><td>4000</td><td>No error.</td></tr>
<tr><td>ERR_WRONG_FUNCTION_POINTER</td><td>4001</td><td>Wrong function pointer.</td></tr>
<tr><td>ERR_ARRAY_INDEX_OUT_OF_RANGE</td><td>4002</td><td>Array index is out of range.</td></tr>
<tr><td>ERR_NO_MEMORY_FOR_CALL_STACK</td><td>4003</td><td>No memory for function call stack.</td></tr>
<tr><td>ERR_RECURSIVE_STACK_OVERFLOW</td><td>4004</td><td>Recursive stack overflow.</td></tr>
<tr><td>ERR_NOT_ENOUGH_STACK_FOR_PARAM</td><td>4005</td><td>Not enough stack for parameter.</td></tr>
<tr><td>ERR_NO_MEMORY_FOR_PARAM_STRING</td><td>4006</td><td>No memory for parameter string.</td></tr>
<tr><td>ERR_NO_MEMORY_FOR_TEMP_STRING</td><td>4007</td><td>No memory for temp string.</td></tr>
<tr><td>ERR_NOT_INITIALIZED_STRING</td><td>4008</td><td>Not initialized string.</td></tr>
<tr><td>ERR_NOT_INITIALIZED_ARRAYSTRING</td><td>4009</td><td>Not initialized string in array.</td></tr>
<tr><td>ERR_NO_MEMORY_FOR_ARRAYSTRING</td><td>4010</td><td>No memory for array string.</td></tr>
<tr><td>ERR_TOO_LONG_STRING</td><td>4011</td><td>Too long string.</td></tr>
<tr><td>ERR_REMAINDER_FROM_ZERO_DIVIDE</td><td>4012</td><td>Remainder from zero divide.</td></tr>
<tr><td>ERR_ZERO_DIVIDE</td><td>4013</td><td>Zero divide.</td></tr>
<tr><td>ERR_UNKNOWN_COMMAND</td><td>4014</td><td>Unknown command.</td></tr>
<tr><td>ERR_WRONG_JUMP</td><td>4015</td><td>Wrong jump (never generated error).</td></tr>
<tr><td>ERR_NOT_INITIALIZED_ARRAY</td><td>4016</td><td>Not initialized array.</td></tr>
<tr><td>ERR_DLL_CALLS_NOT_ALLOWED</td><td>4017</td><td>DLL calls are not allowed.</td></tr>
<tr><td>ERR_CANNOT_LOAD_LIBRARY</td><td>4018</td><td>Cannot load library.</td></tr>
<tr><td>ERR_CANNOT_CALL_FUNCTION</td><td>4019</td><td>Cannot call function.</td></tr>
<tr><td>ERR_EXTERNAL_CALLS_NOT_ALLOWED</td><td>4020</td><td>Expert function calls are not allowed.</td></tr>
<tr><td>ERR_NO_MEMORY_FOR_RETURNED_STR</td><td>4021</td><td>Not enough memory for temp string returned from function.</td></tr>
<tr><td>ERR_SYSTEM_BUSY</td><td>4022</td><td>System is busy (never generated error).</td></tr>
<tr><td>ERR_INVALID_FUNCTION_PARAMSCNT</td><td>4050</td><td>Invalid function parameters count.</td></tr>
<tr><td>ERR_INVALID_FUNCTION_PARAMVALUE</td><td>4051</td><td>Invalid function parameter value.</td></tr>
<tr><td>ERR_STRING_FUNCTION_INTERNAL</td><td>4052</td><td>String function internal error.</td></tr>
<tr><td>ERR_SOME_ARRAY_ERROR</td><td>4053</td><td>Some array error.</td></tr>
<tr><td>ERR_INCORRECT_SERIESARRAY_USING</td><td>4054</td><td>Incorrect series array using.</td></tr>
<tr><td>ERR_CUSTOM_INDICATOR_ERROR</td><td>4055</td><td>Custom indicator error.</td></tr>
<tr><td>ERR_INCOMPATIBLE_ARRAYS</td><td>4056</td><td>Arrays are incompatible.</td></tr>
<tr><td>ERR_GLOBAL_VARIABLES_PROCESSING</td><td>4057</td><td>Global variables processing error.</td></tr>
<tr><td>ERR_GLOBAL_VARIABLE_NOT_FOUND</td><td>4058</td><td>Global variable not found.</td></tr>
<tr><td>ERR_FUNC_NOT_ALLOWED_IN_TESTING</td><td>4059</td><td>Function is not allowed in testing mode.</td></tr>
<tr><td>ERR_FUNCTION_NOT_CONFIRMED</td><td>4060</td><td>Function is not confirmed.</td></tr>
<tr><td>ERR_SEND_MAIL_ERROR</td><td>4061</td><td>Send mail error.</td></tr>
<tr><td>ERR_STRING_PARAMETER_EXPECTED</td><td>4062</td><td>String parameter expected.</td></tr>
<tr><td>ERR_INTEGER_PARAMETER_EXPECTED</td><td>4063</td><td>Integer parameter expected.</td></tr>
<tr><td>ERR_DOUBLE_PARAMETER_EXPECTED</td><td>4064</td><td>Double parameter expected.</td></tr>
<tr><td>ERR_ARRAY_AS_PARAMETER_EXPECTED</td><td>4065</td><td>Array as parameter expected.</td></tr>
<tr><td>ERR_HISTORY_WILL_UPDATED</td><td>4066</td><td>Requested history data in updating state.</td></tr>
<tr><td>ERR_TRADE_ERROR</td><td>4067</td><td>Some error in trading function.</td></tr>
<tr><td>ERR_END_OF_FILE</td><td>4099</td><td>End of file.</td></tr>
<tr><td>ERR_SOME_FILE_ERROR</td><td>4100</td><td>Some file error.</td></tr>
<tr><td>ERR_WRONG_FILE_NAME</td><td>4101</td><td>Wrong file name.</td></tr>
<tr><td>ERR_TOO_MANY_OPENED_FILES</td><td>4102</td><td>Too many opened files.</td></tr>
<tr><td>ERR_CANNOT_OPEN_FILE</td><td>4103</td><td>Cannot open file.</td></tr>
<tr><td>ERR_INCOMPATIBLE_FILEACCESS</td><td>4104</td><td>Incompatible access to a file.</td></tr>
<tr><td>ERR_NO_ORDER_SELECTED</td><td>4105</td><td>No order selected.</td></tr>
<tr><td>ERR_UNKNOWN_SYMBOL</td><td>4106</td><td>Unknown symbol.</td></tr>
<tr><td>ERR_INVALID_PRICE_PARAM</td><td>4107</td><td>Invalid price.</td></tr>
<tr><td>ERR_INVALID_TICKET</td><td>4108</td><td>Invalid ticket.</td></tr>
<tr><td>ERR_TRADE_NOT_ALLOWED</td><td>4109</td><td>Trade is not allowed. Enable checkbox "Allow live trading" in the expert properties.</td></tr>
<tr><td>ERR_LONGS_NOT_ALLOWED</td><td>4110</td><td>Longs are not allowed. Check the expert properties.</td></tr>
<tr><td>ERR_SHORTS_NOT_ALLOWED</td><td>4111</td><td>Shorts are not allowed. Check the expert properties.</td></tr>
<tr><td>ERR_OBJECT_ALREADY_EXISTS</td><td>4200</td><td>Object exists already.</td></tr>
<tr><td>ERR_UNKNOWN_OBJECT_PROPERTY</td><td>4201</td><td>Unknown object property.</td></tr>
<tr><td>ERR_OBJECT_DOES_NOT_EXIST</td><td>4202</td><td>Object does not exist.</td></tr>
<tr><td>ERR_UNKNOWN_OBJECT_TYPE</td><td>4203</td><td>Unknown object type.</td></tr>
<tr><td>ERR_NO_OBJECT_NAME</td><td>4204</td><td>No object name.</td></tr>
<tr><td>ERR_OBJECT_COORDINATES_ERROR</td><td>4205</td><td>Object coordinates error.</td></tr>
<tr><td>ERR_NO_SPECIFIED_SUBWINDOW</td><td>4206</td><td>No specified subwindow.</td></tr>
<tr><td>ERR_SOME_OBJECT_ERROR</td><td>4207</td><td>Some error in object function.</td></tr>
</table>
      </content>
    </text>
  </group>
  

  <group>
    tag=predefined_variables
    caption=Predefined variables
    <content>
    For each executable MQL4 program, a number of predefined variables is supported that reflect the state of the current price chart 
     at the launching of a program: an expert, a script, or a custom indicator.<br/><br/>
    Libraries use variables of the module that has called a library.<br/><br/>
    To have a safe and quick access to these data, client terminal provides local copies of predefined variables for each launched 
     program separately. These data are updated at every launch of an attached expert or a custom indicator automatically or using the 
    <a href="help://windows_RefreshRates">RefreshRates()</a> function call.
    </content>
    <variable>
      tag=predefined_variables_ask
      caption=Ask
      type=double
      <content>
      The latest known seller's price (ask price) for the current symbol. The <a href="help://windows_RefreshRates">RefreshRates()</a> function 
      must be used to update.<br/>
      <b>See also</b> <a href="help://common_MarketInfo">MarketInfo()</a>.
      </content>
      <example>
  if(iRSI(NULL,0,14,PRICE_CLOSE,0)&lt;25)
    {
     OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,
               &quot;My order #2&quot;,3,D'2005.10.10 12:30',Red);
     return;
    }
      </example>
    </variable>
    <variable>
      tag=predefined_variables_bars
      caption=Bars
      type=int
      <content>
      Number of bars in the current chart.<br/>
      <b>See also</b> <a href="help://series_iBars">iBars()</a>.
      </content>
      <example>
  int counter=1;
  for(int i=1; i&lt;=Bars; i++)
    {
     Print(Close[i-1]);
    }
      </example>
    </variable>

    <variable>
      tag=predefined_variables_bid
      caption=Bid
      type=double
      <content>
      The latest known buyer's price (offer price, bid price) of the current symbol. The <a href="help://windows_RefreshRates">RefreshRates()</a> function must be 
      used to update.<br/>
      <b>See also</b> <a href="help://common_MarketInfo">MarketInfo()</a>.
      </content>
      <example>
  if(iRSI(NULL,0,14,PRICE_CLOSE,0)&gt;75)
    {
     OrderSend(&quot;EURUSD&quot;,OP_SELL,Lots,Bid,3,Ask+StopLoss*Point,Bid-TakeProfit*Point,
               &quot;My Order #2&quot;,3,D'2005.10.10 12:30',Red);
     return(0);
    }
      </example>
    </variable>

    <variable>
      tag=predefined_variables_close
      caption=Close[]
      keywords=;Close;
      type=double
      <content>
Series array that contains close prices for each bar of the current chart.<br/><br/>
Series array elements are indexed in the reverse order, i.e., from the last one to the first one.
The current bar which is the last in the array is indexed as 0. The oldest bar, the first in the chart, is indexed as <a href="help://predefined_variables_Bars">Bars</a>-1.<br/><br/>
<b>See also</b> <a href="help://series_iClose">iClose()</a>.
      </content>
      <example>
  int handle = FileOpen(&quot;file.csv&quot;, FILE_CSV|FILE_WRITE, &quot;;&quot;);
  if(handle&gt;0)
    {
     // table column headers recording
     FileWrite(handle, &quot;Time;Open;High;Low;Close;Volume&quot;);
     // data recording
     for(int i=0; i&lt;Bars; i++)
       FileWrite(handle, Time[i], Open[i], High[i], Low[i], Close[i], Volume[i]);
     FileClose(handle);
    }
      </example>
    </variable>

    <variable>
      tag=predefined_variables_digits
      caption=Digits
      type=int
      <content>
      Number of digits after decimal point for the current symbol prices.<br/>
      <b>See also</b> <a href="help://common_MarketInfo">MarketInfo()</a>.
      </content>
      example=Print(DoubleToStr(Close[0], Digits));
    </variable>

    <variable>
      tag=predefined_variables_high
      caption=High[]
      keywords=;High;
      type=double
      <content>
Series array that contains the highest prices of each bar of the current chart.<br/><br/>
Series array elements are indexed in the reverse order, i.e., from the last one to the first one.
The current bar which is the last in the array is indexed as 0. The oldest bar, the first in the chart, is indexed as <a href="help://predefined_variables_Bars">Bars</a>-1.<br/><br/>
<b>See also</b> <a href="help://series_iHigh">iHigh()</a>.
      </content>
      <example>
//---- maximums counting
   i=Bars-KPeriod;
   if(counted_bars&gt;KPeriod) i=Bars-counted_bars-1;
   while(i&gt;=0)
     {
      double max=-1000000;
      k = i + KPeriod-1;
      while(k&gt;=i)
        {
         price=High[k];
         if(max&lt;price) max=price;
         k--;
        }
      HighesBuffer[i]=max;
      i--;
     }
//----
      </example>
    </variable>

    <variable>
      tag=predefined_variables_low
      caption=Low[]
      keywords=;Low;
      type=double
      <content>
Series array that contains the lowest prices of each bar of the current chart.<br/><br/>
Series array elements are indexed in the reverse order, i.e., from the last one to the first one.
The current bar which is the last in the array is indexed as 0. The oldest bar, the first in the chart, is indexed as <a href="help://predefined_variables_Bars">Bars</a>-1.<br/><br/>
<b>See also</b> <a href="help://series_iLow">iLow()</a>.
      </content>
      <example>
//---- minima counting
   i=Bars-KPeriod;
   if(counted_bars&gt;KPeriod) i=Bars-counted_bars-1;
   while(i&gt;=0)
     {
      double min=1000000;
      k = i + KPeriod-1;
      while(k&gt;=i)
        {
         price=Low[k];
         if(min&gt;price) min=price;
         k--;
        }
      LowesBuffer[i]=min;
      i--;
     }
//----
      </example>
    </variable>

    <variable>
      tag=predefined_variables_open
      caption=Open[]
      keywords=;Open;
      type=double
      <content>
Series array that contains open prices of each bar of the current chart.<br/><br/>
Series array elements are indexed in the reverse order, i.e., from the last one to the first one.
The current bar which is the last in the array is indexed as 0. The oldest bar, the first in the chart, is indexed as <a href="help://predefined_variables_Bars">Bars</a>-1.<br/><br/>
<b>See also</b> <a href="help://series_iOpen">iOpen()</a>.
      </content>
      <example>
   i = Bars - counted_bars - 1;
   while(i&gt;=0)
     {
      double high  = High[i];
      double low   = Low[i];
      double open  = Open[i];
      double close = Close[i];
      AccumulationBuffer[i] = (close-low) - (high-close);
      if(AccumulationBuffer[i] != 0)
        {
         double diff = high - low;
         if(0==diff)
            AccumulationBuffer[i] = 0;
         else
           {
            AccumulationBuffer[i] /= diff;
            AccumulationBuffer[i] *= Volume[i];
           }
        }
      if(i&lt;Bars-1) AccumulationBuffer[i] += AccumulationBuffer[i+1];
      i--;
     }
      </example>
    </variable>

    <variable>
      tag=predefined_variables_point
      caption=Point
      type=double
      <content>
      The current symbol point value in the quote currency.<br/>
      <b>See also</b> <a href="help://common_MarketInfo">MarketInfo()</a>.
      </content>
      example=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point);
    </variable>

    <variable>
      tag=predefined_variables_time
      caption=Time[]
      keywords=;Time;
      type=datetime
      <content>
Series array that contains open time of each bar of the current chart. Data like datetime represent time, in seconds, that has passed 
since 00:00 a.m. of 1 January, 1970.<br/><br/>
Series array elements are indexed in the reverse order, i.e., from the last one to the first one.
The current bar which is the last in the array is indexed as 0. The oldest bar, the first in the chart, is indexed as <a href="help://predefined_variables_Bars">Bars</a>-1.<br/><br/>
<b>See also</b> <a href="help://series_iTime">iTime()</a>.
      </content>
      <example>
   for(i=Bars-2; i&gt;=0; i--)
     {
      if(High[i+1] &gt; LastHigh) LastHigh = High[i+1];
      if(Low[i+1] &lt; LastLow)   LastLow  = Low[i+1];
      //----
      if(TimeDay(Time[i]) != TimeDay(Time[i+1]))
        {
         P = (LastHigh + LastLow + Close[i+1])/3;
         R1 = P*2 - LastLow;
         S1 = P*2 - LastHigh;
         R2 = P + LastHigh - LastLow;
         S2 = P - (LastHigh - LastLow);
         R3 = P*2 + LastHigh - LastLow*2;
         S3 = P*2 - (LastHigh*2 - LastLow);
         LastLow  = Open[i];
         LastHigh = Open[i];
        }
      //----
      PBuffer[i]  = P;
      S1Buffer[i] = S1;
      R1Buffer[i] = R1;
      S2Buffer[i] = S2;
      R2Buffer[i] = R2;
      S3Buffer[i] = S3;
      R3Buffer[i] = R3;
     }
      </example>
    </variable>
    <variable>
      tag=predefined_variables_volume
      caption=Volume[]
      keywords=;Volume;
      type=double
      <content>
Series array that contains tick volumes of each bar of the current chart.<br/><br/>
Series array elements are indexed in the reverse order, i.e., from the last one to the first one.
The current bar which is the last in the array is indexed as 0. The oldest bar, the first in the chart, is indexed as <a href="help://predefined_variables_Bars">Bars</a>-1.<br/><br/>
<b>See also</b> <a href="help://series_iVolume">iVolume()</a>.
      </content>
      <example>
      if(i==0 &amp;&amp; time0&lt;i_time+periodseconds)
        {
         d_volume += Volume[0];
         if(Low[0]&lt;d_low)   d_low = Low[0];
         if(High[0]&gt;d_high) d_high = High[0];
         d_close = Close[0];
        }
      last_fpos = FileTell(ExtHandle);
      last_volume = Volume[i];
      FileWriteInteger(ExtHandle, i_time, LONG_VALUE);
      FileWriteDouble(ExtHandle, d_open, DOUBLE_VALUE);
      FileWriteDouble(ExtHandle, d_low, DOUBLE_VALUE);
      FileWriteDouble(ExtHandle, d_high, DOUBLE_VALUE);
      FileWriteDouble(ExtHandle, d_close, DOUBLE_VALUE);
      FileWriteDouble(ExtHandle, d_volume, DOUBLE_VALUE);
      </example>
    </variable>
  </group>

  
  <group>
    tag=runtime
    caption=Program Run
    <content>
    For an MQL4 program to work, it must be compiled (the "Compile" button or F5). It must be compiled 
    without any errors (warnings are allowed, but they must be analyzed). At this, in the corresponding directory, <em>terminal_dir\experts</em>,
    <em>terminal_dir\experts\indicators</em>, or <em>terminal_dir\experts\scripts</em>, an executable file must be created that has the same name 
    and extension EX4. It is this file that can be launched for execution.<br/><br/>
    Experts, custom indicators, and scripts are attached to one of the opened charts by dragging with the mouse from the "Navigator" window of the client
    terminal to the corresponding chart (the Drag'n'Drop technique). MQL4 programs can work only when the client terminal is on.<br/><br/>
    For an expert to stop working,it must be deleted from the chart using "Expert Advisors - Delete" in the chart context menu.
    The status of the "Enable Expert Advisors" field influences the running of the expert.<br/><br/>
    For a custom indicator to stop working, it must be deleted from the chart.<br/><br/>
    Custom indicators and expert advisors operate until they are explicitly deleted from the chart. Information about the attached experts and custom
    indicators is saved between client terminal startups. Scripts are executed once and deleted automatically after they have completed their operation, or
    when the current chart has been closed or changed its status, or when the client terminal has been terminated. Scripts are not launched at the terminal restart
    since information about them is not saved.<br/><br/>
    In the same chart, one expert, one script, and an unlimited amount of indicators can work simultaneously.
    </content>
    <text>
      tag=runtime_start
      caption=Program Run
      keywords=;init;deinit;start;
      <content>
        <p>
        Immediately after the program has been attached to the chart, it starts working with the init() function. The init()
        function of an expert advisor or a custom indicator attached to the chart will run just after client terminal has started 
        and history data (this concerns only experts, but not indicators) have been loaded  additionally, after the symbol and/or 
        chart period have been changed, after the program has been recompiled in MetaEditor, after inputs have been changed from 
        the window of expert or custom indicator settings. An expert will also be initialized after the account has been changed.<br/><br/>
        
        Every program attached to a chart completes its work with the deinit() function. The deinit() function runs at the client 
        terminal shutdown, at chart closing,  immediately before the symbol and/or chart period is changed, at successful recompiling 
        of the program, at changing of inputs, or at changing of the account. One can see the reason of deinitialization using the 
        <a href="help://check_UninitializeReason">UninitializeReason()</a> function during execution of the deinit() function. The deinit() 
        function must be executed within 2.5 seconds. If the function has not completed its execution within this time period, it will 
        be completed forcedly. Scripts are an exception to this rule, as they normally finish their working independently, without any 
        commands from outside. If a script works very long (due to endless loop, foe example), it can be finished by an outside command 
        (at deletion of the script from the chart context menu, at attaching of a new script to the same chart, at closing of the chart, 
        at changing of the symbol and/or chart period). In this case, the deinit() function is limited by 2.5 seconds, too.<br/><br/>
        
        At incoming of new quotes, the start() function of the attached experts and custom indicators will be executed. If the start() 
        function launched at the preceding quote was running when a new quote came, the new quote will be skipped by the expert. All new 
        quotes income while the program was being executed are skipped by the program until the current execution of the start() function 
        has been completed.  After that, the start() function will be run only when a successive new quote incomes.
        For custom indicators, the start() function will be launched for recalculation after the current chart symbol or timeframe 
        has been changed independently on new quotes incoming.
        The start() function will not be run when the expert properties window is open. The latter cannot be opened during the expert execution.<br/><br/>
        
        Detaching of the program from the chart, change of symbol and/or chart period, change of the account, closing of the chart, as 
        well as shutdown of the client terminal will interrupt execution of the program. If the start() function was being executed at 
        the moment when the stop working command was given, the time remaining for its work is limited by 2.5 seconds. The program can 
        get to know that it is tried to shut it down with the built-in function of <a href="help://check_IsStopped">IsStopped()</a> and finish 
        its work correctly.<br/><br/>
        
        Execution of scripts does not depend on incoming quotes. At change of symbol and/or chart period, the script will finish its work 
        and be unloaded from the client terminal.<br/>
        Scripts and experts work in their own thread. Custom indicators work in the main interface thread. If a custom indicator has been called 
        with the <a href="help://indicators_iCustom">iCustom()</a> function, this indicator works in the thread of the program that has called it. 
        Library (imported) functions work in the calling program thread, as well.</p>
      </content>
    </text>
    <text>
      tag=runtime_imports
      caption=Imported functions call
      keywords=;init;deinit;start;
      <content>
        <p>
        To <a href="help://basis_preprosessor_import">import functions</a> during execution of an mql4 program, the so-called late binding is used. 
        This means that, until the imported function is called, the corresponding module (ex4 or dll) will not be loaded.
        MQL4 and DLL libraries are executed in the calling module thread.<br/><br/>

        It is not recommended to use a fully qualified name of the module to be loaded like <em>Drive:\Directory\FileName.Ext</em>. 
      MQL4 libraries are loaded from the <em>terminal_dir\experts\libraries</em> folder. If the library has not been found, 
      there will be made an attempt to load the library from the <em>terminal_dir\experts</em> folder.<br/><br/>

        System libraries (DLLs) are loaded by the rules of the operation system. If the library has already been loaded 
      (by another expert, for example, or from another client terminal launched at the same time), the library 
      already loaded will be referenced to. Otherwise, the searching will be preformed in the following order:<br/>
        1. The <em>terminal_dir\experts\libraries</em> directory.<br/>
        2. The directory from which the <em>terminal_dir</em> client terminal was launched.<br/>
        3. The current directory.<br/>
        4. The system directory of <em>windows_dir\SYSTEM32</em> (or <em>windows_dir\SYSTEM</em> for Win98).<br/>
        5. The directory where <em>windows_dir</em> operation system was installed.<br/>
        6. Directories listed in the PATH environment system variable.<br/><br/>

        If a DLL uses another DLL in its work, the former one will not be loaded if the latter one is unavailable.<br/><br/>

        Unlike system libraires, custom libraries (MQL4) are loaded for every calling module separately, independently on whether 
        the called library has been loaded by any other module. For example, the caller.ex4 module calls functions from lib1.ex4 and 
      lib2.ex4 libraries. The lib1.ex4 library, in its turn, calls functions from the lib2.ex4 library. In this case, 
      one more copy of the lib1.ex4 library and two copies of the lib2.ex4 library will be loaded, regardless that all calls  
        come from the same caller.ex4 module.<br/><br/>

        Functions imported from DLL into an mql4 program must provide linkage convention accepted for Windows API functions.
        To provide such a convention, the key word __stdcall specific for compilers of Microsoft(r) company is used in the source codes 
      of programs written in C or C++ language. The above linkage convention is characterized by the following:<br/>
         - calling function (in our case, it is an mql4 program) must "see" the called (imported from DLL) function prototype 
       in order to put parameters onto the stack in a proper way;<br/>
         - calling function (in our case, it is an mql4 program) puts parameters onto the stack in the reversed order, i.e., from right 
       to left; it is this order in which the imported function reads parameters passed to it;<br/>
         - parameters are passed by their values, except for those explicitely passed by a link (in our case, these are lines);<br/>
         - on reading the parameters passed to it, the imported function will flush the stack by itself.<br/><br/>

         At describing of the imported <a href="help://basis_functions">function</a> prototype, it is useless to use parameters with 
       default values as all parameters must be passed explicitely to the imported function.<br/><br/>

         If the call for an imported function failed (expert settings do not allow DLL imports, or the corresponding 
       library could not be loaded for any reason), the expert stops working putting the corresponding message into the "expert stopped" 
       journal. At that, the expert will not be launched until it is re-initialized. An expert can be re-initialized as a result of 
       recompiling or opening of the expert properties table and pressing of OK button.
        </p>
      </content>
    </text>
    <text>
      tag=runtime_errors
      caption=Runtime errors
      <keywords>
      ;ERR_NO_ERROR;ERR_NO_RESULT;ERR_COMMON_ERROR;ERR_INVALID_TRADE_PARAMETERS;ERR_SERVER_BUSY;
      ;ERR_OLD_VERSION;ERR_NO_CONNECTION;ERR_NOT_ENOUGH_RIGHTS;ERR_TOO_FREQUENT_REQUESTS;ERR_MALFUNCTIONAL_TRADE;
      ;ERR_ACCOUNT_DISABLED;ERR_INVALID_ACCOUNT;ERR_TRADE_TIMEOUT;ERR_INVALID_PRICE;ERR_INVALID_STOPS;
      ;ERR_INVALID_TRADE_VOLUME;ERR_MARKET_CLOSED;ERR_TRADE_DISABLED;ERR_NOT_ENOUGH_MONEY;ERR_PRICE_CHANGED;
      ;ERR_OFF_QUOTES;ERR_BROKER_BUSY;ERR_REQUOTE;ERR_ORDER_LOCKED;ERR_LONG_POSITIONS_ONLY_ALLOWED;
      ;ERR_TOO_MANY_REQUESTS;ERR_TRADE_MODIFY_DENIED;ERR_TRADE_CONTEXT_BUSY;ERR_TRADE_EXPIRATION_DENIED;ERR_TRADE_TOO_MANY_ORDERS;
      ;ERR_NO_MQLERROR;ERR_WRONG_FUNCTION_POINTER;ERR_ARRAY_INDEX_OUT_OF_RANGE;
      ;ERR_NO_MEMORY_FOR_CALL_STACK;ERR_RECURSIVE_STACK_OVERFLOW;ERR_NOT_ENOUGH_STACK_FOR_PARAM;
      ;ERR_NO_MEMORY_FOR_PARAM_STRING;ERR_NO_MEMORY_FOR_TEMP_STRING;ERR_NOT_INITIALIZED_STRING;
      ;ERR_NOT_INITIALIZED_ARRAYSTRING;ERR_NO_MEMORY_FOR_ARRAYSTRING;ERR_TOO_LONG_STRING;ERR_REMAINDER_FROM_ZERO_DIVIDE;
      ;ERR_ZERO_DIVIDE;ERR_UNKNOWN_COMMAND;ERR_WRONG_JUMP;ERR_NOT_INITIALIZED_ARRAY;ERR_DLL_CALLS_NOT_ALLOWED;
      ;ERR_CANNOT_LOAD_LIBRARY;ERR_CANNOT_CALL_FUNCTION;ERR_EXTERNAL_CALLS_NOT_ALLOWED;
      ;ERR_NO_MEMORY_FOR_RETURNED_STR;ERR_SYSTEM_BUSY;ERR_INVALID_FUNCTION_PARAMSCNT;
      ;ERR_INVALID_FUNCTION_PARAMVALUE;ERR_STRING_FUNCTION_INTERNAL;ERR_SOME_ARRAY_ERROR;
      ;ERR_INCORRECT_SERIESARRAY_USING;ERR_CUSTOM_INDICATOR_ERROR;ERR_INCOMPATIBLE_ARRAYS;
      ;ERR_GLOBAL_VARIABLES_PROCESSING;ERR_GLOBAL_VARIABLE_NOT_FOUND;ERR_FUNC_NOT_ALLOWED_IN_TESTING;
      ;ERR_FUNCTION_NOT_CONFIRMED;ERR_SEND_MAIL_ERROR;ERR_STRING_PARAMETER_EXPECTED;ERR_INTEGER_PARAMETER_EXPECTED;
      ;ERR_DOUBLE_PARAMETER_EXPECTED;ERR_ARRAY_AS_PARAMETER_EXPECTED;ERR_END_OF_FILE;ERR_SOME_FILE_ERROR;
      ;ERR_WRONG_FILE_NAME;ERR_TOO_MANY_OPENED_FILES;ERR_CANNOT_OPEN_FILE;ERR_INCOMPATIBLE_FILEACCESS;
      ;ERR_NO_ORDER_SELECTED;ERR_UNKNOWN_SYMBOL;ERR_INVALID_PRICE_PARAM;ERR_INVALID_TICKET;ERR_TRADE_NOT_ALLOWED;
      ;ERR_LONGS_NOT_ALLOWED;ERR_SHORTS_NOT_ALLOWED;ERR_OBJECT_ALREADY_EXISTS;ERR_UNKNOWN_OBJECT_PROPERTY;
      ;ERR_OBJECT_DOES_NOT_EXIST;ERR_UNKNOWN_OBJECT_TYPE;ERR_NO_OBJECT_NAME;ERR_OBJECT_COORDINATES_ERROR;
      ;ERR_NO_SPECIFIED_SUBWINDOW;ERR_TRADE_MODIFY_DENIED;ERR_TRADE_CONTEXT_BUSY;ERR_TRADE_EXPIRATION_DENIED;
      ;ERR_SOME_OBJECT_ERROR,ERR_TRADE_ERROR,
      </keywords>
      <content>
        <p>
         In the executing sub-system of the client terminal, the error code can be stored, in the case of its occurring 
       at an mql4 program execution. There is a specific <i>last_error</i> variable provided for every executable mql4 program.
       Before the init function is run, the <i>last_error</i> variable has been zeroized. If an error occurs during the process of 
       calculation or that of calling the built-in function, the <i>last_error</i> variable takes the corresponding
       <a href="help://constants_errors">error code</a>. Value stored in this variable can be got using the <a href="help://check_GetLastError">GetLastError</a> function.
         At that, the <i>last_error</i> variable will be zeroized.
        </p>
        <p>
         There is a number of critical errors that cause immediate stopping of program execution:</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
        <tr><td>ERR_WRONG_FUNCTION_POINTER</td><td>4001</td><td>At calling of an internal function, a wrong function pointer has been detected</td></tr>
        <tr><td>ERR_NO_MEMORY_FOR_CALL_STACK</td><td>4003</td><td>At calling of an internal function, it is impossible to reallocate memory for the function calls stack</td></tr>
        <tr><td>ERR_RECURSIVE_STACK_OVERFLOW</td><td>4004</td><td>The data stack is overflowed at the recursive function call</td></tr>
        <tr><td>ERR_NO_MEMORY_FOR_PARAM_STRING</td><td>4006</td><td>At calling of an internal function, it is impossible to allocate memory for passing the string as a function parameter</td></tr>
        <tr><td>ERR_NO_MEMORY_FOR_TEMP_STRING</td><td>4007</td><td>It is impossible to allocate the temporary buffer for string operations</td></tr>
        <tr><td>ERR_NO_MEMORY_FOR_ARRAYSTRING</td><td>4010</td><td>At assignment, it is impossible to reallocate memory for a string in an array</td></tr>
        <tr><td>ERR_TOO_LONG_STRING</td><td>4011</td><td>At assignment, too long resulting string to be placed into the service buffer (no possibility to reallocate for the service buffer)</td></tr>
        <tr><td>ERR_REMAINDER_FROM_ZERO_DIVIDE</td><td>4012</td><td>Dividing by 0 when taking the remainder of the division</td></tr>
        <tr><td>ERR_ZERO_DIVIDE</td><td>4013</td><td>Dividing by 0</td></tr>
        <tr><td>ERR_UNKNOWN_COMMAND</td><td>4014</td><td>Unknown instruction</td></tr>
        </table>
        <p>
         If the program stopped working due to a critical error, the code of this error can be read at the next launching of the start or deinit function
         using the <a href="help://check_GetLastError">GetLastError()</a> function. The <i>last_error</i> variable is not zeroized before the start or deinit function starts.
        </p>
        <p><br/>
         There is a number of critical errors referred to <a href="help://runtime_imports">imported functions call</a> that cause immediate stopping of
         expert advisor or custom indicator execution the start function will not be launched until expert or indicator is re-initialized.
        </p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
        <tr><td>ERR_CANNOT_LOAD_LIBRARY</td><td>4018</td><td>At calling of an imported function, loading error of dll or ex4 library occurred</td></tr>
        <tr><td>ERR_CANNOT_CALL_FUNCTION</td><td>4019</td><td>At calling of an imported function, it was found out that dll or ex4 library did not contain the called function</td></tr>
        <tr><td>ERR_DLL_CALLS_NOT_ALLOWED</td><td>4017</td><td>At calling of an imported dll function, it was found out that dll imports were not allowed</td></tr>
        <tr><td>ERR_EXTERNAL_CALLS_NOT_ALLOWED</td><td>4020</td><td>At calling of an ex4 function, it was found out that external ex4 imports were not allowed</td></tr>
        </table>
        <p><br/>
         Other errors do not interrupt program execution.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
        <tr><td>ERR_ARRAY_INDEX_OUT_OF_RANGE</td><td>4002</td><td>Attempt to access an array item number of which is out of the array range</td></tr>
        <tr><td>ERR_NOT_INITIALIZED_STRING</td><td>4008</td><td>Not initialized string; no value was assigned to the string being an operand in an expression</td></tr>
        <tr><td>ERR_NOT_INITIALIZED_ARRAYSTRING</td><td>4009</td><td>Not initialized string in the array string; no value was assigned to the string item being an operand in an expression</td></tr>
        <tr><td>ERR_NO_MEMORY_FOR_RETURNED_STR</td><td>4021</td><td>It is impossible to reallocate memory for a string returned from function</td></tr>
        </table>
        <p><br/>
        The ERR_NO_MQLERROR (4000) code is never generated.
        </p>
        <p>
         There is a number of errors which are possible only as a result of software or hardware failure.If any errors described below occur repeatedly, one should contact the developers.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
        <tr><td>ERR_WRONG_FUNCTION_POINTER</td><td>4001</td><td>At calling of an internal function, a wrong function pointer has been detected</td></tr>
        <tr><td>ERR_UNKNOWN_COMMAND</td><td>4014</td><td>Unknown instruction</td></tr>
        <tr><td>ERR_NOT_INITIALIZED_ARRAY</td><td>4016</td><td>Not initialized array</td></tr>
        <tr><td>ERR_INVALID_FUNCTION_PARAMSCNT</td><td>4050</td><td>Invalid parameters count passed into built-in function</td></tr>
        <tr><td>ERR_STRING_FUNCTION_INTERNAL</td><td>4052</td><td>String function internal error</td></tr>
        <tr><td>ERR_TRADE_ERROR</td><td>4067</td><td>Trade function internal error</td></tr>
        <tr><td>ERR_SOME_OBJECT_ERROR</td><td>4207</td><td>Object function internal error</td></tr>
        </table>
        <p><br/>
         There are some functions that always change the <i>last_error</i> variable value.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Function</th><th width="85%">Error codes</th></tr>
        <tr><td><a href="help://account_AccountFreeMarginCheck">AccountFreeMarginCheck</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_INTEGER_PARAMETER_EXPECTED (4063), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_UNKNOWN_SYMBOL (4106), ERR_NOT_ENOUGH_MONEY (134)</td></tr>
        <tr><td><a href="help://trading_OrderSend">OrderSend</a></td><td>ERR_CUSTOM_INDICATOR_ERROR (4055), ERR_STRING_PARAMETER_EXPECTED (4062), ERR_INTEGER_PARAMETER_EXPECTED (4063), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INVALID_PRICE_PARAM (4107), ERR_UNKNOWN_SYMBOL (4106), ERR_TRADE_NOT_ALLOWED (4109), ERR_LONGS_NOT_ALLOWED (4110), ERR_SHORTS_NOT_ALLOWED (4111), <a href="help://trading_errors">code returned by trade server</a></td></tr>
        <tr><td><a href="help://trading_OrderClose">OrderClose</a></td><td>ERR_CUSTOM_INDICATOR_ERROR (4055), ERR_INTEGER_PARAMETER_EXPECTED (4063), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INVALID_PRICE_PARAM (4107), ERR_INVALID_TICKET (4108), ERR_UNKNOWN_SYMBOL (4106), ERR_TRADE_NOT_ALLOWED (4109), <a href="help://trading_errors">code returned by trade server</a></td></tr>
        <tr><td><a href="help://trading_OrderCloseBy">OrderCloseBy</a></td><td>ERR_CUSTOM_INDICATOR_ERROR (4055), ERR_INTEGER_PARAMETER_EXPECTED (4063), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INVALID_TICKET (4108), ERR_UNKNOWN_SYMBOL (4106), ERR_TRADE_NOT_ALLOWED (4109), <a href="help://trading_errors">code returned by trade server</a></td></tr>
        <tr><td><a href="help://trading_OrderDelete">OrderDelete</a></td><td>ERR_CUSTOM_INDICATOR_ERROR (4055), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INVALID_TICKET (4108), ERR_UNKNOWN_SYMBOL (4106), ERR_TRADE_NOT_ALLOWED (4109), <a href="help://trading_errors">code returned by trade server</a></td></tr>
        <tr><td><a href="help://trading_OrderModify">OrderModify</a></td><td>ERR_CUSTOM_INDICATOR_ERROR (4055), ERR_INTEGER_PARAMETER_EXPECTED (4063), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INVALID_PRICE_PARAM (4107), ERR_INVALID_TICKET (4108), ERR_UNKNOWN_SYMBOL (4106), ERR_TRADE_NOT_ALLOWED (4109), <a href="help://trading_errors">code returned by trade server</a></td></tr>
        <tr><td><a href="help://check_GetLastError">GetLastError</a></td><td>ERR_NO_ERROR (0)</td></tr>
        </table>
        <p><br/>
         Some functions change value of the <i>last_error</i> variable only if an error occurs.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Function</th><th width="85%">Error codes</th></tr>
        <tr><td><a href="help://array_ArrayBsearch">ArrayBsearch</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://array_ArrayCopy">ArrayCopy</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053), ERR_INCOMPATIBLE_ARRAYS (4056), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://array_ArrayCopyRates">ArrayCopyRates</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053), ERR_INCOMPATIBLE_ARRAYS (4056), ERR_STRING_PARAMETER_EXPECTED (4062),</td></tr>
        <tr><td><a href="help://array_ArrayCopySeries">ArrayCopySeries</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053), ERR_INCORRECT_SERIESARRAY_USING (4054), ERR_INCOMPATIBLE_ARRAYS (4056), ERR_STRING_PARAMETER_EXPECTED (4062), ERR_HISTORY_WILL_UPDATED (4066), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://array_ArrayDimension">ArrayDimension</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053)</td></tr>
        <tr><td><a href="help://array_ArrayGetAsSeries">ArrayGetAsSeries</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053)</td></tr>
        <tr><td><a href="help://array_ArrayInitialize">ArrayInitialize</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://array_ArrayIsSeries">ArrayIsSeries</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053)</td></tr>
        <tr><td><a href="help://array_ArrayMaximum">ArrayMaximum</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://array_ArrayMinimum">ArrayMinimum</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://array_ArrayRange">ArrayRange</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053), ERR_INTEGER_PARAMETER_EXPECTED (4063), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://array_ArrayResize">ArrayResize</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://array_ArraySetAsSeries">ArraySetAsSeries</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053)</td></tr>
        <tr><td><a href="help://array_ArraySize">ArraySize</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053)</td></tr>
        <tr><td><a href="help://array_ArraySort">ArraySort</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053), ERR_INCORRECT_SERIESARRAY_USING (4054), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://files_FileClose">FileClose</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://files_FileDelete">FileDelete</a></td><td>ERR_WRONG_FILE_NAME (4101), ERR_SOME_FILE_ERROR (4100)</td></tr>
        <tr><td><a href="help://files_FileFlush">FileFlush</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://files_FileIsEnding">FileIsEnding</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://files_FileIsLineEnding">FileIsLineEnding</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://files_FileOpen">FileOpen</a></td><td>ERR_TOO_MANY_OPENED_FILES (4102), ERR_WRONG_FILE_NAME (4101), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_SOME_FILE_ERROR (4100), ERR_CANNOT_OPEN_FILE (4103)</td></tr>
        <tr><td><a href="help://files_FileOpenHistory">FileOpenHistory</a></td><td>ERR_TOO_MANY_OPENED_FILES (4102), ERR_WRONG_FILE_NAME (4101), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_SOME_FILE_ERROR (4100), ERR_CANNOT_OPEN_FILE (4103)</td></tr>
        <tr><td><a href="help://files_FileReadArray">FileReadArray</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INCOMPATIBLE_FILEACCESS (4104), ERR_SOME_ARRAY_ERROR (4053), ERR_SOME_FILE_ERROR (4100), ERR_END_OF_FILE (4099)</td></tr>
        <tr><td><a href="help://files_FileReadDouble">FileReadDouble</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INCOMPATIBLE_FILEACCESS (4104), ERR_END_OF_FILE (4099)</td></tr>
        <tr><td><a href="help://files_FileReadInteger">FileReadInteger</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INCOMPATIBLE_FILEACCESS (4104), ERR_END_OF_FILE (4099)</td></tr>
        <tr><td><a href="help://files_FileReadNumber">FileReadNumber</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INCOMPATIBLE_FILEACCESS (4104), ERR_SOME_FILE_ERROR (4100), ERR_END_OF_FILE (4099)</td></tr>
        <tr><td><a href="help://files_FileReadString">FileReadString</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INCOMPATIBLE_FILEACCESS (4104), ERR_SOME_FILE_ERROR (4100), ERR_TOO_LONG_STRING (4011), ERR_END_OF_FILE (4099)</td></tr>
        <tr><td><a href="help://files_FileSeek">FileSeek</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://files_FileSize">FileSize</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://files_FileTell">FileTell</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://files_FileWrite">FileWrite</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_SOME_FILE_ERROR (4100)</td></tr>
        <tr><td><a href="help://files_FileWriteDouble">FileWriteDouble</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INCOMPATIBLE_FILEACCESS (4104), ERR_SOME_FILE_ERROR (4100)</td></tr>
        <tr><td><a href="help://files_FileWriteInteger">FileWriteInteger</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INCOMPATIBLE_FILEACCESS (4104), ERR_SOME_FILE_ERROR (4100)</td></tr>
        <tr><td><a href="help://files_FileWriteString">FileWriteString</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INCOMPATIBLE_FILEACCESS (4104), ERR_SOME_FILE_ERROR (4100), ERR_STRING_PARAMETER_EXPECTED (4062)</td></tr>
        <tr><td><a href="help://files_FileWriteArray">FileWriteArray</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INCOMPATIBLE_FILEACCESS (4104), ERR_SOME_FILE_ERROR (4100),</td></tr>
        <tr><td><a href="help://globals_GlobalVariableCheck">GlobalVariableCheck</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062)</td></tr>
        <tr><td><a href="help://globals_GlobalVariableDel">GlobalVariableDel</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_GLOBAL_VARIABLES_PROCESSING (4057)</td></tr>
        <tr><td><a href="help://globals_GlobalVariableGet">GlobalVariableGet</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_GLOBAL_VARIABLE_NOT_FOUND (4058)</td></tr>
        <tr><td><a href="help://globals_GlobalVariablesDeleteAll">GlobalVariablesDeleteAll</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_GLOBAL_VARIABLES_PROCESSING (4057)</td></tr>
        <tr><td><a href="help://globals_GlobalVariableSet">GlobalVariableSet</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_GLOBAL_VARIABLES_PROCESSING (4057), ERR_GLOBAL_VARIABLE_NOT_FOUND (4058)</td></tr>
        <tr><td><a href="help://globals_GlobalVariableSetOnCondition">GlobalVariableSetOnCondition</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_GLOBAL_VARIABLE_NOT_FOUND (4058)</td></tr>
        <tr><td><a href="help://indicators_iCustom">iCustom</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://indicators">technical indicators</a>, <a href="help://series">series access functions</a></td><td>ERR_HISTORY_WILL_UPDATED (4066)</td></tr>
        <tr><td><a href="help://indicators">technical indicators OnArray</a></td><td>ERR_ARRAY_AS_PARAMETER_EXPECTED (4065), ERR_SOME_ARRAY_ERROR (4053)</td></tr>
        <tr><td><a href="help://customind_IndicatorBuffers">IndicatorBuffers</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://customind_IndicatorDigits">IndicatorDigits</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://customind_IndicatorShortName">IndicatorShortName</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://common_MarketInfo">MarketInfo</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_FUNC_NOT_ALLOWED_IN_TESTING (4059), ERR_UNKNOWN_SYMBOL (4106), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://math_MathArccos">MathArccos</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://math_MathArcsin">MathArcsin</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://math_MathMod">MathMod</a></td><td>ERR_ZERO_DIVIDE (4013)</td></tr>
        <tr><td><a href="help://math_MathSqrt">MathSqrt</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://common_MessageBox">MessageBox</a></td><td>ERR_FUNC_NOT_ALLOWED_IN_TESTING (4059), ERR_CUSTOM_INDICATOR_ERROR (4055), ERR_STRING_PARAMETER_EXPECTED (4062)</td></tr>
        <tr><td><a href="help://objects_ObjectCreate">ObjectCreate</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_UNKNOWN_OBJECT_TYPE (4203), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_OBJECT_ALREADY_EXISTS (4200), ERR_NO_SPECIFIED_SUBWINDOW (4206)</td></tr>
        <tr><td><a href="help://objects_ObjectDelete">ObjectDelete</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_OBJECT_DOES_NOT_EXIST (4202)</td></tr>
        <tr><td><a href="help://objects_ObjectDescription">ObjectDescription</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_OBJECT_DOES_NOT_EXIST (4202)</td></tr>
        <tr><td><a href="help://objects_ObjectFind">ObjectFind</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204)</td></tr>
        <tr><td><a href="help://objects_ObjectGet">ObjectGet</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_OBJECT_DOES_NOT_EXIST (4202), ERR_UNKNOWN_OBJECT_PROPERTY (4201)</td></tr>
        <tr><td><a href="help://objects_ObjectGetFiboDescription">ObjectGetFiboDescription</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_OBJECT_DOES_NOT_EXIST (4202), ERR_UNKNOWN_OBJECT_TYPE (4203), ERR_UNKNOWN_OBJECT_PROPERTY (4201)</td></tr>
        <tr><td><a href="help://objects_ObjectGetShiftByValue">ObjectGetShiftByValue</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_OBJECT_DOES_NOT_EXIST (4202), ERR_OBJECT_COORDINATES_ERROR (4205)</td></tr>
        <tr><td><a href="help://objects_ObjectGetValueByShift">ObjectGetValueByShift</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_OBJECT_DOES_NOT_EXIST (4202), ERR_OBJECT_COORDINATES_ERROR (4205)</td></tr>
        <tr><td><a href="help://objects_ObjectMove">ObjectMove</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_OBJECT_DOES_NOT_EXIST (4202)</td></tr>
        <tr><td><a href="help://objects_ObjectName">ObjectName</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_ARRAY_INDEX_OUT_OF_RANGE (4002)</td></tr>
        <tr><td><a href="help://objects_ObjectSet">ObjectSet</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_OBJECT_DOES_NOT_EXIST (4202), ERR_UNKNOWN_OBJECT_PROPERTY (4201)</td></tr>
        <tr><td><a href="help://objects_ObjectSetText">ObjectSetText</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_OBJECT_DOES_NOT_EXIST (4202)</td></tr>
        <tr><td><a href="help://objects_ObjectSetFiboDescription">ObjectSetFiboDescription</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_STRING_PARAMETER_EXPECTED (4062), ERR_OBJECT_DOES_NOT_EXIST (4202), ERR_UNKNOWN_OBJECT_TYPE (4203), ERR_UNKNOWN_OBJECT_PROPERTY (4201)</td></tr>
        <tr><td><a href="help://objects_ObjectType">ObjectType</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NO_OBJECT_NAME (4204), ERR_OBJECT_DOES_NOT_EXIST (4202)</td></tr>
        <tr><td><a href="help://trading_OrderClosePrice">OrderClosePrice</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderCloseTime">OrderCloseTime</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderComment">OrderComment</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderCommission">OrderCommission</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderExpiration">OrderExpiration</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderLots">OrderLots</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderMagicNumber">OrderMagicNumber</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderOpenPrice">OrderOpenPrice</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderOpenTime">OrderOpenTime</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderPrint">OrderPrint</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderProfit">OrderProfit</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderStopLoss">OrderStopLoss</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderSwap">OrderSwap</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderSymbol">OrderSymbol</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderTakeProfit">OrderTakeProfit</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderTicket">OrderTicket</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://trading_OrderType">OrderType</a></td><td>ERR_NO_ORDER_SELECTED (4105)</td></tr>
        <tr><td><a href="help://common_PlaySound">PlaySound</a></td><td>ERR_WRONG_FILE_NAME (4101)</td></tr>
        <tr><td><a href="help://common_SendFTP">SendFTP</a></td><td>ERR_FUNC_NOT_ALLOWED_IN_TESTING (4059), ERR_CUSTOM_INDICATOR_ERROR (4055), ERR_STRING_PARAMETER_EXPECTED (4062)</td></tr>
        <tr><td><a href="help://common_SendMail">SendMail</a></td><td>ERR_FUNC_NOT_ALLOWED_IN_TESTING (4059), ERR_STRING_PARAMETER_EXPECTED (4062), ERR_FUNCTION_NOT_CONFIRMED (4060), ERR_SEND_MAIL_ERROR (4061)</td></tr>
        <tr><td><a href="help://customind_SetIndexArrow">SetIndexArrow</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://customind_SetIndexBuffer">SetIndexBuffer</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_INCORRECT_SERIESARRAY_USING (4054), ERR_INCOMPATIBLE_ARRAYS (4056)</td></tr>
        <tr><td><a href="help://customind_SetIndexDrawBegin">SetIndexDrawBegin</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://customind_SetIndexEmptyValue">SetIndexEmptyValue</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://customind_SetIndexLabel">SetIndexLabel</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_STRING_PARAMETER_EXPECTED (4062)</td></tr>
        <tr><td><a href="help://customind_SetIndexShift">SetIndexShift</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://customind_SetIndexStyle">SetIndexStyle</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://customind_SetLevelValue">SetLevelValue</a></td><td>ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        <tr><td><a href="help://common_Sleep">Sleep</a></td><td>ERR_CUSTOM_INDICATOR_ERROR (4055)</td></tr>
        <tr><td><a href="help://strings_StringFind">StringFind</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062)</td></tr>
        <tr><td><a href="help://strings_StringGetChar">StringGetChar</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NOT_INITIALIZED_STRING (4008), ERR_ARRAY_INDEX_OUT_OF_RANGE (4002)</td></tr>
        <tr><td><a href="help://strings_StringLen">StringLen</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062)</td></tr>
        <tr><td><a href="help://strings_StringSetChar">StringSetChar</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_INVALID_FUNCTION_PARAMVALUE (4051), ERR_NOT_INITIALIZED_STRING (4008), ERR_TOO_LONG_STRING (4011), ERR_ARRAY_INDEX_OUT_OF_RANGE (4002)</td></tr>
        <tr><td><a href="help://strings_StringSubstr">StringSubstr</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062), ERR_TOO_LONG_STRING (4011)</td></tr>
        <tr><td><a href="help://strings_StringTrimLeft">StringTrimLeft</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062)</td></tr>
        <tr><td><a href="help://strings_StringTrimRight">StringTrimRight</a></td><td>ERR_STRING_PARAMETER_EXPECTED (4062)</td></tr>
        <tr><td><a href="help://windows_WindowIsVisible">WindowIsVisible</a></td><td>ERR_FUNC_NOT_ALLOWED_IN_TESTING (4059)</td></tr>
        <tr><td><a href="help://windows_WindowFind">WindowFind</a></td><td>ERR_FUNC_NOT_ALLOWED_IN_TESTING (4059), ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NOT_INITIALIZED_STRING (4008)</td></tr>
        <tr><td><a href="help://windows_WindowHandle">WindowHandle</a></td><td>ERR_FUNC_NOT_ALLOWED_IN_TESTING (4059), ERR_STRING_PARAMETER_EXPECTED (4062), ERR_NOT_INITIALIZED_STRING (4008)</td></tr>
        <tr><td><a href="help://windows_WindowScreenShot">WindowScreenShot</a></td><td>ERR_WRONG_FILE_NAME (4101), ERR_INVALID_FUNCTION_PARAMVALUE (4051)</td></tr>
        </table>
        <p><br/>
         Other functions never change the <i>last_error</i> variable value.<br/>
         <a href="help://account_AccountBalance">AccountBalance</a>,
         <a href="help://account_AccountCompany">AccountCompany</a>,
         <a href="help://account_AccountCredit">AccountCredit</a>,
         <a href="help://account_AccountCurrency">AccountCurrency</a>,
         <a href="help://account_AccountEquity">AccountEquity</a>,
         <a href="help://account_AccountFreeMargin">AccountFreeMargin</a>,
         <a href="help://account_AccountLeverage">AccountLeverage</a>,
         <a href="help://account_AccountMargin">AccountMargin</a>,
         <a href="help://account_AccountName">AccountName</a>,
         <a href="help://account_AccountNumber">AccountNumber</a>,
         <a href="help://account_AccountProfit">AccountProfit</a>,
         <a href="help://account_AccountServer">AccountServer</a>,
         <a href="help://common_Alert">Alert</a>,
         <a href="help://convert_CharToStr">CharToStr</a>,
         <a href="help://common_Comment">Comment</a>,
         <a href="help://dateandtime_Day">Day</a>,
         <a href="help://dateandtime_DayOfWeek">DayOfWeek</a>,
         <a href="help://dateandtime_DayOfYear">DayOfYear</a>,
         <a href="help://convert_DoubleToStr">DoubleToStr</a>,
         <a href="help://common_GetTickCount">GetTickCount</a>,
         <a href="help://windows_HideTestIndicators">HideTestIndicators</a>,
         <a href="help://dateandtime_Hour">Hour</a>,
         <a href="help://customind_IndicatorCounted">IndicatorCounted</a>,
         <a href="help://check_IsConnected">IsConnected</a>,
         <a href="help://check_IsDemo">IsDemo</a>,
         <a href="help://check_IsDllsAllowed">IsDllsAllowed</a>,
         <a href="help://check_IsExpertEnabled">IsExpertEnabled</a>,
         <a href="help://check_IsLibrariesAllowed">IsLibrariesAllowed</a>,
         <a href="help://check_IsOptimization">IsOptimization</a>,
         <a href="help://check_IsStopped">IsStopped</a>,
         <a href="help://check_IsTesting">IsTesting</a>,
         <a href="help://check_IsTradeAllowed">IsTradeAllowed</a>,
         <a href="help://check_IsTradeContextBusy">IsTradeContextBusy</a>,
         <a href="help://check_IsVisualMode">IsVisualMode</a>,
         <a href="help://math_MathAbs">MathAbs</a>,
         <a href="help://math_MathArctan">MathArctan</a>,
         <a href="help://math_MathCeil">MathCeil</a>,
         <a href="help://math_MathCos">MathCos</a>,
         <a href="help://math_MathExp">MathExp</a>,
         <a href="help://math_MathFloor">MathFloor</a>,
         <a href="help://math_MathLog">MathLog</a>,
         <a href="help://math_MathMax">MathMax</a>,
         <a href="help://math_MathMin">MathMin</a>,
         <a href="help://math_MathPow">MathPow</a>,
         <a href="help://math_MathRand">MathRand</a>,
         <a href="help://math_MathRound">MathRound</a>,
         <a href="help://math_MathSin">MathSin</a>,
         <a href="help://math_MathSrand">MathSrand</a>,
         <a href="help://math_MathTan">MathTan</a>,
         <a href="help://dateandtime_Minute">Minute</a>,
         <a href="help://dateandtime_Month">Month</a>,
         <a href="help://convert_NormalizeDouble">NormalizeDouble</a>,
         <a href="help://objects_ObjectsDeleteAll">ObjectsDeleteAll</a>,
         <a href="help://objects_ObjectsTotal">ObjectsTotal</a>,
         <a href="help://trading_OrderSelect">OrderSelect</a>,
         <a href="help://trading_OrdersHistoryTotal">OrdersHistoryTotal</a>,
         <a href="help://windows_Period">Period</a>,
         <a href="help://common_Print">Print</a>,
         <a href="help://windows_RefreshRates">RefreshRates</a>,
         <a href="help://dateandtime_Seconds">Seconds</a>,
         <a href="help://customind_SetLevelStyle">SetLevelStyle</a>,
         <a href="help://strings_StringConcatenate">StringConcatenate</a>,
         <a href="help://convert_StrToTime">StrToTime</a>,
         <a href="help://convert_StrToDouble">StrToDouble</a>,
         <a href="help://windows_Symbol">Symbol</a>,
         <a href="help://terminal_TerminalCompany">TerminalCompany</a>,
         <a href="help://terminal_TerminalName">TerminalName</a>,
         <a href="help://terminal_TerminalPath">TerminalPath</a>,
         <a href="help://dateandtime_TimeCurrent">TimeCurrent</a>,
         <a href="help://dateandtime_TimeDay">TimeDay</a>,
         <a href="help://dateandtime_TimeDayOfWeek">TimeDayOfWeek</a>,
         <a href="help://dateandtime_TimeDayOfYear">TimeDayOfYear</a>,
         <a href="help://dateandtime_TimeHour">TimeHour</a>,
         <a href="help://dateandtime_TimeLocal">TimeLocal</a>,
         <a href="help://dateandtime_TimeMinute">TimeMinute</a>,
         <a href="help://dateandtime_TimeMonth">TimeMonth</a>,
         <a href="help://dateandtime_TimeSeconds">TimeSeconds</a>,
         <a href="help://convert_TimeToStr">TimeToStr</a>,
         <a href="help://dateandtime_TimeYear">TimeYear</a>,
         <a href="help://check_UninitializeReason">UninitializeReason</a>,
         <a href="help://windows_WindowBarsPerChart">WindowBarsPerChart</a>,
         <a href="help://windows_WindowFirstVisibleBar">WindowFirstVisibleBar</a>,
         <a href="help://windows_WindowPriceOnDropped">WindowPriceOnDropped</a>,
         <a href="help://windows_WindowRedraw">WindowRedraw</a>,
         <a href="help://windows_WindowTimeOnDropped">WindowTimeOnDropped</a>,
         <a href="help://windows_WindowsTotal">WindowsTotal</a>,
         <a href="help://windows_WindowOnDropped">WindowOnDropped</a>,
         <a href="help://windows_WindowXOnDropped">WindowXOnDropped</a>,
         <a href="help://windows_WindowYOnDropped">WindowYOnDropped</a>,
         <a href="help://dateandtime_Year">Year</a>
        </p>
      </content>
    </text>
  </group>
  
  <group>
    tag=account
    caption=Account information
    <content>
    A group of functions to access to the active account information.
    </content>
    <function>
      tag=account_AccountBalance
      caption=AccountBalance()
      type=double
      keywords=;AccountBalance();AccountBalance;
      <content>
      Returns balance value of the current account (the amount of money on the account).
      </content>
      example=Print(&quot;Account balance = &quot;,AccountBalance());
    </function>

    <function>
      tag=account_AccountCredit
      caption=AccountCredit()
      keywords=;AccountCredit;
      type=double
      <content>
      Returns credit value of the current account.
      </content>
      example=Print(&quot;Account number &quot;, AccountCredit());
    </function>

    <function>
      tag=account_AccountCompany
      caption=AccountCompany()
      type=string
      <content>
      Returns the brokerage company name where the current account was registered.
      </content>
      example=Print(&quot;Account company name &quot;, AccountCompany());
    </function>

    <function>
      tag=account_AccountCurrency
      caption=AccountCurrency()
      keywords=;AccountCurrency;
      type=string
      <content>
      Returns currency name of the current account.
      </content>
      example=Print(&quot;account currency is &quot;, AccountCurrency());
    </function>

    <function>
      tag=account_AccountEquity
      caption=AccountEquity()
      keywords=;AccountEquity;
      type=double
      <content>
      Returns equity value of the current account. Equity calculation depends on trading server settings.
      </content>
      example=Print(&quot;Account equity = &quot;,AccountEquity());
    </function>

    <function>
      tag=account_AccountFreeMargin
      caption=AccountFreeMargin()
      type=double
      keywords=;AccountFreeMargin;
      <content>
      Returns free margin value of the current account.
      </content>
      example=Print(&quot;Account free margin = &quot;,AccountFreeMargin());
    </function>

    <function>
      tag=account_AccountFreeMarginCheck
      caption=AccountFreeMarginCheck()
      type=double
      keywords=;AccountFreeMarginCheck;
      <content>
      Returns free margin that remains after the specified position has been opened at the current price on the current account. If the free margin
      is insufficient, an <a href="help://constants_errors">error</a> 134 (ERR_NOT_ENOUGH_MONEY) will be generated.
      </content>
      example=if(AccountFreeMarginCheck(Symbol(),OP_BUY,Lots)&lt;=0 || GetLastError()==134) return;
      <parameter>
        type=string
        name=symbol
        description=Symbol for trading operation.
      </parameter>
      <parameter>
        type=int
        name=cmd
        <description>
Operation type. It can be either <a href="help://constants_trading">OP_BUY</a> or <a href="help://constants_trading">OP_SELL</a>.
        </description>
      </parameter>
      <parameter>
        type=double
        name=volume
        description=Number of lots.
      </parameter>
    </function>

    <function>
      tag=account_AccountFreeMarginMode
      caption=AccountFreeMarginMode()
      type=double
      keywords=;AccountFreeMarginMode;
      <content>
      Calculation mode of free margin allowed to open positions on the current account. The calculation mode can take the following values:<br/><br/>
      0 - floating profit/loss is not used for calculation;<br/>
      1 - both floating profit and loss on open positions on the current account are used for free margin calculation;<br/>
      2 - only profit value is used for calculation, the current loss on open positions is not considered;<br/>
      3 - only loss value is used for calculation, the current loss on open positions is not considered.
      </content>
      <example>
if(AccountFreeMarginMode()==0)
   Print(&quot;Floating Profit/Loss do not use.&quot;);
      </example>
    </function>

    <function>
      tag=account_AccountLeverage
      caption=AccountLeverage()
      type=int
      keywords=;AccountLeverage;
      <content>
      Returns leverage of the current account.
      </content>
      example=Print(&quot;Account #&quot;,AccountNumber(), &quot; leverage is &quot;, AccountLeverage());
    </function>

    <function>
      tag=account_AccountMargin
      caption=AccountMargin()
      type=double
      <content>
      Returns margin value of the current account.
      </content>
      example=Print(&quot;Account margin &quot;, AccountMargin());
    </function>

    <function>
      tag=account_AccountName
      caption=AccountName()
      type=string
      <content>
      Returns the current account name.
      </content>
      example=Print(&quot;Account name &quot;, AccountName());
    </function>

    <function>
      tag=account_AccountNumber
      caption=AccountNumber()
      type=int
      <content>
      Returns the number of the current account.
      </content>
      example=Print(&quot;account number &quot;, AccountNumber());
    </function>

    <function>
      tag=account_AccountProfit
      caption=AccountProfit()
      type=double
      <content>
      Returns profit value of the current account.
      </content>
      example=Print(&quot;Account profit &quot;, AccountProfit());
    </function>

    <function>
      tag=account_AccountServer
      caption=AccountServer()
      type=string
      <content>
      Returns the connected server name.
      </content>
      example=Print(&quot;Server name is &quot;, AccountServer());
    </function>

    <function>
      tag=account_AccountStopoutLevel
      caption=AccountStopoutLevel()
      type=int
      <content>
      Returns the value of the Stop Out level.
      </content>
      example=Print(&quot;StopOut level = &quot;, AccountStopoutLevel());
    </function>

    <function>
      tag=account_AccountStopoutMode
      caption=AccountStopoutMode()
      type=int
      <content>
      Returns the calculation mode for the Stop Out level. Calculation mode can take the following values:<br/><br/>
      0 - calculation of percentage ratio between margin and equity;<br/>
      1 - comparison of the free margin level to the absolute value.
      </content>
      <example>
int level=AccountStopoutLevel();
if(AccountStopoutMode()==0)
   Print(&quot;StopOut level = &quot;, level, &quot;%&quot;);
else
   Print(&quot;StopOut level = &quot;, level, &quot; &quot;, AccountCurrency());
      </example>
    </function>
  </group>


  <group>
    tag=array
    caption=Array functions
    <content>
    A group of functions to work with arrays.<br/><br/>
    Arrays are allowed to be maximum four-dimensional. Each dimension is indexed from 0 to <b>dimension size</b>-1.
    In a particular case of a one-dimensional array of 50 elements, calling of the first element will appear as array[0], of the last one - as array[49].<br/><br/>
    Using these functions (except for those which change quantitative and qualitative characteristics of the array) one can process 
    predefined time series <a href="help://predefined_variables_time">Time[]</a>, <a href="help://predefined_variables_open">Open[]</a>,
    <a href="help://predefined_variables_high">High[]</a>, <a href="help://predefined_variables_low">Low[]</a>,
    <a href="help://predefined_variables_close">Close[]</a>, <a href="help://predefined_variables_volume">Volume[]</a>
    </content>
    <function>
      tag=array_ArrayBsearch
      caption=ArrayBsearch()
      type=int
      <content>
        If the element with the specified value doesn't exist in the array, the function returns the index of the nearest smallest value of the elements between which the searched value is located.<br/>
        The function cannot be used with string arrays and series arrays (with the exception of the series array of the bar open time).<br/>
        Note: Binary search processes only sorted arrays.
        To sort numeric arrays use the <a href="help://array_ArraySort">ArraySort()</a> function.
      </content>
      <example>
   datetime daytimes[];
   int      shift=10,dayshift;
   // All the Time[] series are sorted in descendant mode
   ArrayCopySeries(daytimes,MODE_TIME,Symbol(),PERIOD_D1);
   if(Time[shift]&gt;=daytimes[0]) dayshift=0;
   else
     {
      dayshift=ArrayBsearch(daytimes,Time[shift],WHOLE_ARRAY,0,MODE_DESCEND);
      if(Period()&lt;PERIOD_D1) dayshift++;
     }
   Print(TimeToStr(Time[shift]),&quot; corresponds to &quot;,dayshift,&quot; day bar opened at &quot;,
         TimeToStr(daytimes[dayshift]));
      </example>
      <parameter>
        type=double
        name=<nobr>array[]</nobr>
        description=The numeric array to search for.
      </parameter>
      <parameter>
        type=double
        name=value
        description=The value to search for.
      </parameter>
      <parameter>
        type=int
        name=count
        def_value=WHOLE_ARRAY
        description=Count of elements to search for. By default, it searches in the whole array.
      </parameter>
      <parameter>
        type=int
        name=start
        def_value=0
        description=Starting index to search for. By default, the search starts at the first element.
      </parameter>
      <parameter>
        type=int
        name=direction
        def_value=MODE_ASCEND
        <description>
Search direction. It can be any of the following values:<br/>
MODE_ASCEND searching in forward direction,<br/>
MODE_DESCEND searching in backward direction.
        </description>
      </parameter>
    </function>

    <function>
      tag=array_ArrayCopy
      caption=ArrayCopy()
      type=int
      <content>
Copies an array to another one. Arrays must be of the same type, but arrays with type double[],
int[], datetime[], color[], and bool[] can be copied as arrays of the same type.<br/>
Returns the amount of copied elements.
      </content>
      <example>
  double array1[][6];
  double array2[10][6];
  // array2 is filled with some data
  ArrayCopyRates(array1);
  ArrayCopy(array2,array1,0,0,60);
  // array2 is having the first 10 bars from the history now (first bar considered as bar with index [Bars-1])
  ArrayCopy(array2,array1,0,Bars*6-60,60);
  // array2 is having the last 10 bars from the history now (last bar considered as current bar, bar wit index [0])
      </example>
      <parameter>
        type=object&amp;
        name=<nobr>dest[]</nobr>
        description=Destination array.
      </parameter>
      <parameter>
        type=object
        name=<nobr>source[]</nobr>
        description=Source array.
      </parameter>
      <parameter>
        type=int
        name=start_dest
        def_value=0
        description=Starting index for the destination array. By default, start index is 0.
      </parameter>
      <parameter>
        type=int
        name=start_source
        def_value=0
        description=Starting index for the source array. By default, start index is 0.
      </parameter>
      <parameter>
        type=int
        name=count
        def_value=WHOLE_ARRAY
        description=The count of elements that should be copied. By default, it is WHOLE_ARRAY constant.
      </parameter>
    </function>

    <function>
      tag=array_ArrayCopyRates
      caption=ArrayCopyRates()
      type=int
      <content>
Copies rates to the two-dimensional array from chart RateInfo array and returns copied bars amount, or -1 if failed.
First dimension of RateInfo array contains bars amount, second dimension has 6 elements:<br/>
0 - time,<br/>
1 - open,<br/>
2 - low,<br/>
3 - high,<br/>
4 - close,<br/>
5 - volume.<br/><br/>
If data (symbol name and/or timeframe differ from the current ones) are requested from another chart, the situation is possible 
that the corresponding chart was not opened in the client terminal and the necessary data must be requested from the server. In this case, 
<a href="help://constants_errors">error</a> ERR_HISTORY_WILL_UPDATED (4066 - the requested history data are under updating) will be placed 
in the <a href="help://runtime_errors">last_error</a> variable, and one will has to re-request (see example of <a href="help://array_ArrayCopySeries">ArrayCopySeries()</a>).<br/><br/>
Notes: This rates array is normally used to pass data to a DLL function.<br/>
Memory is not really allocated for data array, and no real copying is performed. When such an array is accessed, the access will be redirected.
      </content>
      <example>
  double array1[][6];
  ArrayCopyRates(array1,"EURUSD", PERIOD_H1);
  Print("Current bar ",TimeToStr(array1[0][0]),"Open", array1[0][1]);
      </example>
      <parameter>
        type=double&amp;
        name=<nobr>dest_array[]</nobr>
        description=Reference to the two-dimensional destination array of double type.
      </parameter>
      <parameter>
        type=string
        name=symbol
        def_value=NULL
        description=Symbol name (currency pair name)
      </parameter>
      <parameter>
        type=int
        name=timeframe
        def_value=0
        description=Timeframe. It can be any of the <a href="help://constants_timeframes">listed timeframes</a> values.
      </parameter>
    </function>

    <function>
      tag=array_ArrayCopySeries
      caption=ArrayCopySeries()
      type=int
      <content>
        Copies a series array to another one and returns the count of the copied elements.<br/><br/>

        There is no real memory allocation for data array and nothing is copied. When such an array is accessed,
        the access is redirected. Excluded are arrays that are <a href="help://customind_SetIndexBuffer">assigned as indexed ones</a>
        in custom indicators. In this case, data are really copied.<br/><br/>
        If data are copied from another chart with different symbol and/or timeframe, it is possible that the necessary data will lack.
        In this case, <a href="help://constants_errors">error</a> ERR_HISTORY_WILL_UPDATED (4066 - requested history data 
        under updating) will be placed into the <a href="help://runtime_errors">last_error</a> variable, 
        and there will be necessary to retry copying after a certain period of time.<br/><br/>
        
        Note: If series_index is MODE_TIME, the array to be passed to the function must be of the datetime type. 
      </content>
      <example>
datetime daytimes[];
int      shift=10,dayshift,error;
//---- the Time[] array was sroted in the descending order
ArrayCopySeries(daytimes,MODE_TIME,Symbol(),PERIOD_D1);
error=GetLastError();
if(error==4066)
  {
   //---- make two more attempts to read
   for(int i=0;i&lt;2; i++)
     {
      Sleep(5000);
      ArrayCopySeries(daytimes,MODE_TIME,Symbol(),PERIOD_D1);
      //---- check the current daily bar time 
      datetime last_day=daytimes[0];
      if(Year()==TimeYear(last_day) &amp;&amp; Month()==TimeMonth(last_day) &amp;&amp; Day()==TimeDay(last_day)) break;
     }
  }
if(Time[shift]&gt;=daytimes[0]) dayshift=0;
else
  {
   dayshift=ArrayBsearch(daytimes,Time[shift],WHOLE_ARRAY,0,MODE_DESCEND);
   if(Period()&lt;PERIOD_D1) dayshift++;
  }
Print(TimeToStr(Time[shift])," corresponds to ",dayshift," day bar opened at ", TimeToStr(daytimes[dayshift]));
      </example>
      <parameter>
        type=double&amp;
        name=<nobr>array[]</nobr>
        description=Reference to the destination one-dimensional numeric array.
      </parameter>
      <parameter>
        type=int
        name=series_index
        description=Series array identifier. It must be one of <a href="help://constants_series">series array</a> listed identifiers values.
      </parameter>
      <parameter>
        type=string
        name=symbol
        def_value=NULL
        description=Symbol name (the name of the currency pair)
      </parameter>
      <parameter>
        type=int
        name=timeframe
        def_value=0
        description=Timeframe of the chart. It can be any of <a href="help://constants_timeframes">Timeframe list</a> values.
      </parameter>
    </function>

    <function>
      tag=array_ArrayDimension
      caption=ArrayDimension()
      type=int
      <content>
      Returns the multidimensional array rank.
      </content>
      <example>
int num_array[10][5];
int dim_size;
dim_size=ArrayDimension(num_array);
// dim_size=2
      </example>
      <parameter>
        type=object
        name=<nobr>array[]</nobr>
        description=Array for which the rank will be returned.
      </parameter>
    </function>

    <function>
      tag=array_ArrayGetAsSeries
      caption=ArrayGetAsSeries()
      type=bool
      <content>
        Returns TRUE if array is organized as a series array (array elements are indexed from the last to the first one), otherwise returns FALSE.
      </content>
      <example>
  if(ArrayGetAsSeries(array1)==true)
    Print(&quot;array1 is indexed as a series array&quot;);
  else
    Print(&quot;array1 is indexed normally (from left to right)&quot;);
      </example>
      <parameter>
        type=object
        name=<nobr>array[]</nobr>
        description=Array to be checked.
      </parameter>
    </function>

    <function>
      tag=array_ArrayInitialize
      caption=ArrayInitialize()
      type=int
      <content>
        Sets all elements of a numeric array to the same value. Returns the count of initialized elements.<br/>
      Note: It is not recommended to initialize index buffers in the custom indicator <i>init()</i> function
        as such functions are initialized automatically with an <a href="help://customind_SetIndexEmptyValue">&quot;empty value&quot;</a> 
      at allocation and re-allocation of buffers.
      </content>
      <example>
  //---- initializing of all array elements with 2.1
  double myarray[10];
  ArrayInitialize(myarray,2.1);
      </example>
      <parameter>
        type=double&amp;
        name=<nobr>array[]</nobr>
        description=Numeric array to be initialized.
      </parameter>
      <parameter>
        type=double
        name=value
        description=New value to be set.
      </parameter>
    </function>

    <function>
      tag=array_ArrayIsSeries
      caption=ArrayIsSeries()
      type=bool
      <content>
      Returns TRUE if the array under check is a series array (Time[],Open[],Close[],High[],Low[], or Volume[]), otherwise returns FALSE.
      </content>
      <example>
   if(ArrayIsSeries(array1)==false)
     ArrayInitialize(array1,0);
   else
     {
      Print("Series array cannot be initialized!");
      return(-1);
     }
      </example>
      <parameter>
        type=object
        name=<nobr>array[]</nobr>
        description=Array under check.
      </parameter>
    </function>

    <function>
      tag=array_ArrayMaximum
      caption=ArrayMaximum()
      type=int
      <content>
      Searches for the element with maximum value. The function returns position of this maximum element in the array.
      </content>
      <example>
double num_array[15]={4,1,6,3,9,4,1,6,3,9,4,1,6,3,9};
int    maxValueIdx=ArrayMaximum(num_array);
Print(&quot;Max value = &quot;, num_array[maxValueIdx]);
      </example>
      <parameter>
        type=double
        name=<nobr>array[]</nobr>
        description=The numeric array to search in.
      </parameter>
      <parameter>
        type=int
        name=count
        def_value=WHOLE_ARRAY
        description=The amount of elements to search in.
      </parameter>
      <parameter>
        type=int
        name=start
        def_value=0
        description=Initial search index.
      </parameter>
    </function>

    <function>
      tag=array_ArrayMinimum
      caption=ArrayMinimum()
      type=int
      <content>
      Searches for the element with minimum value. The function returns position of this minimum element in the array.
      </content>
      <example>
double num_array[15]={4,1,6,3,9,4,1,6,3,9,4,1,6,3,9};
int    minValueidx=ArrayMinimum(num_array);
Print(&quot;Min value = &quot;, num_array[minValueIdx]);
      </example>
      <parameter>
        type=double
        name=<nobr>array[]</nobr>
        description=The numeric array to search in.
      </parameter>
      <parameter>
        type=int
        name=count
        def_value=WHOLE_ARRAY
        description=The amount of elements to search in.
      </parameter>
      <parameter>
        type=int
        name=start
        def_value=0
        description=Initial search index.
      </parameter>
    </function>

    <function>
      tag=array_ArrayRange
      caption=ArrayRange()
      type=int
      <content>
        Returns the count of elements in the given dimension of the array.
        Since indexes are zero-based, the size of dimension is 1 greater than the largest index.
      </content>
      <example>
int    dim_size;
double num_array[10,10,10];
dim_size=ArrayRange(num_array, 1);
      </example>
      <parameter>
        type=object
        name=<nobr>array[]</nobr>
        description=Array to check
      </parameter>
      <parameter>
        type=int
        name=range_index
        description=Dimension index.
      </parameter>
    </function>

    <function>
      tag=array_ArrayResize
      caption=ArrayResize()
      type=int
      <content>
        Sets a new size for the first dimension. If executed successfully, it returns count of all elements contained 
        in the array after resizing, otherwise, returns -1, and array is not resized.<br/>
        Note: Array declared at a local level in a function and resized will remain unchanged after the function has completed its operation.
        After the function has been recalled, such array will have a size differing from the declared one.
      </content>
      <example>
double array1[][4];
int    element_count=ArrayResize(array1, 20);
// new size - 80 elements
      </example>
      <parameter>
        type=object&amp;
        name=<nobr>array[]</nobr>
        description=Array to resize.
      </parameter>
      <parameter>
        type=int
        name=new_size
        description=New size for the first dimension.
      </parameter>
    </function>

    <function>
      tag=array_ArraySetAsSeries
      caption=ArraySetAsSeries()
      type=bool
      <content>
        Sets indexing direction of the array. If the <i>set</i> parameter has the TRUE value, the array will be indexed in a reversed order,
        i.e., the last element has a zero index. The FALSE value sets a standard indexing order. The function returns the previous status.
      </content>
      <example>
double macd_buffer[300];
double signal_buffer[300];
int    i,limit=ArraySize(macd_buffer);
ArraySetAsSeries(macd_buffer,true);
 
for(i=0; i&lt;limit; i++)
   macd_buffer[i]=iMA(NULL,0,12,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,26,0,MODE_EMA,PRICE_CLOSE,i);
   
for(i=0; i&lt;limit; i++)
   signal_buffer[i]=iMAOnArray(macd_buffer,limit,9,0,MODE_SMA,i);
      </example>
      <parameter>
        type=double&amp;
        name=<nobr>array[]</nobr>
        description=The numeric array to set.
      </parameter>
      <parameter>
        type=bool
        name=set
        description=Array indexing order.
      </parameter>
    </function>

    <function>
      tag=array_ArraySize
      caption=ArraySize()
      type=int
      <content>
      Returns the count of elements contained in the array. For a one-dimensional array, the value to be returned by the ArraySize function
      is equal to that of <a href="help://array_ArrayRange">ArrayRange(array,0)</a>.
      </content>
      <example>
int count=ArraySize(array1);
for(int i=0; i&lt;count; i++)
  {
   // some calculations.
  }
      </example>
      <parameter>
        type=object
        name=<nobr>array[]</nobr>
        description=Array of any type.
      </parameter>
    </function>

    <function>
      tag=array_ArraySort
      caption=ArraySort()
      type=int
      keywords=;ArraySort();MODE_ASCEND;MODE_DESCEND;
      <content>
      Sorts numeric arrays by first dimension. Series arrays cannot be sorted by ArraySort().
      </content>
      <example>
  double num_array[5]={4,1,6,3,9};
  // now array contains values 4,1,6,3,9
  ArraySort(num_array);
  // now array is sorted 1,3,4,6,9
  ArraySort(num_array,WHOLE_ARRAY,0,MODE_DESCEND);
  // now array is sorted 9,6,4,3,1
      </example>
      <parameter>
        type=double&amp;
        name=<nobr>array[]</nobr>
        description=The numeric array to be sorted.
      </parameter>
      <parameter>
        type=int
        name=count
        def_value=WHOLE_ARRAY
        description=Count of elements to be sorted.
      </parameter>
      <parameter>
        type=int
        name=start
        def_value=0
        description=Starting index.
      </parameter>
      <parameter>
        type=int
        name=sort_dir
        def_value=MODE_ASCEND
        <description>
Array sorting direction. It can be any of the following values:<br/>
MODE_ASCEND - sort ascending,<br/>
MODE_DESCEND - sort descending.
        </description>
      </parameter>
    </function>
  </group>

  <group>
    tag=check
    caption=Checkup
    <content>
    A group of functions that allow determining of the current status of the client terminal, including the environment status of the MQL4 program.
    </content>

    <function>
      tag=check_GetLastError
      caption=GetLastError()
      type=int
      <content>
        The function returns the <a href="help://constants_errors">last occurred error</a>, then the value of special 
      <a href="help://runtime_errors">last_error</a> variable where the last error code is stored will be zeroized. 
      So, the next call for GetLastError() will return 0.
      </content>
      <example>
  int err;
  int handle=FileOpen(&quot;somefile.dat&quot;, FILE_READ|FILE_BIN);
  if(handle&lt;1)
    {
     err=GetLastError();
     Print(&quot;error(&quot;,err,&quot;): &quot;,ErrorDescription(err));
     return(0);
    }
      </example>
    </function>

    <function>
      tag=check_IsConnected
      caption=IsConnected()
      type=bool
      <content>
      The function returns the status of the main connection between client terminal and server that performs data pumping. It returns TRUE if connection to the server was 
     successfully established, otherwise, it returns FALSE.
      </content>
      <example>
  if(!IsConnected())
    {
     Print(&quot;No connection!&quot;);
     return(0);
    }
  // Expert body that needs the connection opened
  // ...
      </example>
   </function>   
    <function>
      tag=check_IsDemo
      caption=IsDemo()
      type=bool
      <content>
      Returns TRUE if the expert runs on a demo account, otherwise returns FALSE.
      </content>
      <example>
  if(IsDemo()) Print(&quot;I work at a demo account&quot;);
  else Print(&quot;I work at a real account&quot;);
      </example>
    </function>

    <function>
      tag=check_IsDllsAllowed
      caption=IsDllsAllowed()
      type=bool
      <content>
Returns TRUE if the function DLL call is allowed for the expert, otherwise returns FALSE.<br/>
<b>See also</b> <a href="help://check_IsLibrariesAllowed">IsLibrariesAllowed()</a>, <a href="help://check_IsTradeAllowed">IsTradeAllowed()</a>.
      </content>
      <example>
  #import &quot;user32.dll&quot;
     int     MessageBoxA(int hWnd, string szText, string szCaption,int nType);
  ...
  ...
  if(IsDllsAllowed()==false)
    {
     Print(&quot;DLL call is not allowed. Experts cannot run.&quot;);
     return(0);
    }
  // expert body that calls external DLL functions
  MessageBoxA(0,&quot;an message&quot;,&quot;Message&quot;,MB_OK);
      </example>
    </function>

    <function>
      tag=check_IsExpertEnabled
      caption=IsExpertEnabled()
      type=bool
      <content>
        Returns TRUE if expert advisors are enabled for running, otherwise returns FALSE.
      </content>
      <example>
  while(!IsStopped())
    {
     ...
     if(!IsExpertEnabled()) break;
    }
      </example>
    </function>

    <function>
      tag=check_IsLibrariesAllowed
      caption=IsLibrariesAllowed()
      type=bool
      <content>
        Returns TRUE if the expert can call library function, otherwise returns FALSE.
        <b>See also</b> <a href="help://check_IsDllsAllowed">IsDllsAllowed()</a>, <a href="help://check_IsTradeAllowed">IsTradeAllowed()</a>.
      </content>
      <example>
  #import &quot;somelibrary.ex4&quot;
     int somefunc();
  ...
  ...
  if(IsLibrariesAllowed()==false)
    {
     Print(&quot;Library call is not allowed.&quot;);
     return(0);
    }
  // expert body that calls external DLL functions
  somefunc();
      </example>
    </function>

    <function>
      tag=check_IsOptimization
      caption=IsOptimization()
      type=bool
      <content>
      Returns TRUE if expert runs in the strategy tester optimization mode, otherwise returns FALSE.
      </content>
      <example>
  if(IsOptimization()) return(0);
      </example>
    </function>

    <function>
      tag=check_IsStopped
      caption=IsStopped()
      type=bool
      <content>
        Returns TRUE if the program (an expert or a script) has been commanded to stop its operation, otherwise returns FALSE.
      The program can continue operation for 2.5 seconds more before the client terminal stops its <a href="help://runtime_start">performing</a> forcedly.
      </content>
      <example>
  while(expr!=false)
    {
     if(IsStopped()==true) return(0);
     // a long run-time cycle
     // ...
    }
      </example>
    </function>

    <function>
      tag=check_IsTesting
      caption=IsTesting()
      type=bool
      <content>
      Returns TRUE if expert runs in the testing mode, otherwise returns FALSE.
      </content>
      <example>
  if(IsTesting()) Print(&quot;I am testing now&quot;);
      </example>
    </function>

    <function>
      tag=check_IsTradeAllowed
      caption=IsTradeAllowed()
      type=bool
      <content>
        Returns TRUE if the expert is allowed to trade and a thread for trading is not occupied, otherwise returns FALSE.<br/>
        <b>See also</b> <a href="help://check_IsDllsAllowed">IsDllsAllowed()</a>, <a href="help://check_IsLibrariesAllowed">IsLibrariesAllowed()</a>, <a href="help://check_IsTradeContextBusy">IsTradeContextBusy()</a>.
      </content>
      <example>
  if(IsTradeAllowed()) Print(&quot;Trade allowed&quot;);
      </example>
    </function>

    <function>
      tag=check_IsTradeContextBusy
      caption=IsTradeContextBusy()
      type=bool
      <content>
Returns TRUE if a thread for trading is occupied by another expert advisor, otherwise returns FALSE.<br/>
<b>See also</b> <a href="help://check_IsTradeAllowed">IsTradeAllowed()</a>.
      </content>
      <example>
  if(IsTradeContextBusy()) Print(&quot;Trade context is busy. Please wait&quot;);
      </example>
    </function>

    <function>
      tag=check_IsVisualMode
      caption=IsVisualMode()
      type=bool
      <content>
      Returns TRUE if the expert is tested with checked &quot;Visual Mode&quot; button, otherwise returns FALSE.
      </content>
      <example>
  if(IsVisualMode()) Comment("Visual mode turned on");
      </example>
    </function>

    <function>
      tag=check_UninitializeReason
      caption=UninitializeReason()
      type=int
      <content>
        Returns the code of the uninitialization reason for the experts, custom indicators, and scripts.
        The returned values can be ones of <a href="help://constants_uninit">Uninitialize reason codes</a>.
        This function can also be called in function init() to analyze the reasons for deinitialization of the previour launch.
      </content>
      <example>
  // this is example
  int deinit()
    {
     switch(UninitializeReason())
       {
        case REASON_CHARTCLOSE:
        case REASON_REMOVE:      CleanUp(); break; // cleaning up and deallocation of all resources.
        case REASON_RECOMPILE:
        case REASON_CHARTCHANGE:
        case REASON_PARAMETERS:
        case REASON_ACCOUNT:     StoreData(); break;  // prepare to restart
       }
     //...
    }
      </example>
    </function>
  </group>

  <group>
    tag=terminal
    caption=Client terminal
    <content>
    Functions returning information about client terminal.
    </content>

    <function>
      tag=terminal_TerminalCompany
      caption=TerminalCompany()
      type=string
      <content>
      Returns the name of company owning the client terminal.
      </content>
      example=Print(&quot;Company name is &quot;,TerminalCompany());
    </function>

    <function>
      tag=terminal_TerminalName
      caption=TerminalName()
      type=string
      <content>
      Returns client terminal name.
      </content>
      example=Print(&quot;Terminal name is &quot;,TerminalName());
    </function>

    <function>
      tag=terminal_TerminalPath
      caption=TerminalPath()
      type=string
      <content>
      Returns the directory, from which the client terminal was launched.
      </content>
      example=Print(&quot;Working directory is &quot;,TerminalPath());
    </function>
</group>

  <group>
    tag=common
    caption=Common functions
    <content>
    General-purpose functions not included into any specialized groups.
    </content>

    <function>
      tag=common_Alert
      caption=Alert()
      type=void
      <content>
        Displays a dialog box containing the user-defined data.
        Parameters can be of any type. Amount of passed parameters cannot exceed 64.<br/><br/>
        Arrays cannot be passed to the Alert function. Arrays should be output elementwise.<br/><br/>
        Data of double type output with 4 decimal digits after point.
        To output with more precision use <a href="help://convert_DoubleToStr">DoubleToStr()</a> function.<br/>
        Data of bool, datetime and color types will be output as its numeric presentation.<br/>
        To output values of datetime type as string convert it by <a href="help://convert_TimeToStr">TimeToStr()</a> function.<br/>
        <b>See also</b> <a href="help://common_Comment">Comment()</a> and <a href="help://common_Print">Print()</a> functions.
      </content>
      <example>
  if(Close[0]&gt;SignalLevel)
    Alert(&quot;Close price coming &quot;, Close[0],&quot;!!!&quot;);
      </example>
      <parameter>
        type=...
        name=
        description=Any values, separated by commas. It can be up to 64 parameters.
      </parameter>
    </function>

    <function>
      tag=common_Comment
      caption=Comment()
      type=void
      <content>
The function outputs the comment defined by the user in the left top corner of the chart. Parameters can be of any type. Amount of passed parameters cannot exceed 64.<br/><br/>
Arrays cannot be passed to the Comment() function. Arrays should be output elementwise.<br/><br/>
Data of double type output with 4 digits after the decimal point.
To output with more precision, use the <a href="help://convert_DoubleToStr">DoubleToStr()</a> function.<br/>
Data of bool, datetime and color types will be output as their numeric presentation.<br/>
To output values of datetime type as strings, convert them with the <a href="help://convert_TimeToStr">TimeToStr()</a> function.<br/>
<b>See also</b> <a href="help://common_Alert">Alert()</a> and <a href="help://common_Print">Print()</a> functions.
      </content>
      <example>
  double free=AccountFreeMargin();
  Comment(&quot;Account free margin is &quot;,DoubleToStr(free,2),"\n",&quot;Current time is &quot;,TimeToStr(TimeCurrent()));
      </example>
      <parameter>
        type=...
        name=
        description==Any values separated by commas. It can be up to 64 parameters.
      </parameter>
    </function>

    <function>
      tag=common_GetTickCount
      caption=GetTickCount()
      type=int
      <content>
        The GetTickCount() function retrieves the number of milliseconds that have elapsed since the system was started. 
      It is limited to the resolution of the system timer.
      </content>
      <example>
  int start=GetTickCount();
  // some hard calculations...
  Print(&quot;Calculation time is &quot;, GetTickCount()-start, &quot; milliseconds.&quot;);
      </example>
    </function>

    <function>
      tag=common_MarketInfo
      caption=MarketInfo()
      type=double
      <content>
      Returns various data about securities listed in the Market Watch window.
      A part of information about the current security is stored in <a href="help://predefined_variables">predefined variables</a>. 
      </content>
      <example>
   double bid   =MarketInfo(&quot;EURUSD&quot;,MODE_BID);
   double ask   =MarketInfo(&quot;EURUSD&quot;,MODE_ASK);
   double point =MarketInfo(&quot;EURUSD&quot;,MODE_POINT);
   int    digits=MarketInfo(&quot;EURUSD&quot;,MODE_DIGITS);
   int    spread=MarketInfo(&quot;EURUSD&quot;,MODE_SPREAD);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Security symbol.
      </parameter>
      <parameter>
        type=int
        name=type
        description=Request identifier that defines the type of information to be returned. Can be any of values of <a href="help://constants_marketinfo">request identifiers</a>.
      </parameter>
    </function>

    <function>
      tag=common_MessageBox
      caption=MessageBox()
      type=int
      keywords=;MessageBox;
      <content>
The MessageBox function creates, displays, and operates message box. The message box contains an application-defined message and header, 
as well as a random combination of predefined icons and push buttons. If the function succeeds, the returned value is one of 
the MessageBox <a href="help://constants_messagebox">return code</a> values.<br/> The function cannot be called from custom indicators since  
they are <a href="help://runtime_start">executed</a> within interface thread and may not decelerate it.
      </content>
      <example>
  #include &lt;WinUser32.mqh&gt;
  
  if(ObjectCreate(&quot;text_object&quot;, OBJ_TEXT, 0, D'2004.02.20 12:30', 1.0045)==false)
    {
     int ret=MessageBox(&quot; ObjectCreate() function returned the &quot;+GetLastError()+&quot; error\nContinue?&quot;, &quot;Question&quot;, MB_YESNO|MB_ICONQUESTION);
     if(ret==IDNO) return(false);
    }
  // continue  
      </example>
      <parameter>
        type=string
        name=text
        def_value=NULL
        description=Optional text that contains the message to be displayed.
      </parameter>
      <parameter>
        type=string
        name=caption
        def_value=NULL
        <description>
          Optional text to be displayed in the header of the dialog box.
          If this parameter is NULL, the expert name will be displayed in the header.
        </description>
      </parameter>
      <parameter>
        type=int
        name=flags
        def_value=EMPTY
        <description>
Optional flags that determine the type and behavior of the dialog box.
 They can represent a conbination of <a href="help://constants_messagebox"> flags</a> from the following groups.
        </description>
      </parameter>
    </function>

    <function>
      tag=common_PlaySound
      caption=PlaySound()
      type=void
      <content>
      Function plays a sound file. The file must be located in the <em>terminal_dir\sounds</em> directory or in its subdirectory.
      </content>
      <example>
  if(IsDemo()) PlaySound(&quot;alert.wav&quot;);
      </example>
      <parameter>
        type=string
        name=filename
        description=Path to the sound file.
      </parameter>
    </function>

    <function>
      tag=common_Print
      caption=Print()
      type=void
      keywords=;Print;
      <content>
Prints a message to the experts log. Parameters can be of any type. Amount of passed parameters cannot exceed 64.<br/><br/>
Arrays cannot be passed to the Print() function. Arrays should be printed elementwise.<br/><br/>
Data of double type are printed with 4 decimal digits after point. To output more precisely, 
use the <a href="help://convert_DoubleToStr">DoubleToStr()</a> function.<br/>
Data of bool, datetime and color types will be printed as their numeric presentation.<br/>
To print values of datetime type as string, convert them with the <a href="help://convert_TimeToStr">TimeToStr()</a> function.<br/>
<b>See also</b> <a href="help://common_Alert">Alert()</a> and <a href="help://common_Comment">Comment()</a> functions.
      </content>
      <example>
  Print(&quot;Account free margin is &quot;, AccountFreeMargin());
  Print(&quot;Current time is &quot;, TimeToStr(TimeCurrent()));
  double pi=3.141592653589793;
  Print(&quot;PI number is &quot;, DoubleToStr(pi,8));
  // Output: PI number is 3.14159265
  // Array printing
  for(int i=0;i&lt;10;i++)
    Print(Close[i]);
      </example>
      <parameter>
        type=...
        name=
        description=Any values separated by commas. It can be up to 64 parameters.
      </parameter>
    </function>

    <function>
      tag=common_SendFTP
      caption=SendFTP()
      type=bool
      <content>
Sends the file to the FTP server set in the Tools->Options->Publisher tab. If the attempt fails, it retuns FALSE.<br/>
The function does not operate in the testing mode. This function cannot be called from custom indicators, either.<br/>
The file to be sent must be stored in the <em>terminal_directory\experts\files</em> folder or in its sub-folders.<br/>
It will not be sent if there is no FTP address and/or access password specified in settings.
      </content>
      <example>
  int lasterror=0;
  if(!SendFTP("report.txt"))
    lasterror=GetLastError();
      </example>
      <parameter>    
        type=string
        name=filename
        description=File to be sent.
      </parameter>
      <parameter>
        type=string
        name=ftp_path
        description=FTP path. If the path has not been specified, the path described in settings will be used.
        def_value=NULL
      </parameter>
    </function>

    <function>
      tag=common_SendMail
      caption=SendMail()
      type=void
      <content>
Sends a message to the e-mail set in the Tools->Options->EMail tab.<br/>
The sending can be disabled in settings, or it can be omitted to specify the e-mail address.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  double lastclose=Close[0];
  if(lastclose&lt;my_signal)
    SendMail(&quot;from your expert&quot;, &quot;Price dropped down to &quot;+DoubleToStr(lastclose,Digits));
      </example>
      <parameter>    
        type=string
        name=subject
        description=Subject text.
      </parameter>
      <parameter>
        type=string
        name=some_text
        description=Mail body.
      </parameter>
    </function>

    <function>
      tag=common_Sleep
      caption=Sleep()
      type=void
      <content>
      The Sleep() function suspends execution of the current expert within the specified interval.<br/>
      The Sleep() function cannot be called from custom indicators since they <a href="help://runtime_start">calculate</a> in the interface 
      thread and may not decelerate it.<br/>
      The checking of the expert <a href="help://check_IsStopped">stop flag status</a> every 0.1 second has been built into the function.
      </content>
      <example>
//---- wait for 10 seconds
   Sleep(10000);
      </example>
      <parameter>
        type=int
        name=milliseconds
        description=Sleeping interval in milliseconds.
      </parameter>
    </function>
  </group>


  <group>
    tag=convert
    caption=Conversion functions
    <content>
    A group of functions that provide conversion of data from one format into another.<br/><br/>
    The <a href="help://convert_NormalizeDouble">NormalizeDouble()</a> function must be specially noted as it provides the necessary accuracy 
     of the price presentation. In trading operations, no unnormalized prices may be used if their accuracy even a digit exceeds that required by the trade server.
    </content>

    <function>
      tag=convert_CharToStr
      caption=CharToStr()
      type=string
      <content>
      Conversion of the symbol code into a one-character string.
      </content>
      <example>
  string str=&quot;WORL&quot; + CharToStr(44); // 44 is code for 'D'
  // the resulting string will be WORLD
      </example>
      <parameter>
        type=int
        name=char_code
        description=ASCII char code.
      </parameter>
    </function>

    <function>
      tag=convert_DoubleToStr
      caption=DoubleToStr()
      type=string
      <content>
        Returns text string with the specified numerical value converted into a specified precision format.
      </content>
      <example>
  string value=DoubleToStr(1.28473418, 5);
  // the value is &quot;1.28473&quot;
      </example>
      <parameter>
        type=double
        name=value
        description=Floating point value.
      </parameter>
      <parameter>
        type=int
        name=digits
        description=Precision format, number of digits after decimal point (0-8).
      </parameter>
    </function>

    <function>
      type=double
      tag=convert_NormalizeDouble
      caption=NormalizeDouble()
      <content>
      Rounds the floating point value to the given precision. Returns normalized value of the double type.<br/>
      The calculated StopLoss and TakeProfit values, as well as <a href="help://trading_OrderSend">open</a> price of pending orders 
      must be normalized with a precision the value of which is stored in the pre-defined variable of <a href="help://predefined_variables_Digits">Digits</a>.
      </content>
      <example>
  double var1=0.123456789;
  Print(DoubleToStr(NormalizeDouble(var1,5),8));
  // output: 0.12346000
      </example>
      <parameter>
        type=double
        name=value
        description=Floating point value.
      </parameter>
      <parameter>
        type=int
        name=digits
        description=Precision format, number of digits after decimal point (0-8).
      </parameter>
    </function>

    <function>
      tag=convert_StrToDouble
      caption=StrToDouble()
      type=double
      <content>
      Converts string representation of number to double type (double-precision format with floating point).
      </content>
      <example>
  double var=StrToDouble(&quot;103.2812&quot;);
      </example>
      <parameter>
        type=string
        name=value
        description=String containing the number character representation format.
      </parameter>
    </function>

    <function>
      tag=convert_StrToInteger
      caption=StrToInteger()
      type=int
      <content>
      Converts string containing the value character representation into a value of the int (integer) type.
      </content>
      <example>
  int var1=StrToInteger(&quot;1024&quot;);
      </example>
      <parameter>
        type=string
        name=value
        description=String containing the integer character representation format.
      </parameter>
    </function>

    <function>
      tag=convert_StrToTime
      caption=StrToTime()
      type=datetime
      <content>
      Converts string in the format &quot;yyyy.mm.dd hh:mi&quot; to datetime type (the amount of seconds that have passed since 1 Jan., 1970).
      </content>
      <example>
  datetime var1;
  var1=StrToTime(&quot;2003.8.12 17:35&quot;);
  var1=StrToTime(&quot;17:35&quot;);      // returns the current date with the given time
  var1=StrToTime(&quot;2003.8.12&quot;);  // returns the date with the midnight time of &quot;00:00&quot;
      </example>
      <parameter>
        type=string
        name=value
        description=String value of date/time format as &quot;yyyy.mm.dd hh:mi&quot;.
      </parameter>
    </function>

    <function>
      tag=convert_TimeToStr
      caption=TimeToStr()
      type=string
      <content>
      Converts value containing time in seconds that has passed since January 1, 1970, into a string of &quot;yyyy.mm.dd hh:mi&quot; format.
      </content>
      keywords=;TIME_DATE;TIME_MINUTES;TIME_SECONDS;
      <example>
  string var1=TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS);
      </example>
      <parameter>
        type=datetime
        name=value
        description=Positive amount of seconds that have passed since 00:00, January 1, 1970.
      </parameter>
      <parameter>
        type=int
        name=mode
        def_value=TIME_DATE|TIME_MINUTES
        <description>
Optional data output mode can be one or combination of:<br/>
TIME_DATE gets result as &quot;yyyy.mm.dd&quot;,<br/>
TIME_MINUTES gets result as &quot;hh:mi&quot;,<br/>
TIME_SECONDS gets result as &quot;hh:mi:ss&quot;.
        </description>
      </parameter>
    </function>
  </group>


  <group>
    tag=customind
    caption=Custom indicators
    <content>
    A group of functions used at producing of custom indicators.<br/><br/>
    These functions cannot be used in experts and scripts.
    </content>
  
    <function>
      tag=customind_IndicatorBuffers
      caption=IndicatorBuffers()
      type=void
      <content>
        Allocates memory for buffers used for custom indicator calculations.
        The amount of buffers cannot exceed 8 or be less than the value given in the <a href="help://basis_preprosessor_compilation">indicator_buffers</a> property.
        If custom indicator requires additional buffers for counting, this function must be used for specifying of the total amount of buffers.
      </content>
      <example>
#property  indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  Silver
//---- indicator parameters
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
//---- indicator buffers
double     ind_buffer1[];
double     ind_buffer2[];
double     ind_buffer3[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(3);
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
   SetIndexDrawBegin(0,SignalSMA);
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2);
//---- 3 indicator buffers mapping
   SetIndexBuffer(0,ind_buffer1);
   SetIndexBuffer(1,ind_buffer2);
   SetIndexBuffer(2,ind_buffer3);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("OsMA("+FastEMA+","+SlowEMA+","+SignalSMA+")");
//---- initialization done
   return(0);
  }
      </example>
      <parameter>
        type=int
        name=count
        description=Amount of buffers to be allocated. Should be within the range between indicator_buffers and 8 buffers.
      </parameter>
    </function>

    <function>
      tag=customind_IndicatorCounted
      caption=IndicatorCounted()
      type=int
      <content>
The function returns the amount of bars not changed after the indicator had been launched last. The most calculated bars do not need any recalculation.
In most cases, same count of index values do not need for recalculation. The function is used to optimize calculating.<br/><br/>
Note: The latest bar is not considered to be calculated and, in the most cases, it is necessary to recalculate only this bar. However, there occur 
some boundary cases where custom indicator is called from the expert at the first tick of the new bar. It is possible that the last tick of the previous bar 
had not been processed (because the last-but-one tick <a href="help://runtime_start">was being processed</a> when this last tick came), the custom 
indicator was not called and it was not calculated because of this. To avoid indicator calculation errors in such situations, the IndicatorCounted() 
function returns the count of bars minus one.
      </content>
      <example>
  int start()
    {
     int limit;
     int counted_bars=IndicatorCounted();
  //---- check for possible errors
     if(counted_bars&lt;0) return(-1);
  //---- the last counted bar will be recounted
     if(counted_bars&gt;0) counted_bars--;
     limit=Bars-counted_bars;
  //---- main loop
     for(int i=0; i&lt;limit; i++)
       {
        //---- ma_shift set to 0 because SetIndexShift called abowe
        ExtBlueBuffer[i]=iMA(NULL,0,JawsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
        ExtRedBuffer[i]=iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
        ExtLimeBuffer[i]=iMA(NULL,0,LipsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
       }
  //---- done
     return(0);
    }
      </example>
    </function>

    <function>
      tag=customind_IndicatorDigits
      caption=IndicatorDigits()
      type=void
      <content>
      Sets precision format (the count of digits after decimal point) to visualize indicator values. 
      The symbol <a href="help://predefined_variables_Digits">price preicision</a> is used by default, the indicator being attached to this symbol chart.
      </content>
      <example>
int init()
  {
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(3);
//---- setting of drawing parameters
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
   SetIndexDrawBegin(0,SignalSMA);
   IndicatorDigits(Digits+2);
//---- 3 allocated buffers of an indicator
   SetIndexBuffer(0,ind_buffer1);
   SetIndexBuffer(1,ind_buffer2);
   SetIndexBuffer(2,ind_buffer3);
//---- "short name" for DataWindow and indicator subwindow
   IndicatorShortName("OsMA("+FastEMA+","+SlowEMA+","+SignalSMA+")");
//---- initialization done
   return(0);
  }
      </example>
      <parameter>
        type=int
        name=digits
        description=Precision format, the count of digits after decimal point.
      </parameter>
    </function>

    <function>
      tag=customind_IndicatorShortName
      caption=IndicatorShortName()
      type=void
      <content>
      Sets the &quot;short&quot; name of a custom indicator to be shown in the DataWindow and in the chart subwindow.
      </content>
      <example>
int init()
  {
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(3);
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
   SetIndexDrawBegin(0,SignalSMA);
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2);
//---- 3 indicator buffers mapping
   SetIndexBuffer(0,ind_buffer1);
   SetIndexBuffer(1,ind_buffer2);
   SetIndexBuffer(2,ind_buffer3);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("OsMA("+FastEMA+","+SlowEMA+","+SignalSMA+")");
//---- initialization done
   return(0);
  }
      </example>
      <parameter>
        type=string
        name=name
        description=New short name.
      </parameter>
    </function>

    <function>
      tag=customind_SetIndexArrow
      caption=SetIndexArrow()
      type=void
      <content>
      Sets an arrow symbol for indicators line of the <a href="help://constants_drawstyles">DRAW_ARROW</a> type.<br/>
      <a href="help://constants_arrows">Arrow codes</a> out of range 33 to 255 cannot be used.
      </content>
      <example>
int init()
  {
//---- 2 allocated indicator buffers  
    SetIndexBuffer(0,ExtUppperBuffer);
    SetIndexBuffer(1,ExtLowerBuffer);   
//---- drawing parameters setting
    SetIndexStyle(0,DRAW_ARROW);
    SetIndexArrow(0,217);
    SetIndexStyle(1,DRAW_ARROW);
    SetIndexArrow(1,218);
//---- displaying in the DataWindow
    SetIndexLabel(0,"Fractal Up");
    SetIndexLabel(1,"Fractal Down");
//---- initialization done
   return(0);
  }
      </example>
      <parameter>
        type=int
        name=index
        description=Line index. Must lie between 0 and 7.
      </parameter>
      <parameter>
        type=int
        name=code
        description=Symbol code from <a href="help://constants_wingdings">Wingdings</a> font or <a href="help://constants_arrows">Array constants</a>.
      </parameter>
    </function>

    <function>
      tag=customind_SetIndexBuffer
      caption=SetIndexBuffer()
      type=bool
      <content>
Binds the array variable declared at a global level to the custom indicator pre-defined buffer.
The amount of buffers needed to calculate the indicator is set with the <a href="help://customind_IndicatorBuffers">IndicatorBuffers()</a> function and cannot 
exceed 8. If it succeeds, TRUE will be returned, otherwise, it will be FALSE.
To get the extended information about the error, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
     </content>
      <example>
  double ExtBufferSilver[];
  int init()
    {
      SetIndexBuffer(0, ExtBufferSilver); // first line buffer
      // ...
    }
      </example>
      <parameter>
        type=int
        name=index
        description=Line index. Must lie between 0 and 7.
      </parameter>
      <parameter>
        type=double
        name=<nobr>array[]</nobr>
        description=Array that stores calculated indicator values.
      </parameter>
    </function>

    <function>
      tag=customind_SetIndexDrawBegin
      caption=SetIndexDrawBegin()
      type=void
      <content>
Sets the bar number (from the data beginning) from which the drawing of the given indicator line must start. 
The indicators are drawn from left to right. The indicator array values that are to the left of the given bar will not be shown in the chart
or in the DataWindow. 0 will be set as default, and all data will be drawn. 
      </content>
      <example>
int init()
  {
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(3);
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
   SetIndexDrawBegin(0,SignalSMA);
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2);
//---- 3 indicator buffers mapping
   SetIndexBuffer(0,ind_buffer1);
   SetIndexBuffer(1,ind_buffer2);
   SetIndexBuffer(2,ind_buffer3);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("OsMA("+FastEMA+","+SlowEMA+","+SignalSMA+")");
//---- initialization done
   return(0);
  }
      </example>
      <parameter>
        type=int
        name=index
        description=Line index. Must lie between 0 and 7.
      </parameter>
      <parameter>
        type=int
        name=begin
        description=First drawing bar position number.
      </parameter>
    </function>

    <function>
      tag=customind_SetIndexEmptyValue
      caption=SetIndexEmptyValue()
      type=void
      <content>
        Sets drawing line empty value.
        Empty values are not drawn or shown in the DataWindow.
      By default, empty value is EMPTY_VALUE.
      </content>
      <example>
int init()
  {
//---- 2 allocated indicator buffers  
    SetIndexBuffer(0,ExtUppperBuffer);
    SetIndexBuffer(1,ExtLowerBuffer);   
//---- drawing parameters setting
    SetIndexStyle(0,DRAW_ARROW);
    SetIndexArrow(0,217);
    SetIndexStyle(1,DRAW_ARROW);
    SetIndexArrow(1,218);
//---- 0 value will not be displayed
    SetIndexEmptyValue(0,0.0);
    SetIndexEmptyValue(1,0.0);
//---- displaying in DataWindow
    SetIndexLabel(0,"Fractal Up");
    SetIndexLabel(1,"Fractal Down");
//---- initialization done
   return(0);
  }
      </example>
      <parameter>
        type=int
        name=index
        description=Line index. Must lie between 0 and 7.
      </parameter>
      <parameter>
        type=double
        name=value
        description=New &quot;empty&quot; value.
      </parameter>
    </function>

    <function>
      tag=customind_SetIndexLabel
      caption=SetIndexLabel()
      type=void
      <content>
      Sets drawing line description for showing in the DataWindow and in the tooltip.
      </content>
      <example>
//+------------------------------------------------------------------+
//| Ichimoku Kinko Hyo initialization function                       |
//+------------------------------------------------------------------+
int init()
  {
//----
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,Tenkan_Buffer);
   SetIndexDrawBegin(0,Tenkan-1);
   SetIndexLabel(0,"Tenkan Sen");
//----
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,Kijun_Buffer);
   SetIndexDrawBegin(1,Kijun-1);
   SetIndexLabel(1,"Kijun Sen");
//----
   a_begin=Kijun; if(a_begin&lt;Tenkan) a_begin=Tenkan;
   SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_DOT);
   SetIndexBuffer(2,SpanA_Buffer);
   SetIndexDrawBegin(2,Kijun+a_begin-1);
   SetIndexShift(2,Kijun);
//---- Up Kumo bounding line does not show in the DataWindow
   SetIndexLabel(2,NULL);
   SetIndexStyle(5,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(5,SpanA2_Buffer);
   SetIndexDrawBegin(5,Kijun+a_begin-1);
   SetIndexShift(5,Kijun);
   SetIndexLabel(5,"Senkou Span A");
//----
   SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_DOT);
   SetIndexBuffer(3,SpanB_Buffer);
   SetIndexDrawBegin(3,Kijun+Senkou-1);
   SetIndexShift(3,Kijun);
//---- Down Kumo bounding line does not show in the DataWindow
   SetIndexLabel(3,NULL);
//----
   SetIndexStyle(6,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(6,SpanB2_Buffer);
   SetIndexDrawBegin(6,Kijun+Senkou-1);
   SetIndexShift(6,Kijun);
   SetIndexLabel(6,"Senkou Span B");
//----
   SetIndexStyle(4,DRAW_LINE);
   SetIndexBuffer(4,Chinkou_Buffer);
   SetIndexShift(4,-Kijun);
   SetIndexLabel(4,"Chinkou Span");
//----
   return(0);
  }
      </example>
      <parameter>
        type=int
        name=index
        description=Line index. Must lie between 0 and 7.
      </parameter>
      <parameter>
        type=string
        name=text
        description=Label text. NULL means that index value is not shown in the DataWindow.
      </parameter>
    </function>

    <function>
      tag=customind_SetIndexShift
      caption=SetIndexShift()
      type=void
      <content>
        Sets offset for the drawing line. For positive values, the line drawing will be shifted to the right, otherwise it will be shifted to the left.
        I.e., the value calculated on the current bar will be drawn shifted relatively to the current bar.
      </content>
      <example>
//+------------------------------------------------------------------+
//| Alligator initialization function                                |
//+------------------------------------------------------------------+
int init()
  {
//---- line shifts when drawing
   SetIndexShift(0,JawsShift);
   SetIndexShift(1,TeethShift);
   SetIndexShift(2,LipsShift);
//---- first positions skipped when drawing
   SetIndexDrawBegin(0,JawsShift+JawsPeriod);
   SetIndexDrawBegin(1,TeethShift+TeethPeriod);
   SetIndexDrawBegin(2,LipsShift+LipsPeriod);
//---- 3 indicator buffers mapping
   SetIndexBuffer(0,ExtBlueBuffer);
   SetIndexBuffer(1,ExtRedBuffer);
   SetIndexBuffer(2,ExtLimeBuffer);
//---- drawing settings
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexStyle(2,DRAW_LINE);
//---- index labels
   SetIndexLabel(0,"Gator Jaws");
   SetIndexLabel(1,"Gator Teeth");
   SetIndexLabel(2,"Gator Lips");
//---- initialization done
   return(0);
  }
      </example>
      <parameter>
        type=int
        name=index
        description=Line index. Must lie between 0 and 7.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Shitf value in bars.
      </parameter>
    </function>

    <function>
      tag=customind_SetIndexStyle
      caption=SetIndexStyle()
      type=void
      <content>
      Sets the new type, style, width and color for a given indicator line.
      </content>
      <example>
  SetIndexStyle(3, DRAW_LINE, EMPTY, 2, Red);
      </example>
      <parameter>
        type=int
        name=index
        description=Line index. Must lie between 0 and 7.
      </parameter>
      <parameter>
        type=int
        name=type
        <description>
Shape style. Can be one of <a href="help://constants_drawstyles">Drawing shape styles</a> listed.
        </description>
      </parameter>
      <parameter>
        type=int
        name=style
        def_value=EMPTY
        <description>
        Drawing style. It is used for one-pixel thick lines.
        It can be one of the <a href="help://constants_drawstyles">Drawing shape styles</a> listed.
        EMPTY value means that the style will not be changed.
        </description>
      </parameter>
      <parameter>
        type=int
        name=width
        def_value=EMPTY
        <description>
          Line width. Valid values are: 1,2,3,4,5. EMPTY value means that width will not be changed.
        </description>
      </parameter>
      <parameter>
        type=color
        name=clr
        def_value=CLR_NONE
        description=Line color. Absence of this parameter means that the color will not be changed.
      </parameter>
    </function>

    <function>
      tag=customind_SetLevelStyle
      caption=SetLevelStyle()
      type=void
      <content>
The function sets a new style, width and color of horizontal levels of indicator to be output in a separate window.
      </content>
      <example>
//---- show levels as thick red lines
   SetLevelStyle(STYLE_SOLID,2,Red)
      </example>
      <parameter>
        type=int
        name=draw_style
        <description>
Drawing style. Can be one of the <a href="help://constants_drawstyles">Drawing shape styles</a> listed. EMPTY value means that the style will not be changed.
        </description>
      </parameter>
      <parameter>
        type=int
        name=line_width
        <description>
         Line width. Valid values are 1,2,3,4,5. EMPTY value indicates that the width will not be changed.
        </description>
      </parameter>
      <parameter>
        type=color
        name=clr
        def_value=CLR_NONE
        description=Line color. Empty value CLR_NONE means that the color will not be changed.
      </parameter>
    </function>

    <function>
      tag=customind_SetLevelValue
      caption=SetLevelValue()
      type=void
      <content>
      The function sets a value for a given horizontal level of the indicator to be output in a separate window.
      </content>
      <example>
SetLevelValue(1,3.14);
      </example>
      <parameter>
        type=int
        name=level
        description=Level index (0-31).
      </parameter>
      <parameter>
        type=double
        name=value
        description=Value for the given indicator level.
      </parameter>
    </function>
  </group>


  <group>
    tag=dateandtime
    caption=Date &amp; Time functions
    <content>
    A group of functions providing the working with data of the datetime type (integer representing the amount of seconds elapsed from midnight, 1 January, 1970).
    </content>

    <function>
      tag=dateandtime_Day
      caption=Day()
      type=int
      <content>
      Returns the current day of the month, i.e., the day of month of the last known server time.<br/>
      Note: At the testing, the last known server time is modelled.
      </content>
      <example>
  if(Day()&lt;5) return(0);
      </example>
    </function>

    <function>
      tag=dateandtime_DayOfWeek
      caption=DayOfWeek()
      type=int
      <content>
      Returns the current zero-based day of the week (0-Sunday,1,2,3,4,5,6) of the last known server time.<br/>
      Note: At the testing, the last known server time is modelled.
      </content>
      <example>
  // does not work on holidays.
  if(DayOfWeek()==0 || DayOfWeek()==6) return(0);
      </example>
    </function>

    <function>
      tag=dateandtime_DayOfYear
      caption=DayOfYear()
      type=int
      <content>
      Returns the current day of the year (1 means 1 January,..,365(6) does 31 December), i.e., the day of year of the last known server time.<br/>
      Note: At the testing, the last known server time is modelled.
      </content>
      <example>
  if(DayOfYear()==245)
    return(true);
      </example>
    </function>

    <function>
      tag=dateandtime_Hour
      caption=Hour()
      type=int
      <content>
      Returns the hour (0,1,2,..23) of the last known server time by the moment of the program start (this value will not change within the time of the program execution).<br/>
      Note: At the testing, the last known server time is modelled.
      </content>
      <example>
  bool is_siesta=false;
  if(Hour()&gt;=12 || Hour()&lt;17)
     is_siesta=true;
      </example>
    </function>

    <function>
      tag=dateandtime_Minute
      caption=Minute()
      type=int
      <content>
      Returns the current minute (0,1,2,..59) of the last known server time by the moment of the program start (this value will not change within the time of the program execution).
      </content>
      <example>
  if(Minute()&lt;=15)
    return("first quarter");
      </example>
    </function>

    <function>
      tag=dateandtime_Month
      caption=Month()
      type=int
      <content>
      Returns the current month as number (1-January,2,3,4,5,6,7,8,9,10,11,12), i.e., the number of month of the last known server time.<br/>
      Note: At the testing, the last known server time is modelled.
      </content>
      <example>
  if(Month()&lt;=5)
    return(&quot;the first half year&quot;);
      </example>
    </function>

    <function>
      tag=dateandtime_Seconds
      caption=Seconds()
      type=int
      <content>
      Returns the amount of seconds elapsed from the beginning of the current minute of the last known server time by the moment of the program start (this value will not change within the time of the program execution).
      </content>
      <example>
  if(Seconds()&lt;=15)
    return(0);
      </example>
    </function>

    <function>
      tag=dateandtime_TimeCurrent
      caption=TimeCurrent()
      type=datetime
      <content>
      Returns the last known server time (time of incoming of the latest quote) as number of seconds elapsed from 00:00 January 1, 1970.<br/><br/>
      Note: At the testing, the last known server time is modelled.
      </content>
      <example>
  if(TimeCurrent()-OrderOpenTime()&lt;360) return(0);
      </example>
    </function>

    <function>
      tag=dateandtime_TimeDay
      caption=TimeDay()
      type=int
      <content>
      Returns day of month (1 - 31) for the specified date.
      </content>
      <example>
  int day=TimeDay(D'2003.12.31');
  // day is 31 
      </example>
      <parameter>
        type=datetime
        name=date
        description=Datetime as number of seconds elapsed since midnight (00:00:00), January 1, 1970.
      </parameter>
    </function>

    <function>
      tag=dateandtime_TimeDayOfWeek
      caption=TimeDayOfWeek()
      type=int
      <content>
      Returns the zero-based day of week (0 means Sunday,1,2,3,4,5,6) for the specified date.
      </content>
      <example>
  int weekday=TimeDayOfWeek(D'2004.11.2');
  // day is 2 - Tuesday
      </example>
      <parameter>
        type=datetime
        name=date
        description=Datetime as number of seconds elapsed since midnight (00:00:00), January 1, 1970.
      </parameter>
    </function>

    <function>
      tag=dateandtime_TimeDayOfYear
      caption=TimeDayOfYear()
      type=int
      <content>
      Returns day (1 means 1 January,..,365(6) does 31 December) of year for the specified date.
      </content>
      <example>
  int day=TimeDayOfYear(TimeCurrent());
      </example>
      <parameter>
        type=datetime
        name=date
        description=Datetime as number of seconds elapsed since midnight (00:00:00), January 1, 1970.
      </parameter>
    </function>

    <function>
      tag=dateandtime_TimeHour
      caption=TimeHour()
      type=int
      <content>
      Returns the hour for the specified time.
      </content>
      <example>
  int h=TimeHour(TimeCurrent());
      </example>
      <parameter>
        type=datetime
        name=time
        description=Datetime is the number of seconds elapsed since midnight (00:00:00), January 1, 1970.
      </parameter>
    </function>

    <function>
      tag=dateandtime_TimeLocal
      caption=TimeLocal()
      type=datetime
      <content>
      Returns local computer time as number of seconds elapsed from 00:00 January 1, 1970.<br/>
      Note: At the testing, local time is modelled and is the same as the modelled last known server time.
      </content>
      <example>
  if(TimeLocal()-OrderOpenTime()&lt;360) return(0);
      </example>
    </function>

    <function>
      tag=dateandtime_TimeMinute
      caption=TimeMinute()
      type=int
      <content>
      Returns the minute for the specified time.
      </content>
      <example>
  int m=TimeMinute(TimeCurrent());
      </example>
      <parameter>
        type=datetime
        name=time
        description=Datetime as number of seconds elapsed since midnight (00:00:00), January 1, 1970.
      </parameter>
    </function>

    <function>
      tag=dateandtime_TimeMonth
      caption=TimeMonth()
      type=int
      <content>
      Returns the month number for the specified time.
      </content>
      <example>
  int m=TimeMonth(TimeCurrent());
      </example>
      <parameter>
        type=datetime
        name=time
        description=Datetime as number of seconds elapsed since midnight (00:00:00), January 1, 1970.
      </parameter>
    </function>

    <function>
      tag=dateandtime_TimeSeconds
      caption=TimeSeconds()
      type=int
      <content>
      Returns the amount of seconds elapsed from the beginning of the minute for the specified time.
      </content>
      <example>
  int m=TimeSeconds(TimeCurrent());
      </example>
      <parameter>
        type=datetime
        name=time
        description=Datetime as number of seconds elapsed since midnight (00:00:00), January 1, 1970.
      </parameter>
    </function>

    <function>
      tag=dateandtime_TimeYear
      caption=TimeYear()
      type=int
      <content>
      Returns year for the specified date. The returned value can be within the range of 1970 to 2037.
      </content>
      <example>
  int y=TimeYear(TimeCurrent());
      </example>
      <parameter>
        type=datetime
        name=time
        description=Datetime as number of seconds elapsed since midnight (00:00:00), January 1, 1970.
      </parameter>
    </function>

    <function>
      tag=dateandtime_Year
      caption=Year()
      type=int
      <content>
      Returns the current year, i.e., the year of the last known server time.<br/>
      Note: At the testing, the last known server time is modelled.
      </content>
      <example>
  // return if the date is within the range from 1 Jan. to 30 Apr., 2006.
    if(Year()==2006 &amp;&amp; Month()&lt;5)
    return(0);
      </example>
    </function>
  </group>


  <group>
    tag=files
    caption=File functions
    <content>
    A group of functions for working with files.<br/><br/>
    There are three directories (with subdirectories) where working files can be placed:
    <ul>
      <li>/HISTORY/&lt;current broker&gt; - especially for the FileOpenHistory function;</li>
      <li>/EXPERTS/FILES - common case;</li>
      <li>/TESTER/FILES - especially for testing.</li>
    </ul>
    Working with files from other directories is prohibited.
    </content>

    <function>
      tag=files_FileClose
      caption=FileClose()
      type=void
      <content>
      Closes file previously opened by the <a href="help://files_FileOpen">FileOpen()</a> function.
      </content>
      <example>
  int handle=FileOpen("filename", FILE_CSV|FILE_READ);
  if(handle&gt;0)
    {
     // working with file ...
     FileClose(handle);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function
      </parameter>
    </function>

    <function>
      tag=files_FileDelete
      caption=FileDelete()
      type=void
      <content>
        Removes specified file name.
        To get the detailed error information, call <a href="help://check_GetLastError">GetLastError()</a>.<br/>
        Files can only be deleted if they are in the <em>terminal_dir\experts\files</em> directory 
        (<em>terminal_directory\tester\files</em>, in case of testing) or its subdirectories.
        </content>
      <example>
  // file my_table.csv will be deleted from terminal_dir\experts\files directory
  int lastError;
  FileDelete("my_table.csv");
  lastError=GetLastError();
  if(laseError!=ERR_NOERROR)
    {
     Print(&quot;An error ocurred while (&quot;,lastError,&quot;) deleting file my_table.csv&quot;);
     return(0);
    }
      </example>
      <parameter>
        type=string
        name=filename
        description=Path to the file.
      </parameter>
    </function>

    <function>
      tag=files_FileFlush
      caption=FileFlush()
      type=void
      <content>
      Flushes all data stored in the file buffer to the disk.<br/>
      Notes: The FileFlush() function must be called between operations of file reading and writing in the file.<br/>
      At file closing, the data are flushed to the disk automatically, so there is no need to call the FileFlush() function 
      before calling of the <a href="help://files_FileClose">FileClose()</a> function.
      </content>
      <example>
  int bars_count=Bars;
  int handle=FileOpen(&quot;mydat.csv&quot;,FILE_CSV|FILE_WRITE);
  if(handle&gt;0)
    {
     FileWrite(handle, &quot;#&quot;,&quot;OPEN&quot;,&quot;CLOSE&quot;,&quot;HIGH&quot;,&quot;LOW&quot;);
     for(int i=0;i&lt;bars_count;i++)
       FileWrite(handle, i+1,Open[i],Close[i],High[i], Low[i]);
     FileFlush(handle);
     ...
     for(int i=0;i&lt;bars_count;i++)
       FileWrite(handle, i+1,Open[i],Close[i],High[i], Low[i]);
     FileClose(handle);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle, returned by FileOpen() functions.
      </parameter>
    </function>

    <function>
      tag=files_FileIsEnding
      caption=FileIsEnding()
      type=bool
      <content>
        Returns logical true if file pointer is at the end of the file, otherwise returns false.
        To get the detailed error information, call <a href="help://check_GetLastError">GetLastError()</a> function.
        If the file end is reached during reading, the <a href="help://check_GetLastError">GetLastError()</a> function will return 
        <a href="help://constants_errors">error</a> ERR_END_OF_FILE (4099).
      </content>
      <example>
  if(FileIsEnding(h1))
    {
     FileClose(h1);
     return(false);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle, returned by FileOpen() functions.
      </parameter>
    </function>

    <function>
      tag=files_FileIsLineEnding
      caption=FileIsLineEnding()
      type=bool
      <content>
        For CSV file returns logical true if file pointer is at the end of the line, otherwise returns false.
        To get the detailed error information, call <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  if(FileIsLineEnding(h1))
    {
     FileClose(h1);
     return(false);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle, returned by FileOpen() function.
      </parameter>
    </function>

    <function>
      tag=files_FileOpen
      caption=FileOpen()
      type=int
      keywords=;FILE_BIN;FILE_CSV;FILE_READ;FILE_WRITE;
      <content>
Opens file for input and/or output. Returns a file handle for the opened file or -1 (if the function fails).
To get the detailed error information, call <a href="help://check_GetLastError">GetLastError()</a> function.<br/>
Notes: Files can only be opened in the <em>terminal_directory\experts\files</em> folder (<em>terminal_directory\tester\files</em> 
if for expert testing) or in its subfolders.<br/>
FILE_BIN and FILE_CSV modes cannot be used simultaneously.<br/>
If FILE_WRITE does not combine with FILE_READ, a zero-length file will be opened. If even the file containd some data, they will be deleted.
If there is a need to add data to an existing file, it must be opened using combination of FILE_READ | FILE_WRITE.<br/>
If FILE_READ does not combine with FILE_WRITE, the file will be opened only if it already exists. If the file does not exist, it can be created 
using the FILE_WRITE mode.<br/>
No more than 32 files can be opened within an executable module simultaneously. Handles of files opened in the same module cannot be passed to other modules (libraries).
      </content>
      <example>
  int handle;
  handle=FileOpen(&quot;my_data.csv&quot;,FILE_CSV|FILE_READ,';');
  if(handle&lt;1)
    {
     Print(&quot;File my_data.dat not found, the last error is &quot;, GetLastError());
     return(false);
    }
      </example>
      <parameter>
        type=string
        name=filename
        description=Filename.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Opening mode. It can be one or combination of values: FILE_BIN, FILE_CSV, FILE_READ, FILE_WRITE.
      </parameter>
      <parameter>
        type=int
        name=delimiter
        def_value=';'
        description=Delimiter character for csv files. By default, the ';' symbol applies.
      </parameter>
    </function>

    <function>
      tag=files_FileOpenHistory
      caption=FileOpenHistory()
      type=int
      <content>
Opens file in the current history directory (<em>terminal_directory\history\server_name</em>) or in its subfolders. Returns the file handle 
for the opened file. If the function fails, the returned value is -1. To get the detailed error information, call the <a href="help://check_GetLastError">GetLastError()</a> function.<br/>
Notes: Client terminal can connect to servers of different brokerage companies. History data (HST files) for each brokerage company are stored in the corresponding 
subfolder of the <em>terminal_directory\history</em> folder.<br/>
The function can be useful to form own history data for a non-standard symbol and/or period. The file formed in the history folder can be opened offline, 
not data pumping is needed to chart it.
      </content>
      <example>
  int handle=FileOpenHistory(&quot;USDX240.HST&quot;,FILE_BIN|FILE_WRITE);
  if(handle&lt;1)
    {
     Print(&quot;Cannot create file USDX240.HST&quot;);
     return(false);
    }
  // work with file
  // ...
  FileClose(handle);
      </example>
      <parameter>
        type=string
        name=filename
        description=Filename.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Opening mode. Can be one or combination of values: FILE_BIN, FILE_CSV, FILE_READ, FILE_WRITE.
      </parameter>
      <parameter>
        type=int
        name=delimiter
        def_value=';'
        description=Delimiter for csv files. By default, the ';' symbol will be passed.
      </parameter>
    </function>

    <function>
      tag=files_FileReadArray
      caption=FileReadArray()
      type=int
      <content>
Reads the specified amount of elements from the binary file into array. Before reading, make sure that the array is large enough. 
Returns the amount of actually read elements.<br/> 
To get the detailed error information, call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle;
  double varray[10];
  handle=FileOpen(&quot;filename.dat&quot;, FILE_BIN|FILE_READ);
  if(handle&gt;0)
    {
     FileReadArray(handle, varray, 0, 10);
     FileClose(handle);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
      <parameter>
        type=object&amp;
        name=<nobr>array[]</nobr>
        description=Array where data will be stored.
      </parameter>
      <parameter>
        type=int
        name=start
        description=Starting position for storing in array.
      </parameter>
      <parameter>
        type=int
        name=count
        description=Count of elements to be read.
      </parameter>
    </function>

    <function>
      tag=files_FileReadDouble
      caption=FileReadDouble()
      type=double
      keywords=;DOUBLE_VALUE;FLOAT_VALUE;
      <content>
Reads the double-precision number with floating point from the current binary file position.
The number format size can be 8 bytes (double) or 4 bytes (float).<br/>
To get the error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle;
  double value;
  handle=FileOpen(&quot;mydata.dat&quot;,FILE_BIN);
  if(handle&gt;0)
    {
     value=FileReadDouble(handle,DOUBLE_VALUE);
     FileClose(handle);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
      <parameter>
        type=int
        name=size
        def_value=DOUBLE_VALUE
        description=Number format size. Can be DOUBLE_VALUE(8 bytes) or FLOAT_VALUE(4 bytes).
      </parameter>
    </function>

    <function>
      tag=files_FileReadInteger
      caption=FileReadInteger()
      type=int
      <content>
        The function reads the integer from the current binary file position.
        The integer format size can be 1, 2 or 4 bytes.
        If the format size is not specified, the system tries to read the 4-bytes value.
        To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      keywords=;CHAR_VALUE;SHORT_VALUE;LONG_VALUE;
      <example>
  int handle;
  int value;
  handle=FileOpen(&quot;mydata.dat&quot;, FILE_BIN|FILE_READ);
  if(handle&gt;0)
    {
     value=FileReadInteger(h1,2);
     FileClose(handle);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
      <parameter>
        type=int
        name=size
        def_value=LONG_VALUE
        description=Format size. Can be CHAR_VALUE(1 byte), SHORT_VALUE(2 bytes) or LONG_VALUE(4 bytes).
      </parameter>
    </function>

    <function>
      tag=files_FileReadNumber
      caption=FileReadNumber()
      type=double
      <content>
Read the number from the current file position before the delimiter. Only for CSV files.<br/>
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle;
  int value;
  handle=FileOpen(&quot;filename.csv&quot;, FILE_CSV, ';');
  if(handle&gt;0)
    {
     value=FileReadNumber(handle);
     FileClose(handle);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
    </function>

    <function>
      tag=files_FileReadString
      caption=FileReadString()
      type=string
      <content>
The function reads the string from the current file position. Applies to both CSV and binary files.
For text files, the string will be read before the delimiter.
For binary file, the given count of characters will be read to the string.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle;
  string str;
  handle=FileOpen(&quot;filename.csv&quot;, FILE_CSV|FILE_READ);
  if(handle&gt;0)
    {
     str=FileReadString(handle);
     FileClose(handle);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
      <parameter>
        type=int
        name=length
        def_value=0
        description=Amount of characters for reading.
      </parameter>
    </function>

    <function>
      tag=files_FileSeek
      caption=FileSeek()
      type=bool
      keywords=;SEEK_CUR;SEEK_SET;SEEK_END;
      <content>
The function moves the file pointer to a new position that is an offset, in bytes, from the beginning, the end or the 
current file position. The next reading or writing are made at a new position.<br/>
If file pointer has been moved successfully, the function returns TRUE, otherwise, it returns FALSE.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle=FileOpen(&quot;filename.csv&quot;, FILE_CSV|FILE_READ|FILE_WRITE, ';');
  if(handle&gt;0)
    {
     FileSeek(handle, 0, SEEK_END);
     //---- add data to the end of file
     FileWrite(handle, data1, data2);
     FileClose(handle);
     handle=0;
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() functions.
      </parameter>
      <parameter>
        type=int
        name=offset
        description=Offset, in bytes, from origin.
      </parameter>
      <parameter>
        type=int
        name=origin
        <description>
Initial position. Value can be one of the following constants:<br/>
SEEK_CUR - from current position,<br/>
SEEK_SET - from begin,<br/>
SEEK_END - from end of file.
        </description>
      </parameter>
    </function>

    <function>
      tag=files_FileSize
      caption=FileSize()
      type=int
      <content>
The function returns file size in bytes. 
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle;
  int size;
  handle=FileOpen(&quot;my_table.dat&quot;, FILE_BIN|FILE_READ);
  if(handle&gt;0)
    {
     size=FileSize(handle);
     Print(&quot;my_table.dat size is &quot;, size, &quot; bytes&quot;);
     FileClose(handle);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
    </function>

    <function>
      tag=files_FileTell
      caption=FileTell()
      type=int
      <content>
        Returns the current position of the file pointer.
        To get the detailed error information, one has to call <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle;
  int pos;
  handle=FileOpen(&quot;my_table.dat&quot;, FILE_BIN|FILE_READ);
  // reading some data
  pos=FileTell(handle);
  Print(&quot;current position is &quot;, pos);
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
    </function>

    <function>
      tag=files_FileWrite
      caption=FileWrite()
      type=int
      <content>
The function is intended for writing of data into a CSV file, delimiter being inserted automatically. After writing into the file, the line
end character &quot;\r\n&quot; will be added. Numbers will be converted into a text at output (see the <a href="help://common_Print">Print()</a> function).<br/>
Returns the count of written characters or a negative number if an error occurs.<br/>
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle;
  datetime orderOpen=OrderOpenTime();
  handle=FileOpen(&quot;filename&quot;, FILE_CSV|FILE_WRITE, ';');
  if(handle&gt;0)
    {
     FileWrite(handle, Close[0], Open[0], High[0], Low[0], TimeToStr(orderOpen));
     FileClose(handle);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
      <parameter>
        type=...
        name=
        <description>
User data to write, separated by commas.  It can be up to 63 parameters.<br/> 
Data of int and double types are automatically converted into a string, but those of color, datetime and bool types 
are not automatically converted and will be written to file as they are (as integers).<br/>
Arrays cannot be passed as a parameter, they can be output elementwise.
        </description>
      </parameter>
    </function>

    <function>
      tag=files_FileWriteArray
      caption=FileWriteArray()
      type=int
      <content>
The function writes the array to a binary file. Arrays of int, bool, datetime and color types will be written elementwise, as 4-bytes integers. 
Arrays of double type will be written elementwise, as 8-bytes floating point numbers. 
Arrays of string type will be written by strings, the line end character &quot;\r\n&quot; to be added at each string automatically.<br/> 
Returns the number of written elements or a negative value if an error occurs. 
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle;
  double BarOpenValues[10];
  // copy first ten bars to the array
  for(int i=0;i&lt;10; i++)
    BarOpenValues[i]=Open[i];
  // writing array to the file
  handle=FileOpen(&quot;mydata.dat&quot;, FILE_BIN|FILE_WRITE);
  if(handle&gt;0)
    {
     FileWriteArray(handle, BarOpenValues, 3, 7); // writing last 7 elements
     FileClose(handle);
    }
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
      <parameter>
        type=object
        name=<nobr>array[]</nobr>
        description=Array to write.
      </parameter>
      <parameter>
        type=int
        name=start
        description=Starting index in the array (the first written element number).
      </parameter>
      <parameter>
        type=int
        name=count
        description=Count of elements to be written.
      </parameter>
    </function>

    <function>
      tag=files_FileWriteDouble
      caption=FileWriteDouble()
      type=int
      <content>
The function writes a double value with floating point to a binary file. 
If the format is specified as FLOAT_VALUE, the value will be written as a 4-bytes floating point number (of the float type),
otherwise, it will be written in the 8-bytes floating point format (of the double type).<br/>
Returns the actually written bytes count or a negative value if an error occurs.<br/>
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle;
  double var1=0.345;
  handle=FileOpen(&quot;mydata.dat&quot;, FILE_BIN|FILE_WRITE);
  if(handle&lt;1)
    {
     Print(&quot;can't open file error-&quot;,GetLastError());
     return(0);
    }
  FileWriteDouble(h1, var1, DOUBLE_VALUE);
  //...
  FileClose(handle);
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
      <parameter>
        type=double
        name=value
        description=Double precision value.
      </parameter>
      <parameter>
        type=int
        name=size
        def_value=DOUBLE_VALUE
        <description>
          Optional format flag. It can be any of the following values:<br/>
          DOUBLE_VALUE (8 bytes, default)<br/>
          FLOAT_VALUE (4 bytes).
        </description>
      </parameter>
    </function>

    <function>
      tag=files_FileWriteInteger
      caption=FileWriteInteger()
      type=int
      <content>
The function writes the integer value to a binary file.
 If the size is SHORT_VALUE, the value will be written as a 2-byte integer (the short type),
 if the size is CHAR_VALUE, the value will be written as a 1-byte integer (the char type), and 
 if the size is LONG_VALUE, the value will be written as a 4-byte integer (the long int type).<br/>
Returns the actually written bytes count or a negative value if an error occurs.<br/>
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle;
  int value=10;
  handle=FileOpen(&quot;filename.dat&quot;, FILE_BIN|FILE_WRITE);
  if(handle&lt;1)
    {
     Print(&quot;can't open file error-&quot;,GetLastError());
     return(0);
    }
  FileWriteInteger(handle, value, SHORT_VALUE);
  //...
  FileClose(handle);
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
      <parameter>
        type=int
        name=value
        description=Value to be written.
      </parameter>
      <parameter>
        type=int
        name=size
        def_value=LONG_VALUE
        <description>
Optional format flag. It can be any of the following values:<br/>
CHAR_VALUE (1 byte),<br/>SHORT_VALUE (2 bytes),<br/>LONG_VALUE (4 bytes, default).
        </description>
      </parameter>
    </function>

    <function>
      tag=files_FileWriteString
      caption=FileWriteString()
      type=int
      <content>
The function writes the string to a binary file from the current file position.<br/> 
Returns the actually written bytes count or a negative value if an error occurs.<br/>
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  int handle;
  string str=&quot;some string&quot;;
  handle=FileOpen(&quot;filename.bin&quot;, FILE_BIN|FILE_WRITE);
    if(handle&lt;1)
    {
     Print(&quot;can't open file error-&quot;,GetLastError());
     return(0);
    }
  FileWriteString(handle, str, 8);
  FileClose(handle);
      </example>
      <parameter>
        type=int
        name=handle
        description=File handle returned by the FileOpen() function.
      </parameter>
      <parameter>
        type=string
        name=value
        description=String to be written.
      </parameter>
      <parameter>
        type=int
        name=length
        description=The length of the string to be written. If the string length exceeds the given value, it will be truncated. If it is shorter, it will be extended by binary 0s up to the given length.
      </parameter>
    </function>
  </group>


  <group>
    tag=globals
    caption=Global variables
    <content>
    A group of functions intended for working with global variables.<br/><br/>
    Global variables of the client terminal should not be mixed up with <a href="help://basis_variables_global">variables</a> declared in the global 
    scope of the MQL4 program.<br/><br/>
    Global variables are kept in the client terminal within 4 weeks since the last access, then they will be deleted automatically.
    An access to a global variable is not only <a href="help://globals_GlobalVariableSet">setting</a> of a new value, but <a href="help://globals_GlobalVariableGet">reading</a> of the global variable value, as well.<br/><br/>
    Global variables of the client terminal are accessible simultaneously from all MQL4 programs launched in the client terminal.
    </content>

    <function>
      tag=globals_GlobalVariableCheck
      caption=GlobalVariableCheck()
      type=bool
      <content>
Returns TRUE if the global variable exists, otherwise, returns FALSE.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  // check variable before use
  if(!GlobalVariableCheck(&quot;g1&quot;))
    GlobalVariableSet(&quot;g1&quot;,1);
      </example>
      <parameter>
        type=string
        name=name
        description=Global variable name.
      </parameter>
    </function>

    <function>
      tag=globals_GlobalVariableDel
      caption=GlobalVariableDel()
      type=bool
      <content>
Deletes the global variable.
If the function succeeds, the returned value will be TRUE, otherwise, it will be FALSE.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  // deleting of the global variable named &quot;gvar_1&quot;
  GlobalVariableDel(&quot;gvar_1&quot;);
      </example>
      <parameter>
        type=string
        name=name
        description=Global variable name.
      </parameter>
    </function>

    <function>
      tag=globals_GlobalVariableGet
      caption=GlobalVariableGet()
      type=double
      <content>
Returns the value of an existing global variable or 0 if an error occurs.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  double v1=GlobalVariableGet(&quot;g1&quot;);
  //---- check function call result
  if(GetLastError()!=0) return(false);
  //---- continue processing
      </example>
      <parameter>
        type=string
        name=name
        description=Global variable name.
      </parameter>
    </function>

    <function>
      tag=globals_GlobalVariableName
      caption=GlobalVariableName()
      type=string
      <content>
The function returns the name of a global variable by its index in the list of global variables.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a>.
     </content>
      <example>
  int    var_total=GlobalVariablesTotal();
  string name;
  for(int i=0;i&lt;var_total;i++)
    {
     name=GlobalVariableName(i);
     Print(i,&quot;: Global variable name - &quot;,name);
    }
      </example>
      <parameter>
        type=int
        name=index
        description=Index in the list of global variables. It must exceed or be equal to 0 and be less than <a href="help://globals_GlobalVariablesTotal">GlobalVariablesTotal()</a>.
      </parameter>
    </function>

    <function>
      tag=globals_GlobalVariableSet
      caption=GlobalVariableSet()
      type=datetime
      <content>
Sets a new value of the global variable. If it does not exist, the system creates a new gloabl variable.
If the function succeeds, the returned value will be the last access time. Otherwise, the returned value will be 0.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      <example>
  //---- try to set new value
  if(GlobalVariableSet(&quot;BarsTotal&quot;,Bars)==0)
    return(false);
  //---- continue processing
      </example>
      <parameter>
        type=string
        name=name
        description=Global variable name.
      </parameter>
      <parameter>
        type=double
        name=value
        description=The new numeric value.
      </parameter>
    </function>

    <function>
      tag=globals_GlobalVariableSetOnCondition
      caption=GlobalVariableSetOnCondition()
      type=bool
      <content>
Sets the new value of the existing global variable if the current value
equals to the third parameter <i>check_value</i>. If there is no global variable, the function will generate <a href="help://constants_errors">error</a> ERR_GLOBAL_VARIABLE_NOT_FOUND (4058) and return FALSE.
When successfully executed, the function returns TRUE, otherwise, it returns FALSE. To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.<br/>
If the current value of the global variable differs from the <i>check_value</i>, the function will return FALSE.<br/>
The function provides atomic access to the global variable, this is why it can be used 
for providing of a semaphore at interaction of several experts working simultaneously within one client terminal.
     </content>
      <example>
  int init()
    {
     //---- create global variable
     GlobalVariableSet(&quot;DATAFILE_SEM&quot;,0);
     //...
    }
  
  int start()
    {
     //---- try to lock common resource
     while(!IsStopped())
       {
        //---- locking
        if(GlobalVariableSetOnCondition(&quot;DATAFILE_SEM&quot;,1,0)==true)  break;
        //---- may the variable be deleted?
        if(GetLastError()==ERR_GLOBAL_VARIABLE_NOT_FOUND) return(0);
        //---- sleeping
        Sleep(500);
       }
     //---- resource locked
     // ... do some work
     //---- unlock resource
     GlobalVariableSet(&quot;DATAFILE_SEM&quot;,0);
    }
      </example>
      <parameter>
        type=string
        name=name
        description=Global variable name.
      </parameter>
      <parameter>
        type=double
        name=value
        description=New value.
      </parameter>
      <parameter>
        type=double
        name=check_value
        description=Value to be compared to the current global variable value.
      </parameter>
    </function>

    <function>
      tag=globals_GlobalVariablesDeleteAll
      caption=GlobalVariablesDeleteAll()
      type=int
      <content>
      Deletes global variables. If the name prefix is not specified, all global variables will be deleted.
      Otherwise, only those variables will be deleted, the names of which begin with the specified prefix.
      The function returns the count of deleted variables.
      </content>
      example=Print(GlobalVariablesDeleteAll(&quot;test_&quot;),&quot; test globals deleted&quot;);
      <parameter>
        type=string
        name=prefix_name
        def_value=NULL
        description=Name prefix of the global variables to be deleted.
      </parameter>
    </function>

    <function>
      tag=globals_GlobalVariablesTotal
      caption=GlobalVariablesTotal()
      type=int
      <content>
      The function returns the total count of global variables.
      </content>
      example=Print(GlobalVariablesTotal(),&quot; global variables detected&quot;);
    </function>
  </group>

  <group>
    tag=math
    caption=Math &amp; Trig
    <content>
    A set of mathematical and trigonometric functions.
    </content>

    <function>
      tag=math_MathAbs
      caption=MathAbs()
      type=double
      <content>
      Returns the absolute value (modulus) of the specified numeric value.
      </content>
      <example>
  double dx=-3.141593, dy;
  // calc MathAbs
  dy=MathAbs(dx);
  Print("The absolute value of ",dx," is ",dy);
  // Output: The absolute value of -3.141593 is 3.141593
      </example>
      <parameter>
        type=double
        name=value
        description=Numeric value.
      </parameter>
    </function>

    <function>
      tag=math_MathArccos
      caption=MathArccos()
      type=double
      <content>
The MathArccos function returns the arccosine of <i>x</i> within the range 0 to &#x3C0; (in radians).
If <i>x</i> is less than -1 or exceeds 1, the MathArccos returns NaN (indeterminate value).
      </content>
      <example>
  double x=0.32696, y;
  y=asin(x);
  Print("Arcsine of ",x," = ",y);
  y=acos(x);
  Print("Arccosine of ",x," = ",y);
  //Output: Arcsine   of 0.326960=0.333085
  //Output: Arccosine of 0.326960=1.237711
      </example>
      <parameter>
        type=double
        name=x
        description=Value between -1 and 1 the arccosine of which to be calculated.
      </parameter>
    </function>

    <function>
      tag=math_MathArcsin
      caption=MathArcsin()
      type=double
      <content>
The MathArcsin function returns the arcsine of <i>x</i> in the range -&#x3C0;/2 to &#x3C0;/2 radians.
If <i>x</i> is less than -1 or exceeds 1, the arcsine returns NaN (indeterminate value).
      </content>
      <example>
  double x=0.32696, y;
  y=MathArcsin(x);
  Print("Arcsine of ",x," = ",y);
  y=acos(x);
  Print("Arccosine of ",x," = ",y);
  //Output: Arcsine   of 0.326960=0.333085
  //Output: Arccosine of 0.326960=1.237711
      </example>
      <parameter>
        type=double
        name=x
        description=Value the arcsine of which to be calculated
      </parameter>
    </function>

    <function>
      tag=math_MathArctan
      caption=MathArctan()
      type=double
      <content>
The MathArctan returns the arctangent of <i>x</i>. If <i>x</i> is 0, MathArctan returns 0.
MathArctan returns a value within the range of -&#x3C0;/2 to &#x3C0;/2 radians.
      </content>
      <example>
  double x=-862.42, y;
  y=MathArctan(x);
  Print("Arctangent of ",x," is ",y);
  //Output: Arctangent of -862.42 is -1.5696
      </example>
      <parameter>
        type=double
        name=x
        description=A number representing a tangent.
      </parameter>
    </function>

    <function>
      tag=math_MathCeil
      caption=MathCeil()
      type=double
      <content>
The MathCeil function returns a numeric value representing the smallest integer
that exceeds or equals to <i>x</i>.
      </content>
      <example>
  double y;
  y=MathCeil(2.8);
  Print("The ceil of 2.8 is ",y);
  y=MathCeil(-2.8);
  Print("The ceil of -2.8 is ",y);
  /*Output:
    The ceil of 2.8 is 3
    The ceil of -2.8 is -2*/
      </example>
      <parameter>
        type=double
        name=x
        description=Numeric value.
      </parameter>
    </function>

    <function>
      tag=math_MathCos
      caption=MathCos()
      type=double
      <content>
      Returns the cosine of the specified angle.
      </content>
      <example>
  double pi=3.1415926535;
  double x, y;

  x=pi/2;
  y=MathSin(x);
  Print("MathSin(",x,") = ",y);
  y=MathCos(x);
  Print("MathCos(",x,") = ",y);
  //Output: MathSin(1.5708)=1
  //        MathCos(1.5708)=0
      </example>
      <parameter>
        type=double
        name=value
        description=An angle measured in radians.
      </parameter>
    </function>

    <function>
      tag=math_MathExp
      caption=MathExp()
      type=double
      <content>
Returns the value of <b>e</b> raised to the power of <i>d</i>.
At overflow, the function returns INF (infinity), and it returns 0 at underflow.
      </content>
      <example>
  double x=2.302585093,y;
  y=MathExp(x);
  Print("MathExp(",x,") = ",y);
  //Output: MathExp(2.3026)=10
      </example>
      <parameter>
        type=double
        name=d
        description=A number specifying the power.
      </parameter>
    </function>

    <function>
      tag=math_MathFloor
      caption=MathFloor()
      type=double
      <content>
The MathFloor function returns a numeric value representing the largest integer that is less than or equal to <i>x</i>.      
      </content>
      <example>
  double y;
  y=MathFloor(2.8);
  Print("The floor of 2.8 is ",y);
  y=MathFloor(-2.8);
  Print("The floor of -2.8 is ",y);
  /*Output:
    The floor of 2.8 is 2
    The floor of -2.8 is -3*/
      </example>
      <parameter>
        type=double
        name=x
        description=Numeric value.
      </parameter>
    </function>

    <function>
      tag=math_MathLog
      caption=MathLog()
      type=double
      <content>
The MathLog function returns the natural logarithm of <i>x</i> if successful.
If <i>x</i> is negative, these functions return NaN (indeterminate value).
If <i>x</i> is 0, they return INF (infinity).
      </content>
      <example>
  double x=9000.0,y;
  y=MathLog(x);
  Print("MathLog(",x,") = ", y);
  //Output: MathLog(9000)=9.10498
      </example>
      <parameter>
        type=double
        name=x
        description=Value logarithm of which to be found.
      </parameter>
    </function>

    <function>
      tag=math_MathMax
      caption=MathMax()
      type=double
      <content>
      Returns the maximum value of two numeric values.
      </content>
      <example>
  double result=MathMax(1.08,Bid);
      </example>
      <parameter>
        type=double
        name=value1
        description=The first numeric value.
      </parameter>
      <parameter>
        type=double
        name=value2
        description=The second numeric value.
      </parameter>
    </function>

    <function>
      tag=math_MathMin
      caption=MathMin()
      type=double
      <content>
      Returns the minimum value of two numeric values.
      </content>
      <example>
  double result=MathMin(1.08,Ask);
      </example>
      <parameter>
        type=double
        name=value1
        description=The first numeric value.
      </parameter>
      <parameter>
        type=double
        name=value2
        description=The second numeric value.
      </parameter>
    </function>

    <function>
      tag=math_MathMod
      caption=MathMod()
      type=double
      <content>
      The function returns the floating-point remainder of division of two numbers.<br/><br/>
      The MathMod function calculates the floating-point remainder <i>f&nbsp;</i> of <i>x&nbsp;/&nbsp;y&nbsp;</i> such that
      <i>x&nbsp;=&nbsp;i&nbsp;*&nbsp;y&nbsp;+&nbsp;f&nbsp;</i>, where <i>i&nbsp;</i> is an integer, <i>f&nbsp;</i> has the same sign as <i>x</i>,
      and the absolute value of <i>f&nbsp;</i> is less than the absolute value of <i>y</i>.
      </content>
      <example>
  double x=-10.0,y=3.0,z;
  z=MathMod(x,y);
  Print("The remainder of ",x," / ",y," is ",z);
  //Output: The remainder of -10 / 3 is -1
      </example>
      <parameter>
        type=double
        name=value
        description=Dividend value.
      </parameter>
      <parameter>
        type=double
        name=value2
        description=Divisor value.
      </parameter>
    </function>

    <function>
      tag=math_MathPow
      caption=MathPow()
      type=double
      <content>
      Returns the value of the base expression raised to the specified power (exponent value).
      </content>
      <example>
  double x=2.0,y=3.0,z;
  z=MathPow(x,y);
  Printf(x," to the power of ",y," is ", z);
  //Output: 2 to the power of 3 is 8
      </example>
      <parameter>
        type=double
        name=base
        description=Base value.
      </parameter>
      <parameter>
        type=double
        name=exponent
        description=Exponent value.
      </parameter>
    </function>

    <function>
      tag=math_MathRand
      caption=MathRand()
      type=int
      <content>
The MathRand function returns a pseudorandom integer within the range of 0 to 32767.
The <a href="help://math_MathSrand">MathSrand</a> function must be used to seed the pseudorandom-number generator before calling MathRand.
      </content>
      <example>
  MathSrand(TimeLocal());
  // Display 10 numbers.
  for(int i=0;i&lt;10;i++ )
    Print("random value ", MathRand());
      </example>  
    </function>

    <function>
      tag=math_MathRound
      caption=MathRound()
      type=double
      <content>
      Returns value rounded to the nearest integer of the specified numeric value.
      </content>
      <example>
  double y=MathRound(2.8);
  Print("The round of 2.8 is ",y);
  y=MathRound(2.4);
  Print("The round of -2.4 is ",y);
  //Output: The round of 2.8 is 3
  //        The round of -2.4 is -2
      </example>
      <parameter>
        type=double
        name=value
        description=Numeric value to be rounded.
      </parameter>
    </function>

    <function>
      tag=math_MathSin
      caption=MathSin()
      type=double
      <content>
      Returns the sine of the specified angle.
      </content>
      <example>
  double pi=3.1415926535;
  double x, y;

  x=pi/2;
  y=MathSin(x);
  Print("MathSin(",x,") = ",y);
  y=MathCos(x);
  Print("MathCos(",x,") = ",y);
  //Output: MathSin(1.5708)=1
  //        MathCos(1.5708)=0
      </example>
      <parameter>
        type=double
        name=value
        description=An angle measured in radians.
      </parameter>
    </function>

    <function>
      tag=math_MathSqrt
      caption=MathSqrt()
      type=double
      <content>
The MathSqrt function returns the square root of <i>x</i>.
If <i>x</i> is negative, MathSqrt returns an indefinite (same as a quiet NaN).
      </content>
      <example>
  double question=45.35, answer;
  answer=MathSqrt(question);
  if(question&lt;0)
    Print(&quot;Error: MathSqrt returns &quot;,answer,&quot; answer&quot;);
  else
    Print("The square root of ",question," is ", answer);
  //Output: The square root of 45.35 is 6.73
      </example>
      <parameter>
        type=double
        name=x
        description=Positive numeric value.
      </parameter>
    </function>

    <function>
      tag=math_MathSrand
      caption=MathSrand()
      type=void
      <content>
The MathSrand() function sets the starting point for generating a series of pseudorandom integers.
To reinitialize the generator, use 1 as the seed argument. Any other value for seed sets the
generator to a random starting point. <a href="help://math_MathRand">MathRand</a> retrieves the pseudorandom numbers
that are generated.
Calling MathRand before any call to MathSrand generates the same sequence as calling MathSrand with seed passed as 1.
      </content>
      <example>
  MathSrand(TimeLocal());
  // Display 10 numbers.
  for(int i=0;i&lt;10;i++ )
    Print("random value ", MathRand());
      </example>  
      <parameter>
        type=int
        name=seed
        description=Seed for random-number generation.
      </parameter>
    </function>

    <function>
      tag=math_MathTan
      caption=MathTan()
      type=double
      <content>
MathTan returns the tangent of <i>x</i>. If <i>x</i> is greater than or equal to 263, or less than or equal to -263,
a loss of significance in the result occurs, in which case the function returns an indefinite (same as a quiet NaN).
      </content>
      <example>
  double pi=3.1415926535;
  double x,y;
  x=MathTan(pi/4);
  Print("MathTan(",pi/4," = ",x);
  //Output: MathTan(0.7856)=1
      </example>
      <parameter>
        type=double
        name=x
        description=Angle in radians.
      </parameter>
    </function>
  </group>


  <group>
    tag=objects
    caption=Object functions
    <content>
    A group of functions intended for working with graphical objects related to the current chart.
    </content>

    <function>
      tag=objects_ObjectCreate
      caption=ObjectCreate()
      type=bool
      <content>
Creation of an object with the specified name, type and initial coordinates in the specified window.
Count of coordinates related to the object can be from 1 to 3 depending on the object type.
If the function succeeds, the returned value will be TRUE. Otherwise, it will be FALSE.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
Objects of the OBJ_LABEL type ignore the coordinates. Use the function of
<a href="help://objects_ObjectSet">ObjectSet()</a> to set up the <a href="help://constants_objects_properties">OBJPROP_XDISTANCE</a> and 
<a href="help://constants_objects_properties">OBJPROP_YDISTANCE</a> properties.<br/>
Notes: The chart sub-windows (if there are sub-windows with indicators in the chart) are numbered starting from 1. The chart main window always exists and has the 0 index.<br/>
Coordinates must be passed in pairs: time and price.
For example, the OBJ_VLINE object needs only time, but price (any value) must be passed, as well.
      </content>
      <example>
  // new text object
  if(!ObjectCreate(&quot;text_object&quot;, OBJ_TEXT, 0, D'2004.02.20 12:30', 1.0045))
    {
     Print(&quot;error: can't create text_object! code #&quot;,GetLastError());
     return(0);
    }
  // new label object
  if(!ObjectCreate(&quot;label_object&quot;, OBJ_LABEL, 0, 0, 0))
    {
     Print(&quot;error: can't create label_object! code #&quot;,GetLastError());
     return(0);
    }
  ObjectSet(&quot;label_object&quot;, OBJPROP_XDISTANCE, 200);
  ObjectSet(&quot;label_object&quot;, OBJPROP_YDISTANCE, 100);
      </example>
      <parameter>
        type=string
        name=name
        description=Object unique name.
      </parameter>
      <parameter>
        type=int
        name=type
        description=Object type. It can be any of the <a href="help://constants_objects">Object type enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=window
        description=Index of the window where the object will be added. Window index must exceed or equal to 0 and be less than <a href="help://windows_WindowsTotal">WindowsTotal()</a>.
      </parameter>
      <parameter>
        type=datetime
        name=time1
        description=Time part of the first point.
      </parameter>
      <parameter>
        type=double
        name=price1
        description=Price part of the first point.
      </parameter>
      <parameter>
        type=datetime
        name=time2
        def_value=0
        description=Time part of the second point.
      </parameter>
      <parameter>
        type=double
        name=price2
        def_value=0
        description=Price part of the second point.
      </parameter>
      <parameter>
        type=datetime
        name=time3
        def_value=0
        description=Time part of the third point.
      </parameter>
      <parameter>
        type=double
        name=price3
        def_value=0
        description=Price part of the third point.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectDelete
      caption=ObjectDelete()
      type=bool
      <content>
Deletes object having the specified name. 
If the function succeeds, the returned value will be TRUE. Otherwise, it will be FALSE.<br/>
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      example=ObjectDelete(&quot;text_object&quot;);
      <parameter>
        type=string
        name=name
        description=Name of the object to be deleted.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectDescription
      caption=ObjectDescription()
      type=string
      <content>
Return object description. For objects of OBJ_TEXT and OBJ_LABEL types, the text drawn by these objects will be returned.<br/>
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
<br/><b>See also</b> <a href="help://objects_ObjectSetText">ObjectSetText()</a> function.
     </content>
      <example>
  // writing the chart objects list to the file
  int    handle, total;
  string obj_name,fname;
  // file name
  fname="objlist_"+Symbol();
  handle=FileOpen(fname,FILE_CSV|FILE_WRITE);
  if(handle!=false)
    {
     total=ObjectsTotal();
     for(int i=-;i&lt;total;i++)
       {
        obj_name=ObjectName(i);
        FileWrite(handle,"Object "+obj_name+" description= "+ObjectDescription(obj_name));
       }
     FileClose(handle);
    }
      </example>
      <parameter>
        type=string
        name=name
        description=Object name.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectFind
      caption=ObjectFind()
      type=int
      <content>
Search for an object having the specified name. The function returns index of the windows that contains the object to be found. If it fails, the returned value will be -1.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
The chart sub-windows (if there are sub-windows with indicators in the chart) are numbered starting from 1. The chart main window always exists and has the 0 index.
      </content>
      example=if(ObjectFind(&quot;line_object2&quot;)!=win_idx) return(0);
      <parameter>
        type=string
        name=name
        description=Object name to search for.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectGet
      caption=ObjectGet()
      type=double
      <content>
The function returns the value of the specified object property.
To check errors, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
<br/><b>See also</b> <a href="help://objects_ObjectSet">ObjectSet()</a> function.
      </content>
      example=color oldColor=ObjectGet(&quot;hline12&quot;, OBJPROP_COLOR);
      <parameter>
        type=string
        name=name
        description=Object name.
      </parameter>
      <parameter>
        type=int
        name=index
        description=Object property index. It can be any of the <a href="help://constants_objects_properties">Object properties enumeration</a> values.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectGetFiboDescription
      caption=ObjectGetFiboDescription()
      type=string
      <content>
The function returns the level description of a Fibonacci object.
The amount of Fibonacci levels depends on the <a href="help://constants_objects">object type</a>. The maximum amount of Fibonacci levels is 32.<br/>
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError() function</a>.
<br/><b>See also</b> <a href="help://objects_ObjectSetFiboDescription">ObjectSetFiboDescription()</a> function.
      </content>
      <example>
#include &lt;stdlib.mqh&gt;
  ...
  string text;
  for(int i=0;i&lt;32;i++)
    {
     text=ObjectGetFiboDescription(MyObjectName,i);
     //---- checking whether the objects has less than 32 levels
     if(GetLastError()!=ERR_NO_ERROR) break;
     Print(MyObjectName,&quot;level: &quot;,i,&quot; description: &quot;,text);
    }
      </example>
      <parameter>
        type=string
        name=name
        description=Fibonacci object name.
      </parameter>
      <parameter>
        type=int
        name=index
        description=Index of the Fibonacci level (0-31).
      </parameter>
    </function>

    <function>
      tag=objects_ObjectGetShiftByValue
      caption=ObjectGetShiftByValue()
      type=int
      <content>
The function calculates and returns bar index (shift related to the current bar) for the given price.
The bar index is calculated by the first and second coordinates using a linear equation. Applied to trendlines and similar objects.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
<br/><b>See also</b> <a href="help://objects_ObjectGetValueByShift">ObjectGetValueByShift()</a> function.
      </content>
      <example>
  int shift=ObjectGetShiftByValue(&quot;MyTrendLine#123&quot;, 1.34);
      </example>
      <parameter>
        type=string
        name=name
        description=Object name.
      </parameter>
      <parameter>
        type=double
        name=value
        description=Price value.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectGetValueByShift
      caption=ObjectGetValueByShift()
      type=double
      <content>
The function calculates and returns the price value for the specified bar (shift related to the current bar).
The price value is calculated by the first and second coordinates using a linear equation.  Applied to trendlines and similar objects.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
<br/><b>See also</b> <a href="help://objects_ObjectGetShiftByValue">ObjectGetShiftByValue()</a> function.
      </content>
      <example>
  double price=ObjectGetValueByShift(&quot;MyTrendLine#123&quot;, 11);
      </example>
      <parameter>
        type=string
        name=name
        description=Object name
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Bar index.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectMove
      caption=ObjectMove()
      type=bool
      <content>
The function moves an object coordinate in the chart. Objects can have from one to three coordinates depending on their
<a href="help://constants_objects">types</a>.
If the function succeeds, the returned value will be TRUE. Otherwise, it will be FALSE.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
The object coordinates are numbered starting from 0.
     </content>
      example=ObjectMove(&quot;MyTrend&quot;, 1, D'2005.02.25 12:30', 1.2345);
      <parameter>
        type=string
        name=name
        description=Object name.
      </parameter>
      <parameter>
        type=int
        name=point
        description=Coordinate index (0-2).
      </parameter>
      <parameter>
        type=datetime
        name=time1
        description=New time value.
      </parameter>
      <parameter>
        type=double
        name=price1
        description=New price value.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectName
      caption=ObjectName()
      type=string
      <content>
The function returns the object name by its index in the objects list.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
     </content>
      <example>
  int    obj_total=ObjectsTotal();
  string name;
  for(int i=0;i&lt;obj_total;i++)
    {
     name=ObjectName(i);
     Print(i,&quot;Object name is &quot; + name);
    }
      </example>
      <parameter>
        type=int
        name=index
        description=Object index in the objects list. Object index must exceed or equal to 0 and be less than <a href="help://objects_ObjectsTotal">ObjectsTotal()</a>.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectsDeleteAll
      caption=ObjectsDeleteAll()
      type=int
      <content>
Removes all objects of the specified type and in the specified sub-window of the chart. The function returns the count of removed objects.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.<br/>
Notes: The chart sub-windows (if there are sub-windows with indicators in the chart) are numbered starting from 1. The chart main window always exists and has the 0 index.
If the window index is missing or it has the value of -1, the objects will be removed from the entire chart.<br/>
If the <i>type</i> value equals to -1 or this parameter is missing, all objects will be removed from the specified sub-window.
     </content>
      <example>
  ObjectsDeleteAll(2, OBJ_HLINE); // all horizontal lines are removed from the 2nd sub-window.
  ObjectsDeleteAll(2);            // all objects are removed from the 2nd sub-window.
  ObjectsDeleteAll();             // all objects are removed from the chart.
      </example>
      <parameter>
        type=int
        name=window
        def_value=EMPTY
        <description>
Optional parameter.
 Index of the window in which the objects will be deleted. Must exceed or equal to -1 (EMPTY, the default value) and be less than <a href="help://windows_WindowsTotal">WindowsTotal()</a>.
        </description>
      </parameter>
      <parameter>
        type=int
        name=type
        def_value=EMPTY
        <description>
Optional parameter. An object type to be deleted.
 It can be any of the <a href="help://constants_objects">Object type enumeration</a> values or EMPTY constant to delete all objects with any types.
        </description>
      </parameter>
    </function>

    <function>
      tag=objects_ObjectSet
      caption=ObjectSet()
      type=bool
      <content>
Changes the value of the specified object property. If the function succeeds, the returned value will be TRUE. Otherwise, it will be FALSE.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
<br/><b>See also</b> <a href="help://objects_ObjectGet">ObjectGet()</a> function.
      </content>
      <example>
  // moving the first coord to the last bar time
  ObjectSet(&quot;MyTrend&quot;, OBJPROP_TIME1, Time[0]);
  // setting the second fibo level
  ObjectSet(&quot;MyFibo&quot;, OBJPROP_FIRSTLEVEL+1, 1.234);
  // setting object visibility. object will be shown only on 15 minute and 1 hour charts
  ObjectSet(&quot;MyObject&quot;, OBJPROP_TIMEFRAMES, OBJ_PERIOD_M15 | OBJ_PERIOD_H1);
      </example>
      <parameter>
        type=string
        name=name
        description=Object name.
      </parameter>
      <parameter>
        type=int
        name=index
        description=Object value index. It can be any of <a href="help://constants_objects_properties">Object properties enumeration</a> values.
      </parameter>
      <parameter>
        type=double
        name=value
        description=New value of the given property.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectSetFiboDescription
      caption=ObjectSetFiboDescription()
      type=bool
      <content>
The function assigns a new description to a level of a Fibonacci object. The amount of Fibonacci levels depends on the <a href="help://constants_objects">object type</a>.
The maximum amount of Fibonacci levels is 32.<br/>
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      example=ObjectSetFiboDescription(&quot;MyFiboObject&quot;,2,&quot;Second line&quot;);
      <parameter>
        type=string
        name=name
        description=Object name.
      </parameter>
      <parameter>
        type=int
        name=index
        description=Index of the Fibonacci level (0-31).
      </parameter>
      <parameter>
        type=string
        name=text
        description=New description of the level.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectSetText
      caption=ObjectSetText()
      type=bool
      <content>
Changes the object description. For objects of OBJ_TEXT and OBJ_LABEL, this description is shown as a text line in the chart.
If the function succeeds, the returned value will be TRUE. Otherwise, it is FALSE.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError() function</a>.<br/>
Parameters of <i>font_size</i>, <i>font_name</i> and <i>text_color</i> are used for objects of OBJ_TEXT and OBJ_LABEL only.
For objects of <a href="help://constants_objects">other types</a>, these parameters are ignored.
<br/><b>See also</b> <a href="help://objects_ObjectDescription">ObjectDescription()</a> function.
      </content>
      example=ObjectSetText(&quot;text_object&quot;, &quot;Hello world!&quot;, 10, &quot;Times New Roman&quot;, Green);
      <parameter>
        type=string
        name=name
        description=Object name.
      </parameter>
      <parameter>
        type=string
        name=text
        description=A text describing the object.
      </parameter>
      <parameter>
        type=int
        name=font_size
        description=Font size in points.
      </parameter>
      <parameter>
        type=string
        name=font
        def_value=NULL
        description=Font name.
      </parameter>
      <parameter>
        type=color
        name=text_color
        def_value=CLR_NONE
        description=Text color.
      </parameter>
    </function>

    <function>
      tag=objects_ObjectsTotal
      caption=ObjectsTotal()
      type=int
      <content>
      Returns total amount of objects of the specified type in the chart.
      </content>
      <example>
  int    obj_total=ObjectsTotal();
  string name;
  for(int i=0;i&lt;obj_total;i++)
    {
     name=ObjectName(i);
     Print(i,&quot;Object name for object #&quot;,i,&quot; is &quot; + name);
    }
      </example>
      <parameter>
        type=int
        name=type
        def_value=EMPTY
        <description>
Optional parameter. An object type to be counted.
 It can be any of the <a href="help://constants_objects">Object type enumeration</a> values or EMPTY constant to count all objects with any types.
        </description>
      </parameter>
    </function>

    <function>
      tag=objects_ObjectType
      caption=ObjectType()
      type=int
      <content>
The function returns the <a href="help://constants_objects">object type</a> value.
To get the detailed error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.
      </content>
      example=if(ObjectType(&quot;line_object2&quot;)!=OBJ_HLINE) return(0);
      <parameter>
        type=string
        name=name
        description=Object name.
      </parameter>
    </function>
  </group>

  <group>
    tag=strings
    caption=String functions
    <content>
    A group of functions intended for working with data of the string type.
    </content>

    <function>
      tag=strings_StringConcatenate
      caption=StringConcatenate()
      type=string
      <content>
Forms a string of the data passed and returns it. Parameters can be of any type. Amount of passed parameters cannot exceed 64.<br/><br/>
Parameters are transformed into strings according the same rules as those used in functions of <a href="help://common_Print">Print()</a>, <a href="help://common_Alert">Alert()</a> and <a href="help://common_Comment">Comment()</a>.
The returned string is obtained as a result of concatenate of strings converted from the function parameters.<br/><br/>
The StringConcatenate() works faster and more memory-saving than when strings are concatenated using addition operations (+).
      </content>
      <example>
  string text;
  text=StringConcatenate(&quot;Account free margin is &quot;, AccountFreeMargin(), &quot;Current time is &quot;, TimeToStr(TimeCurrent()));
// slow text=&quot;Account free margin is &quot; + AccountFreeMargin() + &quot;Current time is &quot; + TimeToStr(TimeCurrent())
  Print(text);
      </example>
      <parameter>
        type=...
        name=
        description=Any values separated by commas. It can be up to 64 parameters.
      </parameter>
    </function>

    <function>
      tag=strings_StringFind
      caption=StringFind()
      type=int
      <content>
      Search for a substring. Returns the position in the string from which the searched substring begins, or -1 if the substring has not been found.
      </content>
      <example>
  string text=&quot;The quick brown dog jumps over the lazy fox&quot;;
  int index=StringFind(text, &quot;dog jumps over&quot;, 0);
  if(index!=16)
    Print(&quot;oops!&quot;);
      </example>
      <parameter>
        type=string
        name=text
        description=String to search in.
      </parameter>
      <parameter>
        type=string
        name=matched_text
        description=Substring to search for.
      </parameter>
      <parameter>
        type=int
        name=start
        def_value=0
        description=Position in the string to start search from.
      </parameter>
    </function>

    <function>
      tag=strings_StringGetChar
      caption=StringGetChar()
      type=int
      <content>
      Returns character (code) from the specified position in the string.
      </content>
      <example>
  int char_code=StringGetChar(&quot;abcdefgh&quot;, 3);
  // char code 'c' is 99
      </example>
      <parameter>
        type=string
        name=text
        description=String
      </parameter>
      <parameter>
        type=int
        name=pos
        description=Char position in the string. Can be from 0 to <a href="help://strings_StringLen">StringLen(text)</a>-1.
      </parameter>
    </function>

    <function>
      tag=strings_StringLen
      caption=StringLen()
      type=int
      <content>
      Returns character count in a string.
      </content>
      <example>
  string str=&quot;some text&quot;;
  if(StringLen(str)&lt;5) return(0);
      </example>
      <parameter>
        type=string
        name=text
        description=String where the length must be calculated.
      </parameter>
    </function>

    <function>
      tag=strings_StringSetChar
      caption=StringSetChar()
      type=string
      <content>
      Returns the string copy with changed character in the specified position.
      </content>
      <example>
  string str=&quot;abcdefgh&quot;;
  string str1=StringSetChar(str, 3, 'D');
  // str1 is &quot;abcDefgh&quot;
      </example>
      <parameter>
        type=string
        name=text
        description=String where character will be changed.
      </parameter>
      <parameter>
        type=int
        name=pos
        description=The character position in the string. Can be from 0 to <a href="help://strings_StringLen">StringLen(text)</a>.
      </parameter>
      <parameter>
        type=int
        name=value
        description=New char ASCII code.
      </parameter>
    </function>

    <function>
      tag=strings_StringSubstr
      caption=StringSubstr()
      type=string
      <content>
Extracts a substring from text string starting from the given position.<br/>
The function returns a copy of the extracted substring if possible, otherwise, it returns an empty string.
      </content>
      <example>
  string text=&quot;The quick brown dog jumps over the lazy fox&quot;;
  string substr=StringSubstr(text, 4, 5);
  // subtracted string is the &quot;quick&quot; word
      </example>
      <parameter>
        type=string
        name=text
        description=String from which the substring will be extracted.
      </parameter>
      <parameter>
        type=int
        name=start
        description=Substring starting index. Can be from 0 to <a href="help://strings_StringLen">StringLen(text)</a>-1.
      </parameter>
      <parameter>
        type=int
        name=length
        def_value=0
        description=Length of the substring extracted. If the parameter value exceeds or equals to 0 or the parameter is not specified, the substring will be extracted starting from the given position and up to the end of the string.
      </parameter>
    </function>

    <function>
      tag=strings_StringTrimLeft
      caption=StringTrimLeft()
      type=string
      <content>
The function cuts line feed characters, spaces 
and tabs in the left part of the string.
The function returns a copy of the trimmed string, if possible.
Otherwise, it returns an empty string.
      </content>
      <example>
  string str1=&quot;  Hello world   &quot;;
  string str2=StringTrimLeft(str);
  // after trimming the str2 variable will be &quot;Hello World   &quot;
      </example>
      <parameter>
        type=string
        name=text
        description=String to be trimmed at the left.
      </parameter>
    </function>

    <function>
      tag=strings_StringTrimRight
      caption=StringTrimRight()
      type=string
      <content>
The function cuts line feed characters, spaces 
and tabs in the right part of the string.
The function returns a copy of the trimmed string, if possible.
Otherwise, it returns an empty string.
      </content>
      <example>
  string str1=&quot;  Hello world   &quot;;
  string str2=StringTrimRight(str);
  // after trimming the str2 variable will be &quot;  Hello World&quot;
      </example>
      <parameter>
        type=string
        name=text
        description=String to be trimmed at the right.
      </parameter>
    </function>
  </group>


  <group>
    tag=indicators
    caption=Technical indicators
    <content>
    A group of functions intended for calculation of standard and custom indicators.<br/><br/>
    For an expert (or any other MQL4 program) to take up the value of any indicator, it is not necessary that this indicator is present in the chart.
    The requested indicator will be loaded and calculated in the thread of the module that has called it.<br/><br/>
    Any indicator can be calculated on the data of not only current chart, but also on the data of any available symbol/period.
    If data (symbol name and/or timeframe differ from the current ones) are requested from another chart, the situation is possible 
    that the corresponding chart was not opened in the client terminal and the necessary data must be requested from the server. In this case, 
    <a href="help://constants_errors">error</a> ERR_HISTORY_WILL_UPDATED (4066 - the requested history data are under updating) will be placed 
    in the <a href="help://runtime_errors">last_error</a> variable, and one will has to re-request (see example of <a href="help://array_ArrayCopySeries">ArrayCopySeries()</a>).
    </content>

    <function>
      tag=indicators_iAC
      caption=iAC() - Accelerator Oscillator (Acceleration/Deceleration)
      type=double
      <content>
      Calculates the Bill Williams' Accelerator/Decelerator oscillator.
      </content>
      <example>
  double result=iAC(NULL, 0, 1);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iAD
      caption=iAD() - Accumulation/Distribution
      type=double
      <content>
      Calculates the Accumulation/Distribution indicator and returns its value.
      </content>
      <example>
  double result=iAD(NULL, 0, 1);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iAlligator
      caption=iAlligator() - Alligator
      type=double
      keywords=;MODE_GATORJAW;MODE_GATORTEETH;MODE_GATORLIPS;
      <content>
      Calculates the Bill Williams' Alligator and returns its value.
      </content>
      <example>
  double jaw_val=iAlligator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, 1);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be one of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=jaw_period
        description=Blue line averaging period (Alligator's Jaw).
      </parameter>
      <parameter>
        type=int
        name=jaw_shift
        description=Blue line shift relative to the chart.
      </parameter>
      <parameter>
        type=int
        name=teeth_period
        description=Red line averaging period (Alligator's Teeth).
      </parameter>
      <parameter>
        type=int
        name=teeth_shift
        description=Red line shift relative to the chart.
      </parameter>
      <parameter>
        type=int
        name=lips_period
        description=Green line averaging period (Alligator's Lips).
      </parameter>
      <parameter>
        type=int
        name=lips_shift
        description=Green line shift relative to the chart.
      </parameter>
      <parameter>
        type=int
        name=ma_method
        description=MA method. It can be any of <a href="help://constants_movings">Moving Average methods</a>.
        </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=mode
        <description>
Data source, identifier of a line of the indicator. It can be any of the following values:<br/>
MODE_GATORJAW - Gator Jaw (blue) balance line,<br/>
MODE_GATORTEETH - Gator Teeth (red) balance line,<br/>
MODE_GATORLIPS - Gator Lips (green) balance line.
        </description>
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Shift relative to the current bar (number of periods back) where the data should be taken from.
      </parameter>
    </function>

    <function>
      tag=indicators_iADX
      caption=iADX() - Average Directional Movement Index
      type=double
      <content>
      Calculates the Movement directional index and returns its value.
      </content>
      example=if(iADX(NULL,0,14,PRICE_HIGH,MODE_MAIN,0)&gt;iADX(NULL,0,14,PRICE_HIGH,MODE_PLUSDI,0)) return(0);
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period for calculation.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Indicator line index. It can be any of the <a href="help://constants_lines">Indicators line identifiers enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iATR
      caption=iATR() - Average True Range
      type=double
      <content>
      Calculates the Indicator of the average true range and returns its value.
      </content>
      <example>
  if(iATR(NULL,0,12,0)&gt;iATR(NULL,0,20,0)) return(0);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period for calculation.
        </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iAO
      caption=iAO() - Awesome Oscillator
      type=double
      <content>
      Calculates the Bill Williams' Awesome oscillator and returns its value.
      </content>
      <example>
  double val=iAO(NULL, 0, 2);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iBearsPower
      caption=iBearsPower() - Bears Power
      type=double
      <content>
      Calculates the Bears Power indicator and returns its value.
      </content>
      <example>
  double val=iBearsPower(NULL, 0, 13,PRICE_CLOSE,0);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period for calculation.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iBands
      caption=iBands() - Bollinger Bands
      type=double
      <content>
      Calculates the Bollinger bands indicator and returns its value.
      </content>
      example=if(iBands(NULL,0,20,2,0,PRICE_LOW,MODE_LOWER,0)&gt;Low[0]) return(0);
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate the indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period to calculate the main line.
      </parameter>
      <parameter>
        type=int
        name=deviation
        description=Deviation from the main line.
      </parameter>
      <parameter>
        type=int
        name=bands_shift
        description=The indicator shift relative to the chart.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Indicator line index. It can be any of the <a href="help://constants_lines">Indicators line identifiers enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iBandsOnArray
      caption=iBandsOnArray() - Bollinger Bands on buffer
      type=double
      <content>
        Calculation of the Bollinger Bands indicator on data stored in a numeric array.
        Unlike iBands(...), the iBandsOnArray function does not take data by symbol name,
        timeframe, the applied price. The price data must be previously prepared.
        The indicator is calculated from left to right. To access to the array elements as to a series array 
        (i.e., from right to left), one has to use the <a href="help://array_ArraySetAsSeries">ArraySetAsSeries</a> function.
      </content>
      example=if(iBands(ExtBuffer,total,2,0,MODE_LOWER,0)&gt;Low[0]) return(0);
      <parameter>
        type=double
        name=<nobr>array[]</nobr>
        description=Array with data.
      </parameter>
      <parameter>
        type=int
        name=total
        description=The number of items to be counted. 0 means the whole array.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period for calculation of main line.
      </parameter>
      <parameter>
        type=int
        name=deviation
        description=Deviation from main line.
      </parameter>
      <parameter>
        type=int
        name=bands_shift
        description=The indicator shift relative to the chart.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Indicator line index. It can be any of the <a href="help://constants_lines">Indicators line identifiers enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iBullsPower
      caption=iBullsPower() - Bulls Power
      type=double
      <content>
      Calculates the Bulls Power indicator and returns its value.
      </content>
      <example>
  double val=iBullsPower(NULL, 0, 13,PRICE_CLOSE,0);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period for calculation.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iCCI
      caption=iCCI() - Commodity Channel Index
      type=double
      <content>
      Calculates the Commodity channel index and returns its value.
      </content>
      <example>
  if(iCCI(NULL,0,12,PRICE_TYPICAL,0)&gt;iCCI(NULL,0,20,PRICE_TYPICAL,0)) return(0);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period for calculation.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iCCIOnArray
      caption=iCCIOnArray() - Commodity Channel Index on buffer
      type=double
      <content>
        Calculation of the Commodity Channel Index on data stored in a numeric array.
        Unlike iCCI(...), the iCCIOnArray function does not take data by symbol name,
        timeframe, the applied price. The price data must be previously prepared.
        The indicator is calculated from left to right. To access to the array elements as to a series array 
        (i.e., from right to left), one has to use the <a href="help://array_ArraySetAsSeries">ArraySetAsSeries</a> function.
      </content>
      example=if(iCCIOnArray(ExtBuffer,total,12,0)&gt;iCCI(NULL,0,20,PRICE_TYPICAL, 0)) return(0);
      <parameter>
        type=double
        name=<nobr>array[]</nobr>
        description=Array with data.
      </parameter>
      <parameter>
        type=int
        name=total
        description=The number of items to be counted.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period for calculation.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iCustom
      caption=iCustom() - Custom Indicator
      type=double
      <content>
      Calculates the specified custom indicator and returns its value. The custom indicator must be compiled (*.EX4 file) 
      and be in the <em>terminal_directory\experts\indicators</em> directory.
      </content>
      <example>
  double val=iCustom(NULL, 0, &quot;SampleInd&quot;,13,1,0);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=string
        name=name
        description=Custom indicator compiled program name.
      </parameter>
      <parameter>
        type=...
        name=
        description=Parameters set (if necessary). The passed parameters and their order must correspond with the desclaration order and the type of extern variables of the custom indicator.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Line index. Can be from 0 to 7 and must correspond with the index used by one of <a href="help://customind_SetIndexBuffer">SetIndexBuffer</a> functions.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iDeMarker
      caption=iDeMarker() - DeMarker
      type=double
      <content>
      Calculates the DeMarker indicator and returns its value.
      </content>
      <example>
  double val=iDeMarker(NULL, 0, 13, 1);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period for calculation.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iEnvelopes
      caption=iEnvelopes() - Envelopes
      type=double
      <content>
      Calculates the Envelopes indicator and returns its value.
      </content>
      <example>
  double val=iEnvelopes(NULL, 0, 13,MODE_SMA,10,PRICE_CLOSE,0.2,MODE_UPPER,0);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=ma_period
        description=Averaging period for calculation of the main line.
      </parameter>
      <parameter>
        type=int
        name=ma_method
        description=MA method. It can be any of <a href="help://constants_movings">Moving Average method enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=ma_shift
        description=MA shift. Indicator line offset relate to the chart by timeframe.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=double
        name=deviation
        description=Percent deviation from the main line.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Indicator line index. It can be any of <a href="help://constants_lines">Indicators line identifiers enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iEnvelopesOnArray
      caption=iEnvelopesOnArray() - Envelopes on buffer
      type=double
      <content>
        Calculation of the Envelopes indicator on data stored in a numeric array.
        Unlike iEnvelopes(...), the iEnvelopesOnArray function does not take data by symbol name,
        timeframe, the applied price. The price data must be previously prepared.
        The indicator is calculated from left to right. To access to the array elements as to a series array 
        (i.e., from right to left), one has to use the <a href="help://array_ArraySetAsSeries">ArraySetAsSeries</a> function.
      </content>
      <example>
  double val=iEnvelopesOnArray(ExtBuffer, 0, 13, MODE_SMA, 0.2, MODE_UPPER,0 );
      </example>
      <parameter>
        type=double
        name=<nobr>array[]</nobr>
        description=Array with data.
      </parameter>
      <parameter>
        type=int
        name=total
        description=The number of items to be counted.
      </parameter>
      <parameter>
        type=int
        name=ma_period
        description=Averaging period for calculation of the main line.
      </parameter>
      <parameter>
        type=int
        name=ma_method
        description=MA method. It can be any of <a href="help://constants_movings">Moving Average method enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=ma_shift
        description=MA shift. Indicator line offset relate to the chart by timeframe.
      </parameter>
      <parameter>
        type=double
        name=deviation
        description=Percent deviation from the main line.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Indicator line index. It can be any of <a href="help://constants_lines">Indicators line identifiers enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iForce
      caption=iForce() - Force Index
      type=double
      <content>
      Calculates the Force index and returns its value.
      </content>
      <example>
  double val=iForce(NULL, 0, 13,MODE_SMA,PRICE_CLOSE,0);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period for calculation.
      </parameter>
      <parameter>
        type=int
        name=ma_method
        description=MA method. It can be any of <a href="help://constants_movings">Moving Average method enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iFractals
      caption=iFractals() - Fractals
      type=double
      <content>
      Calculates the Fractals and returns its value.
      </content>
      <example>
  double val=iFractals(NULL, 0, MODE_UPPER, 3);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Indicator line index. It can be any of the <a href="help://constants_lines">Indicators line identifiers enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iGator
      caption=iGator() - Gator Oscillator
      type=double
      <content>
      Gator oscillator calculation. The oscillator displays the difference between the <a href="help://indicators_iAlligator">Alligator</a> red and blue lines (the upper histogram) and that between red and green lines (the lower histogram).
      </content>
      <example>
  double jaw_val=iGator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_UPPER, 1);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=jaw_period
        description=Blue line averaging period (Alligator's Jaw).
      </parameter>
      <parameter>
        type=int
        name=jaw_shift
        description=Blue line shift relative to the chart.
      </parameter>
      <parameter>
        type=int
        name=teeth_period
        description=Red line averaging period (Alligator's Teeth).
      </parameter>
      <parameter>
        type=int
        name=teeth_shift
        description=Red line shift relative to the chart.
      </parameter>
      <parameter>
        type=int
        name=lips_period
        description=Green line averaging period (Alligator's Lips).
      </parameter>
      <parameter>
        type=int
        name=lips_shift
        description=Green line shift relative to the chart.
      </parameter>
      <parameter>
        type=int
        name=ma_method
        description=MA method. It can be any of <a href="help://constants_movings">Moving Average method enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Indicator line index. It can be any of <a href="help://constants_lines">Indicators line identifiers enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iIchimoku
      caption=iIchimoku() - Ichimoku Kinko Hyo
      type=double
      <content>
      Calculates the Ichimoku Kinko Hyo and returns its value.
      </content>
      keywords=;MODE_TENKANSEN;MODE_KIJUNSEN;MODE_SENKOUSPANA;MODE_SENKOUSPANB;MODE_CHINKOUSPAN;
      <example>
  double tenkan_sen=iIchimoku(NULL, 0, 9, 26, 52, MODE_TENKANSEN, 1);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=tenkan_sen
        description=Tenkan Sen averaging period.
      </parameter>
      <parameter>
        type=int
        name=kijun_sen
        description=Kijun Sen averaging period.
      </parameter>
      <parameter>
        type=int
        name=senkou_span_b
        description=Senkou SpanB averaging period.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Source of data. It can be one of the <a href="help://constants_ichimoku">Ichimoku Kinko Hyo mode enumeration</a>.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iBWMFI
      caption=iBWMFI() - Market Facilitation Index (Bill Williams)
      type=double
      <content>
      Calculates the Bill Williams Market Facilitation index and returns its value.
      </content>
      <example>
  double val=iBWMFI(NULL, 0, 0);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iMomentum
      caption=iMomentum() - Momentum
      type=double
      <content>
      Calculates the Momentum indicator and returns its value.
      </content>
      example=if(iMomentum(NULL,0,12,PRICE_CLOSE,0)&gt;iMomentum(NULL,0,20,PRICE_CLOSE,0)) return(0);
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator.NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Period (amount of bars) for calculation of price changes.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iMomentumOnArray
      caption=iMomentumOnArray() - Momentum on buffer
      type=double
      <content>
        Calculation of the Momentum indicator on data stored in a numeric array.
        Unlike iMomentum(...), the iMomentumOnArray function does not take data by symbol name,
        timeframe, the applied price. The price data must be previously prepared.
        The indicator is calculated from left to right. To access to the array elements as to a series array 
        (i.e., from right to left), one has to use the <a href="help://array_ArraySetAsSeries">ArraySetAsSeries</a> function.
      </content>
      example=if(iMomentumOnArray(mybuffer,100,12,0)&gt;iMomentumOnArray(mubuffer,100,20,0)) return(0);
      <parameter>
        type=double
        name=<nobr>array[]</nobr>
        description=Array with data.
      </parameter>
      <parameter>
        type=int
        name=total
        description=The number of items to be counted.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Period (amount of bars) for calculation of price changes.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iMFI
      caption=iMFI() - Money Flow Index
      type=double
      <content>
      Calculates the Money flow index and returns its value.
      </content>
      example=if(iMFI(NULL,0,14,0)&gt;iMFI(NULL,0,14,1)) return(0);
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Period (amount of bars) for calculation of the indicator.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iMA
      caption=iMA() - Moving Average
      type=double
      <content>
      Calculates the Moving average indicator and returns its value.
      </content>
      example=AlligatorJawsBuffer[i]=iMA(NULL,0,13,8,MODE_SMMA,PRICE_MEDIAN,i);
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period for calculation.
      </parameter>
      <parameter>
        type=int
        name=ma_shift
        description=MA shift. Indicators line offset relate to the chart by timeframe.
      </parameter>
      <parameter>
        type=int
        name=ma_method
        description=MA method. It can be any of the <a href="help://constants_movings">Moving Average method enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iMAOnArray
      caption=iMAOnArray() - Moving Average on buffer
      type=double
      <content>
        Calculation of the Moving Average on data stored in a numeric array.
        Unlike iMA(...), the iMAOnArray function does not take data by symbol name,
        timeframe, the applied price. The price data must be previously prepared.
        The indicator is calculated from left to right. To access to the array elements as to a series array 
        (i.e., from right to left), one has to use the <a href="help://array_ArraySetAsSeries">ArraySetAsSeries</a> function.
      </content>
      <example>
   double macurrent=iMAOnArray(ExtBuffer,0,5,0,MODE_LWMA,0);
   double macurrentslow=iMAOnArray(ExtBuffer,0,10,0,MODE_LWMA,0);
   double maprev=iMAOnArray(ExtBuffer,0,5,0,MODE_LWMA,1);
   double maprevslow=iMAOnArray(ExtBuffer,0,10,0,MODE_LWMA,1);
   //----
   if(maprev&lt;maprevslow &amp;&amp; macurrent&gt;=macurrentslow)
     Alert(&quot;crossing up&quot;);
      </example>
      <parameter>
        type=double
        name=<nobr>array[]</nobr>
        description=Array with data.
      </parameter>
      <parameter>
        type=int
        name=total
        description=The number of items to be counted. 0 means whole array.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Averaging period for calculation.
      </parameter>
      <parameter>
        type=int
        name=ma_shift
        description=MA shift
      </parameter>
      <parameter>
        type=int
        name=ma_method
        description=MA method. It can be any of the <a href="help://constants_movings">Moving Average method enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iOsMA
      caption=iOsMA() - Moving Average of Oscillator
      type=double
      <content>
      Calculates the Moving Average of Oscillator and returns its value. Sometimes called MACD Histogram in some systems.
      </content>
      example=if(iOsMA(NULL,0,12,26,9,PRICE_OPEN,1)&gt;iOsMA(NULL,0,12,26,9,PRICE_OPEN,0)) return(0);
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=fast_ema_period
        description=Number of periods for fast moving average calculation.
      </parameter>
      <parameter>
        type=int
        name=slow_ema_period
        description=Number of periods for slow moving average calculation.
      </parameter>
      <parameter>
        type=int
        name=signal_period
        description=Number of periods for signal moving average calculation.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iMACD
      caption=iMACD() - Moving Averages Convergence/Divergence
      type=double
      <content>
      Calculates the Moving averages convergence/divergence and returns its value. In the systems where OsMA is called MACD Histogram, this indicator is displayed as two lines.
      In the Client Terminal, the Moving Average Convergence/Divergence is drawn as a histogram.
      </content>
      example=if(iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)&gt;iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0)) return(0);
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=fast_ema_period
        description=Number of periods for fast moving average calculation.
      </parameter>
      <parameter>
        type=int
        name=slow_ema_period
        description=Number of periods for slow moving average calculation.
      </parameter>
      <parameter>
        type=int
        name=signal_period
        description=Number of periods for signal moving average calculation.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Indicator line index. It can be any of the <a href="help://constants_lines">Indicators line identifiers enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iOBV
      caption=iOBV() - On Balance Volume
      type=double
      <content>
      Calculates the On Balance Volume indicator and returns its value.
      </content>
      <example>
  double val=iOBV(NULL, 0, PRICE_CLOSE, 1);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iSAR
      caption=iSAR() - Parabolic SAR
      type=double
      <content>
      Calculates the Parabolic Stop and Reverse system and returns its value.
      </content>
      example=if(iSAR(NULL,0,0.02,0.2,0)&gt;Close[0]) return(0);
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=double
        name=step
        description=Increment, usually 0.02.
      </parameter>
      <parameter>
        type=double
        name=maximum
        description=Maximum value, usually 0.2.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iRSI
      caption=iRSI() - Relative Strength Index
      type=double
      <content>
      Calculates the Relative strength index and returns its value.
      </content>
      example=if(iRSI(NULL,0,14,PRICE_CLOSE,0)&gt;iRSI(NULL,0,14,PRICE_CLOSE,1)) return(0);
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Number of periods for calculation.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iRSIOnArray
      caption=iRSIOnArray() - Relative Strength Index on buffer
      type=double
      <content>
        Calculation of the Relative Strength Index on data stored in a numeric array.
        Unlike iRSI(...), the iRSIOnArray function does not take data by symbol name,
        timeframe, the applied price. The price data must be previously prepared.
        The indicator is calculated from left to right. To access to the array elements as to a series array 
        (i.e., from right to left), one has to use the <a href="help://array_ArraySetAsSeries">ArraySetAsSeries</a> function.
      </content>
      example=if(iRSIOnArray(ExtBuffer,1000,14,0)&gt;iRSI(NULL,0,14,PRICE_CLOSE,1)) return(0);
      <parameter>
        type=double
        name=<nobr>array[]</nobr>
        description=Array with data.
      </parameter>
      <parameter>
        type=int
        name=total
        description=The number of items to be counted.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Number of periods for calculation.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iRVI
      caption=iRVI() - Relative Vigor Index
      type=double
      <content>
      Calculates the Relative Vigor index and returns its value.
      </content>
      <example>
  double val=iRVI(NULL, 0, 10,MODE_MAIN,0);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Number of periods for calculation.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Indicator line index. It can be any of <a href="help://constants_lines">Indicators line identifiers enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iStdDev
      caption=iStdDev() - Standard Deviation
      type=double
      <content>
      Calculates the Standard Deviation indicator and returns its value.
      </content>
      example=double val=iStdDev(NULL,0,10,0,MODE_EMA,PRICE_CLOSE,0);
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=ma_period
        description=MA period.
      </parameter>
      <parameter>
        type=int
        name=ma_shift
        description=MA shift.
      </parameter>
      <parameter>
        type=int
        name=ma_method
        description=MA method. It can be any of <a href="help://constants_movings">Moving Average method enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=applied_price
        description=Applied price. It can be any of <a href="help://constants_prices">Applied price enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iStdDevOnArray
      caption=iStdDevOnArray() - Standard Deviation on buffer
      type=double
      <content>
        Calculation of the Standard Deviation indicator on data stored in a numeric array.
        Unlike iStdDev(...), the iStdDevOnArray function does not take data by symbol name,
        timeframe, the applied price. The price data must be previously prepared.
        The indicator is calculated from left to right. To access to the array elements as to a series array 
        (i.e., from right to left), one has to use the <a href="help://array_ArraySetAsSeries">ArraySetAsSeries</a> function.
      </content>
      example=double val=iStdDevOnArray(ExtBuffer,100,10,0,MODE_EMA,0);
      <parameter>
        type=double
        name=<nobr>array[]</nobr>
        description=Array with data.
      </parameter>
      <parameter>
        type=int
        name=total
        description=The number of items to be counted.
      </parameter>
      <parameter>
        type=int
        name=ma_period
        description=MA period.
      </parameter>
      <parameter>
        type=int
        name=ma_shift
        description=MA shift.
      </parameter>
      <parameter>
        type=int
        name=ma_method
        description=MA method. It can be any of <a href="help://constants_movings">Moving Average method enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iStochastic
      caption=iStochastic() - Stochastic Oscillator
      type=double
      <content>
      Calculates the Stochastic oscillator and returns its value.
      </content>
      <example>
  if(iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0)&gt;iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,0))
    return(0);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=%Kperiod
        description=%K line period.
      </parameter>
      <parameter>
        type=int
        name=%Dperiod
        description=%D line period.
      </parameter>
      <parameter>
        type=int
        name=slowing
        description=Slowing value.
      </parameter>
      <parameter>
        type=int
        name=method
        description=MA method. It can be any of<a href="help://constants_movings">Moving Average method enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=price_field
        description=Price field parameter. Can be one of this values: 0 - Low/High or 1 - Close/Close.
      </parameter>
      <parameter>
        type=int
        name=mode
        description=Indicator line index. It can be any of the <a href="help://constants_lines">Indicators line identifiers enumeration</a> value.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=indicators_iWPR
      caption=iWPR() - William's Percent Range
      type=double
      <content>
      Calculates the Larry William's percent range indicator and returns its value.
      </content>
      example=if(iWPR(NULL,0,14,0)&gt;iWPR(NULL,0,14,1)) return(0);
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=period
        description=Number of periods for calculation.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>
  </group>

  <group>
    tag=series
    caption=Timeseries access
    <content>
    A group of functions intended for access to price data of any available symbol/period.<br/><br/>
    If data (symbol name and/or timeframe differ from the current ones) are requested from another chart, the situation is possible 
    that the corresponding chart was not opened in the client terminal and the necessary data must be requested from the server. In this case, 
    <a href="help://constants_errors">error</a> ERR_HISTORY_WILL_UPDATED (4066 - the requested history data are under updating) will be placed 
    in the <a href="help://runtime_errors">last_error</a> variable, and one will has to re-request (see example of <a href="help://array_ArrayCopySeries">ArrayCopySeries()</a>).<br/><br/>
    At the testing, price data of the same symbol but of another timeframe are modelled exactly, with the exception of volumes. Volumes of another timeframe are not modelled.
    Price data of other symbols are not modelled, either. In all cases, the amount of <a href="help://series_iBars">bars</a> in time series is modelled exactly.
    </content>

    <function>
      tag=series_iBars
      caption=iBars()
      type=int
      <content>
      Returns the number of bars on the specified chart.<br/>
      For the current chart, the information about the amount of bars is in the predefined variable named <a href="help://predefined_variables_Bars">Bars</a>.
      </content>
      <example>
  Print(&quot;Bar count on the 'EUROUSD' symbol with PERIOD_H1 is&quot;,iBars(&quot;EUROUSD&quot;,PERIOD_H1));
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
    </function>

    <function>
      tag=series_iBarShift
      caption=iBarShift()
      type=int
      <content>
      Search for bar by open time. The function returns bar shift with the open time specified.
      If the bar having the specified open time is missing, the function will return -1 or the nearest bar shift depending on the <i>exact</i>.<br/>
      </content>
      <example>
  datetime some_time=D'2004.03.21 12:00';
  int      shift=iBarShift(&quot;EUROUSD&quot;,PERIOD_M1,some_time);
  Print(&quot;shift of bar with open time &quot;,TimeToStr(some_time),&quot; is &quot;,shift);
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=datetime
        name=time
        description=value to find (bar's open time).
      </parameter>
      <parameter>
        type=bool
        name=exact
        def_value=false
        description=Return mode when bar not found. false - iBarShift returns nearest. true - iBarShift returns -1.
      </parameter>
    </function>

    <function>
      tag=series_iClose
      caption=iClose()
      type=double
      <content>
      Returns <b>Close</b> value for the bar of indicated <i>symbol</i> with <i>timeframe</i> and <i>shift</i>.
      If local history is empty (not loaded), function returns 0.<br/>
      For the current chart, the information about close prices is in the predefined array named <a href="help://predefined_variables_Close">Close[]</a>.
      </content>
      <example>
  Print(&quot;Current bar for USDCHF H1: &quot;,iTime(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iOpen(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iHigh(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iLow(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iClose(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;, iVolume(&quot;USDCHF&quot;,PERIOD_H1,i));
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=series_iHigh
      caption=iHigh()
      type=double
      <content>
      Returns <b>High</b> value for the bar of indicated <i>symbol</i> with <i>timeframe</i> and <i>shift</i>.
      If local history is empty (not loaded), function returns 0.<br/>
      For the current chart, the information about high prices is in the predefined array named <a href="help://predefined_variables_High">High[]</a>.
      </content>
      <example>
  Print(&quot;Current bar for USDCHF H1: &quot;,iTime(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iOpen(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iHigh(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iLow(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iClose(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;, iVolume(&quot;USDCHF&quot;,PERIOD_H1,i));
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol on that data need to calculate indicator. NULL means current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=series_iHighest
      caption=iHighest()
      type=int
      <content>
      Returns the shift of the maximum value over a specific number of periods depending on type.
      </content>
      <example>
  double val;
  // calculating the highest value on the 20 consequtive bars in the range
  // from the 4th to the 23rd index inclusive on the current chart
  val=High[iHighest(NULL,0,MODE_HIGH,20,4)];
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=type
        description=Series array identifier. It can be any of the <a href="help://constants_series">Series array identifier enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=count
        def_value=WHOLE_ARRAY
        description=Number of periods (in direction from the start bar to the back one) on which the calculation is carried out.
      </parameter>
      <parameter>
        type=int
        name=start
        def_value=0
        description=Shift showing the bar, relative to the current bar, that the data should be taken from.
      </parameter>
    </function>

    <function>
      tag=series_iLow
      caption=iLow()
      type=double
      <content>
      Returns <b>Low</b> value for the bar of indicated <i>symbol</i> with <i>timeframe</i> and <i>shift</i>.
      If local history is empty (not loaded), function returns 0.<br/>
      For the current chart, the information about low prices is in the predefined array named <a href="help://predefined_variables_Low">Low[]</a>.
      </content>
      <example>
  Print(&quot;Current bar for USDCHF H1: &quot;,iTime(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iOpen(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iHigh(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iLow(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iClose(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;, iVolume(&quot;USDCHF&quot;,PERIOD_H1,i));
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=series_iLowest
      caption=iLowest()
      type=int
      <content>
      Returns the shift of the least value over a specific number of periods depending on type.
      </content>
      <example>
// calculating the lowest value on the 10 consequtive bars in the range
// from the 10th to the 19th index inclusive on the current chart
double val=Low[iLowest(NULL,0,MODE_LOW,10,10)];
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=type
        description=Series array identifier. It can be any of <a href="help://constants_series">Series array identifier enumeration</a> values.
      </parameter>
      <parameter>
        type=int
        name=count
        def_value=WHOLE_ARRAY
        description=Number of periods (in direction from the start bar to the back one) on which the calculation is carried out.
      </parameter>
      <parameter>
        type=int
        name=start
        def_value=0
        description=Shift showing the bar, relative to the current bar, that the data should be taken from.
      </parameter>
    </function>

    <function>
      tag=series_iOpen
      caption=iOpen()
      type=double
      <content>
      Returns <b>Open</b> value for the bar of indicated <i>symbol</i> with <i>timeframe</i> and <i>shift</i>.
      If local history is empty (not loaded), function returns 0.<br/>
      For the current chart, the information about open prices is in the predefined array named <a href="help://predefined_variables_Open">Open[]</a>.
      </content>
      <example>
  Print(&quot;Current bar for USDCHF H1: &quot;,iTime(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iOpen(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iHigh(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iLow(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iClose(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;, iVolume(&quot;USDCHF&quot;,PERIOD_H1,i));
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=series_iTime
      caption=iTime()
      type=datetime
      <content>
      Returns <b>Time</b> value for the bar of indicated <i>symbol</i> with <i>timeframe</i> and <i>shift</i>.
      If local history is empty (not loaded), function returns 0.<br/>
      For the current chart, the information about bars open times is in the predefined array named <a href="help://predefined_variables_Time">Time[]</a>.
      </content>
      <example>
  Print(&quot;Current bar for USDCHF H1: &quot;,iTime(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iOpen(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iHigh(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iLow(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iClose(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;, iVolume(&quot;USDCHF&quot;,PERIOD_H1,i));
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>

    <function>
      tag=series_iVolume
      caption=iVolume()
      type=double
      <content>
      Returns <b>Tick Volume</b> value for the bar of indicated <i>symbol</i> with <i>timeframe</i> and <i>shift</i>.
      If local history is empty (not loaded), function returns 0.<br/>
      For the current chart, the information about bars tick volumes is in the predefined array named <a href="help://predefined_variables_Volume">Volume[]</a>.
      </content>
      <example>
  Print(&quot;Current bar for USDCHF H1: &quot;,iTime(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iOpen(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iHigh(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,  iLow(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;,
                                      iClose(&quot;USDCHF&quot;,PERIOD_H1,i),&quot;, &quot;, iVolume(&quot;USDCHF&quot;,PERIOD_H1,i));
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
      <parameter>
        type=int
        name=shift
        description=Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
      </parameter>
    </function>
  </group>


  <group>
    tag=trading
    caption=Trading functions
    <content>
    A group of functions intended for trading management.<br/><br/>
    Trading functions of <a href="help://trading_OrderSend">OrderSend()</a>, <a href="help://trading_OrderClose">OrderClose</a>,
    <a href="help://trading_OrderCloseBy">OrderCloseBy</a>, <a href="help://trading_OrderDelete">OrderDelete</a>, and <a href="help://trading_OrderModify">OrderModify</a>
    cannot be called from custom indicators.<br/><br/>
    Trading functions can be used in experts and scripts. Trading functions can be called only if the "Allow live trading" property of this particular expert is checked.<br/><br/>
    To trade from experts and scripts, only one thread was provided that was launched in the program trade context (context of 
    automated trading from experts and scripts). This is why, if this context is occupied with an expert trading operation, 
    another expert or script cannot call trading functions at that moment due to <a href="help://constants_errors">error</a> 146 (ERR_TRADE_CONTEXT_BUSY). 
    To check whether it is possible to trade or not, one has to use the <a href="help://check_IsTradeAllowed">IsTradeAllowed()</a> function. 
    To make a clear sharing of access to the trading context, one can use a semaphore on the basis of a global variable  
    the value of which must be changed using the <a href="help://globals_GlobalVariableSetOnCondition">GlobalVariableSetOnCondition()</a> function.
    </content>

    <text>
      tag=trading_errors
      caption=Execution errors
      <keywords>
      ;ERR_NO_ERROR;ERR_NO_RESULT;ERR_COMMON_ERROR;ERR_INVALID_TRADE_PARAMETERS;ERR_SERVER_BUSY;
      ;ERR_OLD_VERSION;ERR_NO_CONNECTION;ERR_TOO_FREQUENT_REQUESTS;
      ;ERR_ACCOUNT_DISABLED;ERR_INVALID_ACCOUNT;ERR_TRADE_TIMEOUT;ERR_INVALID_PRICE;ERR_INVALID_STOPS;
      ;ERR_INVALID_TRADE_VOLUME;ERR_MARKET_CLOSED;ERR_TRADE_DISABLED;ERR_NOT_ENOUGH_MONEY;ERR_PRICE_CHANGED;
      ;ERR_OFF_QUOTES;ERR_REQUOTE;ERR_ORDER_LOCKED;ERR_LONG_POSITIONS_ONLY_ALLOWED;
      ;ERR_TOO_MANY_REQUESTS;ERR_TRADE_MODIFY_DENIED;ERR_TRADE_CONTEXT_BUSY;ERR_TRADE_EXPIRATION_DENIED;
      </keywords>
      <content>
        <p>Any trading operation (functions of <a href="help://trading_OrderSend">OrderSend()</a>, <a href="help://trading_OrderClose">OrderClose</a>,
        <a href="help://trading_OrderCloseBy">OrderCloseBy</a>, <a href="help://trading_OrderDelete">OrderDelete</a> or <a href="help://trading_OrderModify">OrderModify</a>)
        can fail, for a number of reasons, and return either negative <a href="help://trading_OrderSend">ticket number</a> or FALSE.
        One can find out about the reason for fail by calling of the <a href="help://check_GetLastError">GetLastError()</a> function. 
        Every error must be processed in a special way. The most common recommendations are given below.</p>

        <p>Error codes returned from trade server.</p>
        <table cellspacing="0" cellpadding="4" border="0" class="docenums" width="95%">
        <tr><th width="15%">Constant</th><th width="10%">Value</th><th width="75%">Description</th></tr>
        <tr><td>ERR_NO_ERROR</td><td>0</td><td>Trade operation succeeded.</td></tr>
        <tr><td>ERR_NO_RESULT</td><td>1</td><td><a href="help://trading_OrderModify">OrderModify</a> attempts to replace the values already set with the same values.
                                                 One or more values must be changed, then modification attempt can be repeated.</td></tr>
        <tr><td>ERR_COMMON_ERROR</td><td>2</td><td>Common error. All attempts to trade must be stopped until reasons are clarified. Restart of operation system and client terminal will possibly be needed.</td></tr>
        <tr><td>ERR_INVALID_TRADE_PARAMETERS</td><td>3</td><td>Invalid parameters were passed to the trading function, for example, wrong symbol, unknown 
                                                 <a href="help://constants_trading">trade operation</a>, negative slippage, non-existing ticket number, etc.
                                                 The program logic must be changed.</td></tr>
        <tr><td>ERR_SERVER_BUSY</td><td>4</td><td>Trade server is busy. The attempt can be repeated after a rather long period of time (over several minutes).</td></tr>
        <tr><td>ERR_OLD_VERSION</td><td>5</td><td>Old version of the client terminal. The latest version of the client terminal must be installed.</td></tr>
        <tr><td>ERR_NO_CONNECTION</td><td>6</td><td>No connection to the trade server. It is necessary to make sure that connection has not been broken (for example, using
                                                 the <a href="help://check_IsConnected">IsConnected</a> function) and repeat the attempt  after a certain period of time (over 5 seconds).</td></tr>
        <tr><td>ERR_TOO_FREQUENT_REQUESTS</td><td>8</td><td>Requests are too frequent. The frequency of requesting must be reduced, the program logic must be changed.</td></tr>
        <tr><td>ERR_ACCOUNT_DISABLED</td><td>64</td><td>The account was disabled. All attempts to trade must be stopped.</td></tr>
        <tr><td>ERR_INVALID_ACCOUNT</td><td>65</td><td>The account number is invalid. All attempts to trade must be stopped.</td></tr>
        <tr><td>ERR_TRADE_TIMEOUT</td><td>128</td><td>Timeout for the trade has been reached. Before retry (at least, in 1-minute time),
                                                 it is necessary to make sure that trading operation has not really succeeded (a new position has not been opened, or the existing order has not 
                                                 been modified or deleted, or the existing position has not been closed)</td></tr>
        <tr><td>ERR_INVALID_PRICE</td><td>129</td><td>Invalid bid or ask price, perhaps, unnormalized price. After 5-second (or more) delay, it is necessary to refresh
                                                 <a href="help://predefined_variables">data</a> using the <a href="help://windows_RefreshRates">RefreshRates</a> function and make a retry.
                                                 If the error does not disappear, all attempts to trade must be stopped, the program logic must be changed.</td></tr>
        <tr><td>ERR_INVALID_STOPS</td><td>130</td><td>Stops are too close, or prices are ill-calculated or unnormalized (or in the open price of a pending
                                                 order). The attempt can be repeated only if the error occurred due to the price obsolescense. After 5-second (or more) delay, it is necessary to refresh
                                                 <a href="help://predefined_variables">data</a> using the <a href="help://windows_RefreshRates">RefreshRates</a> function and make a retry.
                                                 If the error does not disappear, all attempts to trade must be stopped, the program logic must be changed.</td></tr>
        <tr><td>ERR_INVALID_TRADE_VOLUME</td><td>131</td><td>Invalid trade volume, error in the volume granularity. All attempts to trade must be stopped, and the program logic must be changed.</td></tr>
        <tr><td>ERR_MARKET_CLOSED</td><td>132</td><td>Market is closed. The attempt can be repeated after a rather long period of time (over several minutes).</td></tr>
        <tr><td>ERR_TRADE_DISABLED</td><td>133</td><td>Trade is disabled. All attempts to trade must be stopped.</td></tr>
        <tr><td>ERR_NOT_ENOUGH_MONEY</td><td>134</td><td>Not enough money to make an operation. The trade with the same parameters must not be repeated. After 5-second (or more) delay, the attempt can be repeated 
                                                 with a smaller volume, but it is necessary to make sure that there is enough money to complete the operation.</td></tr>
        <tr><td>ERR_PRICE_CHANGED</td><td>135</td><td>The price has changed. The <a href="help://predefined_variables">data</a> can be refreshed without any delay using the
                                                 <a href="help://windows_RefreshRates">RefreshRates</a> function and make a retry.</td></tr>
        <tr><td>ERR_OFF_QUOTES</td><td>136</td><td>No quotes. The broker has not supplied with prices or refused, for any reason (for example, no prices at the session start, unconfirmed prices, fast market).
                                                 After 5-second (or more) delay, it is necessary to refresh <a href="help://predefined_variables">data</a> using the <a href="help://windows_RefreshRates">RefreshRates</a> function and make a retry.</td></tr>
        <tr><td>ERR_REQUOTE</td><td>138</td><td>The requested price has become out of date or bid and ask prices have been mixed up. 
                                                 The <a href="help://predefined_variables">data</a> can be refreshed without any delay using the <a href="help://windows_RefreshRates">RefreshRates</a> function and make a retry.
                                                 If the error does not disappear, all attempts to trade must be stopped, the program logic must be changed.</td></tr>
        <tr><td>ERR_ORDER_LOCKED</td><td>139</td><td>The order has been locked and under processing. All attempts to make trading operations must be stopped, and the program logic must be changed.</td></tr>
        <tr><td>ERR_LONG_POSITIONS_ONLY_ALLOWED</td><td>140</td><td>Only buying operation is allowed. The SELL operation must not be repeated.</td></tr>
        <tr><td>ERR_TOO_MANY_REQUESTS</td><td>141</td><td>Too many requests. The frequency of requesting must be reduced, the program logic must be changed.</td></tr>
        <tr><td>&nbsp;</td><td>142</td><td>The order has been enqueued. It is not an error but an interaction code between the client terminal and the trade server. This code can be got rarely, when the disconnection and the reconnection happen during the execution of a trade operation. This code should be processed in the same way as error 128.</td></tr>
        <tr><td>&nbsp;</td><td>143</td><td>The order was accepted by the dealer for execution. It is an interaction code between the client terminal and the trade server. It can appear for the same reason as code 142.  This code should be processed in the same way as error 128.</td></tr>
        <tr><td>&nbsp;</td><td>144</td><td>The order was discarded by the client during manual confirmation. It is an interaction code between the client terminal and the trade server.</td></tr>
        <tr><td>ERR_TRADE_MODIFY_DENIED</td><td>145</td><td>Modifying has been denied since the order is too close to market and locked for possible soon execution.
                                                 The <a href="help://predefined_variables">data</a> can be refreshed after more than 15 seconds using the <a href="help://windows_RefreshRates">RefreshRates</a> function, and 
                                                 a retry can be made.</td></tr>
        <tr><td>ERR_TRADE_CONTEXT_BUSY</td><td>146</td><td>The trade thread is busy. Retry only after the <a href="help://check_IsTradeContextBusy">IsTradeContextBusy</a> function has returned FALSE.</td></tr>
        <tr><td>ERR_TRADE_EXPIRATION_DENIED</td><td>147</td><td>The use of pending order expiration date has been denied by the broker. The operation can only be repeated if the expiration parameter has been zeroized.</td></tr>
        <tr><td>ERR_TRADE_TOO_MANY_ORDERS</td><td>148</td><td>The amount of open and pending orders has reached the limit set by the broker. New open positions and pending orders can be placed only after the existing positions or orders have been closed or deleted.</td></tr>
        <tr><td>ERR_TRADE_HEDGE_PROHIBITED</td><td>149</td><td>An attempt to open a position opposite to the existing one when hedging is disabled. First the existing opposite position should be closed, all attempts of such trade operations must be stopped, or the program logic must be changed.</td></tr>
        <tr><td>ERR_TRADE_PROHIBITED_BY_FIFO</td><td>150</td><td>An attempt to close a symbol position contravening the FIFO rule. First earlier existing position(s) should be closed, all attempts of such trade operations must be stopped, or the program logic must be changed.</td></tr>
        </table><br/>
      </content>
    </text>

    <function>
      tag=trading_OrderClose
      caption=OrderClose()
      type=bool
      <content>
Closes opened order.
If the function succeeds, the return value is true.
If the function fails, the return value is false.
To get the detailed error information, call <a href="help://check_GetLastError">GetLastError()</a>.
      </content>
      <example>
  if(iRSI(NULL,0,14,PRICE_CLOSE,0)&gt;75)
    {
     OrderClose(order_id,1,Ask,3,Red);
     return(0);
    }
      </example>
      <parameter>
        type=int
        name=ticket
        description=Unique number of the order ticket.
      </parameter>
      <parameter>
        type=double
        name=lots
        description=Number of lots.
      </parameter>
      <parameter>
        type=double
        name=price
        description=Preferred closing price.
      </parameter>
      <parameter>
        type=int
        name=slippage
        description=Value of the maximum price slippage in points.
      </parameter>
      <parameter>
        type=color
        name=Color
        def_value=CLR_NONE
        <description>
Color of the closing arrow on the chart.
 If the parameter is missing or has CLR_NONE value closing arrow will not be drawn on the chart.
        </description>
      </parameter>
    </function>

    <function>
      tag=trading_OrderCloseBy
      caption=OrderCloseBy()
      type=bool
      <content>
Closes an opened order by another opposite opened order.
If the function succeeds, the return value is true.
If the function fails, the return value is false.
To get the detailed error information, call <a href="help://check_GetLastError">GetLastError()</a>.
      </content>
      <example>
  if(iRSI(NULL,0,14,PRICE_CLOSE,0)&gt;75)
    {
     OrderCloseBy(order_id,opposite_id);
     return(0);
    }
      </example>
      <parameter>
        type=int
        name=ticket
        description=Unique number of the order ticket.
      </parameter>
      <parameter>
        type=int
        name=opposite
        description=Unique number of the opposite order ticket.
      </parameter>
      <parameter>
        type=color
        name=Color
        def_value=CLR_NONE
        <description>
Color of the closing arrow on the chart.
 If the parameter is missing or has CLR_NONE value closing arrow will not be drawn on the chart.
        </description>
      </parameter>
    </function>

    <function>
      tag=trading_OrderClosePrice
      caption=OrderClosePrice()
      type=double
      <content>
Returns close price for the currently selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(ticket,SELECT_BY_POS)==true)
    Print(&quot;Close price for the order &quot;,ticket,&quot; = &quot;,OrderClosePrice());
  else
    Print(&quot;OrderSelect failed error code is&quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderCloseTime
      caption=OrderCloseTime()
      type=datetime
      <content>
Returns close time for the currently selected order.
If order close time is not 0 then the order selected and has been closed and retrieved from the account history. Open and pending orders close time is equal to 0.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(10,SELECT_BY_POS,MODE_HISTORY)==true)
    {
     datetime ctm=OrderOpenTime();
     if(ctm&gt;0) Print(&quot;Open time for the order 10 &quot;, ctm);
     ctm=OrderCloseTime();
     if(ctm&gt;0) Print(&quot;Close time for the order 10 &quot;, ctm);
    }
  else
    Print(&quot;OrderSelect failed error code is&quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderComment
      caption=OrderComment()
      type=string
      <content>
Returns comment for the selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  string comment;
  if(OrderSelect(10,SELECT_BY_TICKET)==false)
    {
     Print(&quot;OrderSelect failed error code is&quot;,GetLastError());
     return(0);
    }
  comment = OrderComment();
  // ...
      </example>
    </function>

    <function>
      tag=trading_OrderCommission
      caption=OrderCommission()
      type=double
      <content>
Returns calculated commission for the currently selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(10,SELECT_BY_POS)==true)
    Print(&quot;Commission for the order 10 &quot;,OrderCommission());
  else
    Print(&quot;OrderSelect failed error code is&quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderDelete
      caption=OrderDelete()
      type=bool
      <content>
Deletes previously opened pending order.
If the function succeeds, the return value is true.
If the function fails, the return value is false.
To get the detailed error information, call <a href="help://check_GetLastError">GetLastError()</a>.
      </content>
      <example>
  if(Ask&gt;var1)
    {
     OrderDelete(order_ticket);
     return(0);
    }
      </example>
      <parameter>
        type=int
        name=ticket
        description=Unique number of the order ticket.
      </parameter>
      <parameter>
        type=color
        name=Color
        def_value=CLR_NONE
        <description>
Color of the arrow on the chart.
 If the parameter is missing or has CLR_NONE value arrow will not be drawn on the chart.
        </description>
      </parameter>
    </function>

    <function>
      tag=trading_OrderExpiration
      caption=OrderExpiration()
      type=datetime
      <content>
Returns expiration date for the selected pending order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(10, SELECT_BY_TICKET)==true)
    Print(&quot;Order expiration for the order #10 is &quot;,OrderExpiration());
  else
    Print(&quot;OrderSelect returned error of &quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderLots
      caption=OrderLots()
      type=double
      <content>
Returns amount of lots for the selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(10,SELECT_BY_POS)==true)
    Print(&quot;lots for the order 10 &quot;,OrderLots());
  else
    Print(&quot;OrderSelect returned error of &quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderMagicNumber
      caption=OrderMagicNumber()
      type=int
      <content>
Returns an identifying (magic) number for the currently selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(10,SELECT_BY_POS)==true)
    Print(&quot;Magic number for the order 10 &quot;, OrderMagicNumber());
  else
    Print(&quot;OrderSelect returned error of &quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderModify
      caption=OrderModify()
      type=bool
      <content>
Modification of characteristics for the previously opened position or pending orders.
If the function succeeds, the returned value will be TRUE.
If the function fails, the returned value will be FALSE.
To get the detailed error information, call <a href="help://check_GetLastError">GetLastError()</a> function.<br/>
Notes: Open price and expiration time can be changed only for pending orders.<br/>
If unchanged values are passed as the function parameters, the <a href="help://constants_errors">error</a> 1 (ERR_NO_RESULT) will be generated.<br/>
Pending order expiration time can be disabled in some trade servers. In this case, when a non-zero value is specified 
in the <i>expiration</i> parameter, the <a href="help://constants_errors">error</a> 147 (ERR_TRADE_EXPIRATION_DENIED) will be generated.
      </content>
      <example>
  if(TrailingStop&gt;0)
    {
     OrderSelect(12345,SELECT_BY_TICKET); 
     if(Bid-OrderOpenPrice()&gt;Point*TrailingStop)
       {
        if(OrderStopLoss()&lt;Bid-Point*TrailingStop)
          {
           OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Blue);
           return(0);
          }
       }
    }
      </example>
      <parameter>
        type=int
        name=ticket
        description=Unique number of the order ticket.
      </parameter>
      <parameter>
        type=double
        name=price
        description=New open price of the pending order.
      </parameter>
      <parameter>
        type=double
        name=stoploss
        description=New StopLoss level.
      </parameter>
      <parameter>
        type=double
        name=takeprofit
        description=New TakeProfit level.
      </parameter>
      <parameter>
        type=datetime
        name=expiration
        description=Pending order expiration time.
      </parameter>
      <parameter>
        type=color
        name=arrow_color
        def_value=CLR_NONE
        <description>
Arrow color for StopLoss/TakeProfit modifications in the chart. If the parameter is missing or has CLR_NONE value, the arrows will not be shown in the chart.
        </description>
      </parameter>
    </function>

    <function>
      tag=trading_OrderOpenPrice
      caption=OrderOpenPrice()
      type=double
      <content>
Returns open price for the currently selected order.<br/>
Order must be first selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(10, SELECT_BY_POS)==true)
    Print(&quot;open price for the order 10 &quot;,OrderOpenPrice());
  else
    Print(&quot;OrderSelect returned the error of &quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderOpenTime
      caption=OrderOpenTime()
      type=datetime
      <content>
Returns open time for the currently selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(10, SELECT_BY_POS)==true)
    Print(&quot;open time for the order 10 &quot;,OrderOpenTime());
  else
    Print(&quot;OrderSelect returned error of &quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderPrint
      caption=OrderPrint()
      type=void
      <content>
Prints information about the selected order in the log in the following format:<br/>
<a href="help://trading_OrderTicket">ticket number;</a> <a href="help://trading_OrderOpenTime">open time;</a> <a href="help://trading_OrderType">trade operation;</a>
 <a href="help://trading_OrderLots">amount of lots;</a> <a href="help://trading_OrderOpenPrice">open price;</a> <a href="help://trading_OrderStopLoss">Stop Loss;</a>
 <a href="help://trading_OrderTakeProfit">Take Profit;</a> <a href="help://trading_OrderCloseTime">close time;</a> <a href="help://trading_OrderClosePrice">close price;</a>
 <a href="help://trading_OrderCommission">commission;</a> <a href="help://trading_OrderSwap">swap;</a> <a href="help://trading_OrderProfit">profit;</a>
 <a href="help://trading_OrderComment">comment;</a> <a href="help://trading_OrderMagicNumber">magic number;</a> <a href="help://trading_OrderExpiration">pending order expiration date.</a><br/>
Order must be selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(10, SELECT_BY_TICKET)==true)
    OrderPrint();
  else
    Print(&quot;OrderSelect failed error code is&quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderProfit
      caption=OrderProfit()
      type=double
      <content>
Returns the net profit value (without swaps or commissions) for the selected order. For open positions, it is the current unrealized profit. 
For closed orders, it is the fixed profit.<br/>
Returns profit for the currently selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(10, SELECT_BY_POS)==true)
    Print(&quot;Profit for the order 10 &quot;,OrderProfit());
  else
    Print(&quot;OrderSelect returned the error of &quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderSelect
      caption=OrderSelect()
      type=bool
      keywords=;SELECT_BY_POS;SELECT_BY_TICKET;MODE_TRADES;MODE_HISTORY;
      <content>
The function selects an order for further processing. It returns TRUE if the function succeeds.
It returns FALSE if the function fails.
To get the error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.<br/>
The <i>pool</i> parameter is ignored if the order is selected by the ticket number. The ticket number is a unique order identifier.
To find out from what list the order has been selected, its <a href="help://trading_OrderCloseTime">close time</a> must be analyzed. If the order close time 
equals to 0, the order is open or pending and taken from the terminal open positions list. One can distinguish an open position from a pending order
by the <a href="help://trading_OrderType">order type</a>. If the order <a href="help://trading_OrderCloseTime">close time</a> does not equal to 0, the order is
a <a href="help://trading_OrderClose">closed</a> order or a <a href="help://trading_OrderDelete">deleted</a> pending order and was selected from the terminal history. 
They also differ from each other by their <a href="help://trading_OrderType">order types</a>.
      </content>
      <example>
  if(OrderSelect(12470, SELECT_BY_TICKET)==true)
    {
     Print(&quot;order #12470 open price is &quot;, OrderOpenPrice());
     Print(&quot;order #12470 close price is &quot;, OrderClosePrice());
    }
  else
    Print(&quot;OrderSelect returned the error of &quot;,GetLastError());
      </example>
      <parameter>
        type=int
        name=index
        description=Order index or order ticket depending on the second parameter.
      </parameter>
      <parameter>
        type=int
        name=select
        <description>
Selecting flags. It can be any of the following values:<br/>
SELECT_BY_POS - index in the order pool,<br/>
SELECT_BY_TICKET - index is order ticket.
        </description>
      </parameter>
      <parameter>
        type=int
        name=pool
        def_value=MODE_TRADES
        <description>
Optional order pool index. Used when the selected parameter is SELECT_BY_POS. It can be any of the following values:<br/>
MODE_TRADES (default)- order selected from trading pool(opened and pending orders),<br/>
MODE_HISTORY - order selected from history pool (closed and canceled order).
        </description>
      </parameter>
    </function>

    <function>
      tag=trading_OrderSend
      caption=OrderSend()
      type=int
      <content>
The main function used to open a position or place a pending order.<br/>
Returns number of the ticket assigned to the order by the trade server or -1 if it fails.
To get additional error information, one has to call the <a href="help://check_GetLastError">GetLastError()</a> function.<br/>
Notes:<br/>
At opening of a market order (OP_SELL or OP_BUY), only the latest prices of <a href="help://predefined_variables_Bid">Bid</a> (for selling) or 
<a href="help://predefined_variables_Ask">Ask</a> (for buying) can be used as open price. If operation is performed with a security differing from 
the current one, the <a href="help://common_MarketInfo">MarketInfo()</a> function must be used with MODE_BID or MODE_ASK parameter 
for the latest quotes for this security to be obtained. Calculated or unnormalized price cannot be applied.
If there has not been the requested open price in the price thread or it has not been normalized according to the <a href="help://predefined_variables_Digits">amount 
of digits after decimal point</a>, the <a href="help://constants_errors">error</a> 129 (ERR_INVALID_PRICE) will be generated. If the requested
open price is fully out of date, the <a href="help://constants_errors">error</a> 138 (ERR_REQUOTE) will be generated independently on the <i>slippage</i> 
parameter. If the requested price is out of date, but present in the thread, the position will be opened at the current price and only if 
the current price lies within the range of <i>price</i>+-<i>slippage</i>.<br/><br/>
StopLoss and TakeProfit levels cannot be too close to the market. The minimal distance of stop levels in points can be obtained using the 
<a href="help://common_MarketInfo">MarketInfo()</a> function with MODE_STOPLEVEL parameter. In the case of erroneous or unnormalized stop levels, the 
<a href="help://constants_errors">error</a> 130 (ERR_INVALID_STOPS) will be generated.<br/><br/>
At placing of a pending order, the open price cannot be too close to the market. The minimal distance of the pending price from the current market one
in points can be obtained using the <a href="help://common_MarketInfo">MarketInfo()</a> function with the MODE_STOPLEVEL parameter. In case of false open price
of a pending order, the <a href="help://constants_errors">error</a> 130 (ERR_INVALID_STOPS) will be generated.<br/><br/>
Applying of pending order expiration time can be disabled in some trade servers. In this case, when a non-zero value is specified 
in the <i>expiration</i> parameter, the <a href="help://constants_errors">error</a> 147 (ERR_TRADE_EXPIRATION_DENIED) will be generated.<br/><br/>
On some trade servers, the <a href="help://trading_OrdersTotal">total amount</a> of open and pending orders can be limited.
If this limit has been exceeded, no new position will be opened (or no pending order will be placed) and trade server will return <a href="help://constants_errors">error</a>
148 (ERR_TRADE_TOO_MANY_ORDERS).
      </content>
      <example>
  int ticket;
  if(iRSI(NULL,0,14,PRICE_CLOSE,0)&lt;25)
    {
     ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,&quot;My order #2&quot;,16384,0,Green);
     if(ticket&lt;0)
       {
        Print("OrderSend failed with error #",GetLastError());
        return(0);
       }
    }
      </example>
      <parameter>
        type=string
        name=symbol
        description=Symbol for trading.
      </parameter>
      <parameter>
        type=int
        name=cmd
        <description>
Operation type. It can be any of the <a href="help://constants_trading">Trade operation enumeration</a>.
        </description>
      </parameter>
      <parameter>
        type=double
        name=volume
        description=Number of lots.
      </parameter>
      <parameter>
        type=double
        name=price
        description=Preferred price of the trade.
      </parameter>
      <parameter>
        type=int
        name=slippage
        description=Maximum price slippage for buy or sell orders.
      </parameter>
      <parameter>
        type=double
        name=stoploss
        description=Stop loss level.
      </parameter>
      <parameter>
        type=double
        name=takeprofit
        description=Take profit level.
      </parameter>
      <parameter>
        type=string
        name=comment
        def_value=NULL
        description=Order comment text. Last part of the comment may be changed by server.
      </parameter>
      <parameter>
        type=int
        name=magic
        def_value=0
        description=Order magic number. May be used as user defined identifier.
      </parameter>
      <parameter>
        type=datetime
        name=expiration
        def_value=0
        description=Order expiration time (for pending orders only).
      </parameter>
      <parameter>
        type=color
        name=arrow_color
        def_value=CLR_NONE
        <description>
Color of the opening arrow on the chart. If parameter is missing or has CLR_NONE value opening arrow is not drawn on the chart.
       </description>
      </parameter>
    </function>

    <function>
      tag=trading_OrdersHistoryTotal
      caption=OrdersHistoryTotal()
      type=int
      <content>
Returns the number of closed orders in the account history loaded into the terminal. The history list size depends on
the current settings of the &quot;Account history&quot; tab of the terminal.
      </content>
      <example>
  // retrieving info from trade history
  int i,hstTotal=OrdersHistoryTotal();
  for(i=0;i&lt;hstTotal;i++)
    {
     //---- check selection result
     if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false)
       {
        Print(&quot;Access to history failed with error (&quot;,GetLastError(),&quot;)&quot;);
        break;
       }
     // some work with order
    }
      </example>
    </function>

    <function>
      tag=trading_OrderStopLoss
      caption=OrderStopLoss()
      type=double
      <content>
Returns stop loss value for the currently selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(ticket,SELECT_BY_POS)==true)
    Print(&quot;Stop loss value for the order 10 &quot;, OrderStopLoss());
  else
    Print(&quot;OrderSelect failed error code is&quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrdersTotal
      caption=OrdersTotal()
      type=int
      <content>
Returns market and pending orders count.<br/>
      </content>
      <example>
  int handle=FileOpen("OrdersReport.csv",FILE_WRITE|FILE_CSV,"\t");
  if(handle&lt;0) return(0);
  // write header 
  FileWrite(handle,&quot;#&quot;,&quot;open price&quot;,&quot;open time&quot;,&quot;symbol&quot;,&quot;lots&quot;);
  int total=OrdersTotal();
  // write open orders
  for(int pos=0;pos&lt;total;pos++)
    {
     if(OrderSelect(pos,SELECT_BY_POS)==false) continue;
     FileWrite(handle,OrderTicket(),OrderOpenPrice(),OrderOpenTime(),OrderSymbol(),OrderLots());
    }
  FileClose(handle);
      </example>
    </function>

    <function>
      tag=trading_OrderSwap
      caption=OrderSwap()
      type=double
      <content>
Returns swap value for the currently selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(order_id, SELECT_BY_TICKET)==true)
    Print(&quot;Swap for the order #&quot;, order_id, &quot; &quot;,OrderSwap());
  else
    Print(&quot;OrderSelect failed error code is&quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderSymbol
      caption=OrderSymbol()
      type=string
      <content>
Returns the order symbol value for selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(12, SELECT_BY_POS)==true)
    Print(&quot;symbol of order #&quot;, OrderTicket(), &quot; is &quot;, OrderSymbol());
  else
    Print(&quot;OrderSelect failed error code is&quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderTakeProfit
      caption=OrderTakeProfit()
      type=double
      <content>
Returns take profit value for the currently selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(12, SELECT_BY_POS)==true)
    Print(&quot;Order #&quot;,OrderTicket(),&quot; profit: &quot;, OrderTakeProfit());
  else
    Print(&quot;OrderSelect() returns error - &quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderTicket
      caption=OrderTicket()
      type=int
      <content>
Returns ticket number for the currently selected order.<br/>
Note: The order must be previously selected by the <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  if(OrderSelect(12, SELECT_BY_POS)==true)
    order=OrderTicket();
  else
    Print(&quot;OrderSelect failed error code is&quot;,GetLastError());
      </example>
    </function>

    <function>
      tag=trading_OrderType
      caption=OrderType()
      type=int
      <content>
Returns order operation type for the currently selected order. It can be any of the following values:<br/>
OP_BUY - buying position,<br/>
OP_SELL - selling position,<br/>
OP_BUYLIMIT - buy limit pending position,<br/>
OP_BUYSTOP - buy stop pending position,<br/>
OP_SELLLIMIT - sell limit pending position,<br/>
OP_SELLSTOP - sell stop pending position.<br/>
Note: order must be selected by <a href="help://trading_OrderSelect">OrderSelect()</a> function.
      </content>
      <example>
  int order_type;
  if(OrderSelect(12, SELECT_BY_POS)==true)
    {
     order_type=OrderType();
     // ...
    }
  else
    Print(&quot;OrderSelect() returned error - &quot;,GetLastError());
      </example>
    </function>
  </group>


  <group>
    tag=windows
    caption=Window functions
    <content>
    A group of functions intended for working with the current chart window.
    </content>

    <function>
      tag=windows_HideTestIndicators
      caption=HideTestIndicators()
      type=void
      <content>
        The function sets a flag hiding indicators called by the Expert Advisor.
        After the expert has been tested and the appropriate chart opened, the flagged indicators will not be drawn in the testing chart.
        Every indicator called will first be flagged with the current hiding flag.<br/>
      It must be noted that only those indicators can be drawn in the testing chart that are directly called from the expert under test.
      </content>
      <example>
   HideTestIndicators(true);
   MaCurrent=iMA(NULL,0,56,0,MODE_EMA,PRICE_CLOSE,0);
   MaPrevious=iMA(NULL,0,56,0,MODE_EMA,PRICE_CLOSE,1);
   HideTestIndicators(false);
      </example>
      <parameter>
        type=bool
        name=hide
        description=TRUE, if there is a need to hide indicators, or else FALSE.
      </parameter>
    </function>
   
    <function>
      tag=windows_Period
      caption=Period()
      type=int
      <content>
      Returns the amount of minutes determining the used <a href="help://constants_timeframes">period</a> (chart timeframe).
      </content>
      <example>
  Print(&quot;Period is &quot;, Period());
      </example>
    </function>

    <function>
      tag=windows_RefreshRates
      caption=RefreshRates()
      type=bool
      <content>
 Refreshing of data in <a href="help://predefined_variables">pre-defined variables and series arrays</a>.
 This function is used when expert advisor has been calculating for a long time and needs data refreshing.
 Returns TRUE if data are refreshed, otherwise returns FALSE. The only reason for data cannot be refreshed is that 
 they are the current data of the client terminal.<br/><br/>
 Experts and scripts operate with their own copy of history data. Data of the current symbol are copied at the first launch of the expert or script.
 At each subsequent launch of the expert (remember that script is <a href="help://runtime_start">executed</a> only once and does not depend on 
 incoming ticks), the initial copy will be updated. One or more new ticks can income while the expert or script is operating, 
 and data can become out of date.
      </content>
      <example>
   int ticket;
   while(true)
     {
      ticket=OrderSend(Symbol(),OP_BUY,1.0,Ask,3,0,0,&quot;expert comment&quot;,255,0,CLR_NONE);
      if(ticket&lt;=0)
        {
         int error=GetLastError();
         //---- not enough money
         if(error==134) break;
         //---- 10 seconds wait
         Sleep(10000);
         //---- refresh price data
         RefreshRates();
         break;
        }
      else
        {
         OrderSelect(ticket,SELECT_BY_TICKET);
         OrderPrint();
         break;
        }
     }
      </example>
    </function>

    <function>
      tag=windows_Symbol
      caption=Symbol()
      type=string
      <content>
      Returns a text string with the name of the current financial instrument.
      </content>
      <example>
   int total=OrdersTotal();
   for(int pos=0;pos&lt;total;pos++)
     {
      // check selection result because the order may be closed or deleted at this time!
      if(OrderSelect(pos, SELECT_BY_POS)==false) continue;
      if(OrderType()&gt;OP_SELL || OrderSymbol()!=Symbol()) continue;
      // performs some processing...
     }
      </example>
    </function>

    <function>
      tag=windows_WindowBarsPerChart
      caption=WindowBarsPerChart()
      type=int
      <content>
      Function returns the amount of bars visible on the chart.
      </content>
      <example>
// work with visible bars.
int bars_count=WindowBarsPerChart();
int bar=WindowFirstVisibleBar();
for(int i=0; i&lt;bars_count; i++,bar--)
  {
   // ...
  }
    </example>
    </function>

    <function>
      tag=windows_WindowExpertName
      caption=WindowExpertName()
      type=string
      <content>
Returns name of the executed expert, script, custom indicator, or library, depending on the MQL4 program, from which 
this function has been called.
      </content>
      <example>
string name=WindowExpertName();
GlobalVariablesDeleteAll(name);
      </example>
    </function>

    <function>
      tag=windows_WindowFind
      caption=WindowFind()
      type=int
      <content>
If indicator with <i>name</i> was found, the function returns the window index containing this specified indicator, otherwise it returns -1.<br/>
Note: WindowFind() returns -1 if custom indicator searches itself when <i>init()</i> function works.
      </content>
      example=int win_idx=WindowFind(&quot;MACD(12,26,9)&quot;);
      <parameter>
        type=string
        name=name
        description=Indicator short name.
      </parameter>
    </function>

    <function>
      tag=windows_WindowFirstVisibleBar
      caption=WindowFirstVisibleBar()
      type=int
      <content>
The function returns the first visible bar number in the current chart window. It must be taken into consideration that price bars are numbered 
in the reverse order, from the last to the first one.
The current bar, the latest in the price array, is indexed as 0. The oldest bar is indexed as <a href="help://predefined_variables_Bars">Bars</a>-1.
If the first visible bar number is 2 or more bars less than <a href="help://windows_WindowBarsPerChart">the amount of visible bars in the chart</a>,
it means that the chart window has not been fully filled out and there is a space to the left.
      </content>
      <example>
   // work with visible bars.
   int bars_count=WindowBarsPerChart();
   int bar=WindowFirstVisibleBar();
   for(int i=0; i&lt;bars_count; i++,bar--)
     {
      // ...
     }
      </example>
    </function>

    <function>
      tag=windows_WindowHandle
      caption=WindowHandle()
      type=int
      <content>
        Returns the system window handler containing the given chart.
        If the chart of <i>symbol</i> and <i>timeframe</i> has not been opened by the moment of function calling, 0 will be returned.<br/>
      </content>
      <example>
  int win_handle=WindowHandle("USDX",PERIOD_H1);
  if(win_handle!=0)
    Print(&quot;Window with USDX,H1 detected. Rates array will be copied immediately.&quot;);
      </example>
      <parameter>
        type=string
        name=symbol
        description=symbol name.
      </parameter>
      <parameter>
        type=int
        name=timeframe
        description=Timeframe. It can be any of <a href="help://constants_timeframes">Timeframe enumeration</a> values. 0 means the current chart timeframe.
      </parameter>
    </function>

    <function>
      tag=windows_WindowIsVisible
      caption=WindowIsVisible()
      type=bool
      <content>
      Returns TRUE if the chart subwindow is visible, otherwise returns FALSE. The chart subwindow can be 
      hidden due to the visibility properties of the indicator placed in it.
      </content>
      <example>
  int maywin=WindowFind("MyMACD");
  if(maywin&gt;-1 &amp;&amp; WindowIsVisible(maywin)==true)
    Print("window of MyMACD is visible");
  else
    Print("window of MyMACD not found or is not visible");
      </example>
      <parameter>
        type=int
        name=index
        description=Chart subwindow index.
      </parameter>
    </function>

    <function>
      tag=windows_WindowOnDropped
      caption=WindowOnDropped()
      type=int
      <content>
        Returns window index where expert, custom indicator or script was dropped.
        This value is valid if the expert, custom indicator or script was dropped by mouse.<br/>
        Note: For custom indicators being initialized (call from the <i>init()</i> function), this index is not defined.<br/>
        The returned index is the number of window (0-chart main menu, subwindows of indicators are numbered starting from 1) where the custom indicator 
        is working. A custom indicator can create its own new subwindow during its work, and the number of this subwindow will differ from that of the window 
        where the indicator was really dropped in.<br/>
        <b>See also</b> <a href="help://windows_WindowXOnDropped">WindowXOnDropped()</a>, <a href="help://windows_WindowYOnDropped">WindowYOnDropped()</a>
      </content>
      <example>
if(WindowOnDropped()!=0)
  {
   Print("Indicator 'MyIndicator' must be applied to main chart window!");
   return(false);
  }
      </example>
    </function>

    <function>
      tag=windows_WindowPriceMax
      caption=WindowPriceMax()
      type=double
      <content>
Returns maximal value of the vertical scale of the specified subwindow of the current chart
 (0-main chart window, the indicators' subwindows are numbered starting from 1). If the subwindow 
 index has not been specified, the maximal value of the price scale of the main chart window is returned.<br/>
 <b>See also</b> <a href="help://windows_WindowPriceMin">WindowPriceMin()</a>, <a href="help://windows_WindowFirstVisibleBar">WindowFirstVisibleBar()</a>, <a href="help://windows_WindowBarsPerChart">WindowBarsPerChart()</a>
     </content>
      <example>
double   top=WindowPriceMax();
double   bottom=WindowPriceMin();
datetime left=Time[WindowFirstVisibleBar()];
int      right_bound=WindowFirstVisibleBar()-WindowBarsPerChart();
if(right_bound&lt;0) right_bound=0;
datetime right=Time[right_bound]+Period()*60;
//----
ObjectCreate(&quot;Padding_rect&quot;,OBJ_RECTANGLE,0,left,top,right,bottom);
ObjectSet(&quot;Padding_rect&quot;,OBJPROP_BACK,true);
ObjectSet(&quot;Padding_rect&quot;,OBJPROP_COLOR,Blue);
WindowRedraw();
      </example>
      <parameter>
        type=int
        name=index
        description=Chart subwindow index (0 - main chart window).
        def_value=0
      </parameter>
    </function>

    <function>
      tag=windows_WindowPriceMin
      caption=WindowPriceMin()
      type=double
      <content>
Returns minimal value of the vertical scale of the specified subwindow of the current chart
 (0-main chart window, the indicators' subwindows are numbered starting from 1). If the subwindow 
 index has not been specified, the minimal value of the price scale of the main chart window is returned.<br/>
  <b>See also</b> <a href="help://windows_WindowPriceMax">WindowPriceMax()</a>, <a href="help://windows_WindowFirstVisibleBar">WindowFirstVisibleBar()</a>, <a href="help://windows_WindowBarsPerChart">WindowBarsPerChart()</a>
     </content>
      <example>
double   top=WindowPriceMax();
double   bottom=WindowPriceMin();
datetime left=Time[WindowFirstVisibleBar()];
int      right_bound=WindowFirstVisibleBar()-WindowBarsPerChart();
if(right_bound&lt;0) right_bound=0;
datetime right=Time[right_bound]+Period()*60;
//----
ObjectCreate(&quot;Padding_rect&quot;,OBJ_RECTANGLE,0,left,top,right,bottom);
ObjectSet(&quot;Padding_rect&quot;,OBJPROP_BACK,true);
ObjectSet(&quot;Padding_rect&quot;,OBJPROP_COLOR,Blue);
WindowRedraw();
      </example>
      <parameter>
        type=int
        name=index
        description=Chart subwindow index (0 - main chart window).
        def_value=0
      </parameter>
    </function>

    <function>
      tag=windows_WindowPriceOnDropped
      caption=WindowPriceOnDropped()
      type=double
      <content>
Returns the price part of the chart point where expert or script was dropped.
This value is only valid if the expert or script was dropped by mouse.<br/>
Note: For custom indicators, this value is undefined.
      </content>
      <example>
  double   drop_price=WindowPriceOnDropped();
  datetime drop_time=WindowTimeOnDropped();
  //---- may be undefined (zero)
  if(drop_time&gt;0)
    {
     ObjectCreate(&quot;Dropped price line&quot;, OBJ_HLINE, 0, drop_price);
     ObjectCreate(&quot;Dropped time line&quot;, OBJ_VLINE, 0, drop_time);
    }
      </example>
    </function>

    <function>
      tag=windows_WindowRedraw
      caption=WindowRedraw()
      type=void
      <content>
      Redraws the current chart forcedly. It is normally used after the objects properties have been changed.
      </content>
      <example>
  //---- set new properties for some objects
  ObjectMove(object_name1, 0, Time[index], price);
  ObjectSet(object_name1, OBJPROP_ANGLE, angle*2);
  ObjectSet(object_name1, OBJPROP_FONTSIZE, fontsize);
  ObjectSet(line_name, OBJPROP_TIME2, time2);
  ObjectSet(line_name, OBJPROP_ANGLE, line_angle);
  //---- now redraw all
  WindowRedraw();
      </example>
    </function>

    <function>
      tag=windows_WindowScreenShot
      caption=WindowScreenShot()
      type=bool
      <content>
Saves current chart screen shot as a GIF file. Returns FALSE if it fails. To get the error code, one has to use the <a href="help://check_GetLastError">GetLastError()</a> function.<br/>
The screen shot is saved in the <em>terminal_dir\experts\files</em> (<em>terminal_dir\tester\files</em> in case of testing) directory or its subdirectories.
      </content>
      <example>
  int lasterror=0;
  //---- tester has closed one or more trades
  if(IsTesting() &amp;&amp; ExtTradesCounter&lt;TradesTotal())
    {
     //---- make WindowScreenShot for further checking
     if(!WindowScreenShot("shots\\tester"+ExtShotsCounter+".gif",640,480))
        lasterror=GetLastError();
     else ExtShotsCounter++;
     ExtTradesCounter=TradesTotal();
    }
      </example>
      <parameter>    
        type=string
        name=filename
        description=Screen shot file name.
      </parameter>
      <parameter>    
        type=int
        name=size_x
        description=Screen shot width in pixels.
      </parameter>
      <parameter>    
        type=int
        name=size_y
        description=Screen shot height in pixels.
      </parameter>
      <parameter>
        type=int
        name=start_bar
        <description>
Index of the first visible bar in the screen shot. If 0 value is set, the current <a href="help://windows_WindowFirstVisibleBar">first visible bar</a> will be shot.
 If no value or negative value has been set, the end-of-chart screen shot will be produced, indent being taken into consideration. 
        </description>
        def_value=-1
      </parameter>
      <parameter>
        type=int
        name=chart_scale
        <description>
Horizontal chart scale for screen shot. Can be in the range from 0 to 5.
 If no value or negative value has been set, the current chart scale will be used.
        </description>
        def_value=-1
      </parameter>
      <parameter>
        type=int
        name=chart_mode
        <description>
Chart displaying mode. It can take the following values: CHART_BAR (0 is a sequence of bars), CHART_CANDLE (1 is a sequence of candlesticks), CHART_LINE (2 is a close prices line).
 If no value or negative value has been set, the chart will be shown in its current mode.
        </description>
        def_value=-1
      </parameter>
    </function>

    <function>
      tag=windows_WindowTimeOnDropped
      caption=WindowTimeOnDropped()
      type=datetime
      <content>
Returns the time part of the chart point where expert or script was dropped.
This value is only valid if the expert or script was dropped by mouse.<br/>
Note: For custom indicators, this value is undefined.
      </content>
      <example>
  double   drop_price=WindowPriceOnDropped();
  datetime drop_time=WindowTimeOnDropped();
  //---- may be undefined (zero)
  if(drop_time&gt;0)
    {
     ObjectCreate("Dropped price line", OBJ_HLINE, 0, drop_price);
     ObjectCreate("Dropped time line", OBJ_VLINE, 0, drop_time);
    }
      </example>
    </function>

    <function>
      tag=windows_WindowsTotal
      caption=WindowsTotal()
      type=int
      <content>
      Returns count of indicator windows on the chart (including main chart).
      </content>
      example=Print(&quot;Windows count = &quot;, WindowsTotal());
    </function>

    <function>
      tag=windows_WindowXOnDropped
      caption=WindowXOnDropped()
      type=int
      <content>
Returns the value at X axis in pixels for the chart window client area point at which the expert or script was dropped.
The value will be true only if the expert or script were moved with the mouse (&quot;Drag'n'Drop&quot;) technique.<br/>
        <b>See also</b> <a href="help://windows_WindowYOnDropped">WindowYOnDropped()</a>, <a href="help://windows_WindowOnDropped">WindowOnDropped()</a>
      </content>
      example=Print("Expert dropped point x=",WindowXOnDropped()," y=",WindowYOnDropped());
    </function>

    <function>
      tag=windows_WindowYOnDropped
      caption=WindowYOnDropped()
      type=int
      <content>
Returns the value at Y axis in pixels for the chart window client area point at which the expert or script was dropped.
The value will be true only if the expert or script were moved with the mouse (&quot;Drag'n'Drop&quot;) technique.<br/>
<b>See also</b> <a href="help://windows_WindowXOnDropped">WindowXOnDropped()</a>, <a href="help://windows_WindowPriceOnDropped">WindowPriceOnDropped()</a>, <a href="help://windows_WindowOnDropped">WindowOnDropped()</a>
      </content>
      <example>
  Print"Expert was attached to the window in the point x=",WindowXOnDropped()," y=",WindowYOnDropped());
      </example>
    </function>
  </group>

  <group>
    tag=obsolete
    caption=Obsolete functions
    <content>
      <p>In further development of MQL4, some functions were renamed and moved from one group to another in order
      to systematize them better. The old function names are not highlighted or linked to the 
      MetaEditor Dictionary. The old function names can be used since the compiler will accept them in a proper way. 
      However, we strongly recommend to use the new names.</p>
      <table cellspacing="0" cellpadding="4" border="0" class="docenums">
      <tr><th width="50%">Old Name</th><th width="50%">New Name</th></tr>
      <tr><td>BarsPerWindow</td><td><a href="help://windows_WindowBarsPerChart">WindowBarsPerChart</a></td></tr>
      <tr><td>ClientTerminalName</td><td><a href="help://terminal_TerminalName">TerminalName</a></td></tr>
      <tr><td>CurTime</td><td><a href="help://dateandtime_TimeCurrent">TimeCurrent</a></td></tr>
      <tr><td>CompanyName</td><td><a href="help://terminal_TerminalCompany">TerminalCompany</a></td></tr>
      <tr><td>FirstVisibleBar</td><td><a href="help://windows_WindowFirstVisibleBar">WindowFirstVisibleBar</a></td></tr>
      <tr><td>Highest</td><td><a href="help://series_iHighest">iHighest</a></td></tr>
      <tr><td>HistoryTotal</td><td><a href="help://trading_OrdersHistoryTotal">OrdersHistoryTotal</a></td></tr>
      <tr><td>LocalTime</td><td><a href="help://dateandtime_TimeLocal">TimeLocal</a></td></tr>
      <tr><td>Lowest</td><td><a href="help://series_iLowest">iLowest</a></td></tr>
      <tr><td>ObjectsRedraw</td><td><a href="help://windows_WindowRedraw">WindowRedraw</a>,</td></tr>
      <tr><td>PriceOnDropped</td><td><a href="help://windows_WindowPriceOnDropped">WindowPriceOnDropped</a></td></tr>
      <tr><td>ScreenShot</td><td><a href="help://windows_WindowScreenShot">WindowScreenShot</a></td></tr>
      <tr><td>ServerAddress</td><td><a href="help://account_AccountServer">AccountServer</a></td></tr>
      <tr><td>TimeOnDropped</td><td><a href="help://windows_WindowTimeOnDropped">WindowTimeOnDropped</a></td></tr>
      </table><br/>
    </content>
  </group>

  </group>
</dictionary>