Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Why does it become all zeros after flattening in NATR, while this doesn't happen in other APIs? #653

@gucasbrg

Description

@gucasbrg
import numpy as np
import talib

def _ta_natr_14(x1, x2, x3):
    t = 14
    x1 = x1.flatten()
    x2 = x2.flatten()
    x3 = x3.flatten()
    print(np.nan_to_num(talib.NATR(x1, x2, x3, timeperiod=t))[:100])

def _ta_natr_14_qs(x1, x2, x3):
    t = 14
    print(np.nan_to_num(talib.NATR(x1, x2, x3, timeperiod=t))[:100])


x1 = np.load('x1.npy')
x2 = np.load('x2.npy')
x3 = np.load('x3.npy')
_ta_natr_14(x1, x2, x3)
_ta_natr_14_qs(x1, x2, x3)

data.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions