jiewwantan / XGBoost_stock_prediction

XGBoost is known to be fast and achieve good prediction results as compared to the regular gradient boosting libraries. This project attempts to predict stock price direction by using the stock's daily data and indicators derived from its daily data as predictors. As such this is a classification problem.
24 stars 11 forks source link

your label function is incorrect #1

Open yffbit opened 5 years ago

yffbit commented 5 years ago

you should use the Return of next day, not the Return of current day. return (df['Returns'].shift(-seq_length) > 0).astype(int)

Robertliucd commented 5 years ago

you should use the Return of next day, not the Return of current day. return (df['Returns'].shift(-seq_length) > 0).astype(int)

yes,you should shift to next day,not current day to predict the returns