An Interpretable Random Forest Framework for Indian Stock Market Prediction
Abstract
The stock market is volatile to predict, especially when it comes to short term forecasting. In this study, we present a new way for stock price forecasting that uses Random Forests on the Indian stock market, along with historical OHLCV data and special indicators that help understanding the market. Simple Moving Average (SMA), Relative Strength Index (RSI) and Moving Average Convergence Divergence (MACD) are included in the proposed framework to capture market trends, momentum behaviour and short-term price fluctuations. The experiment was performed on a few stocks available in the NSE under different market conditions. The experiment was performed by taking a train-test ratio of 80:20 in the chronological order to maintain the dependencies of time and to avoid any bias while testing the model. The Random Forest classifier used was set up with 200 decision trees, a maximum depth of 12 and a minimum leaf of size 5. The proposed method gave a prediction accuracy with RMSE of 2.96, MAE of 2.21 and R2 score of 0.86, which improves the performance of the base model by 38.6%. The stock-wise validation shows that our approach is able to give predictions under different market conditions with RSI and MACD being important features.