有的,包的链接如下:
https://github.com/lovelylain/pyctp/tree/master/example/ctp/talib
a = 2/13Prices = [0.0] #prices of everyday
EMAs = [0.0] # ems of everyday
def ema ( N , Price) :
Prices.append(Price)
if N<=1:
EMAs.append(Price)
else :
EMAs.append((1-a)*EMAs[N-1] + a*Price)
ema(1,1)
ema(2,3)
print (EMAs[1])
print (EMAs[2])