1 Introduction

The financial market trading of various securities has attracted a large number of investors. A generalized and, in a majority of the cases, the primary goal of investing in the financial market(s) is to gain maximum profits. It offers a wide scope to the constantly changing capital market frictions and therefore, to the individuals associated with it [1]. As compared to conventional financial approaches such as savings or fixed deposits, investment in the capital market may raise opportunities for increasing the expected returns [2]. While careful investment and trading can be beneficial, such markets may worsen and bring loss of valuables as well. This induces that stock valuation should be carried out before the investment; it can be considered as the process of identifying intrinsic stock price value [3]. The stock valuation can be assessed to classify stock positions on the security market line (SML), i.e., an expected rate of return of each security in capital asset pricing model (CAPM) [4]. There have been various theories associated with an investment, portfolio, arbitrage pricing, option pricing, interest rates, as well as the economic choice [5]. For realistic trading in the financial market, knowledge and acquisition of such aspects can be helpful; in contradiction to that, a large number of traders primarily rely on their analyzing abilities and experiences [6, 7].

Stock market equity is shown to be one of the long-run determinants of per capita GDP, i.e., gross domestic product [8]. It can play a crucial role in regulating a country’s economic output. The economics can be divided into microeconomics and macroeconomics [9, 10]; while the former is concerned with the study of individuals and businesses, the latter can be associated with decisions taken by countries and their implications on the economy as a whole. The inherent non-linear nature of economy market requires detailed analyses to make reliable trading. It can be categorized into fundamental analysis and technical analysis [11,12,13]. The fundamental analysis is based on quantitative tools as well as qualitative indicators of a company such as its profile, managerial policies, marketing strategies, products and their intrinsic values; this kind of an approach requires expertise and detailed market study. On the other hand, the technical analysis is based on the inherent patterns of the targetted instrument such as its price, volume, market trading; such information can be utilized to derive crucial points, oscillations, and other technical aspects. Though such analysis can be carried out using various technical indicators, knowledge of fundamental concepts can be integrated for a reliable financial market study [14]. This kind of study can be employed for stock market-based predictions, for example, assets allocation-based portfolio construction, one-day-ahead stock price prediction, to name a few.

An equity market or a stock market aggregates trading activities of financial instruments; trading include buying, selling, and issuance of various assets publicly as well as privately. The markets serve as platforms for interaction and trading of stocks, bonds, physical assets, and derivatives such as options, futures, forwards among potential buyers and sellers. While a primary market issues new securities on an exchange, investors buy and sell the securities they own in the secondary market; stocks can be traded on either of these markets. Stock-related concepts can be primarily grouped into stock price, stock price movement, i.e., trend, and stock portfolio; analyzing and examining the stock market to forecast its expected returns have been a subject of interest for financial traders as well as academic researchers to develop reliable prediction models. It can be useful in determining trading aspects, stock returns as well as futures, market volatility and liquidity, foreign exchanges, transaction rules, and other applicable measures that can predict the probable future value of a company’s stocks. Therefore, the calculation of the risk associated with expected return and/or profit is crucial. While investment corresponds to buying securities or assets for stable, generally long-term returns with moderate risk association, speculation can be related to executing risky and short-term financial transactions to gain higher profits [15, 16]. Depending on the intention, fundamental and/or technical analysis can be carried out to forecast the expected market returns. This has introduced the need for applying computational approaches to solve financial problems such as stock price prediction, optimal portfolio selection, asset allocation, price movement direction forecasting, market behaviour prediction. Such problems require studying a large number of historical data, company profiles, different transactions and associated factors to derive important information such as market trend, effects of the inflation rate or influence of the news; various machine learning as well as deep learning approaches have been adapted to solve complex financial problems [17, 18]. On the other hand, data mining, text mining, and other sentiment analysis-based techniques have also been explored to study the economy market and related social, financial, and content information [19, 20]. An optimal model configuration can be helpful to improve the resultant accuracy; hence, various nature-inspired metaheuristic approaches have also been integrated to dynamically optimize such methods.

Swarm intelligence and evolutionary algorithms have been developed with the primary objective of optimizing various real-world problems [21, 22]. A large number of nature-inspired algorithms have been proposed such as genetic algorithm (GA), ant colony optimization (ACO), particle swarm optimization (PSO), to name a few [23, 24]; these approaches have covered a vast range of applications and have also been expanding their applicability in various domains [25]. In case of limited availability of actual information and/or resources, the aim of finding a partial solution that can help to optimize the given problem requires such a metaheuristic approach [26]. One of the complex, non-linear time-series prediction problems is based on the dynamic financial markets; to address the same, a large number of optimization approaches have been integrated with machine learning, deep learning, data mining, as well as sentiment analysis-based approaches. While different methods have been used for financial market predictions, the continuous value data of the stock market have been significantly exploited using PSO due to its applicability and adaptability for continuous data [27]. In this article, we have pursued a comprehensive survey on the integration of PSO within various stock market aspects such as portfolio optimization, stock price prediction as well as stock trend forecasting. We have studied the implications of PSO in optimizing other stock market-related concepts such as trading, futures, returns, etc. The main objective is to develop a detailed understanding of critical stock markets, analyzing PSO-based existing approaches, and identifying correspondence among these methods and stock market predictions. While a large number of metaheuristic approaches have been compared for their robustness in complex problem-solving, PSO has demonstrated rapid convergence ability in the large search space [28]. The global optimum position attained by the particle agents can be significantly exploited to generate initial solutions; integration of such approach with other methods can be benefited from PSO’s convergence abilities. The limitation of being trapped into local optima may be overcome using other approaches such as GA [28]. PSO can be applied for continuous data, such as financial time-series data, as well as other dynamic and complex optimization problems, such as portfolio optimization. Though some of the existing literature works have reviewed PSO-based stock-related predictions, it is essential to expand the horizons within stock markets with recent works that have been addressed using PSO. Hence, we carefully develop our survey to explore the widespread applications of PSO in complex stock market prediction.

1.1 Stock Market Computations

It is desirable to study financial concepts associated with stock market before exploring different prediction techniques. The technical analysis plays a vital role in stock market predictions; it is used to observe inherent patterns of the stock price and forecast trading rules. Technical indicators based on such trading rules have resulted in significant positive return [29]; historical stock price data can be exploited to derive various technical indicators. Also, the impacts of conducting technical analysis on the resulted forecasting have been evaluated for various stock markets [29, 30]. Evidence has shown that fluctuations and recurrent patterns of the stock trend could be derived using technical indicators such as moving average (MA), relative strength index (RSI); such indicators can be constructed using historical stock price data.

The continuously updating stock price information can be recorded using a stock ticker. Such reports can be useful in determining the current market scenario as well as the interests of different traders in specific stocks or financial securities. The historical stock data generally consist of date or timestamp, open, high, low, close, as well as volume information about the stock. For an intraday trading, the timestamp data may be integrated for deriving stock market data at a specific interval, such as minutes, hours; date information can be useful for interday trading over one day or longer. While the opening or open price indicates the price at which the particular stock was first traded upon the opening of an exchange on a trading day, the closing or close price indicates the last traded price for the same; the highest and the lowest prices on which the stocks are traded on an exchange within the specific trading day are denoted using high and low, respectively; the total number of share trading carried out for specific security on an exchange in a trading day is given by volume. When a company gets listed on an exchange, its security trading information can be derived; in the case where a company gets listed on multiple exchanges, such historical data can be separately collected from respective exchanges. The purpose of expanding business dimensions can be served with the company’s stock trading on such exchanges. Some of the examples include New York Stock Exchange (NYSE), Nasdaq stock market (NASDAQ), Shanghai Stock Exchange (SSE), Shenzhen Stock Exchange, Bombay Stock Exchange (BSE), National Stock Exchange (NSE), to name a few. Stock data of the companies listed on such exchanges can be selected for predicting future stock price and/or trend.

Based on the historical data of stock exchanges, various technical indicators can be derived to utilize the stock patterns for prediction. Such indicators and their graphical representations can be adopted to determine useful information about stock patterns. A brief overview of some of the technical indicators and the computation method for the same is given in Table 1 (referred from [31]). These formulas are defined to evaluate technical indicator at time t for a time period n; the stock price has been denoted with X, e.g., stock close price. Such indicators can be plotted to analyze the stock patterns.

Table 1 Summary of Technical Indicators

1.2 Existing Surveys on PSO-Based Financial Applications

The stock market has been a subject of interest for different purposes. Integration of metaheuristics within learning algorithms have been frequently studied and their applications to the stock market have been observed. Though PSO-based stock market predictions have been reviewed in the past, the recent advancements in the given field and broader perspectives towards PSO and its financial applications have demanded a critical comprehensive survey. We aim to prepare this survey with the primary orientation towards providing a detailed review of PSO-based applications in stock markets; we believe that understanding of the financial market concepts can accommodate clarity in approaching the same using computational methods. Hence, we have tried to balance between economics and computer science while discussing PSO-based stock market prediction aspects.

One of the early surveys on PSO provided an overview of PSO developments and taxonomy, followed by a range of PSO applications [32]; the survey mentioned that PSO flexibility could be used for economic, financial, business as well as engineering, medical, and other applications. A survey on machine learning-based financial time-series prediction briefly included PSO-based stock prediction [33]. Another review article provided the evolution of PSO algorithm and indicated financial forecasting as one of the applications [34].

A comparison-based survey for the financial domain was carried out for artificial neural network (ANN), PSO, and GA in [35]; authors discussed portfolio management, credit evaluation, as well as financial prediction and planning within the financial market domains. Subsequently, PSO advances were categorized into modification, population topology, hybridization, extension, theoretical analysis, and parallel implementation in [36]; to cover various domains of applications, authors also reviewed the financial time-series prediction. Considering that the review literature that has majorly been limited around approaches such neural networks (NNs), GA, PSO, ACO, authors in [37] discussed the principles, developments, and applications of various heuristic, metaheuristic, and hyper-heuristic bio-inspired methods; however, the list of applications included the financial aspects addressed by bio-inspired algorithms other than PSO.

Computational intelligence-based various financial market applications were explored in [17]; authors provided a financial trading framework with forecasting using ANNs, support vector machines (SVMs), hybrid mechanisms, as well as their optimization models including PSO, GA, artificial bee colony (ABC). On the other hand, impacts of different bio-inspired approaches were reviewed in [38] for stock market prediction; such optimization methods were compared over stock market domains such as stock market prediction and portfolio optimization. Subsequently, swarm intelligence-based different ANNs were surveyed for optimizing stock market price in [39]; comparisons showed that the swarm intelligence approaches with ANNs could improve stock price predictions as compared to other machine learning approaches. A detailed survey was carried out on swarm intelligence for dynamic optimization problems such as discrete, continuous, constrained, multi-objective, and classification in [22].

One of the recent surveys on swarm intelligence studied PSO-based portfolio optimization for various portfolio models [27]; the implications of different swarm intelligence methods on portfolio optimization and potential extensions in the field were analyzed as well. Based on the covariance risk factor in mean-variance (M-V) portfolio optimization model, authors developed a survey on deterministic models and applications in [40]; the techniques included exact solutions, approximate solutions, as well as hybrid approaches. As compared to the scope of earlier surveys, we have restricted our study within PSO-based financial aspects to provide an exhaustive survey. We believe this study can be beneficial for developing broader perspectives of PSO in financial markets. The comparison of the coverage of relevant topics in the existing surveys and our survey is shown in Table 2.

Table 2 A comparative analysis of our survey with the existing PSO-based surveys under various criteria: C1- PSO, C2- Portfolio, C3- Stock price, C4- Stock trend, C5- Trading, C6- Returns, C7- Foreign exchange, C8- Hybrid, C9- Other financial aspects, C10- Stock market conceptualization

The remaining article is organized as follows: we have conceptually discussed PSO and a brief overview of time-series as well as financial market-related PSO applications in Sect. 2; we have elaborated the significance of portfolio optimization and various models, followed by PSO-based parameter optimization, modelling, and hybrid approaches for portfolio construction and optimization in Sect. 3; we have considered stock price prediction techniques where PSO has been applied for parameter optimization as well as hybrid methods in Sect. 4; we have reviewed the existing works in stock trend prediction based on parameter optimization and feature selection using PSO in Sect. 5; implications of PSO on other stock market concepts such as trading rules and strategies, returns, futures, etc. have been briefly reviewed in Sec. 6; stock market prediction using PSO and its variants, various features and linkages to potential stock market applications, limitations of the existing methods, challenges and future directions for potential enhancement have been discussed in Sect. 7; we have concluded our survey on PSO-based stock market-related forecasting and discussed the research aspects that may be considered for future research in Sect. 8. An overview of the coverage and categories of PSO-based stock market prediction that has been considered in this survey is shown in Fig. 1.

Fig. 1
figure 1

An overview of the coverage and categories of PSO-based stock market prediction

2 Particle Swarm Optimization

Nature consists of an enormous number of interactions within itself and with other creatures. Behaviours, as well as various activities of such creatures, have inspired researchers to develop artificial life theory in computational intelligence. The initial concept of exploiting the compatibility of social interactions instead of individual cognitive was developed for computational intelligence in [41].

The proposed PSO approach was inspired by the analogues of bird flocks that searched for corn. PSO is a swarm intelligence-based optimization approach that meets the primary five principles that can be applied for creating artificial swarm viz. proximity, quality, diverse response, stability, and adaptability [28, 42]. Here, the proximity principle specified simple PSO calculations based on time and space; the quality aspect demanded that a swarm should be able to sense and respond to the environmental changes; based on the diverse response-ability, the swarm should not have restricted scope so as to support diverse response principle; though the swarm should be stable enough not to change its behavioural mode with each change of the environment, it should be adaptable in order to change its behaviour, if that was worth.

2.1 Overview

PSO was initially proposed as an emulation of the social movement behaviour such as that of birds flock or fish school [41]. The swam entities were generalized with the term particles having a small amount of mass and volume, followed by velocity and acceleration. Thus, a particle swarm theory was developed to determine how particles move toward the global best position. Such entities were placed in the search space; the problems and/or functions were evaluated based on the movement of particles through the search space.

In a D-dimensional search space of PSO, each particle i can be represented with three vectors viz. current position \(X_i = (x_{i1}, x_{i2}, ..., x_{iD})\), particle’s optimal position, i.e., previous best position \(P_i = (p_{i1}, p_{i2}, ..., p_{iD})\), and velocity \(V_i = (v_{i1}, v_{i2}, ..., v_{iD})\); the optimal swarm position, i.e., global best position \(g_{best} = (g_{1}, g_{2}, ..., g_{D})\) is known to all m particles. For iteration \(t+1\), velocity and position coordinates of each particle are updated as given in Eq. (1) and (2), respectively [28, 43]; in order to restrict the particle velocity within a defined boundary, \(V_{min}\) and \(V_{max}\) are defined as the minimum and maximum allowable velocities, respectively. An iteration of PSO-based particle movement has been demonstrated in Fig. 2.

$$\begin{aligned}&\begin{aligned} V_{id}^{t+1} = \omega \times V_{id}^{t}&+ c_1 \times rand() \times (P_{id}^{t} - X_{id}^{t})\\&+ c_2 \times rand() \times (g_{best_d}^{t} - X_{id}^{t}) \end{aligned} \end{aligned}$$
(1)
$$\begin{aligned}&X_{id}^{t+1} = X_{id}^{t} + V_{id}^{t+1} \end{aligned}$$
(2)

where, \(\omega \) is the inertia weight; \(c_1\) and \(c_2\) present acceleration constants; rand() generates a random value within the interval [0, 1]; the velocity ranges within [\(V_{min}\), \(V_{max}\)]. In Eq. (1), the first term, \(\omega \times V_{id}^{t}\), denotes the influence of particle velocity in iteration t based on which it conducts inertial moving from the current position; subsequently, the second term, \(c_1 \times rand() \times (P_{id}^{t} - X_{id}^{t})\), has the cognitive acceleration factor associated with the particle’s own experience which determines its movement whereas the last term, \(c_2 \times rand() \times (g_{best_d}^{t} - X_{id}^{t})\), corresponds to the particle’s movement that is inspired by the movement of other particles and hence, based on the social acceleration factor [28]. Various modifications have been proposed in order to enhance the convergence ability and wide range of applicability of PSO.

Fig. 2
figure 2

An iterative particle movement in PSO (referred from [28])

An early survey on PSO, presented in [34], reviewed its evolution, variations, the stability aspects, as well as convergence abilities, including applications. In one of the recent literature studies, authors have provided an overview of PSO and its advances in [28] wherein various kinds of research works carried out for PSO were categorized into eight aspects: theoretical analysis-based PSO mechanisms, structural change-based performance analysis, impact of parameter settings, impact of topology selection, parallel PSO, discrete PSO, multi-objective optimization, and PSO for engineering domains.

2.1.1 Theoretical Analysis

It refers to the concepts and principle of PSO algorithm; the interactions among various particles and the effectiveness of the overall concept can be analyzed. Study of the evolution of PSO’s theoretical aspects can be utilized to understand its stability through various enhancements. According to [28], the research problems were divided into individual particle’s moving trajectory, convergence, and evolution and distribution of the swarm. To adapt PSO for stock market prediction problem, compatibility between the problem domain and PSO-based conceptual environment should match.

2.1.2 Swarm Structure Formation

The particles are capable of updating their structures in order to improve the performance; the formation of overall swarm in order to find the optimum position over a large-scale search space can be important aspect in optimization. Various swarm structures can be considered based on multi-sub-populations, learning object selection, velocity update formula and strategy, dynamic position and speed updation; these variations of PSO can be combined with other techniques for improving multi-modal problems and population diversity, as explained in [28].

2.1.3 Parameters of PSO

The inherent properties of such particles include position and velocity which help them to move towards an optimal position. Parameters such as inertia weight, learning factors, limits of speed and position, initial population and its size can be varied to attain the benefits of PSO within the given problem environment. For the given stock prediction model, such parameters need to be carefully selected. It can be helpful for global exploration as well as local exploitation.

2.1.4 PSO Topologies

The swarm of particles is associated with individual particles within the swarm; interaction in terms of local as well as global optimum positions can be useful to guide the swarm movement. Hence, the topology can be correlated with the neighbouring particle behaviour [28]. Such topologies can be static or dynamic which may be determined using particle index or with the topological distance among particles; utilization of such topologies can increase neighbourhood-based experience.

2.1.5 Parallel PSO

The operability of PSO can be conducted in a parallel manner to reduce the time complexity [44]; such technique can be enhanced using the system’s capability to derive feasible solutions within a limited time period. The same can be helpful for a real-time application such as stock market prediction.

2.1.6 Discrete PSO

Based on the problem domain, PSO can provide continuous or discrete solutions to optimize the encoding ability of the integrated approach. One of the continuous data examples is time-series data of the stock market which demonstrates the continuous characteristics of stock values. Discrete PSO, on the other hand, can be useful for solving binary problems such as instance selection for a time-series classification problem.

2.1.7 Multi-objective Optimization

An optimization approach can be applied to independently targetting functions to obtain an optimal value. It can be widely used in deriving Pareto optimal solutions of the problems for which finding a perfect solution is likely to be impossible because of the object conflictions [28]. Stock portfolio optimization can be considered as one of such problems that aim at achieving a near-optimal solution.

2.1.8 PSO in Engineering Domains

Based on diverse provisions of PSO and its variants, it can be applied to a large number of engineering as well as medical domain applications [28]. Integration of PSO with other learning-based approaches as well as ensembled evolutionary algorithms has been extensively explored [25]. Also, interdisciplinary problem domains such as financial markets can be ensembled with such metaheuristic approaches to attain higher result outcomes.

2.2 PSO Applications

The simplicity and problem-solving ability of PSO and its variants have been adapted in various domains to target complex optimization problems. PSO-based applications have been extended to electric power systems [45], wireless sensor networks [46], data clustering [47, 48], cruise cabin price forecasting [49], cloud computing [50], road pavement roughness prediction [51], low material wastage based on rectangular shape packing into circular container [52], travelling salesman problem [24], earthquake prediction [53], to name a few. It can be determined that PSO’s convergence ability can be integrated in a wide range of applications. Though our survey is restricted to PSO-based stock market prediction, we also summarize other financial market concerns, as well as time-series data, that have been addressed using PSO.

2.2.1 PSO in Various Markets

Economic discussions and financial market concepts can be expanded over an extensive variety. PSO has been incorporated to optimize and/or predict a variety of financial topics.

Technical indicators have been introduced in financial markets to assist market trend analysis. They have been exploited in various approaches to forecast future stock price movements and hence, to provide an appropriate trading signal, i.e., buy, sell, or hold. A stock trading system was proposed to optimize the weights of several technical indicators using multi-objective PSO (MOPSO) in [54]. The percentage profit and Sharpe ratio functions were considered with the end-of-day market data; the technical indicators optimization using MOPSO outperformed that using non-dominated sorting GA-II (NSGA-II). Here, Sharpe ratio is useful to derive the return of an investment as compared to the associated risk; it can be considered as an average return earned in excess of the risk-free rate per unit of volatility or total risk [55]. A PSO-based trade credit financing approach was proposed to obtain optimal selling price, replenishment number and schedule along the fluctuating demand [56]; the replenishment was stock restoration at the former level. Here, the credit period could be understood as the time duration provided to the buyers in order to simulate the demand, reduce some of the inventories, or increase the market share. For generalized type demand, a two-level trade credit policy-based approach applied PSO for pricing and time-varying demand and cost in [57].

The market fluctuations follow volatility clustering principle; such clustering was denoted as one of the reasons for degraded prediction performance of many generalized autoregressive conditional heteroskedasticity (GARCH) models. Therefore, authors proposed to apply PSO with an adaptive fuzzy-GARCH model to predict the stock market volatility in [58]. PSO was integrated to provide rapid convergence by optimizing membership functions. GARCH has also been used to measure stock market volatility; one of the enhancements consists of including range with GARCH, i.e., a conditional autoregressive range (CARRX) model for dynamic volatility. In [59], CARRX was used with least squares support vector regression (LSSVR) and adaptive PSO (APSO) to forecast the financial market volatility. The investment behaviours as well as stock category can be evaluated based on the quality of association rule mining; PSO-based optimal threshold values were predicted in [60]. Subsequently, turning point recognition, which is one of the deciding factors for buying or selling stocks, was predicted using a PSO ensembled SVM approach in [61]. Another application of PSO includes the creation of a profitability-based optimal trader for each market trader by optimizing adaptive Bollinger bands (ABB) parameters using PSO [62].

Apart from the financial stock markets, portfolio optimization technique could be developed for creating an investment profile in the electricity market as well; it was proposed to be helpful in deriving the amount of power that could be negotiated so as to increase the profits associated with the available market types [63]. While the prices were predicted using ANN, these expected prices were adapted for portfolio optimization using an evolutionary PSO (EPSO). Another approach using EPSO to provide electricity market participation prediction was proposed in [64]. Similarly, PSO-based hybrid approach for a simplified resolution using an exact method was proposed for solving the participation problem in multiple electricity markets [65]. Based on the electricity price prediction, a portfolio optimization model with risk measurement was proposed using PSO in [66]. In case of such markets where decisions should be made within a short time period, the simplified exact resolution was combined to determine the initial PSO solutions and hence, to derive optimized portfolio for an electricity market [67].

For biodegradable products, consideration of the degree of freshness, elasticity of demand against price, as well as sensitivity of demand towards the degree of freshness could be useful in determining the factors influencing product prices. PSO-based ANN approach was proposed for dynamic price strategy forecasting for such perishable products in [68]. On the other hand, one of the popular agricultural products, soybeans, was considered for futures price prediction using dynamic model averaging (DMA) with PSO in [69]; PSO was used to optimize two forgetting factors and a decay factor of DMA. The proposed DMA-PSO showed prediction enhancement for Chinese soybeans futures price forecasting.

Based on the time-varying characteristics of international crude oil prices, a hybrid method was proposed to forecast its future price in [70]. Authors adopted ensemble empirical mode decomposition (EEMD) approach to decompose the time-series into intrinsic mode functions (IMFs) and residual terms; the non-linear components were predicted using least square SVM (LS-SVM) with PSO (LSSVM-PSO) whereas the time-varying components were forecasted using GARCH model. The combined predicted values could achieve higher performance accuracy. While the time-series data concept was initially referred to as the stock market data, its adaptability has been expanded to the industrial environment as well. In [71], authors introduced industrial safety prediction; the long short-term memory (LSTM) was aggregated with PSO and gradient descent (GD) to obtain optimal parameters.

3 Portfolio Optimization

Investment in a non-linear financial market may introduce uncertainty; risk aversion behaviour of humans would impel them to attempt towards reducing such unpredictability. For different investment schemes that are expected to be providing a similar return, a risk-averse investor is likely to select the scheme with lower risk. Because individuals repeatedly invested to create a panel of risk aversion estimates, a correlation between relative risk aversion (RRA) and wealth was found in [72]. This can be helpful in understanding how an individual may choose to invest in different securities as well as hold a market portfolio. In order to maintain transparent trading within capital markets, disclosure of portfolio information is mandatory; such clarification can also affect the performance as well as the liquidity of the disclosed stocks [73].

A portfolio can be considered as a group of financial assets such as securities, stocks, funds, or cash equivalents; in order to maximize the expected return and to minimize the associated risk, portfolio diversification has been adopted by a large number of investors. Majority of the risk-averse investors do not engage in the market with risky assets; various studies have discussed emotions such as fear and their influences on risky investment attitudes, selection of portfolios, as well as returns [74]. Investors follow specific models and act accordingly to rebalance the portfolio in case of facing price fall, for example, the traditional Merton model considered purchasing risky assets whereas a fear-based model preferred selling out risky assets [75]. Hence, identification of one’s attitude towards risk management, selection as well as optimization of a suitable portfolio, and consideration of the corresponding model is a crucial task. It can be seen that risk is in-built with higher returns. The modern portfolio theory focuses on how risk-averse investors may select a portfolio that would generate maximum expected returns [5]. Various models include M-V, variance with skewness (VwS), semi-variance (S-V), mean-absolute deviation (MAD), value-at-risk (VaR), minimax (MM), and conditional VaR (CVaR).

Portfolio optimization can be broadly categorized into portfolio construction, selection, and management tasks. The unconstrained (UC) portfolio optimization has been extended by incorporating various constraints to ensure realistic portfolio management [27]. Boundary constraints (BC) introduced a limit on the lower as well as upper limits to ensure that the investment amount lies within a certain range; this can be helpful in reducing the costs associated with small portions in a portfolio. Cardinality constraints considered limiting the maximum allowable number of securities that can be held in a portfolio so as to assist easy management. Transaction costs determine the amount payable for purchases, sales, and revisions of securities; such costs can significantly affect the expected outcomes and hence, must be incorporated for realistic portfolios. The transaction lots of each security could be rounded to the nearest integer value by adding constraints on the minimum or maximum transaction units. Constraints such as budget, floor and ceiling have also been considered to construct practical portfolios.

In order to demonstrate the applicability of PSO for stock market portfolio optimization, we have briefly categorized it into parameter optimization, modelling, and hybrid approaches including PSO with other nature-inspired algorithms.

3.1 Parameter Optimization

Identification of optimal parameters for the given model can significantly improve the prediction performance. While a large number of machine learning, as well as deep learning techniques, have been used for portfolio optimization, PSO and its variants have been adapted to optimize the parameter values.

An index fund can be considered as a type of mutual fund with a portfolio; such a portfolio is constructed to track the components of a financial market index. Such funds maintain their benchmark index irrespective of the market state. The co-movement of stock returns varies over time based on the investors’ operations [76]. Hence, a hybrid model was proposed for portfolio optimization by adopting such time-scale features in [77]. The time-scale features were decomposed using maximum overlap discrete wavelet transform; weights of each scale were optimized using PSO as given by the optimizing objective function in Eq. (3) [77].

$$\begin{aligned} minimize~~\lambda _\alpha |{\hat{\alpha }}-0| + \lambda _\beta |{\hat{\beta }}-1| \end{aligned}$$
(3)

where, \({\hat{\alpha }}\) and \({\hat{\beta }}\) indicated the ordinary least-squares regression intercept and slope; \(\lambda _\alpha , \lambda _\beta \ge 0\) defined weighting values. As compared to the Canakgoz’s approach, the average values of \(|\alpha |=0.00048\) and \(|1-\beta |=0.10378\) improved the proposed approach [77]. The weighted time-scale features were used to create homogeneous clusters of securities, followed by constructing an optimal portfolio for index tracking.

To solve the constrained portfolio optimization problem, prediction-based mean-variance (PBMV) model was proposed to predict the expected returns instead of using the mean of past returns [78]. The variance of errors associated with the expected portfolio returns was taken as the risk measure. Hence, the risk and return were determined using a low complexity heuristic functional link ANN (HFLANN) where the structure weights were determined using PSO. On the other hand, the portfolio optimization task was carried out using self-regulating multi-objective PSO (SR-MOPSO). For the given portfolio problem, objectives were defined as Eq. (4) [78].

$$\begin{aligned} minimize~~\text {both}~{\hat{\sigma }}_p^2~\text {and}~-R_p~\text {simultaneously} \end{aligned}$$
(4)

where, \({\hat{\sigma }}_p^2\) indicated total portfolio risk; \(R_p\) indicated the predicted portfolio return.

3.2 Modelling

Various metaheuristic algorithms can be suitable for problem modelling. Such models can be integrated with stock market information to target portfolio management-based problems.

A PSO-based heuristic method was proposed to solve the extended Markowitz portfolio selection model in [79]; it included bounds on holdings, cardinality, minimum transaction lots, and sector capitalization constraint sets. A combined approach of binary PSO (BiPSO) and improved PSO (IPSO) was proposed to select securities from the available ones in order to satisfy cardinality constraints and to attain investment amounts for the selected securities. Here, each particle’s fitness value was calculated by Eq. (5) if it belonged to a feasible region and by Eq. (6), otherwise [79].

$$\begin{aligned} F_{fit} = f(\overrightarrow{x^*}) \end{aligned}$$
(5)

where, \(\overrightarrow{x^*}\) indicated point-wise multiplication of vectors representing the invested amount (\(\overrightarrow{x}\)) and M selected securities (\(\overrightarrow{z}\)).

$$\begin{aligned} \begin{aligned} F_{fit} = max \Bigg [&\Bigg ( B - \sum _{d=1}^{N} x_{d}z_{d}c_{d} \Bigg ), \Bigg ( BR - \sum _{d=1}^{N} x_{d}z_{d}c_{d} {\overline{R}}_{d} \Bigg ), \\&\Bigg | \sum _{d=1}^{N} z_{d} - M \Bigg |, \Delta _{s}^{-} \Bigg ] + BigN \end{aligned} \end{aligned}$$
(6)

where, B denoted total budget; \(c_d\) defined minimum transaction lot for asset d and \(x_d\) defined number of purchased \(c_d\)’s; \(z_d\) indicated the decision variable for cardinality constraint; \({\overline{R}}_{d}\) specified the expected portfolio return value; \(\Delta _{s}^{-}\) defined the deviation of particle position from the constraint; N denoted the available securities whereas BigN represented a large number.

One of the financial instruments is options; based on the strike price for buying or selling the security before its expiration date, the option contract must be used. They can be divided into call options for buying and put options for selling the asset at a stated price within a specific timeframe [80]. One of the reasons for trading options can be reduction of the risk exposure of portfolios. Hence, a normalized PSO (NPSO) model was proposed for portfolio management in [81]; the preferable stock prices and feasible time period to buy or sell the underlying asset(s), i.e., the exercise time, were determined to optimize a portfolio.

Modelling an optimal portfolio may get difficult with an increase in the number of available assets. To address a large-scale asset allocation problem, multi-objective dynamic multi-swarm PSO (DMS-MO-PSO) was proposed in [82]. While each particle learned from its historical as well as local best information in DMS-PSO [83], the local best was selected from the non-dominated solutions obtained during the search process in DMS-MO-PSO. To maintain the portfolio diversity, particles’ self-learning was ceased to speed up the convergence process.

A comprehensive learning PSO (CLPSO) was proposed to update a particle’s velocity based on the previous best information of all other particles [84]. It was showed to outperform many PSO variants for the multi-modal problems. Based on CLPSO, a dimension-decreasing PSO (DDPSO) was proposed in [85] where the particle dimensions after a certain number of iterations were cut. Such a concept could be useful for the portfolio optimization task where an investor might choose to invest in a specific number of assets out of the available ones. DDPSO could deal with multi-constrained portfolio optimization problems.

In PSO population, degree of a particle derives the number of neighbouring particles maintained; structures of such population topology has shown to have a direct impact on the performance [86, 87]. A random topology can be generated with a fixed number of neighbours for each particle under random population topology based on the degree (RT-D) strategy, whereas random topology with a given average degree can be created and maintained during PSO evolution in random population topology based on the average degree (RT-AD) strategy. Dynamic RT (DRT) strategies, on the other hand, indicate generation of random topologies with a specific degree after every number of generations; here, the degree may be fixed, i.e., DRT-D, or average degree, i.e., DRT-AD. Hence, PSO variant with inertia weight (WPSO) was extended as RTWPSO-AD, RTWPSO-D, DRTWPSO-AD, and DRTWPSO-D approaches in [88]. These methods were applied to cardinality-constrained portfolio optimization using M-V model (CCMV) as given by Eq. (7) [88]; the experimental results enhanced the performance.

$$\begin{aligned} f_p = \lambda \Bigg [ \sum _{i=1}^{N} \sum _{j=1}^{N} z_{i} x_{i} z_{j} x_{j} \sigma _{ij} \Bigg ] - (1-\lambda ) \Bigg [ \sum _{i=1}^{N} z_{i} x_{i} \mu _{i} \Bigg ] \end{aligned}$$
(7)

where, \(\lambda \) indicated risk aversion parameter; N denoted number of different assets; for asset i, \(z_i\) defined the decision variable whereas \(x_i\) specified the proportion; \(\sigma _{ij}\) defined the covariance between returns of assets i and j and \(\mu _i\) indicated the mean return.

Similarly, a DRT-based generalized portfolio selection model was proposed in [89] by considering DRT-AD, DRT-D, DRT based on linear increasing AD and D, i.e., DRT-LIAD and DRT-LID, respectively. The proposed strategies were modelled using PSO with constriction factor (CPSO) for CCMV as DRTCPSO-AD, DRTCPSO-D, DRTCPSO-LIAD, and DRTCPSO-LID where the linear increasing-based approaches outperformed solving portfolio selection problem. The fitness function was evaluated using Eq. (7) [89].

While the constraints can be applied in generating a portfolio, constraint handling can be a challenging task in order to find feasible solutions. Some of the existing constraint handling methods include penalty function and augmented Lagrangian methods; they converted the constrained portfolio optimization problem into an unconstrained problem where the algorithm had to search over (n-dimensional) fitness landscape, i.e., the complete search space. Hence, to overcome large dimensionality search problem, particle repair method and preserving feasibility method were proposed in [90] based on bare-bones PSO (BBPSO) approach. The particle repair method translated infeasible solutions into feasible ones, which outperformed traditional constraint handling methods in various dimension. Subsequently, preserving feasibility method augmented the update operator of BBPSO as given by Eq. (8) [90] such that after being initialized within a feasible region, the particles never left the region; its performance degraded with an increase in the problem dimensionality.

$$\begin{aligned} \begin{aligned} minimize~~\phi (x_i, t)_L&= f(x_i) \\&+ \frac{1}{2} \mu _E(t) C_E(x_i)^2 - \lambda _E(t) C_E(x_i) \\&+ \frac{1}{2} \mu _B(t) C_B(x_i)^2 - \lambda _B(t) C_B(x_i) \end{aligned} \end{aligned}$$
(8)

where, \(x_i\) denoted each particle i in swarm X; \(\lambda _E(t)\) and \(\lambda _B(t)\) indicated time-dependent coefficients that were initialized to 0.5 whereas \(\mu _E(t)\) and \(\mu _B(t)\) specified time-dependent constraint penalty coefficients, initialized to 2.0; functions equality constraint \(C_E(x_i)\) and boundary constraint \(C_B(x_i)\) were given by Eq. (9) and (10), respectively.

$$\begin{aligned} C_E(x_i)= & {} 1.0 - \sum _{j=1}^{n}x_{ij} \end{aligned}$$
(9)
$$\begin{aligned} C_B(x_i)= & {} \sum _{j=1}^{n} b(x_{ij}) \end{aligned}$$
(10)

where, \(b(x_{ij})\) was given by Eq. (11).

$$\begin{aligned} b(x_{ij}) = {\left\{ \begin{array}{ll}|x_{ij}|, &{} \text {if}~x_{ij}<0.0\\ 0, &{} otherwise\end{array}\right. } \end{aligned}$$
(11)

In the real-life scenario, a financial expert has information regarding the sector capitalization, price/annual earning, management calibre, dividend rate, etc.; an in-depth analysis could aid the guide’s opinion about inclusion or exclusion of an asset within a portfolio. Hence, an extended Markowitz M-V model was proposed by introducing expert opinion constraint for real-life portfolio selection in [91]. Authors incorporated bounds on holdings, cardinality, minimum transaction lots, and expert opinion constraints; PSO approach was used to solve the portfolio selection problem. This model was classified as a quadratic mixed integer programming model; comparison with GA indicated an improved portfolio optimization using PSO for different test-cases.

One of the comparative studies between cardinality-constrained efficient frontier (CCEF) and unconstrained efficient frontier (UEF) models was carried out using cat swarm optimization (CSO), bat algorithm (BA), and PSO in [92]. For portfolio optimization, such efficient frontier could be considered as an example of Pareto optimal set [93]. The results have discussed the significance of risk associated with the returns. Apart from the existing approaches, authors in [94] considered distributional asymmetry and parameter uncertainty aspects for performance improvement in a portfolio optimization problem. For this reason, the higher moments such as skewness and kurtosis were integrated to describe the risk behaviour of an asset. An MOPSO was adopted for a portfolio-based uncertain multi-objective problem to generate robust efficient solutions.

Based on the fuzzy set theory, Sharpe ratio and VaR ratio were used to build a multi-objective portfolio selection model in [95]. VaR ratio reflected the risk premium per unit of the systematic risk; here, the risk premium indicated the return in excess of the risk-free rate of return an investment was expected to yield. In other words, it determined the extra amount gained by investing in a risky asset as compared to the amount that the same investment could have received by investing in a risk-free asset. Thus, VaR ratio had an index with dimensional knowledge. The portfolio selection was carried out using fuzzy simulation-based MOPSO (FMOPSO); the global best was conducted by an improved dominance times-based approach for each iteration [95]. The proposed approach could determine portfolio composition based on the conflict between Sharpe ratio and VaR ratio.

The multi-objective optimization problems may involve parallel optimization of multiple objectives which may conflict with each other; instead of having a single solution, such approaches generate a set of solutions that compromise objectives. MOPSO is one of the dominance-based algorithms which was tested against decomposition-based multi-objective evolutionary algorithms (MOEA/D) to solve constrained portfolio optimization [96].

A variation to PSO, namely, dynamic search space PSO (DSSPSO), was proposed with the concept of population entropy to enhance the speed of searching as well as convergence accuracy [97]. A portfolio selection model was developed using DSSPSO in [98]; authors identified that it was also suitable to find securities portfolio with certain low-risk interests. Such a dynamic approach showed efficient optimization for the constrained portfolio selection problem. To make an investment decision for a risk-constrained portfolio, the unbalanced returns of assets were considered in [99]; the general portfolio model and combined constraints of market value and upper bound were analyzed using PSO. Also, the investment decision model with irrational consumer behaviours was transformed into a linear planning-based model problem. Authors proposed to use automatic factor scaling for adaptive learning of the PSO parameters and evaluated the prediction performance.

In order to handle the risk associated with various sources in the investment process, risk parity was integrated within cardinality-constrained portfolio optimization problem in [100]. Authors addressed the mixed integer programming problem using an improved hybrid constraint-handling MOPSO (HMOPSO) to deal with cardinality, quantity, and risk parity constraints at the same time [101]. Based on the feasibility ratio \(r_f\), an objective function was defined as Eq. (12).

$$\begin{aligned} F_j(x_s) ={\left\{ \begin{array}{ll}\phi (x_s, \tau ), &{} \text {if}~r_f = 0 \\ \sqrt{f_j(x_s)^2 + \phi (x_s, \tau )^2} &{} \\ ~+ (1-r_f) \phi (x_s, \tau ) &{} \\ ~+ r_f f_j(x_s), &{} \text {if}~r_f \ne 0~\text {and}~x_s \notin \chi \\ f_j(x_s), &{} \text {if}~r_f \ne 0~\text {and}~x_s \in \chi \end{array}\right. } \end{aligned}$$
(12)

where, \(\phi (x_s, \tau )\) denoted the overall constraint violation for candidate portfolio \(x_s\); \(\tau \ge 0\) denoted a tolerance parameter to retain the infeasibile solutions nearby the feasible region; \(\chi \) indicated the Pareto set of portfolios; \(j=1,2\) were used to provide normalization formula for functions \(f_1\) and \(f_2\).

A particle’s position and velocity are important properties in PSO; velocity can be helpful in identifying a particle’s local position learns based on the local as well as global solutions. For cardinality constrained binary optimization problem of a portfolio, mapping smaller number of solutions to higher-dimensional solution space might lead to early stagnation, i.e., sparse velocity PSO (SV-PSO); therefore, using an untransformed solution to define BiPSO velocity direction was proposed in [102] as continuous velocity PSO (CV-PSO). With the varying number of assets available for a fixed stock size, CV-PSO provided reliable results as compared to SV-PSO [102].

3.3 Hybrid

Though PSO and its variants are capable of deriving optimal portfolios, some of their limitations such as local search or premature convergence may be addressed using other nature-inspired algorithms. Such hybrid methods can be suitable for generating robust solutions.

In order to select efficient funds and allocate optimal assets for portfolio optimization, GA and PSO were integrated [103]. Mutation and elitist strategy were adopted, respectively for avoiding local optima and for faster evolution in PSO. Another approach considered PSO to optimize an unrestricted risky portfolio and determined optimal parameter values using GA [104]. Based on the expected value, semivariance, and CVaR parameters, a hybrid portfolio optimization model was proposed in [105]. Authors considered transaction costs experienced for the buying as well as selling assets in the proposed multi-stage portfolio optimization. The parameters of GA and PSO-based hybrid approach were selected using a Taguchi experimental design method; it was intended to reduce the impact of uncontrollable factors whereas to identify the suitable levels of controllable factors based on robustness [106].

In order to ensure optimal asset allocation for minimum risk and maximum returns, a hybrid approach combining clonal selection and PSO was proposed in [107] and followed the fitness function given by Eq. (13).

$$\begin{aligned} maximize~~\alpha _1 (w^Tm) - \alpha _2 \Bigg ( a + \frac{1}{t(1-b)} \sum _{k=1}^{t} u_k \Bigg ) \end{aligned}$$
(13)

where, \(w^T\) denoted the asset weights; m defined the mean of daily yield for each stock; \(\alpha _1\) and \(\alpha _2\) indicated the investor preferences; the degree of belief for an objective function and CVaR were given by a and b, respectively; \(u_k\) represented the portfolio loss in \(k^{\text {th}}\) day of t trading days. A class of immune algorithms (IAs), i.e., clonal selection algorithm was inspired by biological cloning and hypermutation concepts; for portfolio optimization based on clonal selection (POCS), antibody represented a portfolio with parameters such as return for each stock, expected return, expected risk, and fitness function. POCS integrated with PSO (POCSPS) outperformed individual approaches with an increased fitness for a medium population size [107].

For large portfolios, a hybrid PSO approach was proposed in [108] where the global best position of particle swarm acted as the initial point to sequential quadratic programming (SQP) algorithm; it could utilize the faster convergence ability of SQP based on the optimal starting point derived using PSO. Hence, the proposed method could handle the diversification for cardinality constrained portfolio optimization; Eq. (14) defined the fitness function considered in [108].

$$\begin{aligned} f({\overline{W}}, \mu _i, \sigma _{ij}, \lambda ) = \lambda \sum _i \sum _j W_i W_j \sigma _{ij} - (1-\lambda ) \sum _i W_i \mu _i \end{aligned}$$
(14)

where, \({\overline{W}}\) represented the portfolio weights; \(W_i\) denoted the portfolio weight to be assigned to asset i; \(\mu _i\) defined the expected return whereas \(\sigma _{ij}\) defined covariance between the returns of assets i and j; \(\lambda \) indicated a risk aversion parameter.

Though PSO has been widely applied to the portfolio optimization problem, it may encounter being trapped into local optima. Hence, beetle antennae search (BAS) was integrated with PSO as the beetle swarm optimization (BSO) approach for constructing an investment portfolio model [109]; BSO was proposed to provide the judgement ability to each particle. While PSO is capable of efficient global search, its premature convergence may become one of the drawbacks; based on the potential local search ability of an external optimization (EO), a combined eo-PSO approach was introduced to solve cardinality and bonding constraints-based portfolio optimization problem in [110]. Also, a chaotic mutation operation was considered for exploration and the fitness was calculated using Eq. (14).

A two-stage hybrid PSO was proposed by including budget and restriction on short sale constraints for portfolio selection and optimization tasks [111]. Authors considered mean return, variance of return, and return as the profit, risk, and selection criteria, respectively. It was named as the financial tool-box PSO (FTB-PSO) where portfolio construction, mean and standard deviation (SD) calculations, and the task of plotting assets as particles were carried out using FTB of MATLAB. Here, Sharpe ratio was considered as a fitness function, as defined by Eq. (15) [111].

$$\begin{aligned} Sharpe~ratio = \frac{R_p - R_f}{Standard\, Deviation(p)} \end{aligned}$$
(15)

where, \(R_p\) defined mean return of the portfolio p whereas \(R_f\) defined the risk-free rate of return for the assets.

A portfolio optimization approach has been experimented with methods based on swarm intelligence [112]. Using the resultant return, variance-measured risk, Sharpe ratio, and per iteration time, various algorithms such as cuckoo search (CS), harmony search (HS), elephant herd optimization (EHO) algorithm, bat echolocation algorithm (BEA) along with PSO have been evaluated. Comparison analysis showed stable results with high Sharpe ratio while using CS and HS whereas EHO and BEA could significantly optimize the portfolio.

On the other hand, recurrent reinforcement learning (RRL) and PSO were combined with Calmar ratio for asset allocation as well as constraint optimization in [113]. Here, Calmar ratio was considered as the fitness function for asset selection and weight allocation as given by Eq. (16); it served as an objective function for RRL whereas as the fitness function for PSO-based methods.

$$\begin{aligned} C_T = \frac{\gamma ^ T}{E(MDD)} \end{aligned}$$
(16)

where, T denoted the time horizon; \(\gamma \) indicated mean of returns; E(MDD) defined the expected maximum drawdown. Authors proposed to create portfolio trading systems to generate short and long signals while handling the portfolio constraints. These included PSO, IPSO, drift PSO (DPSO), and many optimization liaisons PSO (MOLPSO) with RRL portfolio. Also, the transaction cost was handled using the market condition stop-loss retraining mechanism for an adaptive RRL-PSO portfolio rebalancing decision system [113].

The degree of membership could deal with imprecise concepts using fuzzy logic; thus, it could be used to partly assign data to multiple clusters. A fuzzy clustering-based PSO (FPSO) was ensembled with granular computing (GC) technique for portfolio optimization in [114]. Authors considered dividing stocks into granules and further divided them into small clusters in order to maximize portfolio returns using diversification and evaluated such solutions using fitness function for fuzzy relationship X given by Eq. (17).

$$\begin{aligned} f(X) = \frac{K}{J_m} \end{aligned}$$
(17)

where, K denoted a constant whereas \(J_m\) defined fuzzy C-means objective function as Eq. (18).

$$\begin{aligned} J_m = \sum _{j=1}^{c} \sum _{i=1}^{n} \mu _{ij}^{m} d_{ij} \end{aligned}$$
(18)

where, \(\mu _{ij}\) denoted the membership value of object i to cluster j; n and c denoted the matrix size of velocity, i.e., number of rows and number of columns, respectively; \(d_{ij}\) defined the Euclidean distance. The six information granules were formed based on the capitalization properties of the clustering stock members [114]; efficient portfolio management could be achieved using the proposed approach.

A summary of the existing approaches for PSO-based portfolio optimization and parameter specifications is given in Table 3. The reviewed articles have been summarized based on their targets, features considered and methods followed. We have also provided the dataset specifications including the duration for which specific dataset was considered for the experimentation along with PSO parameter values. We have briefly summarized the results obtained using specific approach.

Table 3 Summary of PSO-based portfolio optimization approaches

4 Stock Price Prediction

In order to trade various stocks, their prices are evaluated and predicted for future stock valuation. The short-term price prediction may indicate intraday price, within an hour or an interday price, such as one-day-ahead price prediction; on the other hand, the long-term price prediction regards to weekly, monthly, or yearly basis. Various price prediction techniques can be integrated with PSO for improved forecasting accuracy. Hence, we have considered parameter optimization, as well as hybrid techniques, followed using PSO for stock price prediction.

4.1 Parameter Optimization

In order to analyze the non-linear time-series data of stock prices, various machine learning approaches such as ANN, SVM, clustering [33, 115, 116] have been considered; similarly, deep learning networks have been applied as well [117]. The prediction accuracy of such algorithms is likely to be influenced by the weights of the framework. Hence, different swarm and evolutionary approaches have been incorporated for parameter optimization of the existing methods.

The inherent non-linearity of the stock price data can be addressed by SVM kernel functions. Based on SVM, an SVR-based third-day stock close price prediction was carried out in [118]. Authors proposed to use Gaussian radial basis function (RBF) (\(\sigma \)) for SVR kernel and considered PSO to optimize \(\sigma \), penalty coefficient (C), and insensitive loss coefficient (\(\varepsilon \)); the particles were given random initial values for \(\{C,\sigma ,\varepsilon \}\) combination as current positions and their speed and positions were updated to reduce the error rate of SVR.

A three-level NNs-based ensemble model was proposed in [119] for improving financial returns by considering that an ensemble model could improve the performance as compared to several base models. It combined Elman network, generalized regression NN (GRNN), and wavelet NN (WNN) using SVM NN in a non-linear manner. The proposed meta-learning modelling integrated different training set and different learning approach methods and the base models were optimized with IPSO; it consisted of adaptive inertia weights and the dynamic arccosine function acceleration parameters. While weights and bias of NNs were optimized with decimal PSO (DePSO), the architecture was optimized with BiPSO to predict one-day-ahead stock price.

Considering the existing ensemble models, it was pointed out that a linear weighted approach might not be suitable for non-linear time-series data such as stock prices. In [120], authors proposed to predict stock e-exchange price using Elman network, GRNN, and WNN with SVM NN similar to that in [119] where model parameters were optimized using IPSO using DePSO and BiPSO. Here, two-point crossover and mutation operations of GA were incorporated in IPSO. The proposed approach, ANNs-PSO-GA [120], delivered significant improvement in predicting stock indices with high volatility and noise.

While global search capabilities of PSO have been adapted for solving various financial problems, other approaches having the ability to search within local areas may be exploited and/or combined with PSO so as to boost the overall performance. The local search advantages of back-propagation (BP) NN (BPNN) were integrated with adaptive PSO as HBP-PSO for predicting stock price in [121]. PSO was utilized to train connection weights and thresholds of BP; here, the mean value of errors between the predicted and the actual output was used as a fitness function. Based on the global search of PSO, BPNN was applied then onwards to ensure that it did not get trapped into local optima. The proposed approach overcame the standard BP model; the forecasting outcomes were useful for stock price trend prediction as well.

A TSK fuzzy model-based structure identification method was incorporated for stock price prediction in [122]. The primary task of relevant input selection was carried out with mutual information using variable ranking (VR) as well as sequential forward input selection (SFIS) methods; the fuzzy if-then rules were generated using fuzzy c-means (FCM) clustering followed by fixing parameter search space boundaries. Authors proposed to optimize the premise and consequent parameters by using cooperative random learning PSO (CRPSO). As compared to the VR-based approach, SFIS showed improved performance in case of considering mutual dependencies among input variables. Hence, the proposed model with five rules [122] enhanced one-day-ahead stock price forecasting.

Another SVM-based stock price forecasting method was proposed in [123] where SVM parameter weights were optimized using PSO. Authors also considered ANN and Naïve Bayes classifier (NBC) for the same; as compared to ANN, NBC, and LS-SVM, the proposed SVM-PSO model achieved the highest accuracy for short-term stock price prediction. Similarly, SVM, LS-SVM, and partial least squares (PLS) were employed for stock price prediction application in [124]. The derived LS-SVM used equality constraints in SVM and hence, transformed the quadratic programming problem into linear equation groups; the reduced calculation complexity could be helpful in reducing the number of parameters that needed to be optimized in LS-SVM. The ability of PLS to solve problems with variable dependencies was considered as well. Results indicated that cross-validation (CV) LS-SVM and PSO-optimized LS-SVM could improve the prediction accuracy whereas PLS could achieve similar accuracy as that of SVM. It can be understood that SVM may be applied to small-scale stock data whereas LS-SVM may be suitable in resolving high-dimensional complex stock data prediction. Subsequently, PSO-optimized SVR forecasting models were proposed for stock price prediction in [125] and [126].

Among various modifications and advances of PSO, simplified swarm optimization (SSO) [127] was proposed to randomly update rules and discard the concept of velocity in PSO. SSO has demonstrated more effectiveness as well as higher stability as compared to the traditional PSO in order to identify optimization solutions [128]. However, a lack of variety in the solutions may lead to a slower convergence rate. In one of the conditions of SSO, a random new position is selected without having been related to the previous position; this may emphasize stochastic search behaviour of SSO. Hence, a combined approach, PSOSSO, was developed for stock price prediction in [129]. It integrated the velocity factor of PSO within SSO as an undated rule; fuzzy WNN (FWNN) prediction model was optimized using PSOSSO.

In order to maintain the search space diversity, the physical principle of center of mass was integrated with PSO as PSOCoM to support cognitive behaviour of the particles [130]. For stock index prediction, authors considered an adaptive linear combiner with parallel inputs as the features calculated from technical indicators. With respect to the mean-squared error (MSE) objective function, the performance of PSOCoM was compared with PSO, BFO, adaptive BFO (ABFO), and GA for long-term and short-term predictions.

For the purpose of intraday stock price prediction, a multiresolution technique, variational mode decomposition (VMD) was integrated with BPNN whereas its initial weights were obtained using PSO in [131]. The primary benefits of applying VMD for financial time-series was to derive similar frequencies for improved characterization of the noisy intraday stock price data and it could be effective towards denoising [132]. Authors set the number of extracted modes to ten which showed to be determining enhanced prediction accuracy with the proposed VMD-BPNN-PSO approach when evaluated with prediction error-based fitness function [131].

Various ANN approaches were compared for stock index prediction in [133] which included multi-layer perceptron (MLP), RBF, and an optimized RBF NN. From the stock data, a set of centers of an RBF NN was optimized using PSO. The updated set of centers were utilized in the proposed, optimized RBF approach; evaluation of the weekly stock data of various companies indicated improved results achieved from the proposed method as compared to MLP and RBF. On the other hand, a BPNN-based model was proposed with PSO and GD for predicting the next-day stock close price in [134]. The fast convergence ability of PSO towards the global optimum whereas local optima handling tendency of BPNN were integrated for stock price prediction.

A hybrid ANN model was adapted for stock price forecasting along with CS, improved CS (ICS), ICSGA, GA, and PSO metaheuristics in [135]. The comparative analysis disclosed the highest performance improved attained using PSO. Other approaches include ANN model optimized with PSO for predicting the next-day high price [136]. Similarly, WNN was proposed for stock price prediction where the suitable initial network configurations were determined using PSO [137]; the experimental results found that this method could accomodate drastic change within stock prices. To deal with the possibility of over-fitting ANN weights, probabilistic network weights were determined using bayesian-regularized ANN (BR-ANN) in [138]. Authors proposed to address the uneven distribution of network weights and optimized them using PSO; the technical indicators were utilized with daily stock market prices to predict one-day future close price. Using a self-adaptive variant PSO for optimizing the weights and threshold of Elman network was proposed for short-term stock open price prediction in [139]; this approach considered only the historical open price data for training the network. Results indicated enhanced prediction accuracy as compared to Elman network as well as BPNN.

Based on the supply and demand forces, the equilibrium monetary value of a traded stock can determine the clearing price. A hybrid approach for hourly prediction of market clearing price of electricity was proposed in [140]; while PSO was used to optimize NN learning ability, GA was combined to enhance the NN structure optimization. Authors considered k-means clustering method for seasonality pattern detection. The proposed method improved prediction accuracy as compared to BA-based NN.

4.2 Hybrid

While PSO has been largely applied for parameters optimization to forecast stock prices, other approaches can also be integrated in an ensembled way to improve the prediction performance.

For stock index forecasting, FLANN was hybridized with improved wavelet mutation (WM) based PSO in [141]. The proposed IWM-PSO-FLANN model could expand mutation range by integrating PSO with the wavelet theory. The motivation behind application of WM was based on the observations that PSO could sharply converge in the initial phase whereas could saturate or even terminate during the later phase; by introducing WM in PSO, each particle could have an opportunity to mutate. Hence, for financial time-series data, IWM introduced expansion of mutation range during each generation [141]; expansion using Chebyshev and trigonometric functions determined improved index prediction accuracy of IWM-PSO-FLANN.

We have briefly summarized existing PSO-based stock price prediction approaches along with the parameter specifications in Table 4. Along with the prediction aim such as close price, open price, etc., we have specified the target in terms of intraday or interday prediction. We have provided the methods followed in respective articles and dataset specifications including duration and training, validation, and testing periods. We have also summarized PSO parameters and the results.

5 Stock Trend Forecasting

The stock price movement as compared to the previous price values can indicate the market situations. While the bull market indicates the up trend, bear market stands for the down trend. Using various technical indicators, the historical data can be exploited for the market trend prediction. Here, we have grouped PSO applications into parameter optimization and feature selection approaches for stock trend forecasting.

5.1 Parameter Optimization

Identification of appropriate time in order to take the buy or sell decision for specific stocks is a crucial task; utilization of various indicators for making an appropriate market trading choice can be helpful in gaining. Another way that may be considered by various investors is security lending; it can be understood as an act of loaning a security to other investors or firms.

Security lending can be helpful in short selling where an investor can borrow securities and sell them to other market participants; the borrowed securities are purchased back and returned to the lenders. Kickback is the amount of fees charged for each borrowed share. While some of the existing studies indicated that short selling can be useful in creating efficient price discovery, it was also mentioned to be adversely affecting the price movement fundamentals [142].

Based on the short selling trade actions, a competitive co-evolutionary PSO (CCPSO) model was integrated for training FFNN in [143]. These actions included buy, sell, and cut; while buy and sell represented purchasing an underlying security and short selling the security, respectively, cut action indicated selling the purchased security or buying back the security that was short sold. The proposed approach was useful in determining trend reversals. However, such short selling actions were restricted or banned in various financial markets; such constraints were also lifted in some cases over the years; the bid-ask spreads, as well as unaffected stock prices due to such bans, were studied in [144].

Due to the complications in predicting the stock trend that might lead to excessive trading, associated costs, and eliminated opportunities, a trading model was developed by integrating NNs, PSO, and denoising concepts in [145]. Authors developed an adaptive stock direction prediction system where the initial NN weights were obtained using PSO and fitness was evaluated using MSE. Because an excessive trading might lead to miss out potential opportunities, the everyday fluctuations of the market trend and hence, noises were filtered using the denoising process. This could also reduce the number of transactions by negotiating small fluctuations and following the larger trends.

While the historical data can reveal various inherent market patterns, consideration of sentiment analysis can be beneficial in deriving important trend information. The financial news can be one of the platforms to collect sentimental features; in [146], authors proposed to consider historical stock market data along with sentiment analysis for financial market prediction. The prediction model was built using SVM where its parameters were optimized using PSO; the pre-processing step of sentiment analysis could aid into feature dimensionality reduction and performance improvement.

Various factors influence the stock price movement; manual analysis with variations, volatility, or other technical indicator-based activities may not be able to forecast precisely. A multi-linear weighted regression-based NN approach was proposed for stock trend prediction in [147] and defined particle fitness as given by Eq. (19) for weighted particle i (\(x_i\)) and predicted weight combination (\(y_i\)). In order to make reliable predictions, this approach used local optima-based linear structures; here, local optima, arbitrarily closer to the value were given higher weights in the initial stage. Such local minima, as well as maxima, were utilized to predict stock trends.

$$\begin{aligned} \phi (i) = |x_i - y_i| x_i \end{aligned}$$
(19)
Table 4 Summary of PSO-based stock price prediction approaches

5.2 Feature Selection

The financial market experiences fluctuations which can largely impact on stock market trend; different factors may influence the market behaviour as well. Hence, for an effective forecasting of the stock price trend, identification of the closely related and/or influential features may be one of the crucial tasks.

High-dimensional, non-linear stock data can be addressed by machine learning approaches such as SVM, however, selection of the input features can be a challenging task. A method of PSO-based optimal feature set selection was proposed in [148] to facilitate SVM, which was further applied for stock trend forecasting. Additionally, PSO was considered for deriving optimal RBF parameters \(\gamma \) and C; while \(\gamma \) influenced feature space partitioning, the tuning parameter, C, controlled the generalization ability of SVM. The proposed, PSOSVM approach removed unnecessary features and predicted more robust stock price movement than the conventional SVM approach.

In order to determine the stock index movement, a stacked denoising autoencoder model was proposed to learn a compact representation of the historical data of price and volume in [149]. The hyper-parameters of this model were optimized by integrating gravitational search algorithm (GSA) in PSO as hybrid GSA (HGSA). The stacked denoising autoencoder-based deep learning approach was utilized to study compact feature representations; by integrating HGSA with deep networks, authors proposed this theoretical methodology.

6 Other Stock Market Concepts

Apart from the portfolio, stock price and trend, there are various financial concepts which have been integrated with PSO for prediction enhancement.

6.1 Trading Prediction

In the financial markets, a large number of assets get traded on a regular basis. The trading approach can be determined based on individuals’ objectives, goals, time-span, risk tolerance factors, and other transaction-oriented aspects. Various well-organized methods have been developed to assist investment and trading; such approaches are adopted, practised, and extended for various instruments such as equity [150], futures [151]. Hence, combination of the pre-defined trading rules can determine trading strategies.

6.1.1 Trading Rules

To succeed a financial market, traders may follow a group of tried-and-true rules. Such rules are likely to be derived from the past experiences and analyses that can suggest whether an individual should buy or sell specific stocks. The existing studies have also discussed profit gains based on such trading rules [152]. Hence, deriving optimal trading rules can be critical.

One of the trading strategy, namely weight reward strategy (WRS), combined MA and trading range breakout (TRB) technical indicators [153]; similarly, performance-based reward strategy (PRS) was proposed in [154] based on MA and TRB. Various parameter combinations were used to derive component trading rules which were initialized with starting weights; these weights were updated using the reward/penalty mechanism based on their performance. In order to maximize the annual net profit, an improved time variant PSO (TVPSO) algorithm was integrated in PRS.

By means of expanding the scope of PRS, authors proposed to incorporate MA, TRB, Bollinger bands (BB), relative strength index (RSI), stochastic oscillator (STO), moving average convergence/divergence (MACD), and on-balance volume average (OBVA) [155]. Similar to the earlier approach [154], starting weights were updated; the search space consisted of a large number of parameters including starting weights, time spans, thresholds, and reward factor. Hence, the extended PRS was optimized using parallel PSO on Hadoop [155].

For the European Union Allowance (EUA) futures market, MA trading rule was integrated in [156]. Because of the performance of adaptive moving averages (AMA) to describe the price features [157], authors proposed to optimize the weights of base AMA rules using PSO and GAs which could further optimize MA trading rules in the targetted market.

6.1.2 Trading Strategy

Investors may prefer to trade on short-term as well as long-term basis. Such trading require knowledge and analysis of associated factors and their implications for the purpose of increasing the expected profits; various trading strategies have been developed to accomodate the investment planning.

One of the important aspects of reducing investment risks is to adapt a hedging strategy; this can be useful in minimizing the effects of adverse situations. Such a strategy can be applied for assets having negative correlations. In [158], a hedging strategy was proposed for portfolio management by considering “long the outperformed stock portfolio and short the index future”. Authors selected active portfolios and minimized the downside risk using PSO; evaluation of the defined strategy could achieve a relatively positive return.

Mutual funds (MFs) introduce diversity of investment as well as scatter the associated risks; MFs generally intend for short-term investments in order to beat the market and gain higher profits [159]. It can be carried out using fundamental and/or technical analysis. Several factors influence the fund performance; the internal variations and their impacts have also been evaluated [160]. A funds trading strategy was introduced by integrating turbulent PSO (TPSO) and mixed MA approaches in [161]. Authors determined the trend and hence, buy and sell signals using MA with differing lengths; here, the optimal number of MAs was dependent on the MF target. Hence, TPSO was considered to find a good buy point and a good sell point that were represented by gold cross point and death cross point, respectively.

Due to the continuous time-series data of stock market, PSO can be frequently applied with other continuous values. A piecewise aggregate approximation (PAA) based time-series representation was combined with PSO, i.e., PAA-PSO [162]. Authors proposed this approach to find inherent patterns and formulated an investment strategy to maximize the profits. The results were evaluated and compared with symbolic aggregate approximation (SAX) and GA-based investment strategy, i.e., a discrete value-based approach.

Options are important financial instruments that allow the buyer to buy or sell an underlying asset based on the type of contract. An options trading strategy was proposed in [163] using GA and PSO; while GA was used to identify the stock trend, PSO was applied to derive trading strategies for the specific trend. Authors optimized strike prices and expiration dates of the traded options and tested it on five exchange traded funds (ETFs).

A weighted signal-based trading strategy was proposed in [164] where trading signals, buy, sell, and hold, were optimized using modified PSO. The daily stock prices were experimented and evaluated for the investment returns. Considering the facts that the final financial balance function might have multiple peaks, a multimodality-based trading method was proposed in [165]. It considered PAA with multi-swarm of improved self-adaptive PSO (MS-IDPSO) with validation (V), i.e., PAA-MS-IDPSO-V; the patterns were determined and used with investment rules to maximize the profit.

6.2 Financial Market Prediction

Based on the second-order fuzzy-trend logical relationship groups and PSO, stock indices as well as exchange rates were predicted in [166, 167]. Other PSO-based applications included trend prediction with quantum-behaved PSO [168], exchange rate volatility [169] and time-series volatility [170], financial futures [171] as well as MA rules optimization [156], market liquidity optimization [172], trading point [173], and time-series segmentation [174]. Hence, PSO can be integrated with various financial aspects for enhancing the prediction performance and/or optimization.

6.2.1 Stock Returns

The global stock market (GSM) transactions have been a subject of interest to analyze inherent patterns and predict market returns; the correlations among markets of various countries and their economic factors can be exploited. A modified clustering approach was introduced in [175] to evaluate the financial market dependencies and hence, associations among their returns. The k-means clustering was integrated with PSO to find an optimal number of clusters using price as the stock market integration measure. The problem of unsynchronized time zones of different countries was resolved using weekly stock indices log difference. The proposed approach with cost function and Silhouette cohesion identified the optimal number of clusters that indicated the significance of geographical similarities and economic status in cluster formation.

Stock returns prediction is one of the crucial aspects to determine the expected investment outcome. There may be unusual profit generation because of the stocks or portfolios; such abnormal returns or excess returns perform differently from the anticipated return. An abnormal return may be positive or negative. An early work demonstrated that the direction of such returns might not be predictable but the amount of abnormality in security returns could be forecasted using news-based text classification [176]. To predict such returns through the inherent noise as well as volatility, generalization characteristics of interval-valued fuzzy cognitive map (IVFCM) was proposed in [177]; authors extracted financial indicators such as log of market capitalization (lnMC) and linguistic analysis from corporate-related documents. PSO was integrated to estimate casual relationships of IVFCM to predict one-day-ahead abnormal stock returns.

6.2.2 Initial Public Offering

The concept of initial public offering (IPO) is important in the financial market where IPO offers shares of a private corporation to the public under a new stock issuance. This can be useful for the company to raise capital from public investors. For the purpose of recognizing valid IPO pricing and determining profitable opportunities, PSO-based IPO pricing forecasting approach was proposed in [178]. Authors proposed to apply PSO with SVM to increase forecasting ability. They considered the ninth day offering prices to ensure dealing with realistic prices and limited volatility influences.

6.2.3 Cryptocurrency

Cryptocurrency is a virtual currency system with decentralized authority operations. Bitcoin was the first blockchain-based cryptocurrency and has been a subject of interest for many investors in the financial markets [179]. In order to predict the bitcoin price, an MLP NN-based non-linear autoregressive with exogenous input (NARX) model was developed in [180]. It consisted of inputs with open, close, high, and low prices along with MA technical indicator with different intervals. The model parameters such as the number of hidden units, input lag, and output lag were optimized using PSO to predict next-day bitcoin price.

7 Challenges and Future Directions

This survey primarily concerns PSO-based stock market prediction; financial concepts and traders’ perspectives have shown that market analyses can be beneficial to predict future market behaviour. Stock features play a crucial role in determining market performance; such features may be derived using the historical data of stock prices. It has been encountered that a large number of stock exchanges and corresponding companies have been aimed to derive technical indicators, however, a rationale has not been found for the selection of a specific dataset. As given by Table 3 and 4, stock data duration, intervals, parameter specifications, methods, as well as features have largely varied in various approaches. Hence, a group of stock price datasets and respective performance results may not be comparable; hence, we have presented our analysis through summary tables. This may induce thorough study over a wide range of datasets, as well as the development of data selection criteria in order to emphasize the significance of one method over others.

Fig. 3
figure 3

A generalized step-by-step PSO-optimized stock market prediction

Fig. 4
figure 4

An overview of PSO-optimized methods, stock features, and their potential stock market applications

Study of a financial market etiquette can be influenced by various macroeconomics as well as microeconomics factors [9, 10]. The highly fluctuating characteristics of a stock market have encouraged the application of computational intelligence for stock-based predictions. The limitations of parameter optimization, feature selection, or classification using machine learning as well as deep learning approaches have been addressed using swarm and evolutionary computation. We have focused our survey on PSO and its variants that have enhances the forecasting performance; the suitability of PSO for continuous data such as stock market has been exploited in various articles. Hence, this survey considers recent advances in portfolio optimization, stock price and trend prediction based on PSO-optimized methods. We believe that knowledge of financial aspects can be productive to develop a clear understanding of the field of work. In order to balance the economical aspects and computational applications to the stock market, we have also incorporated background information about the field. Though a large number of articles have majorly considered the technical analysis, it may be an appropriate choice to study and incorporate the fundamental concepts for improving the prediction. While a large number of applications have targetted portfolio, stock price and trend, a limited amount of attention has been received by PSO-based applications such as returns, futures, trading, cryptocurrencies. The impact of individuals’ choice, beliefs, financial, social, as well as psychological states can be crucial aspects of financial market trading. Subsequently, country-specific perspectives such as government regulations, political events, and other external matters can also influence market trends. However, the identification of linkages among such market dynamics and consideration of their impact on stock market prediction is a challenging task.

PSO can be observed with the capability of dealing with continuous data. Its simplicity due to less number of parameters and rapid convergence ability within large search space have been exploited for the financial market problems; its parallel computation ability may be exploited to make PSO suitable for the target application. Though PSO has shown performance improvements, it may suffer premature convergence for complex problems, leading the solutions to be trapped within local optima. This issue may be encountered in scattered problems. Also, selection of initial parameter values may be a challenging task. PSO weakness of local search ability may be overcome with other approaches such as GA. Thus, integration of PSO with other swarm and evolutionary approaches may be useful to resolve its limitations. The objective function must be carefully selected to enhance the prediction approach. Though a large number of fitness functions were chosen based on risk and return factors for stock portfolios, consideration of other features and derivation of their trade-offs can be considered as a potential research direction. Also, various such factors can be integrated for stock price as well as stock trend prediction.

A generalized flow of stock market-based forecasting can be given as shown in Fig. 3. Based on the target application, the steps can be determined to develop a prediction model and enhance it using the PSO-based approach; here, the collected data is pre-processed for marking it suitable for the problem and necessary features are extracted from the same. The stock dataset may be divided into training and testing and submitted to the prediction model which is to be optimized using PSO; the generated predictions can be evaluated. It may be observed that various specifications may be integrated to enhance the stock market prediction. Though we have centred PSO-based stock market prediction, it may be adapted for other potential optimization methods and appropriate modifications may be carried out for predictions. Fig. 4 provides an overview of algorithms hybridized with PSO and its variants for stock market; the linkages of such methods and the features utilized for various stock market applications have been demonstrated. It has been observed that PSO variants can be integrated with a large number of algorithms and various stock features can be adapted to derive useful information about the stock movement. However, deriving an optimal combination of algorithms and features is challenging. It can be considered as a potential future direction for financial time-series data forecasting.

8 Concluding Remarks

A continuously increasing involvement of a large number of traders and investors in the financial market has been witnessed since the past decades. The stock market trading has been a subject of interest and hence, one of the major attractions for academicians and researchers. This article presents a comprehensive survey of various stock market concepts and PSO-based computational aspects.

Companies get registered on one or more stock exchanges to expand the business dimensions; with a motivation of gaining profits of the investment, individuals trade stocks of such listed companies. We have discussed the influences of various aspects, microeconomic and macroeconomic factors, individuals’ behavioural features, as well as the financial market conditions on the buying and selling actions within stock markets; investment and speculation have also been exhibited as two important criteria in the stock market. Though individuals having expertise in this field can determine the potential assets that they may trade, it is emphasized that there has been a constant requirement of having a preliminary awareness of the probable market behaviour and the expected returns. We have discussed the fundamental analysis and technical analysis that can derive crucial factors of a stock market and forecast the future valuation; while the former analysis is based on analyzing targetted company profiles, products, and related factors, the latter is based on the historical data of a specific stock and the derived technical indicators. For maximizing the expected returns, various trading strategies have been developed with the help of such analyses; their usefulness in the existing literature studies have also been reviewed. Another way to maximize profit and minimize associated risks, i.e., a stock portfolio, has also been considered in this survey. The concept of diversification is presented wherein different stocks and/or securities are traded to ensure that the negative impacts of adverse events could be reduced; we have also discussed the challenges related to suitable portfolio selection and optimization. We have surveyed the influential features as well as the time-series data that help to derive inherent trends and to predict the stock price movement. In addition to this, the survey presents the use of forecasted data to decide trading signals such as buy, hold, or sell for a particular stock.

Various techniques have been developed for stock market prediction including machine learning, deep learning, sentiment analysis, as well as mining approaches. To improve prediction accuracies, swarm intelligence and evolutionary algorithms have also been incorporated. PSO is one of the nature-inspired swarm intelligence approaches that has been adapted for various continuous value optimization problems such as stock market prediction. Hence, in the presented survey, we have primarily focused on reviewing a wide range of stock market prediction concepts which have been addressed using PSO and its variants. We have conducted a detailed study of portfolio optimization, stock price and trend prediction, along with trading, returns, futures, and other financial market-based forecasting approaches. Though the historical stock data can be useful in deriving important features, understanding of the financial concepts, derivable technical indicators, and applicability of optimization techniques such as PSO may be effectively combined for enhancing the predictions. Therefore, we have included the useful financial market concepts associated with the existing approaches for balancing the survey. Our comparison with the existing surveys indicates that the presented survey article can be helpful to the readers in gaining financial market knowledge along with understanding the implications of PSO for the same. We have briefly reviewed other nature-inspired approaches that have been hybridized with PSO for financial market prediction and have demonstrated the superiority of PSO. The objective is to determine the compatibility constraints of using PSO for the stock market and to analyze their potential solutions; it can be observed that hybrid approaches, such as PSO and GA, may be helpful in designing robust prediction models. To support the presented survey, we have also provided a generalized step-by-step PSO-optimized stock market prediction along with a detailed presentation of PSO variants, the hybridized algorithms, stock features, and prediction applicabilities.

It has been perceived that a large number of existing research works consist of applying PSO to historical data and derived technical indicators; the integration of fundamental analysis, as well as sentiments based on various events, may help derive stronger predictions. The risk aversion features and associated psychological and socioeconomic perspectives can significantly impact on an individual’s trading behaviour; consideration of such details may be a potential future direction. Such influential factors may be aggregated for deriving personalized recommendations for the portfolio as well as a trading strategy.