The tutorial series is based on Anaconda distribution. You have the flexibility to use the different python versions in different environments so you could test. When I start to use a tutorial, which is not mine, I do exactly what the owner does. Then when I am familiar with it, I usually make a lot of changes to be comfortable and adapt it to my programming philosophy.

On the other hand, Tensorflow is very dependent on the python version, even its versions. That’s why I use an old (but robust) version of Tensorflow here (for more information, see post: https://todotrader.com/build-tensorflow-from-source-in-centos-7/). I do not think you could use Tensorflow 1.5 with python 3.7 easily, but just try! ]]>

In the beggining, right in the environment.yml file it tels that the project structure is setted for python 3.5, but can I use it with python 3.7?

Thanks in advance đź™‚ ]]>

I include the four â€śOHLCâ€ť data at the time â€śtâ€ť in order to calculate â€śCâ€ť at time â€śt+1â€ť. But it is just an exercise. To be rigorous we should test the features we want to use again results.

Caution! you are approaching the problem of how to Identify the Most Important Independent Variables and determining which variable is the most relevant usually is more complicated than it first appears. There are a full variety of techniques which trying to answer this question. For example, some techniques calculate how R-squared increases when we add each variable to a model that already contains all of the other variables. R-squared is the percentage of the response variable variation that is explained by a â€ślinear model.â€ť So if you have time you could test to identify the independent variable that produces the largest R-squared increase when it is the last variable added to the model. That is, you can calculate the sensibility of the model to the feature â€śClose Priceâ€ť. It is not trivial.

I have copied the code and executed it in different days, and althought graph is similar, my “mean_relative_error” and “absolute_error” of the last prediction are different (0.06316668866630704 and -0.00029683744531624405 respectively).

Is it normal or I did anything wrong and results should match exactly with the ones in this page?

(No se como adjuntar el grafico)

Saludos.

]]>una duda conceptual.

Why to include the “close price” in the features? I was thinking, ok, with the 3 input values we should be able to predict the 4th one, but not to use it as well as input at the begining.

Would it work removing it from the features (adapting the code, of course)?

It is something I plan test once I have fully undertood the full code.

Anyway, if you have a theorical reason for that it will help me to avoid mistakes in my future models đź™‚

Gracias.

Saludos.

]]>Yes you are right, it is because I test several combinations before posting, and then select what seems better, but sometimes, there are no great differences. And this is the case, so it does not matter which one to use. This kind of details will be very relevant when we use big networks or big data.

De nada,

Saludos

]]>Gracias por tus comentarios. Veo que hablas muy bien espaĂ±ol.

I want to answer precisely all of your questions. However, I have to tell you that these exercises are just toys examples. Why? Because the purpose of the series is to serve as templates to place orders in our broker. And I want to do that as soon as possible. Once we have constructed a sound framework, then we can make all kind of changes in parameters, configuration, type of neural network, and so. So I only have used some unusual simple settings and arrangements which work, that’s all. All your questions are difficult to answer now, but we will explore all of them shortly.

]]>I have reviewed quickly the post and first doubt caming into my mind is:

Why in this case for optimization you have used “AdamOptimizer” (optimizer = tf.train.AdamOptimizer().minimize) instead of the one used in the previous post: GradientDescentOptimizer (optimizer = tf.train.GradientDescentOptimizer().minimize)??

Gracias otra vez por este gran blog.

Saludos.

]]>felicidades por el blog y especialmente por esta serie de artĂculos sobre Tensorflow.

I am very interested on applying AI to trading and your blog is exactly what I was looking for. Until now, I have followed it reproducing what you have done. However I have a ton of doubts, specially in this last one.

1) My first questions is about number or neurons and layers. You have decide 3 hidden layers 5, 15, 5 neurons. But what would be the criteria to decide how many layers /neurons per layers fit the best to our problem? Number of combinations are almost infinite. How to decide if it is better more neurons or more layers?

2) In ML there are other type of algoritms (Polinomic regression, KNN, etc) how to know if for our problem (trading) NN is better than the others?

3) Why transformation and normalization are needed? Are we assuming that all input variables will have a gaussian distribution by doing this? if so, could it impact negatively in the final model? As we are applying the linear / non-linear steps to each attribute, the NN should deduce the right parameters even without normalizing the input variables.

4) why in each “epoch” you chose a subset of the data and not to run each one with the full training data? How the size of the “batch” could impact in the final result?

Gracias por compartir este conocimiento y hacerlo accesible a mas gente.

Saludos.

]]>