私募排排网 发表于 2020-4-29 21:41:00

黄金分割公式源码

lhnh:=BARSLAST(DISPSTATUS=1)+1;
nnl:=DISPSTATUS=2;
qqqq:=BACKSET(DISPSTATUS=2 ,barslast(dispstatus=1));
hh:=HHV(h ,lhnh);
ll:=llV(l ,lhnh);
q0:=hh+(hh-ll)*POW(0.618,5);
hh:=HHV(h ,lhnh);
q1:=ll+(hh-ll)*POW(0.618,1);
q2:=ll+(hh-ll)*POW(0.618,2);
q3:=ll+(hh-ll)*POW(0.618,3);
q4:=ll+(hh-ll)/2;
q5:=ll+(hh-ll)*POW(0.618,5);
q6:=hh-(hh-ll)*POW(0.618,3);
q7:=hh-(hh-ll)*POW(0.618,5);
ll:=llV(l ,lhnh);
q8:=ll-(hh-ll)*POW(0.618,5);
PARTLINE(q0,qqqq,RGB(238,238,28));
PARTLINE(hh ,qqqq,RGB(255,0,255));
PARTLINE(q1,qqqq,RGB(238,238,28));
PARTLINE(q2,qqqq,RGB(238,238,28));
PARTLINE(q3,qqqq,RGB(238,238,28));
PARTLINE(q4,qqqq,RGB(238,0,0));
PARTLINE(q5,qqqq,RGB(238,238,28));
PARTLINE(q6,qqqq,RGB(238,238,28));
PARTLINE(q7,qqqq,RGB(238,238,28));
PARTLINE(ll,qqqq,RGB(255,0,255));
PARTLINE(q8,qqqq,RGB(238,238,28));
DRAWTEXT(nnl,q0,'108.9%'+q0),Color00FFFF;

DRAWTEXT(nnl,hh,'100%'+hh),ColorFF00FF;
DRAWTEXT(nnl,q7,'90.9%'+q7),Color00FFFF;
DRAWTEXT(nnl,q6,'76.4%'+q6),Color00FFFF;
DRAWTEXT(nnl,q1,'61.8%'+q1),Color00FFFF;
DRAWTEXT(nnl,q4,'50%'+q4),Colorred;
DRAWTEXT(nnl,q2,'38.2%'+q2),Color00FFFF;
DRAWTEXT(nnl,q3,'23.7%'+q3),Color00FFFF;
DRAWTEXT(nnl,q5,'8.9%'+q5),Color00FFFF;
DRAWTEXT(nnl,ll,'0%'+ll),ColorFF00FF;
DRAWTEXT(nnl,q8,'-8.9%'+q8),VALIGN2,Color00FFFF;
页: [1]
查看完整版本: 黄金分割公式源码