TA-Lib / ta-lib-python

Python wrapper for TA-Lib (http://ta-lib.org/).
http://ta-lib.github.io/ta-lib-python
Other
9.49k stars 1.74k forks source link

Stream values different than regular calls #503

Open kimboox44 opened 2 years ago

kimboox44 commented 2 years ago

Stream values different than regular calls c=[a[1] for a in c] c = np.array(c,dtype="double") val = talib.HT_PHASOR(c) val_stream = stream.HT_PHASOR(c)

print(val_stream) (-0.04820981151286492,-0.011143455822243967)

print(val[0][-1] ) -0.0920150816290648 print(val[0] ) 34:-0.05492210928311794 35:-0.07138520112260047 36:-0.10170034098678124 37:-0.11471878792173447 38:-0.07489067774288735 39:-0.05324519191986519 40:-0.061866246081531955 41:-0.07337167903403932 42:-0.07830740906736532 43:-0.10876347619624367 44:-0.10708360556839117 45:-0.04168729520894142 46:-0.011632078194743222 47:-0.00955331370585474 48:-0.05535466822502754 49:-0.0920150816290648

print(val[0][-1] ) -0.02143220674537429 print(val[0] ) 33:-0.06221513608569242 34:-0.06849135021655883 35:-0.07162313207881235 36:-0.06309723149277043 37:0.036387340179205016 38:0.08978084456343666 39:0.02553053677932897 40:-0.029424557383150664 41:-0.033968063250308926 42:-0.052698143297023464 43:-0.03255025418382515 44:0.12569938394967095 45:0.16201192669772266 46:0.05728323309699908 47:-0.0597890873802021 48:-0.1412316392142619 49:-0.02143220674537429

mrjbq7 commented 2 years ago

This will be true of any indicator that uses “history” such as EMA.

The streaming versions effectively use a rolling window of only “n” or “lookback” previous data points.

On Thu, Feb 24, 2022 at 12:34 PM Kimboo @.***> wrote:

Stream values different than regular calls c=[a[1] for a in c] c = np.array(c,dtype="double") val = talib.HT_PHASOR(c) val_stream = stream.HT_PHASOR(c)

print(val_stream) (-0.04820981151286492,-0.011143455822243967)

print(val[0][-1] ) -0.0920150816290648 print(val[0] ) 34:-0.05492210928311794 35:-0.07138520112260047 36:-0.10170034098678124 37:-0.11471878792173447 38:-0.07489067774288735 39:-0.05324519191986519 40:-0.061866246081531955 41:-0.07337167903403932 42:-0.07830740906736532 43:-0.10876347619624367 44:-0.10708360556839117 45:-0.04168729520894142 46:-0.011632078194743222 47:-0.00955331370585474 48:-0.05535466822502754 49:-0.0920150816290648

print(val[0][-1] ) -0.02143220674537429 print(val[0] ) 33:-0.06221513608569242 34:-0.06849135021655883 35:-0.07162313207881235 36:-0.06309723149277043 37:0.036387340179205016 38:0.08978084456343666 39:0.02553053677932897 40:-0.029424557383150664 41:-0.033968063250308926 42:-0.052698143297023464 43:-0.03255025418382515 44:0.12569938394967095 45:0.16201192669772266 46:0.05728323309699908 47:-0.0597890873802021 48:-0.1412316392142619 49:-0.02143220674537429

— Reply to this email directly, view it on GitHub https://github.com/mrjbq7/ta-lib/issues/503, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAF5A7TMDNKYJSCIS3DAKDU4ZT3PANCNFSM5PIA223A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>