Synthetic time series generation





Artificial neural networks rely heavily on large sets of data to train their models. However, with the constantly evolving data privacy regulations around the world, obtaining high-quality data becomes increasingly challenging, mainly due to security or privacy reasons. Read more and find out how to generate synthetic time series for you machine learning models.
Synthetic time series generator

Continue reading “Synthetic time series generation”

Testing a web application with pytest in two simple examples





Flask application testing is usually associated with web frameworks which automate the tests performed across different web browsers, e.g. Selenium. However, not always there is a need to use such a complex tool and quite often most of the web application can be tested with the popular and universal pytest framework.

Testing web applications with pytest

Continue reading “Testing a web application with pytest in two simple examples”

LSTM for stock prices forecasting

You probably read stories about artificial neural networks which predict stock prices. Some of them are even published as scientific papers. These algorithms were supposed to make their owners rich. Supposedly, it was enough to construct the network, feed it with stock prices, and get prices for the next hour, day or even a week. Is there any truth in such stories?

Recurrent ANN

Continue reading “LSTM for stock prices forecasting”

ARMA for market prediction – does it work?





ARMA process predicts the future taking into account past values and errors. When making predictions, we often reach the past to find a pattern which can repeat itself in the future. Such patterns may have roots in seasons, days (business days and weekends), or time of day (day and night). However, rarely does same pattern happen multiple times. Unexpected events related to politics, the economy and daily life in general, disrupt any ready-to-use templates. Therefore, we need models like ARMA that simultaneously use past data as a template for estimates and can also include unpredictable events distorting this template.
ARMA process

Continue reading “ARMA for market prediction – does it work?”

Web-gui for Python logs





Logging can help you better understand the flow of a program and discover undesirable behaviour, which you might not even consider while developing. Logs give you information about scenarios that an application is going through. You can label this information according to its importance: debug, info, warning and errors. Logs can provide more insights than a stack trace by telling you what the program state was before it arrived at the line of code where the error occurred.

Logs browser in Flask
Logs browser in Flask

Continue reading “Web-gui for Python logs”

Save on taxes understating FIFO or LIFO

FIFO and LIFO are two popular methods for the computation of capital gains. Understanding the differences between them allows you to save on taxes. How much money? Even up to 25% of your capital gains if you live in a country with such high taxes. Usually, the savings are less than this, but still can be a significant amount. How can I do this? By applying the so-called optimisation of your portfolio, which will allow you to reduce tax or prolong its payment. But, to optimise, you need to understand how your broker calculates your capital gains.

Savings
Continue reading “Save on taxes understating FIFO or LIFO”

Calculating capital gains using FIFO queue

According to the first-in-first-out (FIFO) valuation method of capital gain, it’s assumed that equities are sold in the order in which they’re bought. In other words, the oldest shares are sold first. A detailed description of this method can be found in many places, e.g. here. In this post, I will focus on the implementation of the FIFO method in Python.

Fifo queue
Continue reading “Calculating capital gains using FIFO queue”

RSI stock screener





Stock screeners are effective filters when you have a specific idea of the kinds of companies in which you are looking to invest. There are tens of thousands of stocks listed on world exchanges, so it’s time-consuming to browse them manually. Most available on the Internet screeners offer a decent set of rules and filters. They have a database of equity prices updated regularly. However, the rules and filters are usually predefined, and there is a limited possibility to extend them with more elaborate ideas. Secondly, the equity database focuses on the most popular markets, e.g. US and West Europe stocks, and does not cover more exotic and emerging markets, e.g. Eastern Europe. Using the same rules and applying them to the same markets as everybody else do, will give only average results. Focusing, in turn on markets that are less screened by bots and algorithms (Polish, Hungarian) can give a head-to-head advantage in the pursuit of good returns. So let’s create a custom tool screening the Polish market.


Continue reading “RSI stock screener”