
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.. )