- Volume Force (VF) quantifies the strength of volume behind price movements by multiplying price change by volume and applying EMA smoothing with wa...
Volume Force (VF) quantifies the strength of volume behind price movements by multiplying price change by volume and applying EMA smoothing with warmup compensation. The result is a momentum-style oscillator that distinguishes between genuine volume-backed moves and hollow price action.
Unlike simple volume indicators that ignore direction, VF combines directional price change with volume intensity. Large volumes during significant price moves produce high VF readings; large volumes during flat price action contribute nothing. This selectivity makes VF particularly effective at filtering noise from signal.
## Historical Context
Volume Force derives from the concept of "Force Index" popularized by Alexander Elder in his 1993 book "Trading for a Living." Elder's original Force Index multiplied price change by volume without smoothing:
$$
Force_t = (Close_t - Close_{t-1}) \times Volume_t
$$
VF enhances this concept with EMA smoothing and warmup compensation, addressing two limitations of the raw Force Index:
1.**Noise sensitivity**: Raw Force Index is extremely volatile
2.**Initial bias**: Standard EMA starts with zero, creating warmup distortion
The warmup compensation technique ensures that early VF values aren't biased toward zero, providing accurate readings from the second bar onward. This makes VF suitable for both long-term trending analysis and short-term momentum assessment.
## Architecture & Physics
VF combines three components: price change calculation, volume weighting, and EMA smoothing with compensation.
### Component Breakdown
1.**Price Change**: Difference between current and previous close
2.**Raw VF**: Price change multiplied by volume (Force Index)
3.**EMA Smoothing**: Exponential moving average of raw VF
4.**Warmup Compensation**: Bias correction during initial period
### State Requirements
| Component | Type | Purpose |
| :--- | :--- | :--- |
| EmaValue | double | Smoothed VF value |
| E | double | Warmup decay factor (starts at 1) |
| PrevClose | double | Previous bar's close price |
| LastValidClose | double | Fallback for NaN handling |
| LastValidVolume | double | Fallback for NaN handling |
| Warmup | bool | Whether compensation is active |
| Index | int | Bar counter for IsHot |
### Warmup Compensation Mechanism
Standard EMA initialization biases early values toward zero:
VF validation focuses on internal consistency between streaming, batch, and span modes (verified with 1e-10 tolerance) and formula correctness against manual calculations.
## Common Pitfalls
1.**First Bar Is Always Zero**: VF requires a previous close to compute price change. The first bar returns 0 regardless of volume. This is correct behavior, not a bug.
2.**Period Selection**: Shorter periods (5-10) respond quickly but are noisy. Longer periods (20-50) smooth heavily but lag. Default of 14 balances responsiveness and smoothness.
3.**Scale Interpretation**: VF values are in "volume × price" units. A VF of 100,000 means different things for different instruments. Focus on direction and relative magnitude rather than absolute values.
4.**Zero Crossings**: VF oscillates around zero. Positive values indicate net buying pressure; negative indicates selling. Zero crossings can signal momentum shifts but generate noise in ranging markets.
5.**Volume Spikes**: Extreme volume events (earnings, news) can create VF spikes that distort the EMA. Consider whether such events should inform your analysis or be filtered.
6.**Warmup Period**: While warmup compensation provides accurate early values, IsHot only becomes true after `period` bars. This matches EMA convention for statistical significance.
7.**NaN Handling**: VF substitutes last valid values for NaN/Infinity inputs. This maintains continuity but can mask data quality issues. Monitor your data feed.
8.**isNew Parameter**: Bar correction (isNew = false) properly restores EMA state including the warmup decay factor. Incorrect usage corrupts the smoothing calculation.