在实时图叠加股票在参数输入代码后,应点“设为缺省参数”才能变换叠加的股票,否则叠加的是公式设定的'1A0001',在其他分析周期输入代码后点确定即可。
引用公式 “001”
c1:c;
o1;
h1:h;
l1:l;
rcYNAINFO(3);
vv:v;
jh:AMOUNT/10000;
hs:v/CAPITAL*100;
zc/ref(c,1)-1)*100;
TATE;
//////////////////////////////////////////////
“任意股票叠加”
INPUT:代码(0,0,999999);
X:='a';
IF 代码<10 THEN
X:='00000';
IF 代码>10 THEN
X:='0000';
IF 代码>100 THEN
X:='000';
IF 代码>1000 THEN
X:='00';
IF 代码>10000 THEN
X:='0';
IF 代码<=99999 THEN
x:=x+NUMTOSTR(代码,0);
IF 代码>99999 THEN
x:=NUMTOSTR(代码,0);
IF 代码=0 THEN
x:='1A0001';
DRAWTEXT(SYSPARAM(2)=BARPOS,h,'叠加:'+x+' '+STKNAMEEX(x))ALIGN4,COLORWHITE;
T:=BARSLAST(SYSPARAM(2)=BARPOS);
T1:=STKINDI(x,'001.T',0,DATAPERIOD);
T2:=BARSLAST(T1=DATE);
开:STKINDI(x,'001.o1',0,DATAPERIOD),LINETHICK;
高:STKINDI(x,'001.h1',0,DATAPERIOD),LINETHICK;
低:STKINDI(x,'001.l1',0,DATAPERIOD),LINETHICK;
收:STKINDI(x,'001.c1',0,DATAPERIOD),LINETHICK;
涨:STKINDI(x,'001.z',0,DATAPERIOD),LINETHICK,PRECISION2;
换:STKINDI(x,'001.hs',0,DATAPERIOD),LINETHICK,PRECISION2,COLORGRAY;
量:=STKINDI(x,'001.vv',0,DATAPERIOD),LINETHICK,PRECISION0,COLORGRAY;
额:=STKINDI(x,'001.jh',0,DATAPERIOD),LINETHICK,PRECISION0,COLORGRAY;
C1:=REF(C,T);
CC:=IF(T1=DATE,(收/REF(收,T)-1)*C1+C1,REF((收/REF(收,T)-1)*C1+C1,T2));
OO:=IF(T1=DATE,(开/REF(收,T)-1)*C1+C1,REF((收/REF(收,T)-1)*C1+C1,T2));
HH:=IF(T1=DATE,(高/REF(收,T)-1)*C1+C1,REF((收/REF(收,T)-1)*C1+C1,T2));
LL:=IF(T1=DATE,(低/REF(收,T)-1)*C1+C1,REF((收/REF(收,T)-1)*C1+C1,T2));
k:=BARPOS;
k1:=k[datacount];
zrc:=STKINDI(x,'001.rc',0,DATAPERIOD);
grc1:=DYNAINFO(3);
go:=DYNAINFO(4);
gf1:=abs(DYNAINFO(14)*100);
grc:=if(k1=1 OR gf1>=11,go,grc1);
gfh:=(h/grc-1)*100;
gfl:=abs((l/grc-1)*100);
gf2:=hhv(abs(max(gfh,gfl)),0);
zfh:=(收/zrc-1)*100;
zfl:=abs((收/zrc-1)*100);
zf1:=hhv(abs(max(zfh,zfl)),0);
gf1:=if(gf1>=11,min(gf1,gf2),max(gf1,gf2));
gf:=gf1[datacount];
Zf:=Zf1[datacount];
bl:=gf/zf;
zs:=(1+(收/zrc-1)*bl)*grc;
jj1:=sum(zs*量,0)/sum(量,0);
jj2:=(1+(sum(额,0)/sum(量,0)*100/zrc-1)*bl)*grc;
jj:=IF(代码=0 OR 代码=399001,jj1,jj2);
m5:ma(收,5),PRECISION2,LINETHICK;
m10:ma(收,10),PRECISION2,LINETHICK;
m30:ma(收,30),PRECISION2,LINETHICK;
m60:ma(收,60),PRECISION2,LINETHICK;
if(DATATYPE>=0 and DATATYPE<=12,ma(cc,5),zs)PRECISION2;
if(DATATYPE>=0 and DATATYPE<=12,ma(cc,10),jj)PRECISION2,COLORMAGENTA;
kxx:=(zs>=ref(zs,1));
PARTLINE(kxx,zs),COLORMAGENTA;
PARTLINE(not(kxx),zs),COLORGREEN;
if DATATYPE>=0 and DATATYPE<=12 then begin
kx:=(CC>OO or CC=OO and CC>ref(CC,1));
stickline(kx,HH,LL,0.1,1),COLORRED;
stickline(kx,CC,OO,8,1),COLORRED;
stickline(not(kx),HH,LL,0.1,0),COLORCYAN;
stickline(not(kx),CC,OO,8,0),COLORCYAN;
ma(cc,5);
ma(cc,10);
ma5:ma(c,5);
ma10:ma(c,10);
ma30:ma(c,30);
end;
|