{标记最近10日}{九毛八公式指标网www.9m8.cn}
DRAWICON(V=CONST(REF(V,9)),1,22);STICKLINE(V=CONST(REF(V,9)),0,0.9,0.5,0),COLORFFFFFF;
DRAWNUMBER(V=CONST(REF(V,8)),1,9);
DRAWNUMBER(V=CONST(REF(V,7)),1,8);
DRAWNUMBER(V=CONST(REF(V,6)),1,7);
DRAWNUMBER(V=CONST(REF(V,5)),1,6);
DRAWNUMBER(V=CONST(REF(V,4)),1,5);
DRAWNUMBER(V=CONST(REF(V,3)),1,4);
DRAWNUMBER(V=CONST(REF(V,2)),1,3);
DRAWNUMBER(V=CONST(REF(V,1)),1,2);
DRAWNUMBER(V=CONST(REF(V,0)),1,1);
{计算10日、30日涨幅停牌}
距10日停牌需涨:=100-(C-REF(C,9))/REF(C,9)*100,NODRAW;
距30日停牌需涨:=200-(C-REF(C,29))/REF(C,29)*100,NODRAW;
DRAWTEXT_FIX(ISLASTBAR AND 距10日停牌需涨 =20,0.00,0.06,0,STRCAT('距10日停牌还需涨幅:',STRCAT(CON2STR(距10日停牌需涨,2),' %'))),COLORWHITE;
DRAWTEXT_FIX(ISLASTBAR AND 距10日停牌需涨 20,0.00,0.06,0,STRCAT('距10日停牌还需涨幅:',STRCAT(CON2STR(距10日停牌需涨,2),' %'))),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR AND 距30日停牌需涨 =20,0.00,0.26,0,STRCAT('距30日停牌还需涨幅:',STRCAT(CON2STR(距30日停牌需涨,2),' %'))),COLORWHITE;
DRAWTEXT_FIX(ISLASTBAR AND 距30日停牌需涨 20,0.00,0.26,0,STRCAT('距30日停牌还需涨幅:',STRCAT(CON2STR(距30日停牌需涨,2),' %'))),COLORGREEN;
{计算异动}
个股0:=C;
个股1:=REF(C,1);
个股2:=REF(C,2);
个股3:=REF(C,3);
标指0:=IF(CODELIKE('00'), 399107$C ,IF(CODELIKE('60'), 999998$C ,IF(CODELIKE('30'), 399102$C ,IF(CODELIKE('68'), 000688$C ,0))));
标指1:=REF(标指0, 1);
标指2:=REF(标指0, 2);
标指3:=REF(标指0, 3);
S1:=IF((((个股0/个股2)-1)*100-((标指0/标指2)-1)*100) 20,2,0),;
S2:=IF((((个股0/个股3)-1)*100-((标指0/标指3)-1)*100) 20,3,0),;
S21:=IF(S1=2 OR S2=3,1,0);
S22:=IF(S1+S2=5,1,IF(S2=3,2,1));
A1:=S21 AND REF(S21,1)=0 AND REF(S21,2)=0;
STICKLINE(A1,0,0.5,3,0),COLORMAGENTA;
A2:=BARSLAST(A1),NODRAW;
A21:=S21 AND REF(A1,1)=0 AND REF(A1,S22)=0;
A22:=A21 AND REF(A21,1)=0 AND REF(A21,S22)=0;
STICKLINE(A22,0,0.5,3,0),COLORMAGENTA;
A3:=BARSLAST(A22),NODRAW;
A31:=S21 AND REF(A22,1)=0 AND REF(A22,S22)=0;
A32:=A31 AND REF(A31,1)=0 AND REF(A31,S22)=0;
STICKLINE(A32,0,0.5,3,0),COLORMAGENTA;
A4:=BARSLAST(A32),NODRAW;
A41:=S21 AND REF(A32,1)=0 AND REF(A32,S22)=0;
A42:=A41 AND REF(A41,1)=0 AND REF(A41,S22)=0;
STICKLINE(A42,0,0.5,3,0),COLORMAGENTA;
A5:=BARSLAST(A42),NODRAW;
A51:=S21 AND REF(A42,1)=0 AND REF(A42,S22)=0;
A52:=A51 AND REF(A51,1)=0 AND REF(A51,S22)=0;
STICKLINE(A52,0,0.5,3,0),COLORMAGENTA;
{今日涨幅界限}
今一日涨幅界限:=(((20+((标指0/标指1)-1)*100)/100+1)*个股1/个股1-1)*100,COLORMAGENTA,NODRAW;
今两日涨幅界限:=(((20+((标指0/标指2)-1)*100)/100+1)*个股2/个股1-1)*100,COLORMAGENTA,NODRAW;
今三日涨幅界限:=(((20+((标指0/标指3)-1)*100)/100+1)*个股3/个股1-1)*100,COLORMAGENTA,NODRAW;
{
今一日涨幅界限:20-((个股0/个股1)-1)*100-((标指0/标指1)-1)*100+((个股0/个股1)-1)*100+((标指0/标指1)-1)*100,COLORMAGENTA,NODRAW;
今两日涨幅界限:20-((个股0/个股2)-1)*100-((标指0/标指2)-1)*100+((个股1/个股2)-1)*100+((标指1/标指2)-1)*100,COLORMAGENTA,NODRAW;
今三日涨幅界限:20-((个股0/个股3)-1)*100-((标指0/标指3)-1)*100+((个股1/个股3)-1)*100+((标指1/标指3)-1)*100,COLORMAGENTA,NODRAW;
}
B:=IF(今两日涨幅界限-今三日涨幅界限 0,今三日涨幅界限,今两日涨幅界限);
B1:=IF(A2=1 OR A3=1 OR A4=1 OR BARSLAST(A42)=1,今一日涨幅界限,0),NODRAW;
B2:=IF(A2=2 OR A3=2 OR A4=2 OR BARSLAST(A42)=2,今两日涨幅界限,0),NODRAW;
今异动涨幅界限:IF(B1,B1,IF(B2,B2,B)),NODRAW;
DRAWTEXT_FIX(ISLASTBAR AND 今异动涨幅界限 10,0.20,0.06,0,STRCAT('今涨幅异动界限:',STRCAT(CON2STR(今异动涨幅界限,2),' %')))COLORWHITE;
DRAWTEXT_FIX(ISLASTBAR AND 今异动涨幅界限 =10,0.20,0.06,0,STRCAT('今涨幅异动界限:',STRCAT(CON2STR(今异动涨幅界限,2),' %')))COLORGREEN;
{明日涨停是否会触发异动}
明一日涨幅异动:=((ZTPRICE(C,0.1)/REF(C,0))-1)*100-((标指0/标指0)-1)*100,NODRAW;
明两日涨幅异动:=((ZTPRICE(C,0.1)/REF(C,1))-1)*100-((标指0/标指1)-1)*100,NODRAW;
明三日涨幅异动:=((ZTPRICE(C,0.1)/REF(C,2))-1)*100-((标指0/标指2)-1)*100,NODRAW;
B3:=IF(明两日涨幅异动-明三日涨幅异动 0,明两日涨幅异动,明三日涨幅异动),NODRAW;
B4:=IF(A1 OR A22 OR A32 OR A42,1,0),NODRAW;
B5:=IF(A2=1 OR A3=1 OR A4=1 OR BARSLAST(A42)=1,今两日涨幅界限,0),NODRAW;
B6:=IF(B4,B4,IF(B5,B5,B3)),NODRAW;
明涨停是否异动:=IF(B6 19.9,1,0);
DRAWTEXT_FIX(ISLASTBAR AND 明涨停是否异动=0,0.20,0.26,0,STRCAT('明涨停是否异动:','否')),COLORWHITE;
DRAWTEXT_FIX(ISLASTBAR AND 明涨停是否异动=1,0.20,0.26,0,STRCAT('明涨停是否异动:','是')),COLORGREEN;
{今日涨幅}
今涨幅:=(C/REF(C,1)-1)*100;
DRAWTEXT_FIX(ISLASTBAR AND 今涨幅 0,0.40,0.26,0,STRCAT('今涨幅::',STRCAT(CON2STR(今涨幅,2),' %'))),COLORFF00FF;
DRAWTEXT_FIX(ISLASTBAR AND 今涨幅 =0,0.40,0.26,0,STRCAT('今涨幅::',STRCAT(CON2STR(今涨幅,2),' %'))),COLOR00FF00;
{十日内异动次数}
十日内异动次数:=COUNT(A1 OR A22 OR A32 OR A42,10);
DRAWTEXT_FIX(ISLASTBAR AND 十日内异动次数=0,0.40,0.06,0,STRCAT('十日内异动次数:',STRCAT(CON2STR(十日内异动次数,0),' 次')))COLORWHITE;
DRAWTEXT_FIX(ISLASTBAR AND 十日内异动次数 0,0.40,0.06,0,STRCAT('十日内异动次数:',STRCAT(CON2STR(十日内异动次数,0),' 次')))COLORGREEN;