赢利系数:=5;
止损系数:=10;
待仓天数:=5;
指数:INDEXC,NODRAW;
涨跌:INDEXC-REF(INDEXC,1),NODRAW;
买点:=自己的选股条件输出,COLORYELLOW;
买距:=BARSLAST(买点),NODRAW;
MM:=买距>0;
买价:=REF(C,买距)*MM,COLORYELLOW;
止赢价:=买价*(100+赢利系数)/100;
止损价:=买价*(100-止损系数)/100;
预卖:=H>止赢价 OR C<止损价 OR 买距=待仓天数 ;
预卖距:=BARSLAST(预卖),NODRAW;
盈利:= H>止赢价 AND REF(预卖距>=买距,1),COLORRED ,LINETHICK1;
亏损:=C<止损价 AND REF(预卖距>=买距,1),COLORGREEN ,LINETHICK1;
平仓:= 买距=待仓天数 AND REF(预卖距>=买距,1) ,LINETHICK1 ;
盈平仓:=平仓=1 AND C>买价,NODRAW;
亏平仓:=平仓=1 AND C<买价,NODRAW;
买统计:CONST(COUNT(买点,BARSCOUNT(买点))), COLORYELLOW,NODRAW;
盈统计:CONST(COUNT(盈利,BARSCOUNT(盈利))) ,COLORRED,NODRAW;
亏统计:CONST(COUNT(亏损,BARSCOUNT(亏损))) ,COLORGREEN,NODRAW;
平仓统计:CONST(COUNT(平仓,BARSCOUNT(平仓))),COLORWHITE,NODRAW;
盈平仓统计:CONST(COUNT(盈平仓,BARSCOUNT(盈平仓))) ,COLORRED, LINETHICK1,NODRAW;
亏平仓统计:CONST(COUNT(亏平仓,BARSCOUNT(亏平仓))) ,COLORGREEN, LINETHICK1,NODRAW;
选股次数:买统计 ,COLORRED, LINETHICK1,NODRAW;
成功次数:盈平仓统计+ 盈统计 ,COLORRED, LINETHICK1,NODRAW;
成功率:(成功次数/买统计)*100, ,COLORRED, LINETHICK1,NODRAW;
DRAWICON(买点=1,5,1);
STICKLINE(买点,7,50,1,0),COLORYELLOW,LINETHICK1;
STICKLINE(盈利,25,50,1,0),COLORRED,LINETHICK1;
STICKLINE(亏损,30,50,1,0),COLORGREEN,LINETHICK1;
STICKLINE(平仓,7,40,1,0),COLORWHITE,LINETHICK1;
TDXSTEP101:DRAWTEXT(买点,30,’←买’),COLORYELLOW;
TDXSTEP102:DRAWTEXT(盈利,35,’←盈’),COLORRED;
TDXSTEP103:DRAWTEXT(亏损,15,’←亏’),COLORGREEN;
TDXSTEP104:DRAWTEXT(盈平仓,25,’←盈平’),COLORWHITE;
TDXSTEP105:DRAWTEXT(亏平仓,20,’←亏平’),COLORWHITE;
DRAWICON(买点=1,6,25);
STICKLINE(买点,0,50,1,0),COLORYELLOW,LINETHICK1;
STICKLINE(盈利,0,50,1,0),COLORRED,LINETHICK1;
STICKLINE(亏损,0,50,1,0),COLORGREEN,LINETHICK1;
STICKLINE(平仓,0,50,1,0),COLORWHITE,LINETHICK1;
TDXSTEP101:DRAWTEXT(买点,30,’买’),COLORYELLOW;
TDXSTEP102:DRAWTEXT(盈利,35,’盈’),COLORRED;
TDXSTEP103:DRAWTEXT(亏损,25,’亏’),COLORGREEN;
TDXSTEP104:DRAWTEXT(平仓,30,’平’),COLORWHITE;
document.body.oncopy = function ()
{{ setTimeout( function () { var text = clipboardData.getData(“text”);
if (text) { text = text + “{公式网分享:”+location.href+”}”; clipboardData.setData(“text”, text); } }, 100 ) }}
$(“loadlist”).style.display=”none”;
上一篇:通达信小阳过近顶(通过源码副图 贴图) 下一篇:通达信两仪四象提供源码附图
评论(0)