The stock market can provide huge profits in a relatively short time in financial sector. However, it also has a high risk for investors and traders if they are not careful to look the factors that affect the stock market. Therefore, they should give attention to the dynamic fluctuations and movements of the stock market to optimize profits from their investment. In this paper, we present a nonlinear autoregressive exogenous model (NARX) to predict the movements of stock market especially the movements of the closing price index. As case study, we consider to predict the movement of the closing price in Indonesia composite index (IHSG) and choose the best structures of NARX for IHSG's prediction which the number of input neurons, neurons in its single layer, feedback delay, input delay and output neuron are 6, 10, 1, 2 and 1, respectively.