通达信百分比线指标公式
N:=6000;
高:=REFDATE(HHV(H,N),DATE);
低:=REFDATE(LLV(L,N),DATE);
H11:=高-(高-低)*1.000;
H10:=高-(高-低)*0.875;
H9:=高-(高-低)*0.750;
H8:=高-(高-低)*0.666;
H7:=高-(高-低)*0.625;
H6:=高-(高-低)*0.500;
H5:=高-(高-低)*0.375;
H4:=高-(高-低)*0.333;
H3:=高-(高-低)*0.250;
H2:=高-(高-低)*0.125;
H1:=高-(高-低)*0.000;
STICKLINE(CURRBARSCOUNT=18,高,高,120,1),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,H1,H1,120,1),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,H2,H2,120,1),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=10,H1,'0.000'),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=10,H2,'0.125'),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=10,H3,'0.250'),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=10,H4,'0.333'),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=10,H5,'0.375'),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=10,H6,'0.500'),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=10,H7,'0.625'),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=10,H8,'0.666'),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=10,H9,'0.750'),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=10,H10,'0.875'),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=10,H11,'1.000'),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,H3,H3,120,1),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,H4,H4,120,1),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,H6,H6,120,1),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,H5,H5,120,1),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,低,低,120,1),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,H7,H7,120,1),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,H8,H8,120,1),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,H9,H9,120,1),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,H10,H10,120,1),COLOR656565;
STICKLINE(CURRBARSCOUNT=18,H11,H11,120,1),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,高*0.99,CON2STR(高,2)),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,H11,CON2STR(H11,2)),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,H10,CON2STR(H10,2)),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,H9,CON2STR(H9,2)),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,H8,CON2STR(H8,2)),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,H1,CON2STR(H1,2)),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,H2,CON2STR(H2,2)),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,H3,CON2STR(H3,2)),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,H6,CON2STR(H6,2)),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,H4,CON2STR(H4,2)),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,H5,CON2STR(H5,2)),COLOR656565;
DRAWTEXT(CURRBARSCOUNT=35,H7,CON2STR(H7,2)),COLOR656565;
低点:=800;
高点:=800;
时间:=1;
价格:=1;
调点:=1;
PURC:=CONST(FINDHIGH(H,0,高点*10,1));
PLZ:=CONST(BARSLAST(PURC=H))+1;
顶X:=CONST(IF(PLZ=1,H,REF(H,PLZ-1)));
QQT:=CONST(FINDLOW(L,0,低点*10,1));
PLL:=CONST(BARSLAST(QQT=L))+1;
低X:=CONST(IF(PLL=1,L,REF(L,PLL-1)));
ATM:=时间=2OR时间=2;
QTM:=时间=1OR时间=1;
BTM:=时间=1OR时间=1OR时间=1;
AAZ:=IF(ATM,ROUND(IF(PLZ>PLL,PL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PLL)*7/3),DRAWNULL);
QZZ:=IF(QTM,ROUND(IF(PLZ>PLL,PLZ,PLL)-ABS(PLZ-PLL)*8/3),DRAWNULL);
HXCS2:=CURRBARSCOUNT=QAZORCURRBARSCOUNT=QBZOR
CURRBARSCOUNT=QCZ
ORCURRBARSCOUNT=QDZORCURRBARSCOUNT=QEZORCURRBARSCOUNT=QGZ
ORCURRBARSCOUNT=QHZORCURRBARSCOUNT=QIZORCURRBARSCOUNT=QJZ
ORCURRBARSCOUNT=QKZORCURRBARSCOUNT=QMZORCURRBARSCOUNT=QNZ
ORCURRBARSCOUNT=QOZORCURRBARSCOUNT=QPZORCURRBARSCOUNT=QQZ
ORCURRBARSCOUNT=QRZ
ORCURRBARSCOUNT=QSZORCURRBARSCOUNT=QTZORCURRBARSCOUNT=QUZ
ORCURRBARSCOUNT=QVZORCURRBARSCOUNT=QWZORCURRBARSCOUNT=QXZ
ORCURRBARSCOUNT=QYZORCURRBARSCOUNT=QZZ;
STICKLINE(HXCS1ORHXCS2,顶X,低X,0,0),COLOR656565;
DRAWKLINE(H,O,L,C);
天XX线:=IF(价格=5AND时间=5,DRAWNULL,顶X),COLOR656565;
地XX线:=IF(价格=5AND时间=5,DRAWNULL,低X),COLOR656565;
顶点:天XX线,COLOR656565;
底点:地XX线,COLOR656565;
DRAWTEXT(CURRBARSCOUNT=QAZORCURRBARSCOUNT=QIZOR
CURRBARSCOUNT=QSZ,顶X*0.98,'1/8')COLOR656565;
DRAWTEXT(CURRBARSCOUNT=QBZORCURRBARSCOUNT=QMZOR
CURRBARSCOUNT=QTZ,顶X*0.98,'2/8')COLOR656565;
DRAWTEXT(CURRBARSCOUNT=QCZORCURRBARSCOUNT=QNZOR
CURRBARSCOUNT=QUZ,顶X*0.98,'3/8')COLOR656565;
DRAWTEXT(CURRBARSCOUNT=QEZORCURRBARSCOUNT=QPZOR
CURRBARSCOUNT=QVZ,顶X*0.98,'5/8')COLOR656565;
DRAWTEXT(CURRBARSCOUNT=QGZORCURRBARSCOUNT=QQZOR
CURRBARSCOUNT=QWZ,顶X*0.98,'6/8')COLOR656565;
DRAWTEXT(CURRBARSCOUNT=QHZORCURRBARSCOUNT=QRZOR
CURRBARSCOUNT=QXZ,顶X*0.98,'7/8')COLOR656565;
DRAWTEXT(CURRBARSCOUNT=QJZORCURRBARSCOUNT=QDZOR
CURRBARSCOUNT=QYZ,顶X*0.98,'1/3')COLOR656565;
DRAWTEXT(CURRBARSCOUNT=QKZORCURRBARSCOUNT=QOZOR
CURRBARSCOUNT=QZZ,顶X*0.98,'2/3')COLOR656565;
STICKLINE(C>=O,H,L,0,0),COLORFFFFFF;
STICKLINE(C>=O,C,O,3,1),COLORFFFFFF;
STICKLINE(C<O,H,L,0,0),COLORB6B600;
STICKLINE(C<O,C,O,3,1),COLORB6B600;
通达信百分比分割线指标
N:=150;
高 1:=HHV(H,N);
低 1:=LLV(L,N);
H1:=高 1-(高 1-低 1)*0.191;
H2:=高 1-(高 1-低 1)*0.382;
H3:=高 1-(高 1-低 1)*0.5;
H4:=高 1-(高 1-低 1)*0.618;
H5:=高 1-(高 1-低 1)*0.809;
高:REFDATE(高 1,DATE);
低:REFDATE(低 1,DATE);
一:REFDATE(H1,DATE);
二:REFDATE(H2,DATE);
三:REFDATE(H3,DATE);
四:REFDATE(H4,DATE),COLORRED;
五:REFDATE(H5,DATE);
{DRAWTEXT(CURRBARSCOUNT=1.00,一,'一(0.191)'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1.00,二,'二(0.382)'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1.00,三,'三(0.50)'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1.00,四,'四(0.618'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1.00,五,'五(0.809)'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1.00,高,'高'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1.00,低,'低'),COLORYELLOW;
DRAWKLINE(H,O,L,C);};
涨跌停:=(C-REF(C,1))/REF(C,1)*100;
STICKLINE(涨跌停>9.8,O,C,3,0),COLORYELLOW;
STICKLINE(涨跌停<-9.8,O,C,3,0),COLORGREEN;
STICKLINE(涨跌停>6 AND 涨跌停<9.8,O,C,3,0),COLORRED;
股东权益:FINANCE(36),NODRAW;
每股公积:FINANCE(18),NODRAW;
所属地区:DRAWTEXT_FIX(1,0,0,0,'地区: '),COLORYELLOW;
DRAWTEXT_FIX(1,0.07,0,0,DYBLOCK),COLORYELLOW;
所属行业:DRAWTEXT_FIX(1,0,0.08,0,'行业: '),COLORYELLOW;
DRAWTEXT_FIX(1,0.07,0.08,0,HYBLOCK),COLORYELLOW;
所属概念:DRAWTEXT_FIX(1,0,0.16,0,'概念: '),COLORYELLOW;
DRAWTEXT_FIX(1,0.07,0.16,0,GNBLOCK),COLORYELLOW;
所属风格:DRAWTEXT_FIX(1,0,0.24,0,'风格: '),COLORYELLOW;
DRAWTEXT_FIX(1,0.07,0.24,0,FGBLOCK),COLORYELLOW;
评论(0)