相关简介:通达信黄金分割线主图源码分享
通达信指标公式源码概况:
指标类别:通达信指标公式
授权方式:免费版
指标评级:★★★★★
指标分类:策略
画线方法:副图
用法说明:
一条红绿颜色相互转换组成的生命线;
代表值得关注的蓝K线以及代表警惕风险的绿K线组成;
生命线由绿转红说明大盘中期趋势向上,生命线由红转绿说明大盘中期趋势向下;
蓝色K线消失收0.5%以上的阳线,站上生命线,同时生命线由绿翻红,为大盘出现买点的信号
绿K线消失收阴,跌穿生命线,同时生命线由红转绿,为大盘出现卖点的信号
通达信指标公式源码:
平衡:EMA(C,20),CIRCLEDOT,COLORWHITE;
上轨:平衡+2*STD(C,20),LINETHICK2,COLORFF00FF;
下轨:平衡-2*STD(C,20),LINETHICK2,COLOR00FF00;
STICKLINE((CLOSE>平衡),平衡,平衡,1,0),LINETHICK6,COLOR0000FF;
STICKLINE((平衡>CLOSE),平衡,平衡,1,0),LINETHICK6,COLORFF6600;
ZDF:=(C-REF(C,1))/REF(C,1)*100;
STICKLINE(ZDF>9.8,O,C,6,0),COLORRED;
STICKLINE(ZDF<-9.8,O,C,6,0),COLORBLUE;
VAR6Q:=REF(CLOSE,1);
VAR7Q:=SMA(MAX(CLOSE-VAR6Q,0),6,1)/SMA(ABS(CLOSE-VAR6Q),6,1)*100;
DRAWTEXT(CROSS(84,VAR7Q),H*1.03,’逃顶‘),COLORYELLOW;
VAR3P:=IF(CLOSE/REF(CLOSE,1)>1.050ANDHIGH/CLOSE<1.010ANDIF(CLOSE>REF(CLOSE,1),88,0)>0,91,0);
STICKLINE(VAR3P>90,L,L*0.92,1,0),COLORFF00FF;
DRAWTEXT(VAR3P>90,LOW*0.92,’追涨’),COLORFF00FF;
VAR51:=EMA(AMOUNT/VOL/100,3);
VAR52:=EMA(VAR51,88);
VAR53:=EMA(VAR51,88)*0.85;
VAR54:=VAR53*0.87;
VAR55:=LOW<VAR54ANDCLOSE>REF(CLOSE,1)*1.02;
DRAWTEXT(FILTER(VAR55,6),LOW+0.1,’坚决●买进’),COLORYELLOW;
AA:=CROSS(MA(C,5),MA(C,20))ANDCROSS(MA(C,5),MA(C,30))ANDCROSS(MA(C,5),MA(C,60));
BB:=MA(C,60)>MA(C,10)ANDCROSS(MA(C,10),MA(C,30))ANDMA(C,30)>MA(C,20)ANDABS(MA(C,60)-MA(C,20))/MA(C,20)<0.05;
CC:MA(C,30)>MA(C,5)ANDCROSS(MA(C,5),MA(C,20))ANDMA(C,20)>MA(C,10),COLORYELLOW;
DD:=ABS((MA(C,5)-MA(C,10))+(MA(C,10)-MA(C,20))+(MA(C,20)-MA(C,30)))<0.02ANDMA(C,5)>REF(MA(C,5),1)ANDMA(C,10)>REF(MA(C,10),1);
EE:=MA(C,20)>MA(C,5)ANDCROSS(MA(C,5),MA(C,10))ANDMA(C,10)>MA(C,60)ANDABS(MA(C,20)-MA(C,60))/MA(C,60)<0.05;
FF:=AAORBBORCCORDDOREE;
DRAWTEXT(FF,L*0.99,’庄影’),COLORYELLOW;
STICKLINE(FF,H,L,0.5,0),COLORYELLOW;
N:=80;
M:=3;
高:=7.41;
低:=4.30;
MA5:MA(CLOSE,5);
MA10:MA(CLOSE,10);
MA20:MA(CLOSE,20),LINETHICK1;
MA60:MA(CLOSE,60),LINETHICK1;
{高:=REF(HHV(H,N),M);
低:=REF(LLV(L,N),M);}{自动定位法}
H38:=高-(高-低)*0.382;
H中:=高-(高-低)*0.5;
H61:=高-(高-低)*0.618;
顶点:REFDATE(高,DATE),DOTLINE,COLORWHITE;
H61.8%:REFDATE(H38,DATE),DOTLINE,COLORMAGENTA;
H50%:REFDATE(H中,DATE),DOTLINE,COLORRED;
H38.2%:REFDATE(H61,DATE),DOTLINE,COLORMAGENTA;
低点:REFDATE(低,DATE),DOTLINE,COLORWHITE;
DRAWTEXT(ISLASTBAR,顶点,’顶点’),COLORWHITE;
DRAWTEXT(ISLASTBAR,H38.2%,’H38.2%’),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,H50%,’H50%’),COLORRED;
DRAWTEXT(ISLASTBAR,H61.8%,’H61.8%’),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,低点,’低点’),COLORWHITE;
{分时均线}
W:=BARSLAST(DAY-REF(DAY,1))+1;
FSJX:SUM(C*VOL,W)/SUM(VOL,W),COLORYELLOW,LINETHICK2;IF(FSJX<REF(FSJX,1),FSJX,DRAWNULL),COLORCYAN,LINETHICK2;
{分时线}
FSX:IF(C>=FSJX,C,DRAWNULL),COLORRED,LINETHICK2;IF(C<FSJX,C,DRAWNULL),COLORCYAN,LINETHICK2;
{黄金分割线,4*60’=240′}
HH:=CONST(HHV(C,0));
LL:=CONST(LLV(C,0));
HL:=HH-LL;
顶:HH,COLORCYAN,LINETHICK1;
A809:0.809*HL+LL,COLORFFFF0B,DOTLINE;
A618:0.618*HL+LL,COLORLIGRAY,DOTLINE;
A500:0.500*HL+LL,COLOR80FFFF,DOTLINE;
A382:0.382*HL+LL,COLORLIGRAY,DOTLINE;
A191:0.191*HL+LL,COLOR00FF00,DOTLINE;
底:LL,COLOR00FF00,LINETHICK1;
DRAWICON(C=LL,LL,9);
{黄金线240分钟静态提示}
DRAWTEXT(CURRBARSCOUNT=240,HH,’顶’),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=240,A809,’809′),COLORFFFF0B;
DRAWTEXT(CURRBARSCOUNT=240,A618,’618′),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=240,A500,’500′),COLOR80FFFF;
DRAWTEXT(CURRBARSCOUNT=240,A382,’382′),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=240,A191,’191′),COLOR60FF60;
DRAWTEXT(CURRBARSCOUNT=240,LL,’底’),COLOR60FF60;
{黄金线1分钟动态提示}
DRAWTEXT(CURRBARSCOUNT=1,HH,’顶危’),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=1,A809,’809警’),COLORFFFF0B;
DRAWTEXT(CURRBARSCOUNT=1,A618,’618警’),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,A500,’500警’),COLOR80FFFF;
DRAWTEXT(CURRBARSCOUNT=1,A382,’382警’),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,A191,’191警’),COLOR60FF60;
DRAWTEXT(CURRBARSCOUNT=1,LL,’底安’),COLOR60FF60;
{常规提示}
DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0,0,DYBLOCK),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0.04,0,GNBLOCK),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0.08,0,FGBLOCK),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0.12,0,’公告不冲动’),COLORYELLOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.06,0.12,0,’竞价不可信’),COLORYELLOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.12,0.12,0,’纠错不犹豫’),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0.16,0,’涨停不躁动’),COLORYELLOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.06,0.16,0,’跌底果断进’),COLORYELLOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.12,0.16,0,’涨顶坚决出’),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0.20,0,’黄金高不买’),COLORYELLOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.06,0.20,0,’黄金跌不买’),COLORYELLOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.12,0.20,0,’黄金弹不买’),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0.24,0,’分时线:红FSJX撑涨青FSJX压跌’),COLORYELLOW;
N:=20;
P:=1;
MID:MA(CLOSE,N);
UPPER:MID+P*STD(CLOSE,N),colorred;
LOWER:MID-P*STD(CLOSE,N),colorgreen;
DRAWKLINE(H,O,L,C);
攻击:IF(MID>REF(MID,1),MID,DRAWNULL),colorred,LINETHICK3;
防守:IF(MID<REF(MID,1),MID,DRAWNULL),colorgreen,LINETHICK3;
RC1:=REF(C,1);
CS:=IF(C>=1,10000,100000);
C涨停10:=1.10*RC1-49/CS;
C涨停5:=1.05*RC1-49/CS;
C跌停10:=0.90*RC1+51/CS;
C跌停5:=0.95*RC1+51/CS;
ST:=NAMELIKE(‘S’)ORNAMELIKE(‘*S’);
涨停:=IF(ST,C>=C涨停5,C>=C涨停10);
跌停:=IF(ST,C<=C跌停5,C<=C跌停10);
STICKLINE(涨停,OPEN,CLOSE,6,0),coloryellow;
STICKLINE(跌停,OPEN,CLOSE,6,0),colorblue;
[源码注释]通达信公式动态翻译结果
AA赋值:(收盘价/1日前的收盘价-1)*100
输出XG:4日前的AA>8
评论(0)