No one reads it, but they're willing to support it. I thought I saw you in the machine learning thread? If so, you should understand what is written in the article.
I guess I don't fully understand. Why a matrix element has 3 values. It's a 3-dimensional array. Why in the help the vector is a one-dimensional array and the matrix in this example is represented by a three-dimensional one.
ZY, it happens)))) in the example there are 3 rows and 4 columns)))) matrix))))))
Another minor error in the section"Copying timeseries to matrix or vector":
//--- list of characters to be calculatedstring symbols[]= {"EURUSD", "GBPUSD", "USDJPY", "USDCAD", "USDCHF"};
int size=ArraySize(symbols);
//--- matrix and vector to get prices Closematrix rates(InBars, size);
vector close;
for(int i=0; i<size; i++)
{
//--- get Close prices into vectorif(close.CopyRates(symbols[i], InTF, COPY_RATES_CLOSE, 1, InBars))
{
//--- insert the vector into the timeseries matrix
rates.Col(close, i);
PrintFormat("%d. %s: %d Close prices added to the matrix.", i+1, symbols[i], close.Size());
//--- output the first 20 values of the vector for debuggingint digits=(int)SymbolInfoInteger(symbols[i], SYMBOL_DIGITS);
Print(VectorToString(close, 20, digits));
}
else
{
Print("vector.CopyRates(%d,COPY_RATES_CLOSE) failed. Error ", symbols[i], GetLastError());return;
}
}
Probably better like this:
//--- list of characters to be calculatedstring symbols[] = {"EURUSD", "GBPUSD", "USDJPY", "USDCAD", "USDCHF"};
int size =::ArraySize(symbols);
//--- matrix and vector to get prices Closematrix rates_mx(InBars, size);
vector close_vc;
for(int i = 0; i < size; i++)
{
::ResetLastError();//--- get Close prices into vectorif(close_vc.CopyRates(symbols[i], InTF, COPY_RATES_CLOSE, 1, InBars))
{
//--- insert the vector into the timeseries matrix
rates_mx.Col(close_vc, i);
::PrintFormat("%d. %s: %d Close prices added to the matrix.", i + 1, symbols[i],close_vc.Size());
//--- output the first 20 values of the vector for debuggingint digits = (int)::SymbolInfoInteger(symbols[i], SYMBOL_DIGITS); ::Print(VectorToString(close_vc, 20, digits));
}
else
{
::PrintFormat("vector.CopyRates(%s,COPY_RATES_CLOSE) failed. Error %d", symbols[i], ::GetLastError());return;
}
}
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.
It's not a vector, it's a matrix, I have the code above
You have to figure it out yourself or convince the compiler. See examples, read.
So how do you get a column out of a matrix?
You can get a vector from a matrix using Col
What do you mean by "pull out"? Remove?
You can get a vector from a matrix using Col
What do you mean by "take out"? Remove?
Take it out in terms of converting it into something to work with.
I showed above the code that I failed with Col, it was a matrix, not a vector, as you wrote.
You need to rest and re-read all your questions in this osbud tomorrow
Thank you for your concern!
Most of the questions have been resolved with your help.
I will wait until tomorrow, maybe you can answer my question later.
No one reads it, but they're willing to support it. I thought I saw you in the machine learning thread? If so, you should understand what is written in the article.
There's probably a little mistake here:
It should be like this:
Another minor error in the section"Copying timeseries to matrix or vector":
Probably better like this:
There 's probably a little mistake here:
It should be like this:
Thank you, corrected