N:=10;
P:=3;
{背景位置 }
TT:=IF(ISLASTBAR,240/FROMOPEN,1);
NN:=120;
HH:=HHV(V*TT,NN);
LL:=LLV(V,NN);
最高:=CONST(HH);
最低:=CONST(LL);
最高2:=CONST(HHV(H,NN));
最低2:=CONST(LLV(L,NN));
PP:=IF((最高2*0.9-(最高2-最低2)*0.5)>CONST(LLV(L,20)),0.9,IF((最高2*0.9-(最高2-最低2)*0.5)>CONST(LLV(L,50)),0.7,0.6)),NODRAW;
RCC1:=最高2*0.9-(最高2-最低2)*PP;
最低R:=MIN(RCC1,最低2);
RCC:=最低R;
AAA:=CONST(HHV(H,60));
STICKLINE(CURRBARSCOUNT=46 ,RCC*1.1,RCC*1.04,100,0),COLOR333555;
{大盘趋势定仓位 }
RSVD:=(INDEXC-LLV(INDEXL,9))/(HHV(INDEXH,9)-LLV(INDEXL,9))*100;
kd:=SMA(RSVD,3,1);
ZJD:=(INDEXO+INDEXH+INDEXL+INDEXC)/4;
YZD:=IF(BARSCOUNT(INDEXC)>60,vol/SUM(INDEXV,60),VOL/SUM(INDEXV,BARSCOUNT(INDEXC)));
cyc50D:=DMA(ZJD,YZD/0.50);
CYC0D:=DMA(ZJD,YZD);
KPXSD:=(CYC50D/CYC0D-1)*100;
KPD:=IF(KPXSD<0,85,IF(KPXSD>=0 AND KPXSD<5,60,IF(KPXSD>=5 AND KPXSD<15,35,IF(KPXSD>=15,15,90))));
大盘风险:=(KD+KPD)/2,NODRAW;
大盘M3:=MA(REF(INDEXC,1),3);
总涨家:="SZ399001$ADVANCE"+"SH999999$ADVANCE",COLORRED,NODRAW;
总跌家:="SZ399001$DECLINE"+"SH999999$DECLINE",COLORGREEN,NODRAW;
总涨家5日:=SUM(("SZ399001$ADVANCE"+"SH999999$ADVANCE"),5);
总跌家5日:=SUM(("SZ399001$DECLINE"+"SH999999$DECLINE"),5);
总五日比:=(总涨家5日/总跌家5日);
ZWB:=总五日比>REF(总五日比,1)OR 大盘M3>REF(大盘M3,1);
大盘持股: ZWB,NODRAW,COLORRED;
总仓位%:(100-大盘风险),NODRAW;
{个股仓位 }
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
ZJ:=(O+H+L+C)/4;
YZ:=IF(BARSCOUNT(C)>60,VOL/SUM(VOL,60),VOL/SUM(VOL,BARSCOUNT(C)));
CYC50:=DMA(ZJ,YZ/0.50);
CYC0:=DMA(ZJ,YZ);
KPXS:=(CYC50/CYC0-1)*100;
KP:=IF(KPXS<0,85,IF(KPXS>=0 AND KPXS<5,60,IF(KPXS>=5 AND KPXS<15,35,IF(KPXS>=15,15,90))));
个风险:(K+KP)/2,NODRAW;
SHORT:=ATAN((EMA(C,7)/REF(EMA(C,7),1)-1)*100)*57.3;
源码未显示完...
.....................................
下载附件完整源码