When requesting data from the indicator, if requested timeseries are not yet built or they need to be downloaded from the server, the function will immediately return -1, but the process of downloading/building will be initiated.
When requesting data from an Expert Advisor or script, downloading from the server will be initiated, if the terminal does not have these data locally, or building of a required timeseries will start, if data can be built from the local history but they are not ready yet. The function will return the amount of data that will be ready by the moment of timeout expiration.
This note should be removed, as CopyBuffer() is not related to timeseries.
Additionally a note should be added about indicators buffers updates when an indicator is running using iCustom.
Below is a copy of the online version and the values are incorrect as demonstrated in my code above.
ENUM_COPY_TICKS
The ENUM_COPY_TICKS enumeration contains the flags to specify the type of data to be passed to the matrix or array. The flag combination allows getting several series from the history in one request. The order of the rows in the matrix will correspond to the order of the values in the ENUM_COPY_TICKS enumeration. In other words, the row with High data will always be higher in the matrix than the row with Low data.
ID
Value
Description
COPY_TICKS_TIME_MS
1
Tick time in milliseconds
COPY_TICKS_BID
2
Bid price
COPY_TICKS_ASK
4
Ask price
COPY_TICKS_LAST
8
Last price (last deal price)
COPY_TICKS_VOLUME
16
Last price Volume
COPY_TICKS_FLAGS
32
Tick Flags
Data arrangement
COPY_TICKS_VERTICAL
32768
Ticks are copied into the matrix along the vertical axis. The received ticks will be arranged vertically in the matrix, i.e., the oldest ticks will be in the first row, while the most recent ticks will be in the last matrix row.
With default copying, ticks are added into a matrix along the horizontal axis.
The flag is only applicable when copying to a matrix.
Oh yes, that is another thing i noticed. Each time I press F1 while cursor is on the normal CopyTicksRange function, I get the reference article for the vector/matrix function.
Erreurs d'Exécution - Codes d'Erreurs et Avertissements - Constantes, Enumérations et Structures - Référence MQL5 - Référence sur le langage de trading algorithmique/automatisé pour MetaTrader 5
SocketTlsCertificate()- Get data on the certificate used to secure network connection.
The parameters 2-6 are specified as [in] parameters, but actually they are [out] parameters, as can be seen by the example, and the fact, they are specified as reference parameter types.
My guess is this should be a long type. - "unsigned long" or "ulong" as both are valid in MQL5
EDIT:
I suggest also mentioning what a scalar type is, as these would refere to (probably) float, double and signed as well as unsigned versions of char, short, int, long. - But also color and datetime could be used, as they are just a different interpretation of uint(color) and long(datetime).
I wont point out all the other errors, as this needs complete revision anyways. -
MetaQuotes, please update the Documentation, maybe add a new section representing vector, complex and matrix objects. - I am a little annoyed, because you dont update the docs to accomodate the pointed out errors in this thread. - Ive contributed quite some work to make it easy for you, still you refuse to do the required updates, and you dont allow us moderators to edit the docs either.
Also it would be nice, if you yould enable us to derive from vector, complex and matrix types. - Example:
An array initialized with an initializer list is static and not dynamic. - This would conclude, the array in _test_dynamic should be implicit declared as a static array. (Or better, resized to the initializer list size, and have the property dynamic)
EDIT:
Changed first code listing, added brackets to the initialization list, as required for addressing the array inside the struct. (Result is the same)
Structures, Classes and Interfaces - Data Types - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
CopyBuffer() (and CopyIndicatorBuffer) documentation :
Note
When requesting data from the indicator, if requested timeseries are not yet built or they need to be downloaded from the server, the function will immediately return -1, but the process of downloading/building will be initiated.
When requesting data from an Expert Advisor or script, downloading from the server will be initiated, if the terminal does not have these data locally, or building of a required timeseries will start, if data can be built from the local history but they are not ready yet. The function will return the amount of data that will be ready by the moment of timeout expiration.
This note should be removed, as CopyBuffer() is not related to timeseries.
Additionally a note should be added about indicators buffers updates when an indicator is running using iCustom.
Forum on trading, automated trading systems and testing trading strategies
ENUM_COPY_TICKS values different from reference
Fernando Carreiro, 2023.06.13 19:36
That may be the case, but the documentation is still incorrect ... Documentation on MQL5: Matrix and Vector Methods / Initialization / CopyTicks
Below is a copy of the online version and the values are incorrect as demonstrated in my code above.
Forum on trading, automated trading systems and testing trading strategies
ENUM_COPY_TICKS values different from reference
Fernando Carreiro, 2023.06.13 18:44
As a supplement to your information, I get the following ...
Forum on trading, automated trading systems and testing trading strategies
ENUM_COPY_TICKS values different from reference
Tobias Johannes Zimmer, 2023.06.13 21:07
Oh yes, that is another thing i noticed. Each time I press F1 while cursor is on the normal CopyTicksRange function, I get the reference article for the vector/matrix function.Missing error code translations. - Incomplete list of error codes.
French, Japanese:
Error codes: 4023 - 4025, 5700 - 5706, 5800 - 5808
https://www.mql5.com/fr/docs/constants/errorswarnings/errorcodes
https://www.mql5.com/ja/docs/constants/errorswarnings/errorcodes
Wrong specification of function parameters:
SocketTlsCertificate()- Get data on the certificate used to secure network connection.
The parameters 2-6 are specified as [in] parameters, but actually they are [out] parameters, as can be seen by the example, and the fact, they are specified as reference parameter types.https://www.mql5.com/en/docs/network/sockettlscertificate
Wondering where these functions went, or if they ever existed....
https://www.mql5.com/en/docs/basis/variables#array_built_in_methods
Compile result:
Missing type specifier beyond "unsigned" in documentation:
https://www.mql5.com/en/docs/basis/types/matrix_vector
vector matrix.Row(const unsigned nrow)
Return a row vector
vector matrix.Col(const unsigned ncol)
Return a column vector
unsigned matrix.Rows()
Return the number of rows in a matrix
unsigned matrix.Cols()
Return the number of columns in a matrix
My guess is this should be a long type. - "unsigned long" or "ulong" as both are valid in MQL5
EDIT:
I suggest also mentioning what a scalar type is, as these would refere to (probably) float, double and signed as well as unsigned versions of char, short, int, long. - But also color and datetime could be used, as they are just a different interpretation of uint(color) and long(datetime).
- Have I forgotton anything?
Documentation on vectors and matrices seems not complete at all, and has quite some errors:
https://www.mql5.com/en/docs/basis/types/matrix_vector
Compile result:
I wont point out all the other errors, as this needs complete revision anyways. -
MetaQuotes, please update the Documentation, maybe add a new section representing vector, complex and matrix objects. - I am a little annoyed, because you dont update the docs to accomodate the pointed out errors in this thread. - Ive contributed quite some work to make it easy for you, still you refuse to do the required updates, and you dont allow us moderators to edit the docs either.
Also it would be nice, if you yould enable us to derive from vector, complex and matrix types. - Example:
Also, still making it possible to pass these derived objects into API-Functions that tyke in the base types.
Asking myself, if this is intentional, or maybe a bug.
According to documentation, it is possible to use initializer lists on structs and classes, as long as they do not have an explicit constructor.
https://www.mql5.com/en/docs/basis/types/classes#class
But this wont work, though, docs do not state dynamic arrays are a show stopper on initialization lists.
Result:
For confirmation, this seems to be a bug, see following example:
Why? - Because per definition, and as figured here:
https://www.mql5.com/en/forum/445076/page2#comment_46566076
An array initialized with an initializer list is static and not dynamic. - This would conclude, the array in _test_dynamic should be implicit declared as a static array. (Or better, resized to the initializer list size, and have the property dynamic)
EDIT:
Changed first code listing, added brackets to the initialization list, as required for addressing the array inside the struct. (Result is the same)
_test test_me = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };