自动黄金分割(通达信公式 主图 源码 测试图)
通达信免费指标
09-03
阅读:636
评论:0
{自动黄金分割}
全息成本曲线:SUM(CLOSE*VOL,0)/SUM(VOL,0),COLORRED,LINETHICK2;
全息成本直线:=REFDATE(SUM(CLOSE*VOL,0)/SUM(VOL,0),DATE),COLORRED,LINETHICK2;
市场成本曲线:DMA(AMOUNT/(100*VOL),VOL/CAPITAL),COLORBROWN,LINETHICK2;
市场成本直线:=REFDATE(CONST(DMA(AMOUNT/(100*VOL),VOL/CAPITAL)),DATE),COLORBROWN,LINETHICK2;
机构成本曲线:COST(50),COLORRED,COLORMAGENTA,LINETHICK2;
机构成本直线:=REFDATE(CONST(COST(50)),DATE),COLORMAGENTA,LINETHICK2;
高点:=REFDATE(CONST(REF(HHV(H,0),0)),DATE),DOTLINE;
低点:=REFDATE(CONST(REF(LLV(L,0),0)),DATE),DOTLINE;
GD:=CONST(FINDHIGH(H,0,高点*10,1));
DD:=CONST(FINDLOW(L,0,低点*10,1));
GT:=CONST(BARSLAST(GD=H))+1;
DT:=CONST(BARSLAST(DD=L))+1;
SH:=CONST(IF(GT=1,H,REF(H,GT-1)));
SL:=CONST(IF(DT=1,L,REF(L,DT-1)));
CC:=IF(DT>GT,DT,GT);
CD:=INTPART(CC-(DT+GT)/2);
CG:=IF(高点>CD,CD/2,高点);
上涨周期:IF(CURRBARSCOUNT<=DT,BARSLAST(DD=L),DRAWNULL),COLORBROWN,NODRAW;
上涨幅度:IF(CURRBARSCOUNT<=DT,C/SL*100-100,DRAWNULL),NODRAW,COLORRED;
上涨均价:=IF(CURRBARSCOUNT<=DT,SUM(AMOUNT,DT)/SUM(V,DT)/100,DRAWNULL),NODRAW,COLORGRAY;
上涨换手:IF(CURRBARSCOUNT<=DT,SUM(HSL.HSL,DT),DRAWNULL),COLORMAGENTA,NODRAW;
下跌周期:BARSLAST(GD=H),COLORBLACK,NODRAW;
下跌幅度:IF(CURRBARSCOUNT<=GT,C/SH*100-100,DRAWNULL),NODRAW,COLORRED;
下跌均价:=IF(CURRBARSCOUNT<=GT,SUM(AMOUNT,GT)/SUM(V,GT)/100,DRAWNULL),NODRAW,COLORGRAY;
下跌换手:IF(CURRBARSCOUNT<=GT,SUM(HSL.HSL,GT),DRAWNULL),COLORBLUE,NODRAW;
{竖线表示统计起点位置}
上限:=CONST(HHV(H,0));
下限:=CONST(LLV(L,0));
STICKLINE(CURRBARSCOUNT=DT,上限,下限,1,0),COLORMAGENTA;
STICKLINE(CURRBARSCOUNT=GT,上限,下限,1,0),COLORGRAY;
{画K线}
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
{自动黄金分割 普通等系坐标}
DRAWRECTREL(990,1,382,1,RGB(250,250,0));
DRAWTEXT_FIX(C>0,0.382,0.00,0,'100%'),COLOR00CCCC;
DRAWRECTREL(990,188,382,188,RGB(200,200,0));
DRAWTEXT_FIX(C>0,0.382,0.189,0,'19.1%'),COLOR00CCCC;
DRAWRECTREL(990,375,382,375,RGB(200,200,0));
DRAWTEXT_FIX(C>0,0.382,0.376,0,'38.2%'),COLOR00CCCC;
DRAWRECTREL(990,491,382,491,RGB(200,200,0));
DRAWTEXT_FIX(C>0,0.382,0.492,0,'50.0%'),COLOR00CCCC;
DRAWRECTREL(990,607,382,607,RGB(200,200,0));
DRAWTEXT_FIX(C>0,0.382,0.608,0,'61.8%'),COLOR00CCCC;
DRAWRECTREL(990,794,382,794,RGB(200,200,0));
DRAWTEXT_FIX(C>0,0.382,0.795,0,'80.9%'),COLOR00CCCC;
DRAWRECTREL(990,982,382,982,RGB(250,250,0));
DRAWTEXT_FIX(C>0,0.382,0.936,0,'BASE'),COLOR00CCCC;
DRAWRECTREL(990,232,382,232,RGB(100,100,0));
DRAWRECTREL(990,144.6,382,144.6,RGB(100,100,0));
DRAWRECTREL(990,750,382,750,RGB(100,100,0));
DRAWRECTREL(990,839,382,839,RGB(100,100,0));
{画K线}
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
版权声明
本文版权归掌上指标所有。
未经许可,不得转载,转载请注明出处!