TulipCharts / tulipindicators

Technical Analysis Indicator Function Library in C
https://tulipindicators.org/
GNU Lesser General Public License v3.0
818 stars 154 forks source link

NaN is omitted by tulipy #105

Closed ghost closed 3 years ago

ghost commented 3 years ago

import pandas import numpy import talib import tulipy

d = {'o': [1,2,8,9,8,5], 'c': [3,8,5,4,3,5]} df = pandas.DataFrame(data=d, dtype=numpy.float64) df['a'] = talib.SMA(df['o'].values,3) print(df)

df['b'] = tulipy.sma(df['o'].values,3) print(df)

talib.SMA works and fills NaN for the first two rows of df['a]

tulipy.sma fails as it omits NaN for the first two rows. ValueError: Length of values (4) does not match length of index (6)

How to get this working? Thanks!

codeplea commented 3 years ago

This repo is for the C library.