Financial Technical Analysis Indicator Library. Python bindings for https://github.com/TulipCharts/tulipindicators
Project description
tulipy
Python bindings for Tulip Indicators
Tulipy requires numpy as all inputs and outputs are numpy arrays (dtype=np.float64
).
Installation
You can install via pip install tulipy
.
If a wheel is not available for your system, you will need to pip install Cython numpy
to build from the source distribution.
When building from source on Windows, you will need the Microsoft Visual C++ Build Tools installed.
Usage
import numpy as np
import tulipy as ti
ti.TI_VERSION
'0.8.3'
DATA = np.array([81.59, 81.06, 82.87, 83, 83.61,
83.15, 82.84, 83.99, 84.55, 84.36,
85.53, 86.54, 86.89, 87.77, 87.29])
Information about indicators are exposed as properties:
def print_info(indicator):
print("Type:", indicator.type)
print("Full Name:", indicator.full_name)
print("Inputs:", indicator.inputs)
print("Options:", indicator.options)
print("Outputs:", indicator.outputs)
print_info(ti.sqrt)
Type: simple
Full Name: Vector Square Root
Inputs: ['real']
Options: []
Outputs: ['sqrt']
Single outputs are returned directly. Indicators returning multiple outputs use
a tuple in the order indicated by the outputs
property.
ti.sqrt(DATA)
array([ 9.03271831, 9.00333272, 9.10329611, 9.11043358, 9.14385039,
9.11866218, 9.1016482 , 9.16460583, 9.19510739, 9.18477 ,
9.24824308, 9.30268778, 9.32148057, 9.36856446, 9.34291175])
print_info(ti.sma)
Type: overlay
Full Name: Simple Moving Average
Inputs: ['real']
Options: ['period']
Outputs: ['sma']
ti.sma(DATA, period=5)
array([ 82.426, 82.738, 83.094, 83.318, 83.628, 83.778, 84.254,
84.994, 85.574, 86.218, 86.804])
Invalid options will throw an InvalidOptionError
:
try:
ti.sma(DATA, period=-5)
except ti.InvalidOptionError:
print("Invalid Option!")
Invalid Option!
print_info(ti.bbands)
Type: overlay
Full Name: Bollinger Bands
Inputs: ['real']
Options: ['period', 'stddev']
Outputs: ['bbands_lower', 'bbands_middle', 'bbands_upper']
ti.bbands(DATA, period=5, stddev=2)
(array([ 80.53004219, 80.98714192, 82.53334324, 82.47198345,
82.41775044, 82.43520292, 82.51133078, 83.14261781,
83.53648779, 83.8703237 , 85.28887096]),
array([ 82.426, 82.738, 83.094, 83.318, 83.628, 83.778, 84.254,
84.994, 85.574, 86.218, 86.804]),
array([ 84.32195781, 84.48885808, 83.65465676, 84.16401655,
84.83824956, 85.12079708, 85.99666922, 86.84538219,
87.61151221, 88.5656763 , 88.31912904]))
If inputs of differing sizes are provided, they are right-aligned and trimmed from the left:
DATA2 = np.array([83.15, 82.84, 83.99, 84.55, 84.36])
# 'high' trimmed to DATA[-5:] == array([ 85.53, 86.54, 86.89, 87.77, 87.29])
ti.aroonosc(high=DATA, low=DATA2, period=2)
array([ 50., 100., 50.])
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file tulipy-0.3.1.tar.gz
.
File metadata
- Download URL: tulipy-0.3.1.tar.gz
- Upload date:
- Size: 34.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 428f19236f9416e12beaa5f9f3e68121f1c4a5d82f8d8370ae1b28bd5d00e739 |
|
MD5 | 152505cd7c8e1a0dfb4a158d94115856 |
|
BLAKE2b-256 | 8708d624e57effb2cbb40de03e65cc23782b9f3ef84e6ae9c55c9acc2eabe555 |
File details
Details for the file tulipy-0.3.1-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: tulipy-0.3.1-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 129.9 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d0277e4e00dd381727b50ca4a6a85fc84ad96eb4c94a3abdcb54926455b0673 |
|
MD5 | 318a9c151dc8bfe13bd37e0e788ccc73 |
|
BLAKE2b-256 | b75a10471df94d3a6b4700feb43e08e6520a2aab33c6eaece3f729e3efb56119 |
File details
Details for the file tulipy-0.3.1-cp37-cp37m-win32.whl
.
File metadata
- Download URL: tulipy-0.3.1-cp37-cp37m-win32.whl
- Upload date:
- Size: 80.2 kB
- Tags: CPython 3.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a5a3e3d5726c76c26545a844bfb4058c2f271e0e4c13c2bbc3a1e201cf02312 |
|
MD5 | 7e00ae228437ad47518f3a4c9324a241 |
|
BLAKE2b-256 | 3c0f7fcc65492925ec357fefe619b5e978563017dde9a9c12c0e1a8ddaecd246 |