Training N-HiTS Forecasts with Labeled Market Time Series
Summary
The article presents a workflow for preparing labeled market time series and training an N-HiTS forecasting model with PyTorch Lightning and PyTorch Forecasting. It retrieves M15 price data through MetaTrader 5, converts it to a dataframe, and adds time and series identifiers by dividing the input into fixed-length groups. It then adapts the dataset loader to control shuffling and incomplete batches, creates training and validation datasets, trains and selects a model, and plots forecasts and sampled prediction paths.
The approach is an implementation example, not a trading strategy evaluation. It uses a single gold instrument and depends on labels produced by earlier articles; the excerpt does not report forecast accuracy, trading returns, costs, or a comparison against simple baselines. The article also cites broad N-HiTS benchmark claims, but those do not establish performance on this specific market dataset. Model forecasts therefore require careful validation before any trading use.
Key ideas
- The workflow connects MetaTrader 5 data extraction to a PyTorch Forecasting time-series pipeline.
- The input is divided into fixed-length groups with generated time indices and series identifiers.
- A custom dataset class exposes controls for shuffling and dropping incomplete batches.
- The N-HiTS model is trained and visualized with validation forecasts and sampled paths.
- No market-specific forecast metrics or trading results are supplied in the excerpt.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.