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

 
Maxim Dmitrievsky #:
It's not easy to isolate them, but otherwise, what's the point of complicating things?

cycles are too big to catch them, and there is no forecast on them, except for agriculture, and then not everything is so simple. Temporal components - events repeated in time can only be singled out. And if you also find the links of events and influences on the price, it is a goal)))).

 

Grammatical evolution / symbolic regression, a more advanced version of genetic programming....

With these tools, you can automatically search for patterns of any kind.


For example, you can search for optimal indicator control through a formula.

we create a function template (search area)

library(gramEvol)
ruleDef <- list(expr  = grule(op(expr, expr), func(expr), var),
                func  = grule(sin, cos, log, sqrt),
                op    = grule("+", "-", "*","/"),
                var   = grule(distance, distance^n),
                n     = grule(1, 2, 3, 4))

grammarDef <- CreateGrammar(ruleDef)
gr <- GrammarRandomExpression(grammarDef,numExpr = 10,max.depth = 5)
q <- as.matrix(unlist(lapply(gr,as.character)),ncol=1)
q

and it automatically creates formulas:

[1,] "sqrt(log(cos(sqrt(cos(distance^2)))))"                                                                  
 [2,] "sin(log(sqrt(sin(sqrt(distance * distance))) * (sin(log(distance^3)) - cos(cos(distance)) - distance)))"
 [3,] "(sin(distance * sqrt(sin(distance * sqrt(distance^3)))) + distance^1)/distance"                         
 [4,] "sin(log(log(distance^4)))"                                                                              
 [5,] "distance"                                                                                               
 [6,] "distance^4"                                                                                             
 [7,] "log(sin(distance)) * (log(distance) - cos(distance^4 - distance^4))"                                    
 [8,] "distance^1"                                                                                             
 [9,] "distance"                                                                                               
[10,] "log(distance) * (distance/log((distance^4 - distance^3) * distance^2))"        

which then genetically search for the best solution.

=====================

Or it is possible to create log rules, thus searching for regularities.

Again we create a function template (search area ).

library(gramEvol)
ruleDef <- list(
  expr = grule(expr & sub.expr, 
               expr | sub.expr, 
               sub.expr),
  sub.expr = grule( com(var, var) ),
  com = grule(">=","<="),
  var = grule(x,y,w,z,q,y,r)
  )

grammarDef <- CreateGrammar(ruleDef)
gr <- GrammarRandomExpression(grammarDef,numExpr = 15,max.depth = 3)

q <- as.matrix(unlist(lapply(gr,as.character)),ncol=1)
q

And the output is rules

[1,] "x >= y"                  
 [2,] "y <= y | y >= y | w >= y"
 [3,] "y <= x"                  
 [4,] "y <= y"                  
 [5,] "y <= r"                  
 [6,] "z <= z"                  
 [7,] "y <= y"                  
 [8,] "x <= y"                  
 [9,] "z <= y | y >= z & r >= y"
[10,] "z >= x"                  
[11,] "y >= y | q >= y | q >= q"
[12,] "y >= y | q <= y | z >= q"
[13,] "y >= y | x <= y | x >= x"
[14,] "y >= r"                  
[15,] "y >= w"

which are then tested for suitability by genetics.

=============================

If you have a TS and you want to improve it but do not have enough imagination to try millions of variants, you can try to do it with the help of an algorithm.

Forexample, we have an entry point: breakdown of the bolinger with the price down ("PRICE < BOLINGER").

We add this rule to our grammar.

library(gramEvol)
ruleDef <- list(
  expr = grule(expr & sub.expr, 
               expr | sub.expr, 
               sub.expr),
  sub.expr = grule( com(var, var)  ,  PRICE < BOLINGER),
  com = grule(">=","<="),
  var = grule(x,y,w,z,q,y,r)
  )

grammarDef <- CreateGrammar(ruleDef)
gr <- GrammarRandomExpression(grammarDef,numExpr = 15,max.depth = 3)

q <- as.matrix(unlist(lapply(gr,as.character)),ncol=1)
q

The rules are a little bit stupid, but that's because they are generated randomly.

[1,] "y >= q"                                                                                                        
 [2,] "PRICE < BOLINGER & y >= y | x >= x"                                                                            
 [3,] "PRICE < BOLINGER | PRICE < BOLINGER & x <= y | y <= w"                                                         
 [4,] "r <= y & PRICE < BOLINGER | w >= x | y <= x"                                                                   
 [5,] "PRICE < BOLINGER | PRICE < BOLINGER | y <= y & PRICE < BOLINGER"                                               
 [6,] "PRICE < BOLINGER"                                                                                              
 [7,] "PRICE < BOLINGER & PRICE < BOLINGER & z <= x | PRICE < BOLINGER & PRICE < BOLINGER | PRICE < BOLINGER | z <= x"
 [8,] "y <= y | PRICE < BOLINGER | x <= y | PRICE < BOLINGER | PRICE < BOLINGER"                                      
 [9,] "PRICE < BOLINGER & x <= y | y <= q & PRICE < BOLINGER"                                                         
[10,] "q >= z & PRICE < BOLINGER | q >= w & y <= x"                                                                   
[11,] "PRICE < BOLINGER | PRICE < BOLINGER"                                                                           
[12,] "w >= y"                                                                                                        
[13,] "PRICE < BOLINGER"                                                                                              
[14,] "y <= y & PRICE < BOLINGER | q >= x | PRICE < BOLINGER"                                                         
[15,] "q >= x" 

The point is that we reduce the search space a lot if we add our own rule.

If we have a good rule and we don't know how to improve it, but we want to, we can "clothe" it with other rules and check it automatically.

 
mytarmailS #:

Grammatical evolution / symbolic regression, a more advanced version of genetic programming....

You can use these tools to automatically look for patterns, of any kind.


for example, you can search for optimal control of an indicator using the formula

create a function template (search area)

and it automatically creates formulas:

which then genetically searches for the best solution.

=====================

Or you can create log rules, so you can look for patterns.

Again create a function template (search area )

And in the output we get the rules

which are then tested for suitability by genetics.

=============================

If you have a TC and you want to improve it but do not have enough imagination to try millions of variants, you can try to do it with the help of an algorithm.

Forexample, we have an entry point: breakdown of the bolinger with the price down ("PRICE < BOLINGER").

We add this rule to our grammar.

The rules are a little bit stupid, but that's because they are generated randomly.

The point is that we reduce the search space a lot if we add our own rule.

If we have a good rule and we don't know how to improve it, but we want to, we can "clothe" it with other rules and check it automatically.

Well, that's like putting deep trees around the signs.
 
Maxim Dmitrievsky #:
Well, it's like putting deep trees around the signs.
These are simple examples, just to understand the versatility of the tool.

Instead of simple perennials, it could be functions, or neural networks, or whatever you want.


And all of this will be automatic.
 
mytarmailS #:
These are simple examples, just to understand the versatility of the tool.

Instead of simple parens, it can be functions, or neural networks, or whatever you like


And all this will be on automatic oiling
We are waiting for the development of the topic
 
elibrarius #:

A question for those who are involved in MO.
How do you motivate yourself for this almost hopeless endeavour?
In 18 when I started, I had a small income and a material incentive, or rather the hope that MO in the market will help.

Now I get many times more, almost passively, not from the market. The material question does not bother me. For the last 2 years I took up MO 3 times for 1-2 months, to check the idea I was interested in.
I have free time, but it is lazy to spend it on MO after a lot of unsuccessful experiments. As I have almost no hope for return. The only thing - only to have another source in case of another financial slump (if something turns out). But the motive is weak at the moment.

Who motivates themselves with what?

Long relationship with forex. Started as an analyst in a brokerage house (economics education), then worked as a dealer and assistant manager, traded, then got interested in bots and MO.

There were a lot of inefficiencies (including technical ones), when I managed to take out decent sums
 
Maxim Dmitrievsky #:

I have a long relationship with forex. I started as an analyst in a brokerage centre (economics education), then worked as a dealer and assistant manager, traded, then got interested in bots and MO

There were a lot of inefficiencies (including technical ones), when I managed to take out decent sums.
Motivation is still earnings?
Well, no one with the help of MO does not work out.... everyone is searching.
 
elibrarius #:
Motivation is all about earning money?
Well it seems no one with the help of MO is doing well.... everyone's looking.

Not only that, it's an irrational urge.

like when you were a kid you liked to break toys and build new ones.
 
Maxim Dmitrievsky #:

Not only that, it's an irrational urge.

like when I was a kid I liked to break toys and make new ones.

In general - creativity. But creativity "on the table", because all this work is unlikely to be seen and appreciated by anyone.

 
And other supporters of the MoD - what is the motivation?
Reason: