【通达信源码分享】精品指标公式-价位主图指标源码
公式源码:
T:=80;TT:=3;N1:=0;
高1:=REF(HHV(H,T),TT);
低1:=REF(LLV(L,T),TT);
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),COLORRED;
一:REFDATE(H1,DATE),COLORLIGRAY;
二:REFDATE(H2,DATE),COLORYELLOW;
三:REFDATE(H3,DATE),COLORWHITE;
四:REFDATE(H4,DATE),COLORYELLOW;
五:REFDATE(H5,DATE),COLORLIGRAY;
低:REFDATE(低1,DATE),COLORGREEN;
TT3:=(CURRBARSCOUNT=5);
TT4:=(CURRBARSCOUNT=5+3);
DRAWNUMBER(TT3 AND 高,高,高),COLORYELLOW;
DRAWTEXT(TT4 AND 高,高*1.01,'顶'),COLORMAGENTA;
DRAWNUMBER(TT3 AND 一,一,一),COLORYELLOW;
DRAWTEXT(TT4 AND 一,一*1.01,''),COLORRED;
DRAWNUMBER(TT3 AND 二,二,二),COLORYELLOW;
DRAWTEXT(TT4 AND 二,二*1.01,''),COLORRED;
DRAWNUMBER(TT3 AND 三,三,三),COLORYELLOW;
DRAWTEXT(TT4 AND 三,三*1.01,'中'),COLORMAGENTA;
DRAWNUMBER(TT3 AND 四,四,四),COLORYELLOW;
DRAWTEXT(TT4 AND 四,四*1.01,''),COLORRED;
DRAWNUMBER(TT3 AND 五,五,五),COLORYELLOW;
DRAWTEXT(TT4 AND 五,五*1.01,''),COLORRED;
DRAWNUMBER(TT3 AND 低,低,低),COLORYELLOW;
DRAWTEXT(TT4 AND 低,低*1.01,'底'),COLORMAGENTA;
MA5:MA(CLOSE,5);
MA10:MA(CLOSE,10);
高点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,HHV(H, BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORRED,DOTLINE;
低点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,LLV(L, BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORMAGENTA,DOTLINE;
STICKLINE(CCI>=200 AND H>=高点,O,C,3,0),COLORBLUE;
STICKLINE(CCI<=100 AND L<=低点,O,C,3,0),COLORYELLOW;
DRAWTEXT(ISLASTBAR,高点,'高点'),COLORRED;
DRAWTEXT(ISLASTBAR,低点,'低点'),COLORMAGENTA;{COLORBLUE;};
买线:=EMA(C,2);
卖线:=EMA(SLOPE(C,26)*15+C,45);
BU:=CROSS(买线,卖线);
SEL:=CROSS(卖线,买线);
DRAWBMP(BU,L*0.998,'B');
DRAWBMP(SEL,H*1.018,'S');
BOLL:MA(CLOSE,20),COLORWHITE,LINETHICK2;
UPPER:BOLL+2*STD(CLOSE,20),COLORCYAN;
LOWER:BOLL-2*STD(CLOSE,20),COLORCYAN;
IF(BOLL<REF(BOLL,1),BOLL,DRAWNULL),COLORGREEN,LINETHICK2;
IF(BOLL>REF(BOLL,1),BOLL,DRAWNULL),COLORRED,LINETHICK2;
版权声明
本文版权归掌上指标所有。
未经许可,不得转载,转载请注明出处!