自动黄金分割通达信公式 主图 源码附图
全息成本直线:=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,'99.99%'),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);
未来函数检测结果如下:
该公式包含未来函数:COST
该公式包含未来函数:CAPITAL
该公式包含未来函数:DHIGH
该公式包含未来函数:DLOW
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
全息成本直线赋值:REFDATE(0的收盘价*成交量日累和/0的成交量日累和,DATE),画红色, 线宽为2
输出市场成本曲线:DMA(成交额/(100*成交量),成交量/当前流通股本),COLORBROWN, 线宽为2
市场成本直线赋值:REFDATE(CONST(DMA(成交额/(100*成交量),成交量/当前流通股本)),DATE),COLORBROWN, 线宽为2
输出机构成本曲线:获利盘为50%的成本分布,画红色,画洋红色, 线宽为2
机构成本直线赋值:REFDATE(CONST(获利盘为50%的成本分布),DATE),画洋红色, 线宽为2
高点赋值:REFDATE(CONST(REF(0日内H最高值,0)),DATE),DOTLINE
低点赋值:REFDATE(CONST(REF(0日内L最低值,0)),DATE),DOTLINE
GD赋值:CONST(FIND最高价(H,0,高点*10,1))
DD赋值:CONST(FIND最低价(L,0,低点*10,1))
GT赋值:CONST(上次GD=H距今天数)+1
DT赋值:CONST(上次DD=L距今天数)+1
SH赋值:CONST(IF(GT=1,H,GT-1日前的H))
SL赋值:CONST(IF(DT=1,L,DT-1日前的L))
如果DT>GT返回DT否则返回GT
CD赋值:INTPART(CC-(DT+GT)/2)
如果高点>CD返回CD/2否则返回高点
输出上涨周期:IF( 到最后交易的周期<=DT,上次DD=L距今天数,DRAWNULL),COLORBROWN,NODRAW
如果 到最后交易的周期<=DT返回C/SL*100-100否则返回DRAWNULL
上涨均价赋值:IF( 到最后交易的周期<=DT,DT的成交额日累和/DT的V日累和/100,DRAWNULL),NODRAW,COLORGRAY
输出上涨换手:IF( 到最后交易的周期<=DT,DT的HSL.HSL日累和,DRAWNULL),画洋红色,NODRAW
输出下跌周期:上次GD=H距今天数,COLORBLACK,NODRAW
如果 到最后交易的周期<=GT返回C/SH*100-100否则返回DRAWNULL
下跌均价赋值:IF( 到最后交易的周期<=GT,GT的成交额日累和/GT的V日累和/100,DRAWNULL),NODRAW,COLORGRAY
输出下跌换手:IF( 到最后交易的周期<=GT,GT的HSL.HSL日累和,DRAWNULL), 画蓝色,NODRAW
{竖线表示统计起点位置}
上限赋值:CONST(0日内H最高值)
下限赋值:CONST(0日内L最低值)
当满足条件 到最后交易的周期=DT时,在上限和下限之间画柱状线
当满足条件 到最后交易的周期=GT时,在上限和下限之间画柱状线
{画K线}
DRAWKLINE(最高价,开盘价,最低价,收盘价)
{自动黄金分割 普通等系坐标}
DRAWRECTREL(990,1,382,1,RGB(250,250,0))
当满足条件C>0时,在横轴0.382纵轴0.00位置书写文字
DRAWRECTREL(990,188,382,188,RGB(200,200,0))
当满足条件C>0时,在横轴0.382纵轴0.189位置书写文字
DRAWRECTREL(990,375,382,375,RGB(200,200,0))
当满足条件C>0时,在横轴0.382纵轴0.376位置书写文字
DRAWRECTREL(990,491,382,491,RGB(200,200,0))
当满足条件C>0时,在横轴0.382纵轴0.492位置书写文字
DRAWRECTREL(990,607,382,607,RGB(200,200,0))
当满足条件C>0时,在横轴0.382纵轴0.608位置书写文字
DRAWRECTREL(990,794,382,794,RGB(200,200,0))
当满足条件C>0时,在横轴0.382纵轴0.795位置书写文字
DRAWRECTREL(990,982,382,982,RGB(250,250,0))
当满足条件C>0时,在横轴0.382纵轴0.936位置书写文字
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(最高价,开盘价,最低价,收盘价)