Errors, bugs, questions - page 1782
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
Which ones work?
The rule of losing significant digits and filling them with random works
The result is long, but in the intermediate calculations of double and that is where significant digits are lost
(Digits+1)*3-1=17
The rule of losing significant digits and filling them with random works
The result is long, but in the intermediate calculations of double and that is where significant digits are lost
(Digits+1)*3-1=17
Thank you for the information.
However, the information is hard to grasp - i.e. the number can be so, but you can't do calculations with it?
Here is an example of code where it is converted from string to number
Print ("CalcY=",CalcY);
Prints the number 111111111111111104.
I.e. there are no calculations here or am I wrong?
Is it possible to handle these numbers or are these language limitations?
So there are no calculations here, or am I wrong?
A calculation is any operation (in thiscase a conversion). For the specified number StringToDouble returns double with loss of precision
StringToInteger returns long, but further functions operating with double cannot be used in calculations without loss of precision such as NormalizeDouble, MathPow
Computation - any operation (in this case a conversion). StringToDouble returns double - there is a loss of precision
StringToInteger returns long, but further functions operating with double cannot be used in calculations without loss of precision, such as NormalizeDouble, MathPow,
StringToInteger worked to express the number, but then it gets worse, I guess the number must be broken down into its components for mathematical operations...
Print ("CalcZ=",CalcZ);
double Test=CalcZ;
Print ("Test=",Test);
Test=1.111111111111111e+17
Again, it is written in the helpdesk
INT_MAX
Maximum value that can be represented by int type
2147483647
Then how did StringToInteger perform the conversion and store it in long if the number is larger than allowed?
Then how did StringToInteger convert and store to long if the number is larger than allowed?
StringToInteger originally returns long withinLONG_MINLONG_MAX(it could also be called StringToColobok)
StringToInteger originally returns long (it might as well have been called StringToBoob)
Of course, this is probably true, but in the help it is so muddled
"
Converts a string containing a character representation of a number to an int (integer) number.
"
That's what misled me.
Thanks for the information.
I take it that the above number representation will not fit into the graphical buffer?
I take it that the above number will not fit in the graphical buffer?
They are written as B'11111111111111111111111111111111'
I assert (and suggest checking) that when the timeframe is changed from M5 to M15 no M5 Deinit command is sent to the first indicator (and only to it - in this case M5) and it will not unload from the chart until the user deletes the EA
Note that in MT5, the indicator calculation core is a shared resource with a usage counter in its own manager. If different programs or windows use the indicator with the same parameters, one calculation copy with the usage counter actually works. This saves a lot of money when a trader uses the same indicators in charts and in an Expert Advisor.
The indicator manager is designed so that it physically deletes indicators asynchronously and with a delay. And in the meantime, a new working copy is created with new parameters, which is often initialized before the old copy is physically deleted.
The indicator manager is designed so that it physically removes indicators asynchronously and with a delay. And in the meantime a new working copy is created with new parameters, which is often initialised before the old copy is physically deleted.
Let's simplify the indicator
void Prn( string f, int i = -1 ) { Print( f, "->", StringSubstr( EnumToString( Period()), 7 ), (i == -1 ? "" : ":" + i )); }
void OnInit() { Prn( __FUNCTION__ ); }
void OnDeinit( const int reason ) { Prn( __FUNCTION__, reason ); }
int OnCalculate( const int, const int, const int, const double& [] ) { return 0; }
Let's attach the Test.mq5 to the M5 chart and then change the chart period from M5->M15
Result:
2017.02.06 00:54:20.897 OnInit->M5
2017.02.06 00:54:25.553 OnInit->M15
Question: When will OnDeinit->M5 be called ?
My answer: Never!
Your answer above: asynchronously and with a delay