Assignment (Variable)
The Assignment Tab is used to assign a value to a Variable.
- The Value and the Default Value can be entered on the Assignment Tab.
- The Default Value is the value that is set when additional copies of the Variable Element are added to a Drawing.
- Note: A Default Value does not need to be assigned.
- A value can be entered manually by typing in the text-box.
- The expression editor is used to enter a mathematical expression.
- The Apply an Offset section is used to add or subtract a value to or from the variable. A common usage is to add a number of points to a value such as the highest high in the last 24 bars.
- Check the Apply an Offset checkbox to enable the option.
- The first pull-down menu is used to define the action as subtraction (Sub(-)) or addition (Add(+)).
- The middle entry box is used to enter the value to be added or subtracted. This can be a literal value, such as 15, or it can be another previously defined variable such as MyOffset. The value can also be set using the the Choose button. Note: an Input/extern variable can be defined and selected so that the actual value can be set each time the EA is attached to a chart.
- The last pull-down menu is used to select if the value is multiplied or divided by the MQL built-in variable Point, or if neither is done. The available options are:
- * Point (Multiply by Point)
- / Point (Divide by Point)
- None (Do not multiply or divide)
A common usage is to multiply an Integer value, such as 12, by the MQL built-in variable Point to convert the number to a price value.
For Example, on a EURUSD chart: 12 * Point = 12 * 0.00001 = 0.00012
For more information on MQL built-in variables and functions, see the MQL Help section.