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

 

I am far from being a pro in MO, so I would like to know how to solve a problem.

As you know, to convert temperature from Fahrenheit to Celsius the standard formula is used: C = (F-32)*5/9

Gradient bousting shows excellent results in-sample, but outside the sample the error increases immediately.

why? because the formula is very simple. what can we say about a complex relationship on the currency market?)

how to make this algorithm show good results on OOS?

 
Evgeni Gavrilovi Gradient bousting shows excellent results in-sample, but beyond that the error increases immediately.

why? because the formula is very simple. what can we say about the complex relationship on the currency market?)

how to make this algorithm show good results on OOS?

You need to normalise all the data into a range, or take the OOS from the same range of values

Outside of it the extreme value of the range will be predicted, this is how forest and bousting and OOS partially works.
 
I've always wondered why weights are adjusted in the strategy tester? It's fitting...

Wouldn't the best solution be to optimise the number of neurons, layers and types of functions (some in the first, others in the last) of activation in the strategy tester? And use back propagation of error as a change of weights?

I decided to test the idea. Single-layer network (I don't know how to expand the number of layers), tangent function (I don't know how to change it) at neurons, no function at the output (I don't know how to put it). Backward propagation of the error. training period: year - 2021/08/01-2022/08/01

Optimisation consisted in selecting the following parameters:

- number of input data (loop sent to the input the requested number of closing price differences N0-N1, you can do other things, but the hands did not reach) - from 1 to 999 (the array variable did not allow to do more), step 1.
- number of neurons - from 1 to 99 999 (don't laugh), step 1.
- number of sets (Bar++[number of input data]) - 9 999, step 1. Since training was performed on an hour chart, there are 6500 bars in a year. The result is almost up to a year and a half , I think it is ok.
- learning factor on the output : from 0 to 1 in steps of 0.00001.
- learning factor on the input : from 0 to 1 in steps of 0.00001
- number of epochs - from 1 to 1000, step 1.


So, I'll tell you right away about the number of epochs - I didn't manage to change anything, either 1 epoch or 1000, I didn't notice much difference, probably there are some errors.

BUT! Interesting observations:

- the greater the number of neurons, the more trades (almost every candle, if they are predicted in different directions)
- the learning rate on the input in the first 10 best results is most often close to 0.7
- the learning rate on the output in the first 10 best results is most often close to 0.07
- the best results show the formula: the number of input data < the number of neurons < the number of sets. The best result (as far as I had the patience to wait) was something like this: about 200 input data, about 300 neurons and about 400 sets. Why the best result? Because on the backtest - undulating smooth growth, on the forward 2 months - undulating smooth growth and.... on the period before the backtest of about 2 months - wavy smooth growth .

For the sake of interest 99 999 neurons - 50/50, but, naturally - the highest profit - or the highest drawdown
. At the same time, the number of inputs made no more than 100, the number of sets - no more than 100. It's a long time to wait. But, it is not known what the results would show with 1000 inputs and 1000 sets, or 10 000.
 
Evgeni Gavrilovi Gradient bousting shows excellent results in-sample, but beyond that the error increases immediately.

why? because the formula is very simple. what can we say about the complex relationship on the currency market?)

how to make this algorithm show good results on OOS?

You have to learn AMO on a traine sample, and you have to choose a model on a test sample....
Google crossvalidation
 
СанСаныч Фоменко #:

Only R

Then there is a probability of an error in the code, you need to make tests either with real quotes or simulate....

I had it recently, the sign looked at +1 bar, it was not an obvious error at all, it took half an hour to sort out....
 
Ivan Butko strategy tester? This is fitting...

Isn't it the best way out.....
The first and second is fitting, aka searching for unknown parameters, aka optimising.
And it doesn't matter what you're fitting, weights, number of neurons. Neurons, FUN. Activation, number of apples in the basket.
 
mytarmailS #:
Both the first and the second are fitting, aka searching for unknown parameters, aka optimisation.
And it doesn't matter what you're fitting, weights, number of neurons. Neurons, FUN. Activation, number of apples in the basket.

That's a sad thing to say. I don't know what to do about it.

The basic options, where else to look...
 
Ivan Butko #:

That's a sad thing to say. I don't know what to do about it.

That's the main options, where else to look...
Sarcasm?
 
mytarmailS #:
Sarcasm?

No, not at all. I just don't know what else to do. Trying to use neural networks from the market... I don't think there's any prospects there either.

 
Ivan Butko #:

No, not at all. I just don't know what else to do. Trying to use neural networks from the market... I don't think there's any prospects there either.

Market is definitely not...

Read a clever book about MO, if you're good with mathematics... it will be x1000 times more useful than reading this thread....