通达信狄马克的黄金分割公式
{黄金分割}
NB:=80;
MB:=3;
MA5X:=MA(C,5);
MA13X:=MA(C,13);
高:=REF(HHV(H,NB),MB);
低:=REF(LLV(L,NB),MB);
H19:=高-(高-低)*0.191;
H38:=高-(高-低)*0.382;
H中:=高-(高-低)*0.5;
H61:=高-(高-低)*0.618;
H80:=高-(高-低)*0.809;
一:REFDATE(高,DATE),POINTDOT,COLORWHITE;
二:REFDATE(H19,DATE),POINTDOT,COLORYELLOW;
三:REFDATE(H38,DATE),POINTDOT,COLORMAGENTA;
四:REFDATE(H中,DATE),POINTDOT,COLORRED;
五:REFDATE(H61,DATE),POINTDOT,COLORMAGENTA;
六:REFDATE(H80,DATE),POINTDOT,COLORYELLOW;
七:REFDATE(低,DATE),POINTDOT,COLORWHITE;
DRAWTEXT(ISLASTBAR,一, 高),COLORWHITE;
DRAWTEXT(ISLASTBAR,二, 809),COLORYELLOW;
DRAWTEXT(ISLASTBAR,三, 618),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,四, 中),COLORRED;
DRAWTEXT(ISLASTBAR,五, 382),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,六, 191),COLORYELLOW;
DRAWTEXT(ISLASTBAR,七, 低),COLORWHITE; |