九毛八公式指标
请老师帮忙把“趋势顶底”做个预警! 预警要求如下: 1、长期线小于10, 2、买等于2, 3、金底等于1。满足这三个条件时跳出预警 先谢了,老师!!源码如下: {50,COLORRED; FILLRGN(1,20,80),COLOR222222; FILLRGN(1,90,100),COLOR000068; FILLRGN(1,79,90),COLOR663366; FILLRGN(1,10,20),COLOR666600; FILLRGN(1, 0,10),COLOR663300;} A:=MA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),19),COLORRED; B:=-100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14)); D:=EMA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),4),LINETHICK2; 长期线:A+100,COLOR9900FF; 短期线:B+100,COLOR888888; 中期线:D+100,COLORYELLOW,LINETHICK2; {见顶:(长期线>85 OR REF(长期线,1)>85 ) AND (CROSS(中期线,短期线) OR CROSS(REF(中期线,1),REF(短期线,1)) )AND CROSS(长期线,短期线);} 见顶:(REF(中期线,1)>85 AND REF(短期线,1)>85 AND REF(长期线,1)>65) AND CROSS(长期线,短期线) ; 顶部区域:(中期线80) AND (REF(短期线,1)>95 OR REF(短期线,2)>95 ) AND 长期线>60 AND 短期线<83.5 AND 短期线<中期线 AND 短期线<长期线+4; 顶部:=FILTER(顶部区域,4); {DRAWICON( 见顶, 108, 2 );} 底部区域:(长期线<12 and 中期线<8 (短期线<7.2 or ref(短期线,1)<5) (中期线>REF(中期线,1) OR 短期线>REF(短期线,1))) OR (长期线<8 and 中期线<7 短期线<15 短期线>REF(短期线,1)) OR (长期线<10 and 中期线<7 短期线<1) ; stickline( {见顶 or} 顶部,99,103,20,1 ),colorred,linethick2; 底部区域,-4,0,22,0 ),colorgreen; 低位金叉:长期线<15 ref(长期线,1)<15 中期线<18 短期线>REF(短期线,1) AND CROSS(短期线,长期线) AND 短期线>中期线 AND (REF(短期线,1)<5 or ref(短期线,2)<5 ) and (中期线>=长期线 OR REF( 短期线,1)<1 ); stickline( 低位金叉,0,5,11,0 ),colorred; 10,colorcc6633,linethick2; 20,colorgreen; 80,color996699;90,color9966ff,linethick2; kdj_k:="KDJ.K">1,买0,0); 主力:=EMA((C-MA(C,7))/MA(C,7)*480,2)*5; 散户:=EMA((C-MA(C,11))/MA(C,11)*480,7)*5; RSI1:=SMA(MAX(C-REF(C,1),0),6,1)/SMA(ABS(C-REF(C,1)),6,1)*100; BT1:=CROSS(RSI1,25); BT2:=CROSS(主力,散户) AND 主力<-10; 金底:FILTER(COUNT(BT1 OR BT2,3)>=2,3);
公式模块:
A:=MA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),19);
长期线:=A+100; kdj_K:="kdJ.K"(9,3,3);KDJ_D:="KDJ.D"(9,3,3);KDJ_J:="KDJ.J"(9,3,3); 买1:=crOSS(KDJ_J,0) OR (CROSS(KDJ_J,KDJ_K) AND KDJ_D<26); 买2:=CROSS("rsi.RSI1"(6,2,2),20) OR CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)); 买3:=CROSS("macd.DIF","MacD.DEA") OR CROSS("MACD.MACD",0); 买0:=买1+买2+买3; 买:=IF(买0>1,买0,0); 主力:=EMA((C-MA(C,7))/MA(C,7)*480,2)*5; 散户:=EMA((C-MA(C,11))/MA(C,11)*480,7)*5; RSI1:=SMA(MAX(C-REF(C,1),0),6,1)/SMA(ABS(C-REF(C,1)),6,1)*100; BT1:=CROSS(RSI1,25); BT2:=CROSS(主力,散户) AND 主力<-10; 金底:=FILTER(COUNT(BT1 OR BT2,3)>=2,3); 预警:长期线<10 AND 买 AND 金底;
1>