xmduhan
xmduhan

Reputation: 1025

Calculate technical analysis indicators iteratively or using ta-lib?

Usually, I use ta-lib to calculate technical analysis indicators. But I find at times I need to calculate indicators iteratively, like below:

sma = SMA(timeperiod = 10)
while True:
    price = read_price(...)
    ma_value = sma.feed(price)
    # some action do with price and ma_value
    ...  

Can ta-lib be used in this way? Or there is any other library to use?

Upvotes: 0

Views: 1002

Answers (1)

truf
truf

Reputation: 3111

Original library doesn't support this way of work. My fork of TA-Lib project named TA-Lib RT is designed for that. But no one ever tested its autogenerated python wrappers so I doubt it will work without some bugfixes.

Upvotes: 1

Related Questions