异动停牌监控副图指标源码分享
{标记最近10日}
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;
来函数检测结果如下:
该公式没有未来函数
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
{标记最近10日}DRAWICON(V=CONST(9日前的V),1,22)
STICKLINE(V=CONST(9日前的V),0,0.9,0.5,0),COLORFFFFFF
DRAWNUMBER(V=CONST(8日前的V),1,9)
DRAWNUMBER(V=CONST(7日前的V),1,8)
DRAWNUMBER(V=CONST(6日前的V),1,7)
DRAWNUMBER(V=CONST(5日前的V),1,6)
DRAWNUMBER(V=CONST(4日前的V),1,5)
DRAWNUMBER(V=CONST(3日前的V),1,4)
DRAWNUMBER(V=CONST(2日前的V),1,3)
DRAWNUMBER(V=CONST(1日前的V),1,2)
DRAWNUMBER(V=CONST(0日前的V),1,1)
{计算10日、30日涨幅停牌}距10日停牌需涨赋值:100-(C-9日前的C)/9日前的C*100,NODRAW
距30日停牌需涨赋值:200-(C-29日前的C)/29日前的C*100,NODRAW
DRAWTEXT_FIX(ISLASTBAR AND 距10日停牌需涨>=20,0.00,0.06,0,STRCAT('距10日停牌还需涨幅:',STRCAT(CON2STR(距10日停牌需涨,2),' %'))),画白色
DRAWTEXT_FIX(ISLASTBAR AND 距10日停牌需涨<20,0.00,0.06,0,STRCAT('距10日停牌还需涨幅:',STRCAT(CON2STR(距10日停牌需涨,2),' %'))),画绿色
DRAWTEXT_FIX(ISLASTBAR AND 距30日停牌需涨>=20,0.00,0.26,0,STRCAT('距30日停牌还需涨幅:',STRCAT(CON2STR(距30日停牌需涨,2),' %'))),画白色
DRAWTEXT_FIX(ISLASTBAR AND 距30日停牌需涨<20,0.00,0.26,0,STRCAT('距30日停牌还需涨幅:',STRCAT(CON2STR(距30日停牌需涨,2),' %'))),画绿色
{计算异动}个股0赋值:C
个股1赋值:1日前的C
个股2赋值:2日前的C
个股3赋值:3日前的C
标指0赋值:IF(CODELIKE('00'),"399107$C",IF(CODELIKE('60'),"999998$C",IF(CODELIKE('30'),"399102$C",IF(CODELIKE('68'),"000688$C",0))))
标指1赋值: 1日前的标指0
标指2赋值: 2日前的标指0
标指3赋值: 3日前的标指0
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),
如果S1=2 OR S2=3返回1否则返回0
S22:=IF(S1+S2=5,1,IF(S2=3,2,1))
A1赋值:S21 AND 1日前的S21=0 AND 2日前的S21=0
当满足条件A1时,在0和0.5之间画柱状线
A2赋值:上次A1距今天数,NODRAW
A21:=S21 AND 1日前的A1=0 AND S22日前的A1=0
A22:=A21 AND 1日前的A21=0 AND S22日前的A21=0
当满足条件A22时,在0和0.5之间画柱状线
A3赋值:上次A22距今天数,NODRAW
A31:=S21 AND 1日前的A22=0 AND S22日前的A22=0
A32:=A31 AND 1日前的A31=0 AND S22日前的A31=0
当满足条件A32时,在0和0.5之间画柱状线
A4赋值:上次A32距今天数,NODRAW
A41:=S21 AND 1日前的A32=0 AND S22日前的A32=0
A42:=A41 AND 1日前的A41=0 AND S22日前的A41=0
当满足条件A42时,在0和0.5之间画柱状线
A5赋值:上次A42距今天数,NODRAW
A51:=S21 AND 1日前的A42=0 AND S22日前的A42=0
A52:=A51 AND 1日前的A51=0 AND S22日前的A51=0
当满足条件A52时,在0和0.5之间画柱状线
{今日涨幅界限}今一日涨幅界限赋值:(((20+((标指0/标指1)-1)*100)/100+1)*个股1/个股1-1)*100,画洋红色,NODRAW
今两日涨幅界限赋值:(((20+((标指0/标指2)-1)*100)/100+1)*个股2/个股1-1)*100,画洋红色,NODRAW
今三日涨幅界限赋值:(((20+((标指0/标指3)-1)*100)/100+1)*个股3/个股1-1)*100,画洋红色,NODRAW
输出{今一日涨幅界限:20-((个股0/个股1)-1)*100-((标指0/标指1)-1)*100+((个股0/个股1)-1)*100+((标指0/标指1)-1)*100,画洋红色,NODRAW
输出今两日涨幅界限:20-((个股0/个股2)-1)*100-((标指0/标指2)-1)*100+((个股1/个股2)-1)*100+((标指1/标指2)-1)*100,画洋红色,NODRAW
输出今三日涨幅界限:20-((个股0/个股3)-1)*100-((标指0/标指3)-1)*100+((个股1/个股3)-1)*100+((标指1/标指3)-1)*100,画洋红色,NODRAW
如果今两日涨幅界限-今三日涨幅界限>0返回今三日涨幅界限否则返回今两日涨幅界限
B1赋值:IF(A2=1 OR A3=1 OR A4=1 OR 上次A42距今天数=1,今一日涨幅界限,0),NODRAW
B2赋值:IF(A2=2 OR A3=2 OR A4=2 OR 上次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),' %')))画白色
DRAWTEXT_FIX(ISLASTBAR AND 今异动涨幅界限<=10,0.20,0.06,0,STRCAT('今涨幅异动界限:',STRCAT(CON2STR(今异动涨幅界限,2),' %')))画绿色
{明日涨停是否会触发异动}明一日涨幅异动赋值:((ZTPRICE(C,0.1)/0日前的C)-1)*100-((标指0/标指0)-1)*100,NODRAW
明两日涨幅异动赋值:((ZTPRICE(C,0.1)/1日前的C)-1)*100-((标指0/标指1)-1)*100,NODRAW
明三日涨幅异动赋值:((ZTPRICE(C,0.1)/2日前的C)-1)*100-((标指0/标指2)-1)*100,NODRAW
如果明两日涨幅异动-明三日涨幅异动>0返回明两日涨幅异动否则返回明三日涨幅异动
如果A1 OR A22 OR A32 OR A42返回1否则返回0
B5赋值:IF(A2=1 OR A3=1 OR A4=1 OR 上次A42距今天数=1,今两日涨幅界限,0),NODRAW
B6赋值:IF(B4,B4,IF(B5,B5,B3)),NODRAW
如果B6>19.9返回1否则返回0
DRAWTEXT_FIX(ISLASTBAR AND 明涨停是否异动=0,0.20,0.26,0,STRCAT('明涨停是否异动:','否')),画白色
DRAWTEXT_FIX(ISLASTBAR AND 明涨停是否异动=1,0.20,0.26,0,STRCAT('明涨停是否异动:','是')),画绿色
{今日涨幅}今涨幅赋值:(C/1日前的C-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
{十日内异动次数 公式源码 }十日内异动次数赋值:统计10日满足A1 OR A22 OR A32 OR A42的天数
DRAWTEXT_FIX(ISLASTBAR AND 十日内异动次数=0,0.40,0.06,0,STRCAT('十日内异动次数:',STRCAT(CON2STR(十日内异动次数,0),' 次')))画白色
DRAWTEXT_FIX(ISLASTBAR AND 十日内异动次数>0,0.40,0.06,0,STRCAT('十日内异动次数:',STRCAT(CON2STR(十日内异动次数,0),' 次')))画绿色