主题753
精华0
阅读权限120
注册时间2015-3-30
在线时间0 小时
最后登录2020-5-2
美元12
爱心果13826
贡献0
- 积分
- 16247
指标研习组
- 听众
- 5
|
30爱心果
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26),COLORwhite;
DEA : EMA(DIFF,9),COLORYELLOW;
MACD : 2*(DIFF-DEA),colorSTICK;
{======================================================}
cond1:=longcross(dea,diff,3);
cond2:=longcross(diff,dea,3);
var1:=barslast(cond1);
var2:=ref(var1,var1+1)+1;
var3:=barslast(cond2);
var4:=ref(var3,var3+1)+1;
var5:=ref(var3,var1)+1;
macdtop1:=ref(hhv(diff,var5),var1);
top1:=ref(hhv(high,var5),var1);
var6:=ref(var3,var1+var2)+1;
macdtop2:=ref(hhv(diff,var6),var1+var2);
top2:=ref(hhv(high,var6),var1+var2);
顶背离0:=top1>top2 and macdtop1<macdtop2;
顶背离:=顶背离0>ref(顶背离0,1);
var7:=ref(var1,var3)+1;
macdbase1:=ref(llv(diff,var7),var3);
base1:=ref(llv(low,var7),var3);
var8:=ref(var1,var3+var4)+1;
macdbase2:=ref(llv(diff,var8),var3+var4);
base2:=ref(llv(low,var8),var3+var4);
底背离0:=base1<base2 and macdbase1>macdbase2;
底背离:=底背离0>ref(底背离0,1);
var9:=barslast(顶背离);
var10:=ref(hhvbars(diff,ref(var3,var9)),var9);
DLTop1:=filter(backset(顶背离,var10+1),var10);
var11:=ref(var1,var9+1)+1;
var12:=ref(hhvbars(diff,ref(var3,var9+var11))+1,var9+var11);
DLTop2:=filter(backset(顶背离,var9+var11+var12),var9+var11+var12);
drawline(DLTop2,diff,DLTop1,diff,0),colorred;
drawicon(顶背离,diff,8),colorgreen,align1,valign2;
var13:=barslast(底背离);
var14:=ref(llvbars(diff,var7),var13);
DLbase1:=filter(backset(底背离,var14+1),var14+3);
var15:=ref(var3,var13+1)+1;
var16:=ref(llvbars(diff,ref(var1,var13+var15))+1,var13+var15);
DLbase2:=filter(backset(底背离,var13+var15+var16),var13+var15+var16);
drawline(dlbase2,diff,dlbase1,diff,0),colorgreen;
drawicon(底背离,diff,7),align1,valign0; |
|