Using App::financeta
Starting the Application
We hope that you have successfully installed the application as outlined here. If you have installed it from CPAN, you need to start the application like this on Linux or BSD or Mac OS X or Cygwin:
$ financeta
If you’re using Strawberry Perl on Windows, you will need to run it like this:
> financeta.bat
If you have installed the software from Github, you are running it in developer mode and you should be running it like this:
$ perl -Mblib ./bin/financeta
Please refer to the install page for more details on installing the application from Github and CPAN.
On Linux and other Unix variants, you need X-server running to view the GUI. On Mac OS X, if you have installed Gnuplot, you will already have X-server installed and the application should automatically start it up.
Commandline options
The following commandline options are supported:
--debug
This turns on debugging on the console and can be used to send us any logs of error messages or warnings if the application is not doing what you think it should be doing.
Selecting a Security
When we refer to the word security, we mean a company stock. However, as time progresses and if data is freely available, we will be adding options and futures to the mix as well. Hence security is a term that groups all of these under one.
Using the menu option ‘Security’ followed by ‘New’ as shown in the image below, start the ‘Security Wizard’ dialog. Enter a valid stock symbol such as ‘MSFT’ in the ‘Enter Security Symbol’ text box, select the start and end dates for which you want data for (by default this is set to one year back from today) and hit the ‘OK’ button.
If you do not know which symbol you need to enter you can hit the ‘Symbol Search’ button and it will start your default web browser and visit Yahoo! Finance for you to perform the search there. Since they already provide an exhaustive database of symbols and information on symbols, their service is complementary to App::financeta. We do not feel the need to duplicate their efforts.
You will see a new tab opens with the name of the symbol you entered, which is ‘MSFT’ in this case and all the stock data listed in tabular form. You will also see a plot drawn in Gnuplot in a separate window that is started up and controlled by the application.
The data downloaded is saved in $TMPDIR
on Linux or BSD or Mac OSX and $TEMP
or $TMP
on Windows. If $TMPDIR
is not
set, then /tmp/
is used. The data is stored in a CSV file and if the same date
range is used by the user, the data is downloaded only once. If the user wants
to force the download of the data, they can select the ‘Force download’ option
in the ‘Security Wizard’.
The steps are outlined as follows:
- Select ‘New’ from the ‘Security’ menu option
- Enter a valid stock symbol and date range in the ‘Security Wizard’ such as ‘MSFT’
- Alternatively, hit the ‘Load from CSV’ button and load an existing CSV file that is in the Date-Open-High-Low-Close-Volume format. If this file is given, the data will be used from this file and will not be downloaded. This is useful if the users want to use their own data for securities that may not be available for download from Yahoo! Finance.
NOTE: The date in the CSV file has to be in the Unix time format.
- View the retrieved data in a tab titled ‘MSFT’ or the symbol you have chosen
- View the open-high-low-close (OHLC) bar plot in Gnuplot that has been started by App::financeta
- More securities can be added in the same way by following the above steps.
Let us look at the various plot types that the application provides.
Selecting a Plot
Various types of plots are provided to the user as part of this application. Using the ‘Plot’ menu option, the user can select any type of plot and the Gnuplot window will automatically display that plot type.
The current supported plot types are as follows:
- OHLC: This is the default plot type. It displays the Open-High-Low-Close data with the price being on the Y-axis and the date on the X-axis. This is a standard finance plot used in the industry.
- OHLC & Volume: This plot type shows two plots in one window. The top plot is the OHLC plot as described above, and the bottom plot shows Volume in units of 1 million stocks on the Y-axis. There are some Volume based indicators where this kind of plot can be very useful.
- Close Price: This plot type plots the Close price of the stock as a line graph with the Y-axis being the price and the X-axis being the date. This is useful when you want to use indicators that prefer using a single price stream such as Moving Average indicators.
- Close Price & Volume: This plot type is similar to the Close price plot type above and also has a sub-plot of Volume in units of 1 million stocks on the Y-axis.
- Candlesticks: Some researchers like to use Candlestick charts to understand how stock trades move, and for them we have the candlestick plot feature. There are about 61 candlestick indicators that ta-lib supports and hence this plot is essential to App::financeta.
- Candlesticks & Volume: This plot is useful if the user wants to do analysis with both Candlesticks and Volume indicators. The Volume is plotted in units of 1 million stocks as a sub-plot.
Now it is time to select an indicator to add to the plot.
Selecting an Indicator
To perform analysis on the security selected above, we need to try out some indicators. Various types of indicators are available to the user and details about each of them are provided in the chapter titled Indicators. We have counted about 132 indicators that we provide as part of App::financeta that are available from ta-lib. However, once we are satisfied with the documentation of all the indicators available, and the application has all the expected features outlined in the Introduction, we will add our own custom indicators as well.
Let us try to do the simplest indicator - Simple Moving Average. This is a form of Overlap indicator, since it overlaps with the actual price data.
The steps to add this indicator are below: - Load the data for the security ‘MSFT’ or your favorite stock as shown above. The OHLC or Close Price plots should be selected depending on your prefernce.
- Select ‘Add Indicator’ from the ‘Analysis’ menu to start the ‘Technical Analysis Indicator Wizard’.
Select ‘Overlap Studies’ in the Group list, select ‘Simple Moving Average’ in the Function list and set the period window parameter to 21 in the text box as shown here and hit the OK button. You may hit the ‘Indicator Help’ button if you want to know more about the indicator. It will open the documentation in a browser.
Once you do this, the simple moving average has been calculated and added to the data in the tab under the column SMA(21) as shown.
You can also see that the plot window has updated with the moving average line as shown.
Similarly one can add various indicators to the selected security tab.
Removing an Indicator
Once you have added one or more indicators, you may want to remove some that you do not like or do not want to use or think that you may want to change parameters for them. The simplest way to do this is by using the ‘Remove Indicator’ menu option that we provide as shown in the image below.
- This starts a remove indicator wizard which lists all the tabs that the user has open along with each indicator per tab.
- The user has to select a security from the list of tabs and then pick the indicator that they want to remove and hit the OK button.
- Once this is done, the tab data display and the plots will automatically update.
Saving the Strategy
The concept of a strategy in App::financeta consists of a security that the user selects, a date range, a collection of indicators and rules for buying and selling. Using the Save menu option the user can save the required contents of a tab such as the security name, date ranges, indicator details and rules into a YAML file. Since YAML is easily readable and editable manually, the user can manually edit an existing strategy file and create multiples of them using any scripting language as well.
Using the Open menu option the user can quickly open an existing strategy file and load its contents into the GUI. Since the strategy file does not store any data itself, it is easy to reuse it and share it with other users.
Adding Rules
The user can add custom rules to buy and sell stocks to the strategy. To do this the user clicks the Add/Edit Rules menu option in the Analysis menu on the toolbar of the main GUI window.
This will open a custom editor window for the current tab and will display existing rules that the user may have already written and saved or will be blank if the user is writing rules for the first time.
Once the user has typed in the rules they like to test out, the Save menu option in the editor window has to be clicked to save the rules to the strategy file for reloading later and for execution purposes. Each tab will have its own editor window allowing the user to copy-and-paste rules from one strategy to another.
If the user does not click Save the rules will not be saved to the strategy file and the internal tab manager will not execute these rules until they are saved.
To understand how to write rules refer to the chapter on Rules.
Let us move on to understanding the indicators in the next chapter.