摘要: | 一般深度學習做金融商品價格預測時,偏重於使用數值誤差的統計函數(如R^2)做預估準確度的評估當作學習時的回饋機制,但對於實際交易而言,股價預測值所導致的預測交易方向(該買還是該賣)上的誤差,常會比預測值與實際值的數值誤差對交易獲利影響更大,但目前深度學習對時間序列預測的研究顯少觸及此議題,但其有實務上的重要性。 本研究先依據數值誤差(R^2,MASE)比較LSTM與TCN兩大類深度學習方式的收盤價預測模型,找出其高準確度的參數設定,再將其實際運用在交易上。本研究運用程式交易,探索這些預測收盤價是否有達成實際獲利的潛力,若有,則比較其獲利性與原始數值誤差的關係。本研究並提出了透過客製化損失函數將真實交易中所特別重視的實際交易方向(買進或賣出)納入考量,以利提升實際交易獲利。 本研究針對三種常被交易的期貨商品(黃金,黃豆,原油)進行上述整體運算與比較,並發現上述三個商品中,黃金及黃豆在最小化數值誤差的同時也能提升交易獲利,但原油則無法。該黃金及黃豆若再加上考量交易方向誤差的客製化損失函數時,也能進一步提升實際交易獲利。但原油在原本最小化數值誤差也無法提升獲利的商品,則本研究提出的客製化損失函數也無法提升獲利。;Normally, when deep learning is used to predict the price of the financial commodity, people most used the statistical function (such as R^2) that compliance to the numerical error to assessing the accuracy of the estimate as a learning mechanism. However, for the real trading, the forecast trading direction (to buy or to sell) cause by the error of the stock price prediction usually has a greater impact on the profitability of trading than the numerical error between the predicted value and the actual value, but the study of time series prediction by deep learning today rarely explores this topic, but it has practical importance. In this study, we compare the closing price prediction model of LSTM and TCN based on the numerical error (R^2, MASE), to find out the high-accuracy parameter settings and use it on the real trading. We use program trading to explore whether these predicting of closing prices can achieve actual profitability or not, and if so, we will compare the relationship between its profitability and the original numerical error. This study also proposes a custom loss function that incorporate the actual trading direction (to buy or to sell) to increase the profit of real trading. This study is aimed at three futures commodities that are often traded (gold, soybean, crude oil) and perform the above overall calculation and comparison, and we found that some of the commodities will increase the profit when minimized the numerical error, but others not. More than that, that kind of commodities can also enhance the profit of real trading when it adds a custom loss function. However, if the commodities can’t increase the profit when minimized the numerical error, the custom loss function in this study also can’t increase the profit. |