股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

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


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2023-10-9 11:02:30

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

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;





回复

举报

QQ|

GMT+8, 2024-11-17 22:17

快速回复 返回顶部 返回列表