170528
更新:增加15、89线走平、均价线,颜色12。去掉5天线(40周期线)
1.5,15,20,30,60,89周期均线。
2.标记5-20,5-30、5-60多空头排列,标记20-120多头排列。
3.更改20为15周期线,对应5分89周期线。
4.前移89、15周期线顺序,方便看数值。
if (k<=0)
return 0;
ma$1:ma(close, n1);
if (k<=1)
return 0;
ma$2:ma(close, n2);
if (k<=2)
return 0;
ma$3:ma(close, n3);
if (k<=3)
return 0;
ma$4:ma(close, n4);
if (k<=4)
return 0;
ma$5:ma(close, n5);
ma5:=ma(close, 5);
ma10:=ma(close, 10);
ma15:=ma(close, 15);
ma20:=ma(close, 20);
ma30:=ma(close, 30);
ma60:=ma(close, 60);
ma89:=ma(close, 89);
ma120:=ma(close, 120);
diff:= ema(close,12) - ema(close,26);
dea :=ema(diff,9);
macd:=2*(diff-dea);
zero:=0;
//空翻多
kfd5_20:=not(ref(ma5,1)>ref(ma10,1) and ref(ma10,1)> ref(ma20,1) )
and ma5>ma10 and ma10>ma20 ;
drawtext(kfd5_20 and llv(diff,5)>0, ma20*0.999,'20'),colorgray;//上涨的空翻多灰色
//drawtext(kfd5_20 and llv(diff,5)<=0, ma20*0.999,'20'),coloryellow;//下跌转上涨的空翻多黄色
//
kfd5_30:=not(ref(ma5,1)>ref(ma10,1) and ref(ma10,1)> ref(ma20,1) and ref(ma20,1)> ref(ma30,1) )
and ma5>ma10 and ma10>ma20 and ma20>ma30;
drawtext(kfd5_30 and llv(diff,5)>0, ma30*0.999,'30'),colorgray;//上涨的空翻多灰色
drawtext(kfd5_30 and llv(diff,5)<=0, ma30*0.999,'30'),colorwhite;//下跌转上涨的空翻多黄色
//
kfd5_60:=not(ref(ma5,1)>ref(ma10,1) and ref(ma10,1)> ref(ma20,1) and ref(ma20,1)> ref(ma30,1)
and ref(ma30,1)> ref(ma60,1) and ref(ma60,1)>ref(ma60,2))
and ma5>ma10 and ma10>ma20 and ma20>ma30 and ma30>ma60 and ma60>ref(ma60,1);
drawtext(kfd5_60 and llv(diff,12)>0, ma60*0.999,'60'),colorgray;
drawtext(kfd5_60 and llv(diff,12)<=0, ma60*0.999,'60'),colorlired;
//多翻空
dfk5_20:=not(ref(ma5,1)<ref(ma10,1) and ref(ma10,1)< ref(ma20,1) )
and ma5<ma10 and ma10<ma20 ;
drawtext(dfk5_20 and hhv(diff,6)>0, ma20*1.001,'20'),colorgreen;//上涨到顶的多翻空
drawtext(dfk5_20 and hhv(diff,6)<=0, ma20*1.001,'20'),colorblue;
//
dfk5_30:=not(ref(ma5,1)<ref(ma10,1) and ref(ma10,1)< ref(ma20,1) and ref(ma20,1)< ref(ma30,1) )
and ma5<ma10 and ma10<ma20 and ma20<ma30;
drawtext(dfk5_30 and hhv(diff,6)>0, ma30*1.001,'30'),colorcyan;//上涨到顶的多翻空
//drawtext(dfk5_30 and hhv(diff,6)<=0, ma30*1.001,'30'),colorcyan;//下跌中继的多翻空
dfk5_60:=not(ref(ma5,1)<ref(ma10,1) and ref(ma10,1)< ref(ma20,1) and ref(ma20,1)< ref(ma30,1)
and ref(ma30,1)< ref(ma60,1) )
and ma5<ma10 and ma10<ma20 and ma20<ma30 and ma30<ma60 and ma60<ref(ma60,1) ;
drawtext(dfk5_60 and hhv(diff,10)>0, ma60*1.001,'60'),colorgreen;//上涨到顶的多翻空and ref(ma60,1)<ref(ma60,2)
//drawtext(dfk5_60 and hhv(diff,6)<=0, ma60*1.001,'60'),colorcyan;//下跌中继的多翻空
//以下均线20>30>60>120,指示可能出现牛市,属长期指标
kfd20_120:=ma20>ma30 and ma30>ma60 and ma60>ma120
and not(ref(ma20,1)>ref(ma30,1) and ref(ma30,1)>ref(ma60,1) and ref(ma60,1)>ref(ma120,1));
drawtext(kfd20_120 and diff>0, ma(close, 60)*0.998,'120'),colorwhite;
//以下显示均价线
a1:=day!=ref(day,1);
a2:=barslast(a1)+1;
jjx:sum(v*c,a2)/sum(v,a2);
//以下标记30分15线走平上拐
drawtext(ma15>ref(ma15,1) and ref(ma15,1)>=ref(ma15,2)
and ref(ma15,2)<=ref(ma15,3), ma15*0.999,'平'),coloryellow;
//以下标记30分89线走平上拐
drawtext(ma89>ref(ma89,1) and ref(ma89,1)>=ref(ma89,2)
and ref(ma89,2)<=ref(ma89,3), ma89*0.999,'平'),colorwhite;
//以下显示二次金叉价格
//二次金叉
short=12;
long=26;
m=9;
diff := ema(close,short) - ema(close,long);
dea := ema(diff,m);
macd := 2*(diff-dea);
zero : =0;
jccount:=count(cross(diff,dea),barslast(dea>=0));
//barslast,上一次条件成立到当前的周期数
//count(x,n),统计n周期中满足x条件的周期数
二次金叉:=cross(diff,dea) and dea<0 and count(jccount=2,21)=1;
买点u:= cross(h,ma15*1.0005) and count(cross(h,ma15*1.0005),6)=1 and diff<0 and jccount=2;//错
drawtext(买点u,l*0.993,'u'),coloryellow;//-0.15
stickline(买点u,ma15*1.0005,ma15*1.0005,150,1),colorcyan;
//以下显示三次金叉价格
三次金叉:=cross(diff,dea) and dea<0 and count(jccount=3,21)=1;
买点u三:= cross(h,ma15*1.0005) and count(cross(h,ma15*1.0005),6)=1 and diff<0 and jccount=3;
drawtext(买点u三,l*0.993,'三'),coloryellow;//-0.15
stickline(买点u三,ma15*1.0005,ma15*1.0005,150,1),colorcyan;
//以下显示低位空中加油价格,macd<0.3待改
tj:=macd<=0.3 and diff<=ref(diff,1)and
ref(diff,1)<ref(diff,2) and diff> dea and
dea<0 and dea>ref(dea,1) and macd<ref(macd,1)
and ref(macd,1)<ref(macd,2);//条件
空中加油:=ref(tj,1)and diff>=ref(diff,1) and macd>ref(macd,1) and diff<0;
//drawtext(空中加油,hhv(macd,6)*1.1+0.2,' 油'),colorwhite;
买点u油:= cross(h,ma15*1.0005) and count(cross(h,ma15*1.0005),6)=1 and diff<0 and count(空中加油,6)=1 ;
drawtext(买点u油,l*0.993,'油'),coloryellow;//-0.15
stickline(买点u油,ma15*1.0005,ma15*1.0005,150,1),colorliblue;
if (k<=5)
return 0;
ma$6:ma(close, n6);
if (k<=6)
return 0;
ma$7:ma(close, n7);
if (k<=7)
return 0;
ma$8:ma(close, n8);
上一指标公式:一目了然指标公式详解 同花顺了然
下一指标公式:CXR蓉私募战法指标公式详解 同花顺私募CXR
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文均线30分指标公式详解 同花顺均线仅供学习研究。