通达信波段买卖分析主图指标

[复制链接]
查看90 | 回复0 | 2021-8-20 20:08:59 | 显示全部楼层 |阅读模式

以下是通达信波段买卖分析主图指标(无源码的请下载附件导入)

MB1:=EMA(WINNER(C)*100,5);
 MB2:=EMA(MB1,2);
 MB3:=EMA(MB2,2);
 MB4:=EMA(MB3,2);
 N:=5;
 VAR2:=MB1;
 VAR3:=DRAWLINE(VAR2>=HHV(VAR2,N)=1,VAR2,VAR2<=LLV(VAR2,N)=1,VAR2,0);
顶:=IF(VAR2=VAR3,VAR2,DRAWNULL);
 XG:=REF(VAR2,1)=REF(VAR3,1) AND VAR2>REF(VAR2,1);

买入条件:=TFILTER(XG,顶,1);
卖出条件:=TFILTER(顶,XG,0);

买入价:=IF(买入条件,C,DRAWNULL);
卖出价:=IF(卖出条件,C,DRAWNULL);

DRAWICON(买入条件,L*0.98,1);
 DRAWICON(卖出条件,H*1.02,2);

DRAWNUMBER(买入条件,L*0.96,买入价),COLORRED;
 DRAWNUMBER(卖出条件,H*1.04,卖出价),COLORGREEN;
 DRAWNUMBER(卖出条件,H*1.06,(C/REF(C,BARSLAST(买入条件))-1)*100),COLORYELLOW;

成交收益:=IF(卖出条件,(C/REF(C,BARSLAST(买入条件))-1)*100*0.994,DRAWNULL);
年收益:=SUM(成交收益,250);
年成交数:=IF(ISLASTBAR,SUM(卖出条件,250),DRAWNULL);
 DRAWTEXT_FIX(ISLASTBAR,0.00,0.00,0,STRCAT('年交易次数: ',CON2STR(年成交数,0))),COLORLIRED;
 DRAWTEXT_FIX(ISLASTBAR,0.00,0.05,0,STRCAT('年交易收益: ',CON2STR(年收益,2))),COLORLIRED;

DRAWTEXT_FIX(说明=1,0.00,0.10,0,'红箭头是买入信号,红数字是买入参考价'),COLORRED;
 DRAWTEXT_FIX(说明=1,0.00,0.15,0,'绿箭头是卖出信号,绿数字是卖出参考价'),COLORGREEN;
 DRAWTEXT_FIX(说明=1,0.00,0.20,0,'黄色数字是盈亏百分比'),COLORYELLOW;

637333553.jpg

637333553.jpg

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则