Perbandingan Metode Q-Learning Dan SARSA Dalam Optimasi Prediksi Tren Saham Pada Indeks Harga Saham Gabungan (IDX)

Authors

  • Muhammad Affarel Universitas Bina Sarana Informatika
  • Fikri Ikhsan Ramadhan Universitas Bina Sarana Informatika
  • Nugroho Aldi Prayoga Universitas Bina Sarana Informatika

DOI:

https://doi.org/10.37859/jf.v15i3.10596
Keywords: Reinforcement Learning, Q-Learning, SARSA, Trading, Optimatization

Abstract

This study evaluates the performance of Reinforcement Learning algorithms, namely Q-Learning and SARSA, in generating automated trading strategies for the Indonesian stock market. The research is motivated by the high volatility and uncertainty of stock price movements, which require adaptive decision-making methods. The dataset consists of historical stock price data from five companies listed on the Indonesia Stock Exchange (BBCA, BBRI, TLKM, UNVR, and ASII), obtained using the yfinance library and simulated through 1,000 trading episodes. Performance evaluation was conducted based on reward trends, equity curve patterns, and final performance statistics to assess learning effectiveness under different market conditions. The results indicate that Q-Learning performs better on stocks with strong price momentum due to its more aggressive exploration behavior, while SARSA provides more stable performance in highly volatile markets owing to its conservative on-policy approach. Overall, neither algorithm demonstrates absolute dominance; instead, each offers distinct advantages depending on stock characteristics and risk profiles. These findings highlight the potential of Reinforcement Learning for the development of algorithmic trading strategies in the Indonesian stock market.

Downloads

Download data is not yet available.

References

O. V. Zaporozhets, O. V. Okhrimenko, and O. V. Levchenko, “Digital methods of technical analysis for diagnosis of crisis phenomena in the financial market,” International Journal of Technology, vol. 13, no. 7, pp. 1527–1536, 2022, doi: 10.14716/ijtech.v13i7.6187.

X. Chen, B. Xu, Y. Li, and Y. Gao, “A stock prediction method based on deep reinforcement learning and sentiment analysis,” Applied Sciences, vol. 14, no. 19, p. 8747, 2024. [Online]. Available: https://www.mdpi.com/2076-3417/14/19/8747

R. J. Elliott and R. Mamon, “Portfolio management system in equity market neutral using reinforcement learning,” Applied Intelligence, vol. 52, pp. 1–17, 2021, doi: 10.1007/s10489-021-02262-0.

D. Antic, “Application of Q-learning in financial markets: Modelling and experimental results,” International Education and Research Journal, vol. 7, no. 9, pp. 10–14, 2021. [Online]. Available:https://ierj.in/journal/index.php/ierj/article/view/4529/5337

A. R. T. C. Mandala, I. M. A. Pura, and G. Mahardika, “Application of deep reinforcement learning for stock trading on the Indonesia Stock Exchange,” JANAPATI, vol. 12, no. 1, pp. 55–67, 2023. [Online]. Available:https://ejournal.undiksha.ac.id/index.php/janapati/article/view/83775

A. Brim and N. S. Flann, “Deep reinforcement learning stock market trading utilizing a CNN with candlestick images,” PLOS ONE, vol. 17, no. 2, 2022. [Online]. Available: https://journals.plos.org/plosone/article?id=10.1371/pone.0263181

Y. Jiang, C. Xu, X. Ji, and Y. Li, “A multi-scaling reinforcement learning trading system based on multi-scaling convolutional neural networks,” Mathematics, vol. 11, no. 11, p. 2467, 2023. [Online]. Available: https://www.mdpi.com/2227-7390/11/11/2467

M. Ghoreishi and S. Jafari, “Deep reinforcement learning for Tehran stock trading,” Journal of New Engineering Science and Technology, vol. 2, no. 3, pp. 55–66, 2022. [Online]. Available: https://journal.iistr.org/index.php/JNEST/article/view/171/125

T. Kabbani and E. Duman, “Deep reinforcement learning approach for trading automation in the stock market,” IEEE Access, vol. 10, pp. 96841–96854, 2022, doi: 10.1109/ACCESS.2022.3203697.

A. Rahman and B. Sitohang, “Reinforcement learning for bitcoin trading: A comparative study of PPO and DQN,” Jurnal Mandiri, vol. 6, no. 2, pp. 501–512, 2023. [Online]. Available: https://ejournal.isha.or.id/index.php/Mandiri/article/view/455/457

A. S. Perera, A. A. Perera, and D. Dias, “Deep reinforcement learning for trading—A critical survey,” Data, vol. 6, no. 11, p. 119, 2021. [Online]. Available: https://www.mdpi.com/2306-5729/6/11/119

M. López de Prado, Financial Machine Learning. SSRN, 2023. [Online]. Available:https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4501707

A. Kolm and G. Ritter, Foundations of Reinforcement Learning with Applications in Finance. Stanford University, 2021. [Online]. Available: https://stanford.edu/~ashlearn/RLForFinanceBook/book.pdf

Y. Wang, Y. Wu, and Z. Zhang, “Stock trading strategies based on deep reinforcement learning,” Computational Intelligence and Neuroscience, vol. 2022, pp. 1–15, 2022, doi: 10.1155/2022/4698656.

M. Liu, Z. Wang, and J. Zhang, “A deep Q-learning portfolio management framework for the cryptocurrency market,” Neural Computing and Applications, vol. 34, pp. 1–15, 2022, doi: 10.1007/s00521-020-05359-8.

Downloads

Published

2025-12-31