Leakage-Safe Normalization of Trading Volume Features
Summary
The document considers how to normalize daily trading volume and value for stock time-series models, including recurrent neural networks. It contrasts whole-series statistics such as global minimum, maximum, mean, and standard deviation with normalization that adapts to a stock’s changing local regimes. It also asks whether first and second differences can capture changes in trading activity.
The response focuses on avoiding look-ahead leakage: a feature at a given date must be normalized only with information available by that date. This rules out using later observations from the full series or from the end of a cycle to scale earlier values. It suggests that past-only normalization can be applied at each time point and notes that differencing is commonly used to reduce non-stationarity. No specific window, scaling formula, model comparison, or performance evidence is provided, so the guidance establishes a sound temporal constraint but leaves implementation choices to the researcher.
Key ideas
- Normalization at each date must use only information available at that time.
- Whole-series statistics can leak future values into earlier feature transformations.
- Local cycle normalization also creates look-ahead bias if it uses data from later in the cycle.
- Past-only normalization and differencing are possible ways to represent changing volume and value series.
- The document gives no empirical comparison of normalization methods or downstream model performance.
Tags
Full text
# Normalise daily trading volume/value # Normalise daily trading volume/value How to normalise daily trading volume and trading value as features for RNN model of stock time series? The immediate answer could be: taking the global min/max, mean/std for each stock across the whole time series window, normalise the daily volume/value of the corresponding stock, stock by stock. However, during each stock cycle, the trading volume/value range in the particular cycle could vary drastically compared to other cycles, in all these “local” window of a given stock, does it make sense to find dynamic local min/max, mean/std for local normalisation? Or, does it make sense to calculate derivatives of volume/value, 1st and 2nd orders to capture and velocity and acceleration of the market capital flow? ## Answer by zer0hedge (score 4) https://quant.stackexchange.com/a/33676 You must not use "tomorrow"'s data to normalize "today"'s one. So it is not a good idea to use global min/max, mean/std ... across the whole time series window. The same true is for "cycles" - you can't use data from the end of the cycle to normalize data in the beginning of the cycle. So, at every time point of your time series you may do any kind of normalization if you are using data which were known before that point. It does make sense to use derivatives. The operations is usually called differencing in time series literature and is used to transform non-stationary series into a stationary one, for example. See, for example here p.76 "Differencing"
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.