龙听期货论坛's Archiver

龙听 发表于 2018-12-24 15:20

大智慧区域背离指标公式源码[大智慧公式]

[code]
{区域背离}
POLYLINE(1,"KDJ.D"),colorred;
RSI1:SMA(MAX(CLOSE-ref(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-ref(CLOSE,1)),6,1)*100;
短高:IF(BETWEEN("KDJ.K",100,80),88,100);
短低:IF(BETWEEN("KDJ.K",20,0),12,0);
波低:IF(BETWEEN("KDJ.K#week",10,0),30,0);
波高:IF(BETWEEN("KDJ.K#week",100,90),70,100);
中低:IF(BETWEEN("KDJ.K#MONTH",20,0),30,0);
中高:IF(BETWEEN("KDJ.K#MONTH",100,75),70,100);
POLYLINE(1,0);
A1:=BARSLAST(ref(cross("MAcd.diff","MAcd.dea"),1));
B1:=ref(c,A1+1)>c and ref("MAcd.diff",A1+1)<"MAcd.diff" and cross("MAcd.diff","MAcd.dea");
v1:=STICKLINE(FILTER((B1 > 0),5),0,45,3,0);
DRAWTEXT(FILTER((B1 > 0),5),45,'MACD底背离');
A2:=BARSLAST(ref(cross("kdj.k","kdj.d"),1));
B2:=ref(c,A2+1)>c and ref("kdj.k",A2+1)<"kdj.k" and
cross("kdj.k","kdj.d");
v2:=STICKLINE(FILTER((B2 > 0),5),0,15,3,0);
DRAWTEXT(FILTER((B2 > 0),5),15,'KDJ底背离');
A3:=BARSLAST(ref(cross("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=ref(c,A3+1)>c and ref("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) and
cross("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
v3:=STICKLINE(FILTER((B3 > 0),5),0,30,3,0);
DRAWTEXT(FILTER((B3 > 0),5),30,'RSI底背离'),colorFFFF00;

C1:=BARSLAST(ref(cross("MAcd.dea","MAcd.diff"),1));
D1:=ref(c,C1+1)<c and ref("MAcd.diff",C1+1)>"MAcd.diff" and cross("MAcd.dea","MAcd.diff");
v1:=STICKLINE(FILTER((D1 > 0),5),100,55,3,0);
DRAWTEXT(FILTER((D1 > 0),5),55,'MACD顶背离');
C2:=BARSLAST(ref(cross("kdj.d","kdj.k"),1));
D2:=ref(c,C2+1)<c and ref("kdj.k",C2+1)>"kdj.k" and cross("kdj.d","kdj.k");
v2:=STICKLINE(FILTER((D2 > 0),5),100,85,3,0);
DRAWTEXT(FILTER((D2 > 0),5),85,'KDJ顶背离');
C3:=BARSLAST(ref(cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=ref(c,C3+1)<c and ref("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) and cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
v3:=STICKLINE(FILTER((D3 > 0),5),100,70,3,0);
DRAWTEXT(FILTER((D3 > 0),5),70,'RSI顶背离'),colorFF00FF;
Var1:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
Var2:=SMA(Var1,8,1);
Var3:=SMA(Var2,5,1);
Var4:="KDJ.K#WEEK";
Var5:="KDJ.D#WEEK";
Var6:="KDJ.K#MONTH";
Var7:="KDJ.D#MONTH";
日金叉: IF(CROSS(Var2,Var3),0.5,0)*20,colorwhite;
周金叉: IF(CROSS(Var4,Var5),0.9,0)*25,colore000e0;
月金叉: IF(CROSS(Var6,Var7),1,0)*30,colorred,linethick3;
[/code]

页: [1]