Gold-Bitcoin Trading Strategy Based On Time Series
Gold-Bitcoin Trading Strategy Based On Time Series
Volume 68 (2023)
1. Introduction
With the prevalence of globalization in the world economy, various economic problems in market
trading have become a stumbling block to the economic development of the world today. In the
process of market trading, stocks are commonly sought after by market traders. As a kind of securities,
stocks can be transferred, bought and sold, and are a long-term credit instrument in the trade market.
The goal of the market trader is to maximize profits through various means, the most common of
which are buying and selling, where there are commission returns and losses. Gold and Bitcoin are
two such assets [1].
We were given data on the price of gold and bitcoin (USD) from November 9, 2016, to October 9,
2021. On each trading day, a trader will have a portfolio consisting of cash, gold, and bitcoin [C, G,
B] in USD, troy ounces, and bitcoin, respectively. The initial state is [1000, 0, 0]. The commission
for each transaction (purchase or sale) is α% of the transaction amount. Assume = 1% and = 2%.
There is no cost to hold the asset. Notice that Bitcoin can be traded daily, while gold can only be
traded on open days (Monday through Friday). In this paper, we will develop a mathematical model
that uses only past daily prices to determine whether a trader should buy or sell an asset in his or her
portfolio. The best trading strategy for each day will then be given based on the price data up to that
day [2].
73
Highlights in Science, Engineering and Technology ISET 2023
Volume 68 (2023)
Pt (t = 1, 2,3..., n) (1)
based on the data from day 1 today n :
Pt (t = n + 1, n + 2, n + 3) (2)
(3) Convert time and date of gold value data and bitcoin value data into time series values using
the Date Conversion Function (The principle of the function is shown in Figure 1);
74
Highlights in Science, Engineering and Technology ISET 2023
Volume 68 (2023)
d Pt (t = 1, 2,3..., n) (7)
2) After performing the difference once, we conclude that this time series has been smoothed by
performing the ADF Test and the KPSS Test again. Then the number of differences is derived:
d =1 (8)
(5) To carry out the fixed order of the model: we use PACF (partial auto-correlation function) for
auto-regression on the time series after being performed the difference (linear regression). The
regression equation is:
1 Pt = c + 1 1 Pt −1 + 2 1 Pt − 2 + ... + p 1 Pt − p + t (9)
(7) The auto-regressive moving average model is obtained. The formula is:
1 Pt = c + 1 1 Pt −1 + 2 1 Pt − 2 + ... + p 1 Pt − p + t + 1 t −1 + 2 t − 2 + ... + q t −q (11)
Fig. 2 The Given Image of Gold Fig. 3 The Predicted Image of Gold
75
Highlights in Science, Engineering and Technology ISET 2023
Volume 68 (2023)
Fig. 4 The Given Image of Bitcoin Fig. 5 The Predicted Image of Bitcoin
1
That is, spend of the cash c to buy bitcoin on the first day.
2
The cost of buying bitcoins is.
1
cb1 = c (14)
2
The remaining cash is
c1 = 1000 − cb1 − %1 cb1 (15)
The number of bitcoins owned is
cb1
ib1 = (16)
Pb1
(2) After 25 days, at day n (n = 25, 26, 27,...1826) , based on the price data of bitcoin and gold at
day n+1, n+2, n+3 predicted by the ARIMA Model, we find the approximate slope of the increase of
bitcoin at day n for the next three days and the approximate slope of the increase of gold at day n for
the next three days according to the equation:
76
Highlights in Science, Engineering and Technology ISET 2023
Volume 68 (2023)
77
Highlights in Science, Engineering and Technology ISET 2023
Volume 68 (2023)
5. Summary
In this paper, on the one hand, an ARIMA-based daily price prediction model is developed, which
is very simple and requires only endogenous variables without resorting to other exogenous variables;
and it is more accurate in its prediction of data. However, it requires time data to be static or stable
after differencing; it can only capture linear relationships by itself but not nonlinear relationships; and
it requires a large amount of data to provide a forecasting basis for the model.
On the other hand, this paper establishes a trade strategy model based on price increase, which can
improve the accuracy of prediction based on the future slope; and it can reduce the risk value of the
decision based on the accuracy of the prediction of the previous data, making the decision more secure.
However, it relies too much on past data and requires a large amount of data to provide the model
with a basis for prediction. In this paper, it is used as a decision-making model, which is more
subjective, and the standard setting is not reasonable enough.
References
[1] Li, Zhan & Huang, Yuanda. Stock Trading Price Prediction Model Study [N]. Shanghai Jiao Tong
University Newspaper, 1992-6-26 (6).
[2] Li, Hongjie. Bitcoin - A New Kind of Gold in the Digital Age [J]. China Business Review,2018(2):33-34.
[3] Ding,Wenjuan. Comparison of ARIMA Model and LSTM Model Based on Stock Forecast [J]. Industrial
Control Computers, 2021, 34(7): 109~116.
[4] Zhao, Kangyin & Xue, Yanan. Stock Forecast and Evaluation of TCL Group Based on ARIMA Model
[J]. Hot Insights, 2020: 144~145.
[5] Huang Li-Shan. Portfolio Research Based on ARIMA and Comprehensive Evaluation Methods--Taking
Gold and Bitcoin as an Example [J]. Modern Information Technology,2022,6(23):98-102.
78