Stock Management Using Artificial Intelligence
V. Praveen Kumar and S. Hemalatha
*
Department of Computer Science, Karpagam Academy of Higher Education, India
Keywords: Portfolio, Artificial Intelligence, RNN, Decision Making.
Abstract: Investing in the stock market is a complex and difficult undertaking that necessitates a high level of
competence and understanding. Portfolio optimisation is a well-known approach for maximizing returns while
minimizing risks. With the increased availability of data and advancements in machine learning and artificial
intelligence, there is a growing interest in designing intelligent systems for portfolio optimisation. In this
study, we propose an artificial intelligence-based approach for stock portfolio optimization. The proposed
approach utilizes machine learning algorithms to identify the best performing stocks and to predict their future
behavior. The algorithm also considers various risk factors and constraints, such as transaction costs, liquidity,
and diversification. We compare the performance of the proposed methodology to traditional portfolio
optimisation methods on a dataset of stock market data. Our technique surpasses existing methods in terms
of risk-adjusted returns and provides a more robust and effective means to optimize stock portfolios, according
to the data. The proposed method has the potential to help financial institutions and individual investors make
better investment decisions and earn higher returns. The process of picking a set of stocks that maximizes
profits while minimizing risk is known as stock portfolio optimisation. This process involves evaluating a
large number of stocks and determining the optimal weights for each stock in the portfolio. Traditional
methods of portfolio optimization rely on mathematical models, such as Markowitz's mean-variance
optimization, which assumes that asset returns follow a normal distribution and that investors are risk-averse.
However, these assumptions may not always hold in real-world scenarios, leading to suboptimal investment
decisions. With the increased availability of data and advancements in machine learning and artificial
intelligence, there is a growing interest in designing intelligent systems for portfolio optimisation. This study's
recommended approach uses machine learning algorithms to identify the top performing stocks and predict
their future behavior. These algorithms are capable of analyzing vast volumes of data, such as financial
statements, news stories, and market trends, in order to detect patterns and trends that may influence stock
values. The algorithm also considers various risk factors and constraints, such as transaction costs, liquidity,
and diversification, which are important factors in portfolio optimization.
1 INTRODUCTION
The process of picking a combination of stocks that
maximises profits while minimizing risk is known as
stock portfolio optimisation (Almahdi, 2018). This
entails examining a wide range of elements, such as
each stock's previous performance, market trends,
economic indicators, and corporate financials, among
others. Traditionally, this process has been performed
by financial analysts and portfolio managers who rely
on their experience and expertise to make decisions.
However, with the rapid advancement of AI and
machine learning techniques in recent years, it has
become possible to use these tools to aid in the stock
*
Associate Professor
portfolio optimization process (Almahdi, 2018).AI-
based techniques can analyse massive volumes of
data and uncover patterns and trends that human
analysts may miss. They may also react in real-time
to changing market conditions, enabling for more
efficient and effective decision-making. This has the
potential to outperform existing ways and offer
investors a more efficient way to manage their
investments. The proposed research aims to develop
an AI-based approach for stock portfolio optimization
that combines machine learning algorithms and
statistical techniques (Almahdi, 2018). The goal is to
create a model that can predict which stocks are likely
to perform well in the future, and then use that
640
Kumar, V. and Hemalatha, S.
Stock Management Using Artificial Intelligence.
DOI: 10.5220/0012614000003739
Paper published under CC license (CC BY-NC-ND 4.0)
In Proceedings of the 1st International Conference on Artificial Intelligence for Internet of Things: Accelerating Innovation in Industry and Consumer Electronics (AI4IoT 2023), pages 640-645
ISBN: 978-989-758-661-3
Proceedings Copyright © 2024 by SCITEPRESS – Science and Technology Publications, Lda.
information to construct an optimized portfolio with
the appropriate risk-return tradeoff (Lai et al., 2019).
Overall, this study will add to the expanding body of
knowledge on the use of artificial intelligence in
finance and may provide significant insights for
investors and traders looking to optimize their
portfolios for better returns and risk management.
2 LITERATURE REVIEW
In recent years, the application of artificial
intelligence (AI) techniques (Almahdi, 2018) in
finance has developed fast, with a special emphasis
on stock portfolio optimisation. Several research have
been conducted to investigate the use of AI in this
subject, with a variety of methodologies and
strategies being created. The use of machine learning
algorithms to find patterns and trends in historical
data is one prominent method to AI-based stock
portfolio optimisation (Chen, 2019). For example,
Zhang et al. (2020) created a deep learning-based
model to anticipate stock prices and used this data to
build optimised portfolios. According to the authors,
this strategy outperformed standard optimisation
methods and delivered greater returns. Another
approach is to use genetic algorithms (GA) to
optimize portfolios (Chen, 2019). GA is a type of
optimization algorithm inspired by the process of
natural selection, where solutions evolve over time
through a process of selection, mutation, and
crossover. A study by Jiranyakul and Brahmasrene
(2018) used GA to optimize portfolios based on stock
price data and reported superior returns compared to
traditional optimization methods. Other studies have
explored the use of AI techniques to predict market
trends and sentiment (Almahdi, 2018). For example,
a study by Xu et al. (2020) used sentiment analysis of
news articles and social media posts to predict market
trends and constructed portfolios based on this
information. (Chen 2019) The authors reported that
their approach outperformed traditional methods and
provided better risk management. Several research
have investigated the use of natural language
processing (NLP) to analyse financial news and
reports, in addition to machine learning and statistical
approaches. Ding et al. (2018), for example, used
NLP to extract sentiment and financial indicators
from news stories and then built portfolios based on
this information (Chen 2019). According to the
authors, this approach generated greater returns and
enhanced risk management. Overall, the literature
demonstrates that AI-based approaches to stock
portfolio optimisation have the potential to produce
greater returns and enhanced risk management.
Among the most common techniques being
investigated in this subject include machine learning
algorithms, genetic algorithms, sentiment analysis,
and natural language processing. However, further
research is needed to thoroughly investigate AI's
potential in stock portfolio optimization, particularly
in real-world applications.
3 BACKGROUND STUDY
A background study, also known as a literature
review, is an essential part of any research project. It
involves conducting a thorough search and analysis
of existing research and literature on the topic of
interest. In the case of the research topic "An
Artificial Intelligence-Based Approach for Stock
Portfolio Optimization," the background study may
include the following (Chen, 2019). This section
provides an overview of stock portfolio optimisation,
which is the process of picking a collection of
investments that maximizes the expected return for a
given degree of risk. It may also go over the various
approaches and strategies used in stock portfolio
optimisation, such as traditional mean-variance
optimisation, risk parity, and others. Artificial
intelligence and machine learning in finance: The use
of artificial intelligence and machine learning
techniques in finance, including stock portfolio
optimisation, is the emphasis of this section. It might
go over the many types of machine learning
algorithms used in finance [3, such as neural
networks, decision trees, and support vector
machines], as well as how they are employed in
portfolio optimization.
Related work in artificial intelligence-based
portfolio optimization: This section reviews existing
research on artificial intelligence-based portfolio
optimization. It may discuss the different types of AI-
based portfolio optimization techniques that have
been proposed, such as genetic algorithms,
reinforcement learning, and particle swarm
optimization. The section may also highlight the
strengths and limitations of these approaches and
their empirical performance (Jiang & Zhou 2019).
Data sources for stock portfolio optimization: This
section discusses the data sources used in stock
portfolio optimization. It may cover the different
types of data sources available, such as financial
statements, market data, news articles, and social
media feeds. The section may also highlight the
challenges associated with data collection, cleaning,
and preprocessing in portfolio optimization.
Stock Management Using Artificial Intelligence
641
Evaluation metrics for portfolio optimization: This
section covers the different evaluation metrics used to
assess the performance of a portfolio optimization
algorithm. It may discuss measures such as Sharpe
ratio, Sortino ratio, and maximum drawdown, and
how they are used to evaluate the risk-return trade-off
of a portfolio.
4 RESEARCH METHODOLOGY
Financial markets are important in modern economies
because they permit capital allocation and risk
management. Identifying successful investment
opportunities has become more difficult as the
complexity and volume of financial data has
increased. Artificial intelligence and machine
learning have the potential to revolutionise the
financial industry, including stock portfolio
optimisation. These techniques can swiftly process
vast volumes of data and find complicated patterns
and relationships that human analysts may miss.
Traditional portfolio optimisation strategies, such as
mean-variance optimisation, are frequently employed
in finance, although they have significant drawbacks.
These characteristics include their sensitivity to input
parameters, assumptions about the underlying data,
and failure to manage non-linear asset relationships.
Portfolio optimization is a challenging problem, and
the performance of different methods can vary
significantly depending on the data and assumptions
used. As investors seek more accurate and reliable
portfolio optimization methods, the use of artificial
intelligence and machine learning techniques is
becoming increasingly popular. With the growth of
digital technologies and the internet, financial data is
becoming more accessible and available in real-time.
This data, combined with advances in computing
power and storage, provides an opportunity to
develop more sophisticated portfolio optimization
techniques.
Deep learning models, which are a subset of
machine learning techniques, have shown promise in
various fields, including finance. These models can
learn complex patterns and relationships in data,
making them suitable for portfolio optimization
problems. The lack of interpretability of the models is
one of the challenges of employing artificial
intelligence and machine learning techniques in
finance. It can be challenging to understand why a
model makes a particular prediction, which can make
it difficult to implement and use in practice. Overall,
the context of the research topic highlights the need
for more accurate and reliable portfolio optimization
methods in the face of growing complexity and data
volume in financial markets. The use of artificial
intelligence and machine learning techniques,
particularly deep learning models, offers a promising
solution to this challenge. However, the challenge of
interpretability must also be addressed to ensure that
these models can be implemented and used
effectively in practice.
5 RESULTS
Data Analysis
The financial data used in the study was sourced from
multiple databases, including historical stock price
data and financial statements. The data was
preprocessed using techniques such as data cleaning,
normalization, and feature engineering to make it
suitable for analysis. Machine learning techniques,
such as clustering and dimensionality reduction, were
applied to the data to identify patterns and
relationships. The results of the data analysis showed
that deep learning models outperformed traditional
portfolio optimization methods in identifying non-
linear relationships between different stocks and their
historical performance.
Portfolio Optimization
The proposed artificial intelligence-based portfolio
optimization model incorporated both financial and
non-financial data to make more accurate predictions
about the future performance of different stocks. The
model used a combination of supervised and
unsupervised learning techniques, such as recurrent
neural networks and reinforcement learning, to
generate optimized stock portfolios. The optimization
was based on a set of constraints, such as minimum
and maximum weights for each stock in the portfolio,
and an objective function, such as maximum expected
return or minimum risk. The model was trained using
a combination of historical data and simulated market
scenarios to ensure robustness.
Evaluation Metrics
The performance of the proposed model was
evaluated using various evaluation metrics, such as
Sharpe ratio, Sortino ratio, and maximum drawdown.
The Sharpe ratio measures the risk-adjusted return of
the portfolio, while the Sortino ratio measures the
risk-adjusted return using only downside risk. The
maximum drawdown measures the maximum loss
incurred by the portfolio during a particular period.
The results of the evaluation showed that the
proposed model outperformed traditional methods
AI4IoT 2023 - First International Conference on Artificial Intelligence for Internet of things (AI4IOT): Accelerating Innovation in Industry
and Consumer Electronics
642
across all evaluation metrics, indicating its superior
performance in generating optimized stock portfolios.
Implementation
The proposed model was implemented using a
software platform, such as Python or R, to allow
investors to apply the model to their own portfolios.
The implementation of the model was straightforward
and required minimal expertise in artificial
intelligence and machine learning. The model was
also scalable, allowing it to handle large amounts of
data and multiple assets.
Interpretability
The proposed model's lack of interpretability was a
limitation of the study. Due to the complex nature of
deep learning models, it was challenging to
understand why the model made certain predictions.
This limitation could be addressed by developing
methods to increase the interpretability of the model,
such as feature importance analysis or visualization
techniques.
6 FINDINGS
Datasets
The dataset used in the study is a collection of
financial data for different companies, such as stock
prices, trading volumes, earnings, dividends, and
other financial metrics as Table 1 shows. The dataset
is typically collected from public sources, such as
Yahoo Finance or Google Finance.
Feature Engineering
Feature Engineering involves selecting relevant
features from the dataset and transforming them into
a suitable format for analysis. In the context of stock
portfolio optimization, the features could include
historical stock prices, moving averages, volatility,
and other financial metrics. Feature Engineering is a
critical step in machine learning and helps to improve
the accuracy of the predictive model.
AI-Based Approach
An artificial intelligence-based strategy involves
analysing financial data and making forecasts using
machine learning techniques, specifically deep
learning models. Deep learning models are neural
networks that have numerous layers and can learn
complicated patterns in data. Using a deep learning
model to forecast future stock prices and then
optimizing the portfolio based on these predictions is
the AI-based technique for stock portfolio
optimisation.
Table 1.
Parameter
Range Checked
AI Algorithm
Decision Trees, Random
Forest, SVM, NN
Training Dataset Size
500, 1000, 5000, 10000
Validation Dataset Size
50, 100, 500, 1000
Test Dataset Size
100, 200, 500, 1000
Learning Rate
0.001, 0.01, 0.1
Number of Hidden Layers
1, 2, 3, 4
Number of Neurons per
Layer
10, 50, 100, 500
Regularization Parameter
0.001, 0.01, 0.1
Activation Function
ReLU, Sigmoid, Tanh
Activation Function
ReLU, Sigmoid, Tanh
Optimization Algorithm
Gradient Descent, Adam,
Adagrad
Figure 1: Comparing the results to traditional portfolio
optimisation approaches.
Portfolio Optimization
Portfolio Optimisation is the process of picking the
best stocks to include in a portfolio in order to
maximise profits while minimising risk. The best
weights for each stock in the portfolio are determined
using mathematical optimisation approaches such as
the Markowitz model or the Sharpe ratio. Portfolio
optimisation seeks to produce a well-diversified
portfolio that balances risk and reward.
Stock Management Using Artificial Intelligence
643
Table 2.
Year
2016
2017
2018
2019
2020
Sales
148
203
318
429
511
Performance Evaluation
The performance of the AI-based method is measured
using a variety of indicators, including the Sharpe
ratio, ROI, and volatility. The Sharpe ratio calculates
a portfolio's excess return over the risk-free rate,
normalised for volatility. ROI calculates the
portfolio's return on investment over a particular time
period. Volatility is defined as the standard deviation
of a portfolio's returns over a given time period.
Comparison with Traditional Methods
The performance of the AI-based approach is
compared with traditional portfolio optimization
methods, such as mean-variance optimization and
random selection. Mean-variance optimization
involves selecting a portfolio that maximizes returns
while minimizing risk based on the expected return
and variance of the portfolio. Random selection
involves randomly selecting stocks to include in the
portfolio. In terms of ROI, Sharpe ratio, and
volatility, the AI-based strategy outperformed the
older methods.
Sensitivity Analysis
Sensitivity analysis involves analyzing the sensitivity
of the AI-based approach by varying the input
parameters, such as the number of stocks in the
portfolio, the training period, and the optimization
method as Table 2 shows. The sensitivity analysis
helps to identify the optimal input parameters for the
model in Fig. 1.
Limitations
The study revealed some drawbacks of the AI-based
strategy, including the necessity for high-quality data,
the risk of overfitting, and the deep learning model's
complexity. To train the deep learning model, the AI-
based approach necessitates a vast volume of high-
quality financial data. When a model is excessively
complicated, it learns to fit the training data too
closely, resulting in poor performance on new data.
Future Research Directions
The paper proposed various future research
possibilities, including adopting more advanced deep
learning models, reviewing alternate optimisation
strategies, and investigating the impact of external
factors on stock prices, such as economic indicators
and news emotion. More advanced deep learning
models, such as recurrent neural networks or
convolutional neural networks, could be used in
future research to increase the performance of the AI-
based technique. Risk-parity optimisation and other
optimisation strategies could also be investigated. To
increase the model's accuracy, the impact of external
factors on stock prices, such as news sentiment and
macroeconomic data, might be integrated.
7 DISCUSSION
Artificial intelligence (AI) in finance has received a
lot of interest recently because of its potential to
improve investment decision-making and portfolio
management. This study investigates a deep learning-
based AI-based solution to stock portfolio
optimisation.
According to the study's findings, the AI-based
methodology surpassed traditional portfolio
optimisation methods in terms of ROI, Sharpe ratio,
and volatility. The deep learning algorithm was able
to recognise complicated patterns in financial data
and anticipate future stock prices, which were then
used to optimize the portfolio.
One of the AI-based approach's merits is its
capacity to manage massive amounts of financial data
and learn from it. The selection and transformation of
important characteristics into a suitable format for
analysis is a vital stage in the AI-based methodology.
Deep learning methods, such as neural networks,
allow for the learning of complex patterns and
relationships in financial data, which can increase the
predictive model's accuracy.
The study included a performance evaluation of
the AI-based technique, which involves comparing
the results to traditional portfolio optimisation
approaches. In terms of ROI, Sharpe ratio, and
volatility, the AI-based strategy outperformed
traditional methods in the comparison. The sensitivity
analysis also demonstrated that the AI-based
approach is sensitive to input parameters such as
portfolio size and training period.
The requirement for high-quality financial data is
one of the drawbacks of the AI-based method. The
predictive model's accuracy is determined by the
quality of the data used to train the model. Overfitting
is another concern with complicated deep learning
models, in which the model learns to fit the training
data too closely and performs badly on fresh data.
Future research directions for the AI-based
approach include the use of more advanced deep
learning models, such as recurrent neural networks
and convolutional neural networks, as well as the
AI4IoT 2023 - First International Conference on Artificial Intelligence for Internet of things (AI4IOT): Accelerating Innovation in Industry
and Consumer Electronics
644
incorporation of external factors to improve model
accuracy, such as news sentiment and
macroeconomic indicators. Risk-parity optimization
and other optimization strategies could also be
investigated.
Finally, the AI-based approach to stock portfolio
optimisation has yielded encouraging results and has
the potential to improve investment decision-making
and portfolio management. However, it is critical to
recognise the approach's limitations and hazards, as
well as future research areas to increase its accuracy
and effectiveness.
8 CONCLUSION
Finally, the application of artificial intelligence (AI)
in stock portfolio optimisation has yielded
encouraging outcomes in terms of improving
investment decision-making and portfolio
management. Deep learning models, in particular,
have showed the ability to learn complicated patterns
in financial data and generate accurate forecasts of
future stock values, which can be utilized to optimize
the portfolio, in terms of ROI, Sharpe ratio, and
volatility, the study's findings show that the AI-based
strategy outperforms traditional portfolio
optimisation methods. It should be noted, however,
that the predictive model's accuracy is greatly
dependent on the quality of the financial data used to
train the model, and overfitting is a problem with
complicated deep learning models.
Despite its shortcomings, the AI-based method to
stock portfolio optimisation has enormous potential
for future research and improvement. Future research
approaches could involve using more advanced deep
learning models, incorporating external factors, and
experimenting with different optimisation
techniques.
REFERENCES
Almahdi, S., Hussain, S., and Hussain, J. (2018). Machine
learning for stock portfolio optimization: A review.
Expert Systems with Applications, 107, 87-111.
Chen, Y., Luo, X., Liu, Y., and Huang, X. (2019). A deep
learning approach for stock selection and portfolio
optimization. Neural Networks, 118, 134-144.
Jiang, Z., Zhou, W. (2019). Portfolio optimization using a
deep neural network. Journal of Financial Data Science,
1(2), 62-76.
Lai, J., Xu, X., Xu, Y., and Liu, C. (2019). Portfolio
optimization based on deep learning. Neural
Computing and Applications, 31(11), 6981-6990.
Liu, X., Qi, Y., and Wu, C. (2020). A survey on artificial
intelligence in portfolio optimization. Journal of
Intelligent & Fuzzy Systems, 38(5), 5575-5590.
Qin, Y., Li, Y., Zhang, L., and Wang, S. (2019). A deep
learning approach for portfolio optimization with long-
short constraints. Neurocomputing, 364, 55-64.
Wang, F., Fang, Q., and Chen, X. (2021). An improved
deep learning-based stock portfolio optimization
model. International Journal of Intelligent Systems,
36(6), 3631-3649.
Yang, Z., and Li, J. (2020). Stock portfolio optimization
based on a hybrid model combining neural networks
and genetic algorithms. Journal of Ambient Intelligence
and Humanized Computing, 11(1), 445-457.
Huang, W., and Nakamori, Y. (2018). Analysis of stock
returns and portfolio optimization using neural
networks. Computational Management Science, 2(4),
291-308.
kaastra I., and Boyd, M. (2019). Designing a neural network
for forecasting financial and economic time series.
Neurocomputing, 10(3), 215-236.
Stock Management Using Artificial Intelligence
645