0% found this document useful (0 votes)
135 views8 pages

Trading Strategy Model of Gold and Bitcoin Based o

This document discusses building trading strategy models for gold and bitcoin based on user investment income. It establishes a Long Short-Term Memory (LSTM) neural network model to predict gold and bitcoin prices and uses quantitative trading strategies combined with turtle strategy and price predictions to determine daily transaction types and quantities. The goal is to maximize total returns while accounting for transaction commissions.

Uploaded by

Kherrati
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views8 pages

Trading Strategy Model of Gold and Bitcoin Based o

This document discusses building trading strategy models for gold and bitcoin based on user investment income. It establishes a Long Short-Term Memory (LSTM) neural network model to predict gold and bitcoin prices and uses quantitative trading strategies combined with turtle strategy and price predictions to determine daily transaction types and quantities. The goal is to maximize total returns while accounting for transaction commissions.

Uploaded by

Kherrati
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

BCP Business & Management WTED 2022

Volume 33 (2022)

Trading strategy model of gold and bitcoin based on user


investment income
Chengen Wu1,#,*, Shengyue Wang2,#
1School of Optical-Electrical and Computer Engineering, University of Shanghai for Science and
Technology, Shanghai, China
2Business School, University of Shanghai for Science and Technology, Shanghai, China
#These authors contributed equally.
*Corresponding author: [email protected]
Abstract. Gold and bitcoin are the hottest investment products today. In this wave of investment, a
large number of investors swarmed in, trying to obtain huge profits. Therefore, it is very important to
establish mathematical models to help traders make decisions. In order to explore the best trading
strategy to maximize revenue, we need to solve prediction problems to help carry out quantitative
trading. Based on the time series given in the question, we use the LSTM long-term and short-term
memory neural network model to build the network layer, and set the training time to predict the gold
and bitcoin prices on the trading day. We use quantitative trading investment method, combined with
turtle strategy and prediction data to obtain the daily transaction types of gold and bitcoin, and then
combined with alpha hedging strategy and LB ladder rule to obtain the daily transaction quantity of
both, and then combined with the Commission of each transaction to obtain the daily total account
value model.
Keywords: LSTM Long Short-Term Memory neural network, quantitative trading.

1. Introduction
To maximize the total return on speculation, market traders often buy and sell assets with relatively
high price volatility, two of which are gold and bitcoin. Commissions accompany each purchase and
sale. While the epidemic and domestic economic policy changes have caused the normally stable
price of gold to fluctuate, bitcoin has maintained its long-standing price movement.
The whole market remains in distance volatility due to the global epidemic. Gold, as a safe-haven
asset, is driven by risk aversion on the one hand, but investors' demand for liquidity, on the other
hand, makes them sell gold sharply, so gold prices are likely to continue this oscillating state. In this
situation, more and more stockholders are choosing gold to improve their investment yields. Because
bit has stable bookkeeping properties with value preservation, it is also called digital gold. With many
companies fearing a declining dollar, bitcoin has become very popular, and many people are buying
bitcoin to preserve their assets. Ease of circulation and preservation of the value of bitcoin is the most
valuable aspect of bitcoin. Long Short-Term Memory Model. For these two popular investment
products, this paper establishes a prediction model to calculate the daily account value model, which
provides some support for relevant practitioners to calculate the return on investment.

2. The Establishment of Long Short Term Memory Model


After data pre-processing and making the model, we came up with prediction curves for bitcoin
and gold. During this process, we divided the data into predicted and tested values for prediction, and
then scored them with residual standard deviation (RMSE) and found that the predicted values were
significantly better than the tested values, so we predicted all the data for the predicted values and
came up with prediction curves. The implementation process is as figure1.

199
BCP Business & Management WTED 2022
Volume 33 (2022)

Figure1 Flow chart of the LSTM based prediction


After we made the LSTM model and check the structure, we built 943,000 network layers in total.
Setting the training time, we were able to train all epochs in a short time. Then we substituted the data
to get the prediction results. By recording some parameter changes during the training process, we
were able to see that our loss parameter dropped very quickly and finally converged to a small value,
indicating a good training effect, and the following figure shows the loss parameter. Loss parameter
drop image is shown as figure2.

Figure2 Loss parameter drop image


The figure3 shows the image of the resulting prediction data. The first 80% of the data for each
investment commodity is the predicted value prediction data, and the last 20% is the test value
prediction data. Then, we apply the root mean square error (RSME) scoring method to further verify
the stability of the predicted value prediction data, after calculation, the pre score:343.36 while the
test score:2587.80. The pre score is lower than the test, so we can adjust the prediction ratio to 100%
to get the forecast results for gold and bitcoin, which follows the figure4 shows[1].

200
BCP Business & Management WTED 2022
Volume 33 (2022)

Figure3 Prediction comparison chart with predicted and tested values

Figure4 Gold and Bitcoin Forecast Results

3. LSTM Forecasting-Highest Return model


3.1 The Establishment of LSTM Forecasting-Highest Return model
Quantitative trading[2] is a computer-aided tool that uses a programming development language
to write programs that analyze, judge, and help provide decisions with a fixed logic. Complete
quantitative trading should include the input of data, processing of trading strategies, backtesting, and
analysis of data, display of return results, giving trading judgments, and finally automated or manual
way to complete the trading. The selection of data has a significant impact on the quantitative trading
strategy. Currently, there are a large number of stocks in the stock market, and it is especially
important to select which stock and which period of stock data to use, so the back-testing analysis of
the data and thus the optimization of the trading strategy is an important aspect.The following figure5
shows the development process of the quantitative trading system.

201
BCP Business & Management WTED 2022
Volume 33 (2022)

Figure5 Quantitative trading system development process


3.2 Turtle-Alpha Quantitative Trading
Turtle trading[3] is a complete, mechanical trading idea that can systematically complete the entire
trading process. It includes a series of trading strategies such as what to buy and sell, position size,
when to buy and sell, when to exit, etc. It is a trend trading strategy.
The turtle trading method divides the position opening capital into several small parts according to a certain ratio. Each
position opening position and position addition size are related to the volatility amount ATR, which is the average
amplitude of the maximum intra-day index fluctuation, determined by the highest and lowest prices of the day and the
closing price of the previous trading day.For this question, quantitative trading can be divided into two parts. The first
part is to determine whether a trade is necessary, and the second part is to determine the amount of the trading.
3.2.1Sea turtle trading
For turtle trading, it is a complete, mechanical trading idea that can systematically complete the
entire trading process. It includes a series of trading strategies such as what to buy and sell, position
size, when to buy and sell, when to exit, etc. It is a trend trading strategy.
The turtle trading method divides the position opening capital into smaller parts according to a
certain percentage. Each position opening position and position addition size is related to the volatility
volume ATR, which is the average amplitude of the maximum intra-day index fluctuation, determined
by the highest and lowest prices of the day and the closing price of the previous trading day.
(1)
(2)
PDC is the previous day's closing price, H is the day's highest price, and L is the day's minimum
price. PDN is the previous day's n value, and ATR is the average value of TR over n days.
Using the n value to reflect the value fluctuation[4]amount DV:
(3)
C is the value per point of the contract, where the amount of value represented by each point is the
price represented by each index point.
Number of contracts per open trade UNIT is determined by dividing 1% of total assets by DV. A
is total account assets
(4)

3.2.2The improvements
In order to avoid that the revenue from the transaction is less than the commission charged, we
intend to set PAK (Predicted and Known).

202
BCP Business & Management WTED 2022
Volume 33 (2022)

(5)
Where PP is the price of the day predicted earlier and PDC[5]is the actual price of the previous
day. ATR is the ATR for Turtle Trading.
For the 'buy low, sell high' idea, according to the principle of price and actual distribution, the use
of PR (Price Real) to reflect the price of the day high or low
(6)
R is the actual price

(7)

Finally, we get BS(Buy Sell)


(8)
From this, a BS scatter plot can be obtained from the data. BS scatter plot of GOLD is shown as
figure6. BS scatter plot of BTC is shown as figure7.

Figure6 BS scatter plot of GOLD

Figure7 BS scatter plot of BTC


In both charts, the red part corresponds to a time when the price is 'cheap' and the green part
corresponds to a time when the price is 'expensive'. Because both charts have a midline, the midline
means that the current price of gold or bitcoin is the same as its real value, and when the BS is less
than 1[6] then its price is less than its real value, and their prices will eventually approach or even
exceed the midline. Therefore it is best to buy when the BS is less than 1.

203
BCP Business & Management WTED 2022
Volume 33 (2022)

3.3 Alpha Hedging


For Alpha strategies, starting with the CAPM model, assuming that the market is equilibrium, the
expected excess return of the asset is then determined by the market return excess return and risk
exposure. This is shown in the following equation[7].
(9)
where is the market portfolio and is the risk-free rate of return.
According to the CAPM model, the expected return of the portfolio consists of two parts, one is
the risk-free rate of return and the other is the risky rate of return.
However, the CAPM model represents the market in equilibrium, but the market is not always in
equilibrium, and individual stocks will always earn returns that exceed the level of the market
benchmark, i.e., there is always an term at the right end of the CAPM model.
To solve this problem, in 1968, the American economist Michael Jensen proposed the Jensen index
to describe this , so also known as index. The calculation is shown as follows:
(10)
Therefore, the return of the portfolio can be rewritten as follows
(11)
The return of the portfolio can be split into return and return. The formula for calculating
is as follows
(12)
is determined by the market, is systematic risk, and is not related to the investor's management
ability, but only to the portfolio's relationship to the market. When the market as a whole falls, the
return corresponding to also falls with it (assuming positive beta).
To further achieve quantitative precision in trading, we introduce the LB (Labber Rule) ladder
rule[8].
Buy one unit (e.g. 1% of the position) if the current price is higher than the highest price in the last
20 days.
Add a position: If the price has risen by a certain percentage (e.g. 1% of the position) from the
previous buy, add one unit to the position.
(13)
On the basis of this, we introduce our model.
(14)

3.4 The Suolution of LSTM Forecasting-Highest Return model


Finally:

(15)

Where PR greater than 0 means buy and less than 0 means sell. According to the formula, the daily
transaction amount PRgn for gold and PRbn for bitcoin can be derived respectively
Combine the daily transaction amount[8]with the commission, gold and bitcoin prices to get the
total daily account value[9].

(16)

204
BCP Business & Management WTED 2022
Volume 33 (2022)

VALUEN is the total value of the account on day n. g is the amount of gold in the account, b is
the amount of bitcoins in the account, and D is the amount of dollars in the account. Bringing this
data into the formula for calculation: the following figure8 is obtained.

Figure8 The trade of total value


After five years, our account has risen from $1,000 to $2,685.84, for a total gain of 168.58%. And
the gains have risen almost continuously and do not fluctuate with the price of gold or bitcoin, so our
plan is working[10].

4. Conclusion
In this paper, an investment and trading mathematical model based on gold and Bitcoin is
established to help traders make decisions. Firstly, based on the time series trend, we use long and
short term memory neural network model to build the network layer, and set the training time to
predict the gold and bitcoin prices on the trading day. Next, quantitative trading and investment
method is adopted to obtain the daily trading types of gold and Bitcoin by combining turtle strategy
and forecast data, and then the daily trading quantities of both are obtained by combining Alpha
hedging strategy and LB ladder rule, and the daily total account value model is obtained by combining
the commission of each transaction. This paper establishes a prediction model to calculate the daily
account value model, which provides some support for relevant practitioners to calculate the return
on investment.

References
[1] Zhang N,Fang JW,Zhao Yuxuan. Bitcoin price prediction based on LSTM mixture model[J]. Computer
Science,2021,48(S2):39-45.
[2] Nash Kathryn,Trott Verity,Allen William,Iordache Catalina,Raats Tim,Afilipoaie Adelaida.
Transnationalisation revisited through the Netflix Original: An analysis of investment strategies in
Europe[J]. Convergence: The International Journal of Research into New Media Technologies,2022,28(1).
[3] Wnuczak Paweł. Profitability of investment strategies developed on the basis of buy and sell
recommendations[J]. Journal of Economics and Management,2021,43(1).
[4] e Qixiang,Ma Yutong. Classification study of commodity futures risk premiums under different trading
strategies[J]. Journal of Management Engineering,2019,33(03):52-
60.DOI:10.13587/j.cnki.jieem.2019.03.007.
[5] Sin, Jing. Quantitative trading strategy of A-shares based on KNN algorithm[J]. Bohai Rim Economic
Outlook,2020(01):153.DOI:10.16457/j.cnki.hbhjjlw.2020.01.105.
[6] Huang, W.L.. Research on investment portfolio optimization based on multi-objective evolutionary
algorithm [D]. Harbin University of Commerce, 2020. doi:10.27787/d.cnki.ghrbs.2020.000514.
[7] Yongqi Zhang,Haiying Shi. Research on Quantitative Investment Strategy based on Empirical Analysis
of Shanghai A-share Market Data[C]//.Proceedings of 2nd International Conference on Advances in

205
BCP Business & Management WTED 2022
Volume 33 (2022)

Social Sciences and Sustainable Development (ASSSD 2021).,2021:188-


192.DOI:10.26914/c.cnkihy.2021.005777.
[8] Reza Gharoie Ahangar,Asma Salman. Investment Strategies in Emerging New Trends in
Finance[M].IntechOpen:2021-04-14.
[9] Shaokang Zhang, Zizhan Wei. Analysis of Trading Strategy based on LSTM[J]. International Core
Journal of Engineering,2022,8(8).
[10] Shi Yukun,Chen Ding,Guo Biao,Xu Yaofei,Yan Cheng. The information content of CDS implied
volatility and associated trading strategies[J]. International Review of Financial Analysis,2022,83.

206

You might also like