0

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?

SeeDerekEngineer
  • 770
  • 2
  • 6
  • 22
xmduhan
  • 965
  • 12
  • 14

1 Answers1

1

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.

truf
  • 2,843
  • 26
  • 39