MALHJ公式源码加个股板块领涨排行组合源码(十一专版),话不多说,直接上源码,但要建立分时公式调用,要注意步骤. 第一步先建MALHJ主图公式,源码如下:MA3:MA(CLOSE,20); LHJ估值:FINANCE(34)*(FINANCE(30)/FINANCE(19))*100,COLOR00FFFF,NODRAW; MA4:MA(CLOSE,60),COLORGREEN; MA5:MA(CLOSE,120),COLORYELLOW; LH:=100-EMA((HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34))*100,34); J:=EMA(LH,21); 牛点:C>MA(C,60) AND LH>REF(LH,1) AND V/REF(V,2)>2 AND C/MA(C,60)<1.20 AND DYNAINFO(37)*100>4 AND C/REF(C,1)>1.04,NODRAW; DRAWICON(牛点=1,H*1.01,30); 二维启动:REF(C,3)>MA(C,60) AND REF(V,3)/REF(V,5)>2 AND REF(C,3)/REF(C,4)>1.04 AND REF(DYNAINFO(37)*100,3)>4 AND C/MA(C,60)<1.20 AND C/REF(C,1)>1.04 AND DYNAINFO(37)*100>4,NODRAW; DRAWICON(二维启动=1,H*1.02,29); N:=20; HL:=HHV(H,N)/LLV(L,N)<1.30; HLN:=COUNT(HL=1,N)=N; DRAWSL(REF(HLN,1)=1 AND REF(HL,1)>HL AND C>MA(C,20),L,0,20,1),COLORRED; DRAWICON(REF(HLN,1)=1 AND REF(HL,1)>HL AND C>MA(C,20),L,11); DRAWTEXT(REF(HLN,1)=1 AND REF(HL,1)>HL AND C>MA(C,20),LOW*0.9,LOW),LINETHICK2, COLORYELLOW; RH:=20; MHJ:=C/MA(C,20)>1 AND MA(C,60)/MA(C,120)>1;{多头排列} MYXR:=C/MA(C,60)<1.1 AND C/MA(C,20)<1.20;{浮动区间} MYRH:=COUNT(MYXR,RH)=RH;{多头横盘多久} DRAWSL(REF(MYXR,1)>MYXR AND REF(MYRH,1)=1 AND MHJ=1,L,0,20,1),LINETHICK3; DIF:=EMA(CLOSE,12)-EMA(CLOSE,26); DEA:=EMA(EMA(CLOSE,12)-EMA(CLOSE,26),9); DYRH:=EMA(C-O,26); DYXR:=EMA(EMA(2*C-O,26)-EMA(C,5),9); DRAWTEXT_FIX(1,0.30,0,0,STRCAT('净利润:',CON2STR(FINANCE(30)/10000,2))),COLORRED; DRAWTEXT_FIX(1,0.45,0,0,STRCAT('同比增长:',CON2STR(FINANCE(43),2))),COLORRED; LHHY:HORCALC(HYBLOCK,105,1,0),NODRAW ; LHHZ:(HY_INDEXC/HY_INDEXO-1)*100,NODRAW ; PPZH:STRCAT(HYBLOCK,' 行业排名 :'),NODRAW ; DRAWTEXT_FIX(1,0.66,0,0,STRCAT(PPZH,CON2STR(LHHY,0))),COLORWHITE; DRAWTEXT_FIX(1,0.77,0,0,STRCAT('板块涨幅: ',CON2STR(LHHZ,3))),COLORLIRED; 第二步,建立了以上<<MALHJ>>主图公式后,退出一下通达信,再打开通达信,再建立<<LHJ分时>>公式或者用其他名字代码不影响.源码如下:AA:=ZSTJJ; AB:DYNAINFO(3)*1.05; AC:DYNAINFO(4)*1.02; 成交额:= AMOUNT/10000,NODRAW; 主动买盘:=SUM(IF(成交额>50 AND CLOSE>REF(CLOSE,1),成交额,0),0); 主动卖盘:=SUM(IF(成交额>50 AND CLOSE<REF(CLOSE,1),成交额,0),0); 净流:=SUM(IF(CLOSE>REF(CLOSE,1),成交额,IF(CLOSE<REF(CLOSE,1),-成交额,0)),0), COLORSTICK; IF(净流>0 AND C>ZSTJJ,ZSTJJ,DRAWNULL),COLORRED,LINETHICK9; IF(净流<0 AND C<ZSTJJ,ZSTJJ,DRAWNULL),COLORGREEN,LINETHICK9; IF(C>0,C,DRAWNULL),COLORWHITE,LINETHICK9; 伏击:CROSS(C,AC),NODRAW; DRAWTEXT(伏击=1,C,'伏击'), COLORYELLOW; {行业板块龙头排名}; AE:'MALHJ.LHHY#DAY',NODRAW; AF:'MALHJ.LHHZ#DAY',NODRAW; DRAWTEXT_FIX(1,0.55,0.015,0,HYBLOCK),COLORWHITE; DRAWTEXT_FIX(1,0.68,0.015,0,STRCAT('龙头:',CON2STR(AE,0))),COLORWHITE; DRAWTEXT_FIX(1,0.77,0.015,0,STRCAT('板块涨幅:',CON2STR(AF,3))),COLORLIRED; 效果如下图: |
|