{自用组合优化的主图指标
首先感谢此指标的原作者!
声明此指标不是我原创,只是自己学着组合和优化的主图。自己还在学习编指标的阶段。
}
input:da(5,1,100),fy(20,5,40),ct(1,1,60),p(0,0,60),n(3,0,60);
drawgbk(close<hhv(high,0),colorrgb(60,15,35),colorrgb(50,50,90),1);
stickline(close>open or close=open and close>ref(close,1),low,high,0.5,0),linethick5,color10000;
stickline(close<open or close=open and close<=ref(close,1),low,high,0.5,0),linethick5,color10000;
drawtext((barpos = sysparam(2)),high,(((((((((((((((((((((((((((((((('所属板块:' + blkname) + ' 总资产') + numtostr(finance(10),2)) + '千元') + ' 净利润') + numtostr(finance(30),2)) + '千元') + '\n') + '总股本') + numtostr(finance(1),0)) + '万股') + ' 流通a股') + numtostr(finance(7),0)) + '万股') + ' 净资产') + numtostr(finance(34),2)) + '元') + ' 每股收益') + numtostr(finance(33),2)) + '元') + ' 每股未分配') + numtostr(finance(32),2)) + '元') + ' 市盈率') + numtostr(dynainfo(39),2)) + '%') + ' 净资收益率') + numtostr(finance(37),2)) + '%') + ' 每股公积金') + numtostr(finance(18),2)) + '元')),align4,colorff00ff;
vv:='◆代码:'+stklabel;
explain(1=1,vv),,color4080ff;
{explain(1=1,'■所属板块:'+blkname+'\n'),colorred;}
explain(1=1,'●流通a股:'+numtostr(finance(7)/10000,4)+'亿股'),coloryellow;
explain(1=1,'●总股'+ numtostr(finance(1)/10000,2)+'亿股'),coloryellow;
explain(1=1,'●每股收益:'+numtostr(finance(33),2)+'元'),colorcyan;
explain(1=1,'●净资产:'+numtostr(finance(34),2)+'元'),colorcyan;
explain(1=1,'●公积金:'+numtostr(finance(18),2)+'元'),colorcyan;
explain(1=1,'●未分配利润:'+numtostr(finance(32),2)+'元'),colorcyan;
explain(1=1,'◎市盈率:'+numtostr(dynainfo(39),2)+'倍'),colorgreen;
explain(1=1,'◎获利%'+numtostr(winner(c)*100, 2)),colorgreen;
mma:=(2*c+h+l)/(4);
m20:ema(mma,8),coloryellow,linethick2;
m20a:=ref(m20,1);
partline(m20>ref(m20,1),m20),colormagenta,linethick2;
{买入:=cross(m20,m20a);
卖出:=cross(m20a,m20);}
x:=(barslast((sysparam(2)=barpos))+1);
ns:=if((hhv(abs(((hhv(mma,da)/llv(mma,da))-1)),da)>(10/100)),3,da);
n1:=if((datatype=2),(ns*48),if((datatype=3),(ns*16),if((datatype=4),(ns*8),if((datatype=5),(ns*4),ns))));
{mm:=if((((stktype=0) or (p=0)) or (vol=0)),ma(mma,5),((sum(amount,n1)/sum(vol,n1))/100)); }
mm:=m20;
m1:=ref(mm,1);
买入:=if(cross(mm,m1),m1,0);
卖出:=if(cross(m1,mm),m1,0);
ye:=barpos;
费用:=(fy/1000);
dw:=barslast((卖出>0));
ex10:=hhv((买入>0),(dw+1));
bj:=if((ex10>ref(ex10,1)),买入,0);
sj:=if((ex10<ref(ex10,1)),卖出,0);
bnn:=barslast((bj>0));
cc:=ref(bj,bnn);
盈利:=((sj*(1-费用))-(cc*(1+费用)));
yl:=sum(if((sj>0),盈利,0),0);
每股盈利:=yl,linethick0,precision2,colorffffff;
cn:=sum(if(((sj>0) and (ref(cc,1)>0)),1,0),0);
cg:=sum(if(((sj>0) and (盈利>0)),1,0),0);
成功率:=((100*cg)/cn),linethick0,precision1,color88ff;
h1:=hhv(if((ct=2),成功率,yl),x);
l1:=llv(if((ct=2),成功率,yl),x);
ah:=h1[datacount];
al:=l1[datacount];
ahl:=(ah-al);
polyline((ct=2),成功率),color88ff;
买入均价:=(sum(bj,0)/cn),linethick0,precision1,colorff;
年收益:=((100*((240*yl)/ye))/买入),linethick0,precision1,colorff;
持股时间:=(sum(if(((sj>0) and (cc>0)),(ref(bnn,1)+1),0),0)/ye),linethick0,precision2,colorff00ff;
交易:=cn,linethick0,precision0,coloraaaaaa;
(次)成功:=cg,linethick0,precision0,coloraaaaaa;
年交均次:=((240*cn)/ye);
mon:=sum(if((month<>ref(month,1)),1,0),0);
上市年:=(mon/12);
drawnumber((bj>0),(low*0.95),bj,2),align0,colorff;
drawicon(((bj>0) and (ct=1)),(low*0.97),4);
drawnumber((((sj>0) and (ct=1)) and (((盈利/(cc*(1+费用)))*100)>=0)),(high*1.1),((盈利/(cc*(1+费用)))*100),1),align0,colorff;
drawnumber((((sj>0) and (ct=1)) and (((盈利/(cc*(1+费用)))*100)<0)),(high*1.1),((盈利/(cc*(1+费用)))*100),1),align0,colorffff;
drawicon(((sj>0) and (ct=1)),(high*1.04),5);
drawnumber(((sj>0) and (ct=1)),(high*1.07),sj,2),align0,colorff00;
n波动:=(sum(if((((sj>0) and (cc>0)) and ((ref(bnn,1)+1)<=n)),(ref(bnn,1)+1),0),0)/ye),linethick0,precision2,colorff00ff;
买价:=if((bj>0),bj,0),linethick0,precision2,colorff;
卖价:=if((sj>0),sj,0),linethick0,precision2,colorff00;
{drawtextex(close,1,0,0,(((((((((((((((((('年盈利:'+numtostr(yl,2))+'元 成功率:')+numtostr(成功率,1))+'% 年收益:')+numtostr(年收益,1))+'%')+' 持股时间比:')+numtostr(持股时间,1))+'\n')+'交易:')+numtostr(交易,0))+'次 成功:')+numtostr(cg,0))+'次 年均:')+numtostr(年交均次,1))+'次 总共:')+numtostr(ye,0))+'k线')),colorffff;}
临界:=(((close/m1)-1)*100);
增减:=(临界-(100*((ref(close,1)/ref(m1,1))-1)));
{drawtextex(close,1,500,80,(((((((('当前 信号持续:'+numtostr(bnn,0))+'(k线)')+' 最高盈利:')+numtostr(hhv((((high/cc)-1)*100),(bnn+1)),1))+'% 买卖临界点:')+numtostr(临界,1))+'% 增减:')+numtostr(if(((bnn>0) and (datatype=6)),增减,if((bnn=0),0,-100)),1))),colorffff; }
{drawtext(((sysparam(3)=barpos) and (ct<3)),high,'.'),color1;
drawtext(((sysparam(3)=barpos) and (ct<3)),low,'.'),color1;}
参考介入价:mm,linethick0,precision2,colorffffff;
fua:=hhv(high,15);
fub:=llv(low,15);
{drawtextex(close,1,720,60,(('15日最高价:'+numtostr(fua,2))+' ')),align2,colorff;}
{drawtextex(close,1,840,60,(('15日最低价:'+numtostr(fub,2))+' ')),align2,colorbb0000;}
{drawtextex(close,1,950,60,(('参考介入价:'+numtostr(mm,2))+' ')),align2,coloree9999;}
stickline(close>=mm,high,low,1,0),color0000ff;
stickline(close<mm,low,high,1,0),color00ff00;
stickline(close>open or close=open and close>ref(close,1),open,close,9,0),linethick5,color10000;
stickline(close<open or close=open and close<=ref(close,1),open,close,9,0),linethick5,color10000;
stickline(close>=mm,close,open,8,0),color000055;
stickline(close>=mm,close,open,7,0),color000077;
stickline(close>=mm,close,open,5.8,0),color000099;
stickline(close>=mm,close,open,4.4,0),color0000bb;
stickline(close>=mm,close,open,2.8,0),color0000dd;
stickline(close>=mm,close,open,1,0),color0000ff;
stickline(close<mm,close,open,8,0),color005500;
stickline(close<mm,close,open,7,0),color007700;
stickline(close<mm,close,open,5.8,0),color009900;
stickline(close<mm,close,open,4.4,0),color00bb00;
stickline(close<mm,close,open,2.8,0),color00dd00;
stickline(close<mm,close,open,1,0),color00ff00;
stickline(((bj > 0) and (ct = 1)),open,(open+close)/2,8,0),color0033ff;
stickline(((bj > 0) and (ct = 1)),open,(open+close)/2,7,0),color0066ff;
stickline(((bj > 0) and (ct = 1)),open,(open+close)/2,5.8,0),color0099ff;
stickline(((bj > 0) and (ct = 1)),open,(open+close)/2,4.4,0),color00bbff;
stickline(((bj > 0) and (ct = 1)),open,(open+close)/2,2.8,0),color00ddff;
stickline(((bj > 0) and (ct = 1)),open,(open+close)/2,1,0),color00ffff;
stickline(((sj>0) and (ct=1)),close,(close+open)/2,8,0),colorff4400;
stickline(((sj>0) and (ct=1)),close,(close+open)/2,7,0),colorff7700;
stickline(((sj>0) and (ct=1)),close,(close+open)/2,5.8,0),colorff9911;
stickline(((sj>0) and (ct=1)),close,(close+open)/2,4.4,0),colorffbb22;
stickline(((sj>0) and (ct=1)),close,(close+open)/2,2.8,0),colorffdd33;
stickline(((sj>0) and (ct=1)),close,(close+open)/2,1,0),colorffff33;
stickline(((sj>0) and (ct=1)),open,(close+open)/2,8,0),color550000;
stickline(((sj>0) and (ct=1)),open,(close+open)/2,7,0),color770000;
stickline(((sj>0) and (ct=1)),open,(close+open)/2,5.8,0),color990000;
stickline(((sj>0) and (ct=1)),open,(close+open)/2,4.4,0),colorbb0000;
stickline(((sj>0) and (ct=1)),open,(close+open)/2,2.8,0),colordd0000;
stickline(((sj>0) and (ct=1)),open,(close+open)/2,1,0),colorff0000;
支撑价:llv(low,30) ,color7fff00,linethick2;
阻力价:hhv(high,30),colorff9900, linethick2;
a4:=ma(close,20);
a5:=(close > ma(close,5));
a6:=(ma(close,5) > ma(close,10));
a7:=(close > ma(close,10));
a8:=(ma(close,5) > ma(close,20));
a9:=(close > ma(close,20));
a10:=ref(a4,1);
a11:=(a4 > a10);
avx:=(((((if(a5,10,(0 - 10)) + if(a6,10,(0 - 10))) + if(a7,10,(0 - 10))) + if(a8,10,(0 - 10))) + if(a9,10,(0 - 10))) + if(a11,10,(0 - 10)));
dslx:=(close / indexc);
dslx1:=ma(dslx,5);
dslx2:=ma(dslx,10);
v1:=ma(vol,5);
v2:=ma(vol,10);
t := barslast(barstatus=1)+1;
hhg := hhv(high, t);
ddg := llv(low, t);
{hk := ll-hh; g12 := ll-hk*1.55; }
a001:=barstatus=2 and close<200 and ((cross(avx,1) and (v1 >= v2)) and (dslx >= dslx1));
drawtextex(a001,0,12,170,'该股的量能理想,有明显走强迹象,可以考虑中线进场参与,仓位在2/3左右。 '),color0000ff,linethick3;
a002:=barstatus=2 and close<200 and ((cross(avx,1) and (v1 < v2)) and (dslx >= dslx1));
drawtextex(a002,0,12,170,'该股虽然走势趋强,但量能还显不足,可以考虑短线进场,仓位在1/2左右。 '),color0000ff,linethick3;
a003:=barstatus=2 and close<200 and ((cross(avx,1) and (v1 > v2)) and (dslx < dslx1));
drawtextex(a003,0,12,170,'该股量价配合良好,但相对其它股票并没有明显走强,可以考虑短线进场,仓位1/2左右。 '),color0000ff,linethick3;
a004:=barstatus=2 and close<200 and ((cross(avx,1) and (v1 <= v2)) and (dslx < dslx1));
drawtextex(a004,0,12,170,'该股形态尚可,但量能不足,股票也未完全走强,可以短线参与,仓位1/3左右。 '),color0000ff,linethick3;
a005:=barstatus=2 and close<200 and ((cross(1,avx) and (v1 >= v2)) and (dslx >= dslx1));
drawtextex(a005,0,12,170,'该股形态变坏,但走势相对其它股票尚可,重仓者减持大半,清仓者可以观望。 '),color00ff00,linethick3;
a006:=barstatus=2 and close<200 and ((cross(1,avx) and (v1 < v2)) and (dslx >= dslx1));
drawtextex(a006,0,12,170,'该股随大盘一起下跌,程明显缩量走势,考虑到大盘风险,减持或清仓。 '),color00ff00,linethick3;
a007:=barstatus=2 and close<200 and ((cross(1,avx) and (v1 >= v2)) and (dslx < dslx1));
drawtextex(a007,0,12,170,'该股放量下跌,走势明显偏弱,离场观望。 '),color00ff00,linethick3;
a0071:=barstatus=2 and close<200 and ((cross(1,avx) and (v1 < v2)) and (dslx < dslx1));
drawtextex(a0071,0,12,170,'该股缩量下跌,走势偏弱,离场观望。 '),color00ff00,linethick3;
a008:=barstatus=2 and close<200 and ((((avx >= 1) and (ref(avx,1) > 0)) and (v1 >= v2)) and (dslx >= dslx1));
drawtextex(a008,0,12,170,'该股形态良好,强势明显,量能充足,可以继续持有。 '),color00ffff,linethick3;
a009:=barstatus=2 and close<200 and ((((avx >= 1) and (ref(avx,1) > 0)) and (v1 < v2)) and (dslx >= dslx1));
drawtextex(a009,0,12,170,'该股上行趋势不变,强势依然,但量能开始转弱,注意风险。 '),color00ffff,linethick3;
a010:=barstatus=2 and close<200 and ((((avx >= 1) and (ref(avx,1) > 0)) and (v1 >= v2)) and (dslx < dslx1));
drawtextex(a010,0,12,170,'该股仍然具备上涨潜力,但股性偏弱,可考虑减仓。 '),color00ffff,linethick3;
a011:=barstatus=2 and close<200 and ((((avx >= 1) and (ref(avx,1) > 0)) and (v1 < v2)) and (dslx < dslx1));
drawtextex(a011,0,12,170,'该股走势趋弱,量能不足,减持大部分筹码。 '),color00ffff,linethick3;
a012:=barstatus=2 and close<200 and ((((avx < 1) and (ref(avx,1) < 0)) and (v1 >= v2)) and (dslx >= dslx1));
drawtextex(a012,0,12,170,'该股形态不佳,注意成交量的变化,但目前不适合参与。 '),color00ff00,linethick3;
a013:=barstatus=2 and close<200 and ((((avx < 1) and (ref(avx,1) < 0)) and (v1 < v2)) and (dslx >= dslx1));
drawtextex(a013,0,12,170,'该股趋势不明,股价偏弱,注意量能变化,目前不宜参与。 '),color00ff00,linethick3;
a014:=barstatus=2 and close<200 and ((((avx < 1) and (ref(avx,1) < 0)) and (v1 >= v2)) and (dslx < dslx1));
drawtextex(a014,0,12,170,'该股有走强迹象,但量能不足,趋势不明,不适合操作。 '),color00ff00,linethick3;
a015:=barstatus=2 and close<200 and ((((avx < 1) and (ref(avx,1) < 0)) and (v1 < v2)) and (dslx < dslx1));
drawtextex(a015,0,12,170,'该股走势太弱,没有参与价值。 '),color00ff00,linethick3;
a016:=barstatus=2 and close>200 and (cross(avx,1) and (v1 >= v2));
drawtextex(a016,0,12,170,'大盘量能理想,有明显走强迹象,可以考虑中线进场参与,仓位在2/3左右, '),color0000ff,linethick3;
a017:=barstatus=2 and close>200 and (cross(avx,1) and (v1 >= v2));
drawtextex(a017,0,12,170,'如前期经过一轮下跌,此时为最佳买点,但如果前期有过一段涨幅则介入需谨慎。 '),color0000ff,linethick3;
a018:=barstatus=2 and close>200 and (cross(avx,1) and (v1 < v2));
drawtextex(a018,0,12,170,'大盘虽然走势趋强,但量能还显不足,如果前期经过一轮下跌, '),color0000ff,linethick3;
a019:=barstatus=2 and close>200 and (cross(avx,1) and (v1 < v2));
drawtextex(a019,0,12,170,'可以考虑短线进场,仓位在1/2左右,一旦量能放大可以加仓买入。 '),color0000ff,linethick3;
a020:=barstatus=2 and close>200 and (cross(1,avx) and (v1 >= v2));
drawtextex(a020,0,12,170,'大盘形态走坏,重仓者可以减去大部分仓位。 '),color00ff00,linethick3;
a021:=barstatus=2 and close>200 and (cross(1,avx) and (v1 < v2));
drawtextex(a021,0,12,170,'大盘缩量调整,注意风险,短线清仓观望。 '),color00ff00,linethick3;
a022:=barstatus=2 and close>200 and (((avx >= 1) and (ref(avx,1) > 0)) and (v1 >= v2));
drawtextex(a022,0,12,170,'大盘走势良好,量能理想,可以继续持有强势股。 '),color00ffff,linethick3;
a023:=barstatus=2 and close>200 and (((avx >= 1) and (ref(avx,1) > 0)) and (v1 < v2));
drawtextex(a023,0,12,170,'大盘形态良好,但量能稍显不足,随时准备减仓。 '),color00ffff,linethick3;
a024:=barstatus=2 and close>200 and (((avx < 1) and (ref(avx,1) < 0)) and (v1 >= v2));
drawtextex(a024,0,12,170,'大盘趋势不明,注意成交量变化,目前不适宜进场。 '),color00ff00,linethick3;
a025:=barstatus=2 and close>200 and (((avx < 1) and (ref(avx,1) < 0)) and (v1 < v2));
drawtextex(a025,0,12,170,'大盘趋势向下,量能萎缩,不适合进场。 '),color00ff00,linethick3;
nn:= barstatus=2;
上一指标公式:超强趋势公式 飞狐趋势指标 源码
下一指标公式:我的自用主图公式 飞狐自用指标 源码
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文自用组合优化的主图公式 飞狐自用指标指标 源码仅供学习研究。