六组趋势线 教你画出正确趋势线指标 公式 源码[通达信公式]
六组趋势线 教你画出正确趋势线指标 公式 源码:
周期:=5;
QA短:=REF(HIGH,周期)=HHV(HIGH,2*周期+1);
QB短:=BACKSET(QA短,周期+1);
QC短:=FILTER(QB短,周期) AND H=HHV(HIGH,周期+1);
QD短:=BARSLAST(QC短);
QE短:=IF(QC短,CURRBARSCOUNT,0);
QF短:=IF(QD短,REF(QE短,QD短),QE短);
QG短:=CONST(QF短),NODRAW;
QH短:=REF(QF短,QD短+1);
QW短:=CONST(QH短),NODRAW;
NOTEXT短长压:DRAWLINE(CURRBARSCOUNT=QW短,H,CURRBARSCOUNT=QG短,H,1),COLORGREEN;
NOTEXT短长远高:DRAWLINE(CURRBARSCOUNT=QW短,H,ISLASTBAR,REF(HIGH,QW短-1),1),COLORGREEN,DOTLINE;
NOTEXT短长近高:DRAWLINE(CURRBARSCOUNT=QG短,H,ISLASTBAR,REF(HIGH,QG短-1),1),COLORGREEN,DOTLINE;
TPD短长期:=DRAWLINE(CURRBARSCOUNT=QW短,H,CURRBARSCOUNT=QG短,H,1);
DRAWICON(REF(CLOSE,1)<TPD短长期 AND C>TPD短长期 AND REF(TPD短长期,1)>TPD短长期,L*0.98,1);
QA中:=REF(HIGH,周期*2)=HHV(HIGH,2*周期*2+1);
QB中:=BACKSET(QA中,周期*2+1);
QC中:=FILTER(QB中,周期*2) AND H=HHV(HIGH,周期*2+1);
QD中:=BARSLAST(QC中);
QE中:=IF(QC中,CURRBARSCOUNT,0);
QF中:=IF(QD中,REF(QE中,QD中),QE中);
QG中:=CONST(QF中);
QH中:=REF(QF中,QD中+1);
QW中:=CONST(QH中);
{程序化久久公式网}DRAWLINE(CURRBARSCOUNT=QW中,H,CURRBARSCOUNT=QG中,H,1),COLORGREEN;
DRAWLINE(CURRBARSCOUNT=QW中,H,ISLASTBAR,REF(HIGH,QW中-1),1),COLORGREEN,DOTLINE;
DRAWLINE(CURRBARSCOUNT=QG中,H,ISLASTBAR,REF(HIGH,QG中-1),1),COLORGREEN,DOTLINE;
TPD中长期:=DRAWLINE(CURRBARSCOUNT=QW中,H,CURRBARSCOUNT=QG中,H,1);
DRAWICON(REF(CLOSE,1)<TPD中长期 AND C>TPD中长期 AND REF(TPD中长期,1)>TPD中长期,L*0.98,1);
QA长:=REF(HIGH,3*周期)=HHV(HIGH,2*3*周期+1);
QB长:=BACKSET(QA长,3*周期+1);
QC长:=FILTER(QB长,3*周期) AND H=HHV(HIGH,3*周期+1);
QD长:=BARSLAST(QC长);
QE长:=IF(QC长,CURRBARSCOUNT,0);
QF长:=IF(QD长,REF(QE长,QD长),QE长);
QG长:=CONST(QF长),NODRAW;
QH长:=REF(QF长,QD长+1);
QW长:=CONST(QH长),NODRAW;
NOTEXT长长压:DRAWLINE(CURRBARSCOUNT=QW长,H,CURRBARSCOUNT=QG长,H,1),COLORGREEN;
NOTEXT长长远高:DRAWLINE(CURRBARSCOUNT=QW长,H,ISLASTBAR,REF(HIGH,QW长-1),1),COLORGREEN,DOTLINE;
NOTEXT长长近高:DRAWLINE(CURRBARSCOUNT=QG长,H,ISLASTBAR,REF(HIGH,QG长-1),1),COLORGREEN,DOTLINE;
TPD长长期:=DRAWLINE(CURRBARSCOUNT=QW长,H,CURRBARSCOUNT=QG长,H,1);
DRAWICON(REF(CLOSE,1)<TPD长长期 AND C>TPD长长期 AND REF(TPD长长期,1)>TPD长长期,L*0.98,1);
QA久:=REF(HIGH,4*周期)=HHV(HIGH,2*4*周期+1);
QB久:=BACKSET(QA久,4*周期+1);
QC久:=FILTER(QB久,4*周期) AND H=HHV(HIGH,4*周期+1);
QD久:=BARSLAST(QC久);
QE久:=IF(QC久,CURRBARSCOUNT,0);
QF久:=IF(QD久,REF(QE久,QD久),QE久);
QG久:=CONST(QF久),NODRAW;
QH久:=REF(QF久,QD久+1);
QW久:=CONST(QH久),NODRAW;
NOTEXT久压:DRAWLINE(CURRBARSCOUNT=QW久,H,CURRBARSCOUNT=QG久,H,1),COLORGREEN;
NOTEXT久远高:DRAWLINE(CURRBARSCOUNT=QW久,H,ISLASTBAR,REF(HIGH,QW久-1),1),COLORGREEN,DOTLINE;
NOTEXT久近高:DRAWLINE(CURRBARSCOUNT=QG久,H,ISLASTBAR,REF(HIGH,QG久-1),1),COLORGREEN,DOTLINE;
TPD久期:=DRAWLINE(CURRBARSCOUNT=QW久,H,CURRBARSCOUNT=QG久,H,1);
DRAWICON(REF(CLOSE,1)<TPD久期 AND C>TPD久期 AND REF(TPD久期,1)>TPD久期,L*0.98,1);
QAA短:=REF(LOW,周期)=LLV(LOW,2*周期+1);
QBB短:=BACKSET(QAA短,周期+1);
QCC短:=FILTER(QBB短,周期) AND L=LLV(LOW,周期+1);
QDD短:=BARSLAST(QCC短);
QEE短:=IF(QCC短,CURRBARSCOUNT,0);
QFF短:=IF(QDD短,REF(LOW,QDD短),L);
QGG短:=IF(QDD短,REF(QEE短,QDD短),QEE短);
QHH短:=CONST(QGG短);
QWW短:=REF(QFF短,QDD短+1);
QMM短:=REF(QGG短,QDD短+1);
QRR短:=CONST(QMM短);
NOTEXT短长支:DRAWLINE(CURRBARSCOUNT=QRR短,L,CURRBARSCOUNT=QHH短,L,1),COLORYELLOW;
NOTEXT短长近低:DRAWLINE(CURRBARSCOUNT=QHH短,L,ISLASTBAR,REF(LOW,QHH短-1),1),COLORYELLOW,DOTLINE;
NOTEXT短长远低:DRAWLINE(CURRBARSCOUNT=QRR短,L,ISLASTBAR,REF(LOW,QRR短-1),1),COLORYELLOW,DOTLINE;
QAA中:=REF(LOW,周期*2)=LLV(LOW,2*周期*2+1);
QBB中:=BACKSET(QAA中,周期*2+1);
QCC中:=FILTER(QBB中,周期*2) AND L=LLV(LOW,周期*2+1);
QDD中:=BARSLAST(QCC中);
QEE中:=IF(QCC中,CURRBARSCOUNT,0);
QFF中:=IF(QDD中,REF(LOW,QDD中),L);
QGG中:=IF(QDD中,REF(QEE中,QDD中),QEE中);
QHH中:=CONST(QGG中);
QWW中:=REF(QFF中,QDD中+1);
QMM中:=REF(QGG中,QDD中+1);
QRR中:=CONST(QMM中);
NOTEXT中长支:DRAWLINE(CURRBARSCOUNT=QRR中,L,CURRBARSCOUNT=QHH中,L,1),COLORYELLOW;
NOTEXT中长近低:DRAWLINE(CURRBARSCOUNT=QHH中,L,ISLASTBAR,REF(LOW,QHH中-1),1),COLORYELLOW,DOTLINE;
NOTEXT中长远低:DRAWLINE(CURRBARSCOUNT=QRR中,L,ISLASTBAR,REF(LOW,QRR中-1),1),COLORYELLOW,DOTLINE;
QAA长:=REF(LOW,周期*3)=LLV(LOW,2*周期*3+1);
QBB长:=BACKSET(QAA长,周期*3+1);
QCC长:=FILTER(QBB长,周期*3) AND L=LLV(LOW,周期*3+1);
QDD长:=BARSLAST(QCC长);
QEE长:=IF(QCC长,CURRBARSCOUNT,0);
QFF长:=IF(QDD长,REF(LOW,QDD长),L);
QGG长:=IF(QDD长,REF(QEE长,QDD长),QEE长);
QHH长:=CONST(QGG长);
QWW长:=REF(QFF长,QDD长+1);
QMM长:=REF(QGG长,QDD长+1);
QRR长:=CONST(QMM长);
NOTEXT长长支:DRAWLINE(CURRBARSCOUNT=QRR长,L,CURRBARSCOUNT=QHH长,L,1),COLORYELLOW;
NOTEXT长长近低:DRAWLINE(CURRBARSCOUNT=QHH长,L,ISLASTBAR,REF(LOW,QHH长-1),1),COLORYELLOW,DOTLINE;
NOTEXT长长远低:DRAWLINE(CURRBARSCOUNT=QRR长,L,ISLASTBAR,REF(LOW,QRR长-1),1),COLORYELLOW,DOTLINE;
{2画K线}STICKLINE(C=O,C,O,2,1),COLORWHITE;
STICKLINE(C=O,H,L,0,0),COLORWHITE;
STICKLINE(C>O,C,O,2,1),COLORLIRED;
STICKLINE(C>O,H,MAX(OPEN,C),0,0),COLORLIRED;
STICKLINE(C>O,L,MIN(OPEN,C),0,0),COLORLIRED;
STICKLINE(C<O,C,O,2,1),COLORLIBLUE;
STICKLINE(C<O,H,MAX(OPEN,C),0,0),COLORLIBLUE;
STICKLINE(C<O,L,MIN(OPEN,C),0,0),COLORLIBLUE;
EMA13:=EMA(CLOSE,13),NODRAW;
ZR:=TFILTER(C<=EMA13 AND REF(CLOSE,1)>EMA13,C>EMA13,1);
ZQ:=TFILTER(C>EMA13 AND REF(CLOSE,1)<=EMA13,C<=EMA13,1);
转强周期:=BARSLAST(ZQ),NODRAW;
转弱周期:=BARSLAST(ZR),NODRAW;
STICKLINE(ZR,H,L,0,0),COLORFFF370;
STICKLINE(ZR,O,C,2,0),COLORFFF370;
STICKLINE(ZQ,H,L,0,0),COLORMAGENTA;
STICKLINE(ZQ,O,C,2,0),COLORMAGENTA;
ZT1:=C/REF(CLOSE,1)>1.097;
BH1:=BARSLAST(ZT1);
STICKLINE(ZT1,REF(OPEN,BH1),REF(CLOSE,BH1),2,0),COLORYELLOW;
STICKLINE(ZT1,REF(HIGH,BH1),REF(LOW,BH1),0,0),COLORYELLOW;
{程序化交易 WWW.CXH99.COM }
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容