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

 
Alexey Burnakov:

Do you evaluate the performance of the strategy on history or is there a long forward? The hell can be in the evaluation on history.

Entry on momentum, exit through OR on a number of conditions. In principle, it kind of works. But if you enter on the peak, then you have to wait a year to get out of drawdown.

I have tested it on forex. If they have entered on a peak, there is SL.
 
Andrey Dik:

More details: buy signal on the current bar, like buy, counting the smallest number of bars forward......

I also have a similar version of how you can smooth it out, I voiced it about 100 pages ago, but it's more abstract...

We don't know how to trade, where to enter, where to exit.

That's why everything we invented (trends, zz, candlestick colors, rebounds) is just nonsense in an attempt to describe market movements, subjectivism as it is

Everyone has chosen his own direction and everyone digs in it - some use candlestick colors, some use zzz, I personally use zzz rebounds, etc. This is all very subjective and that is what separates us, although in essence we all do the same thing and the result is the same - those no...

I propose to take something that unites all of us and will not be subjective, namely the target in the form of - we can say the desire

"I want the algorithm to earn min. 5% a week with a max drawdown. 2%"

normal target? everyone likes and fits, right? and everything is clear...

You should not train the net according to our created targets like GZ and others, which are subjectivity, but train the net as the search for a certain minimum or maximum in profit or drawdown, or in sharp-ratio or in PV or a combination of these indicators.

And the approach should be - the net I don't care how you trade, trade the way you want, but every week I should get +5% with a drawdown up to 2%.... Let the network itself trade, let it determine whether there is a trend or reversal, as a matter of fact, all we are interested in is the profit and drawdown, and we control that, and we do not know how to trade, and therefore we should not get into it....

How to implement it ...

There are networks that already teach us to play games, in particular in Super Mario http://gekkoquant.com/2016/03/13/evolving-neural-networks-through-augmenting-topologies-part-1-of-4/, I propose to teach the network in the same way, let us draw an analogy ...

1) There is an environment - the turtles that spit, obstacles in the form of pipes, boxes, which should jump over, etc.

2) There are actions - the buttons on the joystick that the network presses to control Mario

3) there are points - a reward for the network

4) there is a penalty - the death of Mario

Once in the environment (1) the net begins to press the joystick buttons (2) and so on for thousands of iterations until it learns to pass the level, scoring a reasonable number of points (3) without dying (4)

The analogy with trading

1) There is an environment - the input data into the network - predictors

2) There are actions - buy/sell/never do anything

3) There are points - received profit

4) there is a penalty - received drawdown

 
mytarmailS:

You should not train the network by our created targets like GZ and others that are subjectivity, but train the network in search of some minimum or maximum of profit or drawdown or sharp-ratio or PV or combination of these indicators

I agree, the chosen target is subjective and unreasonable. I tried to make a trading model with the rneat package, which learned a little bit of trading on history, but still could not predict correctly on new data.

There is one very important difference - in all these experiments with games the model is trained tens of thousands of times on each game. And its result is evaluated by playing these very games, evaluation on the data for learning, so to speak. For Forex, good performance on the data is not enough for training, it is necessary for the model to work on the new data as well, and apparently it is a big problem for such an algorithm.

 
Dr.Trader:

1) I agree, the chosen target is subjective and unreasonable. I tried to make a trading model with the package rneat, which learned a little bit to trade on history, but still could not correctly predict on new data.

2) For forex, good work on the data for learning is not enough, the model must also work on the new data, and apparently this is a big problem for such an algorithm.

1) I don't know how to put it correctly, but in your experiment you didn't let the network think, you didn't let it make trades by itself, thus you turned the network into an ordinary model, its main idea is to self-learn and you did it for it, you see?

I told you to let her do her own trading, let her make her own trades and draw her own conclusions.

Our control is profit and drawdown, that's it... then she's on her own...

2) Yes, it is a problem for any algorithm, but there is hope that if the net learns to trade well on its own, without our targets and our subjectivism, then there is a chance it will accept new data more objectively.

 
Andrey Dik:
I check on the forward. If you entered on the peak - there is SL for that.
There is SL.
 
Dr.Trader:

Although it is implied, I'd rather add it to make it clearer to everyone.

Usually overlearning in models has the effect that the model remembers the training examples very accurately. Learning starts with model's deduction of some general rules, dependencies of target values on predictors, but the further learning goes on, the stricter these rules become in the model, leading eventually to completely memorized examples, with complete inability of the model to predict on new data. This is solved by cross-validation, and stopping training when the model has learned some generalized rules but has not yet started to learn specific examples, this will give better predictive performance on new data.

This works great on data where the dependencies remain constant over time - picture recognition, or sound recognition for example. But forex is different in that many of the dependencies found are not persistent over time. The problem is not only to achieve learning without memorizing training examples, but also to somehow make sure that the patterns found will still exist in the future.


You make a good point. Recognition of pictures, sounds is a pseudo-stationary process, provided that the sample is representative and the way the pictures are drawn in the control sample is not given to left-handed cerebral palsy patients (roughly, sorry).

The task is more complete: to develop a way to estimate predictors with respect to the target variable that makes it guaranteed that the relationship between predictors and the target variable is constant, and will also exist on new data.

Selecting predictors by their importance for the predicted variable on the basis of their consistency over time is almost the same as looking for predictors on a single larger sample. That is, I mean, if one selects predictors that perform equally well in all plots in several consecutive samples, it's a straightforward fit to those plots.

In essence, out of N predictors, n are chosen that will work well across the board (in all available samples). Fitted, what's next? And then comes the real.forward, on which we observe a plum. What is the reason?

The reason is that the methodology for selecting predictors in the K sample area has not been tested for generating similar quality results in the M sample area. In other words, each sub-set of predictors selected must produce correlated results on K and M.

I can select for you such predictors and a model corresponding to them that, without learning out of sample, nevertheless traverses the plot very well. In fact, this is the kind of model that would learn well if all the samples were glued together, and I kind of do this gluing by hand.

We need to find a way to select predictors so that on training and validation the models behave like in the left picture:

And only then can we say that the model passes the out-of-sample test. Not just that some models (predictors) pass out of sample.

 
SanSanych Fomenko:

It seems that you and I are the two of us here, because Alexei's position is not quite clear to me.


I do not understand why my position is complicated. I have already said that if I do not see the correlation between the performance of models in the sample and out of sample, then I do not produce a robust model. Either you don't understand, or you've never done it.

I'm saying that if you fit predictors, or model parameters so that the model will work well everywhere, it's just a FINE thing to do. The model will be overfitted, even if it is protected from overfitting.

 
Alexey Burnakov:

The reason is that the methodology for selecting predictors at K has not been tested for generating similar quality results at M. In other words, each sub-set of predictors selected must produce correlated results at K and M.

What should correlate with what? How do you do that? I don't get it either...

Alexey Burnakov:

Either you don't understand, or you've never done it.

I think nobody did it but you.)

 
Alexey Burnakov:

I don't see why my position is complicated. I already said that if I don't see correlation between the performance of the models in the sample and out of sample, then I don't produce a robust model. Either you don't understand, or you've never done it.

I'm saying that if you fit predictors, or model parameters so that the model will work well everywhere, it's just a FINE thing to do. The model will be overfitted, even if it is protected from overfitting.

I remembered - it's already been discussed, but sorry, I forgot.

It seems to me that you are making too rigid demands, and at the expense of making the tool more complex, and a simpler tool is always preferable to a complex one.

I use the following scheme:

1. I formulate the target variable

2. I invent a set of predictors that intuitively relate to my target variable.

3. Using my algorithm, I sift out those predictors that I attribute to noise for formal reasons. Usually 15-20% of the initial number I made up remains.

4. Generate a large file of at least 10000 bars

5. I divide this file into two parts: 7000 и 3000

6. At 7000 I teach the model, test and validate

7. If all three numbers are about the same, then I go back to step 8.

8. The trained model is used in practice. But I select predictors by one of the algorithms (I use rfe) in the current window. I do this selection on outputs for H1. Rfe from the set I learned the model on, selects from 5 or more predictors for the current window. The list of predictors changes all the time, but it is selected from the set I got during the initial training.

This whole scheme has been working robustly since last fall on the real. But there is one important note: this is only part of the Expert Advisor. Previously my EAs on TA did not live more than half a year. Now I do not see this problem.

 
mytarmailS:

I also have a similar version of how to smooth it out, I voiced it about 100 pages ago, but it's on a more abstract level...

We do not know how to trade, where to enter, where to exit.

That's why everything we invented (trends, zz, candlestick colors, rebounds) is just nonsense in an attempt to describe market movements, subjectivism as it is

Everyone has chosen his own direction and everyone digs in it - some use candlestick colors, some use zz, I personally use zz rebounds, etc. This is all very subjective and that is what separates us, although in essence we all do the same thing and the result is the same - those no...

I propose to take something that unites us all and will not be subjective, namely the target in the form of - we can say the desire

"I want the algorithm to earn min. 5% a week with a max drawdown. 2%"

normal target? everyone likes and fits, right? and everything is clear...

You seem to misunderstand me. I don't tell the net where to enter, not with the zzz or any other indicator. A trained net chooses where to enter.
Reason: