以多智能體虛擬市場模型提升強化學習交易策略之泛化性
A Multi-Agent Virtual Market Model for Generalization in Reinforcement Learning Based Trading Strategies
摘要
許多研究成功使用強化學習的方法,以金融市場資料訓練出有獲利能力的交易模型。
大多數的方法都簡化了交易行為對市場狀態的影響,也就是假設買賣行為不會影響交易環境,如此得以在強化學習的框架中直接重演歷史價格資料作為交易環境。
然而,以固定的歷史資料尋找最大化長期獲利的交易策略,容易有泛化性差的問題,在使用未來資料測試時的表現往往和訓練時有很大的落差。
為了改善交易策略的泛化性,我們提出了多智能體虛擬市場模型,使用多個生成網路模擬出市場未來可能的變化。
由於生成對抗網路擅長產生出擬真的資料,我們的虛擬市場模型學習了真實市場的價格和交易量分佈,可以生成無數個模擬的市場走勢。
此外,交易動作可以和生成的市場狀態疊加,作為虛擬市場模型的輸入,使後續生成的市場狀態能夠和過去交易行為相關。
我們認為結合多個生成網路可以學習到市場上多種價格走勢,比起使用單一網路更有機會精細的模擬真實市場的變化。
我們的研究以多智能體虛擬市場模型所生成的市場資料取代原始的歷史資料,建構強化學習的交易環境。
我們使用中國股票期貨以及美國股票市場的資料來建模並測試使用多智能體虛擬市場模型對強化學習交易策略的改善。
採用多智能體虛擬市場訓練出的交易策略比起直接使用歷史資料,交易滬深300股票期貨一年的總收益增加了至少12%;而交易蘋果公司股票,半年就能夠有至少34%的收益成長。
如此證明了使用多智能體虛擬市場模型訓練出的交易策略有更好的泛化性,能夠在測試資料集上得到更高的報酬且更低的損失風險。
多智能體虛擬市場模型不僅有模擬真實市場變化的能力,生成的價格資料更可以用來訓練基於強化學習的交易策略,並且能夠使交易模型表現出更好的獲利能力。
大多數的方法都簡化了交易行為對市場狀態的影響,也就是假設買賣行為不會影響交易環境,如此得以在強化學習的框架中直接重演歷史價格資料作為交易環境。
然而,以固定的歷史資料尋找最大化長期獲利的交易策略,容易有泛化性差的問題,在使用未來資料測試時的表現往往和訓練時有很大的落差。
為了改善交易策略的泛化性,我們提出了多智能體虛擬市場模型,使用多個生成網路模擬出市場未來可能的變化。
由於生成對抗網路擅長產生出擬真的資料,我們的虛擬市場模型學習了真實市場的價格和交易量分佈,可以生成無數個模擬的市場走勢。
此外,交易動作可以和生成的市場狀態疊加,作為虛擬市場模型的輸入,使後續生成的市場狀態能夠和過去交易行為相關。
我們認為結合多個生成網路可以學習到市場上多種價格走勢,比起使用單一網路更有機會精細的模擬真實市場的變化。
我們的研究以多智能體虛擬市場模型所生成的市場資料取代原始的歷史資料,建構強化學習的交易環境。
我們使用中國股票期貨以及美國股票市場的資料來建模並測試使用多智能體虛擬市場模型對強化學習交易策略的改善。
採用多智能體虛擬市場訓練出的交易策略比起直接使用歷史資料,交易滬深300股票期貨一年的總收益增加了至少12%;而交易蘋果公司股票,半年就能夠有至少34%的收益成長。
如此證明了使用多智能體虛擬市場模型訓練出的交易策略有更好的泛化性,能夠在測試資料集上得到更高的報酬且更低的損失風險。
多智能體虛擬市場模型不僅有模擬真實市場變化的能力,生成的價格資料更可以用來訓練基於強化學習的交易策略,並且能夠使交易模型表現出更好的獲利能力。
Many studies have successfully used reinforcement learning (RL) to train an intelligent agent that learns profitable trading strategies from financial market data. However, most of these studies have simplified the effect of the actions of the trading agent on the market state. Trading actions do not affect the market environment reproduced in RL. The trading agent is trained to maximize long-term profit by optimizing fixed historical data. Such approach frequently results in the trading performance during out-of-sample validation being considerably different from that during training. In this paper, we propose a multi-agent virtual market model (MVMM) comprised of multiple generative adversarial networks (GANs) which cooperate with each other to reproduce market price changes. Due to the advantages of GANs, the MVMM can learn the distribution of real market prices and generate numerous simulated market trends. In addition, the action of the trading agent can be superimposed on the current market state as the input of the MVMM to generate an action-dependent next state. In this research, real historical data were replaced with the simulated market data generated by the MGVMM. The experimental results indicated that the RL agent is appropriately generalized by the aforementioned methods. The trading strategy of the trained RL agent achieved high profits and exhibited low risk of loss during the testing phase.