Prediction of stock markets is a challenging problem because of the number of potential variables as well as unpredictable noise that may contribute to the resultant prices. However, the ability to analyze stock market trends could be invaluable to investors and researchers, and thus has been of continued interest. Numerous statistical and machine learning techniques have been explored for stock analysis and prediction. We present a comparative study of two very promising artificial neural network models namely a Long Short-Term Memory (LSTM) recurrent neural network (RNN) and a deep neural network (DNN) in forecasting the daily and weekly movements of the Indian BSE Sensex index. With both networks, measures were taken to reduce overfitting. Daily predictions of the Tech Mahindra (NSE: TECHM) stock price were made to test the generalizability of the models. Both networks performed well at making daily predictions, and both generalized well to make daily predictions of the Tech Mahindra data. The LSTM RNN outperformed the DNN in terms of weekly predictions and thus, holds more promise for making longer term predictions.