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

 
Vizard_:
radikal.ru/video/1JIag8ds57s

)))

 
Vizard_:

Don't get too euphoric. A couple of days to calmly digest, spin it...

That's good advice. Take your time... :-)

 
mytarmailS:

regular horizontal volumes!!! God! Where did you people come from? )) Ah, I forgot this is a Forex forum)


In the little window? On the left monitor?

 
Sergey Chalyshev:

What's wrong?

I have the same problem myself. Can someone tell me why this may be happening?

 
Mikhail Khlestov:

I have this problem myself. Who can tell me why this can happen?

This is the case with everyone, it makes no sense to look at the results of the tray at all, only on the OOS, but if the system has not identified real patterns (and it succeeds in a couple hundred people in the world), then the OOS will be a drain on the spread or something worse. And it's easy to make a trace - no problem for any graal writer for $100 and a couple of hours.

 
Igor Makanu:

1.I'll try to loosely translate Haikin's quote: the data set should contain both positive and negative examples.

with positive examples it seems to be clear, the only thing left to figure out is how to teach negative examples?

2.Noise should also be taught, but it's not exactly a negative example, is it?

1. That's a good point. But you forgot - the ratio between positive and negative must be consistent with practice. Also a quote from memory.

To teach the same way. Serve the input in mixtures with the positives.

2. from 1. it follows - no noise nada.

If you have only positive and no negative, you have no idea what you are teaching.

 
Igor Makanu:

1. did not forget, because I do not know - there is nothing to forget, still read and read, but here with these little things and all begins!

2. individually all, imho, well, I have good objectives - I do not want to predict the unpredictable, I want to adapt the adaptive )))

By the way, where to take the negative. Since I do not know the problem, in general.

If you're teaching, say, to recognize triangles, then the training sample should contain not only a variety of triangles, but also a variety of non-triangles.

 
Vizard_:

radikal.ru/video/m9Ct2f9xDCn

Shit... what kind of music you're listening to))

 

Karoch, about the fllets, if anyone remembers, I raised the subject of how you can algorithmize the flops. I didn't get any clear answers, so I had to think for myself...

At the beginning I experimented with distributions - the more the price fluctuated on one level and the more these fluctuations were the more probable the flop; however this method has disadvantages and I gave up on it

The second method was better and I want to share it with you in case anyone is interested...

For the second method I used the autocorrelation of price and I searched long enough for signs of flatness in ACF indications and found two simple signs.

This is what the price and the ACF look like

the code on the R-ke

layout(1:2)
x <- cumsum(rnorm(100))
plot(x,t="l")
acf(x,plot = T,lag.max = length(x))

Now about the signs

The first sign - the number of extrema in the ACF (blue)

The second one is the number of crossings of the zero line ( red)

The more crossovers and extrema, the stronger the flat

A function that returns the two above attributes or parameters

get_parameters <- function(x){
  ac <- acf(x,lag.max = length(x),plot = F)
  
  
  library(quantmod)
  
  xx <- ac$acf
  
  pi <- findPeaks(xx)
  va <- findValleys(xx)
  length(c(pi,va))
  
  flet <- rep(0,length(xx))
  for(i in 5:length(xx)){
    
    if(xx[i-1]>0 && xx[i]<0)  flet[i] <- 1
    if(xx[i-1]<0 && xx[i]>0)  flet[i] <- 1
  }
  
  x1 <- length(c(pi,va))
  x2 <- sum(flet)
  
  return(c(x1,x2))
}

The method has a disadvantage - it's a sliding window of a fixed size, but it can be bypassed, though the algorithm slows down a hundred times, which is bad...


Now the result

We consider "flat" the situation when the first and second signs are greater than 7

the algorithm in a sliding window of size 30 points

algorithm in a sliding window of 200 pixels

and the code itself

layout(1:1)
x <- cumsum(rnorm(1000))
plot(x,t="l")
n <- 200  # length roll window
for(i in n:length(x)){
  ii <- (i-(n-1)):i
  gp <- get_parameters(x[ii])
 flat <- gp[1]>=8 && gp[2]>=8
if(flat){
   rect(i-length(ii), min(x[ii]), i, max(x[ii]), col = "aquamarine3",border = "aquamarine3")
 }}
lines(x,t="l")


If anyone knows how to improve the algorithm, feel free to

 
mytarmailS:

Karoch, .....

Algorithm in a sliding window of size 30 points

Algorithm in a sliding window of 200 pixels

So if you take the whole story as a window, it will be a flat from start to finish?