通达信波段效益指标公式

买入价:=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;};




来函数检测结果如下:
该公式没有未来函数

解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式

联系我们  |  股票指标网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 粤ICP备2023063687号-2 股票指标网别名指标网仅为互联网文章,所有股票指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。股票指标网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图