In this thesis, we trained different machine learning models the trading strategies with the help of the historical data of BAC shares, the exchange rate of BTC-USD and the technical analysis of trading. The data from the technical analysis were obtained by using different indicators. We marked the data according to the strategy based on the mean reversion. The strategy can be changed with the help of parameters and thus exploiting the fluctuations of the local extremes in different lengths of the time window. We are mindful of the fact that the strategy should be profitable in various trends (the rising, the decreasing, and the lateral). We described in detail the methods used, i.e. the models of supervised machine learning. The strategies were tested on aforementioned real data and the results were analysed. A good strategy that is profitable, both in rising and decreasing trends, was only achieved by one of the models. That is a random forest with 10 trees.