买入价:=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;};
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
评论(0)