当前位置:首页 > 股票公式 > 飞狐公式

证券K线(副图源码)

时间:2019-04-20 09:41:40 来源:久久财经网 人气:

说明:叠加分析主图,飞狐4.9版本用,可能看不了创业板。

证券K线主图公式

{N-代码参数;M-证券类型参数。
M=0时,可显示深指、基金等,N=证券代码。如,399001则N=399001;
M=1时,可显示沪A,N=证券代码的6之后的实数部份。如,600001则N=1,特别600000则N=0;
M=2时,可显示深A,N=代码的实数部份。如,000008则N=8;
M=3时,可显示沪A指。N=代码A后的实数部份。如,1A0001则N=1;
M=4时,可显示沪B指。N=代码B后的实数部份。如,1B0007则N=7;
M=5时,可显示板块指数,N=代码AA后的实数部份。如,AA99则N=99;
M=6时,可显示板块指数,N=代码BB后的实数部份。如,BB01则N=1;}
INPUT:n(3,0,999999){(0,0,999999)},m(3,0,6){(1,0,6)};{证券K线**  B指}
{INPUT:n(16,0,999999){(0,0,999999)},m(4,0,6){(1,0,6),mm(900,1,2000)};{证券K线**  50指}}
{INPUT:n(399300,0,999999){(0,0,999999)},m(0,0,6){(1,0,6),mm(900,1,2000)};{证券K线**  300指}}

i:=if(m=1 or m=0,6,if(m=2,5,if(m=3 or m=4,4,2)));
s:=if(m=1,600000,if(m=2,100000,if(m=3 or m=4,10000,if(m=5 or m=6,100,0))));
u:=STRRIGHT(NUMTOSTR(n+s,0),i);
t:=if(m=1 or m=0,u,if(m=2,'0'+u,if(m=3,'1A'+u,if(m=4,'1B'+u,if(m=5,'AA'+u,'BB'+u)))));
cc:STKINDI(t,'KXSJ.cc',0,6),LINETHICK0;
oo:STKINDI(t,'KXSJ.oo',0,6),LINETHICK0;
hh:STKINDI(t,'KXSJ.hh',0,6),LINETHICK0;
LL:STKINDI(t,'KXSJ.LL',0,6),LINETHICK0;
DRAWTEXT(BARPOS=datacount-90,hh,'引用的证券名称和代码:'+STKNAMEEX(t)+' '+t)ALIGN4,Color57FFD8;
STICKLINE(cc>oo or (cc=oo and cc>=ref(cc,1)),hh,ll,0.6,0),COLORMAGENTA;
STICKLINE(cc>oo or (cc=oo and cc>=ref(cc,1)),cc,oo,6,1),COLORMAGENTA;
STICKLINE(cc<oo or (cc=oo and cc<ref(cc,1)),hh,ll,0.6,0),COLORGREEN;
STICKLINE(cc<oo or (cc=oo and cc<ref(cc,1)),cc,oo,6,0),COLORGREEN;
m5:ma(cc,5),COLORWHITE;
m1:ma(cc,10),COLORYELLOW;
vv:STKINDI(t,'KXSJ.DV',0,6),LINETHICK0;
r0:=mm/1000;
p:=SYSPARAM(3)-SYSPARAM(2);
q:=SYSPARAM(3);
zL:=LLv(LL,p);
XL:=ZL[q];
r:=(LL-r0*XL)/vv;
r1:=llv(r,p);
r2:=r1[q];
r3:=llv(LL-r2*vv,p);
r4:=r3[q];
r5:=(r2*vv+r4)*0.998;
STICKLINE(cc>=ref(cc,1),r5,r0*XL,5,1)COLORRED;
STICKLINE(cc<ref(cc,1),r5,r0*XL,5,0)COLORCYAN;
PARTLINE(1,r0*XL) colorbrown;
v5:ma(vv,5),LINETHICK0,COLORGREEN;
v10:ma(vv,10),LINETHICK0,COLORMAGENTA;
PARTLINE(1,ma(r5,5)),COLORGREEN;
PARTLINE(1,ma(r5,10)),COLORMAGENTA;
引用公式源码
{KXSJ}

cc:c,LINETHICK0;
oo:o,LINETHICK0;
hh:h,LINETHICK0;
LL:L,LINETHICK0;
dv:v,LINETHICK0;

 

下载地址: 证券K线

标签 实数   证券   代码   部份   显示   公式