程序源碼 DRAWGBK(CLOSE>0,RGB(21,20,44),RGB(61,35,54),0,0,1); LI:=1230927; X:=IF(DATE<LI,1,DRAWNULL); DRAWTEXT_FIX(DATE>=LI,0.9,0.9,0,'TIME OUT'); S:=2.7*X; BK1:=STRCAT(HYBLOCK,' '); BK2:=STRCAT(BK1,DYBLOCK); BK3:=STRCAT(BK2,' '); BK4:=STRCAT(BK3,GNBLOCK); DRAWTEXT_FIX(ISLASTBAR,0.0,0.01,0,STRCAT('所屬板塊:',BK4)),COLORFFFF00; STICKLINE(C>O,H,L,0,0),COLORRED; STICKLINE(C>O,O,C,S,0),COLOR000088; STICKLINE(C>O,O,C,S/2,0),COLOR0000AA; STICKLINE(C>O,O,C,S/3,0),COLOR0000CC; STICKLINE(C>O,O,C,S/6,0),COLOR0000FF; STICKLINE(C<O,H,L,0,0),COLOR888800; STICKLINE(C<O,O,C,S,0),COLOR888800; STICKLINE(C<O,O,C,S/2,0),COLORAAAA00; STICKLINE(C<O,O,C,S/3,0),COLORCCCC00; STICKLINE(C<O,O,C,S/6,0),COLORFFFF00; STICKLINE(C=O,H,L,0,0),COLORWHITE; STICKLINE(C=O,O,C,S,0),COLORWHITE; STICKLINE(C=O,H,L,0,0),COLORWHITE; RR:=EMA(100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34)),3)/4*X; 趨勢線:EMA((MA(C,3)+MA(C,5)+MA(C,8)*2+MA(C,13)*3+MA(C,21)*5)/12,8)*X,COLORLIRED,LINETHICK2; 空:IF(C<趨勢線,趨勢線,DRAWNULL),COLORGREEN,LINETHICK2; ZT:=100*(C-REF(C,1))/REF(C,1)>10-0.01/REF(C,1); DRAWTEXT(crOSS(RR,2),L*0.99,'底'),COLORYELLOW; {DRAWICON(CROSS(RR,2),L*0.99,11);} DRAWICON(CROSS(RR,5),L*0.99,7); DRAWICON(CROSS(23.16,RR),H*1.015,8); X_2:=CROSS(RR,5); STICKLINE(X_2,LOW,HIGH,0,0),COLOR0088EE; STICKLINE(X_2,CLOSE,OPEN,S,0),COLOR0055AA; STICKLINE(X_2,CLOSE,OPEN,S/2,0),COLOR0099EE; STICKLINE(X_2,CLOSE,OPEN,S/3,0),COLOR00AAFF; STICKLINE(X_2,CLOSE,OPEN,S/6,0),COLORYELLOW; VAR2:=LLV(LOW,33); VAR3:=HHV(HIGH,21); VAR4:=EMA((CLOSE-VAR2)/(VAR3-VAR2)*100,10)*-1+100; 風(fēng)險系數(shù):100-EMA(0.191*REF(VAR4,1)+0.809*VAR4,1)*X,NODRAW; 換手:=DYNAINFO(37)*100; macd共振:=MacD.MACD>=REF(MACD.MACD,1) AND REF(MACD.MACD,1)<REF(MACD.MACD,2); SCORE1:=IF(LLV(V,3)=LLV(V,10),1,0);{3天內(nèi)出現(xiàn)地量} SCORE2:=IF(LLV(L,5)/MA(C,5)<=0.921,1,0); {超跌偏離5日線較遠或者剛站上5日線} SCORE3:=IF(COUNT(MACD共振 OR CROSS(MACD.DIF,MACD.DEA),3)>=1,1,0);{3天內(nèi)MACD共振} SCORE4:=IF(C>=REF(C,1)*1.03 AND REF(C,1)<REF(C,2),1,0);{收盤價底分型} SCORE5:=IF(COUNT(EVERY(C<REF(C,4),9),5)>=1,1,0);{5天存在9轉(zhuǎn)序列} SCORE:=SCORE1+SCORE2+SCORE3+SCORE4+SCORE5*X; {反轉(zhuǎn)星級:SCORE,NODRAW;} 反轉(zhuǎn)評分:=IF(SCORE=5,'☆☆☆☆☆',IF(SCORE=4,'☆☆☆☆',IF(SCORE=3,'☆☆☆',IF(SCORE=2,'☆☆',IF(SCORE=1,'☆',DRAWNULL))))); {底分型:=H>REF(H,1) AND L>REF(L,1) AND REF(H,1)<REF(H,2) AND REF(L,1)<REF(L,2); DRAWTEXT(REF(EVERY(C<REF(C,4),9),1) AND C>=REF(C,4),L*0.99,'←9轉(zhuǎn)'),COLORYELLOW; DRAWTEXT(底分型 AND MACD共振 AND C/REF(C,1)>=1.05,L*0.99,'←底分型'),COLORFF00FF;} DRAWTEXT_FIX(V>O,0.888,0.80,0,STRCAT('風(fēng)險系數(shù):',STRCAT(CON2STR(風(fēng)險系數(shù),2),' '))),COLORFFFFFF; DRAWTEXT_FIX(V>O,0.888,0.85,0,STRCAT('參考:',STRCAT(CON2STR(LLV(風(fēng)險系數(shù),250),2),STRCAT('~',CON2STR(HHV(風(fēng)險系數(shù),250),2))))),COLORA6E500; {DRAWTEXT_FIX(V>O,0.888,0.90,0,STRCAT('反轉(zhuǎn)星級:',反轉(zhuǎn)評分)),COLORLIRED;}; 注: 館內(nèi)各種公式為學(xué)習(xí)編程而保存,實戰(zhàn)使用前一定要看其中是否有未來函數(shù)并自己親自測試成功率,決不能依據(jù)公式名稱的描述和形容去投資,據(jù)此入市造成投資損失由投資者自己承擔(dān)。 發(fā)文不易,如獲益,歡迎贊賞,贊賞必復(fù)! |
|
來自: 追夢文庫 > 《風(fēng)險管理控制》