Dio .Ne T: Trading Strategy Model Based On Dynamic Programming
Dio .Ne T: Trading Strategy Model Based On Dynamic Programming
MCM/ICM
C Summary Sheet
2203120
It is of great significance for traders to buy and sell volatile assets reasonably in market
transactions. Traders choose different trading strategies and get different benefits. This paper
studies the best trading strategies for different traders based on the daily prices of gold and bitcoin
国
in the past.
For problem 1, the original data is preprocessed firstly, including filling the missing value by
the daily price of gold in the past, and standardize all the original data. Following the processed
中
data, the ARIMA model is used to establish the price prediction model. Correlation coefficeents
between the prediction results and the price of gold and bitcoin are 0.8592 and 0.9304 respectively.
学
The effectiveness of our model is denoted. Thirdly, a dynamic programming model with largest
total assets and risk as the regular termis is established, with the constraints hit rate and transaction
volume limit. Lastly, the optimal daily trading strategy is solved with dynamic programming
数
t
method. Final profit is $ 132089.1078 on September 10, 2021.
ne
For problem 2, we prove our strategy is the best judged from the generalization ability,
robustness and benefit of the model. By adjusting the variable parameters in the model, the
io.
strategies suitable for three traders are formed, which are insurance type, common type and radical
type. The solution method of problem 1 is used to obtain the changes of each asset and the total
ad
earnings of the three trading strategies. Furthermore, the variable parameters in the model are
disturbed, and the total assets change within a certain range, indicating that the model has strong
anti-interference ability. Finally, the assets obtained by the three types of trading strategies are
m
$14312.6827, $50040.5474 and $132089.1078 respectively. It can be seen that our model yield
can resist inflation greatly.
w.
For problem 3, firstly, the sensitivity is defined as the change rate of transaction frequency.
By changing the transaction cost of gold and bitcoin, it is calculated that the sensitivity of gold
ww
transaction cost is 0.0422 and that of bitcoin transaction cost is 0.0658. It can be seen from
the comparison that the transaction strategy is more sensitive to the transaction cost of bitcoin.
Secondly, the impact of transaction cost on transaction frequency, asset return and asset risk are
analyzed. We find that when the transaction cost increases, the transaction frequency, asset return
and asset risk are decreases correspondingly.
For problem 4, we summarize the models and strategies established in the first three questions,
and introduce to traders in the form of memorandum how to simply use the trading strategy to trade
and the benefits brought by different trading strategies.
Keywords: quantitative investment; ARIMA model; dynamic programming
Contents
1 Introduction 2
1.1 Problem Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Restatement of the Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Problem Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
国
3 Problem 1: Prediction and Strategy in the Investment 4
3.1 Data Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2
中
Model Establishment of Problem 1 . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.1 Price Prediction Model . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.2 Trading Strategy Model . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
5
8
学
3.3 Model Solving: Finding Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4 Results and Model Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
数
t
3.4.1 Model Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
ne
3.4.2 Model Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
io.
4 Problem 2: Prove Optimization of the Strategy 12
4.1 Generalization Ability of the Model . . . . . . . . . . . . . . . . . . . . . . . . . 13
ad
6 Conclusion 18
6.1 Strengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.2 Possible Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7 Memorandum 19
Appendices 23
1 Introduction
1.1 Problem Background
Market traders buy and sell volatile assets frequently, with a goal to maximize their total return.
There is usually a commission for each purchase and sale. Two such assets are gold and bitcoin.The
price changes of bitcoin and gold from September 11, 2016 to September 10, 2021 are shown in
Figure 1. The source of gold daily prices is London Bullion Market Association and the source of
bitcoin daily prices is NASDAQ.
国
(a) Gold daily prices, U.S. dollars per troy ounce (b) Bitcoin daily prices, U.S. dollars per bitcoin
中
Figure 1: The prices of two assets
学
1.2 Restatement of the Problem
数
t
In this problem, we are asked by a trader to develop a model that uses only the past stream of
ne
daily prices to date to determine each day if the trader should buy, hold, or sell their assets in their
portfolio. We will start with $1000 on September 11, 2016 and use the five-year trading period,
io.
from September 11, 2016 to September 10, 2021. On each trading day, the trader will have a
portfolio consisting of cash, gold, and bitcoin [C, G, B] in U.S. dollars, troy ounces, and bitcoins,
respectively.We should only use these data to solve the following problems:
ad
• Develop a model that gives the best daily trading strategy based only on price data up to
m
that day. Use the model and strategy to predict the value of the initial $1000 investment on
September 10, 2021.
w.
• Determine how sensitive the strategy is to transaction costs and how transaction costs affect
the strategy and results.
• Communicate the strategy, model, and results to the trader in a memorandum of at most two
pages.
BP neural network, RNN, encoder-decoder model, etc. In view of the simplicity and efficiency of
ARIMA model, which only needs endogenous variables rather than other exogenous variables, we
choose to use ARIMA model.
Next, establish a trading strategy model according to the established indicators, give the
trading strategy and calculate the final income. Intuitively, the price fluctuation of bitcoin is much
greater than that of gold, so we guess the risk is greater than that of gold. Therefore, the risk
of investment can be described by the variance of price change. This is essentially a dynamic
programming problem. We can quantify the return and risk, take the maximum benefit as the
objective function, find the constraints and establish the model.
With regard to problem 2, The optimization of the model can be proved from three aspects:
generalization ability, robustness and profit. The generalization ability of the model is reflected
in that changing the parameters in the model can make the model formulate different kinds of
国
strategies. Therefore, we divide the strategies into insurance type, common type and radical type.
The robustness of the model means that small changes in parameters will not affect the overall
strategy, and the anti-interference of the model is strong. It also shows that compared with other
中
investments, our strategy has a better rate of return.
As for problem 3, It is known that the transaction cost is the Commission. Intuitively, the
学
increase of commission should appropriately reduce the transactions. The decrease of commission
can increase the number of transactions. The ultimate goal is to maximize the income. Based on
the transaction strategy model established by the first question, by changing the cost α in the model
数
t
and observing the corresponding changes of transaction frequency, asset return and asset risk, we
ne
can get the sensitivity of three types of strategies to transaction cost.
io.
ad
m
w.
ww
国
paid instead of being given separately.
• Since it is only US $1000, the minimum transaction unit of US dollar and bitcoin under
中
normal circumstances is not considered for the universality of the model.
2.2 Notations
学
In this work, we use the nomenclature in Table 1 in the model construction. Other none-
frequent-used symbols will be introduced once they are used.
数
t
ne Table 1: Notations
Symbols Descripition
io.
t1 = 3, t2 = 3 gold trading cycle (including holidays), bitcoin trading cycle
n number of cycles in five years
ad
• Missing value processing. Unlike bitcoin, which is traded daily, gold is traded only on
trading days, so the data is not continuous. For the convenience of subsequent modeling, the
missing value is filled with the mean value before and after the day.
国
3.2.1 Price Prediction Model
Improving forecasting especially time series forecasting accuracy is an important yet often
中
difficult task facing decision makers in many areas. Autoregressive integrated moving average
(ARIMA) models are one of the most popular linear models in time series forecasting, which have
been widely applied in order to construct more accurate hybrid models during the past decade [2].
学
ARIMA model combines three basic methods:
数
t
• Autoregressive(AR). Describe the relationship between the current value and the historical
ne
value, and use the historical time data of the variable to predict itself. The order of AR model
is recorded as p value.The formula is as follows:
io.
yt = α0 + α1 yt−1 + α2 yt−2 + · · · + αp yt−p + ϵt (1)
ad
• Integrated(I). When the time series becomes stationary, the difference needs to be made,
m
and the order of the difference is recorded as d value. Generally, first order is enough.
w.
• Moving average(MA). Moving average model focuses on the accumulation of error terms
in autoregressive model. The order of MA model is recorded as q value.The formula is as
ww
follows:
yt = c + ϵt + θ1 ϵt−1 + θ2 ϵt−2 + · · · + θq ϵt−q (2)
where, c represents the constant term, ϵt is the white noise process of variance, and θ is the
coefficient.
The model is called ARIMA (p, d, q), as shown in the figure3, where p is the autoregressive
term, q is the moving average term, and D is the number of differences. We will follow the steps
listed below to build and solve our model.
Team # 2203120 Page 6 of 23
step1 Stabilization
To use ARIMA model, the time series must be stationary. We use the Augmented Dickey-
国
fuller unit root test to test the stationarity. If the P value obtained from ADF test is less than
0.05, it is a stable time series. If it is unstable, we convert the non-stationary process into a
中
stationary process by difference method. It can be seen from the table 2 that the time series
becomes stable after the first-order difference.
学
Table 2: P value of gold and bitcoin time series before and after difference
P value before difference P value after difference
数
t
gold
bitcoin
ne 0.6734
0.9921
0.0043
0.0000
io.
step2 Selection of p and q
ad
NOTE: Truncation means falling within the confidence interval (95% of the points comply with
the rule)
Figure 4 (a) shows the truncation of gold data using level 2 ACF and level 1 PACF, and
Figure 4 (b) shows the truncation of bitcoin data using level 2 ACF and level 2 PACF. From
this, we can determine the p value and q value respectively.
Team # 2203120 Page 7 of 23
(a) ACF chart and PACF chart of gold (b) ACF chart and PACF chart of bitcoin
国
step3 White noise test
中
If the white noise is obtained, it means that the useful information in the time series has been
extracted, and the rest are all random disturbances, which cannot be predicted and used.[9]
学
If the residual sequence passes the white noise test, the modeling can be terminated, because
there is no information to continue to extract.
The ARIMA model of gold is ARIMA(2,1,1) and bitcoin is ARIMA(2,1,2). The p value
数
t
of the white noise test output of this model is very close to 0, indicating that it follows the
ne
normal distribution with the mean value of 0, that is, it is a white noise.
step4 Prediction
io.
In order to predict the future market timely and accurately, we use the data of 30 consecutive
days as the training set and the data of the next 3 days as the test set. The moving step of
ad
the training set is 3. The prediction results of one cycle are shown in the figure 5. The
correlation coefficient R2 of gold is 0.8592 and that of bitcoin is 0.9304. The prediction
m
(a) Forecast chart of gold in one cycle (b) Forecast chart of bitcoin in one cycle
国
q cash retention ratio
中
Decision coefficient(R2 ): it is used to evaluate the volatility predicted by the model. The closer
学
the index value is to 1, the higher the fitting performance of the model.
Pt 2
x i,j − Y (i)
数
j=1
Ri2 = Pt 2 (3)
t
ne j=1 y i,j − Y(i)
where xi,j represents the predicted value of day j in cycle i and yi,j represents the actual value of
io.
day j in cycle iand Y(i) represents the mean of the true value in cycle i.
Hit rate(DS): it is used to evaluate the accuracy of the model in predicting the rise and fall, so
ad
where di represents the predicted rise and fall in cycle i. If the rise and fall of the real value is the
same as that of the predicted value, it is 1, on the contrary, it is 0.
ww
• The period from September 11, 2016 to November 11, 2016 is the zero cycle, and no
transaction is conducted as the experience accumulation period. Since November 12, 2016
is the first cycle, the number of cycles is n = 588.
• If the transaction starts from the second cycle, the asset situation in the first week is the same
as that in the zero cycle.
• Since gold is not traded during holidays, when the predicted value of gold price in a certain
period is empty, it means that gold is not traded in that period.
Team # 2203120 Page 9 of 23
• The Commission is deducted from the amount paid instead of being given separately.
We use i to record the cycle, in which cycle 0 is the experience accumulation period, which
only predicts and does not trade. 3 days is a cycle. We use j to record the day. The total number of
cycles is 588. Pay attention to the difference between trading days of gold and bitcoin.
To build a strategy model, we need to find the objective function and constraints. To make more
profits, we need to make the risk as small as possible and the profit as much as possible. Firstly,
we quantify the risk and set the standard deviation of assets owned in the transaction process as the
risk index S: v
u ∑i−1 2
u Pi−1
u j=i−30 Ai − j=i−30 Ai
t 30
Sj = (5)
30
国
Calculate the amount of cash:
(
Ci−1 − Gi × wg , Xg(i) − Yg(i−1) > βg × Ai−1
Ci =
(
中
Ci−1 + Gi × mg × (1 − αg ) × Yg(i+1) , Yg(i−1) − Xg(i) > γg × Ai−1
(6)
学
Ci−1 − Bi × wb , Xb(i) − Yb(i−1) > βb × Ai−1
Ci =
Ci−1 + Bi × mb × (1 − αb ) × Yb(i+1) , Yb(i−1) − Xb(i−1) > γb × Ai−1
数
t
ne
Calculate the amount of gold and bitcoin:
(
Gi−1 + Ci × wg × (1 − αg )
io.
Gi = (7)
Gi−1 − Gi−1 × mg
(
ad
Gi−1 + Bi × wb × (1 − αb )
Bi =
Gi−1 − Gi−1 × mb
m
Finally, the objective function and constraints are determined, and the trading strategy model
is obtained:
max Aj − λ × Sj (9)
wj ,mj
Cj , G j , B j , A j ⩾ 0
DSj ⩾ 0.5
s.t. Cj ⩾ Aj × q
αg = 1%, αb = 2%
A = 1000, C = C = 1000, G = G = B = B = 0
0 0 1 0 1 0 1
Team # 2203120 Page 10 of 23
where, Wj represents the roportion of gold and bitcoin bought on day j, mj represents the roportion
of gold and bitcoin sought on day j, Aj represents the total assets on day j, λ represents the
coefficient of regular term, which is used to control risk and return, Sj represents the current day
risk. The first constraint indicates that all assets are positive, the second constraint indicates that the
accuracy of the model is greater than 0.5, the third constraint indicates that the remaining capital
of the transaction is greater than q times of the total assets, and α indicates the transaction cost,
A0 , C0 , G0 , B0 represents the total assets, cash, gold and bitcoin before the first day of trading,
C1 , G1 , B1 represents the amount of cash, gold and bitcoin before trading on day 2.
国
step1 Data initialization. Set i = 1, know αg = 1%, set parameter βg , γg , ds, R2 , wHg , wLg , mg , q,
initial asset distributionR1 = R0 = [1000 0 0], total assets r1 = r0 = 1000.
中
step2 Calculate hit rate (DS). The prediction model hit rate(Formula 4) can evaluate the accuracy
of the trained model in predicting the rise and fall. When the accuracy is high enough, you
can continue to follow the next steps.
学
step3 Determine whether to trade. Firstly, due to the cost in the transaction, in order to avoid
excessive cost caused by frequent transaction, the transaction is carried out only when the
数
t
increase and decrease reach a certain threshold. Secondly, in order to avoid too little cash left
ne
in the transaction, the transaction can be carried out only when the cash meets the reserved
amount. The specific process is shown in the figure 6.
io.
ad
m
w.
ww
where,
eg(i+1) = βg × Ai (10)
fg(i+1) = γg × Ai (11)
Ci
qi = (12)
Ci + Gi × Yg(i) + Bi × Yb(i)
in the formula, βg , γg represents the proportion of increase or decrease.
Team # 2203120 Page 11 of 23
2
step4 Determine the number of transactions. Prediction model discrimination coefficient Rgi
can evaluate the volatility predicted by the trained model. The smaller the variable, the more
stable the model is, and the proportion of buying gold during trading can be increased. The
specific process is shown in the figure 7.
国
中
Figure 7: The process of determining the number of transactions
学
Where, the formula for total assets is
t
distribution is
ne
When proportions WHg , WLg and mg are used respectively, the formula for calculating asset
Ci+1 = Ci − Ci × wLg
io.
C ×w ×(1−αg )
RWHg = Gi+1 = Gi + i YLg (14)
g(i+1)
Bi+1 = Bi
ad
Ci+1 = Ci − Ci × wHg
C ×w ×(1−αg )
RWLg = Gi+1 = Gi + i YHg
m
(15)
g(i+1)
Bi+1 = Bi
w.
Ci+1 = Ci − Ci × wLg
C ×w ×(1−αg )
Rmg = Gi+1 = Gi + i YLg (16)
ww
g(i+1)
Bi+1 = Bi
In the formula, Yg(i+1) represents the real average price of gold on (i+1) day.
[C,G,B]=[22.31, 0.16, 2.84]. The changes of assets during the five-year period are shown in the
figure below.
国
中
Figure 8: The changes of total assets during the five-year period
学
3.4.2 Model Evaluation
This result is obtained using two models. Firstly, ARIMA model is used for prediction, and
数
we get good results: The correlation coefficient R2 of gold is 0.8592 and that of bitcoin is 0.9304.
t
ne
They are close to 1, indicating that the predicted value is highly correlated with the real value.
Through the trading strategy model, we get specific benefits. The strategy model has high
availability:
io.
• The model is only based on the price changes of gold and bitcoin in recent five years, so the
ad
• The parameters in the model have a large variable range and are more flexible.
generalization ability, robustness and profit margin of the model to prove the optimization of
the strategy.
• Insurance-type. The purpose of such traders’ investment behavior is mainly to obtain long-
term capital income, that is, they hope to obtain investment income regularly, and also hope
to obtain differential profits through the change of capital price in a longer term. At the
same time, before investing, traders should generally master sufficient information and make
a rational analysis of the expected profits and risks of the target assets.
国
• Common-type. The purpose of such traders is mainly to obtain large profits in a short
period of time and are willing to bear some risks. Its way mainly depends on the short-term
中
price fluctuation difference to obtain profits. They take technical analysis as the main means
and make speculative decisions based on historical price fluctuation experience. Generally
speaking, the probability of success of Common-type investors is not low, but the probability
学
of failure is also high. Its behavior has strong subjective initiative, and the probability of
success depends on its accuracy in predicting market fluctuations.
数
t
ne
• Radical-type. The characteristics of radical traders’ behavior are based on luck and oppor-
tunity, trading in the market with luck and hoping to make huge profits in the short term.
Generally speaking, the risk is very high. Unless they need money urgently, have the psy-
io.
chology of gamblers or have the ability to take risks, most people will not use this investment
method.
ad
In the model, for three types of traders, the corresponding parameters are adjusted as shown in the
table 5:
m
βb 0.35 0.10 0
βg 0.50 0.50 0.50
γg 0.10 0.20 0.30
γb 0.10 0.20 0.30
wHg 0.95 0.80 0.80
wHb 0.15 0.30 0.40
q 0.15 0.05 0.01
Solve the model according to different parameters adjustments and get the changes of various
Team # 2203120 Page 14 of 23
types of traders’ assets. The figure 9 shows the changes of various assets of insurance-type traders
in five years. See the Appendix A for the figures of the other two types.
国
The changes of total assets of three types of traders are shown in the figure 10:
中
学
数
t
ne
(a) Insurance-type (b) Common-type (c) Radical-type
io.
Figure 10: Changes in total assets of three types of traderss
ad
m
N umber of transactions 85 58 9
SD 3861.73 15501.99 40067.35
Rg2 0.94 0.27 0.24
Rb2 0.41 0.98 0.99
NOTE: Rg2 /Rb2 represent correlation between gold/bitcoin purchase and actual fluctuation, SD
represent standard deviation of 5-year assets.
Reading the data in the table 8, although radical investors have more returns, the value of SD
is very large, that is, assets change greatly, so they have to bear corresponding risks. It can be
Team # 2203120 Page 15 of 23
seen from the number of transactions that any disturbance in the market may disturb insurance
investors. From R2 , we can find that the more traders tend to venture capital, the more they will
buy bitcoin; Gold symbolizes stable and conservative investment. Thus, our model gives a variety
of practical and feasible strategies.
国
中
学
数
t
(a) gold (b) bitcoin
ne
Figure 11: The impact of wL on total assets
io.
ad
m
w.
ww
国
As can be seen from the figure above, if these variables are disturbed, the final income of the
model is stable within a certain range. In fact, if the other parameters β, γ, q are disturbed, the
中
final return and investment risk of the model are stable within a certain range. The model has good
robustness, so it is proved that the strategy we give is the best.
学
4.3 Yield of the Strategy
In the real economic market, because the issue of paper money sometimes exceeds the actual
数
amount needed in circulation, there is often inflationso we need to manage money.Under different
t
ne
levels of inflation, the portfolio is diverse.In reality, money, stocks and bonds are generally used as
investment representatives.The portfolio in this question only includes gold ,bitcoin and cash.
Set the bank deposit interest rate as r, inflation rate as I,deposit amount as a, Then the actual
io.
value of the deposit after five years is
ad
5
A = a(1+r−I) (17)
m
Where A represents the actual value of the money after five years of deposit in the bank.
It can be seen from the data, from 2016 to 2021,the inflation rate was 7%, the bank deposit
w.
interest rate was 0.5%, so the actual value of $1000 after five years is $139.2436.In contrast, with
our portfolio, our total assets are $14312.6827, $50040.5474 and $132089.1078 respectively when
we choose insurance, common and radical investments. The results obtained by our model are
ww
several times higher than the more conservative financial behavior, so our model has higher income
and can resist inflation.
国
We mainly explore through transaction frequency, asset return and asset risk, in which asset
risk is characterized by the variance of return. Specifically, it is investigated through the changes
of the following four costs.
中
a. αg fell 0.1% each time and αb remained unchanged.
学
b. αg remained unchanged and αb fell 0.2% each time.
数
t
ne
d. αg remained unchanged and αb rise 2% each time.
io.
Figure 14 shows the change of strategy in case a. It can be seen from the figure that a small
change in the cost of gold will not have an impact on traders’ decisions.
ad
m
w.
ww
(a) Changes of transaction frequency (b) Changes of return (c) Changes of risk
Figure 14: Change of strategy in case a
The result of case c is shown in the figure 15. In this case, we increase the transaction cost of
gold by 0.1% each time. After reading the picture, it is found that:
1. If the cost increases to a certain extent, it will reduce the number of transactions and the total
income.
Team # 2203120 Page 18 of 23
2. The cost increases, the transactions become less, and the possible risks are reduced.
It can be seen that in the face of the continuous rise in the cost of gold, our model has not
ignored, keenly felt this signal, and the change direction is in line with the reality. The strategy is
relatively sensitive to transaction costs.
国
(a) Changes of transaction frequency (b) Changes of return (c) Changes of risk
中
Figure 15: Change of strategy in case c
学
Table 7 lists the sensitivity of the strategies of the three transaction types to the cost of gold and
bitcoin respectively.
数
t
ne
Table 7: The sensitivity of three types of strategies to two costs
Insurance-type Common-type Radical-type
io.
αg 0.0267 0.0422 0
αb 0.2308 0.0658 0.0123
ad
m
• The sensitivity of trading strategy to the cost of bitcoin is higher than that to the cost of gold.
ww
• The insurance-type strategy is more sensitive to the cost of bitcoin, and the common-type
strategy is more sensitive to the cost of gold.
6 Conclusion
6.1 Strengths
• Our model puts forward variable parameters to form a parameter list. By changing the
parameters in the list, we can achieve different income results. In the future, we can form
Team # 2203120 Page 19 of 23
• The parameters in the model have a large variable range and are more flexible.
• The model is only based on the price changes of gold and bitcoin in recent five years, so the
model has low requirements for data.
国
• Due to the lack of financial knowledge, the establishment of the model is not necessarily
perfect.
7 Memorandum 中
学
Memorandum
数
t
To: traders
With the development of economy and the popularization of financial management concept,
more and more people have joined the ranks of investment. In addition to the traditional treasury
bonds, funds, stocks, gold and so on, virtual currency has increasingly appeared in people’s vision,
ww
setting off a "currency speculation fever". Investment involves both returns and risks. In order to
explore the best trading strategy, our team has established a trading strategy model based on the
price trend of gold and bitcoin in the past five years to help you better invest.
STRATEGY
The strategy we designed mainly focuses on three questions: when to trade, what kind of assets
to trade and how much to trade.
Team # 2203120 Page 20 of 23
• When to trade. We measured the hit rate of the current model, the rise and fall of gold
and bitcoin, and the proportion of cash after trading. Only when the three indicators meet
the trading conditions at the same time can the transaction be carried out, and it is decided
whether to buy or sell. On the contrary, if the trading conditions are not met, wait until the
next cycle for judgment
国
• Deal what. By setting the threshold of increase and decrease, compare the rise and fall range
中
of gold and bitcoin, measure the risk and return of trading bitcoin and gold, and decide to
trade gold or bitcoin.
学
• How much is the deal. If we decide to buy, we will use the decision coefficient of the current
model to decide how much to buy. When the judgment coefficient is small, it means that the
model we currently use is relatively stable and the risk is small. Therefore, when purchasing,
数
we can appropriately increase the purchase proportion, on the contrary, reduce the purchase
t
ne
proportion; If we decide to sell, we will sell according to the preset proportion.
io.
For the above strategies, by changing the variable parameters in the strategy, three strategies
can be formed: insurance type, common type and radical type, which are suitable for different
traders and have good generalization ability. Secondly, when the variable parameters in the strategy
ad
are disturbed, the results show that the total assets change within a certain range, indicating that
the anti-interference ability of the model is strong. Finally, by comparing the benefits of $1000
m
deposited in the bank for five years and the five-year trading of this strategy, it can be seen that our
strategy can resist inflation to a certain extent.
w.
MODEL
ww
The strategy is based on the prediction of the future. In view of the simplicity and efficiency of
ARIMA model, which only needs endogenous variables rather than other exogenous variables, we
choose ARIMA model as the price prediction model. In order to predict the future market timely
and accurately, we use the data of 30 consecutive days as the training set and the data of the next
3 days as the test set. The correlation coefficient R2 between gold’s prediction result and the real
value is 0.8591, and bitcoin’s R2 is 0.9304, which are close to 1, indicating that the correlation
between the predicted value and the real value is strong and the prediction accuracy is high. Such
prediction lays a solid foundation for follow-up work.
Team # 2203120 Page 21 of 23
where, Wj represents the roportion of gold and bitcoin bought on day j, mj represents the roportion
of gold and bitcoin sought on day j, Aj represents the total assets on day j, λ represents the coefficient
of regular term, which is used to control risk and return, Si represents the current day risk.
By changing the coefficient of the regular term λ, the risk can be adjusted and divided into three
investment strategies: steady investment, common investment and radical investment.
RESULTS
国
Through the training of parameters, we have obtained models for three different populations.
The best returns and some transaction information of the three models are shown in the table below:
中
Table 8: Results of three types of strategies
学
Insurance-type Common-type Radical-type
T otal assets 14312.68 50040.55 132089.11
数
[C, G, B] [11474.39, 1.59, 1.07] [421.14, 0.61, 1.05] [22.31, 0.16, 2.84]
t
N umber of transactions
SD
ne 85
3861.73
58
15501.99
9
40067.35
io.
ad
• Insurance investment tends to trade many times and is vulnerable to market influence. Ag-
w.
References
[1] Conlon. T and McGee. R. Safe haven or risky hazard? Bitcoin during the Covid-19 bear
market. FINANCE RESEARCH LETTERS, 35, 2020.
[2] Khashei. M and Bijari. M. A novel hybridization of artificial neural networks and ARIMA
models for time series forecasting. APPLIED SOFT COMPUTING, 11(2):2664-2675, 2011.
[3] Aasim, Singh. SN and Mohapatra. A. Repeated wavelet transform based ARIMA model for
very short-term wind speed forecasting. RENEWABLE ENERGY, 136:758-768, 2019.
[4] Valipour. M, Banihabib. ME and Behbahani. SMR. Comparison of the ARMA, ARIMA, and
the autoregressive artificial neural network models in forecasting the monthly inflow of Dez
dam reservoir. JOURNAL OF HYDROLOGY, 476:433-441, 2013.
国
[5] Mahjoub. C, Bellanger. JJ, Kachouri. A and Jeannes. RL. On the performance of temporal
Granger causality measurements on time series: a comparative study. SIGNAL IMAGE AND
VIDEO PROCESSING, 14(5):955-963, 2020.
中
[6] Chen. JS, Hou. JL, Wu. SM and Chang-Chien. YW. Constructing investment strategy
portfolios by combination genetic algorithms. EXPERT SYSTEMS WITH APPLICATIONS,
学
36(2):3824-3828, 2009.
[7] Wang. S, Wang. XG, Meng. FL, Yang. RJ, Zhao. YJ. Investor behaviour monitoring based on
数
t
deep learning. BEHAVIOUR & INFORMATION TECHNOLOGY, 40 (9):XLII-LIII, 2021.
ne
[8] Michael. SC. Can information technology enable profitable diversification? An empiri-
cal examination. JOURNAL OF ENGINEERING AND TECHNOLOGY MANAGEMENT,
io.
24(3):167-185, 2007.
ad
[9] Mitic. P. Is a Reputation Time Series White Noise? INTELLIGENT DATA ENGINEERING
AND AUTOMATED LEARNING - IDEAL 2017, 10585:543-550, 2017.
m
[10] Daigle. CL and Ridge. EE, Investing in stockpeople is an investment in animal welfare and
agricultural sustainability. ANIMAL FRONTIERS, 8(3):53-59, 2018.
w.
[11] Mariana. CD, Ekaputra. IA and Husodo. ZA. Are Bitcoin and Ethereum safe-havens for stocks
during the COVID-19 pandemic? FINANCE RESEARCH LETTERS, 38, 2021.
ww
[12] Conlon. T, Corbet. S and Mcgee. RJ. Are cryptocurrencies a safe haven for equity markets? An
international perspective from the COVID-19 pandemic. RESEARCH IN INTERNATIONAL
BUSINESS AND FINANCE, 54, 2020.
Team # 2203120 Page 23 of 23
Appendices
Appendix A Changes of Various Types of Traders’ Assetes
国
(a) Changes of cash (b) Changes of gold (c) Changes of bitcoin
Figure 17: Changes of various assets of common-type traders
中
学
数
t
ne
io.
(a) Changes of cash (b) Changes of gold (c) Changes of bitcoin
Figure 18: Changes of various assets of radical-type traders
ad
m
w.
ww