Tulip Indicators is **fast**.

Below are benchmark numbers comparing TI indicator function performance with
TA-Lib version 0.4. The values are
millions of bars processed per second. Each value is taken as the best of 1 runs. **Higher numbers are
better.**

Identifier |
Indicator Name |
TI |
TA-Lib |
Result |

abs | Vector Absolute Value | 2,556 | - | - |

acos | Vector Arccosine | 8 | 8 | *tie* |

ad | Accumulation/Distribution Line | 225 | 222 | *tie* |

add | Vector Addition | 2,261 | 1,547 | TI is 46% faster |

adosc | Accumulation/Distribution Oscillator | 207 | 223 | *tie* |

adx | Average Directional Movement Index | 64 | 32 | TI is 100% faster |

adxr | Average Directional Movement Rating | 50 | 31 | TI is 61% faster |

ao | Awesome Oscillator | 506 | - | - |

apo | Absolute Price Oscillator | 337 | 157 | TI is 114% faster |

aroon | Aroon | 79 | 79 | *tie* |

aroonosc | Aroon Oscillator | 87 | 87 | *tie* |

asin | Vector Arcsine | 8 | 8 | *tie* |

atan | Vector Arctangent | 16 | 16 | *tie* |

atr | Average True Range | 202 | 74 | TI is 172% faster |

avgprice | Average Price | 1,306 | 744 | TI is 75% faster |

bbands | Bollinger Bands | 216 | 59 | TI is 266% faster |

bop | Balance of Power | 222 | 221 | *tie* |

cci | Commodity Channel Index | 18 | 8 | TI is 125% faster |

ceil | Vector Ceiling | 74 | 76 | *tie* |

cmo | Chande Momentum Oscillator | 90 | - | - |

cos | Vector Cosine | 21 | 20 | *tie* |

cosh | Vector Hyperbolic Cosine | 18 | 18 | *tie* |

crossany | Crossany | 653 | - | - |

crossover | Crossover | 1,130 | - | - |

cvi | Chaikins Volatility | 224 | - | - |

decay | Linear Decay | 374 | - | - |

dema | Double Exponential Moving Average | 420 | 153 | TI is 174% faster |

di | Directional Indicator | 86 | 74 | TI is 16% faster |

div | Vector Division | 223 | 221 | *tie* |

dm | Directional Movement | 186 | 140 | TI is 32% faster |

dpo | Detrended Price Oscillator | 618 | - | - |

dx | Directional Movement Index | 68 | 37 | TI is 83% faster |

edecay | Exponential Decay | 352 | - | - |

ema | Exponential Moving Average | 334 | 339 | *tie* |

emv | Ease of Movement | 74 | - | - |

exp | Vector Exponential | 22 | 22 | *tie* |

fisher | Fisher Transform | 15 | - | - |

floor | Vector Floor | 75 | 74 | *tie* |

fosc | Forecast Oscillator | 227 | - | - |

hma | Hull Moving Average | 65 | - | - |

kama | Kaufman Adaptive Moving Average | 225 | 170 | TI is 32% faster |

kvo | Klinger Volume Oscillator | 119 | - | - |

lag | Lag | 3,094 | - | - |

linreg | Linear Regression | 337 | 14 | TI is 2,307% faster |

linregintercept | Linear Regression Intercept | 360 | 15 | TI is 2,300% faster |

linregslope | Linear Regression Slope | 506 | 16 | TI is 3,062% faster |

ln | Vector Natural Log | 28 | 28 | *tie* |

log10 | Vector Base-10 Log | 28 | 28 | *tie* |

macd | Moving Average Convergence/Divergence | 316 | 96 | TI is 229% faster |

marketfi | Market Facilitation Index | 222 | - | - |

mass | Mass Index | 202 | - | - |

max | Maximum In Period | 221 | 212 | *tie* |

md | Mean Deviation Over Period | 19 | - | - |

medprice | Median Price | 2,027 | 1,589 | TI is 27% faster |

mfi | Money Flow Index | 91 | 97 | *tie* |

min | Minimum In Period | 190 | 173 | TI is 9% faster |

mom | Momentum | 2,352 | 1,278 | TI is 84% faster |

mul | Vector Multiplication | 2,261 | 1,507 | TI is 50% faster |

natr | Normalized Average True Range | 173 | 63 | TI is 174% faster |

nvi | Negative Volume Index | 426 | - | - |

obv | On Balance Volume | 367 | 334 | TI is 9% faster |

ppo | Percentage Price Oscillator | 225 | 96 | TI is 134% faster |

psar | Parabolic SAR | 131 | 139 | *tie* |

pvi | Positive Volume Index | 429 | - | - |

qstick | Qstick | 668 | - | - |

roc | Rate of Change | 227 | 225 | *tie* |

rocr | Rate of Change Ratio | 227 | 229 | *tie* |

round | Vector Round | 75 | - | - |

rsi | Relative Strength Index | 212 | 77 | TI is 175% faster |

sin | Vector Sine | 20 | 21 | *tie* |

sinh | Vector Hyperbolic Sine | 18 | 18 | *tie* |

sma | Simple Moving Average | 653 | 230 | TI is 183% faster |

sqrt | Vector Square Root | 235 | 235 | *tie* |

stddev | Standard Deviation Over Period | 231 | 78 | TI is 196% faster |

stderr | Standard Error Over Period | 221 | - | - |

stoch | Stochastic Oscillator | 50 | 50 | *tie* |

stochrsi | Stochastic RSI | 51 | 36 | TI is 41% faster |

sub | Vector Subtraction | 2,261 | 1,589 | TI is 42% faster |

sum | Sum Over Period | 683 | 582 | TI is 17% faster |

tan | Vector Tangent | 18 | 18 | *tie* |

tanh | Vector Hyperbolic Tangent | 30 | 30 | *tie* |

tema | Triple Exponential Moving Average | 326 | 106 | TI is 207% faster |

todeg | Vector Degree Conversion | 2,672 | - | - |

torad | Vector Radian Conversion | 2,556 | - | - |

tr | True Range | 212 | 185 | TI is 14% faster |

trima | Triangular Moving Average | 452 | 448 | *tie* |

trix | Trix | 227 | 77 | TI is 194% faster |

trunc | Vector Truncate | 494 | - | - |

tsf | Time Series Forecast | 360 | 15 | TI is 2,300% faster |

typprice | Typical Price | 1,547 | 226 | TI is 584% faster |

ultosc | Ultimate Oscillator | 46 | 24 | TI is 91% faster |

var | Variance Over Period | 565 | 117 | TI is 382% faster |

vhf | Vertical Horizontal Filter | 83 | - | - |

vidya | Variable Index Dynamic Average | 79 | - | - |

volatility | Annualized Historical Volatility | 77 | - | - |

vosc | Volume Oscillator | 230 | - | - |

vwma | Volume Weighted Moving Average | 227 | - | - |

wad | Williams Accumulation/Distribution | 213 | - | - |

wcprice | Weighted Close Price | 1,200 | 933 | TI is 28% faster |

wilders | Wilders Smoothing | 339 | - | - |

willr | Williams %R | 76 | 72 | *tie* |

wma | Weighted Moving Average | 226 | 227 | *tie* |

zlema | Zero-Lag Exponential Moving Average | 369 | - | - |

All numbers are generated from the benchmark program included in the Tulip
Indicators source distribution. The missing numbers in the TA-Lib column
represents functions that only TI implements. Functions that only TA-Lib
implements aren't tested.

It is worth pointing out that the benchmark program also compares the output from the two libraries.
They must match for the benchmark to succeed (otherwise it wouldn't be a fair test).
This is only a small part of the rigorous testing that TI has been subjected to.

Considering only the functions that both TI and TA-Lib implement, the total
time to run the entire benchmark suite is presented below. **Lower is better.**

TI |
TA-Lib |

64,358 ms | 92,616 ms |

That is, TI on average is 44% faster than TA-Lib.

The primary goal of TI was to implement a clean easy-to-use interface with straight-forward and reliable code.
Performance optimization takes a backseat to those goals. Where TI is much faster than TA-Lib, it is usually
because TI uses a better algorithm. For example, TI does Linear Regression an order of magnitude faster
than TA-Lib. This is because TI takes essentially one pass through the input data, but TA-Lib uses an inefficient algorithm that
ends up looking at the input data multiples times. Another example: TI calculates Trix in one pass, TA-Lib
uses four.

Copyright © 2016-2024 Tulip Charts LLC. All Rights Reserved.