激流探险 源码: INPUT:N(9,1,100),M(15,1,100);
MA3:=MA(C,3); MA8:=MA(C,8); MA21:=MA(C,21); STICKLINE(MA3>MA21,110,117,10,0),COLOR008800; STICKLINE(MA3>MA8,117,124,10,0),COLORRED; R00:=(((CLOSE - LLV(CLOSE,25)) / (HHV(CLOSE,25) - LLV(CLOSE,25))) * 100); R33:=(EMA(CLOSE,2) - EMA(CLOSE,150)); R44:=EMA(R33,100); R55:=(2 * (R33 - R44)); R66:=((POW(R55,3) * 0.1) + POW(R55,1)); R22:=(R00 = 0); R23:=(R00 = 100); 小市民:=(0-(HHV(HIGH,21)*"KDJ.J"))/10000-25; 大富豪:=((IF((R55>0.1),R66,0)/1000000))-25; 生活区:STICKLINE((R22>0),0,-20,6,1),COLORFFFF00; 出货区:STICKLINE((R23>0),90,110,8,0),COLOR0000FF; VAR1:=HHV(HIGH,146); VAR2:=REF(LOW,1); VAR3:=((SMA(ABS((LOW - VAR2)),13,1) / SMA(MAX((LOW - VAR2),0),13,1)) * 100); VAR4:=EMA(IF((CLOSE * 1.2),(VAR3 * 13),(VAR3 / 13)),13); VAR5:=LLV(LOW,34); VAR6:=HHV(VAR4,34); VAR7:=IF(LLV(LOW,56),1,0); VAR8:=((EMA(IF((LOW <= VAR5),((VAR4 + (VAR6 * 2)) / 2),0),3) / 618) * VAR7); VAR9:=EMA(CLOSE,5); VAR10:=(((CLOSE - MA(CLOSE,34)) / MA(CLOSE,34)) * (0 - 10)); 清洗区:INTPART(IF((VAR8 < REF(VAR8,1)),(VAR8 * -5),0))+110,LINETHICK0,COLOR00FFFF; STICKLINE(清洗区,110,清洗区,6,1),COLOR00FFFF; VARQ2:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA(SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1),3,1); VARQ3:= EMA(VARQ2,3); VARQ4:=((3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1)-50)*1.032+50); VARQ5:= SQRT(SQRT(FLOOR(SQRT(MA(1/WINNER(CLOSE)*100,4)/10000))))*5; VARQ6:=(VARQ4<10 AND VARQ5>0) OR VARQ3<=13; 底部区:STICKLINE(VARQ6,-20,-10,6,0),COLORFF00FF; LC:=("KD.K#WEEK"<M); 周K底:=IF(LC AND CLOSE=LLV(CLOSE,N),100,110); T0:=REF(CLOSE,1); QR:=((SMA(MAX((CLOSE - T0),0),6,1) / SMA(ABS((CLOSE - T0)),6,1)) * 100); T1:=(BARSCOUNT(CLOSE) > 12); T2:=(CLOSE = LLV(CLOSE,12)); T3:=(QR > LLV(QR,12)); TRSI:=(QR < 21); VARA1:=((((T1 AND T2) AND T3) AND TRSI) AND ((CLOSE/HHV(CLOSE,120))<1)); MID:=MA(QR,20); UPPER:=MID + 2*STDP(QR,20); LOWER:=MID - 2*STDP(QR,20); 高:=REF(HHV(QR,360),1); 低:=REF(LLV(QR,240),1); 上:UPPER,LAYER0,COLOR0000FF; 下:LOWER,COLOR0000FF; AAAA:=LLV(LOW,36); BBBB:=HHV(HIGH,30); 激流:EMA((CLOSE-AAAA)/(BBBB-AAAA)*4,4)*25,colorffffff,DOTLINE; bbb:MID,DOTLINE,Color00bbaa; RSI双底:IF((REF(VARA1,1) AND (CLOSE>REF(CLOSE,1))),0,-20),COLOR0000FF; VAR12:=HHV(HIGH,9)-LLV(LOW,9); VAR13:=HHV(HIGH,9)-CLOSE; VAR14:=CLOSE-LLV(LOW,9); VAR15:=VAR13/VAR12*100-70; VAR16:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*100; VAR17:=(2*CLOSE+HIGH+LOW)/4; VAR18:=SMA(VAR14/VAR12*100,3,1); VAR19:=LLV(LOW,34); VAR20:=HHV(HIGH,34); 边防线B:=EMA((VAR17-VAR19)/(VAR20-VAR19)*100,8); B1:=EMA(边防线B,5); 危险区:STICKLINE(边防线B>70 AND 边防线B-B1>=0,110,100,8,0),LAYER1,colorFFFFFF; gao:=cross(upper,105); DRAWTEXT(CROSS(激流,LOWER),LOWER,'到岸'),ALIGN0,COLOR00FF00; DRAWTEXT(CROSS(LOWER,激流) OR CROSS(激流,16),LOWER,'★'),ALIGN0,COLOR00FF00; DRAWTEXT(CROSS(激流,高),MID,'高'),ALIGN0,COLORYELLOW; DRAWTEXT(CROSS(低,激流),MID,'低'),ALIGN0,COLORYELLOW; DRAWTEXT(CROSS(UPPER,激流) or gao,UPPER,'离岸'),ALIGN0,LAYER0,COLORYELLOW; DRAWTEXT(CROSS(激流,UPPER),UPPER,'▲'),ALIGN0,COLORYELLOW; 15,DOTLINE,color888888; 85,DOTLINE,color888888; 125,DOTLINE,color888888;
input:N1(3,1,360), N2(5,1,360), N3(8,1,360), N4(13,1,360), N5(21,1,360), N6(34,1,360);
DIFF:=EMA(CLOSE,N3)-EMA(CLOSE,N4); DEA:=EMA(DIFF,N2); A1:=DIFF>DEA; RSV1:=(CLOSE-LLV(LOW,N3))/(HHV(HIGH,N3)-LLV(LOW,N3))*100; K:=SMA(RSV1,N1,1); D:=SMA(K,N1,1); A2:=K>D; LC:=REF(CLOSE,1); RSI1:=(SMA(MAX(CLOSE-LC,0),N2,1))/(SMA(ABS(CLOSE-LC),N2,1))*100; RSI2:=(SMA(MAX(CLOSE-LC,0),N4,1))/(SMA(ABS(CLOSE-LC),N4,1))*100; A3:=RSI1>RSI2; RSV:=-(HHV(HIGH,N4)-CLOSE)/(HHV(HIGH,N4)-LLV(LOW,N4))*100; LWR1:=SMA(RSV,N1,1); LWR2:=SMA(LWR1,N1,1); A4:=LWR1>LWR2; BBI:=(MA(CLOSE,N1)+MA(CLOSE,N2)+MA(CLOSE,N3)+MA(CLOSE,N4))/4; A5:=CLOSE>BBI; MTM:=CLOSE-REF(CLOSE,1); MMS:=100*EMA(EMA(MTM,N2),N1)/EMA(EMA(ABS(MTM),N2),N1); MMM:=100*EMA(EMA(MTM,N4),N3)/EMA(EMA(ABS(MTM),N4),N3); A6:=MMS>MMM; {FILLRGN(c>0,0,-20),color00bb00;} STICKLINE(A1 AND A2 AND A3 AND A4 AND A5 AND A6,-15,-10,10,0),COLORYELLOW; EM3:=EMA(C,3); EM5:=EMA(C,5); STICKLINE(EM3>=REF(EM3,1) AND EM3>=EM5,-13,-5,6,0),COLORMAGENTA; V2:=LLV(LOW,10); V3:=HHV(HIGH,25); 多:=EMA((CLOSE-V2)/(V3-V2)*4,4)*30; {FILLRGN(c>0,0,多),color007D2F;} RSV2:= (HHV(HIGH,11)-CLOSE)/(HHV(HIGH,11)-LLV(LOW,11))*60; 空:=SMA(RSV2,3,1); 慢空:=SMA(空,3,1); Y:=((HIGH + LOW) / 2); AO:=(MA(Y,5) - MA(Y,34));DU0:=CROSS(AO,0); UD0:=CROSS(0,AO); TDU0:=BARSLAST(DU0); TUD0:=BARSLAST(UD0); DU3:=REF(DU0,1); UD3:=REF(UD0,1); TDU3:=BARSLAST(DU3); TUD3:=BARSLAST(UD3); UDGLINE:=IF((TDU3 < TUD3),REF(HHV(HIGH,2),TDU3),REF(LLV(LOW,2),TUD3)); JDU0:=(((REF(CLOSE,1) <= REF(UDGLINE,1)) AND (CLOSE > UDGLINE)) AND (TDU0 < TUD0)); JUD0:=(((REF(CLOSE,1) >= REF(UDGLINE,1)) AND (CLOSE < UDGLINE)) AND (TUD0 < TDU0)); JDU1:=(JDU0 AND (COUNT(JDU0,TDU0) = 1)); JUD1:=(JUD0 AND (COUNT(JUD0,TUD0) = 1)); JDU2:=(JDU1 AND (REF(BARSLAST(JUD1),1) < REF(BARSLAST(JDU1),1))); JUD2:=(JUD1 AND (REF(BARSLAST(JUD1),1) > REF(BARSLAST(JDU1),1))); JDU3:=(JDU1 AND (REF(BARSLAST(JUD1),1) > REF(BARSLAST(JDU1),1))); JUD3:=(JUD1 AND (REF(BARSLAST(JUD1),1) < REF(BARSLAST(JDU1),1))); DRAWTEXT(JDU2,-8,'空转多'),COLORRED; DRAWTEXT(JUD2,-8,'多转空'),COLORGREEN; DRAWTEXT(JDU3,-8,'多续多'),COLORMAGENTA; DRAWTEXT(JUD3,-8,'空续空'),COLORBLUE; DRAWICON((JDU1 OR (BARSLAST(JDU1)<BARSLAST(JUD1))),-1,12),ALIGN1,LAYER1; DRAWICON((JUD1 OR (BARSLAST(JDU1)>BARSLAST(JUD1))),-1,13),ALIGN1,LAYER1; DRAWICON(CROSS(多,空),-4,7),ALIGN1,LAYER0;{红箭头看多} DRAWICON(CROSS(空,慢空),-4,8),ALIGN1,LAYER0;{绿箭头看空} A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1)); B3:=REF(CLOSE,A3+1)>CLOSE AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2"); DRAWTEXT(B3>0,-6,'底'),align1,COLORcyan,LAYER0;{RSI底背离} C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1)); D3:=REF(CLOSE,C3+1)<CLOSE AND REF("RSI.RSI1",C3)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1"); DRAWTEXT(D3>0,90,'顶'),align1,COLORMAGENTA;{RSI顶背离} 量能:EMA(100*(CLOSE-LLV(LOW,31))/(HHV(HIGH,31)-LLV(LOW,31)),3)/4,STICK; stickline(量能,0,量能,8,0),COLORWHITE; 波动线:3*SMA((C-LLV(L,13))/(HHV(H,13)-LLV(L,13))*100,5,1)-2*SMA(SMA((C-LLV(L,13))/(HHV(H,13)-LLV(L,13)) *100,5,1),3,1),COLOR0000FF; 强势:21,COLORblue;{能量强势} stickline(量能<1,0,30,5,0),colorred;{能量底部考虑出击} 持仓:=EMA(100*(CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30)),9); 集中度:=EMA(持仓,1); 做多:EMA(集中度,1),colorred,linethick3; |