以下是通达信自动画黄金分割线主图源码

{自动画黄金分割线}

{《股价结构压力与支撑-附录指标》作者:华强}

 

{背景}

DRAWGBK(C>0, RGB(1,1,1),RGB(1,1,1),0,’0′,0);

 

{K线色}

STICKLINE(CLOSE>OPEN,HIGH,LOW,0,0 ),COLOR0000C0;

STICKLINE(CLOSE>OPEN,OPEN,CLOSE,2.2,0 ),COLOR0000C0;

STICKLINE(CLOSE<OPEN,HIGH,LOW,0,0 ),COLOR00C000;

STICKLINE(CLOSE<OPEN,OPEN,CLOSE,2.2,0 ),COLOR00C000;

STICKLINE(CLOSE=OPEN,HIGH,LOW,0,0 ),COLORWHITE;

STICKLINE(CLOSE=OPEN,OPEN,CLOSE,2.2,0 ),COLORWHITE;

 

{自动画黄金分割线-源码}

N:=74;

M:=3;

PC:=(C+REF(C,1)+0)/3;

高:=REF(HHV(H,N),M);

低:=REF(LLV(L,N),M);

H19:=高-(高-低)*0.191;

H38:=高-(高-低)*0.382;

H中:=高-(高-低)*0.5;

H61:=高-(高-低)*0.618;

H80:=高-(高-低)*0.809;

 

顶点:REFDATE(高,DATE),COLORWHITE;

%19.8:REFDATE(H19,DATE),COLORYELLOW;

%38.2:REFDATE(H38,DATE),COLORMAGENTA;

%50:REFDATE(H中,DATE),COLORRED;

%61.8:REFDATE(H61,DATE),COLORMAGENTA;

%80.9:REFDATE(H80,DATE),COLORYELLOW;

低点:REFDATE(低,DATE),COLORWHITE;

 

DRAWTEXT(ISLASTBAR,顶点,’顶点’),COLORWHITE;

DRAWTEXT(ISLASTBAR,%19.8,’%19.8′),COLORYELLOW;

DRAWTEXT(ISLASTBAR,%38.2,’%38.2′),COLORMAGENTA;

DRAWTEXT(ISLASTBAR,%50,’50%’),COLORRED;

DRAWTEXT(ISLASTBAR,%61.8,’%61.8′),COLORMAGENTA;

DRAWTEXT(ISLASTBAR,%80.9,’%80.9′),COLORYELLOW;

DRAWTEXT(ISLASTBAR,低点,’低点’),COLORWHITE;
 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。