通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
一、通达信bs点买卖指标公式
VAR1:=(100-((90*(HHV(HIGH,14)-CLOSE))/(HHV(HIGH,14)-LLV(LOW,14))));
VAR2:=(100-((90*(HHV(HIGH,14)-CLOSE))/(HHV(HIGH,14)-LLV(LOW,14))));
VAR3:=(100-MA(((100*(HHV(HIGH,6)-CLOSE))/(HHV(HIGH,6)-LLV(LOW,6))),34));
DIR1:=ABS(CLOSE-REF(CLOSE,5));
VIR1:=SUM(ABS(CLOSE-REF(CLOSE,1)),5);
ER1:=DIR1/VIR1;
CS1:=ER1*(0.8-2/8)+2/8;
CQ1:=CS1*CS1;
DIR2:=ABS(CLOSE-REF(CLOSE,10));
VIR2:=SUM(ABS(CLOSE-REF(CLOSE,1)),10);
ER2:=DIR2/VIR2;
CS2:=ER2*(0.8-2/24)+2/24;
CQ2:=CS2*CS2;
STICKLINE(VAR2<MA(VAR3,6),LOW,HIGH,0,1),COLORLIBLUE;
STICKLINE(VAR2>MA(VAR3,6),LOW,HIGH,0,1),COLORRED;
STICKLINE(((OPEN>CLOSE)AND(VAR2<MA(VAR3,6))),(CLOSE-0.03),OPEN,3.05,0),COLORLIBLUE;
STICKLINE(((OPEN<CLOSE)AND(VAR2<MA(VAR3,6))),CLOSE,OPEN,3.05,1),COLORLIBLUE;
STICKLINE(((OPEN>CLOSE)AND(VAR2>MA(VAR3,6))),OPEN,(CLOSE-0.03),3.05,0),COLORRED;
STICKLINE(((OPEN<CLOSE)AND(VAR2>MA(VAR3,6))),OPEN,CLOSE,3.05,1),COLORRED;
DRAWICON(CROSS(VAR2,MA(VAR3,6)),(LOW-(LOW*0.02)),7);
DRAWICON(CROSS(MA(VAR3,6),VAR1),(HIGH+(HIGH*0.02)),8);
PT:=REF(H,1)-REF(L,1);
CDP:=(REF(H,1)+REF(L,1)+REF(C,1)*2)/4;
AH:=CDP+PT;
AL:=CDP-PT;
NH:=CDP*2-REF(L,1);
NL:=CDP*2-REF(H,1);
强:IF(AH>REF(C,1)*1.1,REF(C,1)*1.1,AH)NODRAW;
阻:IF(NH>强,(强-CDP)*0.618+CDP,NH)NODRAW,COLORBLUE;
M:=IF(AL<REF(C,1)/1.1,REF(C,1)/1.1,AL);
撑:IF(NL<M,CDP-(CDP-M)*0.618,NL)NODRAW;
底:IF(AL<REF(C,1)/1.1,REF(C,1)/1.1,AL)NODRAW;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1),colorwhite;
D:=SMA(K,3,1),coloryellow;
J:=3*K-2*D,COLORFF00FF;
A:=250;
DIFF:=(EMA(CLOSE,12)-EMA(CLOSE,26));
DEA:=EMA(DIFF,9),colorblue,LINETHICK0;
MACD:=2*(DIFF-DEA);
MM:=IF(MACD<0,MACD,0);
JJ:=MM>REF(MM,1);
ZZ:=REF(JJ,1)=1;
准备:=(JJANDZZ)*DEA;
STICKLINE(准备=DEA,1,-1,2,1),COLORFFFF00;
JH:=HHV(MAX(K,MAX(D,J)),A);
DH:=HHV(MAX(DIFF,DEA),A);
SH:=INTPART(JH/DH)/2;
DIFF50:=SH*DIFF+50,COLORFFFF00;
DEA50:=SH*DEA+50,colorblue;
STICKLINE(DIFF50>DEA50,0,1.5*(DIFF50-DEA50),0,0),colorred;
STICKLINE(DIFF50<DEA50,0,1.5*(DIFF50-DEA50),0,0),COLORFFFF00;
红柱:IF(1.5*(DIFF50-DEA50)>REF(1.5*(DIFF50-DEA50),1),1.5*(DIFF50-DEA50),0),
STICK,;
绿柱:IF(1.5*(DIFF50-DEA50)<REF(1.5*(DIFF50-DEA50),1),
1.5*(DIFF50-DEA50),0),STICK,colorgreen;
缩头:=IF(1.5*(DIFF50-DEA50)>0ANDREF(1.5*(DIFF50-DEA50),1)>REF(1.5*(DIFF50-DEA50),2)AND1.5*(DIFF50-DEA50)<REF(1.5*(DIFF50-DEA50),1),1,0);
缩脚:=IF(1.5*(DIFF50-DEA50)<0ANDREF(1.5*(DIFF50-DEA50),1)<REF(1.5*(DIFF50-DEA50),2)AND1.5*(DIFF50-DEA50)>REF(1.5*(DIFF50-DEA50),1),1,0);
杀多:=IF(1.5*(DIFF50-DEA50)<0ANDREF(1.5*(DIFF50-DEA50),1)>REF(1.5*(DIFF50-DEA50),2)AND1.5*(DIFF50-DEA50)<REF(1.5*(DIFF50-DEA50),1),1,0);
诱空:=IF(1.5*(DIFF50-DEA50)>0ANDREF(1.5*(DIFF50-DEA50),1)<REF(1.5*(DIFF50-DEA50),2)AND1.5*(DIFF50-DEA50)>REF(1.5*(DIFF50-DEA50),1),1,0);
阻力:=IF(CROSS(C,MA(C,20))ORCROSS(C,MA(C,60)),1,0);
DRAWTEXT(FILTER(杀多,3)AND杀多,1.5*(DIFF50-DEA50),'杀多'),COLORFF00FF;
DRAWTEXT(FILTER(缩头,3)AND缩头,1.5*(DIFF50-DEA50)+0.2,'卖'),COLORFF00FF;
DRAWTEXT(FILTER(诱空,3)AND诱空,1.5*(DIFF50-DEA50),'?洗盘'),COLOR00FF00;
DRAWTEXT(FILTER(缩脚,3)AND缩脚,1.5*(DIFF50-DEA50)-0.2,'买'),COLOR00FF00;
DRAWTEXT(FILTER(阻力,16)AND1.5*(DIFF50-DEA50)>=0,1.5*(DIFF50-DEA50)+0.01,'¤阻力'),COLOR00FFFF;
VRA:=REF(CLOSE,1);
VRB:=SMA(MAX(CLOSE-VRA,0),6,1)/SMA(ABS(CLOSE-VRA),6,1)*100;
VRC:=(2*CLOSE+HIGH+LOW)/4;
VR0:=LLV(LOW,34);
VR1:=HHV(HIGH,34);
VR2:=EMA((VRC-VR0)/(VR1-VR0)*100,6);
VR3:=EMA(0.667*REF(VR2,1)+0.333*VR2,4);
VA1:=(REF(HIGH,1)+REF(LOW,1))/2;
VA2:=MA(CLOSE,20)+2*STD(CLOSE,20);
VA3:=REF(CLOSE,1);
VA4:=SMA(MAX(CLOSE-VA3,0),7,1)/SMA(ABS(CLOSE-VA3),7,1)*100;
VA5:=CROSS(79,VA4);
VA6:=FILTER(VA5,4);
VVD:=MA(CLOSE,80)-MA(CLOSE,10)/3;
VA7:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);
X1:=CROSS(VA1,VA2)ORVA6;
X2:=CROSS(84,VRB);
STICKLINE(X1ORX2,1.5*(DIFF50-DEA50)*1.05,1.5*(DIFF50-DEA50)*1.08,3,0);
Y1:=IF(COUNT(CLOSE<REF(CLOSE,1),8)/8>0.3ANDCOUNT(VA2>VA3,3)ANDREF(LOW,1)=LLV(LOW,120)ANDCLOSE>OPEN,1,0);
Y2:=IF(CLOSE<VVDANDVOL/240>MA(VOL,5)/240ANDCLOSE>REF(CLOSE,1)*1.08ANDCLOSE<MA(CLOSE,13)*1.3,1,0);
Y3:=CROSS(VA7,10);
Y4:=IF(COUNT(CLOSE<REF(CLOSE,1),8)/8>0.3ANDCOUNT(VR2>VR3,3)ANDREF(LOW,1)=LLV(LOW,120)ANDCLOSE>OPEN,1,0);
STICKLINE(Y1ORY2ORY3ORY4,1.5*(DIFF50-DEA50)*0.90,1.5*(DIFF50-DEA50)*0.99,3,0);
DD:=C=HHV(C,180);
EE:=DEA<REF(DEA,1)ANDREF(DEA<REF(DEA,1),1)=1;
CC:=C>REF(C,1)ANDREF(C>REF(C,1),1)=1;
上升背离:(CCANDEE)*1.5*(DIFF50-DEA50),LINETHICK2,colorwhite;
顶背离:(DDANDEEANDDEA<HHV(DEA,180))*3*ABS(DIFF50-DEA50),STICK,LINETHICK3,colorgreen;
FF:=C=LLV(C,180);
GG:=DEA>REF(DEA,1)ANDREF(DEA>REF(DEA,1),1)=1;
LL:=C<REF(C,1)ANDREF(C<REF(C,1),1)=1;
下降背离:(LLANDGG)*1.5*(DIFF50-DEA50),LINETHICK2,coloryellow;
底背离:(FFANDGGANDDEA>LLV(DEA,180))*3*(DIFF50-DEA50),STICK,LINETHICK3,colorred;
指标公式知识:
用k线看多空双方的力量
什么是推动股票市场上涨下跌的原因,简单说就是多方与空方的力量对比。而k线的走势就是多空双方力量的直接体现。下面我们就来讨论下如何用K线看多空双方的力量。
一、K线的四大要素
首先我们看一下K线的四大要素。K线有开盘价、收盘价、最低价、最高价,四个要素。看多空力量就要关注这四个要素,而不是只关注K线的阴阳。
例如:开盘后,价格受到多方力量推动涨到当天的最高价,收盘时受到空方的打压回落至收盘价。那么多空双方一天内的的力量对比如下所示。
卖方:最高点-收盘价。任何时段,卖方的力量都是价格从每日的最高价与收盘价的差距
买方:收盘价-最低价。买方的力量代表都是收盘价与最低价之间的差距
我想从这个角度看应该很好理解,最高点-收盘价=空方力量。买方:收盘价-最低价=多方力量。看下图应该更好理解。
下面看一个例子:K线显示阳线,但多方力量不一定强于空方力量。
同样的道理K线显示阴线,但空方力量不一定强于多方力量。
二、操作条件
单根K线仅能代表当日的多空力量对比,但是如果要“操作”还是要结合“趋势”。
1、当趋势与单根K线表示的多空力量一致时,说明未来单根K线与趋势共振,沿趋势的方向运行概率更大。
分两种
1)上升趋势,如图:上升趋势的多占优,说明上涨没有停止。
2)下跌趋势,如图:下跌趋势的空战优,下跌还将继续。
2、当趋势与单根K线表示的多空力量不一致时,这时要按照趋势是否走坏来判断。
也分两种
1)上升趋势,图如:
上升趋势中出现空占优,有可能是上涨的中继或者是洗盘,在没有跌破颈线的情况下可以放心持有,而且阴线还是你买入的机会。
例如图中,在上升趋势中,一共出现了5次空翻占优的K线,但是上涨趋势没有改变,有4次是买入的好机会。
2)下跌趋势,如图:下跌趋势中的多占优有可能是,反弹,只要没有突破下跌颈线,都以反弹考虑,并且是你减仓的机会。
三、结论
从K线的四要素可以看出当天的多空力量对比。但是如果要操作,我们要结合“趋势”,当趋势走好后,在观察K线的“多空力量”这样才能更好的盈利。
每日通达信公式解答:
编写条件:
回补向上跳空缺口的选股公式。
编写方法:
XG:O>REF(H,1)ANDL<REF(H,1);
评论(0)