本研究旨在探討深度學習模型與金融資本配置理論整合之可行性,提出一套結合Transformer 模型與Kelly Criterion 的投資策略框架,以提升整體投資報酬。研究對象選取Apple(AAPL)與Tesla(TSLA),使用Yahoo Finance 提供之歷史股價資料,且結合技術指標(如移動平均、布林通道、真實波幅均值及波動率)與價格特徵,當作Transformer 模型的輸入變數進行收盤價預測。將預測結果應用於Kelly 公式所計算出的比例當作策略進行投資。 Transformer 模型以其擅長長期依賴捕捉能力及同時運行的運算效率著稱,透過位置 編碼與多頭注意力機制,有效學習價格序列中的趨勢與波動特性;而Kelly Criterion 則基於機率理論,計算可最大化長期資本成長率的最適投注比例。本研究各自在兩種市場情境下評估模型的穩健性:疫情前與疫情後,其中疫情後期間涵蓋了整個疫情期間及其後的回穩階段。 實驗結果顯示,在COVID-19 前,AAPL 與TSLA 之測試資料集預測R² 各自達 0.94 與0.96,預測精度表現優。結合Kelly Criterion 之模擬投資策略總報酬率AAPL +10.1%、TSLA +7.18%。然而,COVID-19 後,預測R² 各自下降至0.89(AAPL)及 0.96(TSLA),對應之模擬投資報酬亦降至AAPL +2.53%、TSLA +1.60%。 整體而言,本研究驗證了將深度學習技術(Transformer 模型)與金融理論(Kelly Criterion)結合應用於資本配置之可行性,提供一套兼具預測精度與風險控管能力的投資策略。;This study proposes an investment strategy framework that integrates the Transformer model with the Kelly Criterion to enhance investment performance. Using historical stock data of Apple (AAPL) and Tesla (TSLA) from Yahoo Finance, the model incorporates technical indicators—such as moving averages, Bollinger Bands, ATR, and volatility— for closing price prediction. The forecasts are then used to compute optimal investment ratios via the Kelly formula. The Transformer model captures long-term dependencies and offers efficient parallel computation by utilizing positional encoding and multi-head attention. The Kelly Criterion, based on probability theory, determines the optimal capital allocation to maximize long-term growth. Model robustness is evaluated under two market regimes: pre- and post-COVID-19, where the latter includes both the pandemic years and the subsequent recovery period. Experimental results demonstrate that prior to COVID-19, the model achieved high predictive accuracy, with R² values of 0.94 for AAPL and 0.96 for TSLA. The simulated investment strategy integrating the Kelly Criterion yielded total returns of +10.1% for AAPL and +7.18% for TSLA. However, following the onset of COVID-19, the R² values declined to 0.89 for AAPL and 0.96 for TSLA, with corresponding simulated investment returns decreasing to +2.53% and +1.60%, respectively. Overall, this study validates the feasibility of combining deep learning techniques (Transformer model) with financial theory (Kelly Criterion) for capital allocation. The proposed framework offers an investment strategy that balances predictive accuracy and risk management, making it a valuable reference for applications in volatile market environments.