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
Related
More Math Operators
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.
FAQ
Frequently Asked Questions
What is the Vector Subtraction (SUB) indicator?
Vector Arithmetic Substraction
How does SUB work?
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.
How do traders use SUB in their strategies?
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.
What are the key points to know about SUB?
Element-wise subtraction of two series Formula: Output = Series1 - Series2 Creates spreads and differences Foundation of most oscillators Essential for pairs trading strategies
Can I use SUB with Cryptorobot.ai?
Yes. Vector Subtraction (SUB) is available as a built-in indicator in Cryptorobot.ai. You can add it to any automated strategy using the no-code strategy builder, backtest it against historical data, and deploy it live on supported exchanges.

