Skip to main content

Financial Technical Analysis Indicator Library. Python bindings for https://github.com/TulipCharts/tulipindicators

Project description

This is a fork of newtulipy which is a fork of tulipy. Install with pip install newnewtulipy.

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 newtulipy. 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.4'
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

newnewtulipy-0.4.6.2.tar.gz (34.8 kB view hashes)

Uploaded Source

Built Distributions

newnewtulipy-0.4.6.2-pp39-pypy39_pp73-win_amd64.whl (86.8 kB view hashes)

Uploaded PyPy Windows x86-64

newnewtulipy-0.4.6.2-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (84.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

newnewtulipy-0.4.6.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (83.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

newnewtulipy-0.4.6.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (78.2 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

newnewtulipy-0.4.6.2-pp38-pypy38_pp73-win_amd64.whl (88.0 kB view hashes)

Uploaded PyPy Windows x86-64

newnewtulipy-0.4.6.2-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (84.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

newnewtulipy-0.4.6.2-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (84.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

newnewtulipy-0.4.6.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (78.2 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

newnewtulipy-0.4.6.2-pp37-pypy37_pp73-win_amd64.whl (88.0 kB view hashes)

Uploaded PyPy Windows x86-64

newnewtulipy-0.4.6.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (85.5 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

newnewtulipy-0.4.6.2-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (84.9 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

newnewtulipy-0.4.6.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (78.2 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

newnewtulipy-0.4.6.2-cp310-cp310-win_amd64.whl (92.1 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

newnewtulipy-0.4.6.2-cp310-cp310-musllinux_1_1_x86_64.whl (289.8 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

newnewtulipy-0.4.6.2-cp310-cp310-musllinux_1_1_i686.whl (279.8 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

newnewtulipy-0.4.6.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (288.5 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

newnewtulipy-0.4.6.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (281.5 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

newnewtulipy-0.4.6.2-cp310-cp310-macosx_10_9_x86_64.whl (95.4 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

newnewtulipy-0.4.6.2-cp310-cp310-macosx_10_9_universal2.whl (166.1 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

newnewtulipy-0.4.6.2-cp39-cp39-win_amd64.whl (92.1 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

newnewtulipy-0.4.6.2-cp39-cp39-musllinux_1_1_x86_64.whl (289.2 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

newnewtulipy-0.4.6.2-cp39-cp39-musllinux_1_1_i686.whl (279.3 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

newnewtulipy-0.4.6.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (287.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

newnewtulipy-0.4.6.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (280.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

newnewtulipy-0.4.6.2-cp39-cp39-macosx_10_9_x86_64.whl (95.4 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

newnewtulipy-0.4.6.2-cp38-cp38-win_amd64.whl (92.0 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

newnewtulipy-0.4.6.2-cp38-cp38-musllinux_1_1_x86_64.whl (313.2 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

newnewtulipy-0.4.6.2-cp38-cp38-musllinux_1_1_i686.whl (303.6 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

newnewtulipy-0.4.6.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (293.9 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

newnewtulipy-0.4.6.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (287.2 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

newnewtulipy-0.4.6.2-cp38-cp38-macosx_10_9_x86_64.whl (91.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

newnewtulipy-0.4.6.2-cp37-cp37m-win_amd64.whl (92.4 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

newnewtulipy-0.4.6.2-cp37-cp37m-musllinux_1_1_x86_64.whl (279.7 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

newnewtulipy-0.4.6.2-cp37-cp37m-musllinux_1_1_i686.whl (272.1 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ i686

newnewtulipy-0.4.6.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (277.0 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

newnewtulipy-0.4.6.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (270.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

newnewtulipy-0.4.6.2-cp37-cp37m-macosx_10_9_x86_64.whl (90.2 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page