After this test, I may one-hot encode some of the features, and try again.
y =
0: R0 = 56.2733
1: R1 = 0.106131 * x
2: R0 = R0 + R1
3: R1 = x * x
4: R1 = 0.000229828 * R1
5: R0 = R0 + R1
6: R2 = 0.000227567 * x
7: R1 = cosh (R2)
8: R1 = R2 * R1
9: R0 = R0 + R1
10: R1 = 0.0315204 * x
11: R1 = asinh (R1)
12: R2 = -0.9609
13: R2 = sign (R2)
14: R1 = R2 * R1
15: R0 = R0 + R1
16: R1 = 0.371744 * x
17: R1 = R1 + 0.602163
18: R1 = cos (R1)
19: R1 = 0.716786 * R1
20: R0 = R0 + R1
21: R1 = 0.102066 * x
22: R1 = R1 + 0.0979074
23: R1 = cos (R1)
24: R1 = 0.825596 * R1
25: R0 = R0 + R1
26: R1 = 0.215541 * x
27: R1 = R1 + 4.59353
28: R1 = cos (R1)
29: R1 = 1.10603 * R1
30: R0 = R0 + R1
return R0
That looks very promising! Especially how the models converged to correlated outputs!That sounded like a good idea to me.
So, I tried some more experimenting with generated code by starting with a template of partial instructions and genetically optimizing the missing parts. Using the same input data in this post, I ran this 10 times where the only difference between any two runs was the sequence of pseudorandom numbers.
The result of the fits and 14-bar future predictions for the 10 models is
View attachment 257708
All 10 models follow the input prices (+ signs) about the same, and the predictions all have the similar shapes and seem ok with predicting short-term turning points for this input data.
A sample generated model is
The code is similar to the other code in this post except it uses the input data (offset in bars from the starting point of the input data) as operands to instructions (x in the code) instead of using initialized values of registers.Code:y = 0: R0 = 56.2733 1: R1 = 0.106131 * x 2: R0 = R0 + R1 3: R1 = x * x 4: R1 = 0.000229828 * R1 5: R0 = R0 + R1 6: R2 = 0.000227567 * x 7: R1 = cosh (R2) 8: R1 = R2 * R1 9: R0 = R0 + R1 10: R1 = 0.0315204 * x 11: R1 = asinh (R1) 12: R2 = -0.9609 13: R2 = sign (R2) 14: R1 = R2 * R1 15: R0 = R0 + R1 16: R1 = 0.371744 * x 17: R1 = R1 + 0.602163 18: R1 = cos (R1) 19: R1 = 0.716786 * R1 20: R0 = R0 + R1 21: R1 = 0.102066 * x 22: R1 = R1 + 0.0979074 23: R1 = cos (R1) 24: R1 = 0.825596 * R1 25: R0 = R0 + R1 26: R1 = 0.215541 * x 27: R1 = R1 + 4.59353 28: R1 = cos (R1) 29: R1 = 1.10603 * R1 30: R0 = R0 + R1 return R0
The fit for this model plus a parabolic, least-squares trend of the fitted curve is.
View attachment 257709
The prices and fitted curve with a parabolic, least-squares trend of the fitted curve subtracted (shows cyclic turning points) are:
View attachment 257710
If you don't mind telling, what's your reasoning behind using about 89 bar sliding window? Result of backtests?That sounded like a good idea to me.
So, I tried some more experimenting with generated code by starting with a template of partial instructions and genetically optimizing the missing parts. Using the same input data in this post, I ran this 10 times where the only difference between any two runs was the sequence of pseudorandom numbers.
The result of the fits and 14-bar future predictions for the 10 models is
View attachment 257708
All 10 models follow the input prices (+ signs) about the same, and the predictions all have the similar shapes and seem ok with predicting short-term turning points for this input data.
A sample generated model is
The code is similar to the other code in this post except it uses the input data (offset in bars from the starting point of the input data) as operands to instructions (x in the code) instead of using initialized values of registers.Code:y = 0: R0 = 56.2733 1: R1 = 0.106131 * x 2: R0 = R0 + R1 3: R1 = x * x 4: R1 = 0.000229828 * R1 5: R0 = R0 + R1 6: R2 = 0.000227567 * x 7: R1 = cosh (R2) 8: R1 = R2 * R1 9: R0 = R0 + R1 10: R1 = 0.0315204 * x 11: R1 = asinh (R1) 12: R2 = -0.9609 13: R2 = sign (R2) 14: R1 = R2 * R1 15: R0 = R0 + R1 16: R1 = 0.371744 * x 17: R1 = R1 + 0.602163 18: R1 = cos (R1) 19: R1 = 0.716786 * R1 20: R0 = R0 + R1 21: R1 = 0.102066 * x 22: R1 = R1 + 0.0979074 23: R1 = cos (R1) 24: R1 = 0.825596 * R1 25: R0 = R0 + R1 26: R1 = 0.215541 * x 27: R1 = R1 + 4.59353 28: R1 = cos (R1) 29: R1 = 1.10603 * R1 30: R0 = R0 + R1 return R0
The fit for this model plus a parabolic, least-squares trend of the fitted curve is.
View attachment 257709
The prices and fitted curve with a parabolic, least-squares trend of the fitted curve subtracted (shows cyclic turning points) are:
View attachment 257710
If you don't mind telling, what's your reasoning behind using about 89 bar sliding window? Result of backtests?
perl -e '
use warnings;
use strict;
my $v1 = 28.745; my $v2 = -103.02;
for (my $i = 3; $i < 70; ++$i)
{
my $vn = $v1 + $v2;
my $ratio = $vn / $v2;
print "$i $ratio\n";
$v1 = $v2; $v2 = $vn;
}
' | tail
This relationship implies that the maximum time rate of change of each spectral
element in the coarse structure is identical to that of every other line in the
spectrum—and that this delicate balance is maintained over many calendar years by a
precise and particular relationship between amplitude and frequency!
If you are referring to me, I don't use this. I was/am curious about what @ph1l posted, and ran a couple of non-rigorous experiments myself.Thanks for the interesting study. However the prediction error still seems too large to be useful in the trading strategies that I can think of.
Thanks for the interesting study. However the prediction error still seems too large to be useful in the trading strategies that I can think of.