通道量化交易指标公式
通达信博尔证券量化交易分析系统指标公式
通达信博尔证券量化交易分析系统指标公式{可用做主图或副图}做空95:HHV((HIGH+LOW+OPEN+2*CLOSE)/5+H-L,5),COLORBLUE;做空68:HHV((HIGH+LOW+OPEN+2*CLOSE)/5*2-L,5),COLORRED;平衡点:LLV((HIGH+LOW+OPEN+2*CLOSE)/5,3),COLORGRAY,DOTLINE;做多68:LLV((HIGH+LOW+OPEN+2*CLOSE)/5*2-H,8),COLORGREEN;做多95:LLV((HIGH+LOW+OPEN+2*CLOSE)/5-H+L,8),COLORFAABEC;F:=100*(C-REF(C,1))/REF(C,1);博尔:=IF(C《REF(O,1) AND F《0,1,0);P1:=博尔;量化:=IF(C《REF(O,2) AND F《0,1,0);P2:=量化;STICKLINE(P1=0 AND REF(P1,1)=1 AND P2=0 AND REF (P2,1)=1,OPEN,CLOSE,3,0),COLOR0055FF;STICKLINE(P1=1 AND REF(P1,1)=0 AND P2=1 AND REF (P2,1)=0,OPEN,CLOSE,3,0),COLORGREEN;==================任何股票价格的走势。
都是在“成本均价”附近上下波动,假如把横坐标作为时间,纵坐标作为股价,我们发现不同时间对应股价的交点所形成的轨迹是一条抛物线(统计学叫正态分布),外国人用数学模型(公式)来模拟股价的走势,就是多空概率,它是博尔证券量化交易系统的核心。
模仿博尔系统作出的多空概率:蓝线为做空概率为95%,红线为做空概率为68%,绿、紫线分别为做多概率为68%和95%,原博尔系统中无平衡点,为后加的以判别趋势和阶段支撑,而判别是否为顶、底部部的基本方法是平顶,在上升(或下降)过程中不管做多还是做空都是抬高(或下降)的,此时关注量能及附图指标的变化,尤其是负向威廉指标和乖离率。
最牛通达信量化副图指标公式源码
最牛通达信量化副图指标公式源码
通达信量化副图指标公式源码有很多,以下是其中一些常用的指标公式源码:
1.MACD指标源码:
```
EMA(CLOSE,12)-EMA(CLOSE,26);
```
2.RSI指标源码:
```
SMA(MAX(CLOSE-LAST(CLOSE),0),N,1)/SMA(ABS(CLOSE-
LAST(CLOSE)),N,1)*100;
```
3.KDJ指标源码:
```
RSV:=100*(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N));
K:SMA(RSV,M1,1);
D:SMA(K,M2,1);
J:3*K-2*D;
```
4.BOLL指标源码:
```
BOLL:MA(CLOSE,N);
UB:BOLL+2*STD(BOLL,N);
LB:BOLL-2*STD(BOLL,N);
```
5.WR指标源码:
```
WR(N):100*(HHV(HIGH,N)-CLOSE)/(HHV(HIGH,N)-LLV(LOW,N));
```
6.OBV指标源码:
```
SUM(IF(CLOSE>REF(CLOSE,1),VOLUME,IF(CLOSE<REF(CLOSE,1),-VOLUME,0)),N);
```
以上是一些常见的通达信量化副图指标的源码,通过这些源码可以实现对应的指标计算。
需要注意的是,不同的量化策略会使用不同的指标,源码可能会有一定差异。
此外,这些源码只是指标的计算公式,并不包含完整的通达信指标的绘图等功能代码。
通达信通道加划线无未来主图指标公式
通达信通道加划线无未来主图指标公式SS1:EMA(C,10),COLOR61DC16 DOTLINE;SS2:EMA(SS1,3),COLOR61DC16 DOTLINE;SS3:EMA(SS2,3),COLOR61DC16 DOTLINE;SS4:EMA(SS3,3),COLOR61DC16 DOTLINE;SS5:EMA(SS4,3),COLOR61DC16 DOTLINE;SSS1:EMA(C,45),COLORD1875A DOTLINE;SSS2:EMA(SSS1,3),COLORD1875A DOTLINE;SSS3:EMA(SSS2,3),COLORD1875A DOTLINE;SSS4:EMA(SSS3,3),COLORD1875A DOTLINE;SSS5:EMA(SSS4,3),COLORD1875A DOTLINE;IF(SS1>REF(SS1,1),SS1,DRAWNULL),COLORFF1CAE LINETHICK2;IF(SS2>REF(SS2,1),SS2,DRAWNULL),COLORFF1CAE;IF(SS3>REF(SS3,1),SS3,DRAWNULL),COLORFF1CAE;IF(SS4>REF(SS4,1),SS4,DRAWNULL),COLORFF1CAE;IF(SS5>REF(SS5,1),SS5,DRAWNULL),COLORFF1CAE;IF(SSS1>REF(SSS1,1),SSS1,DRAWNULL),COLOR00FF7F LINETHICK2;IF(SSS2>REF(SSS2,1),SSS2,DRAWNULL),COLOR00FF7F;IF(SSS3>REF(SSS3,1),SSS3,DRAWNULL),COLOR00FF7F;IF(SSS4>REF(SSS4,1),SSS4,DRAWNULL),COLOR00FF7F;IF(SSS5>REF(SSS5,1),SSS5,DRAWNULL),COLOR00FF7F;{涨停}STICKLINE(CLOSE>REF(CLOSE,1)*1.0985 AND CLOSE=HIGH,CLOSE,OPEN,3.5,-1),COLOR00FFFF;{跌停}STICKLINE(CLOSE<REF(CLOSE,1)*0.9015 AND CLOSE=LOW,CLOSE,OPEN,3.5,-1),COLORGREEN;{VARF:=3*SMA((C-LLV(L,13))/(HHV(H,13)-LLV(L,13))*100,5,1)-2*SMA(SMA((C-LLV(L,13))/(HHV(H,13)-LLV(L,13))*100,5,1),3,1);VARG:=(HHV(HIGH,25)-LLV(LOW,25))/EMA((CLOSE-LLV(LOW,25)),5);趋势:=IF(VARF-VARG,VARF,VARF),COLORBB11AA,LINETHICK0;底部:=IF(VARG-VARF,VARG,VARF),COLORGRAY;{STICKLINE(VARF<10,4,1,10,1),COLOR8E236B;STICKLINE(VARF>90,100,103,10,1),COLORCYAN;STICKLINE(趋势> REF(趋势,1),O,C,2.75,0),COLORFF00FF;STICKLINE(趋势<=REF(趋势,1),C,O,2.75,0),COLORFF7700;}VAR1:=REF(MA(C,20),10);开:=O-VAR1;高:=H-VAR1;低:=L-VAR1;收:=C-VAR1;MID:=MA(C,20);UPPER:=MID+2*STD(C,20);LOWER:=MID-2*STD(C,20);V1:=(C-LOWER)/(UPPER-LOWER)*100;V2:=V1-EMA(V1,5);K1:=SUM(LLV(V2,4),4)/4;V3:=EMA(V2,64)*10;V4:=EM A(0.4*V2*(-1),3);V5:=-1*EMA(V2,39)*10;A:=V3>10;B:=V2>V4;D:=V5>10;E:=V3<=10 OR V2<=V4 OR V5<=10;STICKLINE(收>=开 AND E,C,O,2.75,0) ,COLORYELLOW;STICKLINE(收< 开 AND E,C,O,2.75,0) ,COLORYELLOW;STICKLINE(开> 收 AND A,C,O,2.75,0),COLORFF0000;STICKLINE(开<=收 AND A,C,O,2.75,0),COLORYELLOW;STICKLINE(开> 收 AND B,C,O,2.75,0),COLORFF00FF;STICKLINE(开<=收 AND B,C,O,2.75,0),COLORFF00FF;STICKLINE(开> 收 AND D,C,O,2.75,0),COLORGREEN;量:=(CLOSE-LLV(LOW,32))/(HHV(HIGH,32)-LLV(LOW,32))*1.2*CLOSE;量1:=EMA(量,3);量2:=EMA(量,5);量3:=EMA(量,7);T1:=量2>=量3 AND 量1<REF(量1,1);T2:=量2< 量3 AND 量1>REF(量1,1);STICKLINE(T1,C,O,1.25,0),COLORFF7700;STICKLINE(T1,C,O,1.25,0),COLORFF7700;STICKLINE(T2,C,O,1.25,0),COLORRED;STICKLINE(T2,C,O,1.25,0),COLORRED;N:=10;大涨:=CLOSE/REF(CLOSE,1)>=1.08 OR ((H-L)/REF(C,1)>0.1 AND C=H);STICKLINE(大涨,C,O,2.75,0),COLOR007FFF;DA:=(EMA(C,1)+EMA(C,2)+EMA(C,3)+EMA(C,4))/4;DBB:=(EMA(C,10)+EMA(C,20)+EMA(C,40)+EMA(C,80))/4;DRAWTEXT(CROSS(DA-DBB,0),L*0.995,'★B'),COLORYELLOW;JH:=SMA(MAX(C-REF(C,1),0),5,1)/SMA(ABS(C-REF(C,1)),5,1)*100;DRAWTEXT(CROSS(84,JH),H*1.005,'☆S'),COLORGREEN;MA5:MA(C,5)*IF(CONST(MA(C,5)) AND CURRBARSCOUNT<=4,1,DRAWNULL)COLORYELLOW LINETHICK3;NN:=8;AA:=REF(H,NN)=HHV(H,2*NN+1); AA1:=REF(L,NN)=LLV(L,2 *NN+1);QY:=BACKSET(AA,NN+1); QY1:=BACKSET(AA1,NN+1);CC:=FILTER(QY,NN) AND H=HHV(H,NN+1);CC1:=FILTER(QY1,NN) AND L=LLV(L,NN+1);DRAWICON(CC1,L,1);DRAWICON(CC,H,2);DDD:=BARSLAST(CC); DD1:=BARSLAST(CC1);GDTS:=IF(CC,CURRBARSCOUNT,0); DDTS:=IF(CC1,CURRBAR SCOUNT,0);DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS); DDTS1:=IF(DD1 ,REF(DDTS,DD1),DDTS);GDCS1:=CONST(DINGBUTS); DDCS1:=CONST(DDTS1);GDCS13:=CONST(REF(HIGH,GDCS1-1)); DDCS13:=CONST(REF(L,DDCS1-1));DINGBUTS1:=REF(DINGBUTS,DDD+1); DDTS2:=REF(DDTS1, DD1+1);GDCS2:=CONST(DINGBUTS1); DDCS2:=CONST(DDTS2);GDCS23:=CONST(REF(HIGH,DINGBUTS1-1)); DDCS23:=CONST(REF(L,DDTS2-1));XG1:=BACKSET(ISLASTBAR,GDCS1); XD1:=BACKSET(ISLAST BAR,DDCS1);XG2:=BACKSET(ISLASTBAR,DINGBUTS1); XD2:=BACKSET(IS LASTBAR,DDTS2);STICKLINE(XG2,GDCS23,GDCS23,1,1),COLORRED;STICKLINE(XG1,GDCS13,GDCS13,1,1),COLORRED;DDDDDDD:STICKLINE(XD2,DDCS23,DDCS23,1,1),COLORGRE EN;EEEEEEE:STICKLINE(XD1,DDCS13,DDCS13,1,1),COLORGREEN;。
最牛通达信量化副图指标公式源码
最牛通达信量化副图指标公式源码M1:=5;M2:=10;ZLCM:=EMA(WINNER(CLOSE)*70,3);{//主力筹码估算} SHCM:=EMA((WINNER(CLOSE*1.1)-WINNER(CLOSE*0.9 ))*80,3);{//小筹码估算}ZSHTL:=SHCM/(ZLCM+SHCM)*100;{//小股民套牢筹码比率}ZZLKP:=ZLCM/(ZLCM+SHCM)*100;{//主力控盘筹码比率} ZCMZL:=MA(ZLCM+SHCM,13);{//市场筹码总量} ZZNTS:=BARSLAST(ZSHTL90);{//走牛天数}ZSHJJ:=EMA(ZSHTL,89);{//小股民警戒}ZZLJJ:=EMA(ZZLKP,89);{//主力警戒}ZJLRQD:=INTPART(ZZLKP-ZZLJJ);{//资金流入强度}SH8:=EMA(ZSHTL,8);DKB:=IF(ZZLKP-REF(ZZLKP,1)>ZSHTL-REF(ZSHTL,1),1,0 );{//------【数值显示】}散户套牢系数:INTPART(ZSHTL),NODRAW;主力控盘系数:INTPART(ZZLKP),COLOR4080FF,NODRAW; 资金流入强度:ZJLRQD,NODRAW,COLOR00FFFF;{☆精确风险}{【参数定义】}RSV:=(CLOSE-LLV(LOW,15))/(HHV(HIGH,15)-LLV(LOW,1 5))*100;K1:=SMA(RSV,10,1);D1:=SMA(K1,5,1);KK:=INTPART(K1);DD0:=INTPART(D1);TFXXS:=KK+DD0;{//变异KD风险系数}TGLD:=MOD(TFXXS,10);{//踏浪涨停概率点}TGLXS:=(TFXXS-REF(TFXXS,1))*10;{//变异KD乖离系数} TYCFX:=TFXXS+TGLXS;{//变异KD预测风险}乖离系数:TGLXS,LINETHICK0,COLORGREEN,NODRAW; {【图解模板】}{级别拐点}{乖离系数}STICKLINE(TGLXS>0,100,100+TGLXS,3,0),COLOR000088; STICKLINE(TGLXS>0,100,100+TGLXS,2.5,0),COLOR00009 9;STICKLINE(TGLXS>0,100,100+TGLXS,2,0),COLOR0000A A;STICKLINE(TGLXS>0,100,100+TGLXS,1.5,0),COLOR0000BB;{STICKLINE(TGLXS>0,100,100+TGLXS,1.2,0),COLOR0000 CC;}STICKLINE(TGLXS>0,100,100+TGLXS,1.0,0),COLOR0000 DD;{STICKLINE(TGLXS>0,100,100+TGLXS,0.8,0),COLOR0000 EE;}STICKLINE(TGLXS>0,100,100+TGLXS,0.5,0),COLOR0000F F;{//红柱}STICKLINE(TGLXS<0,100,100+TGLXS,3,0),COLOR008800; {STICKLINE(TGLXS<0,100,100+TGLXS,2.8,0),COLOR0099 00;}STICKLINE(TGLXS<0,100,100+TGLXS,2.5,0),COLOR00AA 00;STICKLINE(TGLXS<0,100,100+TGLXS,2,0),COLOR00BB00 ;{STICKLINE(TGLXS<0,100,100+TGLXS,1.8,0),COLOR00C C00;}STICKLINE(TGLXS=0,100,100+TGLXS,8,0),COLORRED; STICKLINE(TGLXS=0 AND REF(TGLXS,1)REF(ZCMZL,1) AND DKB=0);T3:=CONST( ZCMZL=REF(ZCMZL,1));T4:=CONST( ZCMZL50 AND TFXXS=REF(TFXXS,1) AND TFXXS>100);T10:=CONST(TFXXS>50 AND TFXXS100 );T11:=CONST(TFXXS>50 AND TFXXSREF(ZCMZL,1) );T15:=CONST(CROSS(ZCMZL,ZZLKP) AND ZZLKP>ZZLJJ AND ZZLKP10 AND ZZLJJ>REF(ZZLJJ,1) AND ZCMZL>REF(ZCMZL,1) );T16:=CONST( CROSS(ZCMZL,ZSHTL) ANDZSHTL>ZZLKP AND ZCMZL>REF(ZCMZL,1));T17:=CONST( CROSS(ZCMZL,100) ANDZCMZL>REF(ZCMZL,1));T18:=CONST(REF(ZSHTL,1)>90 AND ZSHTL<90 );TS1:=IF(T1=1,0+0.03,0);TS2:=IF(T2=1,TS1+0.03,TS1);TS3:=IF(T3=1,TS2+0.03,TS2);TS4:=IF(T4=1,TS3+0.03,TS3);TS5:=IF(T5=1,TS4+0.03,TS4);TS6:=IF(T6=1,0+0.73,0);TS7:=IF(T7=1,TS6+0.03,TS6);TS8:=IF(T8=1,TS7+0.03,TS7);TS9:=IF(T9=1,TS8+0.03,TS8);TS10:=IF(T10=1,TS9+0.03,TS9);TS11:=IF(T11=1,TS10+0.03,TS10);TS12:=IF(T12,0+0.03,0);TS13:=IF(T13=1,TS12+0.03,TS12);TS14:=IF(T14=1,TS13+0.03,TS13);TS15:=IF(T15=1,TS14+0.03,TS14);TS16:=IF(T16=1,TS15+0.03,TS15);TS17:=IF(T17=1,TS16+0.03,TS16);TS18:=IF(T8=1,TS17+0.03,TS17);DRAWTEXT_FIX(T1,0.66,TS1,0,'★监控:主力增仓'),COLOR8080FF;DRAWTEXT_FIX(T2,0.66,TS2,0,'★监控:主力减仓'),COLORFFFF00;DRAWTEXT_FIX(T3,0.66,TS3,0,'★监控:多空平衡'),COLORGRAY;DRAWTEXT_FIX(T4,0.66,TS4,0,'★监控:主力回补'),COLORFF9933;DRAWTEXT_FIX(T5,0.66,TS5,0,'★监控:主力出逃'),COLORFFFF00;DRAWTEXT_FIX(T6,0.86,TS6,0,'★操作:买入风险'),COLORYELLOW;DRAWTEXT_FIX(T7,0.86,TS7,0,'★操作:卖出风险'),COLORFFFF00;DRAWTEXT_FIX(T8,0.86,TS8,0,'★操作:追涨博弈'),COLOR8080FF;DRAWTEXT_FIX(T9,0.86,TS9,0,'★操作:稳健持股'),COLOR8080FF;DRAWTEXT_FIX(T10,0.86,TS10,0,'★操作:盘跌减仓'),COLORFFFF00;DRAWTEXT_FIX(T11,0.86,TS11,0,'★操作:杀跌空仓'),COLORFFFF00;DRAWTEXT_FIX(T12,0.36,TS12,0,'☆特别提示:筑底散兵坑'),COLOR66FFCC;DRAWTEXT_FIX(T13,0.36,TS13,0,'☆特别提示:铸顶风险区'),COLORFFFF00;DRAWTEXT_FIX(T14,0.36,TS14,0,'☆特别提示:穿越主力'),COLOR8080FF;DRAWTEXT_FIX(T15,0.36,TS15,0,'☆特别提示:穿越主力'),COLORYELLOW;DRAWTEXT_FIX(T16,0.36,TS16,0,'☆特别提示:穿越散户'),COLORGREEN;DRAWTEXT_FIX(T17,0.36,TS17,0,'☆特别提示:全盘穿越'),COLOR3399FF;DRAWTEXT_FIX(T18,0.36,TS18,0,'☆特别提示:神秘黑洞'),COLOR9966FF;{AAA:=REFDATE(HHV(H,30),DATE);T1A:=CONST(IF(ZZNTS,1,0));TS1A:=IF(T1A=1,0+0.03,0);}{DRAWTEXT(T1A=1 AND CURRBARSCOUNT=45 AND PERIOD=5,AAA-(AAA*TS1A),'【走牛天数判断】'),COLORRED,LINETHICK6;}{DRAWNUMBER(T1A=1 AND CURRBARSCOUNT=45-12 ANDPERIOD=5,AAA-(AAA*TS1A),CONST(ZZNTS)),COLORRE D,LINETHICK6;};三日最低:=EMA((REF(L,4)+REF(L,3)+REF(L,2))/3,3);三日最高:=EMA((REF(H,4)+REF(H,3)+REF(H,2))/3,3),COLORWHI TE;高:=CROSS(CROSS(三日最高,C),0.6),STICK,COLORWHITE;DRAWICON(高>0,高,2);F:=100*(C-REF(C,1))/REF(C,1);博尔:=IF(C0,P1=0,1);量:V,VOLSTICK;PJJ:=DMA((((HIGH + LOW) + (CLOSE * 2)) / 4),0.9);JJ:=REF(EMA(PJJ,3),1);QJJ:=(VOL / (((HIGH - LOW) * 2) - ABS((CLOSE - OPEN)))); XVL:=(IF((CLOSE > OPEN),(QJJ * (HIGH -LOW)),IF((CLOSE OPEN),(0 - (QJJ * ((HIGH - CLOSE) + (OPEN - LOW)))),IF((CLOSE 10),10,ZLL);HSL:=((XVL / 20) / 1.15);进攻流量:=(((HSL * 0.55) + (REF(HSL,1) * 0.33)) +(REF(HSL,2) * 0.22));GJJ:=EMA(进攻流量,8); LLJX:=EMA(进攻流量,3);动态天量:=CONST(IF(V=HHV(V,20),V,REF(V,BARSLAST(V=HHV (V,20))))),COLOR00FF00,POINTDOT;STICKLINE(((HSL * 0.4) >= 0),动态天量+((HSL * 0.4)+LLJX)*20,动态天量,3,0),COLORYELLOW;STICKLINE(((HSL * 0.4)0,(HSL*0.4+LLJX),DRAWNULL),COLORRED;资金流出:=IF((HSL*0.4+LLJX)0,资金流入,资金流出),COLORWHITE,POINTDOT;收支比例%:IF((HSL*0.4+LLJX)>0,资金流入/万元*100,资金流出/万元*100),COLORYELLOW;连红天1:=BARSLASTCOUNT(资金净收支>0),,COLORA20FFD,NODRAW;连红天2:=IF(连红天1=0,REF(连红天1,1),连红天1),,COLORA20FFD,NODRAW;连红天3:=IF(连红天2=0,REF(连红天1,2),连红天2),,COLORA20FFD,NODRAW;连红天4:=IF(连红天3=0,REF(连红天1,3),连红天3),,COLORA20FFD,NODRAW;近期连红天:IF(连红天4=0,REF(连红天1,4),连红天4),COLORYELLOW,NODRAW;三日资金:SUM(资金收支,3),COLORWHITE,NODRAW;五日资金:SUM(资金收支,5),COLORFF00FF,NODRAW;十日资金:SUM(资金收支,10),COLOR0000FF,NODRAW;资金流量:=LLJX,LINETHICK0,COLOR0000FF; STICKLINE((资金流量> 0),动态天量+资金流量*20,动态天量,3,0),COLOR0000FF;STICKLINE((资金流量< 0),动态天量+资金流量*20,动态天量,3,0),COLOR008000;万手:VOL/10000,LINETHICK0;BB:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN)); TOTAL:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30, IF(PERIOD=4,60,IF(PERIOD=5,TOTALFZNUM,1))))); MTIME:=MOD(FROMOPEN,TOTAL);CTIME:=IF(MTIME<0.5,TOTAL,MTIME);VVOL:IF(CURRBARSCOUNT=1,VOL*TOTAL/CTIME,DRA WNULL),NODRAW;STICKLINE(CURRBARSCOUNT=1,VVOL,0,-1,-1),COLOR0 0C0C0;VOLUME:VOL,VOLSTICK;MA VOL1:MA(VOLUME,M1),COLOR80FFFF,LINETHICK1; MA VOL2:MA(VOLUME,M2),COLORFF00FF,LINETHICK1; {变色彩带}V AR1:=(2*CLOSE+HIGH+LOW)/4;操盘线:(EMA(V AR1,2)+EMA(VAR1,3)+EMA(V AR1,5)+EMA(V AR1, 8)+EMA(V AR1,11)+EMA(V AR1,13))/6.4,COLORFFFF00,LIN ETHICK1,CIRCLEDOT;IF(操盘线>REF(操盘线,1),操盘线,DRAWNULL),COLOR0000FF,LINETHICK1,CIRCLEDOT ;。
通达信量化交易指标公式
通达信量化交易指标公式通达信量化交易指标公式是技术分析的一种重要工具。
它通过收集当前市场的各种数据,分析和识别市场走势,以确定购买或出售的机会。
下面我们一起来了解和学习一些通达信量化交易指标公式:一、均线指标1、 MA(Moving Average):移动平均线,它是最常用的技术指标,用于分析趋势,反映价格的趋势变化趋势,常用的时间各种MOV移动平均线,如MA5,MA10,MA20等等。
2、 EMA(Exponential Moving Average):指数平滑移动平均线,它结合指数位置的原理,更多的加重当前周期的数据,保持较为平滑的趋势,表现比MA移动平均线好。
3、 DMA(Dynamic Moving Average):动态移动平均线,是根据投资者所定义的变量,结合价格波动,动态调节MA步长和尺度,较好的反映价格的走势特征,有利于及时准确的作出买卖操作。
二、动量指标1、MOM(Momentum):动量指标,这里的动量指的是时间上的变化,也用于分析股票的趋势变化,当动能指标接近正数时,价格处于上升趋势,接近负数则表示价格处于下降趋势。
2、RSI(Relative Strength Index):相对强弱指标,反映股票超买和超卖的状况,当RSI值大于70时,表示股票超卖,可以卖出;当RSI值小于30时,表示股票超买,可以买入。
三、移动幅度指标1、BOLL(Bollinger Band):波拉克布林带,它利用标准差的原理,通过统计数据的方法,反映价格的波动,一般用于股价分析中,如果价格上穿布林带上轨,可以介入多头仓位,如果价格下穿布林带下轨,可以介入空头仓位。
2、MAV(Moving Average Volatility):移动幅度指标,它利用移动数值模拟价格波动,通过分析历史价格的变化,绘制的移动幅度图线,用于预测未来价格的变化趋势。
三、通道线指标1、KDJ(KDJ Indicator):随机指标,它结合变异系数和动量系数的计算,通过过去的价格和成交量波动对未来的结果进行预测,用于确定购买或出售的机会。
最牛通达信量化副图指标公式源码
最牛通达信量化副图指标公式源码M1:=5;M2:=10;ZLCM:=EMA(WINNER(CLOSE)*70,3);{// 主力筹码估算} SHCM:=EMA((WINNER(CLOSE*1.1)-WINNER(CLOSE*0.9 ))*80,3);{// 小筹码估算}ZSHTL:=SHCM/(ZLCM+SHCM)*100;{// 小股民套牢筹码比率} ZZLKP:=ZLCM/(ZLCM+SHCM)*100;{// 主力控盘筹码比率} ZCMZL:=MA(ZLCM+SHCM,13);{// 市场筹码总量}ZZNTS:=BARSLAST(ZSHTL90);{// 走牛天数}ZSHJJ:=EMA(ZSHTL,89);{// 小股民警戒}ZZLJJ:=EMA(ZZLKP,89);{// 主力警戒}ZJLRQD:=INTPART(ZZLKP-ZZLJJ);{// 资金流入强度}SH8:=EMA(ZSHTL,8);DKB:=IF(ZZLKP-REF(ZZLKP,1)>ZSHTL-REF(ZSHTL,1),1,0 );{// ----- 【数值显示】}散户套牢系数:INTPART(ZSHTL),NODRAW;主力控盘系数:INTPART(ZZLKP),COLOR4080FF,NODRAW;资金流入强度:ZJLRQD,NODRAW,COLOR00FFFF;{ ☆精确风险}{ 【参数定义】}RSV:=(CLOSE-LLV(LOW,15))/(HHV(HIGH,15)-LLV(LOW,1 5))*100;K1:=SMA(RSV ,10,1);D1:=SMA(K1,5,1);KK:=INTPART(K1);DD0:=INTPART(D1);TFXXS:=KK+DD0;{// 变异KD 风险系数}TGLD:=MOD(TFXXS,10);{// 踏浪涨停概率点}TGLXS:=(TFXXS-REF(TFXXS,1))*10;{// 变异KD 乖离系数} TYCFX:=TFXXS+TGLXS;{// 变异KD 预测风险} 乖离系数:TGLXS,LINETHICK0,COLORGREEN,NODRAW;{ 【图解模板】}{ 级别拐点}{ 乖离系数}STICKLINE(TGLXS>0,100,100+TGLXS,3,0),COLOR000088; STICKLINE(TGLXS>0,100,100+TGLXS,2.5,0),COLOR00009 9; STICKLINE(TGLXS>0,100,100+TGLXS,2,0),COLOR0000AA;STICKLINE(TGLXS>0,100,100+TGLXS,1.5,0),COLOR0000 BB;{STICKLINE(TGLXS>0,100,100+TGLXS,1.2,0),COLOR0000 CC;}STICKLINE(TGLXS>0,100,100+TGLXS,1.0,0),COLOR0000 DD; {STICKLINE(TGLXS>0,100,100+TGLXS,0.8,0),COLOR0000 EE;}STICKLINE(TGLXS>0,100,100+TGLXS,0.5,0),COLOR0000F F;{// 红柱}STICKLINE(TGLXS<0,100,100+TGLXS,3,0),COLOR008800; {STICKLINE(TGLXS<0,100,100+TGLXS,2.8,0),COLOR0099 00;} STICKLINE(TGLXS<0,100,100+TGLXS,2.5,0),COLOR00AA 00; STICKLINE(TGLXS<0,100,100+TGLXS,2,0),COLOR00BB00{STICKLINE(TGLXS<0,100,100+TGLXS,1.8,0),COLOR00CC00;}STICKLINE(TGLXS=0,100,100+TGLXS,8,0),COLORRED; STICKLINE(TGLXS=0 AND REF(TGLXS,1)REF(ZCMZL,1) AND DKB=0);T3:=CONST( ZCMZL=REF(ZCMZL,1));T4:=CONST( ZCMZL50 AND TFXXS=REF(TFXXS,1) ANDTFXXS>100);T10:=CONST(TFXXS>50 AND TFXXS100 );T11:=CONST(TFXXS>50 AND TFXXSREF(ZCMZL,1) );T15:=CONST(CROSS(ZCMZL,ZZLKP) AND ZZLKP>ZZLJJ AND ZZLKP10 AND ZZLJJ>REF(ZZLJJ,1) ANDZCMZL>REF(ZCMZL,1) );T16:=CONST( CROSS(ZCMZL,ZSHTL) ANDZSHTL>ZZLKP AND ZCMZL>REF(ZCMZL,1));T17:=CONST( CROSS(ZCMZL,100) ANDZCMZL>REF(ZCMZL,1));T18:=CONST(REF(ZSHTL,1)>90 AND ZSHTL<90 );TS1:=IF(T1=1,0+0.03,0);TS2:=IF(T2=1,TS1+0.03,TS1);TS3:=IF(T3=1,TS2+0.03,TS2);TS4:=IF(T4=1,TS3+0.03,TS3);TS5:=IF(T5=1,TS4+0.03,TS4);TS6:=IF(T6=1,0+0.73,0);TS7:=IF(T7=1,TS6+0.03,TS6);TS8:=IF(T8=1,TS7+0.03,TS7);TS9:=IF(T9=1,TS8+0.03,TS8);TS10:=IF(T10=1,TS9+0.03,TS9);TS11:=IF(T11=1,TS10+0.03,TS10);TS12:=IF(T12,0+0.03,0);TS13:=IF(T13=1,TS12+0.03,TS12);TS14:=IF(T14=1,TS13+0.03,TS13);TS15:=IF(T15=1,TS14+0.03,TS14);TS16:=IF(T16=1,TS15+0.03,TS15);TS17:=IF(T17=1,TS16+0.03,TS16);TS18:=IF(T8=1,TS17+0.03,TS17); DRAWTEXT_FIX(T1,0.66,TS1,0,' ★监控:'),COLOR8080FF;DRAWTEXT_FIX(T2,0.66,TS2,0,' ★监控:'),COLORFFFF00;DRAWTEXT_FIX(T3,0.66,TS3,0,' ★监控:'),COLORGRAY;DRAWTEXT_FIX(T4,0.66,TS4,0,' ★监控:'),COLORFF9933;DRAWTEXT_FIX(T5,0.66,TS5,0,' ★监控:'),COLORFFFF00;DRAWTEXT_FIX(T6,0.86,TS6,0,' ★操作:'),COLORYELLOW;DRAWTEXT_FIX(T7,0.86,TS7,0,' ★操作:'),COLORFFFF00; 主力增仓主力减仓多空平衡主力回补主力出逃买入风险DRAWTEXT_FIX(T8,0.86,TS8,0,' ★操作:追涨博弈'),COLOR8080FF;DRAWTEXT_FIX(T9,0.86,TS9,0,' ★操作:稳健持股'),COLOR8080FF;DRAWTEXT_FIX(T10,0.86,TS10,0,' '),COLORFFFF00;DRAWTEXT_FIX(T11,0.86,TS11,0,''),COLORFFFF00;'),COLOR3399FF;DRAWTEXT_FIX(T18,0.36,TS18,0,' '),COLOR9966FF;{AAA:=REFDATE(HHV(H,30),DATE);T1A:=CONST(IF(ZZNTS,1,0));TS1A:=IF(T1A=1,0+0.03,0);} {DRAWTEXT(T1A=1 AND★操作:盘跌减仓★操作:杀跌空仓DRAWTEXT_FIX(T12,0.36,TS12,0,' ☆特别提示: 筑底散兵坑 '),COLOR66FFCC;DRAWTEXT_FIX(T13,0.36,TS13,0,' ☆特别提示: 铸顶风险区 '),COLORFFFF00;DRAWTEXT_FIX(T14,0.36,TS14,0,' ☆特别提示: 穿越主力 '),COLOR8080FF;DRAWTEXT_FIX(T15,0.36,TS15,0,' ☆特别提示: 穿越主力 '),COLORYELLOW;DRAWTEXT_FIX(T16,0.36,TS16,0,' ☆特别提示: 穿越散户 '),COLORGREEN;DRAWTEXT_FIX(T17,0.36,TS17,0,' ☆特别提示: 全盘穿越 ☆特别提示:神秘黑洞CURRBARSCOUNT=45 AND PERIOD=5,AAA-(AAA*TS1A),' 【走牛天数判断】'),COLORRED,LINETHICK6;} {DRAWNUMBER(T1A=1 AND CURRBARSCOUNT=45-12 AND PERIOD=5,AAA-(AAA*TS1A),CONST(ZZNTS)),COLORRED,LINETHICK6;};三日最低:=EMA((REF(L,4)+REF(L,3)+REF(L,2))/3,3); 三日最高:=EMA((REF(H,4)+REF(H,3)+REF(H,2))/3,3),COLORWHI TE; 高:=CROSS(CROSS( 三日最高,C),0.6),STICK,COLORWHITE; DRAWICON( 高>0,高,2);F:=100*(C-REF(C,1))/REF(C,1);博尔:=IF(C0,P1=0,1);量:V,VOLSTICK;PJJ:=DMA((((HIGH + LOW) + (CLOSE * 2)) / 4),0.9);JJ:=REF(EMA(PJJ,3),1);QJJ:=(VOL / (((HIGH - LOW) * 2) - ABS((CLOSE - OPEN)))); XVL:=(IF((CLOSE > OPEN),(QJJ * (HIGH - LOW)),IF((CLOSE OPEN),(0 - (QJJ * ((HIGH - CLOSE) + (OPEN - LOW)))),IF((CLOSE 10),10,ZLL);HSL:=((XVL / 20) / 1.15); 进攻流量:=(((HSL * 0.55) +(REF(HSL,1) * 0.33)) + (REF(HSL,2) * 0.22));GJJ:=EMA( 进攻流量,8); LLJX:=EMA( 进攻流量,3); 动态天量:=CONST(IF(V=HHV(V ,20),V,REF(V,BARSLAST(V=HHV (V,20))))),COLOR00FF00,POINTDOT;STICKLINE(((HSL * 0.4) >= 0), 动态天量+((HSL * 0.4)+LLJX)*20, 动态天量,3,0),COLORYELLOW;STICKLINE(((HSL * 0.4)0,(HSL*0.4+LLJX),DRAWNULL),COLORRED;资金流出:=IF((HSL*0.4+LLJX)0, 资金流入,资金流出),COLORWHITE,POINTDOT;收支比例%:IF((HSL*0.4+LLJX)>0, 资金流入/万元*100, 资金流出/万元*100),COLORYELLOW;连红天1:=BARSLASTCOUNT( 资金净收支>0),,COLORA20FFD,NODRAW;连红天2:=IF( 连红天1=0,REF(连红天1,1),连红天1) ,,COLORA20FFD,NODRAW;连红天3:=IF( 连红天2=0,REF(连红天1,2),连红天2) ,,COLORA20FFD,NODRAW;连红天4:=IF( 连红天3=0,REF(连红天1,3),连红天3) ,,COLORA20FFD,NODRAW;近期连红天:IF( 连红天4=0,REF(连红天1,4),连红天4) ,COLORYELLOW,NODRAW;三日资金:SUM( 资金收支,3),COLORWHITE,NODRAW; 五日资金:SUM( 资金收支,5),COLORFF00FF,NODRAW;十日资金:SUM( 资金收支,10),COLOR0000FF,NODRAW;资金流量:=LLJX,LINETHICK0,COLOR0000FF;STICKLINE(( 资金流量> 0),动态天量+资金流量*20, 动态天量,3,0),COLOR0000FF;STICKLINE(( 资金流量< 0),动态天量+资金流量*20, 动态天量,3,0),COLOR008000;万手:VOL/10000,LINETHICK0;BB:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));TOTAL:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30, IF(PERIOD=4,60,IF(PERIOD=5,TOTALFZNUM,1))))); MTIME:=MOD(FROMOPEN,TOTAL);CTIME:=IF(MTIME<0.5,TOTAL,MTIME);VVOL:IF(CURRBARSCOUNT=1,VOL*TOTAL/CTIME,DRA WNULL),NODRAW;STICKLINE(CURRBARSCOUNT=1,VVOL,0,-1,-1),COLOR00C0C0;VOLUME:VOL,VOLSTICK;MA VOL1:MA(VOLUME,M1),COLOR80FFFF,LINETHICK1; MA VOL2:MA(VOLUME,M2),COLORFF00FF,LINETHICK1;{ 变色彩带}VAR1:=(2*CLOSE+HIGH+LOW)/4;操盘线:(EMA(V AR1,2)+EMA(VAR1,3)+EMA(V AR1,5)+EMA(V AR1, 8)+EMA(V AR1,11)+EMA(V AR1,13))/6.4,COLORFFFF00,LIN ETHICK1,CIRCLEDOT;IF( 操盘线>REF(操盘线,1),操盘线,DRAWNULL),COLOR0000FF,LINETHICK1,CIRCLEDOT。
量化交易指标公式大全
量化交易指标公式大全
量化交易指标公式是量化交易中非常重要的一部分,它们是用来衡量
市场趋势、波动性和价格变化的工具。
以下是一些常见的量化交易指标公式:1. 移动平均线(MA):MA是一种平滑价格的方法,它可以帮助确定
价格趋势。
MA的公式是:MA = (收盘价1 + 收盘价2 + … + 收盘价n)/ n。
2. 相对强弱指数(RSI):RSI是一种用来衡量市场超买和超卖的
指标。
RSI的公式是:RSI = 100 - (100 / (1 + RS)),其中RS =
平均上涨价格 / 平均下跌价格。
3. 布林带(Bollinger Bands):布林
带是一种用来衡量价格波动性的指标。
布林带的公式是:中轨 = MA,上
轨 = 中轨 + 2 * 标准差,下轨 = 中轨 - 2 * 标准差。
4. 随机指标(Stochastic Oscillator):随机指标是一种用来衡量价格相对于其价
格范围的位置的指标。
随机指标的公式是:%K = (当前收盘价 - 最低价)/ (最高价 - 最低价)* 100,%D = 3日%K的简单移动平均。
5. 平均真
实范围(ATR):ATR是一种用来衡量价格波动性的指标。
ATR的公式是:TR = MAX(最高价 - 最低价,ABS(最高价 - 昨收盘价),ABS(最低价
- 昨收盘价)),ATR = TR的n日简单移动平均。
以上是一些常见的量
化交易指标公式,它们可以帮助量化交易者更好地理解市场趋势和波动性,从而做出更明智的交易决策。
通达信成功率极高的薛斯通道主图指标公式
通达信成功率极高的薛斯通道主图指标公式N:=102;M:=7;AA:=MA((2*CLOSE+HIGH+LOW)/4,5);通道1:AA*N/100;通道2:AA*(200-N)/100;CC:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);DD:=DMA(CLOSE,CC);通道3:(1+M/100)*DD;通道4:(1-M/100)*DD;DIF:=EMA(DCLOSE,9)-EMA(DCLOSE,17);DEA:=EMA(DIF,6);AAA:=(DIF-DEA)*2*60;起爆:=CROSS(AAA-REF(AAA,1),12);DRAWTEXT(起爆,L*0.975,'爆'),COLORRED;DRAWTEXT(起爆,L*0.95,'涨'),COLORRED;{红}STICKLINE(起爆,CLOSE,OPEN,3,0),COLOR000099;STICKLINE(起爆,CLOSE,OPEN,2.2,0),COLOR0000CC;STICKLINE(起爆,CLOSE,OPEN,1.5,0),COLOR0000FF;STICKLINE(起爆,CLOSE,OPEN,0.5,0),COLORCC66FF;STICKLINE(起爆,OPEN,CLOSE,0.5,0),COLORYELLOW;MACD:=(DIF-DEA)*2,COLORSTICK;TYP:=(HIGH+LOW+CLOSE)/3;CCI:=(TYP-MA(TYP,21))/(0.015*AVEDEV(TYP,21));DRAWTEXT_FIX(ISLASTBAR,0.0,0,0,HYBLOCK),COLORCYAN;DRAWTEXT_FIX(ISLASTBAR,0.1,0,0,DYBLOCK),COLORYELLO W;DRAWTEXT_FIX(ISLASTBAR,0.2,0,0,GNBLOCK),COLORGREEN;DRAWTEXT_FIX(ISLASTBAR,0.5,0,0,FGBLOCK),COLORWHITE;{MA2报警器 K线图上变成蓝色,立马出局,别犹豫,切记};VAR1P:=ZIG(3,13);STICKLINE((REF(VAR1P,2) < REF(VAR1P,1)) AND (VAR1P < REF(VAR1P,1)),CLOSE,OPEN,3,0),COLORBLUE;DRAWICON(CROSS(REF(ZIG(3,12),1),ZIG(3,12)),HIGH*1.02,2);STICKLINE((REF(VAR1P,2) > REF(VAR1P,1)) AND (VAR1P >REF(VAR1P,1)),CLOSE,OPEN,3,0),COLORYELLOW;DRAWICON(CROSS(ZIG(3,10),REF(ZIG(3,10),1)),LOW*0.99,1);超B:=L2_AMO(0,2)/10000.0;大B:=L2_AMO(1,2)/10000.0;中B:=L2_AMO(2,2)/10000.0;小B:=L2_AMO(3,2)/10000.0;超S:=L2_AMO(0,3)/10000.0;大S:=L2_AMO(1,3)/10000.0;中S:=L2_AMO(2,3)/10000.0;小S:=L2_AMO(3,3)/10000.0;TESTSKIP(NOT(超B OR 大B OR 中B OR 小B OR 超S OR 大S OR 中S OR 小S)!=0);大宗进:=(超B)+(大B),NODRAW;大宗出:=(超S)+(大S),NODRAW;非大宗进:=(中B)+(小B),NODRAW;非大宗出:=(中S)+(小S),NODRAW;DAZHIV:=CONST(MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出))))),NODRAW;DRAWRECTREL(15,CONST(950-(ABS(大宗进)*250/DAZHIV))-20,30,950,IF(CONST(大宗进>0),RGB(255,0,0),RGB(23,125,255)));DRAWRECTREL(47,CONST(950-(ABS(大宗出)*250/DAZHIV))-20,62,950,IF(CONST(大宗出>0),RGB(23,125,255),RGB(255,0,0)));DRAWRECTREL(107,CONST(950-(ABS(非大宗进)*250/DAZHIV))-20,122,950,IF(CONST(非大宗进>0),RGB(255,0,0),RGB(23,125,255)));DRAWRECTREL(141,CONST(950-(ABS(非大宗出)*250/DAZHIV))-20,154,950,IF(CONST(非大宗出>0),RGB(23,125,255),RGB(255,0,0)));DRAWTEXT_FIX(CURRBARSCOUNT=1,0.015,1,0,'主力进出'),COLORMAGENTA;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.107,1,0,'散户进出'),COLORCYAN;DRAWBMP((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)),LOW*1.02,'BUY1');DRAWBMP((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)),HIGH*1.03,'SELL1');DRAWTEXT(CROSS(83,RSI),H*1.04,' 逃顶')COLORYELLOW;今日保护价:(REF(C,2)+REF(C,1)+O)/3 ,COLORCC3299,NODRAW;顶点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,HHV(H,BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORRED, DOTLINE;低点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,LLV(L,BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORMAG ENTA,DOTLINE;STICKLINE(CCI>=200 AND H>=顶点,O,C,3,0),COLORWHITE;STICKLINE(CCI<=100 AND L<=低点,O,C,3,0),COLORMAGENTA;DRAWTEXT(ISLASTBAR,顶点,'顶点'),COLORMAGENTA;DRAWTEXT(ISLASTBAR,低点,'低点'),COLORRED;{COLORWHITE;};{暴涨信号主图}VAR5A:=EMA(DCLOSE,12)-EMA(DCLOSE,26);VAR6A:=EMA(VAR5A,9);VAR7A:=(VAR5A-VAR6A)*2*60;VAR8A:=CROSS(VAR7A-REF(VAR7A,1),15);DRAWICON(VAR8A,LOW*1.09,25);空:=EMA(CLOSE,5);均衡:=EMA(空,0),COLORFFFFFF;下趋势双线持币:HHV(MA(HIGH,3),2),LINETHICK0,COLORGREEN;上趋势单线持股:LLV(MA(HIGH,3),1),LINETHICK0,COLORRED;VAR5:=FILTER(均衡>REF(均衡,1) AND 下趋势双线持币<REF(下趋势双线持币,1) AND CLOSE>REF(CLOSE,1),11);IF(VAR5>=1,L*0.996,DRAWNULL),COLORMAGENTA,CIRCLED OT;B1:=REF(C,1);B2:=REF(C,2);SS:=IF(C>REF(C,1) AND REF(C,1)>=REF(C,2),1,IF(C<REF(C,1) AND REF(C,1)<=REF(C,2),-1,IF(C>REF(C,2) AND REF(C,2)>REF(C,1),2,IF(C<REF(C,2) AND REF(C,2)<REF(C,1),-2,0))));VAR3:=LLV(HIGH,240);VAR4:=100*(CLOSE-VAR3)/VAR3;VAR6:=(CLOSE-LLV(CLOSE,530))/(HHV(CLOSE,530)-LLV(CLOSE,530))*100;VAR7:=0;VAR8:=MA(HHV(CLOSE-REF(CLOSE,1),0),34)/MA(ABS(CLOSE-REF(CLOSE,1)),7)*100;VAR9:=MA(HHV(CLOSE-REF(CLOSE,1),0),13)/MA(ABS(CLOSE-REF(CLOSE,1)),13)*100;VARA:=BARSCOUNT(CLOSE);VARB:=VAR8<20 AND VAR9<23 AND VARA>35;VARC:=VARB AND COUNT(VARB,1)=1;VARD:=EMA(CLOSE,21)-EMA(CLOSE,8);VARE:=EMA(VARD,5);VARF:=TROUGH(3,6,1)<4 AND CROSS(VARD,VARE);VAR10:=IF(TROUGH(3,16,1)=0 AND HIGH>LOW+0.04,4,0);VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3);VAR12:=ZIG(3,6)<REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)>=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3);VAR13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3);VAR14:=ZIG(3,22)<REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)>=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3);VAR15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3);VAR16:=ZIG(3,51)<REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)>=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3);VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) ANDREF(ZIG(3,72),2)<=REF(ZIG(3,72),3);VAR18:=ZIG(3,72)<REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)>=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3);VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);VAR1A:=EMA(VAR19,100);VAR1B:=2*(VAR19-VAR1A);VAR1C:=POW(VAR1B,3)*0.1+POW(VAR1B,1);VAR1D:=SQRT(SQRT(LOW*HIGH*OPEN*CLOSE));VAR1E:=EMA(VAR1D*0.97,3);VAR1F:=(HIGH+LOW+CLOSE)/3;VAR20:=(VAR1F-MA(VAR1F,14))/(0.015*AVEDEV(VAR1F,14));VAR21:=CROSS(VAR1E,LOW);买点1:=VAR10;买点2:=(VAR11+VAR13+VAR15+VAR17);卖点1:=(VAR12+VAR14+VAR16+VAR18),LINETHICK2;VAR22:=买点1 AND VARF AND VARC AND VAR21 AND VAR4<0 AND VAR5=0 AND VAR6=0 AND VAR20<(-110);DRAWTEXT(买点1>0,LOW+0.2,'买'),COLORRED;DRAWTEXT(买点2>0,LOW+0.2,'买'),COLORFF00FF;DRAWTEXT(卖点1>0,HIGH+0.1,'逃'), COLOR33FF33;黑马线:15,POINTDOT,COLORFFFFFF;主力:VAR7A-REF(VAR7A,1),COLORRED;DRAWICON(CROSS(主力,黑马线),黑马线,25);LING0:0,POINTDOT,COLOR0FFFFF;。
通道交易法指标------堪称短线绝代指标
通道交易法指标------堪称短线绝代指标多止损:XMA(XMA(L,25),25)-(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*3.5,NODRAW,COLORYELLOW;多止盈:(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1+XMA(XMA(H,25),25),NODRAW,COLORW HITE;空止损:(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*3.5+XMA(XMA(H,25),25),NODRAW,COLOR YELLOW;空止盈:XMA(XMA(L,25),25)-(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1,NODRAW,COLORWHITE;短高H:=(20*H+19*REF(H,1)+18*REF(H,2)+17*REF(H,3)+16*REF(H,4)+ 15*REF(H,5)+14*REF(H,6)+13*REF(H,7)+12*REF(H,8)+11*REF(H,9)+10*REF(H,10)+9*R EF(H,11)+8*REF(H,12)+7*REF(H,13)+6*REF(H,14)+5*REF(H,15)+4*REF(H,16)+3*RE F(H,17)+2*REF(H,18)+REF(H,20))/210,COLORBLUE,LINETHICK1;短低L:=(20*L+19*REF(L,1)+18*REF(L,2)+17*REF(L,3)+16*REF(L,4)+15 *REF(L,5)+14*REF(L,6)+13*REF(L,7)+12*REF(L,8)+11*REF(L,9)+10*REF(L,10)+9*REF (L,11)+8*REF(L,12)+7*REF(L,13)+6*REF(L,14)+5*REF(L,15)+4*REF(L,16)+3*REF( L,17)+2*REF(L,18)+REF(L,20))/210,COLORBLUE,LINETHICK1;D90H:=EMA(短高H,90),COLORRED,LINETHICK1;D90L:=EMA(短低L,90),COLORRED,LINETHICK1;D90差:=D90H-D90L;D90顶:=D90H+D90差*2,COLORRED,LINETHICK1;D90底:=D90L-D90差*2,COLORRED,LINETHICK1;高0:=(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1+XMA(XMA(H,25),25),LINETHICK1,COLOR WHITE;低0:=XMA(XMA(L,25),25)-(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1,LINETHICK1,COLORWHITE;多头定位:=低0>=D90底 AND 高0>=D90顶;空头定位:=高0<=D90顶 AND 低0<=D90底;震荡定位:=低0>=D90底 AND 高0<=D90顶;短顶:=(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*2+XMA(XMA(H,25),25),LINETHICK2,COLOR GREEN;短底:=XMA(XMA(L,25),25)-(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*2,LINETHICK2,COLORGREEN;短线收盘:=(C-短底)/(短顶-短底)*100000,LINETHICK2,COLORRED;短线开盘:=(O-短底)/(短顶-短底)*100000,LINETHICK2,COLORRED;短线高盘:=(H-短底)/(短顶-短底)*100000,LINETHICK2,COLORRED;短线低盘:=(L-短底)/(短顶-短底)*100000,LINETHICK0,COLORRED;顶1:=120000,COLORYELLOW,LINETHICK3;底1:=-20000,COLORYELLOW,LINETHICK3;STICKLINE(多头定位==1,顶1,底1,11,0),COLOR000066;STICKLINE(空头定位==1,顶1,底1,11,0),COLOR003300;STICKLINE(震荡定位==1,顶1,底1,11,0),COLOR555555;震荡顶:=(XMA(XMA(短线高盘,25),25)-XMA(XMA(短线低盘,25),25))*1+XMA(XMA(短线高盘,25),25),POINTDOT,COLORWHITE;震荡底:=XMA(XMA(短线低盘,25),25)-(XMA(XMA(短线高盘,25),25)-XMA(XMA(短线低盘,25),25))*1,POINTDOT,COLORWHITE;做空:=80000,COLORWHITE,LINETHICK1;做多:=20000,COLORWHITE,LINETHICK1;空损:=120000,COLORMAGENTA,LINETHICK2;多损:=-20000,COLORMAGENTA,LINETHICK2;多减仓:=65000,POINTDOT,COLORRED;空减仓:=35000,POINTDOT,COLORGREEN;DRAWTEXT(ISLASTBAR,120000,'损'),COLORMAGENTA;DRAWTEXT(ISLASTBAR,80000,'空'),COLORWHITE;DRAWTEXT(ISLASTBAR,65000,'减'),COLORRED;DRAWTEXT(ISLASTBAR,35000,'减'),COLORGREEN;DRAWTEXT(ISLASTBAR,20000,'多'),COLORWHITE;DRAWTEXT(ISLASTBAR,-20000,'损'),COLORMAGENTA;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;今D:=EMA(D,3);昨D:=REF(今D,1);STICKLINE(今D>=昨D,短线低盘,短线高盘,0,0),COLORRED;STICKLINE(今D>=昨D,短线收盘,短线开盘,2.5,0),COLORRED;STICKLINE(今D<=昨D,短线低盘,短线高盘,0,0),COLORGREEN;STICKLINE(今D<=昨D,短线收盘,短线开盘,2.5,0),COLORGREEN;白色点多定位1:=短线低盘<做多 AND 短线高盘>做多;白色点空定位1:=短线高盘>做空 AND 短线低盘<做空;STICKLINE(白色点多定位1==1,短线低盘,做多,2.5,0),COLORWHITE;STICKLINE(白色点空定位1==1,短线高盘,做空,2.5,0),COLORWHITE;白色点多定位2:=短线高盘<做多;白色点空定位2:=短线低盘>做空;STICKLINE(白色点多定位2==1,短线低盘,短线高盘,0,0),COLORWHITE;STICKLINE(白色点多定位2==1,短线收盘,短线开盘,2.5,0),COLORWHITE;STICKLINE(白色点空定位2==1,短线低盘,短线高盘,0,0),COLORWHITE;STICKLINE(白色点空定位2==1,短线收盘,短线开盘,2.5,0),COLORWHITE;多头红色点:=今D>昨D;空头红色点:=今D<昨D;多头红色点定位1:=白色点多定位1==1 AND 多头红色点==1;空头红色点定位1:=白色点空定位1==1 AND 空头红色点==1;STICKLINE(多头红色点定位1==1,短线低盘,做多,2.5,0),COLORMAGENTA;STICKLINE(空头红色点定位1==1,短线高盘,做空,2.5,0),COLORMAGENTA;多头红色点定位2:=白色点多定位2==1 AND 多头红色点==1;空头红色点定位2:=白色点空定位2==1 AND 空头红色点==1;STICKLINE(多头红色点定位2==1,短线低盘,短线高盘,0,0),COLORMAGENTA;STICKLINE(多头红色点定位2==1,短线收盘,短线开盘,2.5,0),COLORMAGENTA;STICKLINE(空头红色点定位2==1,短线低盘,短线高盘,0,0),COLORMAGENTA;STICKLINE(空头红色点定位2==1,短线收盘,短线开盘,2.5,0),COLORMAGENTA;多头多定位:=CROSS(做多,短线低盘) AND 多头定位==1;多头平定位:=CROSS(短线高盘,做空) AND 多头定位==1 AND 震荡定位==0;空头空定位:=CROSS(短线高盘,做空) AND 空头定位==1;空头平定位:=CROSS(做多,短线低盘) AND 空头定位==1 AND 震荡定位==0;震荡多定位:=CROSS(做多,短线低盘) AND 震荡定位==1;震荡空定位:=CROSS(短线高盘,做空) AND 震荡定位==1;DRAWICON(空头平定位==1,短线低盘,88);{78}DRAWICON(多头平定位==1,短线高盘,67);{67}DRAWICON(多头多定位==1 OR 震荡多定位==1,短线低盘,11);{48}DRAWICON(空头空定位==1 OR 震荡空定位==1,短线高盘,49);{49}STICKLINE(1,80000,80000,15,0),COLORWHITE;STICKLINE(1,20000,20000,15,0),COLORWHITE;STICKLINE(1,120000,120000,15,0),COLORMAGENTA;STICKLINE(1,-20000,-20000,15,0),COLORMAGENTA;STICKLINE(1,65000,65000,2,0),COLORRED;STICKLINE(1,35000,35000,2,0),COLORGREEN;。
atr通道突破指标公式Atr指标日内怎么用在股市实战图
atr通道突破指标公式Atr指标日内怎么用在股市实战图atr是K线一段时间平均波动幅度的测量指标,而atr通道突破指标公式就是依据这一数据建立的交易系统。
宽客相对论中提到,二级市场的股价总是随机波动,如果要找到变量中某种确定性的盈利机会就必须引入一个量化的交易模型。
投资本质是一场对风控、收益权衡博弈的游戏,atr指标在股市中具备实战意义,它可以明确告诉投资人每次交易时的预期盈利目标,资金投入,入场出场止损线、止盈线,可能成功的几率等等是投资风险管理中重要的指标参数。
atr指标要搞明白atr指标是什么首先要了解tr的意思,翻译成中文就是真实波幅。
计算公式是TR=|当日最高价-当日最低价|和|昨日收盘价-当日最高价|和|昨日收盘价-当日最低价|的最大值。
atr则是取一段时间TR的平均值。
通常将指标参数设置为14、21、60,应用在日线级别14,atr指的就是该品种14天的平均波幅。
QR 社区讲述了一个通俗的理解方法,你可以认为TR是每天的K线图,那么atr就是里面的移动平均线。
atr通道指标公式,atr指标日内怎么用在QR量化投资社区上,我们了解到市场行情的走势无非是三种,箱体震荡盘整格局,进二退一的稳步上涨或是退二进一的阴跌,单边趋势性暴涨、暴跌行情。
而通过设置atr通道指标公式,我们可以在日内使用这一工具来帮助帮助判断买卖操作手法,以及入场时间点。
以沪深300的股指期货为例,我们来讨论atr指标日内怎么用。
下图调取了某一天实盘的5分钟K线图,黄线代表每一根K线的开盘价格,绿线和白线分别表示一个ATR和两个ATR的距离。
所以我们的atr通道指标公式很简单,就是当日的开盘价加减正负1-3个ATR 值。
很显然价格始终在绿色线1倍ATR区间内游走,这表示当天走势震荡,需要放低预期盈利,无法做趋势性行情交易而是应该高抛低吸,若震荡时期过长面临方向性选择则可放弃交易。
第二幅图中我们可以看见,日内价格始终在1-2倍ATR震荡上行,因此每次靠近1倍ATR的时候就是一个好的买点。
通达信量化交易多空概率修正版+主导动能全套指标公式
通达信量化交易多空概率修正版+主导动能全套指标公式以下是通达信量化交易多空概率修正版+主导动能全套指标公式(无源码的请下载附件导入)通达信量化交易多空概率修正版+主导动能全套指标公式先说一下这套理论比的是概率想要直接提示买卖点然后数钱的人可以直接离开有这好事我是不会告诉你的因为没有任何关系你懂的怎么操作系统随你自己的喜好做主图附图都行用你自己思维选股或者有什么小道消息或者哪个老湿告诉你可以买的股之后看一下当时的股价是在做多位置还是做空位置高的时候多买少买就是你自己的事喽对于个股的多空概率位置小的波段中分时图30分钟60分钟很重要怎么做自己体会熊市中指数用多空概率用在指数上或者一些盘子大的个股用牛市中的指数也适用(现在对指数不宜)图中蓝色k线属于超跌运气好没准掏个大底或者阶段底里面的变色均线如果还有人不会用那就跳楼得了主导动能用法大盘指数用或者一些超级大盘股适用STICKLINE(C>=O,H,C,0,0),COLOR225588;STICKLINE(C>=O,H,C,0,0),COLOR66CCFF;STICKLINE(C>=O,O,L,0,0),COLOR225588;STICKLINE(C>=O,O,L,0,0),COLOR66CCFF;STICKLINE(C>O,C,O,3.4,0),COLOR225588;STICKLINE(C>O,C,O,3.0,0),COLOR226699;STICKLINE(C>O,C,O,2.4,0),COLOR3377AA;STICKLINE(C>O,C,O,2.0,0),COLOR3388BB;STICKLINE(C>O,C,O,1.6,0),COLOR4499CC;STICKLINE(C>O,C,O,1.2,0),COLOR44AADD;STICKLINE(C>O,C,O,0.6,0),COLOR55BBEE;STICKLINE(C>O,C,O,0.1,0),COLOR66CCFF;STICKLINE(C<=O,H,C,0,0),COLOR888800;STICKLINE(C<=O,H,C,0,0),COLORFFFF00;STICKLINE(C<=O,O,L,0,0),COLOR888800;STICKLINE(C<=O,O,L,0,0),COLORFFFF00;STICKLINE(C<=O,C,O,3.4,0),COLOR888800;STICKLINE(C<=O,C,O,3.0,0),COLOR999900;STICKLINE(C<=O,C,O,2.4,0),COLORAAAA00;STICKLINE(C<=O,C,O,2.0,0),COLORBBBB00;STICKLINE(C<=O,C,O,1.6,0),COLORCCCC00;STICKLINE(C<=O,C,O,1.2,0),COLORDDDD00;STICKLINE(C<=O,C,O,0.6,0),COLOREEEE00;STICKLINE(C<=O,C,O,0.1,0),COLORFFFF00;ZZJ:=(CLOSE#WEEK+DOPEN#WEEK+DHIGH#WEEK+DLOW #WEEK)/4;ZJ:=REF(ZZJ,5);做空68:ZJ*(1+0.0382)LINETHICK2,COLORYELLOW;做空95:ZJ*(1+0.0764)LINETHICK2,COLORBLUE;做多68:ZJ*(1-0.0382)LINETHICK2,COLORGREEN;做多95:ZJ*(1-0.0764)LINETHICK2,COLOR8409FF;个股使用的多空概率牛市中指数也可以用现在熊市对指数不适用R5:=EMA(C,3);R2:=EMA(CLOSE,13);AA:=R5>=R2;BB:=R2>R5;买入:DRAWICON(CROSS(AA,BB),L*0.98,1);卖出:DRAWICON(CROSS(BB,AA),H*1.02,2);STICKLINE(AA,C,O,3,0),COLORFFBBFF;STICKLINE(AA,H,L,0,0),COLOR00FFFF;STICKLINE(BB,C,O,3,0),COLOR00FF00;STICKLINE(BB,H,L,0,0),COLORGREEN;STICKLINE(AA,CLOSE,OPEN,3.0,0),COLORFF00FF;STICKLINE(AA,CLOSE,OPEN,2.6,0),COLORFF22FF;STICKLINE(AA,CLOSE,OPEN,2.2,0),COLORFF44FF;STICKLINE(AA,CLOSE,OPEN,1.8,0),COLORFF66FF;STICKLINE(AA,CLOSE,OPEN,1.4,0),COLORFF88FF;STICKLINE(AA,CLOSE,OPEN,1,0),COLORFF99FF;STICKLINE(AA,CLOSE,OPEN,0.5,0),COLORFFAAFF;STICKLINE(AA,CLOSE,OPEN,0.1,0),COLORFFBBFF;STICKLINE(BB,CLOSE,OPEN,3,0),COLOR008800;STICKLINE(BB,CLOSE,OPEN,2.6,0),COLOR009900;STICKLINE(BB,CLOSE,OPEN,2.2,0),COLOR00AA00;STICKLINE(BB,CLOSE,OPEN,1.8,0),COLOR00BB00;STICKLINE(BB,CLOSE,OPEN,1.4,0),COLOR00CC00;STICKLINE(BB,CLOSE,OPEN,1,0),COLOR00DD00;STICKLINE(BB,CLOSE,OPEN,0.6,0),COLOR00EE00;STICKLINE(BB,CLOSE,OPEN,0.2,0),COLOR00FF00;ZJJ:=(DCLOSE#WEEK+DOPEN#WEEK+DHIGH#WEEK+DLO W#WEEK)/4;ZJ:=REF(ZJJ,5);做空68:ZJ*(1+0.0618)LINETHICK2,COLORYELLOW;做空95:ZJ*(1+0.1226)LINETHICK2,COLORBLUE;做多68:ZJ*(1-0.0618)LINETHICK2,COLORGREEN;做多95:ZJ*(1-0.1226)LINETHICK2,COLOR8409FF;LC:=REF(CLOSE,1);RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;STICKLINE(RSI1<15,OPEN,CLOSE,3,0),COLORFF0000;STICKLINE(RSI1<15,H,L,0,0),COLORFF0000;PMA:MA(C,13),COLORWHITE,LINETHICK2;IF(PMA>REF(PMA,1),PMA,DRAWNULL),COLORRED,LINETHI CK2;IF(PMA<REF(PMA,1),PMA,DRAWNULL),COLORGREEN,LINET HICK2;主导动能TT:=(2*CLOSE+OPEN+HIGH+LOW);主导动能:TT/EMA(TT,4)-1,COLORSTICK;FF:=主导动能;STICKLINE(FF<REF(FF,1)AND FF>0,0,FF,4,0),COLOR33CFDD;STICKLINE(FF<REF(FF,1)AND FF>0,0,FF,3,0),COLOR33DFDD;STICKLINE(FF<REF(FF,1)AND FF>0,0,FF,2,0),COLOR33EFDD;STICKLINE(FF<REF(FF,1)AND FF>0,0,FF,1,0),COLOR33FFDD;STICKLINE(FF<REF(FF,1)AND FF<0,0,FF,4,0),COLOR00CC00;STICKLINE(FF<REF(FF,1)AND FF<0,0,FF,3,0),COLOR00DD00;STICKLINE(FF<REF(FF,1)AND FF<0,0,FF,2,0),COLOR00EE00;STICKLINE(FF<REF(FF,1)AND FF<0,0,FF,1,0),COLOR00FF00;STICKLINE(FF>REF(FF,1)AND FF<0,0,FF,4,0),COLORFF9900;STICKLINE(FF>REF(FF,1)AND FF<0,0,FF,3,0),COLORFFAA00;STICKLINE(FF>REF(FF,1)AND FF<0,0,FF,2,0),COLORFFBB00;STICKLINE(FF>REF(FF,1)AND FF<0,0,FF,1,0),COLORFFCC00;STICKLINE(FF>REF(FF,1)AND FF>0,0,FF,4,0),COLOR0000CC;STICKLINE(FF>REF(FF,1)AND FF>0,0,FF,3,0),COLOR0000DD;STICKLINE(FF>REF(FF,1)AND FF>0,0,FF,2,0),COLOR0000EE;STICKLINE(FF>REF(FF,1)AND FF>0,0,FF,1,0),COLOR0000FF;博尔量化交易主导动能(源码及使用说明)主导动能显示红色:表示资金做多买进;主导动能显示绿色:表示资金做空卖出;主导动能显示黄色:表示资金获利回吐;主导动能显示蓝色:表示资金空头回补;趋势概率使用秘笈红色柱状表示资金正在主导价格上涨或即将主导价格上涨核心:资金做多、价格上涨,持有。
通道指标公式源码
通道指标公式源码
通道指标(Channel Index)是一种技术分析指标,用于判断股票或其他交易品种的价格走势。
下面是通道指标的一种计算公式的源码示例(假设使用Python编程语言):import numpy as np
def channel_index(high, low, close, n):
typical_price = (high + low + close) / 3
mean_typical_price = np.mean(typical_price)
mean_high = np.mean(high)
mean_low = np.mean(low)
mean_price_range = (mean_high - mean_low) / 2
channel_index = (typical_price - mean_typical_price) / mean_price_range
channel_index_ma = np.mean(channel_index[-n:])
return channel_index_ma
这里假设传入函数的参数为:
●high:一个包含历史最高价格的数组(按照时间顺序)
●low:一个包含历史最低价格的数组(按照时间顺序)
●close:一个包含历史收盘价格的数组(按照时间顺序)
●n:移动平均的窗口大小
函数首先计算了典型价格(Typical Price),即最高价、最低价和收盘价的平均值。
然后计算了典型价格的均值、最高价的均值、最低价的均值以及价格范围的均值。
最后,根据计算得到的均值,计算了通道指标(Channel Index)。
函数返回最近n 期通道指标的移动平均值(MA)。
交易通道指标
交易通道指标摘要:一、交易通道指标的概念与作用二、交易通道指标的计算方法三、交易通道指标的应用策略四、交易通道指标的优缺点五、总结正文:一、交易通道指标的概念与作用交易通道指标,是一种基于技术分析的股票交易工具,用于衡量股票价格的变动趋势和波动范围。
其主要作用在于帮助投资者判断股票价格是否处于合理波动范围,以及预测股票价格未来的变动趋势,从而为投资者提供决策依据。
二、交易通道指标的计算方法交易通道指标的计算方法较为简单,主要涉及两个参数:上限和下限。
上限通常取股票价格的最高价,下限则取最低价。
具体计算步骤如下:1.计算通道宽度:通道宽度= 上限- 下限2.计算交易通道上边界:上边界= 下限+ 通道宽度3.计算交易通道下边界:下边界= 下限- 通道宽度三、交易通道指标的应用策略交易通道指标的应用策略主要包括以下几个方面:1.当股票价格突破上边界时,表明股票价格可能进入上涨通道,投资者可以考虑买入。
2.当股票价格跌破下边界时,表明股票价格可能进入下跌通道,投资者可以考虑卖出。
3.当股票价格在通道内波动时,表明股票价格处于合理波动范围,投资者可以保持观望。
四、交易通道指标的优缺点交易通道指标具有一定的预测性和实用性,但也存在一定的局限性。
其优点主要表现在:1.直观地反映股票价格的波动范围和趋势,有助于投资者判断市场状况。
2.为投资者提供明确的买卖信号,有助于提高投资决策的准确性。
然而,交易通道指标也存在一定的缺点:1.对于波动较大的股票,通道宽度可能会较大,导致买卖信号过于频繁,降低投资策略的有效性。
2.在股票价格发生剧烈波动时,交易通道指标可能无法及时反应,导致投资者错过交易机会。
五、总结交易通道指标作为一种技术分析工具,在股票交易中具有一定的参考价值。
通达信指标公式源码 量化交易多空概率系统
n 1 100 4 m 1 100 4NK:=O#YEAR;NS:=C#YEAR;STICKLINE(NS>=NK,NS,NK,8,0),COLOR000099;STICKLINE(NS<NK,NS,NK,8,0),COLORLICYAN;QQ1:=VOL/((DHIGH-DLOW)*2-ABS(DCLOSE-DOPEN));主买:=IF(DCLOSE>DOPEN,QQ1*(DHIGH-DLOW),IF(DCLOSE<DOPEN,QQ1*((D HIGH-DOPEN)+(DCLOSE-DLOW)),VOL/2));主卖:=IF(DCLOSE>DOPEN,0-QQ1*((DHIGH-DCLOSE)+(DOPEN-DLOW)),IF(DCL OSE<DOPEN,0-QQ1*(DHIGH-DLOW),0-VOL/2));DD:=(主买+主卖)/10000;DDX1:=EMA(DD,60)*60;DDX2:=MA(DDX1,N);DDX3:=MA(DDX1,M);STICKLINE(DDX1<DDX3,H,L,0,0),COLORGREEN;STICKLINE(DDX1<DDX3,C,O,4,0),COLOR00B500;STICKLINE(DDX1<DDX3,C,O,3,0),COLOR00C600;STICKLINE(DDX1<DDX3,C,O,2,0),COLOR00D500;STICKLINE(DDX1<DDX3,C,O,1,0),COLOR00E600;STICKLINE(DDX1>DDX3,H,L,0,0),COLOR106FFF;STICKLINE(DDX1>DDX3,C,O,4,0),COLOR0000C8;STICKLINE(DDX1>DDX3,C,O,3,0),COLOR0000D7;STICKLINE(DDX1>DDX3,C,O,2,0),COLOR0000EA;STICKLINE(DDX1>DDX3,C,O,1,0),COLOR0000FF;STICKLINE(DDX1<DDX2 AND DDX1>DDX3,H,L,0,0),COLORFF5D10; STICKLINE(DDX1<DDX2 AND DDX1>DDX3,C,O,4,0),COLORFF5D10; STICKLINE(DDX1<DDX2 AND DDX1>DDX3,C,O,3,0),COLORFF7710; STICKLINE(DDX1<DDX2 AND DDX1>DDX3,C,O,2,0),COLORFF9910; STICKLINE(DDX1>DDX2 AND DDX1<DDX3,H,L,0,0),COLORFF00FF;STICKLINE(DDX1>DDX2 AND DDX1<DDX3,C,O,4,0),COLORD000D0; STICKLINE(DDX1>DDX2 AND DDX1<DDX3,C,O,3,0),COLORE600E6; STICKLINE(DDX1>DDX2 AND DDX1<DDX3,C,O,2,0),COLORF900F9; STICKLINE(DDX1>DDX2 AND DDX1<DDX3,C,O,1,0),COLORFF09FF; JRH:=HHV(CLOSE,2);JRL:=LLV(CLOSE,2);MA3:=MA(CLOSE,3);YTSL:=(3*CLOSE+LOW+OPEN+HIGH)/6;VAR1:=(CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2));VAR2:=(REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));VAR3:=(REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2));VAR4:=(REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));VAR5:=(REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2));VAR6:=(REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));VAR7:=(REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2));VAR8:=(REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));VAR9:=(REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2));VARA:=(REF(VAR9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));VARB:=(REF(VARA,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2));VARC:=(REF(VARB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));VARD:=(CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2)); { M} VARE:=(REF(VARD,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2));VARF:=(REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));VAR10:=(REF(VARF,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2));VAR11:=(REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));VAR12:=(REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));VAR13:=(REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));VAR14:=(REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2));VAR15:=(REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) ANDCLOSE>=REF(CLOSE,2));VAR16:=(REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2));VAR17:=(REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) ANDCLOSE>=REF(CLOSE,2));VAR18:=(REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2));VAR19:=((REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1)) AND VAR1); VAR1A:=((REF(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR VAR8 OR VAR9 OR VARA OR VARB OR VARC,1)) AND VARD);红色持股:=VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR VAR8 OR VAR9 OR VARA OR VARB OR VARC,COLOR0000FF,NODRAW;离场:=IF(红色持股,JRL,DRAWNULL);明离场价:离场,COLORFF99FF,NODRAW;今离场价:REF(离场,1)COLOR0000FF,NODRAW;青色观望:=VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,NODRAW;进:=IF(青色观望,JRH,DRAWNULL);明进场价:进,COLOR33AACC,NODRAW;今进场价:REF(明进场价,1),COLOR00FF00,NODRAW;短买:=VAR19,COLOR33AACC,NODRAW;品红离场:=VAR1A,COLORFF99FF,NODRAW;急速超跌:=(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*100<-14,COLORFFFFFF,NODRA W;STICKLINE(ISLASTBAR AND (红色持股OR REF(红色持股,1)=1),今离场价,今离场价,30,1),COLOR0000FF;STICKLINE(ISLASTBAR AND (青色观望OR REF(青色观望,1)=1),今进场价,今进场价,30,1),COLOR00FF00;CO:=(C-O);STICKLINE(短买,O,O+CO/3,2.8,0),COLOR335555;STICKLINE(短买,O,O+CO/3,2,0),COLOR338888;STICKLINE(短买,O,O+CO/3,1.5,0),COLOR33AAAA;STICKLINE(短买,O,O+CO/3,1,0),COLOR33CCCC;STICKLINE(短买,O,O+CO/3,0,0),COLOR33EEEE;STICKLINE(品红离场,O,O+CO/3,2.8,0),COLOR550055;STICKLINE(品红离场,O,O+CO/3,2,0),COLOR880088;STICKLINE(品红离场,O,O+CO/3,1.5,0),COLORAA00AA;STICKLINE(品红离场,O,O+CO/3,1,0),COLORCC00CC;STICKLINE(品红离场,O,O+CO/3,0.5,0),COLOREE00EE;ZC:=DCLOSE#WEEK;ZO:=DOPEN#WEEK;ZH:=DHIGH#WEEK;ZL:=DLOW#WEEK;ZJ:=(ZC+ZO+ZH+ZL)/4;做空68:ZJ*(1+0.068),COLORRED; 做空95:ZJ*(1+0.136),COLORBLUE; 做多68:ZJ*(1-0.068),COLORGREEN; 做多95:ZJ*(1-0.136),COLOR8409FF;。
通达信量化MACD主图指标公式
通达信量化MACD主图指标公式SHORT:=12;LONG:=26;M:=9;最大亏损:=5000;DIF:=EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);DEA:=EMA(DIF,M);MACD:=2*(DIF-DEA),STICK;多空分界:MA(C,50),LINETHICK1,COLORCYAN,POINTDOT;{IF(多空分界>REF(多空分界,1),多空分界,DRAWNULL), COLORRED,LINETHICK1;}TOZ:=MA(C,50),COLORYELLOW,DOTLINE;TMACD:=MA(C,50)+(MACD.MACD)*3;HD0:=CROSS(DIF,DEA);金收:=REF(L,BARSLAST(HD0)),COLORYELLOW,DOTLINE;DRAWNUMBER(ISLASTBAR,金收,金收),COLORCYAN;LD0:=CROSS(DEA,DIF);死收:REF(H,BARSLAST(LD0)),COLOR00FF00,DOTLINE;JCSC:=(M-1)/(M+1)*DEA/(1-2/(M+1));{计算出金叉死叉时的DIFF值}DD:=(MACD/2+(DEA*(M-1)/(M+1)))/(1-2/(M+1));{计算出明日MACD=MACD时的DIFF值}DIF拐头价:(DIF*(SHORT+1)*(LONG+1)-(LONG+1)*(SHORT-1)*EMA(C,SHORT)+(SHORT+1)*(LONG-1)*EMA(C,LONG))/(2*((LONG+1)-(SHORT+1)))COLORYELLOW,LINETHICK1;柱变向价:=(DD*(SHORT+1)*(LONG+1)-(LONG+1)*(SHORT-1)*EMA(C,SHORT)+(SHORT+1)*(LONG-1)*EMA(C,LONG))/(2*((LONG+1)-(SHORT+1))),COLORWHITE,LINETHICK1;DRAWBAND(DIF拐头价,RGB(250,250,0),DIF拐头价,RGB(0,0,0));DRAWBAND(IF(柱变向价>DIF拐头价,柱变向价,DRAWNULL),RGB(250,0,0),柱变向价,RGB(0,0,0));黄铢消失见顶:=IF(柱变向价>=DIF拐头价,DIF拐头价,DRAWNULL),COLORYELLOW,CIRCLEDOT,LINETHICK1;金叉:=IF(柱变向价>=DIF拐头价,多空分界,DRAWNULL),COLORYELLOW,CIRCLEDOT,LINETHICK1;金死叉价:(JCSC*(SHORT+1)*(LONG+1)-(LONG+1)*(SHORT-1)*EMA(C,SHORT)+(SHORT+1)*(LONG-1)*EMA(C,LONG))/(2*((LONG+1)-(SHORT+1)))COLORCYAN,NODRAW;MACD走平时股价:=(((M+1)*(2*REF(DEA,1)*(M-1)+REF(MACD,1)*(M+1)))/(2*(M+1)*(M-1))+(REF(EMA(C,26),1)*(26-1)/(26+1))-(REF(EMA(C,12),1)*(12-1)/(12+1)))*(12+1)*(26+1)/(2*(26-12));{DRAWNUMBER(DIF>DEA,TOZ,BARSLAST(CROSS(DIF,DEA)) +1),COLORRED;DRAWNUMBER(DIF<DEA,TOZ,BARSLAST(CROSS(DEA,DIF)) +1),COLORGREEN;}ES:=REF(EMA(C,26),1);EP:=REF(EMA(C,12),1);DI:=REF(DIF,1);DIF穿零价:((12+1)*(26-1)*ES-(26+1)*(12-1)*EP)/(2*(26+1)-2*(12+1)),NODRAW,COLORWHITE;{DRAWTEXT_FIX(1,0.6,0.94,0,STRCAT('DIF拐头价: ',CON2STR(DIF拐头价,2))),COLORYELLOW;DRAWTEXT_FIX(1,0.7,0.94,0,STRCAT('柱变向价: ',CON2STR(柱变向价,2))),COLORRED;DRAWTEXT_FIX(1,0.5,0.94,0,STRCAT('DIF穿零价: ',CON2STR(DIF穿零价,2))),COLORRED;}DRAWTEXT_FIX(1,0.7,0.01,0,STRCAT('金死叉价: ',CON2STR(金死叉价,2))),COLORCYAN;ZJ:=DIF>DEA;HY:=DIF<DEA;XG1:=ZJ AND C>死收 AND C>多空分界;STICKLINE(XG1,L,H,0,0),COLOR0000AA;STICKLINE(XG1,CLOSE,OPEN,3,0),COLOR000055;STICKLINE(XG1,CLOSE,OPEN,2.8,0),COLOR000066;STICKLINE(XG1,CLOSE,OPEN,2.5,0),COLOR000077;STICKLINE(XG1,CLOSE,OPEN,2.2,0),COLOR000088;STICKLINE(XG1,CLOSE,OPEN,1.7,0),COLOR000099;STICKLINE(XG1,CLOSE,OPEN,1.2,0),COLOR0000AA;STICKLINE(XG1,CLOSE,OPEN,0.7,0),COLOR0000CC;STICKLINE(XG1,CLOSE,OPEN,0.2,0),COLOR0000FF;W1:= C<死收 AND ZJ;STICKLINE(W1,H,L,0,1),COLORFF55FF;STICKLINE(W1,C,O,3.2,0),COLOR880088;STICKLINE(W1,C,O,2.6,0),COLORAA00AA;STICKLINE(W1,C,O,1.9,0),COLORCC00CC;STICKLINE(W1,C,O,1.1,0),COLOREE00EE;STICKLINE(W1,C,O,0.3,0),COLORFF44FF;W2:= C<多空分界 AND ZJ;STICKLINE(W2,H,L,0,1),COLORFF55FF;STICKLINE(W2,C,O,3.2,0),COLOR880088;STICKLINE(W2,C,O,2.6,0),COLORAA00AA;STICKLINE(W2,C,O,1.9,0),COLORCC00CC;STICKLINE(W2,C,O,1.1,0),COLOREE00EE;STICKLINE(W2,C,O,0.3,0),COLORFF44FF;XG2:=C<DIF拐头价 AND HY;STICKLINE(XG2,H,L,0,0),COLOR00FF00;STICKLINE(XG2,C,O,3,0),COLOR009900;STICKLINE(XG2,C,O,2,0),COLOR00BB00;STICKLINE(XG2,C,O,1,0),COLOR00DD00;STICKLINE(XG2,C,O,0.3,0),COLOR00FF00;XG3:=C>DIF拐头价 AND HY;STICKLINE(XG3,H,L,0,0),COLOR00FF00;STICKLINE(XG3,C,O,3,0),COLOR009900;STICKLINE(XG3,C,O,2,0),COLOR00BB00;STICKLINE(XG3,C,O,1,0),COLOR00DD00;STICKLINE(XG3,C,O,0.3,0),COLOR00FF00;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:SMA(RSV,3,1),COLORWHITE,LINETHICK1,NODRAW;D:SMA(K,3,1),COLORYELLOW,LINETHICK1,NODRAW;LC:=REF(CLOSE,1);RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;IF(COUNT(RSI1>80,3)=3,H,DRAWNULL),POINTDOT,COLORG REEN,LINETHICK8;IF(COUNT(RSI1<20,3)=3,L,DRAWNULL),POINTDOT,COLORY ELLOW,LINETHICK8;IF(COUNT(K>80,3)=3,H,DRAWNULL),POINTDOT,COLORGRE EN,LINETHICK5;IF(COUNT(K<20,3)=3,L,DRAWNULL),POINTDOT,COLORFF33 FF,LINETHICK5;今日空间:=C-REF(金死叉价,1)COLORGREEN,NODRAW;尾盘空间:C-金死叉价,NODRAW;{DRAWTEXT_FIX(1,0.4,0.09,0,STRCAT('今日浮动空间: ',CON2STR(今日空间,2))),COLORCYAN;}DRAWTEXT_FIX(1,0.6,0.09,0,STRCAT('尾盘5分钟差值: ',CON2STR(尾盘空间,2))),COLORCYAN;A0:=最大亏损;今日开仓:=A0/今日空间,NODRAW;尾盘开仓:A0/尾盘空间,NODRAW;DRAWTEXT_FIX(ISLASTBAR,0.0,0.09,0.0,'资金管理:单笔最大损失确定的情况下交易更从容')COLORRED;DRAWTEXT_FIX(1,0.7,0.09,0,STRCAT('尾盘最大开仓股数: ',CON2STR(尾盘开仓,2))),COLORMAGENTA;。
埃尔德盘通道指标公式
埃尔德盘通道指标公式
****《以交易为生》中有一个通道指标:以26周期EMA为基础,向上下等比扩展形成一个价格通道,通道包含近100个周期内95%的价格,也就是说通道允许100根K线中,有5根K线的高低极值可以超出通道上下轨道。
编写了一个公式如下:
UP:IF(CURRBARSCOUNT<=100,(EMA(CLOSE,26)+EMA(CLOSE,26)*系数/100),DRAWNULL),CIRCLEDOT,COLOR808080;DOWN:IF(CURRBARSCOUNT<=100,(EMA (CLOSE,26)-EMA(CLOSE,26)*系数/100),DRAWNULL),CIRCLEDOT,COLOR808080;参数为:系数、最小最大999、缺省151.假设要求通道包络100根K线内的95根,即100根K线中有5根最高价大于等于通道上轨,或100根K线中有5根最低价小于等于通道下轨,或100根K线中最高价大于等于通道上轨与最低价小于等于通道下轨的K线数之和等于52.这里我们先只单纯考虑100根K线中有5根最高价大于等于通道上轨,其它的可以举一反三3.假设对系数进行赋值初始值为99系数:=99,X赋值为:X:=HIGH>=通道上轨,Y赋值为:Y:=COUNT(X,100),如果Y为0就自动在系数上减1,直到Y=54.根据上面3的情况,当V=5时,结束计算系数减1,并自动用当前的系数
值为通道系数。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
通道量化交易指标公式
通达信量化交易模型指标公式-通达信公式。
操作说明:
1、任选一只股票,根据当前价预估未来一定时期内(1-12个月都可以)可能到达的高点和低点,右键选中指标“调整指标参数”(或Alt+T),调整“阶段箱顶”及“阶段箱底”的价位,“阶段箱顶”一般按现价加33.33%设定,“阶段箱底”一般按现价减33.33%设定。
即箱顶价和箱底价相差一倍。
2、设好箱顶箱底价后,微调“总网格数”参数以设定“格幅%”,即打算手上股票上涨多大幅度后减仓,下跌多大幅度后补仓。
3、微调“建仓网格”参数,观察指标“建仓价”数值的变化,使其调整至当前股价上下或打算开始建仓的价位。
4、确定建仓价位后,调整当前“可用资金”参数,指标“建仓量(手)”显示的数值即为首次建仓可买入的股票数量(手数)。
5、建仓后如股价上涨,上涨至建仓价向上相邻的第一个拟定价位时开始减仓,减仓数量为表格相对应的“格量”数(手数);同理,建仓后如股价下跌,下跌至建仓价向下相邻的第一个拟定价位时开始补仓,补仓数量为表格相对应的“格量”数(手数)。
如遇暴涨暴跌,超过几个格幅的,则减仓或补仓数量为那几个超过的格量之和。
} 阶段箱顶:=20;
阶段箱底:=10;
总网格数:=22;
建仓网格:=10;
可用资金:=100000;手续费‰:=0.30;WX:=VARP(C,0)。