通达信盈利统计指标公式
2020/12/8 18:20:48
{使用说明:可以自行设置,止损止盈平仓条件,将选股条件替换为设置为自己选股指标的输出条件即可,加入指数显示,可以直观显示当日信号输出时的指数涨跌。}
选股条件:=CROSS(MA(C,10),MA(C,20));
赢利系数:10,NODRAW;
止损系数:10,NODRAW;
待仓天数:20,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;
看 股吧公式 www.kan guba.com
其它股票公式列表