通达信波段效益指标公式
2021/1/3 18:25:31
买入价:=8;
卖出价:=9;
数量:=10000;
买入日:=161226;
卖出日:=170330;
均线:=1;
MA1:IF(均线=1,MA(CLOSE,5),DRAWNULL);
MA2:IF(均线=1,MA(CLOSE,10),DRAWNULL);
MA3:IF(均线=1,MA(CLOSE,20),DRAWNULL);
MA4:IF(均线=1,MA(CLOSE,60),DRAWNULL);
买入日期:=1000000+买入日;
DRAWICON(DATE=买入日期,L*0.98,1);
卖出日期:=1000000+卖出日;
DRAWICON(DATE=卖出日期,H*1.02,2);
买入:IF(买入价!=0,买入价,DRAWNULL),COLORLIRED,DOTLINE;
卖出:=IF(卖出价!=0,卖出价,DRAWNULL),COLORGREEN,DOTLINE;
STICKLINE(DATE=买入日期,买入,买入,10,0),COLORGREEN;
STICKLINE(DATE=卖出日期,卖出,卖出,10,0),COLORGREEN;
盈亏:=(卖出-买入)*数量/10000,COLORYELLOW,NODRAW;
买入金额:=买入*数量/10000;
获利:=盈亏/买入金额*100;
{偏离:=IF(卖出价>MA(C,5),(卖出价-MA(C,5))/MA(C,5)*100,(MA(C,5)-卖出价)/卖出价*100),NODRAW;}
DRAWTEXT_FIX(1,0.1,0.15,0,STRCAT('股票代码:',CODE)),COLORWHITE;
DRAWTEXT_FIX(1,0.22,0.15,0,STRCAT('股票名称:',STKNAME)),COLORWHITE;
DRAWTEXT_FIX(1,0.1,0.20,0,STRCAT('买入日期:',CON2STR(买入日期+19000000,0))),COLORLIRED;
DRAWTEXT_FIX(1,0.22,0.20,0,STRCAT('买入价:',CON2STR(买入,2))),COLORLIRED;
DRAWTEXT_FIX(1,0.1,0.25,0,STRCAT('卖出日期:',CON2STR(卖出日期+19000000,0))),COLORLIGREEN;
DRAWTEXT_FIX(1,0.22,0.25,0,STRCAT('卖出价:',CON2STR(卖出,2))),COLORLIGREEN;
DRAWTEXT_FIX(1,0.1,0.30,0,STRCAT('交易数量:',CON2STR(数量,0))),COLORYELLOW;
DRAWTEXT_FIX(1,0.22,0.30,0,STRCAT('占用资金:(万)',CON2STR(买入金额,2))),COLORYELLOW;
DRAWTEXT_FIX(1,0.1,0.35,0,STRCAT('盈亏:(万)',CON2STR(盈亏,2))),COLORMAGENTA;
DRAWTEXT_FIX(1,0.22,0.35,0,STRCAT('获利比:(%)',CON2STR(获利,2))),COLORMAGENTA;
{DRAWTEXT_FIX(1,0.1,0.40,0,STRCAT('偏离度:)',CON2STR(偏离,2))),COLORCYAN;};
投股 票网 www.tou18 .cn
股市公式下载推荐