Neural networks and trading. Part 3: predicting the cue ball 1 hour ahead

The  last article  was an attempt to show the whole process of training, selection and testing of models on the EUR / USD trading pair. In Google Colab, the scheme worked:  train models-> test-> draw on a graph . The attempt was unsuccessful. The desire not to drag a ton of code into Colab, but to simplify everything as much as possible led to a very low quality of training. The signals looked unconvincing and clumped together in obvious places.





Since then, a lot of water has flowed under the bridge, and research has continued. I'll tell you about this + another Colab, this time easier and clearer.





Moving on

As a result of the previous stage of development, the neural network still began to predict something. A more or less adequate forecast appeared on the charts, similar in quality to the average indicator. There is little practical sense, but enough to further engage in this area. The main disadvantages were poor prediction quality and grouping of signals in obvious places.





In the last article, this was discussed in detail, but here I will just remind you that the neural network answers the question of where the price will go "up" or "down" and does not answer the question of how strong the movement will be. The answer is binary: 1 - up, 0 - down. Those. if after the poll the answer returned [0.8, 0.2] it means "will go up", and [0.4, 0.6] "will probably go down, but this is not accurate". The difference within these binary responses characterizes the degree of confidence of the network, +0.6 in the first case and -0.2 in the second. The more this difference tends to 1 (or -1), the higher the forecast quality.





The "degree of confidence" at which a response can be considered a signal is individual for each model and is determined by running it on test data. Moreover, this threshold is different for up and down signals. The models that will be loaded into the collab have the name of a file like BTCUSD_M6_0.66_0.75.h5

The last two values โ€‹โ€‹are these limits. Before interrogating the model, the trigger values โ€‹โ€‹are taken out of its name and compared with its response.





, , . ,  " ? !", , . , "" . , .





, . , , , . , "" ( ). , .





, . . - TradingView, , " " ... . , JavaScript + Vue + NodeJS . ,  , , BTC/USD 5m .





Google Colab

:





  1. /









  2. BTC/USD , , ( ).





  3. , , , 1 .





" -..."  . " + . ? ".





"". , 6, .. 6 , 3000 . 10%, 100%. . .





Google Colab   . Google ( Gmail).





ยซยป .







Warning: This notebook was not authored by Google

, , .





Now you need to sequentially run the blocks from top to bottom ...

That's all.





PS Do not try to make money on the real market, 97% of beginners lose their deposit. The purpose of the study is to solve an interesting problem.








All Articles