MCPcopy Index your code
hub / github.com/mpquant/Ashare / ATR

Function ATR

MyTT.py:126–128  ·  view source on GitHub ↗
(CLOSE,HIGH,LOW, N=20)

Source from the content-addressed store, hash-verified

124 return (TP-MA(TP,N))/(0.015*AVEDEV(TP,N))
125
126def ATR(CLOSE,HIGH,LOW, N=20): #真实波动N日平均值
127 TR = MAX(MAX((HIGH - LOW), ABS(REF(CLOSE, 1) - HIGH)), ABS(REF(CLOSE, 1) - LOW))
128 return MA(TR, N)
129
130def BBI(CLOSE,M1=3,M2=6,M3=12,M4=20): #BBI多空指标
131 return (MA(CLOSE,M1)+MA(CLOSE,M2)+MA(CLOSE,M3)+MA(CLOSE,M4))/4

Callers

nothing calls this directly

Calls 4

MAXFunction · 0.85
ABSFunction · 0.85
REFFunction · 0.85
MAFunction · 0.85

Tested by

no test coverage detected