33 lines
1.4 KiB
Markdown
33 lines
1.4 KiB
Markdown
# Input
|
|
|
|
Input Variables
|
|
The input storage class defines the external variable. The input modifier is indicated before the data type. A variable with the input modifier can't be changed inside mql4-programs, such variables can be accessed for reading only. Values of input variables can be changed only by a user from the program properties window. External variables are always reinitialized immediately before the OnInit() is called.
|
|
|
|
Example:
|
|
|
|
//--- input parameters
|
|
input int MA_Period=13;
|
|
input int MA_Shift=0;
|
|
input ENUM_MA_METHOD MA_Method=MODE_SMMA;
|
|
|
|
There is another way to set how your input parameter will look like in the Inputs tab. For this, place a string comment after the description of an input parameter in the same line. In this way you can make names of input parameters more understandable for users.
|
|
|
|
//--- input parameters
|
|
input int InpMAPeriod=13; // Smoothing period
|
|
input int InpMAShift=0; // Line horizontal shift
|
|
input ENUM_MA_METHOD InpMAMethod=MODE_SMMA; // Smoothing method
|
|
|
|
input ENUM_MA_METHOD MAMethod = MODE_EMA;
|
|
|
|
//
|
|
// Gives time frame as an input ...
|
|
input ENUM_TIMEFRAMES Timeframe = PERIOD_CURRENT;
|
|
|
|
|
|
in adding input data to your advisors, indicators or etc, you can groups your input's together.
|
|
for this following below descriptions:
|
|
|
|
int group "Moving Avarage Filter"
|
|
|
|
every inputs appears after this, attached to created group ...
|