# Visual Analytics Course

### Site Tools

haolin_ren:projectfinal

Tulip file of this project, Tulip file of the project . You can download directly.

If the following pictures can't display normally, please refresh the page.

## 1. Introduction

Algorithmic trading involves entering trading orders through electronic trading platforms using an algorithm which helps in taking into account order’s characteristic like timing, price, and the volume of the order. On august 31st, 2011, RYBN has launched the Trading Bot ADM8 on the financial markets.The motivation of this project is using data visualization to study the performance of this robot.By analysing the performance of this bot, to see wether this algorithmic trading Bot was profitable, and to find wether there exist some problems of Bot that could be improved. We would provide some evidence to support the prediction on the Bot(we call this trading bot as Bot in the following part) going bankrupt. The data visualisation results were generated by tulip software.

### Prepare Data

• Step1. Acquired the data from its monitoring page http://rybn.dyndns.org/ANTI/ADM8/ , from the site we got its historical operating records, the records shows when the Bot bought or sold the stock, and the price, the quantity, the currency of that stock. We organised the data into a CSV file as the following format, we used the data from 08/31/2011 to 11/07/2014.

• Step2. Because of Bot have using different currency to buy stocks from different Exchange, we exchanged euro and HKD into US dollars, in order to improve accuracy, we wrote a script for searching the exchange rate historical data, and translate the search result into a python dictionary variable.related code.

• Step3. Unordered List Item In order to find out which markets did Bot buy and sell stocks, we also wrote a script for searching some properties of each stock, the results were also translated into a python file in order to analyse the data. After doing that, we got each stock’s trading locations and the industry which it belongs to.related code.

## 3. Data Visualisation

1. Section 3.1 gives some graph to show that this Bot is a high frequency trading robot
2. Section 3.2 gives an analysis of Bot’s performance based on markets
3. Section 3.3 shows the Bot fixed settings of trading hours
4. Section 3.4 shows the Bot’s ability of making money
5. Section 3.5 give the answer of the prediction on the Bot going bankrupt
6. Section 3.6 shows the property of stocks which Bot bought.

#### 3.1.1 Stock holding time

After importing the data into tulip, we got the result like figure4 shows, each nodes in the right windows represents one transaction. The 1563 nodes stands for 1563 times historical transactions by the Bot, each node includes the information of one stock, such as the name of stock and when it was bought or sold and the value of cost or earn, etc. We sorted the nodes according to the time, in order to distinguish different types of transactions, buying stocks were arranged in the left side, selling stocks were arranged in the right side. As figure 5 shows, The height of the nodes based on the date of his operation, The arrows indicate the direction of time growth. If the buying node is the same stock as the selling node, we added an edge between two nodes.

From figure5, we can make two conclusion, first conclusion is that each time Bot bought about five different stocks. Secondly, every time Bot oversold all the shares he own before it bought shares, that means this Bot didn’t do long-term holdings.

The figure6 represents the interval of one complete transaction(after the Bot selling the stock it had bought, we define this as one complete transaction), in the graph each small circle stands for one complete transaction, the label on it is the days interval between buying and selling of a same stock. From Bot operating records, 93.3% transactions were finished within two days, it should be added that, if the stock had been bought on Friday then been sold next Monday, we counted this 1 day, we didn’t count the other holidays, so the ratio of 1 day transaction was more than 93.3%.

In addition, we noticed that, there were two stocks which had been bought and sold in the same day, as figure7 shows. We verified these two transactions, we found that those special cases were caused by the sharp dropping of the stock’s value.

We can conclude that the Bot is a high-frequency trading algorithm Bot. Its algorithm designed to buy stocks every day, and then sell the next day. But in some special situation, it strategy would be modified by the operator.

#### 3.1.2 Bot's activities

The figure9 shows the activities of Bot, one cube stands for one day, if the color of cube is yellow, that means Bot didn’t make any transaction that day, if the cube is red or green, it means Bot had did at least one transaction that day, from the didn’t figure out how many stocks were bought or sold in a day, the aim of this figure is just to figure out which days did Bot not trade and why. The conclusion from this graph is that in 2011 and 2013 Bot was running almost every weekday, at the beginning of 2012, Bot slowed down the trading frequency, after the middle of 2014, the trading frequency decreased sharply. After introducing the ￼different exchange markets, we would give some possible reasons for this frequency decline.

### 3.2 Stock Exchanges

From the historical records, the Bot was trading with three currencies: USD, EUR, HKD. In past 1563 transactions, trading in euro and HKD were both 220 times, and the rest 1123 transactions were operated in USD. We also find the Stock Exchange for each stock bought, there were: NewYork(NYSE), NASDAQGS, HongKong, ENParis, Xetra and ENAmsterdam, first two are American Stock Exchange, last three are in Europe. The figure10 shows the percentage of the amount of stocks bought from different Stock Exchange over the total number of operations. From figure10, we can find that Bot preferred to trade stocks in the United States. We would discuss the reasons latter. Considering the difference between Stock Exchange, we compared the trading frequency in different locations. Figure11 shows the trading frequency difference of American markets, European markets and HongKong markets.

From figure11, we can conclude that if excluding the influence of the european debt crisis on European markets, the trading frequency in HongKong markets and European markets were almost the same. The Bot focused on American stocks.

### 3.3 Operating hour analysis

From Bot’s page, we can get information about buying or selling hour, in this section we would analyse its operating hour setting. Figure12 shows the operating time, X-axis represents the date, Y-axis represents the time of day, a circle represents a selling stock, a cube represents a buying stock, We can directly see from the picture, the operating time is a regular. In addition, all the following is (UTC/GMT +1) Central European Time Zone.

After adding edges between the same buying and selling stocks as Figure13 shows, the operating time strategy is very clear. Considering the time difference in different locations, we shows this graph depend different locations.

#### 3.3.1 American Exchange

From figure14, we find that in American Stock Exchange, Bot sold the stocks in 15:00 - 16:00(New York time), bought in 10:00 - 11:00.

#### 3.3.2 European Exchange

From figure15, in European Stock Exchange, Bot sold the stock in 16:00 - 17:00, and bought in 09:00 - 10:00.

#### 3.3.3 HongKong Exchange

From figure15, in HongKong Stock Exchange, Bot sold the stock in 15:00 - 16:00, and bought in 10:00 - 11:00.

We can conclude that, Bot bought the stock at the opening of the Stock Exchange each day, then sold at the close of Exchange next day.

### 3.4 Profits analysis

Figure17 shows the profits of all the complete transaction, Bot made profits 390 times, lost 391 times, it lost 1849dollars. its forecast accuracy was 49.93%. In American Exchange, it make profits 292 times, lost 269 times, market’s profits was 516 dollars, forecast accuracy was 52.04%; in European Exchange, it made profits 58 times, lost 52 times, market’s profits was -295dollars, forecast accuracy was 52.72%; in HongKong Exchange, it made profits 40 times, lost 70 times, market’s profits was -2071 dollars forecast accuracy was 36.36%.

We can conclude that Bot’s performance is much better in American Exchange, in fact those four years it was losing money. Figure18 shows the change of amount of it’s money.