
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
Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 4.
Why does the code in the loop not work
while(!IsStopped())
{
code
Sleep(50);
}
but by ticks it works fine
Why does the code in the loop not work
А! Got it! Thank you!!!
Problem with Symbol() MT4:
2 functions to illustrate:
Execution of the first one outputs an empty string:
But the second function outputs a string ID "EURUSD" (well, depends on the chart, but outputs, although according to the logic of the function it should be an empty string):
Help me understand what is wrong? Thank you
Problem with Symbol() MT4:
2 functions to illustrate:
Execution of the first one outputs an empty string:
But the second function outputs a string ID "EURUSD" (well, depends on the chart, but outputs, although according to the logic of the function it should be an empty string):
Help me understand what is wrong? Thank you
Your if(false) will never work, so value will not change in any way, and will most likely be an empty string. Although I don't know how values of string variables are initiated. Maybe they are not initiated at all, then in your version anything can be output.
"...If no initial value is set explicitly, a numeric variable is initialised to zero (0) and a string variable is initialised to the empty string...."
There you go, you've even found it in the documentation too... But generally speaking a d...n... question. Not to bother, it's not so hard to type instead:
string value;
something like this:
There you go, you even found it in the documentation... But generally speaking, it's a dumb question. It's not too hard to type instead:
something like this:
Thank you for answering. About the documentation, I know that without explicit initialization, the string variable will be an empty string, but this function returns a character code of the tool. I.e. we will never get into a condition (false intentionally), so how value becomes Symbol() in this version (this example of the function is exaggerated), that is, with implicit initialization the string variable is not an empty string (and I really counted on it), but something unclear, or rather the mechanism of implicit string initialization is not clear. "Stuffing" the variable declaration is not difficult, it's just the behaviour of the system outside of the documentation that's somehow confusing. And most importantly, this happens when you use Symbol().
Good afternoon everyone!
I have written an arbitrage Expert Advisor. The entry signal is generated - if the current divergence of price lines of the DELTA_MA indicator exceeds the DELTA value set in the parameters:
The EA works fine and correctly! The problems started when I wanted to insert a filter that allows entering only if the first condition is met - the convergence of price lines at the same time:

The algorithm for such a condition is implemented as follows