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

 
mytarmailS:

roughly speaking yes, here is the article where the basis of everythinghttp://gekkoquant.com/2014/09/07/hidden-markov-models-examples-in-r-part-3-of-4/ was taken from.

And here is a code snippet from the example in the article.

If you take away the data processing and visualization, yes, the code is three lines long.

well, here's where e.g. bulmarket and beermarket and bulmarket, where to get them from, i.e. we need some data preprocessing at first

and then comes the calculation of the path through the Viterbi and forward-backward, also 2 different algorithms. I don't get it, I'll read it.

in python it looks like this, in lib hmmlearrn

>>> import numpy as np
>>> from hmmlearn import hmm
>>> np.random.seed(42)
>>>
>>> model = hmm.GaussianHMM(n_components=3, covariance_type="full")
>>> model.startprob_ = np.array([0.6, 0.3, 0.1])
>>> model.transmat_ = np.array([[0.7, 0.2, 0.1],
...                             [0.3, 0.5, 0.2],
...                             [0.3, 0.3, 0.4]])
>>> model.means_ = np.array([[0.0, 0.0], [3.0, -3.0], [5.0, 10.0]])
>>> model.covars_ = np.tile(np.identity(2), (3, 1, 1))
>>> X, Z = model.sample(100)
 

I'm currently working on Evolving Neural Networks through Augmenting Topologies according to the article http://gekkoquant.com/2016/10/23/evolving-neural-networks-through-augmenting-topologies-part-4-of-4-trading-strategy.

I haven't managed to remotely install RNeat package via devtools, I used its alternative - remotes (remotes::install_github). The script for MT4 is almost ready. I excluded complex preprocessing transformations, I will try to use raw data first. I have added possibility to work with any number of predictors. I will write to you if something interesting appears.

I am adding an example of R-script for forex data. The analyzed symbol is USDJPY-H1. Initial data - last known price and 10 RSI lags.
Evolving Neural Networks through Augmenting Topologies – Part 4 of 4 – Trading Strategy
Evolving Neural Networks through Augmenting Topologies – Part 4 of 4 – Trading Strategy
  • 2016.10.23
  • GekkoQuant
  • gekkoquant.com
This post explores applying NEAT to trading the S&P. The learned strategy significantly out performs buying and holding both in and out of sample. A key part of any machine learning problem is defining the features and ensuring that they’re normalised in some fashion. The features will be rolling percentiles of the following economic data, a...
 
Ilya Antipin:

I would very much like to see how RNeat works on my indicator

 
mytarmailS:

Using well-known indicators and even with a fixed period is a rotten idea, no algorithm will not find any patterns there because they simply do not exist, the market has a dynamic, fractal (mutually enclosed structure), we need an indicator that is at least a little bit adequate market, which at least a little bit, even indirectly, takes into account the fractal

I agree. I got good results with the ZigZag indicator. I feed the prices of recent extrema or derivatives thereof including the unfinished price of the last extremum. The indicator is calculated for each instance from the training set, that is, a variant without re-drawing is obtained. This is the only indicator that has shown more or less satisfactory results, which can be traded.
 
Ilya Antipin:
I agree. I got good results with the ZigZag indicator. I feed the prices of the last extrema or derivatives thereof including the unfinished price of the last extremum. The indicator is calculated for each instance from the training set, that is, a variant without re-drawing is obtained. This is the only indicator that has shown more or less satisfactory results, which can be traded.

If I understood correctly, I also did almost the same thing, but with a different algorithm, I predicted not the direction but the knee of turn, I wrote here how I processed the pricehttps://www.mql5.com/ru/forum/86386/page1476

Машинное обучение в трейдинге: теория и практика (торговля и не только)
Машинное обучение в трейдинге: теория и практика (торговля и не только)
  • 2019.05.16
  • www.mql5.com
Добрый день всем, Знаю, что есть на форуме энтузиасты machine learning и статистики...
 
First impressions about the research on the RNeat package. First, it takes a very long time to calculate the model, it requires a lot of computing power of the computer. Second, when you feed the target it does not get a perfect result. It seems to have a peculiar learning mechanism, which does not directly assess the importance of predictors.
 
Ilya Antipin:
when you input the target it does not get a perfect result

It's not quite clear... Can you be more specific?


p.s. And what was the target? I looked at the code, but I do not understand, maximizing profits?

 
mytarmailS:

If I understood correctly, I also did almost the same thing, only with a different algorithm, predicted not the direction but the knee of a turn, here wrote how to process the pricehttps://www.mql5.com/ru/forum/86386/page1476

I can give the market explanation of this effect. At the reversal points of the market (change of trend) there is a change in the balance of supply and demand associated with the manifestation of stronger (fundamental) pricing factors. Perhaps the mathematical relationship between different past such points may contain valuable information for technical forecasting of future points.
 
Ilya Antipin:
I can give a market explanation of this effect. At the turning points of the market there is a change in the balance of supply and demand associated with the manifestation of stronger (fundamental) pricing factors. Perhaps, the mathematical relationship between different past points may contain valuable information for technical forecasting of future points.

It seems to me that everything is even simpler... If we leave only significant extrema of the price and throw out everything else, plus we do not predict the direction, but just the trace of the extremum, it does not clean the data from a lot of noise and reduces the degree of freedom for the neural network, for which it is grateful

 
mytarmailS:

It seems to me that everything is even simpler... If we leave only significant extrema of the price and throw out everything else, plus we do not predict the direction, but just the trace of the extremum, it does not clean the data from a lot of noise and reduces the degree of freedom for the neural network, for which it is grateful

Yes. Undoubtedly, by using significant extrema we reduce the dimensionality of the data and this in turn will have a positive impact on the learning results.
Reason: