Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1206
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
Alert("Разбег "+DoubleToString(delta,_Digits));
or Alert(StringFormat("Spread %.5f",delta));
in general, get used to it, they are just different representations of the same number. Think back to your wonderful school days - that's where it comes from.
Thank you. But what if I need to use the delta value as a number and compare it? For example.
Would that be correct?Thank you. What if I need to use the delta value as a number and compare? For example.
Is this correct?You can compare two real numbers like this:
https://www.mql5.com/ru/docs/basis/types/double
You can compare two real numbers like this:
https://www.mql5.com/ru/docs/basis/types/double
You can, if you're sure they can't be very close in value. After all, soft is compared to warm.
I don't get it. For example. I take the number of pips that price has passed in one tick. If the price passed more than 20 points, then I get an Alert.
I compare the price difference (1.12300-1.12321=0.00021) with the necessary maximum value (0.00020).
0.00021>0.00020.
What does this have to do with soft and warm?
I don't get it. For example. I take the number of pips that price has passed in one tick. If the price passed more than 20 points, then I get an Alert.
I compare the price difference (1.12300-1.12321=0.00021) with the necessary maximum value (0.00020).
0.00021>0.00020.
What does this have to do with soft and warm?
you need points, so compare points. they are integers by the way.
and double is compared to epsilon (DBL_EPS if memory serves), otherwise you might get 3.0-0.2 > 2.0+0.8 (figuratively, figures may be different)
you need points, so compare the points. they are integers by the way.
while double is compared to epsilon (DBL_EPS if memory serves), otherwise you may get 3.0-0.2 > 2.0+0.8 (figuratively, numbers may be different)
better use@fxsaber example for this purpose:
script to check:
I don't get it. For example. I take the number of pips that price has passed in one tick. If the price passed more than 20 points, then I get an Alert.
I compare the price difference (1.12300-1.12321=0.00021) with the necessary maximum value (0.00020).
0.00021>0.00020.
What does this have to do with soft and warm?
Well sometimes you don't have to read everything that's written.
You took numbers that are normally represented by the system. Take these...
and you get
The idea is a-b==c, but the computer will give you such errors. It was written about it a lot on the forum, search and read.
But you can take the normalised difference and the normalised control value and compare them.
Good time to you all. Question: in MT4, when working in the tester with crosses (pairs without quid), how does the tester calculate the results of closed positions, if the account, on which testing is conducted, is a dollar account? For the recalculation of position totals in dollars, does the tester take the exchange rate of the base currency of the cross to the dollar at the current moment or at the moment of the tested interval? I strongly suspect that it is at the current time. If so, is it impossible to make it calculate at the time of the interval?
Does anyone know?
count the MODE_TICKVALUE itself for each tick.
You could, if you're sure they can't be very close in value. After all, soft is compared to warm.
Ifprom18 needs to compare two numbers, within Digits signs, this is the only method that works:
But as you can see, it has even more variation: https://www.mql5.com/ru/forum/160683/page1205#comment_17247843. Therefore, in the example I intentionally reduced the comparison accuracy by two digits. Of course, such a spread in price values is quite inaccurate... But how else to compare two numbers in cases like this...? If the deviation was over Digits, then we could not use EqualDoubles, but use NormalizeDouble to cut off all unnecessary things.
Although, you could also do it like this: