“Strategic portfolio rebalancing: Integrating predictive models and adaptive optimization objectives in a dynamic market”

Adjusting investment strategy is one of the ways to handle dynamic market conditions. This study proposes a novel portfolio management strategy using appropriate optimization objectives for different stock market trends while also incorporating market trends and stock return predictions The optimization objectives that will be evaluated for different market trends are maximizing the Sharpe ratio, minimizing risk, and minimizing expected shortfall. This study utilizes simulation modelling with various predictive models on building the portfolios. The results show that, in an upward market trend, the strategy is to choose stocks with positive returns, and the objective is to maximize the Sharpe ratio. The portfolio that follows this strategy during up-ward market trends has greater returns than both the Indonesian Composite Index and LQ45, which serve as stock market benchmarks, with 90% certainty. Meanwhile, during the downward market trend, the strategy is to choose stocks with a negative correlation with the Indonesian Composite Index, and the proper optimization objec-tive is to minimize risk. A portfolio that follows this strategy during downward market trends has greater returns than stock market benchmarks with 95% certainty. Across the evaluation period from 2018 to 2023, the portfolio using the proposed strategy outperforms both stock market benchmarks, with a higher quarterly Sharpe ratio of 0.3047 and cumulative return of 107.90%. The proposed portfolio has a higher quarterly return than the stock market benchmark with 99% certainty. Therefore, the proposed strategy shows a promising result in a dynamic market.


INTRODUCTION
Portfolio managers regularly manage and rebalance their stock portfolios to achieve the targeted objectives.Gaining insights into the market movement can be helpful for investors to decide the appropriate investment strategy.Proper strategies are necessarily needed to navigate different market conditions (Milovidov, 2021).Comparing the managed portfolio to benchmarks such as the market index is one of the way to evaluate their performance relative to the market (van Staden et al., 2024).In fact, outperforming the market can be challenging due to its complex nature (Meoqui & Pedraza, 2011).
The process of managing a stock portfolio involves strategic decisions in selecting stocks and deciding the allocation (Kuo et al., 2021).The researchers have studied on how to obtain the optimal allocation using mathematical and machine-learning approaches to achieve the objectives.When solving the allocation problem, historical returns are used as the expected returns in the future.However, advanced predic-Investment Management and Financial Innovations, Volume 21, Issue 3, 2024 http://dx.doi.org/10.21511/imfi.21(3).2024.25 tive modeling can provide more accurate predictions of the future returns, which can give more suitable allocation based on the prediction.
Gaining insight into future market conditions can potentially be a key factor for implementing investment strategies.Adaptive portfolio management and rebalancing strategies are necessary to differentiate strategy based on market condition.One of the ways to build these strategies is to integrate insights from market trends and stock returns to manage and rebalance portfolios in dynamic market conditions.With these strategies, investors can dynamically adjust their portfolio objectives to align with market conditions and allocate their stocks based on the insights from stock prediction.

LITERATURE REVIEW
A portfolio, specifically an investment portfolio, can be defined as various assets held by an individual or organization.Managing this portfolio requires investors to determine the asset to invest in and the allocation of capital to each asset (Solares et al., 2022;Wu et al., 2021).Given that investors have limited capital, selecting which assets to invest in is essential.For a stock portfolio, investors usually use fundamental and technical factors to choose potential stocks (Drakopoulou, 2016;Eiamkanitchat et al., 2017).These factors use the historical and current characteristics of companies and stock prices.However, the latest research on stock selection has incorporated stock predictions using machinelearning algorithms (Yang et al., 2019;Yang et al., 2018;Yuan et al., 2020).Furthermore, Yang et al. (2018) showed that integrating predicted returns as an additional factor in stock selection results in better portfolio performance.
After selecting the stocks, investors must determine the allocation of capital for each stock.Markowitz (1952) proposed a mathematical model to create an efficient portfolio, where the optimal allocation was calculated to optimize certain objectives such as maximizing portfolio returns or minimizing risk.Markowitz defined a portfolio's return as the weighted average of all assets' returns in the portfolio, while the variance of weighted assets' return is the portfolio's risk.The mathematical model proposed by Markowitz is known as the mean-variance optimization model.

The mean-variance optimization proposed by
Markowitz has been used in many studies (Ma et al., 2021;Ta et al., 2020;Yang et al., 2018;Yu et al., 2020).However, there are other optimization objectives that can be used.The Sharpe ratio, a widely used portfolio performance measure, is calculated as the ratio of the excess portfolio return over the risk-free rate to the portfolio standard deviation (Levy, 2016;Sharpe, 1994).It shows the riskreturn trade-off in portfolios, providing investors with valuable insight into the relationship between risk and potential returns.Several researchers have used maximizing the Sharpe ratio as their portfolio objective.For instance, Liu et al. (2021) constructed a portfolio that maximized the Sharpe ratio and solved it using genetic programming, while Wang et al. (2022) developed an energy futures portfolio by maximizing the Sharpe ratio.On the other hand, cautious investors prefer low-risk portfolios (Jadhav & Ramanathan, 2019).Standard deviation, a common measure of portfolio risk, has conceptual difficulties (Bertsimas et al., 2004).Rockafellar and Uryasev (2000) proposed a more coherent risk measure, called expected shortfall, to optimize portfolios.Jadhav and Ramanathan (2019) used another risk measurement, the modified expected shortfall, as their minimization objective.While Markowitz initially used the average of historical returns as the expected stock returns, recent research has used return predictions ( Previous studies typically used only one optimization objective for the entire observation period.However, it is suggested that adjusting optimization objectives depending on the stock market condition may be necessary, as investors often adjust their strategies based on market conditions and have different preferences depending on the trends (Milovidov, 2021;Sokolowska & Makowiec, 2017).Stock market indices play an important role in providing insight into a country's stock market conditions (Gao et al., 2020).
In the Indonesian market, Indeks Harga Saham Gabungan (IHSG), or the Indonesia Composite Index, serves as a proxy for Indonesia's market conditions.Fuad and Yuliadi (2021) showed that inflation and exchange rates influence Indonesia Composite Index (IHSG).Hidayat  This study aims to propose an adaptive strategy for managing and rebalancing stock portfolios by aligning suitable portfolio objectives with market trends.Additionally, this strategy integrates market trend prediction and return prediction into the stock selection and optimization processes.To test how the strategy compares to market benchmarks (IHSG and LQ45), the following hypotheses were formulated: H1: The portfolio (with the suitable objective) has a greater quarterly return than the IHSG in the upward condition.
H2: The portfolio (with the suitable objective) has a greater quarterly return than LQ45 in the upward condition.
H3: The portfolio (with the suitable objective) has a greater quarterly return than the IHSG in the downward condition.
H4: The portfolio (with the suitable objective) has a greater quarterly return than LQ45 in the downward condition.
H5: The proposed portfolio's quarterly return is greater than IHSG's return.
H6: The proposed portfolio's quarterly return is greater than LQ45's return.

METHODOLOGY
This study uses secondary data, particularly macroeconomic variables, international stock market index prices, companies' historical stock prices, and financial ratios.The data are curated from YahooFinance, Stockbit, and Investing.com.The stocks used are listed on the Indonesia Stock Exchange, specifically those included in the LQ45 index, and have been publicly traded since 2015.Stocks in the LQ45 index are chosen for their stability and strong financial condition, making them preferable for investment.Additionally, these stocks require a longer listing history to provide a sufficient sample for the predictive models.
The final stock comprises of 40 stocks (Table 1).The period of time for the data is shown at Table 2.The IHSG price, which serves as a proxy for the Indonesian stock market price, along with macroeconomic variables and international stock market data, is used to build predictive models to predict trends in the Indonesian stock market.Meanwhile, stock prices and financial ratios are used to build predictive models to predict stock returns and volatility.Given the limited data on financial ratios, the length of the stock price data is adjusted to match the financial ratio data, which is from 2008.
This study incorporates the prediction of stock market trends and stocks returns in managing stock portfolios.The strategy for selecting stocks depends on the predicted future market trends.If the predicted market trend is upward, stocks with positive predicted returns are selected.Otherwise, stocks negatively correlated with IHSG are chosen.
The rationale for selecting stocks that are negatively correlated to IHSG is that they move in op-posite directions to IHSG; therefore, they potentially perform well when IHSG is on a downward trend.After stock selection, the allocation of these stocks is optimized using three portfolio optimization objectives: maximizing the Sharpe ratio, minimizing risk, and minimizing expected shortfall.These objectives are evaluated across different market trends (upward and downward) based on their performance to find the most suitable one for each market trend.Based on these findings, an adaptive strategy based on market trends then can be proposed.The portfolio using the proposed strategy is compared with two Indonesian stock market indices, IHSG and LQ45, to assess the performance of the proposed portfolio against the market.The portfolio will be rebalanced and evaluated quarterly during the period 2018-2023.The start date of each quarter is shifted by one month to ensure that all companies have released their previous quarter's financial reports (e.g., the first quarter starts in February, the second quarter in June, etc.). Figure 1  The dependent variable is the next three-month IHSG trend.If the next three-month return (r t+3 ) is positive, the trend is denoted as 1; otherwise, it is denoted as 0. r t+3 is calculated by the following formula.
where IHSG t is the value of IHSG in month-t.While the portfolio is rebalanced quarterly, the predictive model for stock market trends uses monthly data to increase the amount of training data.However, the model is tested quarterly or using data from the beginning of each quarter (February, May, August, and November) from 2018 to 2023.
The methodology for the stock return prediction is adopted from Yang et al. (2018), which uses gradient boosting regression, random forest regression, ridge regression, linear regression, and stepwise regression.The independent variables are earnings per share, net profit margin, return on equity, working capital ratio, price-to-book value, operating margin, price per share, quick ratio, return on assets, and price earnings ratio.All algorithms  Solving the portfolio optimization model results in the weight of each stock, which gives the optimal portfolio.In this study, three optimization models are compared, which shown in Table 6.
μ denotes the vector of the stock's mean return; x i denotes the weight of stock-i in the portfolio; Q denotes the stock's return covariance matrix; r f denotes the risk-free rate; φ() is the standard normal probability distribution function; Φ() is the standard normal cumulative distribution function; and α denotes the significance level.
The constraints for every optimization model are all the weights equal to 1 and no short selling.Additional constraint on minimize risk and minimize expected shortfall is the portfolio's return is equal to risk-free rate.The maximum Sharpe ratio model seeks to maximize the risk-adjusted return, which assumes a certain level of acceptable risk.
In contrast, the minimum risk and minimum expected shortfall models focus on reducing risk to the lowest possible levels, thus a return constraint is added to ensure meaningful comparison.Without this constraint, these models could potentially optimize for extremely low or even negative returns, which would not provide a useful basis for comparison.
Aside from the Sharpe ratio, the portfolio is also evaluated by the geometric return, risk, daily cumulative return, and daily standard deviation.Additionally, the probability of the portfolio with greater return than IHSG and greater than LQ45 is calculated.The probability is calculated as follows: Where n(R p >index) denotes the number of quarters in which the portfolio quarterly return is greater than the index's quarterly return and to-tal_quarter denotes the total number of quarters.

Optimization Model Optimization Objective
Maximize Sharpe Ratio max For example, if the number of quarters for upward market trends is ten, then to tal_quarter= 10.There are 20 quarters in total from February 1, 2018, to January 31, 2023.A one-tailed t-test is also employed to statistically compare the portfolio's return with indices.This study rejects the hypothesis of a normal distribution population at a 99% confidence interval.

RESULTS
B efore examining the appropriate optimization objectives for each market trend and constructing the portfolio management strategy, the stock market index, stock returns, and stock return volatility were predicted.The optimum hyperparameters obtained from hyperparameter tuning and accuracy of the model are listed in Table 7.The model was retrained using the optimum hyperparameter with all the training data to predict the test data.The accura-cy of the model for predicting the test data is 75%.Therefore, the model is not overfit and yields a better result than pure guessing (greater than 50%).
The squared error of the stock return predictions for each quarter is shown in Figure 2.There are several outliers for each quarter.The median can provide a more robust approach for determining the central tendency of the squared error in the presence of outliers.The median squared error for each quarter ranges from 0.80% to 3.76%.This means that in one quarter, half of the squared error predictions are below 3.76%, while in the other quarter, half of them are below 0.80%.This suggests that more than half of the overall squared error predictions are below 3.76%.The squared error of the models is not relatively small because of the limited number of samples as the data used are quarterly.
Meanwhile, the squared errors of the stock return volatility predictions for each quarter are shown in Figure 3.Among the 40 stocks, five (GGRM, INKP, INTP, BBCA, and BBRI) exhibit heteroscedasticity and were predicted using GARCH, while the other stocks use historical volatility.As shown in Figure 3, the squared-error stock return volatility has outliers in each quarter; thus, the median is used as a robust approach to find the central value.
The median squared error for each quarter ranges from 0.14% to 0.23%.This suggests that more than 50% of quarterly stock return volatility predictions across all quarters have squared errors of less than 0.23%.The predictions of the stock market index, stock returns, and stock return volatility are used to evaluate the appropriate objectives in both upward and downward market trends.These predictions are used in stock selection and portfolio optimization processes.Ten quarters are predicted to exhibit an upward trend.For upward market trends, stocks with positive predicted returns are selected.The portfolio that maximizes the Sharpe ratio in this trend has the highest average quarterly return, average quarterly Sharpe ratio, cumulative return, and probability of having a higher return than the IHSG.This portfolio has an average quarterly Sharpe ratio of 0.5722 and cumulative return of 107.90%.Among the 10 quarters, portfolio's quarterly returns outperform IHSG and LQ45 quarterly returns by eight quarters and six quarters, respectively.Table 9 provides further insight into the portfolio performance in this trend.Although the portfolio that maximizes the Sharpe ratio has the highest risk, with a standard deviation of returns of 1.38%, it is superior in most other evaluation metrics.Therefore, maximizing the Sharpe ratio is considered more suitable than other optimization objectives in an upward trend.Table 9 shows the statistical results for the H1 and H2 tests for the portfolio that maximizes the Sharpe ratio (Port SR).The return of this portfolio is significantly higher than that of IHSG and LQ45 at the 90% confidence level, given that H1 and H2 are rejected at a significant level of 10%.This indicates that, during upward trends, this portfolio has the potential to outperform IHSG and LQ45 with a 90% level of certainty.
Ten quarters are predicted to exhibit a downward trend.In downward market trends, stocks with a negative correlation with IHSG are selected.The portfolio that minimizes risk has the highest average quarterly return, average quarterly Sharpe ratio, and cumulative returns.Moreover, this port-Figure 3. Boxplot of return volatility prediction squared error folio has a higher quarterly return than IHSG and LQ45 in 9 out of 10 quarters.Even in downward market trends, portfolio that minimize risk shows positive average quarterly returns and average quarterly Sharpe ratios of 0.66% and 0.03725, respectively.Further insights into the performance of all portfolios in this trend are shown in Table 10.Among the three objectives, minimizing risk is the most suitable objective in terms of portfolio performance, as indicated by the evaluation metrics.The statistical results for the H3 and H4 tests for the portfolio that minimizes risk (port risk) are shown in Table 11.H3 and H4 are both rejected at a significant level of 5%.This portfolio's return is significantly higher than that of IHSG and LQ45 at the 95% confidence level.This suggests that, during downward trends, this portfolio is likely to outperform IHSG and LQ45 with a 95% level of certainty.
Based on these findings, the appropriate objective during an upward market condition is to maximize the Sharpe ratio, whereas during a downward market condition, the appropriate objective is to minimize risk.The proposed strategy involves selecting stocks with positive return predictions and maximizing the Sharpe ratio during upward market conditions.On the contrary, during downward market conditions, the strategy is to select stocks that are negatively correlated with IHSG and minimize portfolio risk.
Figure 4 shows the value of the portfolio using the proposed strategy (proposed portfolio), IHSG, and LQ45 throughout the evaluation period.Before May 2020, the proposed portfolio shows slightly better performance than IHSG and LQ45.Particularly during early COVID 19 pandemic (December 2019 -March 2021), while the values of the proposed portfolio, IHSG and LQ45 decline,the decrease in the proposed portfolio's value is less significant than the indices.After May 2020, the value of the proposed portfolio increase significantly.Table 12 shows how the proposed portfolio performs compared to IHSG and LQ45.The proposed portfolio has the highest average quarterly return, average quarterly Sharpe Ratio, and cumulative return compared with IHSG and LQ45.However, the IHSG and LQ45 have lower risks than the proposed portfolio, as indicated by the lower standard deviation.Across 20 quarters, the proposed portfolio has higher quarterly returns than IHSG and LQ45 in 17 and 15 quarters, respectively.
Table 13 presents the statistical results for H5 and H6.With a significant level of 1%, both H5 and H6 are rejected.The return of the proposed portfolio is significantly higher than that of IHSG and LQ45 at the 99% confidence interval.This suggests that the proposed portfolio outperforms IHSG and LQ45 in terms of quarterly returns with a high degree of certainty at 99%.

DISCUSSION
The results demonstrate how a portfolio with different optimization objectives performs in upward and downward market trends.Interestingly, the appropriate optimization objectives differ between these market conditions.In the upward trend condition, the portfolio that maximizes the Sharpe ratio outperforms those with other objectives, suggesting that maximizing the Sharpe ratio is the most suitable optimization objective in this market trend.Moreover, this portfolio has a higher quarterly return than IHSG and LQ45, with 90% certainty.Similarly, investors are more willing to invest in risky assets during a bullish market but still avoid excessively risky assets (Sokolowska & Makowiec, 2017).This indicates that investors still consider the trade-off between risk and return, which can be shown by the Sharpe ratio, as it calculates the excess return relative to risk.Therefore, maximizing the Sharpe ratio ensures an optimal risk-return trade-off for investors.
In contrast, during a downward trend condition, minimizing the risk is a more appropriate optimization objective.The results show that portfolio that minimizes risk outperforms the others.Furthermore, this portfolio has a higher quarterly return than the IHSG and LQ45, with 95% certainty.Investors can become more loss-averse and prefer less risky assets in bearish markets (Hwang & Satchell, 2010;Sokolowska & Makowiec, 2017).This shows how investors' aversion to risk aligns with the use of risk minimization as the portfolio optimization objective.
These findings indicate that a rebalancing strategy, which adjusts the optimization objective according to the market trend, is more appropriate than using the same optimization objective regardless of market conditions.This aligns with Schultz (2002) and Milovidov (2021), who suggest that different strategies for different market conditions are rational decisions and a necessity for investors.

CONCLUSION
This study aims to introduce a novel strategy for managing portfolios by using suitable optimization objectives that depend on market trends and integrating market trends and stock return predictions into the strategy and optimization model.This study compares three optimization objectives -maximizing the Sharpe ratio, minimizing risk, and minimizing expected shortfalls -in two market conditions: upward and downward.
In upward-trending market conditions, stocks with positive predicted returns are selected.Based on portfolio performance, this study identifies the suitable objective in an upward trend is to maximize the portfolio Sharpe ratio.The portfolio that maximizes the Sharpe ratio has the highest return and Sharpe ratio among the other portfolios.On the other hand, in downward-trending market conditions, stocks with negative correlations with IHSG are chosen.The results show that the suitable optimization objective is to minimize portfolio risk.Portfolio that minimizes risk has a positive average return and Sharpe ratio, even when the market is declining.Based on these findings, the proposed strategy is to select stocks with positive return predictions and maximize the Sharpe ratio during upward market conditions, and select stocks with negative correlation with IHSG while minimizing risk during downward market conditions.
The performance of the proposed portfolio strategy is compared with the IHSG and LQ45 indices.Although the proposed portfolio has a higher risk than IHSG and LQ45, it has a higher return and Sharpe ratio than both indices.The proposed portfolio has a higher quarterly return than the IHSG and LQ45 in more than 50% of the quarters during the evaluation period.Moreover, the proposed portfolio outperforms both the IHSG and LQ45 by having statistically greater quarterly returns with a 99% level of certainty.
Insights of market movement can be integrated to investment strategy to adjust the strategy accordingly.This study tests a portfolio rebalancing strategy using different way of selecting stock and optimization objectives to rebalance the portfolio based on the dynamic market trend.This study demonstrates that using market trend prediction, return prediction, and adjusting portfolio objectives to market conditions into the strategy can outperform the stock market on the testing period.This shows how the proposed strategy has a potential and promising performance in the dynamic market condition.
Maji et al., 2021; Ta et al., 2020; Yu et al., 2020).Yang et al. (2018) used financial ratios and several machinelearning methods to predict quarterly stock returns.Ma et al. (2021) used the combination of machine learning and deep learning in predicting stock daily return.Moreover, Yu et al. (2020) showed that using forecasted returns improves the portfolio performance as the portfolio is allocated more efficiently.In addition to stock return prediction, investors can also incorporate stock return volatility predictions.The Generalized Autoregressive Conditional Heteroskedasticity (GARCH) model is commonly used to predict stock volatility (Wang et al., 2020).Notably, Awalludin et al. (2018) used GARCH (1,1) Investment Management and Financial Innovations, Volume 21, Issue 3, 2024 http://dx.doi.org/10.21511/imfi.21(3).2024.25 to model the volatility of several Indonesian stocks.Wang et al. (2020) used GARCH-MIDAS to predict stock volatility.Budiandru (2021) applied the ARCH-GARCH model to predict Indonesia Sharia Stock Index volatility.

Figure 2 .
Figure 2. Boxplot of return prediction squared error

Table 1 .
Final pool of stocks

Table 2 .
Time period of the data

Table 3 .
Data distribution for training and testing The optimum hyperparameters are determined through a grid search with a 10-fold cross-validation.Grid search is a method for finding hyperparameters by fitting each combination of hyper-Investment Management and Financial Innovations, Volume 21, Issue 3, 2024 http://dx.doi.org/10.21511/imfi.21(3).2024.25parametersinto the training data and finding the best one based on accuracy.The training data are divided into 10 groups, and the hyperparameters are fitted into nine groups and validated in one group.This process is repeated until each group has been used as the validation data.The average accuracy of the validation data is used to determine the optimal hyperparameters.This method is considered more robust than the traditional method of dividing data into three sets: training, validation, and testing.The tested hyperparameters are listed in Table4.

Table 4 .
Hyperparameter list diction, the model will be fitted into slightly different training data from before, which consists of the previous training data but drops the oldest data by one period and adds newer data by one period.Therefore, the length of the training data remains the same, but newer data is used for every prediction.
Yang et al. (2018)ning data.The model is then validated using data from one quarter before the data test to determine the best algorithm.The best model is tested to predict the next quarter's stock returns.The models are tested quarterly from February 1, 2018, to January 31, 2023.Yang et al. (2018)trained models separately for each stock sector; hence, all stocks in the same sector and period were predicted using the same algorithm.In contrast toYang et al. (2018), this study models each stock separately.Therefore, in each quarter, different stocks can use different algorithms to predict the next-quarter return.Besides, stock return volatility is predicted.Monthly stock return volatility is predicted instead of quarterly volatility, because quarterly returns have a limited number of observations; hence, heteroscedasticity is rarely observed.The model predicts the monthly volatility over three months.The latest month among the three predictions is converted into quarterly volatility and used for the quarterly volatility prediction.To predict stock return volatility, the GARCH model is used for stocks exhibiting heteroscedasticity, as confirmed through the Breusch-Pagan test.Stocks that do not exhibit heteroscedasticity are assumed to have a constant variance.The division of data for training and testing purposes is presented in Table5.The stock return volatility model is tested quarterly. are

Table 8 .
Performance comparison of portfolio with different objectives in upward trend condition

Table 12 .
Proposed portfolio comparison with IHSG and LQ45

Table 13 .
Statistical result on proposed portfolio's return compared to IHSG and LQ45