通达信顶底仓位主图指标公式源码

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;
LONG:=ATAN((EMA(C,21)/REF(EMA(C,21),1)-1)*100)*57.3;
个持股:SHORT>LONG,NODRAW,COLORYELLOW;
个仓位%:100-个风险,COLORRED,NODRAW;
{boll+k线 }
bbi:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;
DWN:BBI-P*STD(BBI,N),COLORYELLOW,LINETHICK1;
UPR:BBI+P*STD(BBI,N),COLORFF50FF,LINETHICK1;
MA5:MA(C,5),COLORWHITE,LINETHICK1;
IF(MA5>REF(MA5,1),MA5,DRAWNULL),COLORRED,LINETHICK1;
M10:MA(C,10),COLORA08888;
M89:=MA(INDEXC,89),COLORMAGENTA;
{乖离均线 }
AA05:=MA(C,5),COLOR0099CC;
五乖:=(C-AA05)/AA05*100;
BB05:=ATAN((AA05/REF(AA05,1)-1)*100)*180/3.1416;

 

.....................................

下载附件完整源




来函数检测结果如下:
该公式没有未来函数

解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式

联系我们  |  指标公式网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 浙ICP备2024071487号-2 指标公式网别名指标网仅为互联网文章,所有指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。指标公式网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图