
A rational investor always pursues a portfolio with the greatest possible return and the least possible risk. Therefore, a core issue of investment decision analysis is how to make an optimal investment choice in the market with fuzzy information and realize the balance between maximizing the return on assets and minimizing the risk. In order to find optimal investment portfolios of financial assets with high volatility, such as gold and Bitcoin, a mathematical model for formulating investment strategies based on the long short-term memory time series and the dynamic programming model combined with the greedy algorithm has been proposed in this paper. The model provides the optimal daily strategy for the five-year trading period so that it can achieve the maximum expected return every day under the condition of a certain investment amount and a certain risk. In addition, a reasonable risk measure based on historical increases is established while considering the weights brought by different investment preferences. The empirical analysis results show that the optimal total assets and initial capital obtained by the model change in the same proportion, and the model is relatively stable and has strong adaptability to the initial capital. Therefore, the proposed model has practical reference value and research significance for investors and promotes a better combination of computer technology and financial investment decision.
Citation: Jiuchao Ban, Yiran Wang, Bingjie Liu, Hongjun Li. Optimization of venture portfolio based on LSTM and dynamic programming[J]. AIMS Mathematics, 2023, 8(3): 5462-5483. doi: 10.3934/math.2023275
[1] | Chenyang Hu, Yuelin Gao, Eryang Guo . Fractional portfolio optimization based on different risk measures in fuzzy environment. AIMS Mathematics, 2025, 10(4): 8331-8363. doi: 10.3934/math.2025384 |
[2] | Fei Yu . Multiperiod distributionally robust portfolio selection with regime-switching under CVaR risk measures. AIMS Mathematics, 2025, 10(4): 9974-10001. doi: 10.3934/math.2025456 |
[3] | Yunjae Nam, Dongsun Lee . Efficient one asset replacement scheme for an optimized portfolio. AIMS Mathematics, 2022, 7(9): 15881-15903. doi: 10.3934/math.2022869 |
[4] | Guocheng Li, Pan Zhao, Minghua Shi, Gensheng Li . A hybrid framework for mean-CVaR portfolio selection under jump-diffusion processes: Combining cross-entropy method with beluga whale optimization. AIMS Mathematics, 2024, 9(8): 19911-19942. doi: 10.3934/math.2024972 |
[5] | Chengjin Tang, Jiahao Guo, Yinghui Dong . Optimal investment based on performance measure with a stochastic benchmark. AIMS Mathematics, 2025, 10(2): 2750-2770. doi: 10.3934/math.2025129 |
[6] | Doong Toong Lim, Khang Wen Goh, Lam Hong Lee . A new class of Shariah-compliant portfolio optimization model: diversification analysis. AIMS Mathematics, 2023, 8(9): 20933-20965. doi: 10.3934/math.20231066 |
[7] | Liyuan Zhang, Limian Ci, Yonghong Wu, Benchawan Wiwatanapataphee . Blockchain asset portfolio optimization with proportional and fixed transaction fees. AIMS Mathematics, 2025, 10(3): 6694-6718. doi: 10.3934/math.2025306 |
[8] | Dennis Llemit, Jose Maria Escaner IV . Value functions in a regime switching jump diffusion with delay market model. AIMS Mathematics, 2021, 6(10): 11595-11609. doi: 10.3934/math.2021673 |
[9] | Dongsheng Xu, Qingqing Liu, Xin Jiang . The principal-agent model in venture investment based on fairness preference. AIMS Mathematics, 2021, 6(3): 2171-2195. doi: 10.3934/math.2021132 |
[10] | CW Chukwu, S. Y. Tchoumi, Z. Chazuka, M. L. Juga, G. Obaido . Assessing the impact of human behavior towards preventative measures on COVID-19 dynamics for Gauteng, South Africa: a simulation and forecasting approach. AIMS Mathematics, 2024, 9(5): 10511-10535. doi: 10.3934/math.2024514 |
A rational investor always pursues a portfolio with the greatest possible return and the least possible risk. Therefore, a core issue of investment decision analysis is how to make an optimal investment choice in the market with fuzzy information and realize the balance between maximizing the return on assets and minimizing the risk. In order to find optimal investment portfolios of financial assets with high volatility, such as gold and Bitcoin, a mathematical model for formulating investment strategies based on the long short-term memory time series and the dynamic programming model combined with the greedy algorithm has been proposed in this paper. The model provides the optimal daily strategy for the five-year trading period so that it can achieve the maximum expected return every day under the condition of a certain investment amount and a certain risk. In addition, a reasonable risk measure based on historical increases is established while considering the weights brought by different investment preferences. The empirical analysis results show that the optimal total assets and initial capital obtained by the model change in the same proportion, and the model is relatively stable and has strong adaptability to the initial capital. Therefore, the proposed model has practical reference value and research significance for investors and promotes a better combination of computer technology and financial investment decision.
Gold is a multi-faceted metal with dual properties, gold commodity, and currency. It has been used as a store of value for wealth for centuries because it can effectively avoid various risks. Bitcoin is the first decentralized digital currency not regulated by any central bank or authority. Therefore, gold and Bitcoin are often used as investment portfolios in market transactions [1,2].
Portfolio management is a very complex unstructured decision-making process involving a series of techniques such as financial forecasting, investment decision analysis, and portfolio optimization [3]. It is affected by macroeconomics, investor psychology, and government policies. With the continuous changes in the financial market, the information on financial assets in the market is also changing. Investors not only need to adjust the assets in the portfolio they have held but also need to decide which assets to buy in the market based on market conditions and which assets to sell at the same time to maximize the utility of the investment [4].
From September 11, 2016, to September 10, 2021, the daily price fluctuation of gold and Bitcoin has gradually changed from gentle to violent. We will have a portfolio that includes cash, gold, and Bitcoin [C,G,B] on each trading day during this period. Their units are dollars, troy ounces, and Bitcoins, respectively, and the initial state is [C0,0,0]. Traders buy, hold or sell assets in their portfolios every day. Bitcoin can be traded daily, but gold is traded only when the market is open, and there is a specific commission for each transaction. We are aiming to
(1) develop a model that uses only the past daily price to determine the best daily trading strategy and calculate the value of the initial C0 dollars investment on the last day;
(2) prove that the proposed trading strategy is optimal;
(3) determine the sensitivity of the strategy and outcome to transaction costs.
In the past twenty years, models of price forecasting and portfolio planning have been well established through various research. Changlin Yang et. al.[5] believed that when processing time series data, the combination of Long Short-Term Memory network (LSTM) and dynamic programming will be more effective. Both gold and Bitcoin prices studied in this paper are time series data. This research aims to predict the prices of gold and Bitcoin and maximize the interests of investors by planning based on the prediction results.
First, with the deepening of artificial neural network research in financial data, the application of artificial neural network research in predicting gold and Bitcoin prices is increasingly extensive.
The Recursive Neural Network (RNN) builds connections between neurons at the same hidden layer to obtain contextual information of data to play its advantages in short-term memory [6]. When RNN deals with long-term time series, gradient disappearance and gradient explosion often occur, resulting in too small memory value and poor effect. Therefore, we use LSTM (Long short-term Memory Network) model in this question. Its performance in long-distance dependent tasks is far superior to that of RNN. In the process of degree backpropagation, it will no longer be troubled by the problem of gradient disappearance, and it can accurately model the data with short-term or long-term dependence[7].
The second, Rene Schnieper et. al.[8] assumed that the two objectives of investors were maximum return and minimum risk, respectively, and were weighted according to investors' preferences. On this basis, Konno et al.[9] used the absolute deviation of portfolio returns as a measure of risk. A branch and bound algorithm are proposed to calculate portfolio construction with concave transaction cost and minimum transaction unit constraints.
To adapt to changes in stock trends, Yan Chen et. al.[10] use technical indices and candlestick charts as judgment functions and create trading rules to form a model of dynamic portfolio optimization that changes with time-based on-time adapting genetic network programming (TA-GNP). This paper has significant advantages over the traditional static strategy. TA-GNP consists of control nodes, judgment nodes, and processing nodes. RL is used in TA-GNP individuals to select the appropriate subnode functions, i.e., determining the kind of technical indices and candlestick chart patterns (the study uses "bull" or "bear" market signals) to be used in the judgment nodes while determining buy and sell actions in the processing node based on a greedy strategy. However, this method lacks further research in considering transaction cost and risk during trading.
To solve the estimation problem in the application of actual data, Gaah-Yi Ban et. al.[11] introduced performance-based regularization for the mean-variance and mean-CVAR problems, proposed and analyzed a new portfolio optimization model, and showed that the PBR portfolio model could be cast as a robust optimization problem. Further, Ling Rao et. al.[3] first used the driven uncertain fractional differential equation to model and predict stock prices and introduced the left half deviation of uncertain variables to quantify risks. Finally, the uncertain fractional differential equation is used to formulate the investment strategy.
Compared with evolutionary algorithms, Changlin Yang et. al.[5] believe that the dynamic programming (DP) method has the following advantages. First, DP can generate a globally optimal solution that maximizes total assets. Second, with a different number of optimized Wells forming multiple problem stages in each subproblem, DP is well suited for multi-stage or sequential decision processes. Third, DP avoids recalculation of repeating subproblems and has high efficiency.
Compared to those existing methods, our method shows three highlights.
(1) The proposed method has excellent predictions and benefits the judgment of subsequent planning problems.
(2) In the dynamic programming process, several additional variables are employed to transform the problem of absolute value term in the recursive function into the problem without absolute value term, which is more friendly and flexible for finding the optimal solution.
(3) The dynamic programming model we established also considers the quantification of risks to target different types of investors with other risk preferences.
Our model is built based on two basic assumptions:
● In the first two months of the trading period, due to the lack of historical data and the inability of making an accurate prediction, so we decided not to carry out the trading, which will begin on November 21, 2016.
● The daily strategy is based only on historical data to date to maximize profits from the current perspective.
The proposed model, as shown in Figure 1, is described in the following subsections.
To better describe our method, some symbols used in our model are listed in Table 1 in advance.
Symbols | Definitions |
Ci | Cash holdings in the portfolio of the ith day(Units: dollars) |
Gi | Gold holdings in the portfolio of the ith day(Units: troy ounces) |
Bi | Bitcoin holdings in the portfolio of the ith day(Units: Bitcoins) |
Mi | Trading value of gold of the ith day(Units: dollars) |
Ni | Trading value of Bitcoin of the ith day(Units: dollars) |
Pi | The price of gold of the ith day |
Qi | The price of Bitcoin of the ith day |
ˆPi | Gold forecast price of the ith day |
ˆQi | Bitcoin forecast price of the ith day |
ri | Gold investment risk rate of the ith day |
ti | Bitcoin investment risk rate of the ith day |
fi | Forecast return on investment of the ith day(Units: dollars) |
Fi | Actual return on investment of the ith day(Units: dollars) |
gi | The investment risk of the ith day(Units: dollars) |
hi | Investment planning objectives of the ith day(Units: dollars) |
w | The weight of risk versus benefit |
It describes daily gold prices and Bitcoin daily prices in London Bullion Market Association and NASDAQ, respectively. Gold daily prices are a time series from 9/12/2016 to 9/10/2021, and Bitcoin daily prices are a time series from 9/11/2016 to 9/10/2021.
Gold does not trade on dates not mentioned in the dataset, and there is a case where a date exists in the dataset, but a daily gold price is missing. To facilitate the forecast, we fill in the missing values with data not missing from the previous day and assume that the price is unchanged. The basic descriptive statistics of daily gold prices and Bitcoin daily prices, including the minimum price (Min), the lower quartile(1st Qu), Median, Mean, the upper quartile(3rd Qu), the maximum price(Max), and the number of trading days(num), are listed in Table 2.
Data | Min | 1st Qu | Median | Mean | 3rd Qu | Max | num |
Gold | 1126 | 1266 | 1329 | 1464 | 1724 | 2067 | 1265 |
Bitcoin | 594.1 | 3995 | 7924.5 | 12206.1 | 11084.7 | 63554.4 | 1826 |
Finally, we explored the characteristics of gold price data and Bitcoin price data. We conduct the ADF test and Ljung-box test on the price data, and the results show that these p-values were both less than 0.05, so the data was significantly stable and not a white noise sequence, so the subsequent prediction model for it is indeed appropriate.
We can see from the trend chart in the question that the time series of gold and Bitcoin is not a smooth process, and each day needs only to use the past daily price flow so far to predict the price of the next working day and to make a decision: Buy, hold or sell the asset. We can use LSTM to complete the task.
LSTM unit has three gating types : Input gate σi, forget gate σf, and output gate σo, as shown in Figure 2.
Gating is realized by sigmoid function and dot product operation, and its general form can be expressed as
σ(x)=11+e−x, | (3.1) |
and
σβ(x)=σ(wβx+bβ),β∈{i,f,o}. | (3.2) |
The calculation process of LSTM is the same as [12], in which is listed as follows for making the method a whole.
Let xt be the input and ht the state value of cells at time t. w and b represent the network's weight matrix and bias vector. The one with tanh represents the feedforward network layer whose activation function is tanh. Then, the value of the candidate memory unit ~ct at time t, the value of input gate it and the value of forgetting gate ft are calculated respectively using follow formulae
~ct=tanh(wc[ht−1,xt]+bc), | (3.3) |
it=σ(wi[ht−1,xt]+bi), | (3.4) |
ft=σ(wf[ht−1,xt]+bf). | (3.5) |
The old state is multiplied by the forgetting gate information, and part of the information is discarded. The value of the memory unit at the current moment is obtained by adding the input gate and candidate memory unit values ct, as
ct=ftct−1+it~ct. | (3.6) |
Finally, the value of the output gate through the output gate ot and the output part ht are obtained as
ot=σ(wo[ht−1,xt]+bo), | (3.7) |
ht=ottanh(ct). | (3.8) |
A decision model is built based on the greedy algorithm and dynamic programming.
For the five-year trading period from September 11, 2016, to September 10, 2021, there is a portfolio [Ci,Gi,Bi] of cash, gold, and Bitcoin on the ith trading day. Their units are dollars, troy ounces, and Bitcoins respectively. Assuming that the initial state is [C0,0,0],C0>0; the value of gold used for trading on the ith day is Mi (dollars), and the value of Bitcoins used for trading is Ni (dollars), and the commission rates for each transaction are αgold and αBitcoin, then the following recursive equation can be obtained:
Ci+1=Ci−Mi−Ni−αgold⋅|Mi|−αBitcoin⋅|Ni|, | (3.9) |
Gi+1=Gi+MiPi, | (3.10) |
Bi+1=Bi+NiQi, | (3.11) |
where Pi and Qi are respectively the prices of gold and Bitcoin on the ith day. Note that if Mi<0, Gi+1<Gi, which means that this transaction is to sell gold. Similarly, if Ni<0, Bi+1<Bi, which means that this transaction is to sell Bitcoin.
In order to get as much return as possible and take as little risk as possible, we choose the optimal portfolio plan through the object-weighted method [13].
Firstly, the following mathematical models are established according to the maximum return
maxfi+1=Ci+1+Gi+1⋅ˆPi+1+Bi+1⋅ˆQi+1, | (3.12) |
and minimum risk
mingi+1=ri⋅Mi+ti⋅Ni. | (3.13) |
In formula 3.12, ˆPi+1, ˆQi+1 are respectively the predicted price of gold and Bitcoin on the ith day. In formula 3.13, rt and ti are the investment risk rates of gold and Bitcoin, respectively.
Then, by introducing the subjective factor w of venture investors, the multi-objective programming problem is transformed into a single objective problem:
minhi+1=w×gi+1+(1−w)×(−fi+1). | (3.14) |
The smaller w is, the more willing investors are to take risks. When w=0, the investor does not consider the risk. That is, the investor is an activist investor. When w=1, it indicates that the investor is stable.
Considering that gold trades only on the days when the market is open, we introduce the 0–1 variable ηi:
ηi={1,Gold open quotation,0,Gold market close. | (3.15) |
When ηi = 1, we can trade both Bitcoin and gold on the ith day. When ηi = 0, we can only trade Bitcoin on the ith day. After using variable ηi, the decision function 3.13 can be updated as
mingi+1=ηi⋅ri⋅Mi+ti⋅Ni. | (3.16) |
Then the decision model is as follows:
{minhi+1=w⋅gi+1+(1−w)⋅(−fi+1),s.t.Ci+1=Ci−ηi⋅Mi−Ni−ηi⋅αgold⋅|Mi|−αBitcoin⋅|Ni|,Gi+1=Gi+ηi⋅MiPi,Bi+1=Bi+NiQi,Ci+1≥0,Gi+1≥0,Bi+1≥0. | (3.17) |
To solve the decision model, we adopt the basic idea of the greedy algorithm: The decision made every day is only aimed at the optimal result of the next day, not the globally optimal result of the last day. Next, the decision that should be made one day can be obtained by solving the model. The decision uses the predicted price on the (i+1)th day and takes the optimal combination of benefits and risks on the (i+1)th day as the objective function. The actual total assets of the investor on the (i+1)th day after making this decision are:
Fi+1=Ci+1+Gi+1⋅Pi+1+Bi+1⋅Qi+1. | (3.18) |
Bias Ratio γi on the ith day represents the difference between a gold's closing price or intraday market price and its moving average for the day and analyzes the extent to which a gold price deviates from its average price (average cost) for a given period. Its formula is:
γi=Pc−Pm,iPm,i⋅100, | (3.19) |
where Pc is the closing price of the day, Pm,i the moving average price on the past i days.
The Bias Ratio can be divided into positive Bias Ratio and negative Bias Ratio. If the gold price is above the moving average, it is called a positive Bias Ratio, and the gold can be sold. In contrast, it is known as a negative Bias Ratio and can be bought. The Bias Ratio can be regarded as the average rate of return in a certain period.
The bull market and bear market analysis is also introduced in our model. In the gold market, when everyone is optimistic about the future, it is called a bull market; When the outlook is bearish, it is called a bear market. Bull market evaluation indicators BMI are defined as
BMI=ˉr1≤i≤90⋅W+ˉγ1≤i≤90⋅(1−W), | (3.20) |
where ˉr1≤i≤90 is the first ninety-day average of the increase; ˉγ1≤i≤90 is the first ninety-day average of bias ratio on the ith day. W is the self-defined weight. In our model, we set W equal to 0.5. If BMI on the day i is greater than the average BMI, it is a bull market. On the contrary, if BMI on the day i is less than the average BMI, it is a bear market.
For example, if the ith day is a bull market according to the index, it is a bull market from one quarter ago to the ith day. However, the (i−1)th day is calculated as a bear market and the (i+1)th day is also calculated as a bear market, which may be due to a significant error in the calculation results of the ith day. To solve this error, we set the initial value at all times to 0, and the previous quarter's value is increased by 1 if the current calculation is bullish, and the previous quarter's value is decreased by 1 if the current calculation is bearish. The final result is a bull market if it is greater than 0 and a bear market if it is less than 0.
The bull market and bear market analysis of Bitcoin is the same method as gold.
After the normalization of the bull market score, the risk is quantified and set as follows:
rpurchase=γi⋅W+BMI⋅(1−W), | (3.21) |
where rpurchase is the purchase risk ratio, and W is the weight. We let W=0.5, for we consider γi and BMI equally. In this way, the risk rates for buying gold ri and Bitcoin purchase risk ti can be estimated.
The first is the model performance and prediction results of gold price. This research splits the gold price dataset, with the first 90% being the training set and the last 10% being the test set. When the solver was adam and the gradient threshold was 1, we conducted 300 rounds of training and specified the initial learning rate as 0.005. After 125 rounds of training, the learning rate was reduced by multiplying the factor by 0.2. The model performance can be seen intuitively in Figure 3. The model effect can also be quantitatively evaluated with index RMSE, i.e.,
RMSE=√1nn∑i=1d2i, | (4.1) |
where di is the difference between predicted and actual values of each day. For the prediction of USD(PM) by LSTM, RMSE = 22.79 means that the model has a good effect. Therefore, we use the LSTM model to conduct an iterative prediction of gold price after the 51st day. We use the previous (n−1) day's price to predict the nth day's price. Figure 4 shows a reasonable prediction effect, and RMSE is only 13.86.
The second is the model performance and prediction results of Bitcoin. This research splits the Bitcoin price dataset, with the first 90% being the training set and the last 10% being the test set. When the solver was adam, and the gradient threshold was 1, we conducted 300 rounds of training and specified the initial learning rate as 0.003. After 125 rounds of training, the learning rate was reduced by multiplying the factor by 0.2. The model performance can be seen intuitively in Figure 5. By comparing the predicted data with the original data, RMSE = 3490 is related to a large amount of data in the data set. Using the trained LSTM model, the Bitcoin price is iteratively predicted, and the prediction result obtained in Figure 6 with the RMSE is 1353.30.
To make the prediction of Bitcoin price more accurate, we make the difference between the price of Bitcoin every day and the previous day's price as a data set. The relevant learning rate and other settings are consistent with the above settings of gold price prediction, and the model is modeled again. The model performance can be seen intuitively in Figure 7. This time, the trained LSTM model was used for iterative prediction of this data set, and the prediction result was obtained in Figure 8, RMSE is 957.96. We believe that the model has been improved. Then, the result of the model, i.e., the daily forecast difference, is added together with the accurate price of Bitcoin on that day to obtain the forecast price of Bitcoin on the next day. Thus, the forecast price of Bitcoin after the 51st day is accepted.
The average increase is calculated based on the price of gold and Bitcoin every five, ten, fifteen, and twenty days. According to the change curve of gold price increase from Figure 9(a) to Figure 9(d), it is found that the mean value of gold price increase is small, so the mean value of daily gold prices increase every 15 days is selected for calculation. According to the change curve of Bitcoin price increase from Figure 10(a) to Figure 10(d), we can find that if the average value of the growth is calculated every five days, the maximum gain is 2000. If the average increase value is calculated every ten days, the top growth is reduced to 1000. However, daily gold prices will miss drastic changes, so we evaluate the value according to the average increase value in five days.
According to the defined bull market evaluation index, the BMI of gold is 0.574829, while Bitcoin is 0.53531. Then use the voting method to determine the time of the bull and bear market according to the indicators, as shown in Figures 11 and 12. Finally, according to the defined purchase risk rate, the gold purchase risk rate ri and Bitcoin purchase risk rate ti are calculated according to the formula (3.21). The results are shown in Figure 13.
In the forecast model, we get the forecast price for the day ahead from a daily perspective. According to this prediction, dynamic planning is carried out with high returns and low risks. Each transaction volume of gold and Bitcoin is obtained using the proposed algorithm. After the transaction, the holding of cash, gold, and Bitcoin will be updated. We use the daily updated asset holdings [Ci, Gi, Bi] to reflect the daily decisions. By adjusting the weights and controlling the risk, we get the best strategy at w = 0.5. See Figures 14(a)–14(c) for daily decisions.
Then, the total assets Fi after daily decisions are calculated according to formula (3.18). As seen from Figure 14(d), after five years of trading, the final cost of 1000 yuan is worth 62757.60 on September 10, 2021.
In addition, we explore the returns of optimal strategies under different weights. After adjusting the weight with the step size of 0.1 to calculate the gain, the result is shown in Figure 15. It shows that the stronger the risk aversion consciousness is, the smaller the risk and the smaller the benefit. Moreover, ignoring the risk, the investor may also pay the price for being too radical. Here we can see that when w = 0.5, intermediate investors are more likely to obtain high returns.
In the dynamic programming model, we calculated the optimal daily strategy for 1,755 trading days through an algorithmic solution, and the final total assets were 62757.60 dollars. In order to provide evidence of optimal strategy, the trading volume of gold or Bitcoin with different optimal daily strategies is randomly selected to be disturbed by changing it to 0.9 times of its original value. In this way, more opportunities may be left for trading in the future with greater returns, but some current investment gains may also be lost. The total assets calculated on September 10, 2021, according to the disturbing strategy, are shown in Table 3.
Number of disturbance | 1 | 2 | 3 | 4 | 5 |
The final asset | 48848.02 | 52989.34 | 55631.51 | 61486.30 | 61833.41 |
It can be seen from Table 3 that the final returns obtained after five perturbations are all less than those obtained by our strategy, which illustrates that our strategy is indeed the optimal strategy to a certain extent.
Sensitivity analysis is to study the influence degree on the optimal solution of the function when the coefficient changes in the current linear programming problem. According to the initial state, C0=1000,G0=0, andB0=0. We use the proposed model described in Section 3 to give the daily optimal strategy and results. In order to explore the sensitivity of the model to the initial capital and how the initial capital affects the strategy and results, we calculate total assets by assuming three levels of the initial capital C0=2000,1000, and 500, respectively. Table 4 shows the final assets held on September 10, 2021 using the model only under the initial state change.
[C0G0B0] | Total Assets (in dollars) |
[2000 0 0] | 125515.19 |
[1000 0 0] | 62757.60 |
[500 0 0] | 31378.80 |
According to the data in Table 4, we can see that if the initial capital is doubled, the total assets held in the end will also be doubled; If the initial capital decreases by 1/2, the final total assets held will also decrease by 1/2. Figures 16 and 17 show the optimal decision and results under three initial states.
Through comparison, it can be seen that the changing trend of the broken line chart of daily cash, gold and Bitcoin holdings is the same when the initial value of C is 2000, 1000, and 500, and the changing trend of total daily assets is the same under the three conditions. The comparison also shows that the above model has high adaptability to various initial states.
To explore the sensitivity of the above model to commission and how commission affects strategy and results, we changed the size of αgold and αBitcoin so that one remains unchanged when the other changes up and down. Table 5 shows the selection of values of αgold and αBitcoin and the results of decision-making using the above model.
αgold | αBitcoin | Total assets (unit: dollars) |
1% | 2.5% | 19394.14 |
1% | 1.5% | 431513.84 |
1% | 2% | 62757.60 |
1.5% | 2% | 68254.46 |
0.5% | 2% | 80197.99 |
The calculation results show that when αBitcoin is increased by 0.25, the total assets change by 0.7, when αBitcoin is decreased by 0.25, the total assets change by 5.88; when αgold is increased by 0.5, the total assets change by 0.09, and when αgold is decreased by 0.5, the total assets change by 0.28. The model is relatively stable. Figures 18–21 below show the optimal decisions and results under different αgold and αBitcoin. It can also be seen that under this model, the final total assets can be increased by reducing αgold and αBitcoin.
In order to decide within the five-year trading period and only use price data up to that day every day instead of from the perspective of God, we first use historical data to obtain the predicted prices of gold and Bitcoin on the following day on each trading day, which means that for each additional day step, the data set supporting the prediction will also be added with one more day of data. According to this characteristic, we choose to use the LSTM time series prediction model for prediction, and through parameter adjustment, we have a better prediction effect.
Considering that it is impossible to make an accurate prediction in the first two months of the trading period due to the small amount of historical data, we do not conduct any trading in the first two months.
Every day from November 21, 2016, we use the predicted price of the next day and the investment risk rate generated by historical data analysis to establish a planning model. We hope to select the optimal portfolio scheme through the calculation to obtain as much income as possible under the condition of taking as little risk as possible. Therefore, we introduce a weight w to transform the multi-objective problem containing the maximum expected income and the minimum risk into a single objective problem. This consideration makes our model more suitable for investments with large fluctuations, such as gold and Bitcoin.
Based on this model, we solve it circularly through the algorithm and provide the optimal strategy when the risk weight is 0.5. The daily holdings of cash, gold, and Bitcoin adopting this strategy are shown in Figures 14(a)–14(c). If the above strategy is adopted, the total assets will grow faster and faster every day, and the trend is shown in Figure 14(d). Finally, Assets worth 62757.60 dollars will be acquired on September 10, 2021.
When predicting the price of gold and Bitcoin, the LSTM model is consistent with our data iterative prediction characteristics and can accurately reflect the prediction results from different date perspectives. Traders with different investment preferences choose the risk weight and strategy direction that suits them. The consideration of the risk is better than the strategy obtained without considering the risk.
Our current single forecasting model has its limitations. The one limitation is that the model is unsuitable for long-term direct prediction. It can only accurately predict the next day's price trend, which is a locally optimal solution for five years, so there is no guarantee that it certainly reaches the global optimal solution for long-term direct prediction from the perspective of God. The other limitation is that the model is still inadequate for more complex financial markets. The financial market is very complex [14]. Not only book numbers determine the rise and fall of stock prices but also very complex human factors, such as public opinion orientation, political environment, and news events, which form the characteristics of high noise and unpredictable stock data. When considering the above factors, a single model will not cover everything, of course, because of the inherent properties of the model itself. In the future, based on our current model, we will combine the advantages of another model (such as CNN and BP) to create a better model which can be genuinely applied to complex financial markets.
The research is supported by the Teaching Reform Project of Beijing Forestry University (BJFU2020JYZD007).
The authors declare no conflict of interest.
[1] |
D. G. Baur, T. Dimpfl, K. Kuck, Bitcoin, gold and the us dollar-a replication and extension, Financ. Res. Lett., 25 (2018), 103–110. https://doi.org/10.1016/j.frl.2017.10.012 doi: 10.1016/j.frl.2017.10.012
![]() |
[2] |
I. Musialkowska, A. Kliber, K. Świerczyńska, P. Marszalek, Looking for a safe-haven in a crisis-driven venezuela: The caracas stock exchange vs gold, oil and bitcoin, Transform. Gov. People, 14 (2020), 475–494. http://doi.org/10.1108/TG-01-2020-0009 doi: 10.1108/TG-01-2020-0009
![]() |
[3] |
L. Rao, Portfolio selection based on uncertain fractional differential equation, AIMS Mathematics, 7 (2022), 4304–4314. http://doi.org/10.3934/math.2022238 doi: 10.3934/math.2022238
![]() |
[4] | W. Wang, N. Zhang, D. Fan, X. Wang, Intelligent portfolio optimization based on dynamic trading and risk constraints, J. Cent. Univ. Financ. Econ., 2021, 32–47. |
[5] |
C. Yang, X. Wang, A steam injection distribution optimization method for sagd oil field using lstm and dynamic programming, ISA T., 110 (2020), 195–248. https://doi.org/10.1016/j.isatra.2020.10.029 doi: 10.1016/j.isatra.2020.10.029
![]() |
[6] |
N. Zhang, J. Fang, Y. Zhao, Bitcoin price prediction based on lstm hybrid model, Comput. Sci., 48 (2021), 39–45. https://doi.org/10.11896/jsjkx.210600124 doi: 10.11896/jsjkx.210600124
![]() |
[7] | L. Yang, Y. Wu, J. Wang, Y. Liu, A review of research on recurrent neural networks, Comput. Appl., 38 (2018). |
[8] |
R. Schnieper, Portfolio optimization, Astin Bull., 30 (2000), 195–248. https://doi.org/10.1007/0-387-24149-3_1 doi: 10.1007/0-387-24149-3_1
![]() |
[9] |
H. Konno, A. Wijayanayake, Portfolio optimization problem under concave transaction costs and minimal transaction unit constraints, Math. Program., 89 (2001), 233–250. https://doi.org/10.1007/PL00011397 doi: 10.1007/PL00011397
![]() |
[10] |
Y. Chen, S. Mabu, K. Hirasawa, A model of portfolio optimization using time adapting genetic network programming, Comput. Oper. Res., 37 (2010), 1697–1707. https://doi.org/10.1016/j.cor.2009.12.003 doi: 10.1016/j.cor.2009.12.003
![]() |
[11] |
G. Ban, N. E. Karoui, A. E. B. Lim, Machine learning and portfolio optimization, Manage. Sci., 64 (2018), 1136–1154. https://doi.org/10.1287/mnsc.2016.2644 doi: 10.1287/mnsc.2016.2644
![]() |
[12] |
Y. Peng, Y. Liu, R. Zhang, Stock price forecasting modeling and analysis based on lstm, Comput. Eng. Appl., 55 (2019), 209–212. https://doi.org/10.3778/j.issn.1002-8331.1811-0239 doi: 10.3778/j.issn.1002-8331.1811-0239
![]() |
[13] |
W. Tong, Establishment and solution of linear programming model for venture portfolio, Stat. Decis. Mak., 9 (2016), 89–91. https://doi.org/10.13546/j.cnki.tjyjc.2016.09.022 doi: 10.13546/j.cnki.tjyjc.2016.09.022
![]() |
[14] |
Y. Fang, Z. Lu, J. Ge, Stock price prediction of joint RMSE loss LSTM-CNN model, Comput. Eng. Appl., 58 (2022), 294-302. https://doi.org/10.3778/j.issn.1002-8331.2112-0006 doi: 10.3778/j.issn.1002-8331.2112-0006
![]() |
1. | Xueshen Chen, Peina Dang, Enzao Zhang, Yanxue Chen, Cunyao Tang, Long Qi, Accurate recognition of rice plants based on visual and tactile sensing, 2024, 104, 0022-5142, 4268, 10.1002/jsfa.13311 | |
2. | Yi-You Hou, Ming-Hung Lin, Majid Anjidani, Hassan Saberi Nik, Robust Optimal Control of Point-Feet Biped Robots Using a Reinforcement Learning Approach, 2024, 70, 0377-2063, 7831, 10.1080/03772063.2024.2362343 | |
3. | Jiaqi Liu, Hucheng Xu, Xiaoheng Deng, Hui Liu, Deng Li, Portfolio-Based User Recruitment Mechanism for Crowdsensing in Uncertain and Unpredictable Environments, 2024, 73, 0018-9545, 17630, 10.1109/TVT.2024.3429351 |
Symbols | Definitions |
Ci | Cash holdings in the portfolio of the ith day(Units: dollars) |
Gi | Gold holdings in the portfolio of the ith day(Units: troy ounces) |
Bi | Bitcoin holdings in the portfolio of the ith day(Units: Bitcoins) |
Mi | Trading value of gold of the ith day(Units: dollars) |
Ni | Trading value of Bitcoin of the ith day(Units: dollars) |
Pi | The price of gold of the ith day |
Qi | The price of Bitcoin of the ith day |
ˆPi | Gold forecast price of the ith day |
ˆQi | Bitcoin forecast price of the ith day |
ri | Gold investment risk rate of the ith day |
ti | Bitcoin investment risk rate of the ith day |
fi | Forecast return on investment of the ith day(Units: dollars) |
Fi | Actual return on investment of the ith day(Units: dollars) |
gi | The investment risk of the ith day(Units: dollars) |
hi | Investment planning objectives of the ith day(Units: dollars) |
w | The weight of risk versus benefit |
Data | Min | 1st Qu | Median | Mean | 3rd Qu | Max | num |
Gold | 1126 | 1266 | 1329 | 1464 | 1724 | 2067 | 1265 |
Bitcoin | 594.1 | 3995 | 7924.5 | 12206.1 | 11084.7 | 63554.4 | 1826 |
Number of disturbance | 1 | 2 | 3 | 4 | 5 |
The final asset | 48848.02 | 52989.34 | 55631.51 | 61486.30 | 61833.41 |
[C0G0B0] | Total Assets (in dollars) |
[2000 0 0] | 125515.19 |
[1000 0 0] | 62757.60 |
[500 0 0] | 31378.80 |
αgold | αBitcoin | Total assets (unit: dollars) |
1% | 2.5% | 19394.14 |
1% | 1.5% | 431513.84 |
1% | 2% | 62757.60 |
1.5% | 2% | 68254.46 |
0.5% | 2% | 80197.99 |
Symbols | Definitions |
Ci | Cash holdings in the portfolio of the ith day(Units: dollars) |
Gi | Gold holdings in the portfolio of the ith day(Units: troy ounces) |
Bi | Bitcoin holdings in the portfolio of the ith day(Units: Bitcoins) |
Mi | Trading value of gold of the ith day(Units: dollars) |
Ni | Trading value of Bitcoin of the ith day(Units: dollars) |
Pi | The price of gold of the ith day |
Qi | The price of Bitcoin of the ith day |
ˆPi | Gold forecast price of the ith day |
ˆQi | Bitcoin forecast price of the ith day |
ri | Gold investment risk rate of the ith day |
ti | Bitcoin investment risk rate of the ith day |
fi | Forecast return on investment of the ith day(Units: dollars) |
Fi | Actual return on investment of the ith day(Units: dollars) |
gi | The investment risk of the ith day(Units: dollars) |
hi | Investment planning objectives of the ith day(Units: dollars) |
w | The weight of risk versus benefit |
Data | Min | 1st Qu | Median | Mean | 3rd Qu | Max | num |
Gold | 1126 | 1266 | 1329 | 1464 | 1724 | 2067 | 1265 |
Bitcoin | 594.1 | 3995 | 7924.5 | 12206.1 | 11084.7 | 63554.4 | 1826 |
Number of disturbance | 1 | 2 | 3 | 4 | 5 |
The final asset | 48848.02 | 52989.34 | 55631.51 | 61486.30 | 61833.41 |
[C0G0B0] | Total Assets (in dollars) |
[2000 0 0] | 125515.19 |
[1000 0 0] | 62757.60 |
[500 0 0] | 31378.80 |
αgold | αBitcoin | Total assets (unit: dollars) |
1% | 2.5% | 19394.14 |
1% | 1.5% | 431513.84 |
1% | 2% | 62757.60 |
1.5% | 2% | 68254.46 |
0.5% | 2% | 80197.99 |