等级: 免费版
- 注册:
- 2021-8-6
- 曾用名:
|
楼主 |
发表于 2021-11-19 21:47
|
显示全部楼层
DIFF :=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA :=EMA(DIFF,9);
MACD :=2*(DIFF-DEA);
n1:=sumbars(macd>0 and ref(macd<0,1),1);
n2:=sumbars(macd<0 and ref(macd>0,1),1);
//上一个金叉的最高价:ref(hhv(HIGH,n1),n2);
//上一个金叉的最大DIFF:ref(hhv(DIFF,n1),n2);
上一个死叉最低价:ref(llv(low,n2),n1);
上一个死叉最小DIFF:ref(llv(DIFF,n2),n1);
cond:LOW<上一个死叉最低价 and diff>上一个死叉最小DIFF and ref(diff,1)<diff;
老师我想引用5分钟周期,预警的结果与上面的不一样,不知道哪里该改下 谢谢老师
DIFF5min:"macd.DIFF#MIN5";
DIFF5min_:"macd.DIFF##MIN5";
macd5min:"macd.macd1#MIN5";
n1:=sumbars(macd5min>0 and ref(macd5min<0,1),1);
n2:=sumbars(macd5min<0 and ref(macd5min>0,1),1);
//上一个金叉的最高价:ref(hhv(HIGH,n1),n2);
//上一个金叉的最大DIFF:ref(hhv(DIFF,n1),n2);
上一个死叉最低价:ref(llv(low,n2),n1);
上一个死叉最小DIFF:ref(llv(DIFF5min,n2),n1);
cond:LOW<上一个死叉最低价 and DIFF5min>上一个死叉最小DIFF and DIFF5min_<DIFF5min;
|
|