In financial high-frequency data, duration data can reflect the transaction intensity and liquidity of financial market, so the prediction of duration is a research hotspot in the financial field in recent years. With the development of machine learning, it is more and more common to apply machine learning method to the research of financial field. This paper screens evaluation indicators via XGBoost and then optimizes the BP neural network with genetic algorithm. Meanwhile, it introduces the duration average high-low spread, duration average absolute return, duration average trading volume, position at time point and trading density as the microstructure variables to build the prediction model of the price duration of Shanghai 50ETF options. It is found that the introduction of genetic algorithm can improve the prediction accuracy and efficiency of BP neural network, and the evaluation indexes MSE, RMSE, and MAE are reduced by 74.14%, 49.41% and 38.82% respectively, with the operation time reduced by 33.25%. This method provides a new research idea for the prediction of high-frequency price duration, and enriches the theoretical research of machine learning method in the field of option high-frequency data prediction.