i'm working on SARIMAX model to predict stock market in python. I divided the data to training and testing data. After fitting my model on the training data, my goal is to predict the testing data (one step prediction)
When i add exogs to the model, it returns very accurate results, however, when i fit the model without exogs I got a straight line. I went throw some similar questions but i couldn't solve the problem. This is my code:
fitting the model
`mod1 = sm.tsa.statespace.SARIMAX(endog= ptrain,
exog = ftrain,
order=(1, 1, 0),
seasonal_order=(0, 0, 0, 12),
enforce_stationarity=False,
enforce_invertibility=False)
results1 = mod1.fit()`
Out of sample prediction
`prediction=results1.get_prediction(start=pd.to_datetime(ptrain.index[-1]),end=pd.to_datetime(ptest.index[-1]),exog= test)
` This is the plot i got[1]: https://i.stack.imgur.com/XDd6n.png
Any idea on how to do the prediction properly?