/Hybrid_Model_DTT_RNN

This model combines Deep Temporal Transformers with LSTM and GRU to predict the stock market. Specifically, it outperforms the SP500 during the 3-year testing period, achieving a return of 170% and a Sortino ratio greater than 2.

Primary LanguageJupyter Notebook

Hybrid A.I. Model: Deep Temporal Transformer + RNN

This model combines Deep Temporal Transformers with LSTM and GRU to predict the stock market. Specifically, it outperforms the SP500 during the 3-year testing period, achieving a return of 170% and a Sortino ratio greater than 2.

⚠️Disclaimer: Optimum select and best combination algorithms may introduce overfitting. If you use it, be sure to implement a system to correct for selection bias, overfitting, and non-normality to ensure model robustness. This is example code for educational purposes. Under no circumstances put these models into production because the probability of losing money is too high.⚠️

backtesting

Sortino: 2.446

Beta: 0.372

Alpha: 21.554 %

MaxDrawdown: 17.405 %

Mathematical expectation of the daily return of the Hybrid Model: 0.1362%

Average loss when losing: -0.85%

Average gain when winning: 0.95%

Probability of success: 56.09%

Probability of failure: 43.91%

Final profitability: 169.82%

Risk-to-reward ratio: 1.11

Maximum loss in one day: -5.89% => 2020-06-11 00:00:00

Maximum gain in one day: 11.98% => 2020-03-16 00:00:00

Maximum number of consecutive negative days: 6

Cumulative average loss in those 6 days: -5.11%

DTT architecture

DTT schema