摘要:
MA/SMA/DMA/EMA移动平均算法公式 1、简单移动平均MA 用法: MA(X,N):X的N日简单移动平均 算法(X1+X2+X3+...+Xn)/N 2、移动平均SMA 用法: SMA(X,N,M),求X的N日移动平均,M/N为给予观测值X的权重,N必须大于M。 算法: 若Y=SMA(X,N,M) 则 Y=[M*X+(N-M)*Y')]/N=M/N*X +(N-M) ... 阅读全文
摘要:
x = None if x is not None: print("kong") if not x is not None: print("kong") # if not XXX就是 = if XXX ==0# if XXX 就是= if XXX !=0暂且只能这么理解 if x is not No 阅读全文
摘要:
portfolio = [ {'name': 'IBM', 'shares': 100, 'price': 91.1}, {'name': 'AAPL', 'shares': 50, 'price': 543.22}, {'name': 'FB', 'shares': 200, 'price': 2 阅读全文
摘要:
filter和map初一看很像 都是filter(func,iterable) map(func,iterable) 实际情况是filter函数:filter()为已知的序列的a56爆大奖在线娱乐元素调用给定的布尔函数,调用中,返回值为非零的元素将被添加至一个列表中。filter会对给定的iterable下的a56爆大奖在线娱乐结 阅读全文