The unprecedented Corona Virus Disease (COVID-19) pandemic has put the world in peril and shifted global landscape in unanticipated ways. The SARSCoV2 virus, which caused the COVID-19 outbreak, first appeared in Wuhan, Hubei Province, China, in December 2019 and quickly spread around the world. This pandemic is not only a global health crisis, but it has caused the major global economic depression. As soon as the virus spread, stock market prices plummeted and volatility increased. Predicting the market during this outbreak has been of substantial importance and is the primary motivation to carry out this work. Given the nonlinearity and dynamic nature of stock data, the prediction of stock market is a challenging task. The machine learning models have proven to be a good choice for the development of effective and efficient prediction systems. In recent years, the application of hyperparameter optimization techniques for the development of highly accurate models has increased significantly. In this study, a customized neural network model is proposed and the power of hyperparameter optimization in modelling stock index prices is explored. A novel dataset is generated using nine standard technical indicators and COVID-19 data. In addition, the primary focus is on the importance of selection of optimal features and their preprocessing. The utilization of multiple feature ranking techniques combined with extensive hyperparameter optimization procedures is comprehensive for the prediction of stock index prices. Moreover, the model is evaluated by comparing it with other models, and results indicate that the proposed model outperforms other models. Given the detailed design methodology, preprocessing, exploratory feature analysis, and hyperparameter optimization procedures, this work gives a significant contribution to stock analysis research community during this pandemic.