Machine learning in trading: theory, models, practice and algo-trading - page 2510

 
elibrarius #:

Apparently they reserved words for new types.

Not just reserved, something already works.

void OnStart()
{
  vector v(3);
  v[0] = 1.0;
  v[1] = 2.0;
  v[2] = 3.0;
  matrix m(3, 3);
  m.Random();
  Print("m = ", m);
  Print("m^-1 = ", m.Inverse());
  Print("Det(m) = ", m.Det());
  Print("m * v = ", m * v);
}
 
Aleksey Nikolayev #:

Not only reserved, something already works.

The help search doesn't yield anything.
And the matrices will come in handy.
Setting the size via variables works

int m1=2; int m2=2;
matrix m(m1, m2);

Before, you had to use dynamic arrays.

 
elibrarius #:

The help search doesn't give me anything.

I only have information from here.

elibrarius #:

And the matrices will come in handy.
Working with variables to set the size

int m1=2; int m2=2;
matrix m(m1, m2);

Before you had to use dynamic arrays.

In fact, Renat promised machine learning in MQL5, like ONNX support. Let's see)

 
Vladimir Baskakov #:
No one has ever beaten the intersection of the two masks

... and the lag can be reduced by an NS predicate))

 
elibrarius #:
If anyone uses SanSanych's package https://www.mql5.com/ru/code/17468 to connect to R, then:

In the R.mqh file, the names of the vector and matrix variables started to give an error when compiling. Rename them to other names and everything will work. I used vectr and matr.

The editor highlights these words in blue as a data type like int, double. Apparently reserved words for new types.

Hmm, didn't know anything about this library. How to use it, what is its functionality?

 
iwelimorn #:

In short, all in vain, with MO the market can not cheat.

I found the signs and the target, whose class distribution is shown in the first figure.

The accuracy on the test and training katbust models trained using this dataset was 93%

The second figure shows the balance and equity graph of the target trade:

The third figure shows the graph of balance and equity trading on the signals of the trained catbust model:

So, ladies and gentlemen, disperse.

What's the target, how did you find it?

Have you tried adding a trall?

If you just look at the error balance (+1 right -1 wrong for class 1), are the results much different?

 
Aleksey Vyazmikin #:

Hmm, didn't know anything about this library. How to use it, what is its functionality?


Two-way transfer of variables and arrays between MT and R. There quotes, back results and commands.
Function description:
/**
* Return the dll version. The upper 16 bit of the return value
* are the major version and the lower 16 bit the minor. This
* is used in RInit() to make sure that this header file and
* zzthe dll fit together.
*/
int RGetDllVersion();

/**
* This is not meant to be called directly, it will be
* called by RInit() after the successful version check.
* You should call RInit() to start a new R session.
*/
long RInit_(string commandline,int debuglevel);

/**
* Teminate the R session. Call this in your deinit() function.
* After this the handle is no longer valid.
*/
void RDeinit(long rhandle);

/**
* return true if the R session belonging to this handle is
* still running. R will terminate on any fatal error in the
* code you send it. You should check this at the beginning
* of your start function and stop all actions. The last
* command prior to the crash will be found in the log.
* If R is not running anymore this library won't emit any
* more log messages and will silently ignore all commands.
*/
bool RIsRunning(long rhandle);

/**
* return true if R is still executing a command (resulting
* from a call to RExecuteAsync())
*/
bool RIsBusy(long rhandle);

/**
* execute code and do not wait. Any subsequent call however
* will wait since there can only be one thread executing at
* any given time. Use RIsBusy() to check whether it is finished
*/
void RExecuteAsync(long rhandle,string code);

/**
* execute code and wait until it is finished. This will not
* return anything. You can basically achieve the same with
* the RGet*() functions, evaluating the expression is also
* just executig code, the only difference is that these
* RGet*() functions will additionally try to parse and return
* the output while RExecute() will just execute, wait and
* ignore all output.
*/
void RExecute(long rhandle,string code);

/**
* assign a bool to the variable name. In R this type is called "logical"
*/
void RAssignBool(long rhandle,string variable,bool value);

/**
* assign an integer to the variable name.
*/
void RAssignInteger(long rhandle,string variable,int value);

/**
* assign a double to the variable name.
*/
void RAssignDouble(long rhandle,string variable,double value);

/**
* assign a string to the variable namd. In R this type is called "character"
*/
void RAssignString(long rhandle,string variable,string value);

/**
* assign a vector to the variable name. If the size does not match
* your actual array size then bad things might happen.
*/
void RAssignVector(long rhandle,string variable,double &vectr[],int size);

/**
* assign a vector of characters (an array of strings) to the variable. If you need
* a factor then you should execute code to convert it after this command. In
* recent versions of R a vector of strings does not need any more memory than
* a factor and it is easier to append new elements to it.
*/
void RAssignStringVector(long rhandle,string variable,string &vectr[],int size);

/**
* assign a matrix to the variable name. The matrix must have the row number as the
* first dimension (byrow=TRUE will be used on the raw data). This function is much
* faster than building a huge matrix (hundreds of rows) from scratch by appending
* new rows at the end with RRowBindVector() for every row. This function is optimized
* for huge throughput with a single function call through using file-IO with the
* raw binary data. For very small matrices and vectors with only a handful of elements
* this might be too much overhead and the other functions will be faster. Once you
* have the matrix with possibly thousands of rows transferred to R you should then
* only use RRowBindVector() to further grow it slowly on the arrival of single new
* data vectors instead of always sending a new copy of the entire matrix.
*/
void RAssignMatrix(long rhandle,string variable,double &matr[],int rows,int cols);

/**
* append a row to a matrix or dataframe. This will exute
* variable <- rbind(variable, vector)
* if the size does not match the actual array size bad things might happen.
*/
void RAppendMatrixRow(long rhandle,string variable,double &vectr[],int size);

/**
* return true if the variable exists, false otherwise.
*/
bool RExists(long rhandle,string variable);

/**
* evaluate expression and return a bool. Expression can be any R code
* that will evaluate to logical. If it is a vector of logical then only
* the first element is returned.
*/
bool RGetBool(long rhandle,string expression);

/**
* evaluate expression and return an integer. Expression can be any R code
* that will evaluate to an integer. If it is a floating point it will be
* rounded, if it is a vector then only the first element will be returned.
*/
int RGetInteger(long rhandle,string expression);

/**
* evaluate expression and return a double. Expression can be any R code
* that will evaluate to a floating point number, if it is a vector then
* only the first element is returned.
*/
double RGetDouble(long rhandle,string expression);

/**
* evaluate expression and return a vector of doubles. Expression can
* be anything that evaluates to a vector of floating point numbers.
* The return value is the number of elements that could be copied into the
* array. It will never be bigger than size but might be smaller.
* warnings are output on debuglevel 1 if the sizes don't match.
>>> Limited to 100000 elements
*/
int RGetVector(long rhandle,string expression,double &vectr[],int size);

/**
* do a print(expression) for debugging purposes. The outout will be
* sent to the debug monitor on debuglevel 0.
*/

void RPrint(long rhandle,string expression);

 
elibrarius #:

Two-way transfer of variables and arrays between MT and R. There quotes, back results and commands.
Thanks for the information, will be aware of this possibility. How much of a round trip delay is there anyway?
 
Aleksey Vyazmikin #:
Thanks for the information, I will be aware of this possibility. How long is the round trip delay?
Very fast. Via memory exchange. Not files and not pips.
 
Vladimir Baskakov #:
No one has ever beaten the intersection of the two waveforms
You won't believe this.
If averaging is used, the result will be identical to the swabs, and the signal rollover time will be the same to within seconds.
---
I was shocked myself ;)
Reason: