{背景颜色设定}
DRAwrECTREL(0,10,200,1000,rgb(0,0,255)),layer0;
{参数}
short:=12;long:=26;M:=9;
DIFF1:=EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA1:=EMA(DIFF1,M);
macd:2*(DIFF1-DEA1),linethick0;
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),colorff00ff,linethick0;
DEA : EMA(DIFF1,M),colorwhite,linethick0;
AH:HHV(DIFF1,55),COLOR6600ff,linethick0,layer0;
PARTLINE(ah,ah),COLORWHITE,POINTDOT,linethick0,layer0;
DRAWICON( ref(aH=diff1,1) and DIFF<REF(DIFF1,1),AH*0.65,8),ALIGN1;
AL:LLV(DIFF1,55),COLOR248a24,linethick0,layer0;
PARTLINE(al,Al),COLORWHITE,POINTDOT,linethick0,layer0;
DRAWICON( ref(al=diff1,1) and DIFF>REF(DIFF1,1),al*0.65,7),ALIGN1;
{美人眼}
VAR1:=HHV(DEA,53);
VAR2:=LLV(DEA,30);
VAR3:=DEA-(DIFF-DEA);
UP:IF(DIFF>VAR1 AND DEA=VAR1,MAX(LLV(VAR1,10),VAR3),VAR1),COLORbb9a00,LINETHICK0,LAYER0;
DN:IF(DIFF<VAR2 AND DEA=VAR2,MIN(HHV(VAR2,10),VAR3),VAR2),COLORaa00bb,LINETHICK0,LAYER0;
美人眼:crOSS(DIFF ,DEA ) AND CROSS( DIFF,DN ) AND DN<0,linethick0;
STICKLINE(美人眼,-0.1,-0.20,6,0),COLORRED;
{美人眼a:美人眼*AL,stick,linethick4,COLOR8080ff;}
DRAWTEXT(美人眼,-0.15,'美人眼'),ALIGN1,COLOR8080FF,linethick2,LAYER1;
{美人瞎眼:=CROSS(DEA ,DIFF ) AND CROSS( UP,DIFF ) AND DIFF<UP;
美人瞎眼a:美人瞎眼*ah,stick,linethick4,COLOR9ca010;
DRAWTEXT(美人瞎眼,dn,'美人瞎眼'),ALIGN1,COLOR9ca010,linethick2,LAYER0;}
{●60零上金叉:IF(CROSS(DIFF,DEA) AND DIFF>0,0.3,0),COLOR6600ff,POINTDOT;
STICKLINE(●60零上金叉,DIFF,ah,4,0),COLOR6600ff;}
■零下金叉:IF(CROSS(DIFF,DEA) AND DIFF<-0.001,0.3,0),COLORWHITE,POINTDOT,LINETHICK0;
STICKLINE(■零下金叉,0.1,0.20,6,0),COLORffffff;
drawtext(■零下金叉,0.15,'零下金叉'),ALIGN1,color6600FF,layer1;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BArslAST(DEA>=0));
■二次金叉:IF(CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1,0.2,0),COLORred,POINTDOT,LINETHICK0;
STICKLINE(■二次金叉,0.20,0.3,6,0),COLORred;
drawtext(■二次金叉,0.25,'二次金叉'),ALIGN1,colorffffFF,layer1;
A3:=CROSS(DIFF,DEA) AND DEA<0;
■零下二次金叉:IF(FILTER(COUNT(A3,21)=2,10) AND DEA<0,0.05,0),COLORblue,POINTDOT,LINETHICK0;
STICKLINE(■零下二次金叉,0.3,0.4,6,0),COLORblue;
drawtext(■零下二次金叉,0.35,'零下二次金叉'),ALIGN1,colorYELLOW,layer1;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
■底背离:IF(REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA),0.1,0),COLORFFFF00;
{底背离1:STICKLINE(REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA),0,AL,4,0),COLOR00FF00;}
STICKLINE(■底背离,0.2,0.25,6,0),COLORFFFF00;
{DRAWLINE(A1=0,DEA,■底背离,DEA,0),COLORYELLOW};
{A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:STICKLINE(REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF),0,DIFF,4,0),COLORBLacK;
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN;}
中线:0,LINETHICK2,COLORYELLOW,LAYER1;
{绿色}
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,8,0 ),COLOr008800;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,7,0 ),COLOR009900;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,6,0 ),COLOR00aa00;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,5,0 ),COLOR00bb00;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,4,0 ),COLOR00cc00;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,3,0 ),COLOR00dd00;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,2,0 ),COLOR00ee00;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,1,0 ),COLOR00ff00;
{红色}
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,8,0 ),COLOR000088;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,7,0 ),COLOR000099;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,6,0 ),COLOR0000aa;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,5,0 ),COLOR0000bb;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,4,0 ),COLOR0000cc;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,3,0 ),COLOR0000dd;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,2,0 ),COLOR0000ee;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,1,0 ),COLOR0000ff;
{黄色}
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,8,0 ),COLOR338fdd;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,7,0 ),COLOR339fdd;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,6,0 ),COLOR33afdd;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,5,0 ),COLOR33bfdd;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,4,0 ),COLOR33cfdd;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,3,0 ),COLOR33dfdd;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,2,0 ),COLOR33efdd;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,1,0 ),COLOR33ffdd;
{蓝色}
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,8,0 ),COLORFF4400;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,7,0 ),COLORFF6600;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,6,0 ),COLORFF7700;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,5,0 ),COLORFF8800;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,4,0 ),COLORFF9900;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,3,0 ),COLORFFaa00;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,2,0 ),COLORFFbb00;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,1,0 ),COLORFFcc00;
{当日及时行情}
DRAWTEXTREL(5,70,'今 美 人 眼:'+NUMTOSTRN(美人眼,0)),COLORffffff,linethick1,layer0;
DRAWTEXTAbs(5,5,' '),linethick1,COLOR00EEff;
DRAWTEXTREL(5,250,'日 零下金叉:'+NUMTOSTRN(■零下金叉,0)),COLORffffff,linethick1,layer0;
DRAWTEXTREL(5,430,'行 二次金叉:'+NUMTOSTRN(■二次金叉,0)),COLORFFFFFF,linethick1,layer0;
DRAWTEXTREL(5,610,'情 零下二次金叉:'+NUMTOSTRN(■零下二次金叉,0)),COLORffffff,linethick1,layer0;
DRAWTEXTREL(5,790,'表 趋 势:'),COLORffffff,linethick1,layer0;
MRY1:=美人眼=1;
MRY2:=美人眼=0 AND ( ■零下金叉>0 OR ■二次金叉>0 OR ■零下二次金叉>0 );
MRY3:=美人眼=0 AND ■零下金叉=0 AND ■二次金叉=0 AND ■零下二次金叉=0 ;
IF BARSTATUS=2 AND MRY1 THEN BEGIN
DRAWTEXTREL(25,70,' ● 对你抛媚眼!'),colorRED,layer0;
END
ELSE
IF BARSTATUS=2 AND MRY2 THEN BEGIN
DRAWTEXTREL(25,70,' ● 不理你!'),colorgreen,layer0;
END
ELSE
IF BARSTATUS=2 AND MRY3 THEN BEGIN
DRAWTEXTREL(25,70,' ● 看 !'),colorgreen,layer0;
END;
LXJC1:=■零下金叉>0;
LXJC2:=■零下金叉=0 AND (■二次金叉>0 OR ■零下二次金叉>0);
LXJC3:=■零下金叉=0 AND ■二次金叉=0 AND ■零下二次金叉=0 AND 美人眼=0 ;
IF BARSTATUS=2 AND LXJC1 THEN BEGIN
DRAWTEXTREL(25,250,' ● 好消息!'),colorRED,layer0;
END
ELSE
IF BARSTATUS=2 AND LXJC2 THEN BEGIN
DRAWTEXTREL(25,250,' ● 闲闲没事 !'),colorgreen,layer0;
END
ELSE
IF BARSTATUS=2 AND LXJC3 THEN BEGIN
DRAWTEXTREL(25,250,' ● 趋 !'),colorgreen,layer0;
END
ECJC1:=■二次金叉>0;
ECJC2:=■二次金叉=0 AND ( ■零下金叉>0 OR ■零下二次金叉>0 );
ECJC3:=■二次金叉=0 AND ■零下金叉=0 AND ■零下二次金叉=0 AND 美人眼=0 ;
IF BARSTATUS=2 AND ECJC1 THEN BEGIN
DRAWTEXTREL(25,430,' ● 乐透开了!'),colorRED,layer0;
END
ELSE
IF BARSTATUS=2 AND ECJC2 THEN BEGIN
DRAWTEXTREL(25,430,' ● 喝茶去 !'),colorgreen,layer0;
END
ELSE
IF BARSTATUS=2 AND ECJC3 THEN BEGIN
DRAWTEXTREL(25,430,' ● 势 !'),colorgreen,layer0;
END
LXECJC1:=■零下二次金叉>0;
LXECJC2:=■零下二次金叉=0 AND ( ■零下金叉>0 OR ■二次金叉>0);
LXECJC3:=■零下二次金叉=0 AND ■二次金叉=0 AND ■零下金叉=0 AND 美人眼=0 ;
IF BARSTATUS=2 AND LXECJC1 THEN BEGIN
DRAWTEXTREL(25,610,' ● 中头彩了!'),colorRED,layer0;
END
ELSE
IF BARSTATUS=2 AND LXECJC2 THEN BEGIN
DRAWTEXTREL(25,610,' ● 等 吧 !'),colorgreen,layer0;
END
ELSE
IF BARSTATUS=2 AND LXECJC3 THEN BEGIN
DRAWTEXTREL(25,610,' ● 线 !'),colorgreen,layer0;
END
准备1:=MACD>0 AND MACD>REF(MACD,1);
准备2:=MACD>0 AND MACD<REF(MACD,1);
板凳1:=MACD<0 AND MACD>REF(MACD,1);
板凳2:=MACD<0 AND MACD<REF(MACD,1);
IF BARSTATUS=2 AND 准备1 THEN BEGIN
DRAWTEXTREL(25,790,' ● 起跑线上 趋势上升中!'),colorRED,layer0;
END
ELSE
IF BARSTATUS=2 AND 准备2 THEN BEGIN
DRAWTEXTREL(25,790,' ● 起跑线上 趋势下跌中!'),colorgreen,layer0;
END;
IF BARSTATUS=2 AND 板凳1 THEN BEGIN
DRAWTEXTREL(25,790,' ● 板凳球员 趋势上升中!'),colorRED,layer0;
END
ELSE
IF BARSTATUS=2 AND 板凳2 THEN BEGIN
DRAWTEXTREL(25,790,' ● 板凳球员 趋势下跌中!!'),colorgreen,layer0;
END;