自用组合优化的主图指标公式指标公式[其他软件公式]
相关标签:自用卖出指标公式 、 自用cci指标公式 、 西点自用指标公式 、 自用组合股票公式 、 通达信主图指标公式 、 黄金柱主图指标公式 、 金钻指标公式主图 、 获利盘主图指标公式 、 macd主图指标公式 、 绝密主图指标公式 、 波段主图指标公式 、 恒者主图指标公式 、 分时主图指标公式 、
{自用组合优化的主图指标
首先感谢此指标的原作者!
声明此指标不是我原创,只是自己学着组合和优化的主图。自己还在学习编指标的阶段。
}
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;
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容