通达信同期涨幅指标公式
2020/9/1 19:16:53
起始年:=2014;
起始月:=11;
起始日:=20;
截止年:=2014;
截止月:=12;
截止日:=22;
A:=DATETODAY(DATE);
A1:=(起始年-1900)*10000+起始月*100+起始日;
A2:=REF(A,TOTALBARSCOUNT-1)+1;
起始日期:=IF(DATETODAY(A1)<A2,A,A1);
B1:=(截止年-1900)*10000+截止月*100+截止日;
B2:=A;
截止日期:=IF(DATETODAY(B1)>A2,B1,B2);
T1:=BARSSINCE(DATE>=起始日期);
T2:=BARSSINCE(DATE>=截止日期);
ZF1:=100*(C/REF(C,T1+1)-1);
同期涨幅:IF(DATE>=起始日期 AND DATE<=截止日期,ZF1,REF(ZF1,T2)),COLORFC0096,LINETHICK2;
{把以下内容用英文大括号括起来,排序去研究吧!}
0,COLORBLACK;
无效:IF(DATE<起始日期,0,DRAWNULL),POINTDOT,COLORBLUE,LINETHICK4;
有效:IF(DATE>=起始日期 AND DATE<=截止日期,0,DRAWNULL),POINTDOT,COLORGREEN,LINETHICK4;
失效:IF(DATE>截止日期,0,DRAWNULL),POINTDOT,COLOR666666,LINETHICK4;
DRAWNUMBER(有效=0 AND T1=0,60,YEAR),COLORRED;
DRAWNUMBER(有效=0 AND T1>0 AND YEAR-1=REF(YEAR,1),60,YEAR),COLORLIRED;
DRAWNUMBER(T2=0,60,YEAR),COLORRED;
DRAWNUMBER(有效=0 AND T1=0,45,MONTH),COLORYELLOW;
DRAWNUMBER(有效=0 AND T1>0 AND YEAR=REF(YEAR,1) AND BARSLASTCOUNT(MONTH=REF(MONTH,1))+1=1,45,MONTH),COLORYELLOW;
DRAWNUMBER(有效=0 AND T1>0 AND (YEAR-1)=REF(YEAR,1),45,MONTH),COLORYELLOW;
DRAWNUMBER(有效=0,30,DAY),COLORCYAN;
DRAWTEXT(有效=0 AND WEEKDAY=1,11,'一'),COLORWHITE;
DRAWTEXT(有效=0 AND WEEKDAY=2,11,'二'),COLORWHITE;
DRAWTEXT(有效=0 AND WEEKDAY=3,11,'三'),COLORWHITE;
DRAWTEXT(有效=0 AND WEEKDAY=4,11,'四'),COLORWHITE;
DRAWTEXT(有效=0 AND WEEKDAY=5,11,'五'),COLORWHITE;
DRAWTEXT(有效=0 AND WEEKDAY=6,11,'六'),COLORWHITE;
DRAWTEXT(有效=0 AND WEEKDAY=7,11,'七'),COLORWHITE;
DRAWNUMBER(T2=1,-1,(T1+1)-(T2)),COLORGREEN,DRAWABOVE;
投股 票网 www.tou18 .cn
股市公式下载推荐