Risk Measurement and Portfolio Optimization Based on NASDAQ 100

: This paper analyzes the historical data of the NASDAQ 100 stock pool to understand the historical performance of specific stock weights, so as to optimize the investment portfolio and explore optimization methods to better avoid the financial risks brought by market fluctuations. This paper mainly uses mathematical statistics principle and mathematical model to quantify the possibility and influence degree of risk occurrence, and adopts value at risk (VaR), conditional value at risk (CVaR), maximum retracement (MD) and other analysis indicators. This paper will take the top 20 stocks by market capitalization in NASDAQ 100 index as the stock pool to analyze and judge the future return risk of different stock weighted asset portfolios. The ultimate goal of risk analysis is to control risks more effectively. Once risks are identified and quantified, investors can take corresponding risk management measures. Therefore, when calculating the risk of a certain portfolio, this paper will find the corresponding portfolio weight according to different situations, so as to optimize the portfolio. As a result, different optimization methods have made progress in different aspects. Among them, the optimization method of E[X]-CVaR is the best for the stock index, and its optimization results can obtain the maximum return and the future risk is minimal.


Introduction
Financial risks can arise from a variety of different reasons, including market fluctuations, economic changes, human causes, policy reasons, etc.Among them, market risk is usually caused by price fluctuations in the financial market, including the price fluctuations of financial assets such as stocks, bonds, commodities, and currencies, which have a negative impact on the investment portfolio, such as stock price fluctuations or currency exchange rate changes.This paper mainly studies the market risk of portfolio, explores the impact of stock price changes on the return rate of portfolio and the return rate of different asset portfolios.
In order to better predict the risk of financial market and avoid the risk to reduce the loss, the risk analysis is very important.For example, Value-at-Risk (VaR) is a common quantitative method that is able to assess the maximum loss a portfolio can suffer at a certain level of confidence.Market risk is often complex and difficult to predict, but there is a certain regularity in a long-time range, for example, when the data is taken over a long time span, the return of a stock or investment portfolio often conforms to the normal distribution.Usually, through the processing of historical data, the return rate of the corresponding investment portfolio can be obtained, and the analysis of its return rate can judge the future return risk of the investment portfolio.The ultimate purpose of risk analysis is to manage and control risks more effectively.Once the risks are identified and quantified, investors can take corresponding risk management measures.Therefore, in this paper, after calculating the risk of a certain portfolio, the corresponding portfolio weight will be found according to different conditions, such as maximizing the difference between the mean value and the variance of return, so as to optimize our portfolio.Risk analysis often relies on historical data and models.Premature historical data may not be well applicable to the present and future, and less data will increase the probability of result deviation.Moreover, the current market is also unique.All risk analysis has uncertainties, and to reduce these uncertainties, we need to continuously optimize the model and conduct sensitivity analysis.In addition, risks are diversified, and each risk is interrelated, and the market is very complex, resulting in the risk being difficult to fully predict, so we need to consider a variety of risks and evaluation methods to reduce errors.This paper can help investors maximize their returns as well as minimize future investment risks.For researchers in the same industry, it also provides them with three different weight optimization methods and selects the optimal portfolio.

Value at Risk
VaR is mainly used to calculate the possible loss degree of a certain investment portfolio at a specific time.By setting different confidence intervals, the probability and degree of potential loss in this investment portfolio can be determined.Here, VaR is mainly calculated by direct integration.First, define F(x) as the CDF function of x, determine the confidence interval α, the range of α is (0,1), and calculate VaR by the following formula: Since VaR is usually the probability of losing a certain percentage of money, it is desirable that VaR is positive.In addition, assume that the rate of return usually conforms to the law of normal distribution, that is, the PDF of X is: (2) [1] Assuming that the confidence interval is 95%, for the top 20 stocks by market capitalization of Nasdaq100 with random weights, the calculation results are shown in Figure 1: The value of VaR is 0.02956, that is, there is a 95% chance that a portfolio with this weight will lose less than 0.02956 of the amounts invested.

Conditional Value at Risk
CVaR is mainly used to calculate the possible expected loss value once the loss of the portfolio exceeds the expected value VaR, that is, to calculate the loss expectation of the loss exceeding VaR.Even if the probability of a loss exceeding VaR is only 5%, once it is exceeded, the probability of loss may far exceed the value of VaR.Once the loss of this investment exceeds VaR, the investor may face a loss far exceeding the expectation.CVaR can be calculated by the following formula: The expectation can be calculated by: The result of those 20 stocks in Nasdaq 100 was shown in Figure 3. Value of CVar is 0.04238, which means once the total loss exceeds 2.956% of total amount, the expectation of loss is 4.238% of the total investment.

Maximal Drawdown
Maximum Drawdown refers to the maximum loss a stock can suffer from trading activity in a certain period of time.Retracements are calculated based on the difference between cumulative yields.Since the cumulative return is calculated based on net worth, the retracement calculation includes both closed and open orders.If the maximum retracement is large, it indicates that the risk of capital loss is also large.For the two stocks or portfolios that ultimately benefit the same, the largest pullback is larger, and once there is a loss, the loss will be larger.The maximum retracement will be affected by the type of investment, time, and other circumstances, so it does not mean that the smaller the maximum retracement is necessarily better, and it needs to be considered comprehensively.In order to reduce the influence of time on the maximum retracement and to better judge the quality of stocks, the time span is selected as 10 years.Retracement can usually be calculated using the following formula: , where s = (0, t) Drawdowns are usually negative, so the maximum retracement is the minimum retracement in the time frame, The result of these 20 stocks is shown in Fig 3:

Skewness
Skewness is the asymmetry of the display data.Considering historical returns, if skewness is negative, the tail on the left side of the data will be longer than the right side, and most of the values will be on the right side of the mean.On the contrary, if the skewness is positive, the right tail of the data will be longer than the left, and most of the values will be on the left of the average, which will affect the expected return, but there will be a higher probability of extreme returns.In general, skewness is calculated in order to obtain the probability of excess returns.The greater the skewness, the greater the probability of excess returns [4].The formula for calculating skewness is as follows: For Nasdaq100, its result is shown in Fig 4 with a skewness of -0.533287.Its skewness is negative, that is, the performance of the Nasdaq100 over the ten-year period is not optimistic, and the excess return is expected to be poor.

Sharp Ratio
The Sharp ratio is a measure of the relationship between a portfolio's risk and return.The Sharpe ratio measures the balance between risk and return of a portfolio by comparing the expected return of the portfolio to the standard deviation.The formula is as follows: Where R p is the expected rate of return, R f is the risk-free rate, and σ p is the standard deviation.The higher the Sharpe ratio, the higher the return rate of the portfolio and the lower the risk.On the other hand, if the Sharpe ratio is small, it indicates that the return rate of the portfolio is low and the risk is high.It is generally believed that a portfolio with a Sharpe ratio greater than 0 is profitable, while a portfolio with a Sharpe ratio less than 0 is loss-making.In general, the higher the Sharpe ratio, the more attractive the portfolio [5].For the Nasdaq100 portfolio, its sharp ratio is 0.8678, positive value means these portfolios are profitable.

3.
Results of Risk Measurement

Data Collection
By analyzing the historical data of Nasdaq100 in the past ten years, the risk measurement values are calculated, and the results are shown in Table 1.

Risk Assessment
According to the cumulative income chart, the income result can be obtained, as shown in the Table 2.The cumulative return chart of Nasdaq 100 shows an upward trend, and the cumulative return, annualized return rate and average return rate are all positive, so the return of Nasdaq 100 is good in ten years.

Optimal Weight
In order to minimize the risk of loss and loss and maximize the return, the weight of the stock pool can be optimized according to different needs and different forecasting methods to obtain the best stock weight results.This paper mainly optimizes the weight of the top 20 stocks in Nasdaq 100 market based on the historical data of the past ten years, and obtains the optimal weight of the 20 stocks.The first optimization method is the optimal Mean-Variance portfolio.First, the sum of weights is set to 1, and when there is no short selling, the stock weights with the maximum meanvariance are found [6]. Figure 6 shows the optimized weight.Under this optimization weight, its maximum drawdown is 0.564, as shown in Figure 7.Its maximum retracement is greater than the retracement value before optimization, so the risk of loss will be greater than that before optimization.The second optimization method is to find the optimization weight corresponding to the minimum value of the maximum retracement when the sum of weights is 1 and there is no short.

Max ω′E[X]
Min (Maximum Drawdown) Under this optimization weight, its maximum drawdown is 0.741 as shown in Fig 9, and its maximum retracement is much smaller than the retracement value before optimization, so the risk of loss will be smaller than that before optimization, which is a very effective optimization method for investment risk.The third optimization method is when the sum of weights is 1, and there is no short, mean is less than or equal to 0.005, find the optimization weight when skewness -CVaR is the largest, that is Max  Under this optimization weight, its maximum retracement is 1.580 as shown in Figure ( 18), and its maximum retracement is smaller than the retracement value before optimization, so the risk of loss may be smaller than that before optimization, which is a very effective optimization method for investment risk.As can be seen from Figure 12, no matter which optimization method is adopted, the cumulative return is on a downward trend, so it can be seen that the investment portfolio composed of these 20 stocks has lost money over the course of ten years.However, for portfolios with different weights, the cumulative returns are also different.For Mean-CVaR minimization optimization, the cumulative benefit is the least, that is, the loss is the most, and the performance in ten years is the worst.Depending on the optimization method, the risk measurement value will be different.The forecast of future risks and returns will also be different, and the specific risk measurements are shown in Table 3.As can be seen from the table, different optimization methods have made progress in different aspects.For example, the first mean-variance optimization method increases the Sharpe ratio.If judged according to the Sharpe ratio, the investment risk is minimal and the probability of obtaining higher returns is greater.However, the investment portfolio with this weight has average performance in VaR, CVaR and maximum retracement, so it cannot be concluded that this investment portfolio has the least risk and higher future return.As can be seen from the table, for different risk measurement values, the second optimization method has better performance, which has the smallest VaR and CVaR, that is, the smallest probability of loss, so the risk under this kind of stock weight is small.Moreover, the maximum retracement of this kind of portfolio is also the smallest, that is, the maximum loss of this kind of portfolio is also the smallest during the decade, so the risk of this kind of portfolio is also small.Even the sharpe ratio under this optimization is the smallest.In addition, the skewness of the optimized portfolio is the largest and greater than zero, so its past returns are the largest and positive.

Conclusion
This paper mainly focuses on risk evaluation and portfolio optimization based on the top 20 stocks in the Nasdaq 100 by capitalization.The second method, which is minimizing maximum drawdown, is the risk-lowest method to optimize stock weight.However, only three optimization methods are used in this paper, which is very limited among many optimization methods.Moreover, the research time is short, in the actual market, stock fluctuations will be affected by many factors, and there are many better ways to balance the weight.The advantages and disadvantages of each portfolio and their focus optimization should be further discussed.Of course, backtesting of each weight optimization method can obtain more accurate data and results, which is also missing in the process of this research.Extracting historical data from data browsing software, summarizing each optimization method into a strategy, using historical data to train the model and test can make the analysis results more accurate.Additionally, the maximum retracement alone cannot fully reflect the results of this optimization, and indicators such as return rate, win rate, and average retracement rate should also be observed in the backtest.In terms of optimization algorithms, only the comparison of three algorithms cannot explain the absolute superiority of a certain method, and more factors should be extracted to determine the optimal optimization algorithm.In general, This optimization process reflects, to some extent, the benefits of the approach of minimum value of the maximum retracement.As well, the research also shows how risky the top 20 stocks in the Nasdaq 100 are, but lacks further backtesting and breadth of research.

Figure 1 :
Figure 1: The VaR Value of the Top 20 Nasdaq Stocks.

Figure 2 :
Figure 2: The VaR and CVaR Value of the Top 20 Nasdaq Stocks.

Figure 3 :
Figure 3: Drwdown of the top 20 stocks on the Nasdaq.

Figure 4 :
Figure 4: skewness of the top 20 stocks on the Nasdaq.

Figure 5 :
Figure 5: Cumulative Return of the Top 20 Stocks on the Nasdaq.

Figure 8 :
Fig 8 shows the results of optimized stock weights:
Proceedings of the 2nd International Conference on Management Research and Economic Development DOI: 10.54254/2754-1169/85/20240928 s. t ∑ W i = 1 W i > 0 E[X] ≤ 0.005 Results are shown in Fig10 and Fig 11:

Figure 11 :
Figure 11: Drawdown after Optimizing Skewness -CVaR.The three different optimization methods also have different returns in the past ten years, and their cumulative returns are shown in Fig 12:

Figure 12 :
Figure 12: Cumulative Returns of Different Optimization Methods.

Table 1 :
Nasdaq100 risk measurement results table

Table 3 :
Results of three potifolio optimization