公式效果图:
指标源码及源码注释:
B1:=EMA((EMA(CLOSE, 29) + EMA(CLOSE, 31) + EMA(CLOSE, 33)) / 3, 3);{计算三个不同周期EMA的平均值的EMA,周期为3}
B2:=EMA((2 * C + H + L) / 4, 3);{计算加权平均价的EMA,周期为3}
B3:=SLOPE(B2 * 5 - REF(B2, 5), 5) + C;{计算B2的5周期斜率并加上当前收盘价}
B4:=EMA(B3, 3) - EMA(B3, 13);{计算B3的3周期和13周期EMA的差值}
B5:=EMA(B4, 3);{计算B4的EMA,周期为3}
B6:=IF(C > (EMA(((L + H + C * 2) / 4), 14) * 1.04) AND C > (EMA(((L + H + C * 2) / 4), 14)) AND C > B1 AND (B4 - B5) > 0, (B4 - B5), 0) AND REF(CCI, 1) < -50;{如果满足一系列条件,返回B4和B5的差值,否则返回0,且昨日CCI小于-50}
B7:=CLOSE / REF(CLOSE, 1) > 1.048 AND CLOSE = HIGH AND BETWEEN(FORCAST(VOL, 5), 0.3 * FORCAST(VOL, 12), 2.1 * FORCAST(VOL, 12));{判断今日收盘价是否较昨日上涨超过4.8%,且收盘价等于最高价,以及成交量是否在预测成交量的0.3到2.1倍之间}
XG: (B6 > 0 AND FILTER(B7, 10)) AND (H - C) / C * 100 < 1.06;{如果B6大于0且B7在过去10个交易日内为真,则判断今日最高价与收盘价的差值占收盘价的百分比是否小于1.06}