九毛八公式指标
请老师帮忙把极品MACD改成飞狐 作者吉祥使者 DIF1:=EMA(CLOSE,12) - EMA(CLOSE,27),LINETHICK2; DEA1:=EMA(DIF1,9),LINETHICK2; MACD1:=2*(DIF1-DEA1),STICK; MACD2:=EMA(MACD1,3); STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,3.2,0),COLOR000055; STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,2.7,0),COLOR000077; STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,2.1,0),COLOR000099; STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1.5,0),COLOR0000BB; STICKLINE(MACD1>MACD2 AND MAD1>0,0,MACD1,0.9,),COLOR0000DD; STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,01.3,0),COLOR0000FF; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,3.2,0),COLOR555555; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,2.7,0),COLOR777777; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,2.1,0),COLOR999999; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1.5,0),COLORBBBBBB; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,0.9,0),COLORDDDDDD; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,0.3,0),COLORFFFFFF; STICKLINE(MACD1公式模块:
DIF1:=EMA(CLOSE,12) - EMA(CLOSE,27),LINETHICK2;
DEA1:=EMA(DIF1,9),LINETHICK2; macd1:=2*(DIF1-DEA1); MacD2:=EMA(MACD1,3); STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,3.2,0),COLOR000055; STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,2.7,0),COLOR000077; STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,2.1,0),COLOR000099; STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1.5,0),COLOR0000BB; STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,0.9,0),COLOR0000DD; STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,0.3,0),COLOR0000FF; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,3.2,0),COLOR555555; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,2.7,0),COLOR777777; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,2.1,0),COLOR999999; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1.5,0),COLORBBBBBB; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,0.9,0),COLORDDDDDD; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,0.3,0),COLORFFFFFF; STICKLINE(MACD1<MACD2,0,MACD1,3.2,0),COLORB20000; STICKLINE(MACD1<MACD2,0,MACD1,2.7,0),COLOREC0000; STICKLINE(MACD1<MACD2,0,MACD1,2.1,0),COLORFF4600; STICKLINE(MACD1<MACD2,0,MACD1,1.5,0),COLORFF6300; STICKLINE(MACD1<MACD2,0,MACD1,0.9,0),COLORFF8B00; STICKLINE(MACD1<MACD2,0,MACD1,0.3,0),COLORFFAB00; STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE; DIF:DIF1,COLOR33FF33; DEA:DEA1,COLORYELLOW; MACD:MACD1,linethick0,COLORMAGENTA; 低位金叉:crOSS(DIF1,DEA1) AND DIF1<-0.1; JCCOUNT:=COUNT(CROSS(DIF1,DEA1),BArslAST(DEA1>=0)); 二次金叉:=CROSS(DIF1,DEA1) AND DEA1<0 AND COUNT(JCCOUNT=2,21)=1; STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF; DRAWICON(二次金叉,DEA1*0.9,1) ; DRAWTEXT(二次金叉,0.4,' 二次金叉'),COLORYELLOW; 强度:=IF(DIF1>=DEA1,DIF1,0); PARTLINE(DIF1>=DEA1,DIF1),COLORRED,LINETHICK2; A1:=BARSLAST(REF(CROSS(DIF1,DEA1),1)); 底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF1>REF(DIF1,A1+1) AND CROSS(DIF1,DEA1); STICKLINE(底背离,0,0.03,6,0),COLOR00FF00; 底背:DRAWLINE(A1=0,DEA1,底背离,DEA1,0),COLORRED,LINETHICK4; DRAWTEXT(底背离,0.1,' 底背离'),COLORYELLOW; A2:=BARSLAST(REF(CROSS(DEA1,DIF1),1)); 顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF1,A2+1)>DIF1 AND CROSS(DEA1,DIF1); 顶背:DRAWLINE(A2=0,DEA1,顶背离,DEA1,0),COLORGREEN,LINETHICK4; DRAWTEXT(顶背离,0.1,'顶背离'),COLORGREEN; {obv判势} OBV:=DIF; P:=5; AA1:=REF(OBV,P)=HHV(OBV,2*P+1); B1:=FILTER(AA1,P); C1:=BACKSET(B1,P+1); D1:=FILTER(C1,P);{高点} AA2:=REF(OBV,P)=LLV(OBV,2*P+1); B2:=FILTER(AA2,P); C2:=BACKSET(B2,P+1); D2:=FILTER(C2,P);{低点} 上:REF(OBV,BARSLAST(D1)),COLORFF00FF,linethick0; 下:REF(OBV,BARSLAST(D2)),COLOR00FF00,linethick0; 向上:CROSS(OBV,上*1.01),linethick0; 相对能量:(OBV-下)/(上-下)*100,COLORYELLOW,linethick0; R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1); S11:=R11>REF(R11,1); DRAWLINE(D1,OBV,S11,OBV,1),COLORYELLOW; T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1); U11:=T11>REF(T11,1); DRAWLINE(D2,OBV,U11,OBV,1),COLOR00FF00; STICKLINE(C>0,下,下,1,0),COLOR00FF00; STICKLINE(C>0,上,上,1,0),COLORFF00FF; DRAWTEXT(CROSS(OBV,上*1.01),上,'上'),COLORYELLOW; DRAWTEXT(CROSS(下*0.99,OBV),下,'下'),COLORYELLOW; {金叉共振及三全项} DRAWICON(D1,OBV,1); DRAWICON(D2,OBV,2); B4:CROSS(DIF,DEA) AND CROSS("kdj.K"(9,3,3),"kdJ.D"(9,3,3)); DRAWTEXT(B4,0.1,'★金叉共振'),COLORYELLOW; DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0.25,'三全项'),COLORYELLOW,LINETHICK2; {买入信号} SHORT:=6; LONG:=9; MID:=3; DIF11:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG),LINETHICK1,COLOR0000FF; DEA11:=EMA(DIF11,MID); 向下:=IF(DIF11<REF(DIF,1),DIF11,0),COLORGREEN,LINETHICK2; 强势区:=IF((EVERY(向下>=REF(向下,1),1)),-0.2,0)COLOR0000FF,LINETHICK3; 买入信号:IF(((CROSS(-0.01,强势区))AND DIF<0),0.3,0),COLORGREEN,LINETHICK3;