[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-124771-en":3,"doc-seo-124771-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":27,"seo_description":14,"update_tm":28,"read_time":29},124771,1649267921044,"Ava Thompson","https://us-avatar.wpscdn.com/avatar/1800007509477c92dfb?_k=1782875107921204101",8,"Research & Report","Using Hybrid Machine learning Models for Stock Price Forecasting and Trading - A Thesis Submitted by Ahmed Khalil","Trading stocks of publicly traded companies in stock markets is a demanding problem because investors aim to maximize returns while limiting risks. Research therefore integrates fundamental and technical analysis and increasingly applies machine learning and algorithmic trading, leveraging large data volumes for price forecasting and execution. This study uses four machine learning models—LSTM, W-LSTM, LSTM-ARO, and W-LSTM-ARO—to predict next-day prices, evaluate accuracy with MSE, MAE and R2, and assess profit generation across six NYSE-listed companies.","American University in Cairo  \nAUC Knowledge Fountain  \n\n| Theses and Dissertations | Student Research |\n| --- | --- |\n| Spring 5-8-2024\u003Cbr>Using Hybrid Machine learning Models for Stock Price Forecasting and Trading.\u003Cbr>Ahmed Khalil\u003Cbr>[aawkhalil@aucegypt.edu](aawkhalil@aucegypt.edu)\u003Cbr>Follow this and additional works at: [https://fount.aucegypt.edu/etds](https://fount.aucegypt.edu/etds)\u003Cbr> Part of the Business Intelligence Commons, Management Information Systems Commons, and the Portfolio and Security Analysis Commons |  |\n\nRecommended Citation  \nAPA Citation  \nKhalil, A. (2024) . Using Hybrid Machine learning Models for Stock Price Forecasting and Trading. [Master's Thesis, the American University in Cairo] . AUC Knowledge Fountain.  \n[https://fount.aucegypt.edu/etds/2285](https://fount.aucegypt.edu/etds/2285)  \nMLA Citation  \nKhalil, Ahmed. Using Hybrid Machine learning Models for Stock Price Forecasting and Trading.. 2024. American University in Cairo, Master's Thesis. AUC Knowledge Fountain.  \n[https://fount.aucegypt.edu/etds/2285](https://fount.aucegypt.edu/etds/2285)  \nThis Master's Thesis is brought to you for free and open access by the Student Research at AUC Knowledge Fountain. It has been accepted for inclusion in Theses and Dissertations by an authorized administrator of AUC Knowledge Fountain. For more information, please contact [thesisadmin@aucegypt.edu](thesisadmin@aucegypt.edu).  \nUsing hybrid Machine learning models for stock price forecasting and trading.  \nA Thesis Submitted by  \nAhmed Khalil  \nto the  \nMasters of Science in Finance  \nGraduate Program  \n5th of February 2024  \nIn partial fulfillment of the requirements for the degree of  \nMasters  \nTable of content  \nChapter one: Introduction 5  \nChapter two: Literature review 8  \nChapter three: Data & Methodology 12  \n3.1 Models 12  \n3.1.1 LSTM 12  \n3.1.2 W-LSTM 13  \n3.1.3 LSTM-ARO 14  \n3.1.4 W-LSTM-ARO 14  \n3.2 LSTM Hyperparameters 14  \n3.3 Data Set 15  \n3.4 Evaluation criteria: 16  \n3.4.1 Mean Absolute Error (MAE) 16  \n3.4.2 R-Squared score (R2) 16  \n3.4.3 Mean Squared Error (MSE) 17  \n3.5 Trading strategies: 17  \n3.5.1 Machine learning trading signals 17  \n3.5.2 Technical Indicator EMA signals 17  \n3.5.3 Technical Indicator RSI signals 17  \nChapter four: Discussion & Results 18  \nChapter five: Conclusion and future work 25  \nReferences 27  \nAppendix 30  \nFig1: LSTM Model forecasting price against real price. 30  \nFig2: W-LSTM Model forecasting price against real price 30  \nFig3: LSTM-ARO Model forecasting price against real price 31  \nFig4: W-LSTM-ARO Model forecasting price against real price 31  \nFig5: Mean Absolute Error (MAE) 32  \nFig6: Mean Squared Error (MSE) 32  \nFig7: R-Squared (R2) 32  \nFig8: Trading revenues/losses generated by machine learning models. 33  \nFig9: Trading revenues/losses generated by machine learning models and other trading strategies. 33  \nPython Libraries used. 34  \nCalculating EMA & RSI technical indicators 34  \nWavelet decomposition code. 34  \nPreparing data for LSTM Model 35  \nEarly stop configuration 36  \nARO model 36  \nLSTM Model 38  \nAbstract:  \nTrading stocks of publicly traded companies in stock markets is a challenging topic since investors are researching what tools can be used to maximize their profits while minimizing risks, which encouraged all researchers to research and test different methods to reach such goal. As a result, the use of both fundamental analysis and technical analysis started to evolve to support traders in buying and selling stocks. Recently, the focus increased on using Machine learning models to predict stock prices and algorithmic trading as currently there is a huge amount of data that can be processed and used to forecast and trade stocks.  \nThe focus of this paper is to use four machine learning models to forecast next day stock prices and trade stocks accordingly. The models used are LSTM model, W-LSTM model in which Wavelet analysis is used to remove the noise of the time series dat","cbCaioQwXHXCy81o","https://ap.wps.com/l/cbCaioQwXHXCy81o","pdf",1006868,1,40,"English","en",105,"# Chapter one: Introduction\n# Chapter two: Literature review\n# Chapter three: Data & Methodology\n## 3.1 Models\n## 3.2 LSTM Hyperparameters\n## 3.3 Data Set\n## 3.4 Evaluation criteria\n## 3.5 Trading strategies\n# Chapter four: Discussion & Results\n# Chapter five: Conclusion and future work\n# References\n# Appendix","[{\"question\":\"What is the core goal of the thesis?\",\"answer\":\"To use hybrid machine learning models to forecast next-day stock prices and trade accordingly, then evaluate both prediction quality and profit generation.\"},{\"question\":\"Which machine learning models are used for forecasting?\",\"answer\":\"LSTM, W-LSTM, LSTM-ARO, and W-LSTM-ARO, where wavelet analysis removes noise and ARO optimization selects hyperparameters.\"},{\"question\":\"How are model predictions evaluated and how are trading strategies tested?\",\"answer\":\"Accuracy is measured using MSE, MAE, and R2, and trading performance is assessed by comparing revenues or losses generated by the models against other strategies such as buy-and-hold, RSI, and EMA.\"}]","Using Hybrid Machine learning Models for Stock Price Forecasting and Trading - A Thesis Submitted by Ahmed Khalil | PDF",1785894470,101,{"code":4,"msg":31,"data":32},"ok",{"site_id":24,"language":23,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"using-hybrid-machine-learning-models-for-stock-price-forecasting-and-trading-a-thesis-submitted-by-ahmed-khalil","",{"@graph":36,"@context":85},[37,54,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/research-report/",3,{"item":52,"name":13,"@type":43,"position":53},"https://docshare.wps.com/document/using-hybrid-machine-learning-models-for-stock-price-forecasting-and-trading-a-thesis-submitted-by-ahmed-khalil/124771/",4,{"url":52,"name":13,"@type":55,"author":56,"headline":13,"publisher":58,"fileFormat":61,"inLanguage":23,"description":14,"dateModified":62,"datePublished":62,"encodingFormat":61,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":57},"Person",{"url":41,"name":59,"@type":60},"DocShare","Organization","application/pdf","2026-08-05",true,{"@type":65,"interactionType":66,"userInteractionCount":4},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What is the core goal of the thesis?","Question",{"text":75,"@type":76},"To use hybrid machine learning models to forecast next-day stock prices and trade accordingly, then evaluate both prediction quality and profit generation.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"Which machine learning models are used for forecasting?",{"text":80,"@type":76},"LSTM, W-LSTM, LSTM-ARO, and W-LSTM-ARO, where wavelet analysis removes noise and ARO optimization selects hyperparameters.",{"name":82,"@type":73,"acceptedAnswer":83},"How are model predictions evaluated and how are trading strategies tested?",{"text":84,"@type":76},"Accuracy is measured using MSE, MAE, and R2, and trading performance is assessed by comparing revenues or losses generated by the models against other strategies such as buy-and-hold, RSI, and EMA.","https://schema.org",{"og:url":52,"og:type":87,"og:title":13,"og:site_name":59,"og:description":14},"article",{"robots":89,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,119,122,127,130,134],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":53,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":21,"slug":118},7,"Healthcare","healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":120,"slug":121},30,"research-report",{"id":123,"doc_module":4,"doc_module_name":46,"category_name":124,"show_sort_weight":125,"slug":126},9,"Religion & Spirituality",20,"religion-spirituality",{"id":125,"doc_module":4,"doc_module_name":46,"category_name":128,"show_sort_weight":125,"slug":129},"World Cup","world-cup",{"id":131,"doc_module":4,"doc_module_name":46,"category_name":132,"show_sort_weight":131,"slug":133},10,"Lifestyle","lifestyle",{"id":135,"doc_module":4,"doc_module_name":46,"category_name":136,"show_sort_weight":106,"slug":137},19,"General","general"]