Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 673
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
After the last answers the picture became clearer and the most obvious one is that I am not destined to become a programmer :-)
So far I started with the simplest listing and this is what it turned out to be:
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[4] = 86.0999999999999999 2018.10.15 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[3] = 85.989999999999999999 2018.10.16 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[2] = 86.76000000000001 2018.10.17 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[1] = 86.5 2018.10.18 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[0] = 85.72 2018.10.19 00:00:00
In some cases, for some reason, the price exceeds the dimension of two significant digits after the point in either direction.
And this happens without any errors in calculations, it's just the output of the price value from the chart base tmp1[i]=close[i];
Is there any way to fix it or just ignore it?
You can remove everything from it that's relevant to five, and get a template for four.
This can be written by someone who knows the difference between a five and a four, and it's definitely not me :-)
Where did the number 4 come from, what is its sacred meaning?
This can be written by someone who knows the difference between a five and a four, and it's definitely not me :-)
Where did the number 4 come from, what sacred meaning does it have?
You certainly don't listen or read... I was:
Forum on trading, automated trading systems & strategy testing
Any MQL4 beginners questions, assistance and discussion on algorithms and codes
Artyom Trishkin, 2018.10.18 09:26
After the last answers the picture became clearer and the most obvious one is that I am not destined to become a programmer :-)
So far I started with the simplest listing and this is what it turned out to be:
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[4] = 86.0999999999999999 2018.10.15 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[3] = 85.989999999999999999 2018.10.16 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[2] = 86.76000000000001 2018.10.17 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[1] = 86.5 2018.10.18 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[0] = 85.72 2018.10.19 00:00:00
In some cases, for some reason, the price exceeds the dimension of two significant digits after the point in either direction.
And this happens without any errors in calculations, it's just the output of the price value from the chart base tmp1[i]=close[i];
Is there any way to fix it or just ignore it?
It's fine. To print fractional numbers, simply use DoubleToString() with the required precision. In this case the required precision should be Digits()
After the last answers the picture became clearer and the most obvious one is that I am not destined to become a programmer :-)
So far I started with the simplest listing and this is what it turned out to be:
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[4] = 86.0999999999999999 2018.10.15 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[3] = 85.989999999999999999 2018.10.16 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[2] = 86.76000000000001 2018.10.17 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[1] = 86.5 2018.10.18 00:00:00
2018.10.20 08:42:43.343 _t1 CADJPY,Daily: tmp1[0] = 85.72 2018.10.19 00:00:00
In some cases, for some reason, the price exceeds the dimension of two significant digits after the point in either direction.
And this happens without any errors in calculations, it's just the output of the price value from the chart base tmp1[i]=close[i];
Can this be defeated in some way or just ignore it?
these are normal values for a real number. you can learn to write programs, everyone starts there - you just need to read a lot and try to write and write your own codes.
The accuracy of the real number, mantissa, and how it's all stored in memory, you can google it on the web, the principles of storage are the same everywhere.
if you want beautiful output use DoubleToStr()
these are common values for a real number, you can learn to write programs, everyone starts there - you just need to read a lot and try to write and write your own codes
The accuracy of the real number, mantissa, and how it's all stored in memory, you can google it on the web, the principles of storage are the same everywhere.
if you want beautiful output, use DoubleToStr()
Where it is possible to use compatible functions, it is better to offer them for use. Otherwise this epic will start all over again. In this case: DoubleToString()
How could you prevent the EA from running on the same instruments?
For example, the EA works in eur/usd window, but when run in other windows on eur/usd some alert message is displayed. I will be very grateful for the help.
How could you prevent the EA from running on the same instruments?
For example, the EA works in eur/usd window, but when run in other windows on eur/usd some alert message is displayed. I will be very grateful for help.
You need to transfer data from one EA to another, search the forum
or use the global variables of the terminal (this is the easiest way) - there you can write the value of the first EA, and subsequent copies of the EA will read this value and will not runhttps://www.mql5.com/ru/docs/globals
you need to transfer data from one EA to another, search the forum
or use the global variables of the terminal (this is the easiest way) - there you can write the value of the first EA, and subsequent copies of the EA will read this value and will not runhttps://www.mql5.com/ru/docs/globals
the EA is the same, you should not allow it to run on the same symbols
and? you couldn't have studied the help in 2 minutes
If you're talking specifically about how to pass a string to a global variable, the only way is to create a name for the global variable, i.e. in your case you run an EA on EURUSD, do a check
if(GlobalVariableCheck(_Symbol)) .....
If there is no such a variable, then create an oversized one, like this
if(GlobalVariableSet(_Symbol,Magic)==0) Print("Error writing to global variable # ",GetLastError());
then on completion of the Expert Advisor, delete the glob.variable
as it is, the terminal is not handy, and I kind of pointed out the direction of search