This article introduces how to use PyTorch Lightning and PyTorch Forecasting framework through MetaTrader5 trading platform to implement financial time series forecasting based on neural networks. It explains the reasons for choosing these two frameworks and the data format utilized. PyTorch Lightning is a deep learning framework that offers an efficient method for organizing and managing PyTorch code, while PyTorch Forecasting is a Python library specifically designed for time series forecasting. The article also provides detailed usage of the libraries and implementations of a variety of predictive models.