钱袋指标 角度线与黄金分割 通达信指标 源码 贴图
角度线与黄金分割 通达信指标 源码 贴图
N9:=120;
KP:=BARSLAST(CURRBARSCOUNT=N9);
GDY:=CONST(IF(ISLASTBAR=1,HHV(H,KP),0));{高点}
DDS:=CONST(IF(ISLASTBAR=1,LLV(L,KP),0));{低点}
KJ:=GDY-DDS;{高低点差值=分区高度}
DRAWTEXT(CURRBARSCOUNT=N9/2-58,GDY-KJ/12,' 【风险区】--高抛避险'),COLOR555555;
DRAWTEXT(CURRBARSCOUNT=N9/2-58,GDY-KJ/3.5,' 【警示区】--逢高减仓'),COLOR555555;
DRAWTEXT(CURRBARSCOUNT=N9/2-58,GDY-KJ/2.23,' 【突破区】--主力拉升'),COLOR555555;
DRAWTEXT(CURRBARSCOUNT=N9/2-58,GDY-KJ/1.82,' 【拉升区】--强势畜锐'),COLOR555555;
DRAWTEXT(CURRBARSCOUNT=N9/2-58,DDS+KJ/3.5,' 【反弹中轨】--低买高休'),COLOR555555;
DRAWTEXT(CURRBARSCOUNT=N9/2-58,DDS+KJ/10,' 【低吸区】--大胆买入'),COLOR555555;
AQ1:=REF(V,1);AQ2:=DVOL;AQ3:=AQ2/AQ1;
LNX:=AQ3-REF(AQ3,1);
E1:=REF(C,1);E2:=DCLOSE;E3:=(E2-E1)/E1*100;
QMX:=E3-REF(E3,1);
XGG:=CROSS(LNX,500) AND CROSS(QMX,10);
DRAWTEXT(XGG=1,L*0.97,'◇'),COLORCBCBC0;
{钱袋指标}
VAR113:=HHV(HIGH,60);
VAR114:=LLV(LOW,30);
VAR115:=(CLOSE-MA(CLOSE,32))/MA(CLOSE,32)*100;
VAR116:=(VAR113+VAR114+VAR115)/3;
VAR117:=EMA(VAR116,5);
K01:=EMA(VAR117,5)*2, COLORFF00FF;
D01:=EMA(K01,5), COLORWHITE;
J01:=K01*3-D01*2, COLORYELLOW;
ENTERLONG:=CROSS(K01,D01);
EXITLONG:=CROSS(D01,K01);
B01:=(DRAWICON((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)),L*0.98,1))*D01*2/3;
B02:=IF(TROUGHBARS(3,15,1)=1 AND HIGH>LOW+0.01,20,0);
必买:=(B01 AND B02);
DRAWICON(必买,L*0.98,38);
抄底:=ABS((CROSS("MACD.DIF","MACD.DEA")
&&"MACD.DEA"<=-0.07)*"MACD.DIF")*1.09,COLORLIMAGENTA,LINETHICK2;
DRAWTEXT(ABS(抄底)>0,L*0.996,'●'),COLOR000099;
VAR2X:=TROUGHBARS(3,15,1)<10;
VAR3X:=PEAKBARS(3,15,1)<10;
VAR4X:=IF(VAR2X=1,50,0);
底部:=IF(VAR4X=50,10,0);
多头能量:=0;
买入:=IF(底部=10 AND REF(底部,1)=10 AND REF(底部,2)=0,50,0);
{买入延迟线:底部,LINETHICK1 ,COLOR00CCFF;}
DRAWTEXT(买入=50,L*0.996,'●'),COLORCBCBC0;
{波浪}
PL5:=IF(PERIOD>=7,ZIG(3,1),IF(PERIOD=3,ZIG(1,2),ZIG(1,2)));
{S说明: 如果周月以上的选5%转向,如果日线选3%转向,如果日线以下周期选2%转向 }
PL10:=IF(PERIOD>=7,ZIG(3,30),IF(PERIOD=3,ZIG(1,10),ZIG(1,10)));
{S说明: 如果周月以上的选10%转向,如果日线选5%转向,如果日线以下周期选4%转向 }
EN1:=PL5>REF(PL5,1) AND REF(PL5,1)<=REF(PL5,2) AND REF(PL5,2)<=REF(PL5,3);
EN2:=PL10>REF(PL10,1) AND REF(PL10,1)<=REF(PL10,2) AND REF(PL10,2)<=REF(PL10,3);
走强2:=BARSLAST(PL10<REF(PL10,1));
ZTJZ5:=IF(PL10>REF(PL10,1),COUNT(EN1,走强2),0);
DRAWTEXT(EN2 AND ZTJZ5=1,L*0.99,'●'),COLORYELLOW;
TC1S:=IF(H=HHV(H,48),H,DRAWNULL);
TC2S:=CONST(BARSLAST(TC1S=H))+1;
UPPERS:=CONST(IF(TC2S=1,H,REF(H,TC2S-1)));
BC1S:=IF(L=LLV(L,48),L,DRAWNULL);
BC2S:=CONST(BARSLAST(BC1S=L))+1;
LOWERS:=CONST(IF(BC2S=1,L,REF(L,BC2S-1)));
LPS:=CURRBARSCOUNT<=BC2S AND L=LOWERS;
HPS:=CURRBARSCOUNT<=TC2S AND H=UPPERS;
AB1S:=EMA(((2*C+H+L)/4-LLV(LOW,30))/
(HHV(HIGH,30)-LLV(LOW,30))*100,8);
BA1S:=EMA(AB1S,5);
上轨:=REFDATE(REF(HHV(MAX(C,O),96),5),DATE);
下轨:=REFDATE(REF(LLV(MIN(C,O),96),5),DATE);
中轨:=((上轨)+(下轨))/2;
YXHX:=DATE>=REF(DATE,BARSLAST(IF(BC2S>TC2S,LPS,HPS)));
上沿:IF(AB1S>0 AND AB1S-BA1S<=0 AND YXHX,上轨,上轨),DOTLINE,COLOR666666;
中枢:IF(AB1S>0 AND AB1S-BA1S<=0 AND YXHX,中轨,中轨),DOTLINE,COLOR666666;
下沿:IF(AB1S>0 AND AB1S-BA1S<=0 AND YXHX,下轨,下轨),DOTLINE,COLOR666666;
{涨幅量尺}
最低C:=TROUGHBARS(L,之幅度,1);{调整之字幅度找到低位起点}
低价:=REF(L,BARSLAST(最低C=0));
低价_:DRAWLINE(最低C=0,L,ISLASTBAR,低价,0),NODRAW;
FU:=C-低价_;
幅度:=FU/低价_*100,NODRAW;
DRAWTEXT(ISLASTBAR,低价_,' --------低价_'),COLOR996600;
_3%:DRAWLINE(最低C=0,L*1.03,ISLASTBAR,低价*1.03,0),COLOR004500,DOTLINE,NODRAW;
_5%:DRAWLINE(最低C=0,L*1.05,ISLASTBAR,低价*1.05,0),COLOR004500,DOTLINE,NODRAW;
_8%:DRAWLINE(最低C=0,L*1.08,ISLASTBAR,低价*1.08,0),COLOR004500,DOTLINE,NODRAW;
_13%:DRAWLINE(最低C=0,L*1.13,ISLASTBAR,低价*1.13,0),COLOR004500,DOTLINE,NODRAW;
_18%:DRAWLINE(最低C=0,L*1.18,ISLASTBAR,低价*1.18,0),COLOR666666,DOTLINE,NODRAW;
_25%:DRAWLINE(最低C=0,L*1.25,ISLASTBAR,低价*1.25,0),COLOR666666,DOTLINE,NODRAW;
_30%:DRAWLINE(最低C=0,L*1.30,ISLASTBAR,低价*1.30,0),COLOR666666,DOTLINE,NODRAW;
_35%:DRAWLINE(最低C=0,L*1.35,ISLASTBAR,低价*1.35,0),COLOR666666,DOTLINE,NODRAW;
_40%:DRAWLINE(最低C=0,L*1.40,ISLASTBAR,低价*1.40,0),COLOR666666,DOTLINE,NODRAW;
_50%:DRAWLINE(最低C=0,L*1.50,ISLASTBAR,低价*1.50,0),COLOR666666,DOTLINE,NODRAW;
_55%:DRAWLINE(最低C=0,L*1.55,ISLASTBAR,低价*1.55,0),COLOR666666,DOTLINE,NODRAW;
DRAWTEXT(ISLASTBAR,_3%,' --------3%'),COLOR996600;
DRAWTEXT(ISLASTBAR,_5%,' --------5%'),COLOR996600;
DRAWTEXT(ISLASTBAR,_8%,' --------8%'),COLOR996600;
DRAWTEXT(ISLASTBAR,_13%,' --------13%'),COLOR996600;
DRAWTEXT(ISLASTBAR,_18%,' --------18%'),COLOR996600;
DRAWTEXT(ISLASTBAR,_25%,' --------25%'),COLOR996600;
DRAWTEXT(ISLASTBAR,_30%,' --------30%'),COLOR996600;
DRAWTEXT(ISLASTBAR,_35%,' --------35%'),COLOR996600;
DRAWTEXT(ISLASTBAR,_40%,' --------40%'),COLOR996600;
DRAWTEXT(ISLASTBAR,_50%,' --------50%'),COLOR996600;
DRAWTEXT(ISLASTBAR,_55%,' --------55%'),COLOR996600;
GD:=CONST(FINDHIGH(H,0,高点*10,1));
DD:=CONST(FINDLOW(L,0,低点*10,1));
GT:=CONST(BARSLAST(GD=H))+1;
DT:=CONST(BARSLAST(DD=L))+1;
SH:=CONST(IF(GT=1,H,REF(H,GT-1)));
SL:=CONST(IF(DT=1,L,REF(L,DT-1)));
CC:=IF(DT>GT,DT,GT);
CD:=INTPART(CC-(DT+GT)/2);
CG:=IF(高点>CD,CD/2,高点);
{黄金分割}
ZG:=IF(CURRBARSCOUNT<=CD,SH,DRAWNULL);
DRAWBAND(ZG,RGB(0,0,0),ZG,RGB(0,0,0)),DOTLINE,COLOR004500;
ZD:=IF(CURRBARSCOUNT<=CD,SL,DRAWNULL);
DRAWBAND(ZD,RGB(0,0,0),ZD,RGB(0,0,0)),DOTLINE,COLOR004500;
X191:=IF(CURRBARSCOUNT<=CD,SH-(SH-SL)*0.191,DRAWNULL);
DRAWBAND(X191,RGB(0,0,0),X191,RGB(0,0,0)),DOTLINE,COLOR004500;
X382:=IF(CURRBARSCOUNT<=CD,SH-(SH-SL)*0.382,DRAWNULL);
DRAWBAND(X382,RGB(0,0,0),X382,RGB(0,0,0)),DOTLINE,COLOR004500;
X500:=IF(CURRBARSCOUNT<=CD,SH-(SH-SL)*0.500,DRAWNULL);
DRAWBAND(X500,RGB(0,0,0),X500,RGB(0,0,0)),DOTLINE,COLOR004500;
X618:=IF(CURRBARSCOUNT<=CD,SH-(SH-SL)*0.618,DRAWNULL);
DRAWBAND(X618,RGB(0,0,0),X618,RGB(0,0,0)),DOTLINE,COLOR004500;
X809:=IF(CURRBARSCOUNT<=CD,SH-(SH-SL)*0.809,DRAWNULL);
DRAWBAND(X809,RGB(0,0,0),X809,RGB(0,0,0)),DOTLINE,COLOR004500;
DRAWTEXT(CURRBARSCOUNT=CG,(ZD)*1.003,STRCAT('起点: ',CON2STR(ZD,2))),COLOR004500;
DRAWTEXT(CURRBARSCOUNT=CG,(X191)*0.996,STRCAT('80.9% ',CON2STR(X191,2))),COLOR004500;
DRAWTEXT(CURRBARSCOUNT=CG,(X382)*0.996,STRCAT('61.8% ',CON2STR(X382,2))),COLOR004500;
DRAWTEXT(CURRBARSCOUNT=CG,(X500)*0.996,STRCAT('50% ',CON2STR(X500,2))),COLOR004500;
DRAWTEXT(CURRBARSCOUNT=CG,(X618)*0.996,STRCAT('38.2% ',CON2STR(X618,2))),COLOR004500;
DRAWTEXT(CURRBARSCOUNT=CG,(X809)*0.996,STRCAT('19.1% ',CON2STR(X809,2))),COLOR004500;
DRAWTEXT(CURRBARSCOUNT=CG,(ZG)*0.996,STRCAT('100% ',CON2STR(ZG,2))),COLOR004500;
CURR:=CURRBARSCOUNT;
TCH:=CONST(FINDHIGH(H,0,HDAY*10,1));
GTT:=CONST(BARSLAST(TCH=H))+1;
SX跌H:=CONST(IF(GTT=1,H,REF(H,GTT-1)));
BCL:=CONST(FINDLOW(L,0,LDAY*10,1));
DTT:=CONST(BARSLAST(BCL=L))+1;
SX涨L:=CONST(IF(DTT=1,L,REF(L,DTT-1)));
涨点:=BARSSINCE(BACKSET(ISLASTBAR,BARSLAST(L=SX涨L)+1));
跌点:=BARSSINCE(BACKSET(ISLASTBAR,BARSLAST(H=SX跌H)+1));
最低:=IF(调点=1,跌点,IF(调点=2,涨点,IF(调点=3,涨点,跌点)));
L斜率:=下角度/IF(C<300,1000,10);
最高:=IF(调点=1,跌点,IF(调点=2,涨点,IF(调点=3,跌点,涨点)));
H斜率:=上角度/IF(C<300,1000,10);
IM68:=((SX跌H-SX涨L)/8-(SX跌H-SX涨L)/8);
GH跌X:=SX跌H+(SX跌H-SX涨L)/8; DL涨X:=SX涨L-(SX跌H-SX涨L)/8;
GTHT:=IF(DTT>GTT,DTT,GTT); R:=ABS(GTT-DTT);
DRAWBAND(IF(CURR<=GTHT,SX跌H,DRAWNULL),RGB(0,120,120),SX跌H,RGB(8,168,168));
DRAWBAND(IF(CURR<=GTHT,SX涨L,DRAWNULL),RGB(0,120,120),SX涨L,RGB(0,160,160));
STICKLINE(CURRBARSCOUNT=GTT,SX跌H,SX涨L,0,0),COLOR556600;
STICKLINE(CURRBARSCOUNT=DTT,SX跌H,SX涨L,0,0),COLOR666666;
STICKLINE(CURRBARSCOUNT=1,SX跌H,SX涨L,0,0),COLOR556600;
DRAWKLINE(H,O,L,C);
天线:=SX跌H; 地线:=SX涨L;
K:=(天线-地线)/(IF(跌点>=涨点,跌点,涨点)-IF(跌点>=涨点,涨点,跌点));
上斜线:=IF(地线+CONST(L斜率*4.00)*最低>=地线,地线+CONST(L斜率*4.00)*最低,DRAWNULL);
上斜线0:=IF(地线+CONST(L斜率*2.00)*最低>=地线,地线+CONST(L斜率*2.00)*最低,DRAWNULL);
上斜线1:=IF(地线+CONST(L斜率*1.5)*最低>=地线,地线+CONST(L斜率*1.5)*最低,DRAWNULL);
上斜线2:=IF(地线+CONST(L斜率*1.00)*最低>=地线,地线+CONST(L斜率*1.000)*最低,DRAWNULL);
上斜线3:=IF(地线+CONST(L斜率*0.70)*最低>=地线,地线+CONST(L斜率*0.70)*最低,DRAWNULL);
上斜线4:=IF(地线+CONST(L斜率*0.50)*最低>=地线,地线+CONST(L斜率*0.50)*最低,DRAWNULL);
上斜线5:=IF(地线+CONST(L斜率*0.365)*最低>=地线,地线+CONST(L斜率*0.365)*最低,DRAWNULL);
上斜线6:=IF(地线+CONST(L斜率*0.250)*最低>=地线,地线+CONST(L斜率*0.250)*最低,DRAWNULL);
上斜线7:=IF(地线+CONST(L斜率*0.165)*最低>=地线,地线+CONST(L斜率*0.165)*最低,DRAWNULL);
上斜线8:=IF(地线+CONST(L斜率*0.123)*最低>=地线,地线+CONST(L斜率*0.123)*最低,DRAWNULL);
上斜线9:=IF(地线+CONST(L斜率*0.06)*最低>=地线,地线+CONST(L斜率*0.06)*最低,DRAWNULL);
上9:IF(上斜线9<=天线*1.05,上斜线9,DRAWNULL),COLORAA00AA,DOTLINE;
上8:IF(上斜线8<=天线*1.05,上斜线8,DRAWNULL),COLORAA00AA,DOTLINE;
上7:IF(上斜线7<=天线*1.05,上斜线7,DRAWNULL),COLORAA00AA,DOTLINE;
上6:IF(上斜线6<=天线*1.05,上斜线6,DRAWNULL),COLORAA00AA,DOTLINE;
上5:IF(上斜线5<=天线*1.05,上斜线5,DRAWNULL),COLORAA00AA,DOTLINE;
上4:IF(上斜线4<=天线*1.05,上斜线4,DRAWNULL),COLOR00DDDD,DOTLINE;
上3:IF(上斜线3<=天线*1.05,上斜线3,DRAWNULL),COLORAA00AA,DOTLINE;
上2:IF(上斜线2<=天线*1.05,上斜线2,DRAWNULL),COLORAA00AA,DOTLINE;
上1:IF(上斜线1<=天线*1.05,上斜线1,DRAWNULL),COLORAA00AA,DOTLINE;
上0:IF(上斜线0<=天线*1.05,上斜线0,DRAWNULL),COLORAA00AA,DOTLINE;
上:IF(上斜线<=天线*1.05,上斜线,DRAWNULL),COLORAA00AA,DOTLINE;
下斜线:=IF(天线-CONST(H斜率*4.00)*最高<=天线,天线-CONST(H斜率*4.00)*最高,DRAWNULL);
下斜线0:=IF(天线-CONST(H斜率*2.00)*最高<=天线,天线-CONST(H斜率*2.00)*最高,DRAWNULL);
下斜线1:=IF(天线-CONST(H斜率*1.500)*最高<=天线,天线-CONST(H斜率*1.500)*最高,DRAWNULL);
下斜线2:=IF(天线-CONST(H斜率*1.000)*最高<=天线,天线-CONST(H斜率*1.000)*最高,DRAWNULL);
下斜线3:=IF(天线-CONST(H斜率*0.70)*最高<=天线,天线-CONST(H斜率*0.70)*最高,DRAWNULL);
下斜线4:=IF(天线-CONST(H斜率*0.50)*最高<=天线,天线-CONST(H斜率*0.50)*最高,DRAWNULL);
下斜线5:=IF(天线-CONST(H斜率*0.365)*最高<=天线,天线-CONST(H斜率*0.365)*最高,DRAWNULL);
下斜线6:=IF(天线-CONST(H斜率*0.250)*最高<=天线,天线-CONST(H斜率*0.250)*最高,DRAWNULL);
下斜线7:=IF(天线-CONST(H斜率*0.165)*最高<=天线,天线-CONST(H斜率*0.165)*最高,DRAWNULL);
下斜线8:=IF(天线-CONST(H斜率*0.123)*最高<=天线,天线-CONST(H斜率*0.123)*最高,DRAWNULL);
下斜线9:=IF(天线-CONST(H斜率*0.06)*最高<=天线,天线-CONST(H斜率*0.06)*最高,DRAWNULL);
下9:IF(下斜线9>=地线*0.95,下斜线9,DRAWNULL),COLORAAAAAA,DOTLINE;
下8:IF(下斜线8>=地线*0.95,下斜线8,DRAWNULL),COLORAAAAAA,DOTLINE;
下7:IF(下斜线7>=地线*0.95,下斜线7,DRAWNULL),COLORAAAAAA,DOTLINE;
下6:IF(下斜线6>=地线*0.95,下斜线6,DRAWNULL),COLORAAAAAA,DOTLINE;
下5:IF(下斜线5>=地线*0.95,下斜线5,DRAWNULL),COLORAAAAAA,DOTLINE;
下4:IF(下斜线4>=地线*0.95,下斜线4,DRAWNULL),COLOR00DDDD,DOTLINE;
下3:IF(下斜线3>=地线*0.95,下斜线3,DRAWNULL),COLORAAAAAA,DOTLINE;
下2:IF(下斜线2>=地线*0.95,下斜线2,DRAWNULL),COLORAAAAAA,DOTLINE;
下1:IF(下斜线1>=地线*0.95,下斜线1,DRAWNULL),COLORAAAAAA,DOTLINE;
下0:IF(下斜线0>=地线*0.95,下斜线0,DRAWNULL),COLORAAAAAA,DOTLINE;
下:IF(下斜线>=地线*0.95,下斜线,DRAWNULL),COLORAAAAAA,DOTLINE;