「通达信」区间成本主图指标公式

起点:=1;终点:=100;
AA:=起点;
BB:=终点;
CYC:=IF(CAPITal=0,(sum(C,AA)-SUM(C,BB))/(AA-BB),(SUM(AMOUNT,AA)-SUM(AMOUNT,BB))/(SUM(VOL,AA)-SUM(VOL,BB))/100);
区间成本:CONst(CYC),NODRAW;
区间换手:(SUM(VOL,AA)-SUM(VOL,BB))/CAPITAL*100,NODRAW;
计算周期:AA-BB,NODRAW;
HH:=REFdate(HHV(H,起点),DATE);
LL:=REFDATE(LLV(L,起点),DATE);
N1:=IF(PERIOD=7,1.05,IF(PERIOD=6,1.02,1.01));
n2:=IF(PERIOD=7,0.95,IF(PERIOD=6,0.98,0.99));
STICKLINE(CUrrBARSCOUNT<=终点,区间成本*N1,区间成本*N2,5,0),COLOR808080;
STICKLINE(CURRBARSCOUNT<=终点,区间成本,区间成本,5,0),COLORWHITE;
{www.gainiangu.com 概念股网_最新股票指标公式}
STICKLINE(CURRBARSCOUNT=起点,HH,LL,0,-1),COLORYELLOW;
STICKLINE(CURRBARSCOUNT=终点,HH,LL,0,-1),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=起点,LL,起点),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=终点,LL,终点),COLORWHITE;
DRAWKLINE(high,OPEN,LOW,close);

分享: