What if instead of a bank deposit we use bonds after the sharp increase in the rate by the Bank of Russia?

Setting parameters for searching liquid bonds

Setting parameters for searching liquid bonds

  • New filter for screening out bonds with unknown coupon rates. The script now has a new filter that allows you to filter out bonds with unknown coupon rates. This is important because the issuer may change the rate after a certain period. This way, the user can avoid unpleasant surprises.

  • Filter to exclude illiquid bonds. A filter has also been added to exclude illiquid bonds. It filters out securities whose transaction volume over the last 15 days does not reach the threshold set by the user.

  • Displays whether an investor is qualified to purchase bonds. It is displayed whether the bond is classified as a qualified investor bond or not.

  • The mechanism for receiving the number of payments has been changed. Now, with the help of the Moscow Exchange API, not only the first 20 payments are withdrawn, but all coupons in full.

  • The appearance of the table has been slightly changed.

Important parameters for me when searching for bonds

Here are the most important parameters for automatic bond selection:

  1. A range of yields, such as 15% to 30%. This is the effective yield before coupon tax and without adjustment for purchase fees.

  2. Current price range: from 60% to 110% of the nominal value.

  3. Duration range: from 3 to 18 months. This allows you to see only those bonds that will mature on time. In fact, the life of the bond.

  4. Availability of information on all coupon payments until maturity. This is important to save time in the future and avoid the need for additional portfolio monitoring. I do NOT like floaters because they it is impossible to schedule future payments. However, to find floaters there is a good resource.

  5. Minimum number of trades in each of the last 15 calendar days. This is the key parameter for which the script was written. It is important that the bond is liquid and actively traded.

  6. The total number of transactions over the last 15 calendar days. This is a new criterion that also serves as a filter for selecting bonds.

Filter bonds by parameters

Filter bonds by parameters

How the script works

Script operation depends entirely on Moscow Exchange serversIf the Moscow Exchange changes the issuance format, organizes other trading modes, or changes something in the existing system, then the script will need to be modified to work correctly.

Results of the script running on the computer

Results of the script running on the computer

Results of the script on an android phone

Results of the script on an android phone

Step by step guide to use

Before you get started, make sure you have the following installed on your computer:

  • Node.js and npm (Node package manager): Node.js allows you to run JavaScript on your computer, and npm is the package manager that comes with Node.js. You can download both from official site of Node.js.

  • Code editor (optional). It is recommended to use a code editor such as Visual Studio Code to edit and view project files. Download it from Visual Studio Code website.

Download the project repository

The first step is – download (clone) the project from GitHub.

List of files

List of files

Installing dependencies

The next step is to install the necessary packages needed to run the project.

For Windows, use the file first start.bat.

For Mac and Linux, in Terminal, enter:

npm install

This command will install all packages (node-fetch and moment) listed in the file package.json.

Launch of the project

Once the dependencies are installed, you can run the project.

For Windows:

Use the file 2024_bond_search_start_windows.bat

Startup takes 1 to 2 minutes:

After the red arrow, the wait is from 1 to 2 minutes

After the red arrow, the wait is from 1 to 2 minutes

For Mac:

Open a terminal and run the command, changing the path to your own:

node /Users/mike/Desktop/2024_bond_search/index.js 2>&1 | tee /Users/mike/Desktop/2024_bond_search/log/log_$(date +%F_%T).txt

The process also takes from 1 to 2 minutes, all logs can be viewed in the folder log.

For Linux:

Open a terminal and run the command, changing the path to your own:

node /home/mike/2024_bond_search 2>&1 | tee /home/mike/2024_bond_search/log/log_$(date +%F_%T).txt

View results

After successful execution of the script in the folder searching_results another file with the current date will appear.

You can click on the column names – the sorting will change.

Past search results for several years you can see here.

How to buy bonds on the stock exchange?

You can buy bonds on the stock exchange through any broker. To do this, you need to open a brokerage account and top it up. After that, you can choose bonds and make transactions.

Although most bonds are marked as not requiring qualification when purchased – in reality, after opening an account with a broker, you will have to pass testing – otherwise you will not be allowed to use the instrument. And even if you have qualifications with one broker, they do not transfer to another. You will have to do everything again.

Testing failed

Testing failed

An undoubted advantage is that testing can be taken without limitation on the number of times.

Testing passed

Testing passed

Instead of conclusions

The script allows you to save time and find liquid bonds that are suitable in terms of yield and maturity. However, the selection is not an individual investment recommendation and may not correspond to your investment goals. This is due to the fact that the script is just a tool, and the decision to buy specific securities is made by the person himself after studying the issuer.

The script works solely due to the use of the Moscow Exchange API, with which the author has no ties. I use the Moscow Exchange ISS only for personal information purposes.

Script always available on GitHub.

Author: Mikhail Shardin

August 12, 2024

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *