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 5 runs. **Higher numbers are
better.**

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

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

acos | Vector Arccosine | 9 | 9 | *tie* |

ad | Accumulation/Distribution Line | 251 | 251 | *tie* |

add | Vector Addition | 3,920 | 1,896 | TI is 106% faster |

adosc | Accumulation/Distribution Oscillator | 221 | 250 | TA-Lib is 13% faster |

adx | Average Directional Movement Index | 69 | 34 | TI is 102% faster |

adxr | Average Directional Movement Rating | 53 | 34 | TI is 55% faster |

ao | Awesome Oscillator | 539 | - | - |

apo | Absolute Price Oscillator | 376 | 170 | TI is 121% faster |

aroon | Aroon | 85 | 85 | *tie* |

aroonosc | Aroon Oscillator | 94 | 94 | *tie* |

asin | Vector Arcsine | 9 | 9 | *tie* |

atan | Vector Arctangent | 18 | 17 | *tie* |

atr | Average True Range | 209 | 78 | TI is 167% faster |

avgprice | Average Price | 1,896 | 933 | TI is 103% faster |

bbands | Bollinger Bands | 235 | 64 | TI is 267% faster |

bop | Balance of Power | 251 | 250 | *tie* |

cci | Commodity Channel Index | 19 | 9 | TI is 111% faster |

ceil | Vector Ceiling | 78 | 78 | *tie* |

cmo | Chande Momentum Oscillator | 96 | - | - |

cos | Vector Cosine | 22 | 22 | *tie* |

cosh | Vector Hyperbolic Cosine | 19 | 19 | *tie* |

crossany | Crossany | 753 | - | - |

crossover | Crossover | 1,251 | - | - |

cvi | Chaikins Volatility | 235 | - | - |

decay | Linear Decay | 420 | - | - |

dema | Double Exponential Moving Average | 420 | 170 | TI is 147% faster |

di | Directional Indicator | 89 | 80 | TI is 11% faster |

div | Vector Division | 251 | 250 | *tie* |

dm | Directional Movement | 209 | 150 | TI is 39% faster |

dpo | Detrended Price Oscillator | 753 | - | - |

dx | Directional Movement Index | 73 | 40 | TI is 82% faster |

edecay | Exponential Decay | 374 | - | - |

ema | Exponential Moving Average | 376 | 376 | *tie* |

emv | Ease of Movement | 78 | - | - |

exp | Vector Exponential | 24 | 23 | *tie* |

fisher | Fisher Transform | 16 | - | - |

floor | Vector Floor | 80 | 78 | *tie* |

fosc | Forecast Oscillator | 251 | - | - |

hma | Hull Moving Average | 71 | - | - |

kama | Kaufman Adaptive Moving Average | 251 | 188 | TI is 33% faster |

kvo | Klinger Volume Oscillator | 125 | - | - |

lag | Lag | 3,920 | - | - |

linreg | Linear Regression | 376 | 15 | TI is 2,406% faster |

linregintercept | Linear Regression Intercept | 420 | 16 | TI is 2,525% faster |

linregslope | Linear Regression Slope | 539 | 17 | TI is 3,070% faster |

ln | Vector Natural Log | 30 | 30 | *tie* |

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

macd | Moving Average Convergence/Divergence | 326 | 98 | TI is 232% faster |

marketfi | Market Facilitation Index | 227 | - | - |

mass | Mass Index | 211 | - | - |

max | Maximum In Period | 223 | 217 | *tie* |

md | Mean Deviation Over Period | 20 | - | - |

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

mfi | Money Flow Index | 100 | 94 | *tie* |

min | Minimum In Period | 196 | 176 | TI is 11% faster |

mom | Momentum | 2,450 | 1,400 | TI is 75% faster |

mul | Vector Multiplication | 2,450 | 1,589 | TI is 54% faster |

natr | Normalized Average True Range | 186 | 62 | TI is 200% faster |

nvi | Negative Volume Index | 432 | - | - |

obv | On Balance Volume | 328 | 328 | *tie* |

ppo | Percentage Price Oscillator | 231 | 97 | TI is 138% faster |

psar | Parabolic SAR | 132 | 144 | TA-Lib is 9% faster |

pvi | Positive Volume Index | 445 | - | - |

qstick | Qstick | 700 | - | - |

roc | Rate of Change | 235 | 236 | *tie* |

rocr | Rate of Change Ratio | 234 | 236 | *tie* |

round | Vector Round | 73 | - | - |

rsi | Relative Strength Index | 235 | 81 | TI is 190% faster |

sin | Vector Sine | 22 | 22 | *tie* |

sinh | Vector Hyperbolic Sine | 19 | 19 | *tie* |

sma | Simple Moving Average | 753 | 251 | TI is 200% faster |

sqrt | Vector Square Root | 251 | 269 | *tie* |

stddev | Standard Deviation Over Period | 251 | 85 | TI is 195% faster |

stderr | Standard Error Over Period | 251 | - | - |

stoch | Stochastic Oscillator | 55 | 53 | *tie* |

sub | Vector Subtraction | 3,920 | 1,896 | TI is 106% faster |

sum | Sum Over Period | 753 | 632 | TI is 19% faster |

tan | Vector Tangent | 19 | 19 | *tie* |

tanh | Vector Hyperbolic Tangent | 33 | 33 | *tie* |

tema | Triple Exponential Moving Average | 376 | 110 | TI is 241% faster |

todeg | Vector Degree Conversion | 3,920 | - | - |

torad | Vector Radian Conversion | 3,675 | - | - |

tr | True Range | 235 | 197 | TI is 19% faster |

trima | Triangular Moving Average | 534 | 539 | *tie* |

trix | Trix | 251 | 83 | TI is 202% faster |

trunc | Vector Truncate | 539 | - | - |

tsf | Time Series Forecast | 376 | 15 | TI is 2,406% faster |

typprice | Typical Price | 1,896 | 251 | TI is 655% faster |

ultosc | Ultimate Oscillator | 50 | 25 | TI is 100% faster |

var | Variance Over Period | 632 | 125 | TI is 405% faster |

vhf | Vertical Horizontal Filter | 91 | - | - |

vidya | Variable Index Dynamic Average | 85 | - | - |

volatility | Annualized Historical Volatility | 81 | - | - |

vosc | Volume Oscillator | 251 | - | - |

vwma | Volume Weighted Moving Average | 251 | - | - |

wad | Williams Accumulation/Distribution | 235 | - | - |

wcprice | Weighted Close Price | 1,896 | 1,251 | TI is 51% faster |

wilders | Wilders Smoothing | 376 | - | - |

willr | Williams %R | 83 | 78 | *tie* |

wma | Weighted Moving Average | 251 | 251 | *tie* |

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

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 |

58,737 ms | 85,062 ms |

That is, TI on average is 45% 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-2017 Tulip Charts LLC. All Rights Reserved.