-
Notifications
You must be signed in to change notification settings - Fork 29
User guide
Volatiles estimates stock trends, predict short-term future prices, then ranks, rates, quantifies growth and finds highly correlated pairs of stocks. All you need to do to run Volatile is to open your terminal and type
python volatile.py
Volatile will automatically analyse the list of stock symbols saved in symbols_list.txt
. This should neither be considered to be a privileged nor a complete list of stocks; feel free to update it as you please (do not worry if by chance you enter a symbol twice). Mind that it can take a while to access information of stock symbols that are either not in the list or that you pass for the first time. For this reason, relevant stock information is stored in stock_info.csv
and will be fast to access from the second time onwards.
When the run is complete, a prediction table like the following will appear printed on your shell:
For each symbol, the table tells you its sector and industry, then the last available adjusted closing price, a rate, a current percentage trend growth and the strongest match.
Possible rates are HIGHLY ABOVE TREND, ABOVE TREND, ALONG TREND, BELOW TREND and HIGHLY BELOW TREND. They are derived from a score metric that compares the predicted price in 5 trading days (usually this corresponds to the price in one week) to the last available observed price, scaling by the standard deviation of the prediction (see the technical section below for more details).
The current percentage trend growth is a real number (positive or negative) corresponding to how fast the trend is currently going up or down (again, see the technical section). This is a particularly interesting measure for stocks ALONG TREND, whose price evolution can be sensibly approximated by their trends.
The match indicates the stock that, along the last year, was most strongly correlated with the one considered. This is particularly useful to formulate pair trading strategies. See the technical section for details.
By default, symbols appear in the table ranked from the furthest below to the furthest above their respective trends; alternatively, you can rank according to growth indicator or volatility, from largest to smallest, by respectively adding the following flags to the command above: --rank growth
and --rank volatility
. The prediction table can be saved in the current directory as prediction_table.csv
using the flag --save-table
.
In the current directory, several estimation plots will appear. stock_estimation.png
is a visualisation of stock prices and their estimations over the last year, together with a notion of uncertainty and daily trading volume. By default, only stocks rated either above or below their trends will be plotted, ranked as in the prediction table. If, instead, you have used the flag --rank growth
, only the top growing 100 stocks ALONG TREND will be plotted, accordingly ranked.
Notice how the estimation crucially attempts to reproduce the trend of a stock but not to learn its noise. The uncertainty, on the other hand, depends on the stock volatility; the smaller the volatility, the more confident we are about our estimates, the more a sudden shift from the trend will be regarded as significant. You can use this plot as a sanity check that the estimation procedure agrees with your intuition. Make sure to glance at it before any transaction.
market_estimation.png
, sector_estimation.png
and industry_estimation.png
are plots that help you quickly visualizing aggregate performances. Given the hierarchical relation of market, sectors, industries and stocks, estimates at each level of the hierarchy should be thought as average estimates of their sub-levels. In the plots, sectors and industries are ranked in alphabetical order.
matches_estimation.png
shows the 99 most strongly correlated pairs of stocks. This is an interesting one to look at to discover unexpected correlations and enter pair trading strategies.
If you do not want plots to be saved in the current directory, you can disable them by adding the flag --no-plots
.
If you have already run Volatile before, data will be saved in the current directory as a pickle file data.pickle
. If you want to run Volatile a second time and load data rather than downloading it again, you can do so by using the flag --cache
.