Announcement:
  • If you need to open an account, you can contact customer service to guide the operation.
  • Customer service WeChat: Jin-DaoCheng
    1. Home > Foreign Exchange School

    Introduction to MT4 Indicator Programming (2): Analysis of Common Symbols

    MT4 indicator programming is similar to other programming, and it also requires the help of many symbols to complete the logical expression. Whether it isDLSMForex or other platforms, mastering these commonly used symbols is the basis for writing custom indicators. Let's sort out the symbols often used in MT4 self-written indicator programming.

    Introduction to MT4 Indicator Programming (II): Analysis of Common Symbols (Figure 1)

    1. Comment characters: single-line comment "//", multi-line comment "/**/"

    The program does not execute the content in the comment, only for reading or temporarily preserving statements that do not need to be run. In the MQ language editor, the content of the comment is displayed in gray.

    2. Semicolon ";"

    It is used to mark the end of a statement.

    3. Comma ","

    Represents an interval within a statement that does not end the statement.

    Equivalent sign "="

    Assignment operation assigns the value to the right of the equal sign to the variable to the left of the equal sign.

    Plus sign "+"

    When used for integers or decimals, it means adding values; when used for strings, it means connecting before and after.

    Add "++"

    Increase the value of the variable before the symbol by 1. For example, "i ++;" is actually short for "i = i + 1;", which means that the value of i increases by 1.

    Plus equals "+="

    Add the value after the sign to the variable before the sign. For example, "i += 2;" is actually short for "i = i + 2;", which means that the value of i is increased by 2.

    Double equal sign "=="

    The equal determinant is used for logical judgment. If the values before and after the double equals sign are equal, the logical value "true" is returned; if not, "false" is returned.

    Exclamation mark "! ="

    Not equal to determinant, used for logical judgment. If the values before and after the inequality sign are not equal, the logical value "true true" is returned; if they are equal, "false false" is returned.

    4、“&&”

    The logical operator "and".

    5、“||”

    The logical operator "or".

    6. Braces "{}"

    Used to represent the body of a function. The content inside the braces is the body statement.

    Click to inquire about transaction account opening

    Please indicate the source: https://www.daoctech.com/fxschool/2514.html

    Disclaimer: The content of this article does not represent the views of the Institute of Foreign Exchange. The content is for reference only and does not constitute investment advice. Investors operate accordingly at their own risk.