Analysis of the best trading strategies based on neural networks

: This article build a prediction model based on the historical trading volume of gold and Bitcoin, then establish an investment return maximization model to maximize the return amount, and finally propose a feasible trading strategy to traders based on the model results. First, this article will process the data visualization after missing values to analyze the trend of bitcoin and gold trading volume, yield, risk and volatility respectively. Second, This article combine the ARIMA model and the LSTM model to establish an ensemble learning model, and use the critic method to combine the two series of predictions with appropriate weights to predict the asset price of gold and bitcoin for each trading day during the period from 2016 to 2021, again, According to the ensemble learning prediction results, the optimal average cost method (DCA) (DCA) is used to solve the prediction curve and verify the optimality, and it is concluded that there is a maximum benefit when k=19% and p=54%. Finally, based on the above predictive analysis results, this article explain to traders the model building process and the results it presents, and propose feasible investment decisions about gold and bitcoin from the aspects of trading behavior and trading psychology.


Introduction
A wide range of market traders pay close attention to the high-yield investment trading market, expecting to maximize their returns by investing in volatile assets.However, the higher risk and volatility make trading decisions difficult to determine [1].Among them, two different assets, gold and bitcoin, are favored by traders.
Gold is traded in troy ounce in international transactions and is not traded on weekends or holidays.In recent years, its continuous rise in prices has triggered public passion to invest.Gold has become a indispensable financial channel as stocks and bonds [2].Bitcoin (BTC) is an anonymous P2P form of virtual currency proposed by "Satoshi Nakamoto" [3], which can be traded daily, but its monetary properties are not that prominent.Its holding is mostly from people's speculative motives, that is, through the purchase and sale of transactions, thus earning a spread [4].
Markets for both bear high risk as well as simultaneous high return, and one of the risks is whether to be able to make a correct analysis of their price tendency.Therefore, it is of great theoretical and practical importance to effectively predict the price of gold and bitcoin [5].
We will build a model that uses historical time series to predict future data, considering the huge volatility of the financial market, we use the ARIMA model and the LSTM model for combined forecasting, and use the nonlinear forecasting ability of the LSTM to complement the nonlinear forecasting ability of ARIMA to achieve better results, and finally analyze the sensitivity of the model.This model preliminarily considers the four factors that have the greatest impact on decision-making, and on this basis, the two concepts of fixed asset ratio coefficient and investment risk coefficient are used to further rationally analyze the investment decision.Based on the results of the analysis, we will make a memorandum on how to make investment decisions for traders, and give certain suggestions and references.

Approches
Firstly, the trading volume-time curves of Bitcoin and gold are drawn according to the actual transaction volume, and their trends, volatility and risk ratio are observed, which is shown in Figure 1.With the result of ACF and PACF we can derive the values of p, q.Also in combination with the previous section, d can be determined, so the final parameters of the two arima models are as follows.

LSTM neural network model
Considering the small amount of data, insufficient training time, and the need for multiple iterations, this model uses the relatively simple lstm model as follows(Fig.2).

Figure 2: Flow chart
The Lstm neural network uses the simplest single-layer neural network with 12 neurons, the activation function is selected as relu, the input dimension is two bits, and the number of features is one.Considering the relatively small amount of input data, a dropout layer is added to prevent data overfitting, and a dropout rate of 0.3 is set.
Adaptive moment estimation is chosen for the optimizer because of its unique advantages [1], which is based on the combination of first-order moment estimation (First Moment Estimation, i.e., the mean of the gradient) and second-order moment estimation (Second Moment Estimation, i.e., the uncentered variance of the gradient) of the gradient to calculate the update step [6].
The loss function is chosen as mean absolute error, which is defined by

CRITIC method combination
The CRITIC method is a better objective weighting method than the entropy and standard deviation methods.
It is based on the evaluation of the strength of contrast and the conflict between indicators to measure the objective weight of indicators.Considering the magnitude of variability of indicators while taking into account the correlation between indicators, it is not the case that the larger the number means the more important, and the scientific evaluation is made entirely by using the objective properties of the data itself [7].
The corresponding process of the construction is as follows，like Fig. 3. where denotes the value of the jth evaluation indicator for the i-th sample.
(2).Dimensionless processing CRITIC weighting method generally uses forward or inverse processing, and here forward processing is chosen, and the formula is as follows.min ' max min (3) Variability of indicators The variability of the indicators is expressed in the form of standard deviation.
Sj denotes the standard deviation of the jth indicator.In the CRITIC method, the standard deviation is used to indicate the fluctuation of the difference between the internal values of each indicator.The larger the standard deviation is, the greater the difference in the value of the indicator, the more information can be shown, and the stronger the evaluation intensity of the indicator itself, and more weight should be assigned to the indicator. (

4). Conflict of indicators
The correlation coefficient is used to express 1 (1 ) rij denotes the correlation coefficient between evaluation indicators i and j.The stronger the correlation with other indicators, the less conflicting the indicator is with other indicators, the more the same information is reflected, and the more duplication in the evaluation content that can be reflected, which to a certain extent also weakens the evaluation intensity of the indicator and should reduce the weight assigned to the indicator.(4) Amount of information 1 (1 ) * The larger Cj is, the greater the role of the jth evaluation index in the whole evaluation index system, and more weight should be assigned to it.
(5) Objective weights The objective weight of the jth indicator is.Where: B (t) is denoted as actual bitcoin price on day t,G (t): the actual price of gold on day t,G_ P (t): forecast price of gold on day t, B_ Dr: expected revenue of bitcoin,G_ Dr: expected return of gold,T 'is the day when the tendency of expected price changes.Because on non tradable days, gold have no price, G_ dr follows the previous.

Influencing Factors
There are 4 factors that influence the investment strategy.Factor (1) the expected outcome of bitcoin, Factor (2) the expected outcome of gold, Factor (3) the percentage of assets invested in bitcoin, and Factor (4) Bitcoin risk assessment Explanation of influencing factors.Factor 1: Based Bon the bitcoin trading price as of the current day and the bitcoin price curve obtained from the model prediction, if the bitcoin price is predicted to be higher (lower) on the next trading day than it is today, define this time as a gain (loss) and continue predicting the price on the next day until it stops when the price turns, the expected result is the difference between the price on the day the turn occurs and the price of bitcoin on the current trading day.
Factor 2: Based on the gold price as of the current day and the gold price curve obtained from the model prediction, if the gold price is predicted to be higher (lower) tomorrow than it is today, define this time as a gain (loss) and continue predicting the next day's price until it stops when the price takes a turn, with the expected result being the difference between the price on the day the turn occurs and the price of bitcoin today.
In addition, because gold has a non-trading day, there is no gold price for that day, and the expected return is extended to the previous day when the non-trading day occurs.
Factor 3: High risk means high return, and to increase your return, it is best to make a bitcoin investment.If you go all your money to invest in Bitcoin, you will suffer a huge property loss when Bitcoin has a crash.If very little money is used to invest in bitcoin, the risk is lower, but it also means that the return will be less when bitcoin skyrockets.
Factor 4: Investment should be risk-averse.Bitcoin is very volatile and suitable for short-term investment, and when bitcoin predictions are not promising in terms of returns, you should call it quits and sell all your bitcoins in time.However, because it is very normal for bitcoin prices to fluctuate, if you sell and buy frequently because you are afraid of a price crash, you will lose more and more money because of commissions and thus losses.
In addition, investment should also have a sense of risk, bitcoin is very volatile and suitable for short-term investment, when the bitcoin predicted return is not optimistic, we have to close in time and sell all the bitcoin, after selling if the day can be traded in gold and gold expected return is optimistic, you can buy all the cash into gold.This involves the definition of unpromising returns on bitcoin.We use the investment risk factor k to determine the timing of selling bitcoin, and when the predicted return is negative and less than k times the bitcoin's daily trading price, we dump the bitcoin to hedge the risk and stop the loss in time.

Investment measures
If Expected return of gold > Commission of buying gold

Results
Using the trading strategy given by this team, the initial investment amount of $1,000 made on September 11, 2016, the total assets gained as of September 10, 2021, is $34,351.

Conclusion
The combination model of ARIMA and LSTM is used to forecast the price in the short term.By using ARIMA model's good linear fitting ability and LSTM's powerful nonlinear relationship mapping ability, price time series is regarded as composed of linear autocorrelation structure and nonlinear structure, and ARIMA model and LSTM model are used to predict them respectively.For low-risk gold prediction, the error is small, while for high-risk bitcoin prediction, the error is large.
The combination method gives full play to the advantages of the two models, and is an effective method to predict short-term market price changes.At the same time, this model also has good generalization ability, which can be applied to other time series prediction.It can also be used for long-term sequence change analysis.It can be considered to add the wavelet function before THE LSTM model to separately predict the sequence decomposition, which can achieve higher accurac

Figure 1 :
Figure 1: Time-to-Close Price Trend of Gold and Bitcoin

Figure 3
Figure 3: Flowchart output The final prediction results are obtained by multiplying the obtained prediction values with their corresponding weights and adding up all the product results.