权证指标公式指标 公式 源码[其他软件公式]
指标公式源码分析及使用说明:
1. 首先,代码中定义了一些变量,如C(收盘价)、H(最高价)、L(最低价)、O(开盘价)等,它们代表了股票的不同价格数据。
2. 接着,通过一系列的计算,生成了一组新的指标a1到a6,它们都是根据收盘价等数据计算得出的指标。
3. 接下来是一些条件判断,例如a1是否大于前一期的a1等,根据这些条件的不同,会绘制不同颜色和样式的线条,以在股票图表上标识出不同的技术信号。
4. 最后,根据一些条件,绘制了不同颜色的柱状图,用于表示不同的交易信号。
综上所述,这段代码主要是用于生成股票的技术分析图表,通过计算得出的指标和条件判断,来辅助投资者进行交易决策。
在使用这些指标时,投资者可以关注指标的变化趋势和交叉点,结合其他技术分析方法,来判断股票的走势和可能的买卖点,从而做出更明智的投资决策。
源码:
INPUT: P1(1,0,10),M(1,0,12),P2(2,0,20),N(21,3,60),N1(3,3,5),ZZ(1,1,3),P3(3,0,10),P4(1,0,4),M10(5,1,20);
c1:=(C+2*H+L+O)/5;a1:=EMA((EMA(c1,1)+EMA(c1,3)+EMA(c1,5))/3,3);
a2:=EMA((EMA(c1,6)+EMA(c1,8)+EMA( c1,10))/3,3);
a3:=EMA((EMA(c1,10)+EMA(c1,12)+EMA( c1,14))/3,3);
a4:=EMA((EMA(c1,14)+EMA(c1,16)+EMA( c1,18))/3,3);
a5:=EMA((EMA(c1,18)+EMA(c1,20)+EMA( c1,22))/3,3);
a6:=EMA((EMA(c1,22)+EMA(c1,24)+EMA(c1,26))/3,3);
a:=EMA((EMA(c1,29)+EMA(c1,31)+EMA(c1,33))/3,3),colorwhite;
PARTLINE(c1>a,a),colormagenta,linethick2;
PARTLINE(c1<a,a),colorgreen,linethick2;
PARTLINE(a1>REF(a1,1),a1),colormagenta,LINEDASH;
PARTLINE(a2>REF(a2,1),a2),colormagenta,LINEDASH;
PARTLINE(a3>REF(a3,1),a3),colormagenta,LINEDASH;
PARTLINE(a4>REF(a4,1),a4),colormagenta,LINEDASH;
PARTLINE(a5>REF(a5,1),a5),colormagenta,LINEDASH;
PARTLINE(a6>REF(a6,1),a6),colormagenta,LINEDASH;
PARTLINE(a1<REF(a1,1),a1),colorgreen,LINEDASH;
PARTLINE(a2<REF(a2,1),a2),colorgreen,LINEDASH;
PARTLINE(a3<REF(a3,1),a3),colorgreen,LINEDASH;
PARTLINE(a4<REF(a4,1),a4),colorgreen,LINEDASH;
PARTLINE(a5<REF(a5,1),a5),colorgreen,LINEDASH;
PARTLINE(a6<REF(a6,1),a6),colorgreen,LINEDASH;
tj:=c1>a;tj2:=c1>OPEN or c1=OPEN and c1>REF(c1,1);
STICKLINE(tj2,H,L,0.5,0),colorred;
STICKLINE(tj,O,C,8,0),color102088;
STICKLINE(tj,O,C,7,0),color102099;
STICKLINE(tj,O,C,6,0),color1020aa;
STICKLINE(tj,O,C,5,0),color1020bb;
STICKLINE(tj,O,C,4,0),color1020cc;
STICKLINE(tj,O,C,3,0),color1020dd;
STICKLINE(tj,O,C,2,0),color1020ee;
STICKLINE(tj,O,C,1,0),color1020ff;
STICKLINE(NOT(tj),O,C,8,0),colorff7700;
STICKLINE(NOT(tj),O,C,7,0),colorff8800;
STICKLINE(NOT(tj),O,C,6,0),colorff9900;
STICKLINE(NOT(tj),O,C,5,0),colorffaa00;
STICKLINE(NOT(tj),O,C,4,0),colorffbb00;
STICKLINE(NOT(tj),O,C,3,0),colorffcc00;
STICKLINE(NOT(tj),O,C,2,0),colorffdd00;
STICKLINE(NOT(tj),O,C,1,0),colorffee00;
c11:=REF(C,1);
c2:=HHV(c11,2);
c3:=LLV(c11,1);
et:=HHV(c11,2);
et1:=REF(et,1);
xb:=LLV(c11,1);
xb1:=REF(xb,1);
s:=BARSLAST(C<xb and c11>=xb1);
m1:=REF(m,1);
n9:=BARSLAST(C>et and c11<=et1);
s1:=REF(n9,1);
m2:=BARSLAST(m-n9>0 and m1<=n1)+1;
n2:=BARSLAST(n9-m>0 and n1<=m1)+1;
et2:=HHV(et,m2);
xb2:=LLV(xb,n2);
app:=IF(m-n9>0 and m1<=n1,1,IF(n9-m>0 and n1<=m1,0,2));
h11:=IF(m-n9>0,C,et2);
h2:=IF(app=1,C,c2);
h3:=IF(m-n9<0,C,xb2);
h4:=IF(app=1,C,xb2);
关键位:IF(m-n9>0or app=1 ,CLOSE,h3);
m1:=MA(C,3);
m3:=MA(C,8);
m2:MA(C,21),linethick,colorff00ff,;
均线变异:IF(m1>m2,m2,m1),,linethick1,colorFFffff,;
PARTLINE(均线变异>REF(均线变异,1) and 均线变异=m2,均线变异),linethick,COLORFF00FF;
CXH1:=(HHV(H,n)-C)/(HHV(H,n)-LLV(L,n))*100;
CXH3:=(C-LLV(L,n))/(HHV(H,n)-LLV(L,n))*100;
CXH6:=CXH3-CXH1;
z:=MA(CXH6,n1);
DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(z,0),1,0),L,'平空开多!'),linethick1,color0066ff,;
DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(0,z),1,0),H,'平多开空!'),linethick1,color0066ff,;
CXH2:=LLV(L,11);
CXH3:=HHV(H,25);
警戒线:= p1 ;
减仓线:= p2 ;
卖出线:= p3 ;
空头线:=p4;
动力线:= EMA((C-CXH2)/(CXH3-CXH2)*4,4);
DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(动力线,警戒线),1,0),C,'预警 '),ALIGN4,colorwhite;
DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(动力线,减仓线),1,0),C,'减磅 '),ALIGN5,COLORYELLOW;
DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(动力线,卖出线),1,0),C,'出局?'),ALIGN4,COLORGREEN ;
DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(动力线,空头线),1,0),C,'与虎谋皮 '),ALIGN3,COLORRED;
DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(警戒线,动力线),1,0),C,'预警确认 '),ALIGN3,COLORRED;
DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(减仓线,动力线),1,0),C,'减磅确认 '),ALIGN3,COLORRED;
DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(卖出线,动力线),1,0),C,'出局确认'),ALIGN3,COLORRED ;
DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(空头线,动力线),1,0),C,'虎皮到手'),ALIGN4,COLORRED ;
DRAWICON(CROSS(动力线,卖出线),H,4);
WW:=(MA(C,3)+MA(C,8)+MA(C,15)+MA(C,34))/4;
DRAWICON(CROSS(C,WW),LOW-0.02,4);
DRAWICON(CROSS(WW,C),HIGH+0.06,5);
DRAWTEXT(CROSS(C,WW),LOW-0.02,' 开多');
DRAWTEXT(CROSS(WW,C),HIGH+0.06,' 多平');
mA1:MA(C,S),colorFFffff,;
mA2:MA(C,P3),linethick3,color6600FF,;
mA3:MA(C,P2),linethick2,color00ffff,;
mA4:MA(C,P1),linethick1,colorffffff,;
MA6:MA(C,S), linethick1,colorFF66FF,;
a:=HHV(MA((LOW+HIGH+C)/3,17),60);
b:=LLV(MA((LOW+HIGH+C)/3,1),40);
STICKLINE(BARSCOUNT(C)=SYSPARAM(1),a,a,15,0),Coloryellow,linethick1,shift1;
DRAWNUMBER(BARSCOUNT(C)=SYSPARAM(1),a,a,3),shift3,colorYELLOW;
STICKLINE(BARSCOUNT(C)=SYSPARAM(1),b,b,15,0),Colorred,linethick1,shift1;
DRAWNUMBER(BARSCOUNT(C)=SYSPARAM(1),b,b,3),shift3,Colorred;
STICKLINE(BARSCOUNT(C)=SYSPARAM(1),((H+L)/2),((H+L)/2),4,0),,Coloryellow,linethick1,POINTDOT;
DRAWTEXT(BARSCOUNT(C)=SYSPARAM(1),((H+L)/2)*1.05,'+5%'),Color63806A,shift2;
DRAWTEXT(BARSCOUNT(C)=SYSPARAM(1),((H+L)/2)*1.03,'+3%'),Color63806A,shift2;
DRAWTEXT(BARSCOUNT(C)=SYSPARAM(1),((H+L)/2)*0.95,'-5%'),Color63806A,shift2,linethick2;
DRAWTEXT(BARSCOUNT(C)=SYSPARAM(1),((H+L)/2)*0.97,'-3%'),Color63806A,shift2,linethick2;
DRAWTEXT( REF(C,1)<REF(b,1) and C>b AND BARSCOUNT(C)=SYSPARAM(1),b*0.985,'←试买'),COLORYELLOW,shift1;
DRAWTEXT( C>=a AND BARSCOUNT(C)=SYSPARAM(1),A*1.015,'←多'),COLORYELLOW,shift1;
DRAWTEXT(REF(C,1)<REF(a,1) and C>=a AND BARSCOUNT(C)=SYSPARAM(1),A*0.995,'←进'),COLORYELLOW,shift1;
DRAWTEXT(REF(C,1)>REF(a,1) and C<a AND BARSCOUNT(C)=SYSPARAM(1),A*1.01,'↓减'),COLORYELLOW,shift1;
DRAWTEXT(CROSS(b,C) AND BARSCOUNT(C)=SYSPARAM(1),A*0.995,'↓逃'),COLORgreen,shift1;
DRAWTEXT( C<b AND BARSCOUNT(C)=SYSPARAM(1),A*1.015,'↓空'),COLORYELLOW,shift1;
STICKLINE(C<OPEN and REF(C,1)>REF(O,1),REF(C,1),REF(C,1),20,0),COLORFFFFFF;
DRAWTEXT(FILTER(EMA(C,40)-EMA(C,8)>0 AND EMA(C,8)/L>1.16,3),
LOW,'●'),linethick3 , COLORMAGENTA;
DRAWTEXT(FILTER(EMA(C,8)-EMA(C,40)>0 AND HIGH/EMA(C,8)>1.16,3),
HIGH,'●'),linethick3 ,color99ff00;
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容