I need a bit more clearly explanation about the 'GlobalVariable Functions' which one how can I use it. I already read documentation.
( if would be example that would be awesome )
Thanks in advance.
The documentation is quite self explanatory regarding this.
Use them in the same way as globally declared variables when you need a value retained after an EA or indicator has been removed or the terminal is shut down or timeframe changed on the chart to which an indicator is attached.
The most important thing is to make sure that they are given individual names. You could use magic number and Symbol in the name. It could cause problems if more than 1 EA or indicator were trying to access and change the same Global Variable (of the client terminal).
Global variables of the terminal provide an indispensable tool for developing sophisticated and reliable Expert Advisors. If you master the global variables, you will no more be able to imagine developing EAs on MQL5 without them.
The documentation is quite self explanatory regarding this. ...
Alain Verleyen:
Article for mql5, but it works the same with mql4.
Big thanks for more informative comments.
And I try like below code but I do not get good result. So I try to terminal would save my latest changes. e.g: Default Lot Size is 0.01 after I changed Lot Size then I change TimeFrames - Lot Size turn to Default. Please, help me or give me good (clearly) advice!
I have not any idea about 'Lot Reset' Button. some describe: And I need to when I click reset button lot size turn to default lot size value.( e.g lot size value 1 ) So, I need good advice with example.
I have not any idea about 'Lot Reset' Button. some describe: And I need to when I click reset button lot size turn to default lot size value.( e.g lot size value 1 ) So, I need good advice with example.
( also I am still researching )
All the best to you.
It may help if you describe what you are referring to.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I need a bit more clearly explanation about the 'GlobalVariable Functions' which one how can I use it.
I already read documentation.
( if would be example that would be awesome )
Thanks in advance.
I need a bit more clearly explanation about the 'GlobalVariable Functions' which one how can I use it.
I already read documentation.
( if would be example that would be awesome )
Thanks in advance.
The documentation is quite self explanatory regarding this.
Use them in the same way as globally declared variables when you need a value retained after an EA or indicator has been removed or the terminal is shut down or timeframe changed on the chart to which an indicator is attached.
The most important thing is to make sure that they are given individual names. You could use magic number and Symbol in the name. It could cause problems if more than 1 EA or indicator were trying to access and change the same Global Variable (of the client terminal).
I need a bit more clearly explanation about the 'GlobalVariable Functions' which one how can I use it.
I already read documentation.
( if would be example that would be awesome )
Thanks in advance.
Article for mql5, but it works the same with mql4.
The documentation is quite self explanatory regarding this.
...
Article for mql5, but it works the same with mql4.
Big thanks for more informative comments.
And I try like below code but I do not get good result. So I try to terminal would save my latest changes.
e.g: Default Lot Size is 0.01 after I changed Lot Size then I change TimeFrames - Lot Size turn to Default.
Please, help me or give me good (clearly) advice!
Thanks in advance.
string _lotGV;
//-----------------------------------------------------------------------------
int OnInit()
{
//Global Variables
_lotGV = _prefix + _Symbol + " _lotGV";
if ( GlobalVariableCheck( _lotGV ) == true )
{
GlobalVariableGet( _lotGV );
} //---if Close
else
{
GlobalVariableSet( _lotGV, _lotSize );
}
}
#GlobalVariable - Closed
I solved like below code.
_lotGV = _prefix + _Symbol + " _lotGV";
if ( GlobalVariableCheck( _lotGV ) == true )
{
_lotSize = GlobalVariableGet( _lotGV );
} //---if Close
else
{
GlobalVariableSet( _lotGV, _lotSize );
}
#Lot Reset - Open
I have not any idea about 'Lot Reset' Button. some describe: And I need to when I click reset button lot size turn to default lot size value. ( e.g lot size value 1 )
So, I need good advice with example.
( also I am still researching )
All the best to you.
I am really struggle, someone please help me.
Thanks.
#Lot Reset - Open
I have not any idea about 'Lot Reset' Button. some describe: And I need to when I click reset button lot size turn to default lot size value. ( e.g lot size value 1 )
So, I need good advice with example.
( also I am still researching )
All the best to you.
{
Lotsize=0.01;
}
{
Lotsize=0.01;
}
You clearly understand me, thank you great man, much appreciate.
( it is simple, but sometimes I struggle.. )