IDEAS home Printed from https://ideas.repec.org/a/bjc/journl/v8y2022i6p107-111.html
   My bibliography  Save this article

Predicting Stock Price in Python Using TensorFlow and Keras

Author

Listed:
  • Orlunwo Placida Orochi

    (Computer Science Department, Ignatius Ajuru University of Education)

  • Ledesi Kabari

    (Computer Science Department, Ignatius Ajuru University of Education)

Abstract

One of the most important practices in the financial world is stock trading. The act of attempting to forecast the future value of a stock or other financial instrument listed on a stock exchange is known as stock market prediction. This paper discusses how Machine Learning can be used to predict a stock’s price. When it comes to stock forecasts, most stockbrokers use technical and fundamental analysis, as well as time series analysis. Python is the programming language used to forecast the stock market. In this paper, we propose a Machine Learning (ML) method that will be trained using publicly accessible stock data to obtain intelligence, and then use that intelligence to make an accurate prediction. In this context, this research builds a neural network in TensorFlow and Keras that predicts stock market, which is basically a Python scraper that extracts finance data from the Yahoo Finance platform; more precisely, a Recurrent Neural Network with LSTM cells was constructed, which is the current state-of-the-art in time series forecasting.

Suggested Citation

  • Orlunwo Placida Orochi & Ledesi Kabari, 2021. "Predicting Stock Price in Python Using TensorFlow and Keras," International Journal of Research and Scientific Innovation, International Journal of Research and Scientific Innovation (IJRSI), vol. 8(6), pages 107-111, June.
  • Handle: RePEc:bjc:journl:v:8:y:2022:i:6:p:107-111
    as

    Download full text from publisher

    File URL: https://www.rsisinternational.org/journals/ijrsi/digital-library/volume-8-issue-6/107-111.pdf
    Download Restriction: no

    File URL: https://www.rsisinternational.org/virtual-library/papers/predicting-stock-price-in-python-using-tensor-flow-and-keras/
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Fischer, Thomas & Krauss, Christopher, 2018. "Deep learning with long short-term memory networks for financial market predictions," European Journal of Operational Research, Elsevier, vol. 270(2), pages 654-669.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Wei Dai & Yuan An & Wen Long, 2021. "Price change prediction of ultra high frequency financial data based on temporal convolutional network," Papers 2107.00261, arXiv.org.
    2. Shao, Zhen & Zheng, Qingru & Yang, Shanlin & Gao, Fei & Cheng, Manli & Zhang, Qiang & Liu, Chen, 2020. "Modeling and forecasting the electricity clearing price: A novel BELM based pattern classification framework and a comparative analytic study on multi-layer BELM and LSTM," Energy Economics, Elsevier, vol. 86(C).
    3. Erdinc Akyildirim & Oguzhan Cepni & Shaen Corbet & Gazi Salah Uddin, 2023. "Forecasting mid-price movement of Bitcoin futures using machine learning," Annals of Operations Research, Springer, vol. 330(1), pages 553-584, November.
    4. Yang Dexiang & Mu Shengdong & Yunjie Liu & Gu Jijian & Lien Chaolung, 2023. "An Improved Deep-Learning-Based Financial Market Forecasting Model in the Digital Economy," Mathematics, MDPI, vol. 11(6), pages 1-18, March.
    5. Xiaohua Zeng & Changzhou Liang & Qian Yang & Fei Wang & Jieping Cai, 2025. "Enhancing stock index prediction: A hybrid LSTM-PSO model for improved forecasting accuracy," PLOS ONE, Public Library of Science, vol. 20(1), pages 1-31, January.
    6. Kamaladdin Fataliyev & Aneesh Chivukula & Mukesh Prasad & Wei Liu, 2021. "Stock Market Analysis with Text Data: A Review," Papers 2106.12985, arXiv.org, revised Jul 2021.
    7. Bartram, Söhnke & Branke, Jürgen & Motahari, Mehrshad, 2020. "Artificial Intelligence in Asset Management," CEPR Discussion Papers 14525, C.E.P.R. Discussion Papers.
    8. Frédy Pokou & Jules Sadefo Kamdem & François Benhmad, 2024. "Hybridization of ARIMA with Learning Models for Forecasting of Stock Market Time Series," Computational Economics, Springer;Society for Computational Economics, vol. 63(4), pages 1349-1399, April.
    9. Hyungjun Park & Min Kyu Sim & Dong Gu Choi, 2019. "An intelligent financial portfolio trading strategy using deep Q-learning," Papers 1907.03665, arXiv.org, revised Nov 2019.
    10. Giacomo di Tollo & Joseph Andria & Gianni Filograsso, 2023. "The Predictive Power of Social Media Sentiment: Evidence from Cryptocurrencies and Stock Markets Using NLP and Stochastic ANNs," Mathematics, MDPI, vol. 11(16), pages 1-18, August.
    11. Hu, Xiao & Kang, Siqin & Ren, Long & Zhu, Shaokeng, 2024. "Interactive preference analysis: A reinforcement learning framework," European Journal of Operational Research, Elsevier, vol. 319(3), pages 983-998.
    12. Wang, Jianzhou & Lv, Mengzheng & Wang, Shuai & Gao, Jialu & Zhao, Yang & Wang, Qiangqiang, 2024. "Can multi-period auto-portfolio systems improve returns? Evidence from Chinese and U.S. stock markets," International Review of Financial Analysis, Elsevier, vol. 95(PB).
    13. Ghosh, Indranil & Chaudhuri, Tamal Datta & Alfaro-Cortés, Esteban & Gámez, Matías & García, Noelia, 2022. "A hybrid approach to forecasting futures prices with simultaneous consideration of optimality in ensemble feature selection and advanced artificial intelligence," Technological Forecasting and Social Change, Elsevier, vol. 181(C).
    14. Gergana Taneva-Angelova & Stefan Raychev & Galina Ilieva, 2025. "A Framework for Gold Price Prediction Combining Classical and Intelligent Methods with Financial, Economic, and Sentiment Data Fusion," IJFS, MDPI, vol. 13(2), pages 1-25, June.
    15. Green, Lawrence & Sung, Ming-Chien & Ma, Tiejun & Johnson, Johnnie E. V., 2019. "To what extent can new web-based technology improve forecasts? Assessing the economic value of information derived from Virtual Globes and its rate of diffusion in a financial market," European Journal of Operational Research, Elsevier, vol. 278(1), pages 226-239.
    16. Zeynep Cipiloglu Yildiz & Selim Baha Yildiz, 2022. "A portfolio construction framework using LSTM‐based stock markets forecasting," International Journal of Finance & Economics, John Wiley & Sons, Ltd., vol. 27(2), pages 2356-2366, April.
    17. Shi, Yu & Song, Xianzhi & Song, Guofeng, 2021. "Productivity prediction of a multilateral-well geothermal system based on a long short-term memory and multi-layer perceptron combinational neural network," Applied Energy, Elsevier, vol. 282(PA).
    18. Sina Montazeri & Akram Mirzaeinia & Haseebullah Jumakhan & Amir Mirzaeinia, 2024. "CNN-DRL for Scalable Actions in Finance," Papers 2401.06179, arXiv.org.
    19. Nikolopoulos, Konstantinos & Punia, Sushil & Schäfers, Andreas & Tsinopoulos, Christos & Vasilakis, Chrysovalantis, 2021. "Forecasting and planning during a pandemic: COVID-19 growth rates, supply chain disruptions, and governmental decisions," European Journal of Operational Research, Elsevier, vol. 290(1), pages 99-115.
    20. Nosratabadi, Saeed & Mosavi, Amir & Duan, Puhong & Ghamisi, Pedram & Filip, Ferdinand & Band, Shahab S. & Reuter, Uwe & Gama, Joao & Gandomi, Amir H., 2020. "Data science in economics: comprehensive review of advanced machine learning and deep learning methods," FrenXiv e75gc_v1, Center for Open Science.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:bjc:journl:v:8:y:2022:i:6:p:107-111. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Dr. Renu Malsaria (email available below). General contact details of provider: https://rsisinternational.org/journals/ijrsi/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.