【经典】波段主力趋势指标(附源码)
////主力动向+主力趋势雷达///
r0:=((if(isnull(zdmr[-1]),0,zdmr)+if(isnull(bdmr[-1]),0,bdmr))-(if(isnull(zdmc[-1]),0,zdmc)+if(isnull(bdmc[-1]),0,bdmc)))/shgzg*100;
ma5:=ma(r0,5);
//超买:3.2,coloryellow;//让位趋势决策线
//超卖:0.5,coloryellow;//让位花神线
最小值:=llv(low,10);
最大值:=hhv(high,25);
波动线:=ema((close-最小值)/(最大值-最小值)*4,4);
平均线:ema(波动线,3);
主力攻击:=r0-(abs(ref(r0,1))+abs(ref(r0,2))+abs(ref(r0,3))+abs(ref(r0,4))+abs(ref(r0,5))/2)>0 and 平均线>=ref(平均线,1) and ref(平均线,1)<ref(平均线,2);
主力撤退:=-((r0+(abs(ref(r0,1))+abs(ref(r0,2))+abs(ref(r0,3))+abs(ref(r0,4))+abs(ref(r0,5))/2)<0) and 平均线<=ref(平均线,1) and ref(平均线,1)>ref(平均线,2));
drawtext(主力攻击>0,1.5,"主进"),colorred;
drawtext(主力撤退<0,2.8,"主退"),colorgreen;
信息:=平均线>=ref(平均线,1);
走强:=close>ma(close,20)and close>ma(close,5);
走弱:=close<ma(close,10)and close<ma(close,5);
量:=vol>ma(vol,5);
stickline(平均线>=ref(平均线,1),波动线,ref(波动线,1),5,0),colorred;
stickline(平均线<ref(平均线,1),波动线 ,ref(波动线,1),5,0),colorgreen;
d:=信息=1 and ref(信息,1)=0 and (ref(信息,2)+ref(信息,3)=0) and 平均线<0.5;
s:=信息=1 and ref(信息,1)=0 and (ref(信息,2)+ref(信息,3)=0) and 走强=1 and ref(走强,1)=0 and 量=1;
dd:=平均线>2 and (信息=0 and ref(信息,1)=1) and (ref(信息,2)+ref(信息,3)=2);
tz:=(信息=0 and ref(信息,1)=1) and (ref(信息,2)+ref(信息,3)=2) and ma5<0 and 走弱=1 and 平均线>1;
drawtext(d=1,1.75,'极底'),colorred;
drawtext(s=1,平均线,'升');
drawtext(dd=1,平均线,'顶');
drawtext(tz=1,平均线,'下');
partline(平均线,平均线>=ref(平均线,1),colorred,平均线<ref(平均线,1),colorgreen);
////机构建仓////
lc:=ref(close,1);
rsi5:=((sma(max((close - lc),0),5,1) / sma(abs((close - lc)),5,1)) * 100);
tr1:=sum(max(max((high - low),abs((high - ref(close,1)))),abs((low - ref(close,1)))),10);
hd:=(high - ref(high,1));
ld:=(ref(low,1) - low);
dmp:=sum(if(((hd > 0) and (hd > ld)),hd,0),10);
dmm:=sum(if(((ld > 0) and (ld > hd)),ld,0),10);
pdi:=((dmp * 100) / tr1);
mdi:=((dmm * 100) / tr1);
adx:=ma(((abs((mdi - pdi)) / (mdi + pdi)) * 100),5);
av:=(rsi5 + adx);
wr10:=((100 * (hhv(high,10) - close)) / (hhv(high,10) - llv(low,10)));
zcjl:=(rsi5 - wr10);
最佳买入:=(av + zcjl);
最佳买入选股:=if(cross(最佳买入,0),1,0);
var5:=sma(最佳买入选股,3,1);
var6:=sma(var5,3,1);
var7:=sma(var6,3,1);
建仓买点:=if(cross(var6,var7) and (var6<40),5,0);
drawtext(建仓买点,0.75,'建仓'),colorred;
////机构利器////
var8:=ref(close,2);
会员:=sma(max(close-var8,0),7,1)/sma(abs(close-var8),7,1)*100;
逃亡:=if(会员< ref(会员,1) and 会员>79,会员,0);
drawtext(逃亡,3.1,'逃'),coloryellow;
drawtext(88>0 and ref(o,1)/ref(c,1)>1.04 and ref(l,1)<=688 and o>ref(c,1)and c<ref(o,1)and c/o>=1.01,1,'见底'),colorlired;
drawtext(c-o>=0 and o/l>1.05 and l<=llv(l,20),1,'绝底'),colorred;
///主力吸货////
var11:=ref(low,1);
var12:=sma(abs(low-var11),3,1)/sma(max(low-var11,0),3,1)*100;
var13:=ema(if(close*1.2,var12*10,var12/10),3);
var14:=llv(low,38);
var15:=hhv(var13,38);
var16:=if(llv(low,90),1,0);
var17:=ema(if(low<=var14,(var13+var15*2)/2,0),3)/618*var16;
cdxs:=hhv(var17,0)/2.6;
stickline(var17,0.53,var17/cdxs+0.53,1,0),colorwhite;
////马上成功////
hua:=(close - llv(low,14)) / (hhv(high,14) - llv(low,14)) * 1.2 * close;
nv1:=ema(hua,4);
nv2:=ema(hua,8);
drawicon(cross(nv1,nv2) and close/open>1.05,0.5,1);
drawicon(cross(nv2,nv1) and count(cross(nv1,nv2) and close/open>1.05 ,20) ,3.2,2);
////必涨之星////
hua2:=sma(max(close-ref(close,1),0),16,2)/sma(abs(close/ref(close,1)),16,2)*100;
xian=sma(hua2,3,1);
nv3:=sma(xian,3,1);
xinv=3*xian-2*nv3;
买入条件:=cross(xinv,nv3);
卖出条件:=cross(nv3,xinv);
drawicon( 卖出条件,3.3,2),coloryellow;
drawicon(买入条件,0.4,222),colorwhite;//必涨之星
hxn:=if(close/ref(close,1)>1.05 and high/close<1.01 and if(close>ref(close,1),88,0)>0, 91, 0);//花仙女涨停
drawtext(hxn>90 and vol>ref(vol,1) and close>ref(close,1) and count(hxn>90,30)=1,平均线-0.25, '见涨'),,colorlired;
hxjz:=ma((2*close+high+low)/4,5);//花仙女绝招
bztd:=hxjz*89/100;
drawtext(cross(low,bztd),1.25,'必涨'),colorred;
////花神////
花:=ema(slope(1,1)+c,3),colorred;
女:=ema(slope(1,1)+c,7),colorblue;
stickline(花>女 ,0.5,0.53,12,0) ,colorred;//花神线,红色开始为买
stickline(花<=女 ,0.5,0.53,12,0),colorgreen;//花神线,绿色开始为卖
///资金抄底///
rj:=((zdmr[-1]+bdmr[-1])-(zdmc[-1]+bdmc[-1]))/shgzg*100;//大单净量
rsi$1:=sma(max(close-lc,0),3,1)/sma(abs(close-lc),3,1)*100;
rsi$2:=sma(max(close-lc,0),5,1)/sma(abs(close-lc),5,1)*100;
rsi$3:=sma(max(close-lc,0),8,1)/sma(abs(close-lc),8,1)*100;
相对强弱:=0.5*rsi$1+0.31*rsi$2+0.19*rsi$3;
wave$1:=sma(100*(close-llv(low,8))/(hhv(high,8)-llv(low,8)),3,1);
wave$2:=sma(100*(close-llv(low,8))/(hhv(high,8)-llv(low,8)),5,1);
wave$3:=sma(100*(close-llv(low,8))/(hhv(high,8)-llv(low,8)),8,1);
短线波段:=0.5*wave$1+0.31*wave$2+0.19*wave$3;
风险系数:=0.5*相对强弱+0.5*短线波段,coloryellow;
cd1:=if(风险系数<20 and close>open and rj>0,1,0);//波段小于20,股价翻红;
cd2:=if(风险系数<20 and low>=ref(low,1) and close>low and rj>0,1,0);//波段小于20,股价未翻红,但未创新低;
cd3:=if(ref(风险系数,1)<20 and 风险系数>ref(风险系数,1),1,0);//前一日波段小于20,今日转向;
signalbuy=(cd1=1 or cd2=1 or cd3=1);
cd=(signalbuy and count(signalbuy,3)=1);
drawtext(cd,0.5,'抄底'),color0099ff;
///金叉共振///
dif:=(ema(close,12)-ema(close,26))*100;
dea:=ema(dif,9);
rsv:=(close-llv(low,9))/(hhv(high,9)-llv(low,9))*100;
k:=sma(rsv,9,3);
d:=sma(k,9,3);
gz:=cross(dif,dea) and cross(k,d);
drawtext(gz,2,'金叉'),color0099ff;
////趋势决策////
大单净差bbd:=bigbuycount1+waitbuycount1-bigsellcount1-waitsellcount1;
diff:=ema(大单净差bbd,2) - ema(大单净差bbd,4),coloryellow;
diff2:=ema(大单净差bbd,6) - ema(大单净差bbd,12),coloryellow;
m34:=ma(c,34);
m5:=ma(c,5);
r5:=count(大单净差bbd>0,5);
r6:=count(大单净差bbd>0,6);
a1:=if(c<ref(c,2)*1.0200,1,0);
a2:=if(c<ref(c,2)*1.0050,1,0);
a3:=if(c<ref(c,2)*0.0985,1,0);
a4:=if(c<ref(c,2)*0.0970,1,0);
a5:=if(diff>0,2,0);
a6:=if(diff2>0,2,0);
a7:=if(c>m34,2,0);
a8:=if(c>m5,2,0);
a9:=if(r5>3,2,0);
a10:=if(r6>3,1,0);
az:=a1+a2+a3+a4+a5+a6+a7+a8+a9+a10;
if(c<m5)
green:=c<m5;
else if(az>2.5)
red:=az>2.5;
else green:=az<2.5;
enterlong:=(ref(green,1)=1 and red=1 ) and count(ref(green,1)=1 and red=1,barslast(ref(red,1)=1 and green=1))=1;
exitlong:=ref(red,1)=1 and green=1 and count(ref(red,1)=1 and green=1,barslast(ref(green,1)=1 and red=1))=1;
if(c<m5){stickline(c<m5,3.2,3.22,12,0),colorgreen;}
else if(az>2.5){stickline(az>2.5,3.2,3.22,12,0),colorred;}
else if(az<=2.5){stickline(az<=2.5,3.2,3.22,12,0),colorgreen;}
drawtext_fix(1,0.01,0.2,0,'趋势决策线'),colormagenta;
drawtext_fix(1,0.01,1.1,0,'花神线'),colormagenta;
上一指标公式:雷达炒股——看清主力和散户的进出指标
下一指标公式:同花顺实战指标——钻石选股(源码)
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文【经典】波段主力趋势指标(附源码)仅供学习研究。