MyTT icon indicating copy to clipboard operation
MyTT copied to clipboard

贡献3个函数:量比,钱龙短线指标,钱龙长线指标

Open chorespore opened this issue 4 years ago • 1 comments

def QRR(VOL):  # 量比(Quantity Relative Ratio)
    return (VOL / MA(REF(VOL), 5)).values


def SHO(CLOSE, VOL, N=5):  # 钱龙短线指标(Short)
    VAR1 = MA((VOL - REF(VOL, 1)) / REF(VOL, 1), 5)
    VAR2 = (CLOSE - MA(CLOSE, 24)) / MA(CLOSE, 24) * 100
    SHT = VAR2 * (1 + VAR1)
    SHTMA = MA(SHT, N)
    return SHT, SHTMA


def LON(CLOSE, HIGH, LOW, VOL):  # 钱龙长线指标(Long)
    LC = REF(CLOSE, 1)
    VID = SUM(VOL, 2) / (((HHV(HIGH, 2) - LLV(LOW, 2))) * 100)
    RC = (CLOSE - LC) * VID
    LONG = SUM(RC, 0)
    DIFF = SMA(LONG, 10, 1)
    DEA = SMA(LONG, 20, 1)
    LON = DIFF - DEA
    LONMA = MA(LON, 10)
    return LON, LONMA

chorespore avatar Dec 06 '21 02:12 chorespore

感谢分享!

mpquant avatar Dec 06 '21 03:12 mpquant