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

 

I've been playing around with the convolutional neuron for a while now. So far it didn't work, but at least I figured out how to cook it and predict with it. Here's a simple code with comments, and a table for the test.

There are two convolutional layers and one normal hidden layer. The trained model just ends up always outputting "1" (buy). The idea is to have dozens, not 2 convolutional layers, and then weeks to train, and there is no guarantee that there will be any success at all. But it's worth a try.

I repatched forex_mxnet.txt, there was an error there. For the softmax function the number of outputs on the last layer should equal the number of classes. The option with regression in this case is not possible at all.

Files:
eurusd_h1.zip  30 kb
forex_mxnet.txt  20 kb
 
Dr.Trader:

1) I'm not quite sure what you mean by "clustering. Usually cluster not one particular predictor, but on the contrary take a dozen of them, and find areas in space where these points are grouped. For example, in the picture below, having two predictors, clustering into two clusters will give just blue and red clusters.

2) Maybe you are talking about patterns? The green pattern - the price goes down and then up. Yellow: price goes up from the bottom. Red: up->down. Did you get it?


Initially we do not know which predictors are good and which are bad, if we cluster them all at once in one model (stochastic+rsi+masd.......) = cluster 1,2,3,4,5..... then we will account for the unnecessary predictors as well, we won't even know that they are unnecessary...

We need to cluster each predictor

K1 = (stochastic) = clusters 1,2,3,4,5....

K2 = (rci) = clusters 1,2,3,4,5....

K3 = (mass) = clusters 1,2,3,4,5....

then we look for combinations by cluster numbers between model combinations

К1

K1 and K2

K2 and K3

K1 and K3

K1 and K2 and K3...

2) Correct, In this context, clusters and patterns are the same thing

 
mytarmailS:

Clusters and patterns are different. Clusters on one vector are intervals, i.e. the list of all allowable indicator values is divided into several zones. But in this case intervals 2 and 3 from your picture are one and the same.

But if your second and third clusters are necessarily different things, then they are no longer clusters, but patterns.

 
Dr.Trader:

Clusters and patterns are different. Clusters on one vector are intervals, i.e. the list of all allowable indicator values is divided into several zones. But in this case intervals 2 and 3 from your picture are one and the same.

But if your second and third clusters are necessarily different things, then they are no longer clusters, but patterns.

If we cluster not the last indicator value, but, say, the last 10 values in the sliding window, we obtain a cluster with a certain number that takes into account the numerical and geometrical characteristics of the indicator (slopes etc.)

So what is it a cluster or a pattern?

Did I answer your question or did I not understand the question? :)

 
mytarmailS:

Did I answer your question or did I not understand the question? :)

That's yes, quite clustering, then it's fine.
 

This is where I look at how the committee of all available models behaves on validation versus naive approximations: buy only, sell only, random directions.

Bai is pulling ahead a bit on this sample.

There is another delayed sample ahead to validate a finely matched committee. It is possible that the sell will be better. But the important thing is how the models committee behaves...

Correlation with the scheme I gave:

 
Alexey Burnakov:

The Bai is slightly ahead on this sample.

If the price chart on that time interval is going up, then statistically it will be more profitable sometimes to just open a buy trade, hold it, and close it. Not that it is "profitable", just the loss will be less compared with if you also accidentally open a sell trade and hold it for a while. That's why buy-only and sell-only are so beautifully symmetrical around random trades. It's not the model itself that pulls ahead, it's just the price that successfully accompanies it.
 
Dr.Trader:
If the price chart is going up in that time frame, then statistically it will be more profitable sometimes to just open a buy trade, hold it, and close it. Not that it is "profitable", just the loss will be less compared to if you also randomly open a sell trade and hold it for a while. That's why buy-only and sell-only are so beautifully symmetrical around random trades. It's not the model itself that pulls ahead, it's just the price that successfully accompanies it.
That's what I'm talking about. Both sell-only and buy and random trades were done without the model... But the trend was up and the buy was better against the rest of the random.

And the deals on trained models are green... In this sample, they are in the lead. This particular target was chosen because the models on it are on average going to the plus side in the sample that did not participate in either the training or the Model Selection. Then there will be committee tweaking and validation. And I will only use the last delayed sample once in the entire study.

PS ) All taking into account the spread. Therefore, the random is distributed below zero.
 

It looks good in general, I wonder what will happen in the end.

About the committee - I posted some examples, but there are models that use regression with rounding when classifying, and there is not so straightforward. I tried two different ways of combining votes:

1) round up everything to classes, take that class which will have more votes.
I.e. having a forecast for 4 bars from three models
c(0.1, 0.5, 0.4, 0.4) c(0.6, 0.5, 0.7, 0.1) c(0.1, 0.2, 0.5, 0.7) I would further round it up to classes
c(0, 1, 0, 0) c(1,1,1,0) c(0,0,1,1) , and the final vector with predictions would be c(0, 1, 1, 0) by number of votes.

2) another option is to find the average result right away, and only then round it up to the classes
the result would be c((0.1+0.6+0.1)/3, (0.5+0.5+0.2)/3, (0.4+0.7+0.5)/3, (0.4+0.1+0.7)/3)
or (0.2666667, 0.4000000, 0.5333333, 0.4000000), or
c(0, 0, 1, 0)

You can see that the result is different, and it depends on which step to round. I don't know which of these is more standard, but I think the second way works better on new data.
 
Alexey Burnakov:

This is where I look at how the committee of all available models behaves on validation versus naive approximations: buy only, sell only, random directions.

Bai is pulling ahead a bit on this sample.

There is another delayed sample ahead to validate a finely matched committee. It is possible that the sell will be better. But the important thing is how the models committee behaves...

Correlation with the scheme I gave:

This is a very interesting conclusion: my basic Sequent Demark's instrument has some interesting features, one of which is the following. In other words, I have a lot of buy signals and the model trains better on them. I think this shows a global downward trend, when the picture will change to the opposite, there will be preconditions to buy, I mean the pound, of course, and on the Jews similar too can be seen at once....