0% found this document useful (0 votes)
225 views14 pages

Stock Trading Research

This document summarizes a research paper about automated stock trading. The paper proposes using a semi-automated approach combining fundamental and technical analysis with machine learning to identify stocks with upward trends. A support vector machine algorithm will be used to predict the top 5 performing stocks from the Australian healthcare sector. These stocks will then be hypothetically traded using an automated trading application to demonstrate how such a system could yield profits through faster and less emotionally-driven trading. The goal is to help investment firms identify profitable stocks to trade in a semi-automated manner.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
225 views14 pages

Stock Trading Research

This document summarizes a research paper about automated stock trading. The paper proposes using a semi-automated approach combining fundamental and technical analysis with machine learning to identify stocks with upward trends. A support vector machine algorithm will be used to predict the top 5 performing stocks from the Australian healthcare sector. These stocks will then be hypothetically traded using an automated trading application to demonstrate how such a system could yield profits through faster and less emotionally-driven trading. The goal is to help investment firms identify profitable stocks to trade in a semi-automated manner.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

New Era University

College of Business Administration

No. 9, Central Ave., New Era, Quezon City 1107

Philippines, Quezon City

“RESEARCH ABOUT STOCK TRADING”

Submitted by:
MARC ALESTER P. NICOLAS
Abstract
The primary challenges with stock trading are the identification of the profitable stocks and trading
those stocks without human errors and interference of personal sentiments in order to reap better
returns. In this paper, we propose the automated stock trading in a semi-automated manner .

1. Introduction
Companies or businesses improve their capital via the problem and subscription of stocks
through exchanges or over-the-counter markets via way of means of giving traders a slice of
possession in the company. A trader seeks to profit from the price fluctuations of the shares held.
Trading in the stock market can be very profitable or painfully unprofitable based on the stock-
picking methodology. In order to select profitable stocks, basically there are two different stock
picking methodology namely fundamental and technical analysis. Fundamental analysis takes
into account the overall economy, industry conditions, financial conditions and management of
the organizations whereas in technical analysis instead of measuring the intrinsic value it mainly
studies the stock charts to identify patterns and trend of the stock market. These two techniques
are generally considered as two sides of a coin. It is always a debate which methodology is best.

With the advent of information technology, trading methods have considerably evolved from an
open outcry manner on the stock exchange floor of the stock market to modern stock trading
conducted via electronic exchanges. In early 2000 the e-trading has taken a new dimension
where trades are planned and executed by complex algorithms rather than humans. Auto trading
executes trading systematically by eliminating the human emotional impacts and errors which
results in increased profit for the trader and market liquidity. Another major advantage is that can
trade continuously on all opened markets in the same time, applying the same algorithms over
and over again, without any pause. Technical analysis is the foundation for Auto trading.
Currently there are decision making algorithms such as Pairs Trading, Automated Gaming and
Execution Algorithms such as Iceberg, Volume Weighted Average Price are implemented for
algorithmic trading.

Algorithmic trading is widely used by investment banks, pension funds, mutual funds, and other
buy-side (investordriven) institutional traders, to divide large trades into several smaller trades to
manage market impact and risk. Also algorithmic trading helps banks to trade foreign currency
in order to reduce the risk encountered by the misconduct by human traders. Motivation of
automated trading strategy dates back to 1950’s with portfolio optimization theory by Harry
Markowitz in which he explains how an investor should allocate his wealth over risky securities
so as to maximize his expected utility of total wealth. The second remarkable milestone is the
development of Capital Asset Pricing model by Sharpe (1964), Lintner (1965) and Mossin
(1966). This model determines theoretically appropriate required rate of return of an asset, if that
asset is to be added to an already well-diversified portfolio, given that non-diversifiable risk of
the asset. The third milestone is the linear multifactor risk model by Rosenberg (1974) in which
individual stock returns were assumed to be related to a smaller number of common factors
which was statistical and computational. A relatively recent innovation in financial trading is
high frequency trading a form of automated trading that utilize the computational innovation and
advancement in telecommunication. This trading accounts for 40 to 60% of all trading activity
across the financial markets, including stocks, derivatives and liquid foreign currencies. The
major benefits rendered by auto trading to the financial markets operating are liquidity,
transaction costs and the efficiency of market prices. The purpose of this paper is to provide you
with correct inventory selections the use of gadget studying algorithm, alternate the ones picked
shares with the aid of using the use of buying and selling guidelines within side the semi-
computerized technique with inside the Australian Stock Market.

2. Literature Review
In the authors have proposed an algorithmic stock trading model that combines the signals from
different technical indicators such as Moving Average Convergence-Divergence MCDM, Price
Rate of Change and Stochastic Oscillator in order to provide more accurate trading signals.

Further in the authors have simulated an artificial market in which the different types of traders
such as random agents, human agents, market makers agent and strategic agent trade based on
certain rules. In addition, in the authors have studied the four algorithmic trading strategies. The
first strategy is based on Static Order Book Imbalance in which the volume weighted averages of
the prices are computed in the buy and sell order books. Then two differences are computed from
each average and the last price of the exchange. Depending upon the difference in the sell/buy
side greater than the threshold buy/sell order is placed. The second strategy is based on the
volume average weighted prices in which the weighted prices for the entire market is computed
and compared with the average price for the first orders in the buy book. Based on the
higher/lower than the threshold hold value buy/sell order placed. The third strategy is based on
the trend following which depends only on the price movements. In this, two trend lines, with the
help of regression is computed based on the 4 hour and 1 hour window. If the slope of the two
trend line matches then a buy order is placed. The final strategy is reverse strategy in which buy
order is placed when the price is falling and sell order is placed when the price is rising. It has
been concluded that SOBI, reverse and TF are better.

Also in, the authors have combined the technical analysis with the nearest neighbour
classification. The technical indicators such as moving averages, Relative strength index and
Stochastics and Bollinger bands have been considered in this work. Apart from these indicators,
the features extracted from the price history and trading volumes of the stocks has been used as
input to K-NN algorithm. Based on the output from K-NN, stock is either bought/sold. Also
stop/loss criteria has also been considered.

All of the above authors have all successfully demonstrated the algorithmic trading strategies of
stocks. They have all used only the technical indicators based on past price and volume to predict
the stock performance. It is a fact that only a good technical indicators do not always lead to
better returns. Same holds good for fundamentals too. An organization which is having upper
trend in the stock movement currently but if it does not have good fundamental say management
effectiveness then the trend would not be a long standing one. In our research we intend to use
both fundamental and technical indicator data in order to reap the benefits of both the
methodologies. Also we have used the machine learning algorithm, support vector machine to
predict the trend of the stocks. Finally we hypothetically trade the top 5 stocks suggested by
SVM using the auto trading application developed based on the trading rules such as stop/loss
criteria.

3. Objective of the Study


The research intends to demonstrate scientifically how analytical techniques can help to select good
stocks and then such stocks traded using auto trading approach in a semiautomated process yield profit.
Our research would help to identify the good stocks to invest by using machine learning algorithm. With
a semi-automated process, selected stocks will be traded in a faster and smarter way without
interference of human sentiments ensuring a significance increase in profitability. Investment
firms/brokers can use this approach to make money. The Figure 1, illustrates the systematic approach to
achieve the research objective. Using fundamental and technical indicators we intend to predict the
stocks with the upward trend movement by using machine learning algorithm. Infer rules and use them
for making decisions such as buy, sell or hold the stocks. Automate the trading based on the algorithm
developed using the rules and analyse the inferences.
Figure 1. Systematic approach for Auto trading.

4. Methodology
4.1. Market Selection

The purpose of this paper is to provide you with correct inventory selections the use of gadget studying
algorithm, alternate the ones picked shares with the aid of using the use of buying and selling guidelines
within side the semi-computerized technique within side the Australian Stock Market.

4.2. Sector Selection


The Australian inventory marketplace ASX is split into the subsequent sectors specifically
Consumer Discretionary, Consumer Staples, Energy, Financials, Health Care, Industrials,
Information Technology, Materials, Metals/Mining, Telecommunications Services, Utilities, and
Real Estate. Out of those 12 sectors, which will hold our studies centered we determined to
choose 1 exact appearing quarter. Begun out the studies have a look at in the course of the
primary area of 2015. So as in keeping with the world fashion evaluation in the course of the first
area of 2015, the fitness care quarter become appearing properly as depicted within side the
following figures 2.

Figure 2. Upward trend in healthcare sector.

For Health Care sector the trend is upwards which means it is a good sign. The energy sector trend is
depicted in figure 3 and the trend is downwards which means it is not a good sector to choose. There
are totally 98 stocks in health care sector.

4.3. Data Collection


The fundamental indicators for the first quarter of 2015 for each of the 98 health care stocks, is
collected from yahoo finance by web scraping using webscraper.io . The figure 4 shows the highlighted
fundamental variables collected from yahoo finance. The data is collected for 3 different periods such as
Jan, Feb and Mar 2015 for our research, in order to ensure repeatability and consistency of our
modeling approach results
Figure 4. Variables collected from yahoo finance

The Trend variable is accumulated from ASX. When the fashion is upward as proven in parent 5,
this suggests an amazing inventory and subsequently the variable fashion is coded as 1. If the
fashion is downwards as proven in parent 6 then it indicated now no longer an amazing inventory
and subsequently the variable fashion is coded as zero for such stocks.

Figure 5. Upward trend healthcare stock.


Figure 6. Downward trend healthcare stock.

4.4. Data Cleaning


For the Health care sector, once the data is collected we formatted the data in a structured format
so that we can further process using statistical tools. Then we checked for the presence of
incorrect, incomplete and duplicate data. The missing data was imputed using Expectation
maximization method. Also certain stocks which are not currently traded, stocks with volume of
trade less than 10000 and also stocks having price less than 10 cents were removed from the
analysis.

4.5. Trend Analysis


Trend analysis tries to predict the upward or downward trend for each of the stocks. There are
various methods such as current market price calculation, moving averages and channel
breakouts for trend following. Previous studies has compared the different trend following
strategies such as momentum, channel, dual moving average crossover and time series
momentum strategies [10] and confirmed that such trend following approach are indeed
profitable in stock trading when followed. Also in another previous study which was conducted
based on the inspiration of the Performance Probability Score (PPS) model, proved the
possibility that trend following can yield profits

In our study for each of the stocks, we tried to infer the monthly trend of the stock by comparing
the current day stock price with the previous day stock price. If the current day stock price is
greater than the previous day stock price for about 40% of the trading days in a month then we
conclude that the stock is having upward trend else it is considered to have downward trend for
that particular month.

4.6. Support Vector Machines


Initially, we started to fit more simple models like logistic regression and decision trees and
then even proceeded with ensemble models but they were unable to predict the upward trend
stocks. The sensitivity was very low for most of these models. The SVM was giving relatively a
very good accuracy, sensitivity and specificity. Hence we selected SVM.

Support Vector Machines (SVMs) are supervised learning models that analyse and recognize data for
classification and regression analysis. A support vector machine constructs a hyper plane or set of hyper
planes in a high- or infinitedimensional space, which can be used for classification, regression, or other
tasks .

When there are numerous machine learning algorithms, the reason for choosing SVM is to address the
unbalanced data problem more efficiently. The unbalanced classification problem occurs when there are
many more samples of some classes than others. In our case we have 88% of stocks with downward
trend and 12% stocks with upward trend. The standard classifiers tend to be overwhelmed by the
largescale classes and ignore the small ones and tend to classify any example as belonging to the
majority-class. Even though this is highly accurate under the standard measure of accuracy such a
classifier is useless because it will be able to predict which stocks will tend to have downward trend and
not the upward trend. We are more interested in the stock with upward price trend than downward
price trend as we are interested to know the most profitable stock for investment.

Also in one of the previous research study, it was proved that SVM outperforms the other classification
methods in the predictability of financial movement direction were they forecasted the weekly
movement direction of NIKKEI 225 index .

5. Statistical Analysis Results The results of trend following and performance of the machine learning
algorithms are visualized using confusion matrix . The upward and downward trends are denoted by 1
and 0 respectively. Sensitivity measures the proportion of upward trend stocks that are correctly
identified. Specificity measures the proportion of downward trend stocks that are correctly identified.
Accuracy is the proportion of both upwards and downward trend stock resulting among the total
number of stocks examined.

5.1. Results of Trend Analysis


The trend analysis logic was implemented using R programming language. The predicted trend
values are compared with the actual trend values collected as explained in the section 4.3. The
figure 7 below illustrates the confusion matrix for the Trend analysis.
Figure 7. Confusion Matrix for Trend Analysis.

5.2. Results of Support Vector Machines


The financial data collected from yahoo finance and the stock monthly trend data resulted from
our trend analysis are used as the independent and dependent variable respectively for SVM. It
was implemented using the R programming language. The package used is caret. The figure 8
below illustrates the confusion matrix for the support vector machines.

Figure 8. Confusion Matrix for SVM.

5.3. Best Stock Pick for Trading


For the health care sector, the best stocks which are predicted to have upward trend having
probability greater than 0.8 for each of the month is shown in the figure 9. The below stocks are
the ones chosen for hypothetical automatic trading with high probability of moving upward
trend. In case of the model suggesting equal probabilities then we have prioritized the stocks
based on the fundamental indicators such as return on equity, return on assets, revenue per share,
book value per share with high values but price having low value.
Figure 9. Health Care sector - good stock picks.

The highlighted top 5 stocks are recommended for inventory trading. The stocks expected the
usage of Jan, Feb, and March 2015 statistics are used for the Feb, Mar, and April computerized
trading respectively. Based at the stop-loss rule as soon as an inventory goes out of the portfolio,
subsequent inventory with inside the listing will pass into the portfolio.

6. Paper Trading
Based on the stocks predicted by SVM, hypothetically paper trading was done following the stop loss
criteria and we were able to achieve around 16.64% revenue at the end of 3 months. The algorithm
outperformed the ASX returns and this is shown in the below visualization.
Figure 10. Visualization of returns from Paper Trading shown from Feb to April 2015.

7. Auto Trading Application


The methodology mentioned with inside the preceding sections for the choice of correct shares
and buying and selling regulations observed for paper buying and selling are applied
programmatically and semiautomatic buying and selling utility has been evolved. The shares
expected to have upward fashion through SVM are given as enter to the automobile buying and
selling utility. The utility is programmed dynamically to select out the primary three shares from
the listing and invest similarly the allotted fund. The overall allotted fund is $100K. Initially,
every of the 3 stocks is similarly invested. The forestall loss/benefit rule desires to be configured
with inside the utility. The regulations configured are, promote the proportion whilst the
everyday returns from the proportion exceeds 10% if you want to gain the benefit or promote
whilst the everyday returns from the proportion is going under three% in order to keep away
from in addition loss. The shopping for and promoting expenses are assumed to be 20$ for every
transaction. When one in all the inventory with inside the portfolio is offered because of earnings
or loss, the next inventory with inside the listing is robotically picked for buying and selling. The
backend of the automobile buying and selling utility is programmed the use of Microsoft EXCEL
visible simple for applications. The the front quit is evolved the use of R programming language
the use of Shiny dashboard and rCharts programs giving interactive charts for the consumer to
higher recognize their portfolio.
Figure 11. The below interactive chart provides visualization of the overall daily returns of the portfolio
shown from Feb till mid of March 2015.

Figure 12. The below interactive chart provides visualization of the individual stock daily returns of the
portfolio.
8. Conclusion
So far with inside the research, have completed in screening the 2000+ shares within side the
Australian inventory marketplace primarily based totally at the good appearing sectors and are
available right all the way down to 98 stocks in health care sector. Out of those 98 stocks with
the assist of statistical modelling strategies we've got similarly come right all the way down to
five best stocks for every of the months particularly Jan, Feb, and March 2015. Thus completed
to systematically select out few high go back shares (needles) from the hay of 2000+ stocks.
These shares had been traded with the assist of the auto trading software without human error
and human sentiments interference to yield earnings with the aid of using configuring the trading
guidelines in the application

You might also like