通达信自用仓位控制顶底操盘主图指标 源码



K:=1;
P:=6;
EM:=1;
M1:=5;
M2:=10;
M3:=20;
M4:=60;
DRAWTEXT_FIX(1,0.01,0.02,0,EXTERNSTR(0,1)),COLORGREEN;
DRAWGBK(C>0,RGB(0,0,0),RGB(00,0,0),0,'EM',0);
DRAWKLINE(H,O,L,C);
K1:=REF(C,1)=DYNAINFO(3) AND O=DYNAINFO(4) AND C=DYNAINFO(7) AND H=DYNAINFO(5) AND L=DYNAINFO(6);
K2:=BARSLAST(V=HHV(V,20));
K3:=BACKSET(K1,K2+1);
STICKLINE(K2=0 AND K3=1,H,H*1.003,8*EM,0),COLORYELLOW;
收:C,NODRAW;
DRAWTEXT(EM=1&&K2=0&&K3=1,H*1.02,'20天内最高量的'),COLORGREEN;
DRAWTEXT(EM=1&&K2=0&&K3=1,H*0.98,'当天最高价划线'),COLORGREEN;
爆发点:=(DCLOSE-REF(C,1))/REF(C,1)*100;
XB:=CROSS(爆发点,20);
DRAWTEXT(XB,L,'量价齐升'),COLORRED;
PL5:=ZIG(3,5);
EN1:=ZIG(3,5)>REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)<=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)<=REF(ZIG(3,5),3);
EX1:=ZIG(3,5)=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)>=REF(ZIG(3,5),3);
PL10:=ZIG(3,10);
EN2:=ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)<=REF(ZIG(3,10),2) AND REF(ZIG(3,10),2)<=REF(ZIG(3,10),3);
EX2:=ZIG(3,10)=REF(ZIG(3,10),2) AND REF(ZIG(3,10),2)>=REF(ZIG(3,10),3);
PL20:=ZIG(3,20);
EN3:=ZIG(3,20)>REF(ZIG(3,20),1) AND REF(ZIG(3,20),1)<=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)<=REF(ZIG(3,20),3);
EX3:=ZIG(3,20)=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)>=REF(ZIG(3,20),3);
PL40:=ZIG(3,40);
走强1:=BARSLAST(PL5< REF(PL5,1));
走弱1:=BARSLAST(PL5>REF(PL5,1));
走强2:=BARSLAST(PL10< REF(PL10,1));
走弱2:=BARSLAST(PL10>REF(PL10,1));
走强3:=BARSLAST(PL20< REF(PL20,1));
走弱3:=BARSLAST(PL20>REF(PL20,1));
ZTJZ5:=IF(PL10>REF(PL10,1),COUNT(EN1,走强2),0);
ZTJD5:=IF(PL10>REF(PL10,1),COUNT(EX1,走强2),0);
DTJZ5:=IF(PL10< REF(PL10,1),COUNT(EN1,走弱2),0);
DTJD5:=IF(PL10< REF(PL10,1),COUNT(EX1,走弱2),0);
ZTJZ10:=IF(PL20>REF(PL20,1),COUNT(EN2,走强3),0);
ZTJD10:=IF(PL20>REF(PL20,1),COUNT(EX2,走强3),0);
DTJZ10:=IF(PL20< REF(PL20,1),COUNT(EN2,走弱3),0);
DTJD10:=IF(PL20< REF(PL20,1),COUNT(EX2,走弱3),0);
DRAWTEXT(EN1 AND DTJZ5=1,L*0.98,'反弹'),COLORFFFF00;
DRAWTEXT(EX1 AND DTJD5=2,H*1.02,'清仓'),COLORGREEN;
DRAWTEXT(EN2 AND ZTJZ5=1,L*0.98,'买入'),COLORLIRED;
DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJD5=1,H*1.02,'留1成仓'),COLORLIGREEN;
DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=2,L*0.98,'加半仓'),COLOR0000FF;
DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJZ5=2,H*1.02,'减7成'),COLORGREEN;
DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=3,L*0.98,'加7成'),COLOR0000FF;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.02,'逢高出局'),COLORLIBLUE;
DRAWTEXT(EN2 AND DTJZ10=1,L*0.94,'等待主升'),COLORWHITE;
DRAWTEXT(EN3 AND ZTJZ10=1,L*0.94,'满仓进场'),COLORMAGENTA;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.06,'卖'),COLORLICYAN;
DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=2,L*0.94,'满仓持股'),COLORLIRED;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=2 OR (ZTJD10=0 OR ZTJD10=2) AND EX2,H*1.06,'需要清仓'),COLORCYAN;
DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=3,L*0.94,'开始大涨'),LINETHICK3,COLOR00FFFF;
MA1:MA(CLOSE,M1);
MA2:MA(CLOSE,M2);
MA3:MA(CLOSE,M3);
MA4:MA(CLOSE,M4);
DIF:=EMA(DCLOSE,12)-EMA(DCLOSE,26);
DEA:=EMA(DIF,9);
AAA:=(DIF-DEA)*2*60;
起爆:=CROSS(AAA-REF(AAA,1),15),COLORRED,LINETHICK2;
DRAWTEXT(起爆,L*0.99,'↖暴涨'),COLORYELLOW,LINETHICK2;
DRAWTEXT(C>REF(C,1)*1.093 ,H,'板'),COLORGREEN,DRAWABOVE;
DRAWTEXT(C>REF(C,1)*1.093 AND C>MA(C,60) AND C< MA(C,60)*1.15 ,L,'★板买'),COLORRED;
T1B:=CONST(LLVBARS(LOW,10));
T1HIGH:=CONST(REF(HIGH,T1B));
CC:=CONST(CURRBARSCOUNT);
T2B:=CONST(BARSLAST(CURRBARSCOUNT>CC+T1B AND H>T1HIGH));
T2HIGH:=CONST(REF(HIGH,T2B));
T3:=CONST(BARSLAST(CURRBARSCOUNT>CC+T2B AND HIGH>T2HIGH));
T3HIGH:=CONST(REF(HIGH,T3));
涨停线:DRAWLINE(CURRBARSCOUNT=T3+1,T3HIGH, ISLASTBAR, T3HIGH, 1),COLORGREEN,LINETHICK2;
C2:=REF(C,1);
涨停:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);
STICKLINE(涨停,OPEN,CLOSE,2,0),,COLORYELLOW;
STICKLINE(涨停,H,L,0,0),,COLORYELLOW;
跌停:=IF((C2-C)*100/C2>=(10-0.01*100/C2),1,0);
STICKLINE(跌停,OPEN,CLOSE,2,0),COLORGREEN;
STICKLINE(跌停,H,L,0,1),COLORGREEN;
N:=10;
HH:IF(CURRBARSCOUNT<=N,CONST(HHV(H,N)),DRAWNULL),COLORGREEN;
LL:IF(CURRBARSCOUNT<=N,CONST(LLV(L,N)),DRAWNULL),COLORRED;
DRAWNUMBER(CURRBARSCOUNT=N,HH,HH),COLORGREEN;
DRAWNUMBER(CURRBARSCOUNT=N,LL,LL),COLORRED;
DRAWICON(CURRBARSCOUNT=N,L,1);
DRAWTEXT(CURRBARSCOUNT=N,HH*1.04,STRCAT('振幅:',CON2STR((HH-LL)/LL*100,2))),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.01,0.99,0,EXTERNSTR(0,3)),COLORYELLOW;
DRAWTEXT(CROSS(ZIG(3,8),REF(ZIG(3,8),1)),LOW*0.94,'底') ,LINETHICK2,COLORYELLOW;
DRAWTEXT(CROSS(REF(ZIG(3,7),1),ZIG(3,7)),HIGH*1.04,'顶') ,LINETHICK2,COLORGREEN;
庄线A:=(3*CLOSE+OPEN+LOW+HIGH)/6;
庄线B:(19*庄线A+19*REF(庄线A,1)+18*REF(庄线A,2)+17*REF(庄线A,3)+16*REF(庄线A,4)+15*REF(庄线A,5)+14*REF(庄线A,6)+13*REF(庄线A,7)+12*REF(庄线A,8)+11*REF(庄线A,9)+10*REF(庄线A,10)+9*REF(庄线A,11)+8*REF(庄线A,12)+7*REF(庄线A,13)+6*REF(庄线A,14)+5*REF(庄线A,15)+4*REF(庄线A,16)+3*REF(庄线A,17)+2*REF(庄线A,20)+REF(庄线A,19))/210,COLOR000000;
庄线支撑:MA(庄线B,5),COLORRED,LINETHICK3;
天数:=BARSLAST(涨停);
DRAWTEXT(BETWEEN(天数,1,10), H*1.02, VAR2STR(天数,0));


未来函数检测结果如下:
该公式包含未来函数:ZIG
该公式包含未来函数:BACKSET
该公式包含未来函数:DYNAINFO
该公式包含未来函数:DCLOSE
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式

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

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