TrendFormer: Two-Stage Trend Fusion for Financial Time Series Forecasting Using Transformers

Main Article Content

Shihao Sun

Abstract

This paper addresses key challenges in stock price sequence modeling, including trend entanglement, complex temporal dependencies, and limited training samples in financial markets. A two-stage Transformer prediction method is proposed to separate and model long-term and short-term trends. The method consists of a self-supervised pretraining stage and a supervised fine-tuning stage. In pretraining, two tasks are designed: trend reconstruction and temporal ordering. These tasks aim to capture the global evolution structure and local temporal relationships in price sequences. During fine-tuning, the model performs closing price regression based on the fused representations, reinforcing the structural consistency between trend encoding and target prediction. In terms of encoder architecture, the model adopts a dual-channel design for long-term and short-term modeling. It uses global and local Transformer modules to capture features at different temporal scales. A trend alignment and fusion mechanism is introduced to integrate multi-granularity representations. To validate the effectiveness of the method, a series of sensitivity and robustness experiments are conducted. The evaluations cover factors such as time window length, training data ratio, activation function selection, and noise injection. The results show that the proposed method outperforms existing sequence modeling approaches in accuracy, stability, and structural awareness. It is better suited for forecasting tasks under complex price environments.

Article Details

Section

Articles