DIFF := EMA(CLOSE,12) - EMA(CLOSE,26); DEA := EMA(DIFF,9); MACD := 2*(DIFF-DEA); 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); 頂背離; DIFF := EMA(CLOSE,12) - EMA(CLOSE,26); DEA := EMA(DIFF,9); MACD := 2*(DIFF-DEA); 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); 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); 底背離; |
|
來(lái)自: 欠收 > 《我的文件夾-----股票》