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

 
Maxim Dmitrievsky:

k-means, the simplest

Well, it's the same thing.

Try dbscan, I think it will be better.

See, I can even see what you're clustering) I'm crazy about myself.)

 
Alexander_K2:

I showed somewhere (I forgot where, because I haven't been trading for more than a month) that the probability distribution of market increments is the product of the CB Gaussian and exponential (or in general - Erlang) distributions.

The Erlang distribution is responsible for the time intervals between the tick quotes and the generator of such numbers looks like this:


Here Lambda is the intensity of the flow of events (quotes).

If Lambda=const, the process is stationary, but the flux intensity is different at different moments of the market, i.e. Lambda=f(t) that determines the non-stationarity of the process in general.

So, in order to distinguish a stationary process, it is necessary to consider separate sections of BP with the same flux density as a whole.

Therefore, attempts to break BP into hours within a day, and then these hours "glue" together - clearly have the right to life.

P.S.

According to my calculations, the same flux density is observed in the following hours within a day:

0

1, 23

2, 5, 22

3, 4, 8, 21

6, 7

9, 12, 19

10, 11, 15, 18

13, 14

16

17

20

Well, this is just for information...

 
mytarmailS:

Well, it's the same thing

Try dbscan, I think it will be better.

See, I can even see what you did clustering)) I'm freaking myself out)

why are you freaking out? i wrote it in the beginning

 
Maxim Dmitrievsky:

Why are you freaking out? I wrote it in the beginning.

where? i didn't see it.

 
mytarmailS:

Where? I haven't seen.

can you pull out matrices with centroids to use them separately in another program with new data?

Maybe R has such a function? Check it out.

 
Maxim Dmitrievsky:

can you pull out matrices with centroids to use them separately in another program with new data?

Maybe R has such a function? Check it out.

if i got it right, yes, i can

 
mytarmailS:

If I understand correctly, yes, I can

teach me

 
Maxim Dmitrievsky:

teach

Write again specifically what you want to do without coding unnecessarily


fake.dt <- matrix(rnorm(100),ncol = 5)
kn <- kmeans(fake.dt,centers = 3)
kn$centers
 kn$centers
       [,1]        [,2]        [,3]        [,4]       [,5]
1 0.1491919 -0.82943057  1.00194753 -0.78824900  0.7330618
2 0.4543194 -0.01318233 -2.36800973  0.05477085  0.2706286
3 0.1478300  0.34991845 -0.04671528  0.33735489 -0.6789331
three centroids from three clusters
 
mytarmailS:

write again specifically what you want to do so that you don't code unnecessarily

after the fit model there should be a matrix or something similar, depending on the algorithm

which can be used to calculate the forecast on the new data... and on the old data

to transfer it to the metaq and run it in the tester

 
So, what should I do with it? I'm not very good at clustering yet
Reason: