Machine learning in trading: theory, models, practice and algo-trading - page 2642
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
What's up?
that's the kind of sign I got. Correlate because the base is increments of close orders of magnitude
example formula: price - MA(n) * std(n) * coef, where MA and std - moving average and standard deviation of arbitrary order and levelling coefficient, the larger - the more stationary the series. In this case, it's 50000.
for some reason my MO shows stability better than just on increments
with coef 20.
It turns out to be something similar to fractional difference, but it counts instantly.
Maybe someone can think of other options
that's the kind of sign I got. Correlated, because the base is increments of close orders of magnitude
What are these curves in general?
Maxim Dmitrievsky #:
maybe someone will come up with other options
Here we go, symbolic regression to the rescue
What's with the curveballs anyway?
Well, symbolic regression to the rescue.
The formula is written
I'll throw something up, I'll show you a simpler example without SR.
I'll just throw something together and show you a simpler example without SR.
With SR it takes more time to code and plan, so for simplicity, speed and clarity I made it simple...
Instead of creating a formula in real time, I create a "formula result" - a curve and then use it as a target for the model.
I create a fitness function that maximises the correlation between the price and the model output, but the model output has a limitation: it can only be between -1 and 1.
That is, we get a series that should correlate with the price, but "clamped" within the limits of statsionary values. If you need real statsionarity according to Dickie Fuller and so on, you just change the fitness function to what you need.
create data and train the model with genetics
test the model.
The vertical lines are separation of train, test, validation.
As you can see in the picture, the model has learnt to take the price as input, and the output is a statistical series that correlates with the price.
For better clarity we can make a cumulative sum of the model output.
like this )))) And you don't need to invent anything, everything can be done automatically.
With SR you need more time for code and planning, so for simplicity, speed and clarity I made it simpler.
Instead of creating a formula in real time, I create a "formula result" - a curve, and then use it as a target for the model.
I create a fitness function that maximises the correlation between price and model output, but the model output has a limitation: it can only be between -1 and 1.
That is, we get a series that should correlate with the price, but "clamped" within the limits of statsionary values. If we need the real statsionarity according to Dickie Fuller and so on, we simply change the fitness function to what we need.
create data and train the model with genetics
validate the model
Vertical lines are separation of train, test, validation.
As you can see in the picture, the model has learnt to take the price as input, and the output is a statsyonary series that correlates with the price
For better clarity we can make a cumulative sum from the model output
like this )))) And you don't have to think of anything, everything can be done on the machine
Interesting, I'll try to think about it later, we're having a bloody mary today, it's hard to think.
I wonder how many lines it would take in python.....
probably thousands in µl))))))))))))))))))))))))))))
I wonder how many lines it would take in python.....
in µl, probably thousands))))