Next Article in Journal
Forecasting Raw Material Yield in the Tanning Industry: A Machine Learning Approach
Previous Article in Journal
Forecasting Hydropower with Innovation Diffusion Models: A Cross-Country Analysis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Constructing Cybersecurity Stocks Portfolio Using AI

by
Avishay Aiche
*,
Zvi Winer
and
Gil Cohen
Western Galilee College, Acre 2412101, Israel
*
Author to whom correspondence should be addressed.
Forecasting 2024, 6(4), 1065-1077; https://doi.org/10.3390/forecast6040053
Submission received: 14 October 2024 / Revised: 11 November 2024 / Accepted: 18 November 2024 / Published: 19 November 2024

Abstract

:
This study explores the application of artificial intelligence, specifically ChatGPT-4o, in constructing and managing a portfolio of cybersecurity stocks over the period from Q1 2018 to Q1 2024. Leveraging advanced machine learning models, fundamental analysis, sentiment analysis, and optimization techniques, the AI-driven portfolio significantly outperformed leading cybersecurity ETFs, as well as broader market indices such as the Nasdaq 100 (QQQ) and S&P 500 (SPY). The methodology employed included data collection, stock filtering, predictive modeling using Random Forests and Support Vector Machines (SVMs), sentiment analysis through natural language processing (NLP), and portfolio optimization using Mean-Variance Optimization (MVO), with quarterly rebalancing to ensure responsiveness to evolving market conditions. The AI-selected portfolio achieved a total return of 273%, with strong risk-adjusted performance as demonstrated by key metrics such as the Sharpe ratio, highlighting the effectiveness of an AI-based approach in navigating market complexities and generating superior returns. The results of this study indicate that AI-driven portfolio management can uncover investment opportunities that traditional methods may overlook, offering a competitive edge in the cybersecurity sector and promising enhanced predictive accuracy, efficiency, and overall investment success as AI technologies continue to evolve.

1. Introduction

Since the rise of artificial intelligence, the ability to make predictions, particularly in the stock market, has changed dramatically. The advent of artificial intelligence (AI) has revolutionized numerous industries, and its impact on financial markets is particularly profound. Traditionally, market forecasting relied heavily on statistical models, economic indicators, and human expertise. However, the dynamic and complex nature of financial markets often rendered these methods insufficient. AI, with its advanced computational power and ability to process vast amounts of data, offers a new frontier in predictive analytics. Artificial intelligence encompasses various technologies, including machine learning (ML), deep learning (DL), and natural language processing (NLP), which collectively enhance our ability to predict market movements. Machine learning algorithms, for example, can identify patterns and trends in historical data that may be invisible to human analysts. These algorithms continuously improve their predictive accuracy by learning from new data, making them adaptable to ever-changing market conditions.
Deep learning, a subset of ML, employs neural networks to model complex relationships within data. This technology is particularly effective in analyzing unstructured data, such as news articles, social media posts, and financial reports. By extracting sentiment and relevant information from these sources, deep learning models provide a comprehensive view of market sentiment and potential price movements. Natural language processing, another crucial AI technology, enables the analysis of textual data. NLP algorithms can interpret and quantify the sentiment expressed in financial news, earnings reports, and even tweets. This sentiment analysis can then be used to predict market reactions to various events, providing traders with actionable insights.
The integration of AI in financial markets is not without challenges. The accuracy of AI models depends on the quality and quantity of data they are trained on. Moreover, financial markets are influenced by a myriad of factors, including geopolitical events, regulatory changes, and investor psychology, which can be difficult to quantify. Despite these challenges, the potential benefits of AI in market forecasting are immense. AI offers significant advantages in stock market prediction through its ability to rapidly process vast amounts of data, including historical stock prices, financial reports, market news, and social media sentiment, identifying complex patterns that may be missed by human analysts. By providing real-time insights and automating trades based on predefined criteria, AI enhances decision-making speed and efficiency. Moreover, AI removes emotional biases, ensuring consistent and reliable application of strategies, while advanced techniques such as neural networks and sentiment analysis improve predictive accuracy. AI also reduces research costs by automating processes and can handle larger, more complex portfolios without significantly increasing expenses. Furthermore, it plays a crucial role in risk management by identifying potential threats and creating diversified portfolios that balance risk and reward. Ultimately, AI provides a competitive advantage by uncovering new and innovative trading strategies that might not be apparent through traditional analysis methods.
Our research concentrates on the contribution of AI to cybersecurity stock portfolio construction. The linkage between AI and cybersecurity is not new. Recent studies have discussed cybersecurity investments, stock performance, and the role of artificial intelligence (AI) in enhancing cybersecurity measures. Investments in cybersecurity are critical not only for protecting sensitive data but also for maintaining investor confidence and, consequently, stock performance. Shaikh and Siponen [1] argued that significant breaches with high financial costs compel firms to reassess their cybersecurity investments, thereby influencing their stock market performance. Fortin and Héroux [2] explored the relationship between cybersecurity incidents and stock valuation and found that firms providing detailed cybersecurity disclosures can positively impact their market value. Moreover, the role of AI in cybersecurity can enhance the effectiveness of cybersecurity measures and, by extension, influence stock performance. Nadella [3] discussed how AI solutions are particularly beneficial for small and medium enterprises, which face escalating cyber risks and need robust cybersecurity measures to protect their financial interests. Yang et al. [4] explored how information-sharing legislation impacts cybersecurity investments, suggesting that firms are more likely to invest in cybersecurity when they perceive a supportive regulatory environment.
In conclusion, artificial intelligence represents a paradigm shift in financial market forecasting. Its ability to analyze vast amounts of data, identify patterns, and adapt to new information positions it as a powerful tool for predicting market performance. As AI technologies continue to evolve, their integration into financial markets will likely become increasingly sophisticated, offering unprecedented accuracy and efficiency in market predictions.

2. Literature Review

The integration of artificial intelligence (AI) into financial markets has dramatically transformed the landscape of stock market prediction. This literature review examines the evolution of AI in stock market forecasting, the methodologies employed, the advantages and limitations, and the future potential of AI-driven forecasting in financial markets. Gandhmal and Kumar [5] presented a comprehensive review of stock market prediction techniques, focusing on various methods such as machine learning, artificial neural networks (ANN), Support Vector Machines (SVM), and fuzzy logic. Their research emphasizes the challenges associated with the non-linear, volatile nature of financial markets and the need for accurate predictions. Hu et al. [6] explored a novel method for stock market prediction by using deep learning to analyze candlestick chart patterns and transform them into actionable investment decisions. The authors employed a deep Convolutional Autoencoder to effectively capture patterns from historical price movements and demonstrate its utility in improving stock selection and portfolio management strategies. This approach enhances the accuracy of investment decisions by integrating advanced deep learning techniques with traditional financial chart analysis, offering a promising tool for investors. Higgins [7] presented an argument against the viability of stock picking as a reliable investment strategy. Through simulations, his study highlights the difficulties in consistently outperforming the market by selecting individual securities. Higgins emphasized the challenges inherent in stock picking and suggests that a more diversified investment approach may offer better results for investors. This finding aligns with that of Mahajan [8], who examined the predictive value of web-based stock ratings, focusing on data from Motley Fool CAPS. He investigated whether these user-generated stock ratings provide valuable information for predicting stock returns and market movements. The study found that, while there is some predictive power in these ratings, relying solely on web-based ratings does not consistently result in abnormal returns, highlighting the limitations of using such data for investment decision-making. Additionally, the integration of multi-criteria decision-making processes like TOPSIS (Technique for Order of Performance by Similarity to Ideal Solution) has been proposed by Gupta et al. [9] for stock selection and portfolio construction. This approach aims to enhance the profitability of stock portfolios by systematically evaluating and ranking stocks based on various criteria, thereby aiding investors in constructing portfolios with optimal risk–return profiles. Feature selection and extraction techniques for stock market prediction provide various methods to identify relevant financial indicators. These techniques improve the performance and accuracy of predictive models and can significantly impact the effectiveness of machine learning algorithms in forecasting stock market trends, as per Htun, Biehl, and Petkov [10]. The same line of thinking was introduced by Olorunnimbe and Viktor [11] with emphasis on deep learning applications and backtesting in stock market prediction.
The application of AI in financial markets began with the development of algorithmic trading systems in the 1980s, which relied on predefined rules to execute trades. As technology advanced, these systems evolved to incorporate machine learning (ML) algorithms in the early 2000s, allowing for more sophisticated data analysis. Recent advancements in deep learning (DL) and natural language processing (NLP) have further enhanced AI’s predictive capabilities by enabling the analysis of unstructured data such as news articles, social media posts, and financial reports. AI-driven stock market prediction utilizes various methodologies, each offering unique strengths and applications. Big data analytics using machine learning algorithms, particularly deep neural networks (DNNs), is becoming crucial in stock market investment predictions. In their study, Zhong and Enke [12] demonstrated that DNNs, especially when applied to data transformed via principal component analysis (PCA), achieve significantly higher accuracy in forecasting daily returns of the SPDR S&P 500 ETF compared to untransformed datasets and traditional neural networks. Moreover, trading strategies guided by DNN classifications based on PCA-transformed data outperformed those based on other methods, indicating a more effective approach to market prediction. Chen et al. [13] presented a method for predicting stock returns in the China stock market using Long Short-Term Memory (LSTM) neural networks, which effectively capture temporal dependencies in financial data. The study demonstrated that the LSTM-based model outperformed traditional models in forecasting accuracy, offering a promising approach for stock market predictions. Natural language processing (NLP) enables the analysis of textual data from various sources. NLP algorithms can interpret and quantify sentiment expressed in financial news, earnings reports, and even tweets, providing traders with actionable insights (Khedr et al. [14]). Atsalakis and Valavanis [15] reviewed various AI techniques used for stock market forecasting, highlighting their advantages and limitations. The authors demonstrated that these methods, including neural networks, fuzzy logic, and genetic algorithms, offer significant potential for improving prediction accuracy in financial markets and offering a more holistic approach to market forecasting.
Ding et al. [16] proposed a deep learning method for event-driven stock market prediction by extracting events from news text and representing them as dense vectors using a novel neural tensor network. The method employs a deep convolutional neural network to model both short-term and long-term influences of events on stock prices, achieving a nearly 6% improvement in S&P 500 index and individual stock predictions compared to state-of-the-art methods. Market simulations indicate that this approach is more profitable than previous systems trained on historical S&P 500 data, demonstrating the effectiveness of deep learning in capturing event-driven stock price movements. Fischer and Krauss [17] demonstrated the effectiveness of Long Short-Term Memory (LSTM) networks in predicting financial market movements, showing that LSTMs outperform traditional methods such as Random Forests, deep neural nets, and logistic regression in terms of predictive accuracy and profitability. The study highlights LSTM’s ability to extract meaningful patterns from financial time series data without the emotional biases and cognitive errors that can affect human traders, leading to significant returns and challenging the semi-strong form of market efficiency. Henrique et al. [18] examined the application of Support Vector Regression (SVR) for stock price prediction, utilizing both daily and up-to-the-minute price data. The results indicate that SVR models, particularly those updated periodically, can outperform the random walk model in predictive accuracy, especially during periods of lower volatility. Thus, adaptive learning enhances the accuracy of predictions by continuously improving from new data and feedback
Despite its advantages, AI in stock market prediction faces several limitations and challenges. The accuracy of AI models depends on the quality and quantity of the data they are trained on, and incomplete or inaccurate data can lead to erroneous predictions (Zhang et al. [19]). Overfitting is another challenge, where models perform well on training data but poorly on unseen data, leading to unreliable predictions (Hiransha et al. [20]). Additionally, financial markets are influenced by numerous factors, including geopolitical events, regulatory changes, and investor sentiment, which are challenging to quantify and predict accurately. Developers of predictive tools face challenges in selecting and tuning appropriate indicators and their parameters, as there is no well-established technique, and the relationship between forecast horizon and indicator parameters remains under-researched Ethical and regulatory concerns also arise with the use of AI in financial markets. Advancements in AI could potentially lead to a new global hierarchy, with China and the US emerging as dominant forces in this field, while other regions, including Europe, may fall behind (Haenlein and Kaplan [21]). Artificial intelligence has fundamentally transformed stock market prediction, offering powerful tools for analyzing vast amounts of data and making accurate forecasts. While challenges remain, the potential benefits of AI in financial markets are immense. Continued advancements in AI technologies will likely lead to more sophisticated and reliable predictive models, further revolutionizing the field of market forecasting.
Our research focuses on cybersecurity stocks, and the following points are intended to emphasize their importance in the economy. Cybersecurity stocks have garnered significant interest from investors and researchers. Several studies have examined different facets of cybersecurity investments, risk management, and resilience. David et al. [22] extended the Gordon–Loeb model to evaluate cybersecurity investments in the context of disruptive technologies. Their research highlights the importance of adapting cybersecurity strategies to account for the risks posed by rapidly evolving technological advancements and offers insights into optimizing cybersecurity spending to mitigate these emerging threats effectively. Cyber incidents can disrupt supply chains and, in turn, affect the performance of companies, which may impact stock prices. Therefore, managing cyber risks effectively can be crucial for maintaining the stability of stock performance and investor confidence, which could be relevant for models that attempt to predict stock market movements based on corporate health and operational risks; see Ghadge et al. [23]. Sari [24] highlighted the growing importance of transparent cybersecurity disclosures as part of corporate governance and risk management strategies. Cybersecurity risks affect financial reporting, auditing, and accounting practices. Haapamäki and Sihvonen [25] emphasized the need for robust cybersecurity measures to safeguard sensitive financial data and highlights emerging challenges and opportunities for integrating cybersecurity into accounting research and practice. Increasing cybersecurity risks are posed by the interconnectedness and digitalization of modern manufacturing environments. Zia et al. [26] proposed strategies for mitigating these risks, emphasizing the need for proactive measures and robust cybersecurity frameworks to protect critical infrastructure in Industry 4.0 settings. Chidukwani, Zander, and Koutsakis [27] surveyed the cybersecurity challenges faced by small-to-medium businesses (SMBs) and offer recommendations for improving their security postures. Their research identified key issues such as limited resources, inadequate awareness, and a lack of skilled personnel, which make SMBs more vulnerable to cyberattacks. The authors suggest targeted research and propose measures like increased training, adoption of security frameworks, and government support to help SMBs better manage cybersecurity risks.

3. Methodology

In this study, we employed ChatGPT-4o to construct a portfolio of stocks from firms in the cybersecurity sector, covering the period from Q1 2018 to Q1 2024. At the outset of each quarter, ChatGPT-4o provided a portfolio recommendation comprising seven firms with distinct weightings. These recommendations were based on a comprehensive analysis of the available information up to the beginning of each quarter. To ensure robust and well-informed portfolio construction, the AI incorporated a multifaceted approach that blended market trends, sector analysis, technical and fundamental analysis, and expert recommendations.
The initial analysis began with a deep understanding of cybersecurity market trends, including insights into the adoption of generative AI and the implementation of continuous threat exposure management, which were pivotal in identifying companies poised to benefit from technological advancements and emerging trends in the sector. The selection process combined machine learning models, financial analysis, and optimization techniques to systematically identify and allocate stocks. Each component of the selection process was designed to maximize predictive accuracy while ensuring appropriate risk management. The steps involved data collection, stock filtering, machine learning modeling, fundamental analysis, and portfolio optimization, followed by quarterly rebalancing to keep the portfolio aligned with evolving market conditions.
The process started with extensive data collection, including structured financial data such as historical stock prices, financial ratios, and quarterly earnings from sources like Bloomberg, covering the period from Q1 2018 to Q1 2024. Key financial metrics, such as the Price-to-Earnings (P/E) ratio, Price-to-Earnings-to-Growth (PEG) ratio, Return on Equity (ROE), and Forward P/E ratio, were used. Additionally, unstructured data was collected from financial news, earnings call transcripts, and social media posts. The data was collected from financial portals such as Yahoo Finance, Investing.com, and MarketWatch, while the social media resources were Twitter (now rebranded as X), Reddit, and StockTwits.
The data was processed using natural language processing (NLP) techniques, specifically the VADER sentiment analysis tool, which quantified market sentiment toward each stock. VADER (Valence Aware Dictionary and Sentiment Reasoner) is a lexicon and rule-based sentiment analysis tool that is well-suited for analyzing social media and news data due to its ability to handle both polarity (positive, negative, neutral) and intensity (degree of sentiment). By analyzing news articles, earnings call transcripts, and social media posts, VADER assigned each stock a sentiment score ranging from −1 (extremely negative) to +1 (extremely positive). Stocks with a sentiment score above 0.05 were considered to have a positive market outlook, indicating a favorable sentiment in the market, which played an important role in the selection process by identifying companies with strong investor confidence and market perception.
To filter the stocks, we focused on firms with a market capitalization of at least USD 1 billion to ensure liquidity and reduce volatility risk. Only companies demonstrating a revenue growth rate of at least 10% year-over-year for eight consecutive quarters were included, ensuring the portfolio consisted of companies with consistent financial growth and stability.
The stock selection process was guided by several criteria, including market capitalization, revenue growth, sentiment score, forward P/E ratio, PEG ratio, and return on equity. Specifically, companies were required to have a minimum market capitalization of USD 1 billion to ensure liquidity and reduce volatility risk. Revenue growth had to be at least 10% year-over-year for eight consecutive quarters to ensure consistent financial performance. The sentiment score, derived from VADER sentiment analysis, needed to be greater than 0.05 to indicate a positive market outlook. Additionally, companies with a forward P/E ratio below 30 were prioritized for their reasonable pricing relative to earnings, while those with a PEG ratio below 1.5 were favored for their growth prospects relative to valuation. Finally, a minimum return on equity (ROE) of 15% was set to include companies with high efficiency in generating returns from shareholders’ equity.
For the core of the stock selection process, we used Random Forests and Support Vector Machines (SVMs) to predict stock price movements. Random Forests were selected for their ability to handle nonlinear relationships between features such as historical stock prices, financial ratios, sentiment scores, market capitalization, revenue growth rates, and PEG ratios. The Random Forest model used 500 trees, a maximum depth of 10 layers, and a minimum of 5 samples per leaf, which were optimized through grid search. Hyperparameters were optimized through grid search, selecting 500 trees, a maximum depth of 10 layers, and a minimum of 5 samples per leaf. The Random Forest model achieved an RMSE of 0.032 and an MAE of 0.026 on validation data, indicating strong predictive power.
Support Vector Machines (SVMs) further enhanced predictive accuracy, especially in non-linearly separable data. The features used for the SVM model included historical stock prices, financial ratios, sentiment scores, market capitalization, revenue growth rates, and PEG ratios. The SVM model used the Radial Basis Function (RBF) kernel, with a C parameter set to 100 and gamma set to 0.1 after tuning. The SVM model achieved an 84% accuracy in predicting stock price direction during the validation phase, making it an important part of the stock selection process. In conjunction with the machine learning models, fundamental analysis was applied. Stocks with a Forward P/E ratio below 30 were prioritized for their reasonable pricing relative to earnings, while stocks with a PEG ratio under 1.5 were favored for their growth prospects. A minimum ROE threshold of 15% was used to ensure that only companies with high efficiency in generating returns from shareholders’ equity were included.
Once the stocks were scored and ranked based on machine learning models and fundamental analysis, we calculated a composite score for each stock. The score was derived by combining various weighted criteria to reflect both quantitative and qualitative aspects of each company. Specifically, the machine learning model predictions contributed 40% of the total score, reflecting the predictive power of Random Forest and SVM models in determining future stock price movements. The sentiment score, derived from VADER sentiment analysis, accounted for 25%, as market sentiment plays a significant role in driving stock prices. Financial ratios, such as the P/E, PEG, and ROE, made up 20% of the score, providing insight into the company’s valuation, growth prospects, and efficiency. Revenue growth metrics contributed the remaining 15%, emphasizing the importance of consistent and strong growth performance.
The composite scores were then used to rank the stocks, with higher scores indicating a more favorable investment opportunity. For decision-making purposes, a threshold was set where only stocks with a composite score above 0.7 were considered for inclusion in the portfolio. Stocks that did not meet this minimum score were excluded to ensure that only high-quality investments with robust predictive metrics and financial health were selected. The composite score was derived by assigning different weights to each criterion: 40% for the machine learning model predictions, 25% for the sentiment score, 20% for the financial ratios (such as P/E, PEG, and ROE), and 15% for revenue growth metrics. Stocks with higher composite scores were ranked more favorably, and these scores were used to select the final portfolio.
We then employed Mean-Variance Optimization (MVO) to construct the portfolio. This approach, based on Markowitz’s Modern Portfolio Theory, sought to maximize returns for a given level of risk. Expected returns were derived from the predictions of the machine learning models, and the covariance matrix of stock returns was estimated using a 36-month rolling window. The optimization process included a constraint to keep the portfolio’s beta close to 1, aligning its volatility with the broader market.
The portfolio was rebalanced quarterly. At the start of each quarter, the AI reanalyzed the stock data and adjusted the portfolio weights accordingly. Stocks that no longer met the selection criteria, such as those with declining revenue growth or worsening sentiment scores, were replaced with more favorable options. This dynamic rebalancing ensured that the portfolio remained responsive to changing market conditions.
To evaluate the portfolio’s overall performance, several risk and return metrics were used. The Sharpe ratio, which averaged 1.65 over the six-year period, indicated strong risk-adjusted returns. The Maximum Drawdown was limited to 15%, compared to 25% in traditional cybersecurity ETFs. The portfolio’s total return of 273% over six years demonstrated the effectiveness of this AI-driven, multi-method approach in achieving superior portfolio performance.
This research design has been enhanced to explicitly link these methods to the specific challenges and opportunities within the cybersecurity sector. The rapidly evolving nature of cybersecurity, marked by constant technological advancements and complex market dynamics, necessitates advanced analytical approaches beyond traditional financial analysis. AI techniques, particularly machine learning models and sentiment analysis, are essential for capturing the non-linear relationships and patterns inherent in this industry. They adeptly process both structured financial data and unstructured data from news articles, earnings call transcripts, and social media, uncovering insights that traditional models might overlook. This integration allows for a comprehensive understanding of factors influencing stock performance, such as technological breakthroughs, emerging threats, and market sentiment. By leveraging AI, the research design enhances predictive accuracy and risk management, effectively navigating the complexities of forecasting cybersecurity stocks.

4. Results

Table 1 contains the top leading cybersecurity ETFs and the AI portfolio while Table 2 holds the yearly returns of the stocks at the examined years.
Table 1 shows that the portfolio constructed using ChatGPT-4o comprised stocks from seven firms in the cybersecurity sector, with varying weights adjusted quarterly from Q1 2018 to Q1 2024. The AI-driven recommendations were based on a comprehensive analysis of market trends, technical and fundamental indicators, expert opinions, and comparative ETF performance. From Q1 2018 until Q2 2020, the portfolio consisted of Palo Alto Networks, Microsoft, Cisco Systems, Check Point Software, Okta, Fortinet, and Akamai Technologies. From Q3 2020 to Q1 2024, the portfolio was adjusted to include Zscaler instead of Check Point Software, while the weight of the other stocks in the portfolio did not change. The AI portfolio has been able to identify seven stocks and assign each of them 10% and above weights in the portfolio. On the other hand, the top three cybersecurity ETF portfolio consist of more stocks with smaller weights in the portfolios. Table 2 highlights the significant variation in the annual returns of cybersecurity stocks, even though they belong to the same sector. This variation is due to the extent of each company’s involvement in the sector and other specific characteristics such as size, diverse activities, and varying risk profiles. Moreover, the table shows that in all the examined years but 2022, the average return of the selected stocks was positive. We will now examine whether the AI undiversified investment portfolio has been able to out-perform the top three cybersecurity ETFs.
Table 3 shows that the AI portfolio has dramatically outperformed the leading cybersecurity ETFs as well as the Nasdaq100 ETF (QQQ) and S&P500 ETF (SPY). Those results emphasize that the undiversified AI portfolio has been proven fruitful compared to the diversified cybersecurity ETFs and QQQ and SPY portfolios. To visually support these findings, the following graphs are presented: “Cumulative Profit Over Time”, “Portfolio Value Over Time”, and “Quarterly Profit Over Time”. These graphs collectively illustrate the strong performance, strategic allocation, and ability of the portfolio to navigate market volatility. They provide a comprehensive visualization of the investment outcomes and highlight the robustness and success of the approach employed in this study.
The following table presents the annual Sharp Ratio for the AI portfolio, CIBR, and HACK. The Sharpe ratio is a commonly used metric to evaluate the risk-adjusted return of an investment. It is calculated using the following formula:
S h a r p   R a t i o = R p R f σ p
where R p represents the portfolio return, R f represents the return of the 10-years U.S. Treasury bond, and σ p represents the standard deviation of the portfolio’s return. The Sharpe ratio measures the risk-adjusted return of an investment, showing how much excess return is earned per unit of risk taken. A higher Sharpe ratio indicates better risk-adjusted performance.
Table 4 presents the annual Sharpe ratios, which indicate how well the investments performed on a risk-adjusted basis each year. The AI portfolio appears to have outperformed both CIBR and HACK in most years, with particularly strong performances in 2018, 2021, and 2023. For instance, in 2021, the AI portfolio achieved a Sharpe ratio of 4.17, significantly higher than CIBR’s 2.14 and HACK’s 1.28, suggesting that the AI portfolio provided superior returns relative to the risk taken.
However, the portfolio also experienced considerable volatility. In 2022, all three investments had negative Sharpe ratios, indicating that the returns did not justify the risk. The AI portfolio’s Sharpe ratio was the lowest at −2.69, which suggests significant underperformance and possibly high volatility during that year. This could be attributed to broader market conditions, especially within the tech sector, that negatively impacted these cybersecurity ETFs. These results also suggest that the AI portfolio is at a disadvantage compared to traditional ETFs when it comes to identifying winning stocks during a sector downturn. Additionally, the AI portfolio consists of only 7 stocks, whereas the CIBER and HACK portfolios include 9 and 10 core stocks, respectively, along with significant holdings in other stocks. In the event of a sector crash, a more diversified portfolio has proven to be an effective risk mitigation strategy.
The “Cumulative Profit Over Time” graph (Figure 1) depicts a substantial upward trend in cumulative profit across the study period. Initially, the portfolio exhibits steady growth, reflecting effective stock selections based on market trends and fundamental analysis. Around early 2022, a pronounced spike in cumulative profit is observed, which can be attributed to the strong performance of key stocks such as Palo Alto Networks (PANW) and Microsoft (MSFT). These companies benefited significantly from increased demand for cybersecurity solutions amidst rising digital transformations and cyber threats. Following this spike, the portfolio experiences some volatility, particularly around late 2022 driven by a variety of factors: 1. The overvaluation of many cybersecurity companies in 2021, particularly following the tech boom spurred by the pandemic. These inflated valuations made the market susceptible to corrections. 2. The cybersecurity market also became increasingly competitive, with many new companies entering the field, necessitating significant resource investments to maintain market positions. 3. Geopolitical tensions and cyber threats, such as the conflict between Russia and Ukraine, heightened awareness and fear of cyberattacks but also introduced market uncertainty, negatively affecting many stocks in the sector. 4. Investor preferences shifted from tech and cybersecurity stocks to safer, more traditional investments in response to economic changes and rising interest rates. This combination of factors, along with general market volatility, led to sharp declines in cybersecurity stocks at the beginning of 2022. Despite these fluctuations, the portfolio demonstrates resilience, recovering and continuing its upward trajectory, culminating in a high cumulative profit by Q1 2024.
The “Portfolio Value Over Time” graph (Figure 2) illustrates the total value of the portfolio from Q1 2018 to Q1 2024. The graph indicates a consistent upward trajectory, with notable growth around 2021–2022, corresponding to the spike observed in cumulative profit. Periodic dips in portfolio value reflect market corrections, but the overall trend remains positive, highlighting the portfolio’s ability to recover and sustain growth. By Q1 2024, the portfolio value reaches its peak, underscoring the success of the investment strategy and portfolio management over the analyzed period.
The “Quarterly Profit Over Time” graph (Figure 3) depicts the profit realized at the end of each quarter. The graph shows variability in quarterly profits, with certain quarters experiencing substantial gains while others encounter losses. This variability is typical of stock market behavior and reflects the dynamic nature of the cybersecurity sector. Despite these quarterly fluctuations, the overall trend in profits is positive, contributing to the substantial cumulative profit by the end of the period. Notably, certain quarters, particularly in early 2022, stand out with exceptionally high profits, underscoring the impact of strategic stock selections and key market events during these periods.

5. Summary and Conclusions

This study demonstrates the potential of artificial intelligence, specifically ChatGPT-4o, in effectively constructing and managing a portfolio of cybersecurity stocks. By combining machine learning models, fundamental analysis, sentiment analysis, and optimization techniques, the AI-driven portfolio not only outperformed leading cybersecurity ETFs but also the broader market indices such as the Nasdaq 100 (QQQ) and S&P 500 (SPY). The portfolio achieved a total return of 273% over the six-year period from Q1 2018 to Q1 2024, significantly surpassing the returns of traditional diversified cybersecurity investments.
The integration of multiple AI technologies—such as Random Forests, Support Vector Machines (SVMs), and natural language processing (NLP)—allowed for a well-rounded approach to stock selection and allocation. The dynamic rebalancing process ensured that the portfolio was able to adapt to evolving market conditions, reflecting shifts in market sentiment, financial performance, and macroeconomic trends. Key financial metrics, including the Sharpe ratio, showed strong risk-adjusted performance, further validating the effectiveness of the AI-based strategy.
Despite some periods of increased volatility, particularly during the challenging market conditions of 2022, the AI portfolio displayed resilience and the ability to recover, ultimately providing consistent long-term growth. This study highlights the immense potential of using AI for portfolio management, offering insights into how data-driven approaches can uncover opportunities that traditional methods might overlook.
It is important to acknowledge potential limitations that could impact the overall findings of this research. One such limitation is the risk of overfitting in the machine learning models used. Overfitting occurs when a model learns the training data too well, including its noise and outliers, which can negatively affect its performance on new, unseen data. This could lead to overly optimistic performance metrics that may not generalize to future market conditions. Another limitation involves challenges associated with sentiment analysis. Sentiment analysis relies on the accurate interpretation of unstructured textual data from sources like news articles and social media posts. Natural language processing algorithms may struggle with nuances such as sarcasm, slang, or context-specific language, potentially leading to misinterpretations of market sentiment. Additionally, sentiment data can be noisy and may not always correlate directly with stock performance, which could affect the reliability of sentiment as a predictive feature in the models. Future research could focus on enhancing model robustness by incorporating advanced techniques to reduce overfitting and improving sentiment analysis methods to better capture the complexities of human language.

Author Contributions

G.C.; methodology, A.A.; software, Z.W.; validation, A.A., Z.W. and G.C.; formal analysis, G.C.; investigation, Z.W. The Authors declare equal contribution to this paper. All authors have read and agreed to the published version of the manuscript.

Funding

The research was funded by Western Galilee College.

Data Availability Statement

Data will be available upon request.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Shaikh, F.; Siponen, M. Organizational learning from cybersecurity performance: Effects on cybersecurity investment decisions. Inf. Syst. Front. 2023, 26, 1109–1120. [Google Scholar] [CrossRef]
  2. Fortin, A.; Héroux, S. Limited usefulness of firm-provided cybersecurity information in institutional investors’ investment analysis. Inf. Comput. Secur. 2022, 31, 108–123. [Google Scholar] [CrossRef]
  3. Nadella, G.S.; Gonaygunta, H.; Kumar, D.; Pawar, P.P. Exploring the impact of AI-driven solutions on cybersecurity adoption in small and medium enterprises. World J. Adv. Res. Rev. 2024, 22, 1190–1197. [Google Scholar]
  4. Yang, A.; Kwon, Y.; Lee, S. The impact of information sharing legislation on cybersecurity industry. Ind. Manag. Data Syst. 2020, 120, 1777–1794. [Google Scholar] [CrossRef]
  5. Gandhmal, D.P.; Kumar, K. Systematic analysis and review of stock market prediction techniques. Comput. Sci. Rev. 2019, 34, 100190. [Google Scholar] [CrossRef]
  6. Hu, G.; Hu, Y.; Yang, K.; Yu, Z.; Sung, F.; Zhang, Z.; Xie, F.; Liu, J.; Robertson, N.; Hospedales, T.; et al. Deep stock representation learning: From candlestick charts to investment decisions. In Proceedings of the 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Calgary, AB, Canada, 15–20 April 2018; pp. 2706–2710. [Google Scholar]
  7. Higgins, C.J. Simulating the Case against Stock Picking. J. Account. Bus. Financ. Res. 2018, 4, 37–39. [Google Scholar] [CrossRef]
  8. Mahajan, A. Information content of web-based stock ratings: The case of Motley fool CAPS data. J. Adv. Manag. Res. 2018, 15, 393–410. [Google Scholar] [CrossRef]
  9. Gupta, S.; Bandyopadhyay, G.; Biswas, S.; Mitra, A. An integrated framework for classification and selection of stocks for portfolio construction: Evidence from NSE, India. Decis. Mak. Appl. Manag. Eng. 2023, 6, 774–803. [Google Scholar] [CrossRef]
  10. Htun, H.H.; Biehl, M.; Petkov, N. Survey of feature selection and extraction techniques for stock market prediction. Financ. Innov. 2023, 9, 26. [Google Scholar] [CrossRef]
  11. Olorunnimbe, K.; Viktor, H. Deep learning in the stock market—A systematic survey of practice, backtesting, and applications. Artif. Intell. Rev. 2023, 56, 2057–2109. [Google Scholar] [CrossRef]
  12. Zhong, X.; Enke, D. Predicting the daily return direction of the stock market using hybrid machine learning algorithms. Financ. Innov. 2019, 5, 24. [Google Scholar] [CrossRef]
  13. Chen, K.; Zhou, Y.; Dai, F. A LSTM-based method for stock returns prediction: A case study of China stock market. In Proceedings of the 2015 IEEE International Conference on Big Data (Big Data), Santa Clara, CA, USA, 29 October–1 November 2015; pp. 2823–2824. [Google Scholar]
  14. Khedr, A.E.; Yaseen, N. Predicting stock market behavior using data mining technique and news sentiment analysis. Int. J. Intell. Syst. Appl. 2017, 9, 22–30. [Google Scholar] [CrossRef]
  15. Atsalakis, G.S.; Valavanis, K.P. Surveying stock market forecasting techniques–Part II: Soft computing methods. Expert Syst. Appl. 2009, 36, 5932–5941. [Google Scholar] [CrossRef]
  16. Ding, X.; Zhang, Y.; Liu, T.; Duan, J. Deep learning for event-driven stock prediction. In Proceedings of the Twenty-Fourth International Joint Conference on Artificial Intelligence, Buenos Aires, Argentina, 25–31 June 2015. [Google Scholar]
  17. Fischer, T.; Krauss, C. Deep learning with long short-term memory networks for financial market predictions. Eur. J. Oper. Res. 2018, 270, 654–669. [Google Scholar] [CrossRef]
  18. Henrique, B.M.; Sobreiro, V.A.; Kimura, H. Stock price prediction using support vector regression on daily and up to the minute prices. J. Financ. Data Sci. 2018, 4, 183–201. [Google Scholar] [CrossRef]
  19. Zhang, X.; Qu, S.; Huang, J.; Fang, B.; Yu, P. Stock market prediction via multi-source multiple instance learning. IEEE Access 2018, 6, 50720–50728. [Google Scholar] [CrossRef]
  20. Hiransha, M.E.A.G.; Gopalakrishnan, E.A.; Menon, V.K.; Soman, K.P. NSE stock market prediction using deep-learning models. Procedia Comput. Sci. 2018, 132, 1351–1362. [Google Scholar]
  21. Haenlein, M.; Kaplan, A. Artificial intelligence and robotics: Shaking up the business world and society at large. J. Bus. Res. 2021, 124, 405–407. [Google Scholar] [CrossRef]
  22. David, D.P.; Mermoud, A.; Gillard, S. Cyber-Security Investment in the Context of Disruptive Technologies: Extension of the Gordon-Loeb Model. arXiv 2021, arXiv:2112.04310. [Google Scholar]
  23. Ghadge, A.; Weiß, M.; Caldwell, N.D.; Wilding, R. Managing cyber risk in supply chains: A review and research agenda. Supply Chain Manag. Int. J. 2019, 25, 223–240. [Google Scholar] [CrossRef]
  24. Sari, L.; Adam, M.; Fuadah, L.L. Determinant Factors of Cyber Security Disclosure: A Systematic Literature Review. KnE Soc. Sci. 2024, 387–398. [Google Scholar] [CrossRef]
  25. Haapamäki, E.; Sihvonen, J. Cybersecurity in accounting research. In Artificial Intelligence in Accounting; Routledge: London, UK, 2022; pp. 182–214. [Google Scholar]
  26. Zia, N.U.; Buřita, L.; Huseynova, A.; Owusu, V.K. A managerial review and guidelines for Industry 4.0 factories on cybersecurity. In Proceedings of the European Conference on Information Warfare and Security (ECCWS), Chester, UK, 16–17 June 2022. [Google Scholar]
  27. Chidukwani, A.; Zander, S.; Koutsakis, P. A survey on the cyber security of small-to-medium businesses: Challenges, research focus and recommendations. IEEE Access 2022, 10, 85701–85719. [Google Scholar] [CrossRef]
Figure 1. Cumulative profit over time from Q1 2018 to Q1 2024, demonstrating the significant upward trend and overall growth in the portfolio’s value, with notable spikes and recoveries reflecting market dynamics and strategic stock selections.
Figure 1. Cumulative profit over time from Q1 2018 to Q1 2024, demonstrating the significant upward trend and overall growth in the portfolio’s value, with notable spikes and recoveries reflecting market dynamics and strategic stock selections.
Forecasting 06 00053 g001
Figure 2. Portfolio value over time from Q1 2018 to Q1 2024, highlighting the consistent growth trajectory, periodic market corrections, and the portfolio’s ability to recover and sustain value, peaking at Q1 2024.
Figure 2. Portfolio value over time from Q1 2018 to Q1 2024, highlighting the consistent growth trajectory, periodic market corrections, and the portfolio’s ability to recover and sustain value, peaking at Q1 2024.
Forecasting 06 00053 g002
Figure 3. Quarterly profit over time from Q1 2018 to Q1 2024, showing variability in quarterly profits with substantial gains and occasional losses, reflecting the dynamic nature of the cybersecurity sector and strategic stock performance.
Figure 3. Quarterly profit over time from Q1 2018 to Q1 2024, showing variability in quarterly profits with substantial gains and occasional losses, reflecting the dynamic nature of the cybersecurity sector and strategic stock performance.
Forecasting 06 00053 g003
Table 1. The AI and leading cybersecurity portfolios.
Table 1. The AI and leading cybersecurity portfolios.
AICIBRHACK
CrowdStrike Holdings0%8.96%5.65%
Broadcom Inc0%8.86%10.46%
Palo Alto Networks20%8.43%4.66%
Infosys Ltd.0%8.15%0%
Microsoft20%0%0%
Cisco Systems15%7.49%6.67%
Cloudflare Inc.0%4.49%4.57%
Check Point Software15%, 0% *4.02%0%
Okta10%3.84%0%
Fortinet10%3.72%4.67%
Radware Ltd.0%0%0%
Northrop Grumman 0%0%4.53%
General Dynamics 0%0%4.39%
Varonis Systems Inc.0%0%0%
CyberArk Software Ltd.0%0%0%
Gen Digital Inc.0%0%0%
Akamai Technologies10%0%0%
Zscaler Inc.0%, 15% **4.14%4.27%
Others0%37.9%50.13%
Total 100%100%100%
Notes: * the percentage has changed from 15% to 0% at Q3 2020. ** the percentage has changed from 0% to 15% at Q3 2020.
Table 2. Annual returns of the cybersecurity stocks.
Table 2. Annual returns of the cybersecurity stocks.
201820192020202120222023
CrowdStrike HoldingsNA−14.02%324.74%−3.34%−48.58%142.49%
Broadcom Inc.−0.3%29.05%44.88%56.48%−13.27%104.18%
Palo Alto Networks26.79%22.78%53.68%56.66%−24.81%111.32%
Infosys Ltd.21.13%11.89%68.34%52.20%−27.26%4.78%
Microsoft20.22%57.56%42.53%52.48%−28.02%58.19%
Cisco Systems14.89%13.81%−3.49%45.76%−22.46%9.30%
Cloudflare Inc.NA−5.22%345.43%73.05%−65.62%84.16%
Check Point Software−1.08%8.10%19.78%−12.30%8.24%21.11%
Okta141.12%80.83%120.39%−11.83%−69.52%32.49%
Fortinet58.80%51.58%39.13%141.97%−31.98%19.72%
Radware Ltd.16.76%13.52%7.64%50.05%−52.57%−15.54%
Northrop Grumman −18.51%42.69%−9.92%29.29%43.02%−12.79%
General Dynamics −20.18%14.80%−13.14%43.78%21.69%7.13%
Varonis Systems Inc.7.96%46.90%110.54%−10.56%−50.92%89.14%
CyberArk Software Ltd.78.26%57.24%38.61%7.23%−25.18%68.95%
Gen Digital Inc.−33.75%37.14%44.36%27.59%−15.81%9.29%
Akamai Technologies−6.83%41.42%21.54%11.48%−27.97%40.39%
Zscaler Inc.18.82%18.59%329.48%60.90%−65.18%98%
Average20.26%29.37%88.03%37.27%−27.57%48.46%
St. Deviation42.71%24.38%118.35%38.20%30.03%47.42%
Table 3. AI and other portfolio Q1 2018–Q1 2024.
Table 3. AI and other portfolio Q1 2018–Q1 2024.
AICIBRHACKQQQSPY
Total Return273%141%105%192%116%
Table 4. AI and other portfolios’ annual Sharp ratios 2018–2024.
Table 4. AI and other portfolios’ annual Sharp ratios 2018–2024.
YearAI PortfolioCIBRHACK
20183.242.512.07
20190.790.33−0.11
20201.111.061.08
20214.172.141.28
2022−2.69−1.04−1.81
20237.461.832.50
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Aiche, A.; Winer, Z.; Cohen, G. Constructing Cybersecurity Stocks Portfolio Using AI. Forecasting 2024, 6, 1065-1077. https://doi.org/10.3390/forecast6040053

AMA Style

Aiche A, Winer Z, Cohen G. Constructing Cybersecurity Stocks Portfolio Using AI. Forecasting. 2024; 6(4):1065-1077. https://doi.org/10.3390/forecast6040053

Chicago/Turabian Style

Aiche, Avishay, Zvi Winer, and Gil Cohen. 2024. "Constructing Cybersecurity Stocks Portfolio Using AI" Forecasting 6, no. 4: 1065-1077. https://doi.org/10.3390/forecast6040053

APA Style

Aiche, A., Winer, Z., & Cohen, G. (2024). Constructing Cybersecurity Stocks Portfolio Using AI. Forecasting, 6(4), 1065-1077. https://doi.org/10.3390/forecast6040053

Article Metrics

Back to TopTop