Math Operators

Vector Subtraction (SUB)

Vector Arithmetic Substraction

Deep Dive

Everything You Need to Know

Under the Hood

How It Works

SUB performs element-wise subtraction of two data series: Output[i] = Input1[i] - Input2[i]. This mathematical utility is fundamental for calculating spreads, differences, and oscillators. Most oscillators (like MACD) are essentially subtraction operations. SUB enables explicit difference calculations between any two series.

In Practice

How Traders Use It

Developers use SUB for creating spread indicators, calculating price differences between assets, or building custom oscillators. Essential for pairs trading (price1 - price2), relative performance tracking, and any strategy based on divergences or differences. SUB is the foundation of most momentum and oscillator indicators.

Highlights

SUB at a Glance

Element-wise subtraction of two series
Formula: Output = Series1 - Series2
Creates spreads and differences
Foundation of most oscillators
Essential for pairs trading strategies

Get Started

Automate SUB with cryptorobot.ai

Build automated strategies using Vector Subtraction and hundreds of other indicators. Connect to your favourite exchange and let the bot execute trades 24/7 — no code required.