An LSTM module (or cell) has 5 essential components which allows it to model both long-term and short-term data. Hidden state (h t) – This is output state information calculated w.r.t. current input, previous hidden state and current cell input which you eventually use to predict the future stock market prices .