建仓成本估算,可估计回踩成本(通达信公式 主图 源码 测试图)

[复制链接]
查看63 | 回复0 | 2022-6-27 18:38:22 | 显示全部楼层 |阅读模式

 建仓成本估算,这个通达信公式,可估计回踩成本。

全息成本曲线: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;
 
 
 
拉升起点:=REFDATE(CONST(REF(LLV(L,0),0)),DATE)*1.0,DOTLINE;
{拉升起点:=REFDATE(CONST(COST(0.001)),DATE)*1.00,DOTLINE;}
 
拉升10%:=拉升起点*1.1,DOTLINE;
拉升20%:=拉升10%*1.1,DOTLINE;
拉升30%:=拉升20%*1.1,DOTLINE;
拉升40%:=拉升30%*1.1,DOTLINE;
拉升50%:=拉升40%*1.1,DOTLINE;
拉升60%:=拉升50%*1.1,DOTLINE;
拉升70%:=拉升60%*1.1,DOTLINE;
拉升80%:=拉升70%*1.1,DOTLINE;
拉升90%:=拉升80%*1.1,DOTLINE;
拉升99.99%:=拉升90%*1.1,DOTLINE;
拉升110%:=拉升99.99%*1.1,DOTLINE;
拉升120%:=拉升110%*1.1,DOTLINE;
拉升130%:=拉升120%*1.1,DOTLINE;
拉升140%:=拉升130%*1.1,DOTLINE;
拉升150%:=拉升140%*1.1,DOTLINE;
拉升160%:=拉升150%*1.1,DOTLINE;
拉升170%:=拉升160%*1.1,DOTLINE;
拉升180%:=拉升170%*1.1,DOTLINE;
拉升190%:=拉升180%*1.1,DOTLINE;
拉升200%:=拉升190%*1.1,DOTLINE;
 
 
拉升210%:=拉升200%*1.1,DOTLINE;
拉升220%:=拉升210%*1.1,DOTLINE;
拉升230%:=拉升220%*1.1,DOTLINE;
拉升240%:=拉升230%*1.1,DOTLINE;
拉升250%:=拉升240%*1.1,DOTLINE;
拉升260%:=拉升250%*1.1,DOTLINE;
拉升270%:=拉升260%*1.1,DOTLINE;
拉升280%:=拉升270%*1.1,DOTLINE;
拉升290%:=拉升280%*1.1,DOTLINE;
拉升300%:=拉升290%*1.1,DOTLINE;
 
DRAWTEXT(CURRBARSCOUNT=DT,拉升起点,'拉升起点'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升10%,'拉升10%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升20%,'拉升20%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升30%,'拉升30%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升40%,'拉升40%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升50%,'拉升50%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升60%,'拉升60%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升70%,'拉升70%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升80%,'拉升80%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升90%,'拉升90%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升99.99%,'拉升99.99%'),COLORGRAY;
 
DRAWTEXT(CURRBARSCOUNT=DT,拉升110%,'拉升110%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升120%,'拉升120%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升130%,'拉升130%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升140%,'拉升140%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升150%,'拉升150%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升160%,'拉升160%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升170%,'拉升170%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升180%,'拉升180%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升190%,'拉升190%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升200%,'拉升200%'),COLORGRAY;
 
DRAWTEXT(CURRBARSCOUNT=DT,拉升210%,'拉升210%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升220%,'拉升220%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升230%,'拉升230%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升240%,'拉升240%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升250%,'拉升250%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升260%,'拉升260%'),COLORGRAY;
 
DRAWTEXT(CURRBARSCOUNT=DT,拉升270%,'拉升270%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升280%,'拉升280%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升290%,'拉升290%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=DT,拉升300%,'拉升300%'),COLORGRAY;
 
 
回踩起点:=REFDATE(CONST(REF(HHV(H,0),0)),DATE)*1.0,DOTLINE;
{回踩起点:=REFDATE(CONST(COST(99.999)),DATE)*1.0,DOTLINE;}
 
回踩10%:=回踩起点*0.90,DOTLINE;
回踩20%:=回踩10%*0.90,DOTLINE;
回踩30%:=回踩20%*0.90,DOTLINE;
回踩40%:=回踩30%*0.90,DOTLINE;
回踩50%:=回踩40%*0.90,DOTLINE;
回踩60%:=回踩50%*0.90,DOTLINE;
回踩70%:=回踩60%*0.90,DOTLINE;
回踩80%:=回踩70%*0.90,DOTLINE;
回踩90%:=回踩80%*0.90,DOTLINE;
回踩99.99%:=回踩90%*0.90,DOTLINE;
 
回踩110%:=回踩99.99%*0.90,DOTLINE;
回踩120%:=回踩110%*0.90,DOTLINE;
回踩130%:=回踩120%*0.90,DOTLINE;
回踩140%:=回踩130%*0.90,DOTLINE;
回踩150%:=回踩140%*0.90,DOTLINE;
回踩160%:=回踩150%*0.90,DOTLINE;
回踩170%:=回踩160%*0.90,DOTLINE;
回踩180%:=回踩170%*0.90,DOTLINE;
回踩190%:=回踩180%*0.90,DOTLINE;
回踩200%:=回踩190%*0.90,DOTLINE;
 
 
回踩210%:=回踩200%*0.90,DOTLINE;
回踩220%:=回踩210%*0.90,DOTLINE;
回踩230%:=回踩220%*0.90,DOTLINE;
回踩240%:=回踩230%*0.90,DOTLINE;
回踩250%:=回踩240%*0.90,DOTLINE;
回踩260%:=回踩250%*0.90,DOTLINE;
回踩270%:=回踩260%*0.90,DOTLINE;
回踩280%:=回踩270%*0.90,DOTLINE;
回踩290%:=回踩280%*0.90,DOTLINE;
回踩300%:=回踩290%*0.90,DOTLINE;
 
 
DRAWTEXT(CURRBARSCOUNT=GT,回踩起点,'回踩起点'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=GT,回踩10%,'回踩10%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=GT,回踩20%,'回踩20%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=GT,回踩30%,'回踩30%'),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=GT,回踩40%,'回踩40%'),CO

p20206108552890162.jpg

p20206108552890162.jpg

20206108553675133.rar

6.56 KB, 下载次数: 0

售价: 6 金钱  [记录]  [购买]

20206108553675133.rar

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则