Errors, bugs, questions - page 1871
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
And it should not be possible to
1. When is union planned to be introduced?
2. will typedefs be entered as well?
3. are pointers to fundamental types planned to be introduced?1. when is union planned to be introduced?
2. will typedef also be introduced with union?
3. Is introduction of pointers to fundamental types planned?1. Soon. Everything is ready in the compiler, we are testing it now. We will release it after the tests.
2. It is not known yet when
3. no, not planned.
For some reason,CopyTime (or any similar)resizes the receive array, evenif thesize of the receive array is larger than the size to be copied.
Gentlemen, is it normal? Has it always been like this? Or a bug?
For example:
The CopyTime function resizes the TimeBuf array to 1.
This is wrong in principle.
It wouldn't be a problem but for one important nuance: the data are copied to the beginning of the array and, consequently, the whole point of optimization is lost at the root.
For some reason,CopyTime (or any similar)resizes the receive array, evenif thesize of the receive array is larger than the size to be copied.
Gentlemen, is it normal? Has it always been like this? Or a bug?
For example:
The CopyTime function resizes the TimeBuf array to 1.
This is wrong in principle.
It wouldn't be so bad, were it not for one important nuance: the data are copied at the beginning of the array, and consequently, the whole point of optimization is lost at the root.
Your array is dynamic! That is, with a variable size. As you have not specified its dimension in square brackets.
The word static means that the object of this array is constructed when the Expert Advisor is loaded, and is destroyed when it is unloaded.
Your array is dynamic! That is, with a variable size. As you didn't specify its dimension in square brackets.
The word static means that object of this array is constructed at loading of EA and destroyed at unloading
I'm sorry, but you missed the point.
Let the array be declared in the global scope
Then:
1) The first time we copy (CopyTime) into the array how many bars there are.
2) According to the optimal design, when a new bar appears, we don't want to copy all the bars, right? Therefore, we decide to copy only the last 2 modified bars.
3) In the end our optimization doesn't work, becauseCopyTime resizes the array and puts the size =RequiredCount, plus we lose the reserve size(CopyTime is not aware of it).
This situation would not occur if CopyTime copied directly from the end of the array to the starting point:
at the location:
it:
Copy functions have always changed the size of a dynamic array. To a larger or smaller size. But there was always a clear correspondence with the number of records given as a result of the query.
In your case the original query to an array with dynamically resizable. All other requests that request one element at a time, do it in an array with a predefined size (datetime _TimeBuf1[1]), so there is no redistribution. Self-reallocate the received element to a large dynamic array
So it's always been like that and it's normal. I see. Thank you for your reply!
I was aware of the enlargement, but not of the shrinking to the size of the requested data. Now I'll know, thank you!
MT4 build 1065
Test on USDJPY TF M15
from the result log:
406 2014.11.28 20:30 sell 18 5.50 118.641 0.000 117.015 0.00
521 2014.12.09 17:15 t/p 18 5.50 118.386 0.000 118.386-148.95
How does the loss come about?