wx:=MA(c,0);
M1:MA(CLOSE,P1);
M2:MA(CLOSE,P2)*if(n<2,wx,1);
M3:MA(CLOSE,P3)*if(n<3,wx,1);
M4:MA(CLOSE,P4)*if(n<4,wx,1);
M5:MA(CLOSE,P5)*if(n<5,wx,1);
M6:MA(CLOSE,P6)*if(n<6,wx,1);
M7:MA(CLOSE,P7)*if(n<7,wx,1);
M8:MA(CLOSE,P8)*if(n<8,wx,1);
急速超跌:=(C-MA(C,34))/MA(C,34)*100<-14;{34日乖离率}
筹码平衡线:REFX(REF(HHV(H,20),1),DATE),COLORRED;
A:=BARSLAST((VOL=HHV(VOL,21)));
A1:=A=0;
B:=SUMBARS(A1,1);
STICKLINE(B<=1,REF(OPEN,B-1)*1,REF(CLOSE,B-1),1,0),COLORyellow;
STICKLINE(B<=1,REF(HIGH,B-1)*1,REF(LOW,B-1),0.5,0),COLORyellow;
异动:=B<=1 AND REF(HIGH,B-1)*1 AND REF(LOW,B-1);
PARTLINE(BARSLAST(异动),REF(HIGH,BARSLAST(异动))),COLORCYAN,linethick1;
PARTLINE(BARSLAST(异动),REF(LOW,BARSLAST(异动))),COLORGREEN,linethick1;
fh:=high;
fl:=low;
sell:=0*fh;
buy:=sell;
signal:=sell;
boxh:sell,linethick0;
boxl:sell,linethick0;
variable:hc=0,lc=0,bt=fh[1],bb=fh[1];
for i=1 to datacount do begin
if hc>1 then begin
if lc>2 and bt<=fh then begin
buy:=1;
for j=i-1 downto i-hc do begin
boxh[j]:=fh[i-hc];
boxl[j]:=fl[i-lc];
end;
hc:=0;lc:=0;
end;
if bt>fh then begin
if lc>2 then begin
if bb>=fl then begin
sell:=1;
for j=i-1 downto i-hc do begin
boxh[j]:=fh[i-hc];
boxl[j]:=fl[i-lc];
end;
hc:=-1;lc:=0;
end else begin
boxh:=fh[i-hc];
boxl:=fl[i-lc];
end;
end;
hc:=hc+1;
if lc>1 then begin
if bb<fl then begin
lc:=lc+1;
if lc=3 then begin
signal[i-hc+1]:=1;
for j=i downto i-hc+1 do begin
boxh[j]:=fh[i-hc+1];
boxl[j]:=fl[i-lc+1];
end;
end;
end else lc:=0;
end else
if lc=1 then begin
if bb<fl then begin
lc:=lc+1;
end else lc:=0;
end;
if lc=0 and hc>1 then begin
bb:=fl;
lc:=lc+1;
end;
end else begin hc:=0; lc:=0; end;
end else
if hc=1 then begin
if bt>fh then
hc:=hc+1
else begin hc:=0;lc:=0; end;
end;
if hc=0 then begin
bt:=fh;
hc:=hc+1;
end;
end;
partline(boxh and boxh=ref(boxh,1),boxh),linedot,coloryellow;
partline(boxl and boxl=ref(boxl,1),boxl),linedot,coloryellow;
stickline((signal||refx(buy||sell,1))&&boxh,boxh,boxl,0.1,0),linedot,coloryellow;
drawicon(buy,low*0.98,4);
drawicon(sell,high*1.02,5);
DRAWNUMBER(refx(buy||sell,1)&&boxh,boxh,100*(boxh-boxl)/boxl,2) colorgreen;
DRAWNUMBER(refx(buy||sell,1)&&boxh,boxl,boxh-boxl ,2) colorwhite;
A1:=boxh and boxh=ref(boxh,1);
A2:=REFX(REF(A1=0,1) AND A1=1,1);
A3:=REFX(REF(A1=1,1) AND A1=0,1);
DRAWLINE(A2,boxl,A3,boxh,0),colorff9900;
DRAWLINE(A2,boxh,A3,boxl,0),colorgreen;
partline(boxh and boxh=ref(boxh,1),(boxh-boxl)/2+boxl),colorff9900;
stickline((signal||refx(buy||sell,1))&&boxh,boxh,boxl,0.1,0),linedot,coloryellow;
ZZ:=BACKSET(refx(buy||sell,1),BARSLAST(signal)/2);ZX:=REFX(REF(ZZ=0,1) AND ZZ=1,1);
DRAWLINE(signal,boxh,zx,boxl,0),linedot,colorgreen;
DRAWLINE(signal,boxh,refx(buy||sell,1),(boxh-boxl)/2+boxl,0),linedot,colorgreen;
DRAWLINE(signal,boxl,zx,boxh,0),linedot,colorff9900;
DRAWLINE(signal,boxl,refx(buy||sell,1),(boxh-boxl)/2+boxl,0),linedot,colorff9900;
DRAWLINE(signal,boxh,ISLASTBAR AND boxh>boxl,boxl,0),colorgreen;
DRAWLINE(signal,boxh,ISLASTBAR AND boxh>boxl,(boxh-boxl)/2+boxl,0),linedot,colorgreen;
DRAWLINE(signal,boxl,ISLASTBAR AND boxh>boxl,boxh,0),colorff9900;
DRAWLINE(signal,boxl,ISLASTBAR AND boxh>boxl,(boxh-boxl)/2+boxl,0),linedot,colorff9900;
ZA:=BACKSET(ISLASTBAR AND boxh>boxl,BARSLAST(signal)/2);ZB:=REFX(REF(ZA=0,1) AND ZA=1,1);
DRAWLINE(signal,boxh,zb,boxl,0),linedot,colorgreen;
DRAWLINE(signal,boxl,zB,boxh,0),linedot,colorff9900;
VAR3:=LLV(HIGH,240);
VAR4:=100*(CLOSE-VAR3)/VAR3;
VAR5:=(CLOSE-LLV(LOW,528))/(HHV(HIGH,528)-LLV(LOW,528))*100;
VAR6:=(CLOSE-LLV(CLOSE,530))/(HHV(CLOSE,530)-LLV(CLOSE,530))*100;
VAR7:=0;
VAR8:=SMA(MAX(CLOSE-REF(CLOSE,1),0),34,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),7,1)*100;
VAR9:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100;
VAR10:=IF(TROUGHBARS(3,16,1)=0 AND HIGH>LOW+0.04,4,0);
VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3);
VAR12:=ZIG(3,6)<REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)>=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3);
VAR13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3);
VAR14:=ZIG(3,22)<REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)>=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3);
VAR15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3);
VAR16:=ZIG(3,51)<REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)>=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3);
VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3);
VAR18:=ZIG(3,72)<REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)>=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3);
VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);
买1:=VAR10;
买2:=(VAR11+VAR13+VAR15+VAR17);
卖1:=(VAR12+VAR14+VAR16+VAR18);
B:DRAWICON(买1>0 OR 买2>0,LOW*0.99,14),CROSSDOT,LINETHICK3,COLORYELLOW;
DRAWTEXT(买1>0 OR 买2>0,LOW*0.99,'买入'),COLORRED;
S:DRAWICON(卖1>0,HIGH*1.01,14),CROSSDOT,LINETHICK3,COLORGREEN;
DRAWTEXT(卖1>0,HIGH*1.02,'卖出'),COLORGREEN;
{股灵吧决策}
VAR100:=(100 - ((90 * (HHV(HIGH,20) - CLOSE)) / (HHV(HIGH,20) - LLV(LOW,20))));
VAR200:=(100 - ((90 * (HHV(HIGH,20) - CLOSE)) / (HHV(HIGH,20) - LLV(LOW,20))));
VAR300:=(100 - MA(((100 * (HHV(HIGH,5) - CLOSE)) / (HHV(HIGH,5) - LLV(LOW,5))),34));
F:DRAWICON(CROSS(VAR200,MA(VAR300,5)),LOW * 0.98,14),CROSSDOT,LINETHICK3,COLOREE00EE;
年:MA(CLOSE,22),LINETHICK2,COLORWHITE;
当前月:=FRACPART(ROUND(当前日期/100)/100)*100;
月:=MONTH;日:=DAY;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='1',c,NUMTOSTR(当前月,0)+'月时间之窗:5(小寒)、6、15、20(大寒)、21、*25\n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='2',c,NUMTOSTR(当前月,0)+'月时间之窗:4(立春)、6、15、18(雨水)21\n \n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='3',c,NUMTOSTR(当前月,0)+'月时间之窗:5(惊蛰)、6、15、*20(春分)、21\n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='4',c,NUMTOSTR(当前月,0)+'月时间之窗:4(清明)、6、15、20(谷雨)21\n \n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='5',c,NUMTOSTR(当前月,0)+'月时间之窗:5(立夏)、6、*12、15、21(小满)\n \n \n \n \n'),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='6',c,NUMTOSTR(当前月,0)+'月时间之窗:5(芒种)、6、*14、21(夏至)\n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='7',c,NUMTOSTR(当前月,0)+'月时间之窗:7(小暑)、8、15、*19、23(大暑)\n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='8',c,NUMTOSTR(当前月,0)+'月时间之窗:*6、7(立秋)、8、18、23(
|