Research on Maximization of Investment Income Based on Linear Method

. In this paper, we analyze the trading process of investment by building models for evaluating and trading investment products and using mathematical and economic knowledge and methods. We obtain the purchase coefficients and trading recommendations by quantifying the indicators of investment products. And through linear and nonlinear equations to get the trading volume. All in all, our goal is to obtain the largest income throughout the whole trading date sequence. In the end, we discuss the shortcoming of the model.


Introduction
With the development and promotion of the Internet economy, online payment is gradually known and used by people. In recent years, the popular virtual currency has entered the vision of ordinary investors. Taking bitcoin as an example, it rose from the original less than $1 to the highest of more than $60000 in 2021 and then plummeted from $60000 to more than $30000 [1]. It is proven that bitcoin has obvious bubble properties. Compared with gold, bitcoin is tax-free, short-transactioncycle, and lack-liquidity. Investors in the industry also fully explore and utilize bitcoin. While using bitcoin for diversified investment and higher risk-return, hedgers are more and more interested in whether there is a cointegration relationship between gold and bitcoin, so as to build a hedging portfolio in investment [2].
In order to get the maximum benefit from the investment in Bitcoin and gold, we de-signed two models based on the predicted price of gold and bitcoin, Investment Product Evaluation Model and Investment Product Trading Model respectively, established a reasonable trading model, and adjusted the number of positions accurately.

Data Sources
The data used in the article are from London Bullion Market and NASDAQ, 9/11/2021. Therefore, the prices of gold and bitcoin have reference value.

General Assumption
Assumption 1: The initial cash holding is $1,000. On the first day of trading, $333 was used to buy gold and bitcoin products respectively. description: Since the data before the first day is not given, and there is no previous transaction price for reference and prediction. Therefore, we use the method of evenly distributing funds to complete the initial transaction, and on this basis, we can maximize the future benefits.
Assumption 2: Among the five years from 2016 to 2021, the inflation rate of the money is zero. description: With zero monetary inflation, we can compare different results. At the same time, it allows some simplifications of the model.

Notations
The symbols repeated in this article are shown in Table 1.

The rate of increase and price deviation
The upside calculation is, as the name implies, measured using the difference in the data of the trading price.
Deviation rates allow assessing the sharpness of price changes of investment products similar to mathematical differentiation. The formula for calculating the deviation rate is as follows.

Market situation assessment
In the case of gold, for example, when calculating market conditions, we need to refer to price data with a long time horizon. Gold is a value-protected type of investment, so we take a price increase calculation period of 60 days, and take a deviation rate calculation period of 15 days. When we debug the model, we find that the maximum price increase for gold in 15 days is larger compared to all other times, so we do not miss excellent trading opportunities. For bitcoin, we selected 30 days of price increase data and 5 days of deviation for the market coefficient calculation. The formula for calculating its market coefficient is as follows.
The distribution of the market coefficients is between 0.53 and 0.62. We take its median value of 0.565 as the threshold to divide the market into bull and bear markets. A bull market indicates a positive market price, while a bear market is an opposite. The temporal distribution of market conditions is shown in Figure 1. We are able to observe that the market coefficients reflect well the rise and fall of the market [7].

Calculation of trading risk
In trading investment products, each one carries a certain amount of risk, which we measure with a risk coefficient [8].
Both investment products can be calculated using this formula, substituting the variables of the corresponding investment product to get the corresponding result. Still using gold as an example, its risk factor is shown in Figure 2. This indicates that the faster the market price changes, the greater the trading risk.

Investment Product Evaluation Model
In the current transaction, we have two investment products to choose from, gold and bitcoin, and we need to construct a model that, with the input of quantitative indicator variables, can produce a selection coefficient for the two investment products that visually reflects the differences and allows us to make a purchase choice based on that.
In the data processing session, we have been provided with information on the in-crease in gold and bitcoin, the market coefficients for gold and bitcoin, and the purchase risk factors for both. Conveniently, we have normalized all the data to be used, which enables us to get rid of the computational headaches caused by the relative imbalance in the size of the data. Based on the magnitude of the effects of the different variables on purchase intention and profitability, we have developed a weighted formula to measure the buying and selling strategies of investment products.
Similarly, this is a general formula. The weighted coefficients of these variables are derived from our daily investment experience and indicate the importance we attach to these different influencing factors. For B, we consider the degree of increase or decrease in the price of the investment product as the key factor that influences our investment strategy and plays a decisive role in the investment strategy; of course, market conditions are also influencing factors that we cannot ignore, so we put the degree of influence of market conditions in the second place; finally, we need to consider the risk brought by the transaction. Obviously, we put the importance of risk in the last place, we calculate the impact of risk on the buying and selling strategy in the form of a score that can dilute the dramatic growth and fall of the price of the investment product and reduce the volatility of the coefficient.
After the calculation has gone through the formula 5, it is then normalized to obtain a coefficient sized representation of the buying and selling strategy. The results are then input into the trading model of the investment product for calculation and the final result.

Investment Product Trading Model
The trading model of the investment product is built on top of the Investment Product Evaluation Model, whose coefficient values are distributed between 0 and 1. At this point, we set the threshold to pick the time of the trade. The trading model equation is as follows.
In Formula 6, Acurrent cash is the current cash holding amount. In formula 7, Aitem held is the current amount of investment products held. After getting the buy and sell amount, we still have to take the handling fee of the transaction into consideration, because each transaction has to spend the corresponding handling fee.
The difference between the purchase coefficients and the threshold represents the magnitude of willingness to trade, with a larger difference representing higher willingness to trade. In formula 6, we use a linear formula to measure willingness to buy and reduce the risk in trading. When buying opportunities arise, we need to take a conservative approach to trade to ensure that the trade is ultimately profitable. In formula 7, we use a non-linear approach, selling a smaller amount of the product when a general trading opportunity arises and selling an exponentially larger amount when a great trading opportunity arises, i.e., when the investment product rises very much so that we can make a good profit in a rare bull market. Of course, the number of products sold will not exceed the amount we hold, and the formula already places a limit on the extent of their growth.

Trading Price Prediction
We input the first 150 days of data into the LSTM [9] model for training and let the model perform the identification of features and extract their data changes and temporal patterns, and obtained the following results. We will use the predicted price data for the calculation (Figure 3 and Figure 4).

Processing of Forecasted Transaction Price Data
After getting good prediction results, we performed data processing work and we calculated the predicted growth of gold and bitcoin prices and normalized them. The results compared with the real values are shown in the Figure 5 and Figure 6.   As can be seen from these two images, the predicted price increases for gold and bit-coin do not exactly match the magnitude of the original data, but they perfectly reflect the larger values of change in the original data, and their changes are quite correlated. Subsequently, we calculated the market coefficients for the predicted price data as well as the risk coefficients for the subsequent calculation of the purchase coefficients corresponding to the predicted price data.

The Purchase Coefficient Corresponding to The Predicted Price
After getting the input data for calculating the coefficient, we bring them into Equation5 for the calculation to get the coefficients for different investment products and normalize them, and the results obtained are as follows (Figure 7 and Figure 8). First, observe the blue lines in the two charts above, these show the purchase coefficients for gold and bitcoin, i. e. the corresponding ratings for the investment products. By comparing these two blue lines with their raw price data, we are able to make such a rule: the trend of the purchase coefficients and the raw price data is the same, which provides a basis for our trading. When the purchase coefficient increases, we can conclude that the price of the investment product is also increasing, and the same when it decreases, while the magnitude of the increase and decrease is also reflected in the size of the purchase coefficient. The blue line's trend is relatively obvious, but its data is too noisy. In trading investment products, we usually take a relatively long-term view of price increases and decreases, indicating our pursuit of long-term profitability. Therefore, after filtering the purchase coefficients through the filter, their true and obvious trend is revealed, which makes it more convenient for us to perform subsequent calculations [10]. On a practical level, it is also more suitable for the daily trading of investment products: we do not constantly make buying and selling operations based on short-term fluctuations of the product.

The Purchase Coefficient Corresponding to The Predicted Price
After obtaining the detailed trading coefficients, we will artificially measure the size of the trading threshold to define whether to trade or not. We can observe Figure 7 and 8 to know that the larger the purchase coefficients are, the higher the investment product is in the growth phase, the price is relatively high, and suitable for selling; similarly, the smaller the purchase coefficients are, the price is relatively low and suitable for buying. After considering the predicted prices of the two investment products, we set the Bin for gold to 0.38 and the Bout to 0.5, and the Bin for bitcoin to 0.58 and the Bout to 0.61. Then, we can get Figure 9 and Figure 10.  In these two figures above, the orange scattered points represent the buy points and the blue points represent the sell points. The absolute value of the difference between the purchase coefficients and the corresponding threshold represents the willingness to trade, and the larger the absolute value, the stronger the willingness to trade, i.e., the larger the trading volume obtained when substituted into Equation 6 and 7.
Next, we trade the investment products. Because the prices obtained through the pre-diction are obtained 150 days later, we only consider transactions made after 150 days from the initial start.
In trading, we first have a look on whether it is a trading day for gold. Then, we judge the buying threshold of gold and Bitcoin, and then judge the absolute value of the difference between the buying coefficient and the threshold of the two, judge which product has more trading potential, and choose the larger one for trading. If gold has more trading potential, sell it. Again, because Bitcoin can be traded on each trading day, the buying and selling of Bitcoin are judged separately. of course, after getting the transaction volume, the transaction price is easily obtained by calculation. Finally, we get the number of gold and bitcoin positions in Figure 11 and Figure 12. Observing the position amount shows that the share of investment products held in-creases when the price decreases and decreases when the price increases, in line with the general common sense and law of buying and selling. The law of change of total assets is shown in Figure 13. It can be seen that the total assets show an overall upward trend, and in the end, we were able to reach a total price of more than $25,000, so our assets are 25 times more than what they were.

Conclusion
On the whole, to get the highest profit, it is necessary to buy when the price is lowest and sell when it is highest within a rise or fall. On the basis of assumptions, we get the ultimate maximum benefit through the established model. Meanwhile, we can know by observing the raw data that although the graphs of both gold and bitcoin are relatively volatile, the growth multiple of bitcoin is much larger than that of gold, which is also determined by the properties of these two investment products. After the normalization and filtering operations, the trading price properties of these two investment products have disappeared to a considerable extent, making it difficult to reflect Bitcoin's advantage in terms of trading price multiplier growth.