Abstract
Algorithmic trading is one important financial area of interest to both academic and industrial researchers. With the development of machine learning and deep learning, all kinds of models and techniques are utilized in algorithmic trading. This paper proposes a novel framework for enhancing stock technical analysis strategies by survival analysis. The main idea is to integrate an existing trading strategy with a survival model and make them complementary to each other. By means of survival analysis, the original trading strategy can be extended to introduce an investment target, which is treated as the event of interest. On the other hand, the original trading signal provides survival analysis with a simple and clear starting time point of observation. The trained survival models are used to filter out false trading signals to improve the strategy performance. Under the framework, we propose different filtering methods, utilize different deep survival models, and compare their performance from both trading and model perspectives. We perform extensive and strict backtesting on the daily trading data of 380 plus stocks. The experimental results show that the framework can well improve the performance of technical analysis strategies in different market situations.
Similar content being viewed by others
References
Antolini, L., Boracchi, P., & Biganzoli, E. (2005). A time-dependent discrimination index for survival data. Statistics in Medicine, 24(24), 3927–3944.
Andersen, P. K., & Gill, R. D. (1982). Cox’s regression model for counting processes: A large sample study. Annals of Statistics, 10(4), 1100–1120.
Ayala, J., Garcí a-Torres, M., Noguera, J. L. V., Gómez-Vela, F., & Divina, F. (2021). Technical analysis strategy optimization using a machine learning approach in stock market indices. Knowledge-Based Systems, 225, 107119. https://doi.org/10.1016/j.knosys.2021.107119
Adhikari, S., Thapa, S., Naseem, U., Lu, H. Y., Bharathy, G., & Prasad, M. (2023). Explainable hybrid word representations for sentiment analysis of financial news. Neural Networks. https://doi.org/10.1016/j.neunet.2023.04.011
Ben Jabeur, S., Stef, N., & Carmona, P. (2023). Bankruptcy prediction using the XGBoost algorithm and variable importance feature engineering. Computational Economics, 61(2), 715–741. https://doi.org/10.1007/s10614-021-10227-1
Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5–32. https://doi.org/10.1023/A:1010933404324
Cox, D. R. (1972). Regression models and life-tables. Journal of the Royal Statistical Society, 34(2), 187–220.
Dash, R., & Dash, P. K. (2016). A hybrid stock trading framework integrating technical analysis with machine learning techniques. The Journal of Finance and Data Science, 2(1), 42–57. https://doi.org/10.1016/j.jfds.2016.03.002
Davidson-Pilon, C. (2019). Lifelines: Survival analysis in Python. Journal of Open Source Software, 4(40), 1317. https://doi.org/10.21105/joss.01317
Fanai, H., & Abbasimehr, H. (2023). A novel combined approach based on deep autoencoder and deep classifiers for credit card fraud detection. Expert Systems with Applications, 217, 119562. https://doi.org/10.1016/j.eswa.2023.119562
Fama, E. F. (1970). Efficient capital markets: A review of theory and empirical work. The Journal of Finance, 25, 383–417.
Friedman, J. H. (2001). Greedy function approximation: A gradient boosting machine. Annals of Statistics, 29(5), 1189–1232.
Guo, Y., Guo, J., Sun, B., Bai, J., & Chen, Y. (2022). A new decomposition ensemble model for stock price forecasting based on system clustering and particle swarm optimization. Applied Soft Computing, 130, 109726. https://doi.org/10.1016/j.asoc.2022.109726
Graf, E., Schmoor, C., Sauerbrei, W., & Schumacher, M. (1999). Assessment and comparison of prognostic classification schemes for survival data. Statistics in Medicine, 18(17–18), 2529–2545.
Guangliang, G., Zhan, B., Lingbo, L., Jie, C., & Zhiang, W. (2015). A survival analysis method for stock market prediction. https://doi.org/10.1109/besc.2015.7365968
Han, Y., Kim, J., & Enke, D. (2023). A machine learning trading system for the stock market based on n-period min-max labeling using XGBoost. Expert Systems with Applications, 211, 118581. https://doi.org/10.1016/j.eswa.2022.118581
Hu, W., & Zhou, J. (2018). Joint modeling: An application in behavioural scoring. Journal of the Operational Research Society, 70(7), 1129–1139. https://doi.org/10.1080/01605682.2018.1487821
Hu, W., & Zastawniak, T. (2020). Pricing high-dimensional American options by kernel ridge regression. Quantitative Finance, 20(5), 851–865. https://doi.org/10.1080/14697688.2020.1713393
Ishwaran, H., Kogalur, U. B., Blackstone, E. H., & Lauer, M. S. (2008). Random survival forests. The Annals of Applied Statistics, 2(3), 841–860. https://doi.org/10.1214/08-aoas169
Jiang, C., Lu, W., Wang, Z., & Ding, Y. (2023). Benchmarking state-of-the-art imbalanced data learning approaches for credit scoring. Expert Systems with Applications, 213, 118878. https://doi.org/10.1016/j.eswa.2022.118878
Kvamme, H., & Borgan, O. (2021). Continuous and discrete-time survival prediction with neural networks. Lifetime Data Analysis, 27(4), 710–736.
Klein, J. P. (2006). Survival analysis: Techniques for censored and truncated data. Springer.
Katzman, J. L., Shaham, U., Cloninger, A., Bates, J., Jiang, T., & Kluger, Y. (2018). DeepSurv: Personalized treatment recommender system using a Cox proportional hazards deep neural network. BMC Medical Research Methodology, 18(1), 24.
LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436–444. https://doi.org/10.1038/nature14539
Liang, L., & Cai, X. (2022). Time-sequencing European options and pricing with deep learning: Analyzing based on interpretable ALE method. Expert Systems with Applications, 187, 115951. https://doi.org/10.1016/j.eswa.2021.115951
Lo, A. W. (2004). The adaptive markets hypothesis. The Journal of Portfolio Management, 30(5), 15–29. https://doi.org/10.3905/jpm.2004.442611
Li, X., Wu, P., & Wang, W. (2020). Incorporating stock prices and news sentiments for stock market prediction: A case of Hong Kong. Information Processing & Management, 57(5), 102212. https://doi.org/10.1016/j.ipm.2020.102212
Lee, C., Yoon, J., & Schaar, M. V. (2018). DeepHit: A deep learning approach to survival analysis with competing risks. IEEE Transactions on Biomedical Engineering, 67(1), 122–133.
Md, A. Q., Kapoor, S., AV, C. J., Sivaraman, A. K., Tee, K. F., Sabireen, H., & Janakiraman, N. (2023). Novel optimization approach for stock price forecasting using multi-layered sequential LSTM. Applied Soft Computing, 134, 109830. https://doi.org/10.1016/j.asoc.2022.109830
Nazareth, N., & Ramana Reddy, Y. V. (2023). Financial applications of machine learning: A literature review. Expert Systems with Applications, 219, 119640. https://doi.org/10.1016/j.eswa.2023.119640
Ozbayoglu, A. M., Gudelek, M. U., & Sezer, O. B. (2020). Deep learning for financial applications: A survey. Applied Soft Computing, 93, 106384. https://doi.org/10.1016/j.asoc.2020.106384
Pei, D., Luo, C., & Liu, X. (2023). Financial trading decisions based on deep fuzzy self-organizing map. Applied Soft Computing, 134, 109972. https://doi.org/10.1016/j.asoc.2022.109972
Picasso, A., Merello, S., Ma, Y., Oneto, L., & Cambria, E. (2019). Technical analysis and sentiment embeddings for market trend prediction. Expert Systems with Applications, 135, 60–70. https://doi.org/10.1016/j.eswa.2019.06.014
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, E. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830.
Rizkiana, A., Sari, H., Hardjomijojo, P., Prihartono, B., & Yudhistira, T. (2017). Analyzing the impact of investor sentiment in social media to stock return: Survival analysis approach. In 2017 IEEE international conference on industrial engineering and engineering management (IEEM) (pp. 519–523). IEEE.
Souza, T. T. P., & Aste, T. (2019). Predicting future stock market structure by combining social and financial network information. Physica A: Statistical Mechanics and its Applications, 535, 122343. https://doi.org/10.1016/j.physa.2019.122343
Sang, C., & Di Pierro, M. (2019). Improving trading technical analysis with tensorflow long short-term memory (LSTM) neural network. The Journal of Finance and Data Science, 5(1), 1–11. https://doi.org/10.1016/j.jfds.2018.10.003
Song, Y., Lee, J. W., & Lee, J. (2022). Development of intelligent stock trading system using pattern independent predictor and turning point matrix. Computational Economics, 59(1), 27–38. https://doi.org/10.1007/s10614-020-10066-6
Statman, M. (2018). Behavioral efficient markets. The Journal of Portfolio Management, 44(3), 76–87. https://doi.org/10.3905/jpm.2018.44.3.076
Su, Z., Xie, H., & Han, L. (2020). Multi-factor RFG-LSTM algorithm for stock sequence predicting. Computational Economics, 57(4), 1041–1058. https://doi.org/10.1007/s10614-020-10008-2
Van Belle, R., Baesens, B., & De Weerdt, J. (2023). Catchm: A novel network-based credit card fraud detection method using node representation learning. Decision Support Systems, 164, 113866. https://doi.org/10.1016/j.dss.2022.113866
Yao, J., Partington, G., & Stevenson, M. (2005). Run length and the predictability of stock price reversals. Accounting and Finance, 45(4), 653–671. https://doi.org/10.1111/j.1467-629X.2005.00156.x
Zhou, F., Zhang, Q., Sornette, D., & Jiang, L. (2019). Cascading logistic regression onto gradient boosted decision trees for forecasting and trading stock indices. Applied Soft Computing, 84, 105747. https://doi.org/10.1016/j.asoc.2019.105747
Funding
This work was supported by [Zhejiang Provincial Philosophy and Social Sciences Project] (Grant Numbers [20NDJC225YB]).
Author information
Authors and Affiliations
Contributions
All authors contributed to the study conception and design. Material preparation, data collection and analysis were performed by Wenbin Hu and Junzi Zhou. The first draft of the manuscript was written by Wenbin Hu and all authors commented on previous versions of the manuscript. All authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Conflict of interest
The authors have no relevant financial or non-financial interests to disclose.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendix
Appendix
1.1 Detailed Experimental Results
This section provides the detailed experimental results on both training dataset and testing dataset for the DEMA, MACD and RSI strategies. The enhanced strategies are all built with the Cox PH model and the MST filtering method.
Table 9 reports the backtesting results of the OTSs. There is no hyper-parameter for the OTSs, so that all the periods are out of sample. Tables 10, 11 and 12 list the results of hyper-parameter tuning for the three enhanced strategies. For each strategy, there are three \(\alpha _M\) values, the best parameter is the one that has the best performance on the training dataset, which is in sample. E.g., in Table 10, \(\alpha _M=0.45\) have the best mean Shape and Calmar values on the four periods of training dataset. Each of the other two values only has one best metrics. As a result, \(\alpha _M=0.45\) is the selected hyper-parameter. However, the strategy with this selected parameter does not necessarily have the best performance on the testing dataset, which is out of sample. E.g., in Table 11, \(\alpha _M=0.44\) is selected, but \(\alpha _M=0.4\) has the best performance on the testing dataset.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Hu, W., Zhou, J. Trading Signal Survival Analysis: A Framework for Enhancing Technical Analysis Strategies in Stock Markets. Comput Econ (2024). https://doi.org/10.1007/s10614-024-10567-8
Accepted:
Published:
DOI: https://doi.org/10.1007/s10614-024-10567-8