Skip to content

Subtraction is one of the commonly used mathematical operations in quantitative trading, used to calculate the difference between two time series data.

Calculation Principle ​

Subtraction uses the following formula:

Result = Series1 - Series2

Where:

  • Series1: First input series
  • Series2: Second input series

Parameter Description ​

  • Input Parameters: Two K-line data series
  • Output: Difference between corresponding positions in both series

Usage Recommendations ​

  1. Ensure both input series have the same length
  2. Pay attention to data type consistency
  3. Consider the possibility of numerical overflow
  4. Handle missing values appropriately

Notes ​

  • Input series must be aligned
  • Pay attention to numerical precision issues
  • Consider the impact of extreme values
  • Pay attention to data preprocessing
  • Pay attention to sign handling