Forecasting the stock market is a paramount challenge owing to its volatility and sensitivity and hence, precise prediction becomes essential for investors. This study solves the problem of index fund forecasting as well as anomaly detection, a twin problem that is mostly ignored in classical models. The significance is in facilitating improved risk management and investment choices. Hence creating a gap in comprehensive financial modeling.
Inspired by the necessity of a strong system incorporating these features, this research presents a new architecture that unites anomaly detection, forecasting. The process starts with preprocessing index fund data, then detects anomalies in a 2 layered anomaly detection module. The trend forecasting engine utilizes Stacked GRU and Holt-Winters models. Tests on Nifty Auto and Nifty Bank data sets yielded unique anomaly scores of 14.28 and 16.23 respectively out of 50, demonstrating the capability of the model to distinguish index behaviors. An MAPE score of 0.687 was observed on Nifty Pharma forecast while using Random Forest to combine predictions within the forecast engine.