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

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 通达信牛熊操盘源码


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

以下是通达信牛熊操盘源码

{公式名称: 牛熊操盘

无参数

公式类型: 技术指标公式-大势型

画线方法: 主图叠加

公式版本: 0

显示小数: 固定2位

坐标线位置: 自动

额外Y轴分界: 无

参数精灵:无

用法注释:无

公式源码:}

VAR1:=MA(CLOSE,18);

VAR2:=MA(CLOSE,72);

STICKLINE(CLOSE>=0,HIGH,LOW,0,0),COLORLIMAGENTA;

STICKLINE(CLOSE>=0 AND CLOSE>=OPEN,OPEN,CLOSE,(-1),1),COLORLIMAGENTA;

STICKLINE(CLOSE>=0 AND CLOSE<=OPEN,OPEN,CLOSE,(-1),0),COLORLIMAGENTA;

STICKLINE(CLOSE>VAR1 AND VAR1>REF(VAR1,1),HIGH,LOW,0,0),COLOR0000A8;

STICKLINE(CLOSE>VAR1 AND VAR1>REF(VAR1,1) AND CLOSE>=OPEN,OPEN,CLOSE,(-1),1),COLOR0000A8;

STICKLINE(CLOSE>VAR1 AND VAR1>REF(VAR1,1) AND CLOSE<=OPEN,OPEN,CLOSE,(-1),0),COLOR0000A8;

STICKLINE(CLOSE<VAR1 AND CLOSE>VAR2,HIGH,LOW,0,0),COLORFFFF80;

STICKLINE(CLOSE<VAR1 AND CLOSE>VAR2 AND CLOSE>=OPEN,OPEN,CLOSE,(-1),1),COLORFFFF80;

STICKLINE(CLOSE<VAR1 AND CLOSE>VAR2 AND CLOSE<=OPEN,OPEN,CLOSE,(-1),0),COLORFFFF80;

STICKLINE(CLOSE<VAR2,HIGH,LOW,0,0),COLOR804000;

STICKLINE(CLOSE<VAR2 AND CLOSE>=OPEN,OPEN,CLOSE,(-1),1),COLOR804000;

STICKLINE(CLOSE<VAR2 AND CLOSE<=OPEN,OPEN,CLOSE,(-1),0),COLOR804000;

STICKLINE(CLOSE>VAR1 AND VAR1<VAR2,HIGH,LOW,0,0),COLORGRAY;

STICKLINE(CLOSE>VAR1 AND VAR1<VAR2 AND CLOSE>=OPEN,OPEN,CLOSE,(-1),1),COLORGRAY;

STICKLINE(CLOSE>VAR1 AND VAR1<VAR2 AND CLOSE<=OPEN,OPEN,CLOSE,(-1),0),COLORGRAY;

VAR3:=NAMELIKE(8) OR NAMELIKE(9) OR NAMELIKE(10);

VAR4:=REF(CLOSE,1);

VAR5:=IF(1.05*VAR4-CLOSE<0.005,1,0) AND VAR3;

VAR6:=IF(1.1*VAR4-CLOSE<0.005,1,0);

VAR7:=VAR5 OR VAR6;

STICKLINE(VAR7,OPEN,CLOSE,(-1),0),COLORYELLOW;

STICKLINE(VAR7,HIGH,LOW,0,0),COLORYELLOW;

STICKLINE(VAR7,OPEN*1.005,CLOSE*0.995,1,(-1)),COLORYELLOW;

STICKLINE(CLOSE>=0 AND CLOSE>=OPEN AND VAR7,OPEN*1.006,CLOSE*0.994,0.8,0),COLORLIMAGENTA;

STICKLINE(CLOSE>=0 AND CLOSE<=OPEN AND VAR7,OPEN*0.994,CLOSE*1.006,0.8,0),COLORLIMAGENTA;

STICKLINE(CLOSE>VAR1 AND VAR1>REF(VAR1,1) AND CLOSE>=OPEN AND VAR7,OPEN*1.006,CLOSE*0.994,0.8,0),COLOR0000A8;

STICKLINE(CLOSE>VAR1 AND VAR1>REF(VAR1,1) AND CLOSE<=OPEN AND VAR7,OPEN*0.994,CLOSE*1.006,0.8,0),COLOR0000A8;

STICKLINE(CLOSE<VAR1 AND CLOSE>VAR2 AND CLOSE>=OPEN AND VAR7,OPEN*1.006,CLOSE*0.994,0.8,0),COLORFFFF80;

STICKLINE(CLOSE<VAR1 AND CLOSE>VAR2 AND CLOSE<=OPEN AND VAR7,OPEN*0.994,CLOSE*1.006,0.8,0),COLORFFFF80;

STICKLINE(CLOSE<VAR2 AND CLOSE>=OPEN AND VAR7,OPEN*1.006,CLOSE*0.994,0.8,0),COLOR804000;

STICKLINE(CLOSE<VAR2 AND CLOSE<=OPEN AND VAR7,OPEN*0.994,CLOSE*1.006,0.8,0),COLOR804000;

STICKLINE(CLOSE>VAR1 AND VAR1<VAR2 AND CLOSE>=OPEN AND VAR7,OPEN*1.006,CLOSE*0.994,0.8,0),COLORGRAY;

STICKLINE(CLOSE>VAR1 AND VAR1<VAR2 AND CLOSE<=OPEN AND VAR7,OPEN*0.994,CLOSE*1.006,0.8,0),COLORGRAY;

VAR8:=IF(CLOSE-0.95*VAR4<0.005,1,0) AND VAR3;

VAR9:=IF(CLOSE-0.9*VAR4<0.005,1,0);

VAR10:=VAR8 OR VAR9;

STICKLINE(VAR10,OPEN,CLOSE,(-1),0),COLORGREEN;

STICKLINE(VAR10,HIGH,LOW,0,1),COLORGREEN;

STICKLINE(VAR10,OPEN*0.995,CLOSE*1.005,1,(-1)),COLORGREEN;

STICKLINE(CLOSE>=0 AND CLOSE>=OPEN AND VAR10,OPEN*1.006,CLOSE*0.994,0.8,0),COLORLIMAGENTA;

STICKLINE(CLOSE>=0 AND CLOSE<=OPEN AND VAR10,OPEN*0.994,CLOSE*1.006,0.8,0),COLORLIMAGENTA;

STICKLINE(CLOSE>VAR1 AND VAR1>REF(VAR1,1) AND CLOSE>=OPEN AND VAR10,OPEN*1.006,CLOSE*0.994,0.8,0),COLOR0000A8;

STICKLINE(CLOSE>VAR1 AND VAR1>REF(VAR1,1) AND CLOSE<=OPEN AND VAR10,OPEN*0.994,CLOSE*1.006,0.8,0),COLOR0000A8;

STICKLINE(CLOSE<VAR1 AND CLOSE>VAR2 AND CLOSE>=OPEN AND VAR10,OPEN*1.006,CLOSE*0.994,0.8,0),COLORFFFF80;

STICKLINE(CLOSE<VAR1 AND CLOSE>VAR2 AND CLOSE<=OPEN AND VAR10,OPEN*0.994,CLOSE*1.006,0.8,0),COLORFFFF80;

STICKLINE(CLOSE<VAR2 AND CLOSE>=OPEN AND VAR10,OPEN*1.006,CLOSE*0.994,0.8,0),COLOR804000;

STICKLINE(CLOSE<VAR2 AND CLOSE<=OPEN AND VAR10,OPEN*0.994,CLOSE*1.006,0.8,0),COLOR804000;

STICKLINE(CLOSE>VAR1 AND VAR1<VAR2 AND CLOSE>=OPEN AND VAR10,OPEN*1.006,CLOSE*0.994,0.8,0),COLORGRAY;

STICKLINE(CLOSE>VAR1 AND VAR1<VAR2 AND CLOSE<=OPEN AND VAR10,OPEN*0.994,CLOSE*1.006,0.8,0),COLORGRAY;

VAR11:=IF((CLOSE-VAR4)*100/VAR4>=5-0.01*100/VAR4,1,0);

VAR12:=IF((CLOSE-VAR4)*100/VAR4<10-0.01*100/VAR4,1,0);

VAR13:=VAR11 AND VAR12 AND NOT(VAR3);

STICKLINE(VAR13,OPEN,CLOSE,(-1),0),COLOR006AD5;

STICKLINE(VAR13,HIGH,LOW,0,0),COLOR006AD5;

STICKLINE(VAR13 AND CLOSE>OPEN,OPEN*1.005,CLOSE*0.995,1,(-1)),COLOR006AD5;

STICKLINE(VAR13 AND CLOSE<OPEN,OPEN*0.995,CLOSE*1.005,1,(-1)),COLOR006AD5;

STICKLINE(CLOSE>=0 AND CLOSE>=OPEN AND VAR13,OPEN*1.006,CLOSE*0.994,0.8,0),COLORLIMAGENTA;

STICKLINE(CLOSE>=0 AND CLOSE<=OPEN AND VAR13,OPEN*0.994,CLOSE*1.006,0.8,0),COLORLIMAGENTA;

STICKLINE(CLOSE>VAR1 AND VAR1>REF(VAR1,1) AND CLOSE>=OPEN AND VAR13,OPEN*1.006,CLOSE*0.994,0.8,0),COLOR0000A8;

STICKLINE(CLOSE>VAR1 AND VAR1>REF(VAR1,1) AND CLOSE<=OPEN AND VAR13,OPEN*0.994,CLOSE*1.006,0.8,0),COLOR0000A8;

STICKLINE(CLOSE<VAR1 AND CLOSE>VAR2 AND CLOSE>=OPEN AND VAR13,OPEN*1.006,CLOSE*0.994,0.8,0),COLORFFFF80;

STICKLINE(CLOSE<VAR1 AND CLOSE>VAR2 AND CLOSE<=OPEN AND VAR13,OPEN*0.994,CLOSE*1.006,0.8,0),COLORFFFF80;

STICKLINE(CLOSE<VAR2 AND CLOSE>=OPEN AND VAR13,OPEN*1.006,CLOSE*0.994,0.8,0),COLOR804000;

STICKLINE(CLOSE<VAR2 AND CLOSE<=OPEN AND VAR13,OPEN*0.994,CLOSE*1.006,0.8,0),COLOR804000;

STICKLINE(CLOSE>VAR1 AND VAR1<VAR2 AND CLOSE>=OPEN AND VAR13,OPEN*1.006,CLOSE*0.994,0.8,0),COLORGRAY;

STICKLINE(CLOSE>VAR1 AND VAR1<VAR2 AND CLOSE<=OPEN AND VAR13,OPEN*0.994,CLOSE*1.006,0.8,0),COLORGRAY;

VAR14:=IF((VAR4-CLOSE)*100/VAR4>=5-0.01*100/CLOSE,1,0);

VAR15:=IF((VAR4-CLOSE)*100/VAR4<=10-0.01*100/CLOSE,1,0);

VAR16:=VAR14 AND VAR15 AND NOT(VAR3);

STICKLINE(VAR16,OPEN,CLOSE,(-1),0),COLOR008000;

STICKLINE(VAR16,HIGH,LOW,0,0),COLOR008000;

STICKLINE(VAR16 AND CLOSE<OPEN,OPEN*0.995,CLOSE*1.005,1,(-1)),COLOR008000;

STICKLINE(VAR16 AND CLOSE>OPEN,OPEN*1.005,CLOSE*0.995,1,(-1)),COLOR008000;

STICKLINE(CLOSE>=0 AND CLOSE>=OPEN AND VAR16,OPEN*1.006,CLOSE*0.994,0.8,0),COLORLIMAGENTA;

STICKLINE(CLOSE>=0 AND CLOSE<=OPEN AND VAR16,OPEN*0.994,CLOSE*1.006,0.8,0),COLORLIMAGENTA;

STICKLINE(CLOSE>VAR1 AND VAR1>REF(VAR1,1) AND CLOSE>=OPEN AND VAR16,OPEN*1.006,CLOSE*0.994,0.8,0),COLOR0000A8;

STICKLINE(CLOSE>VAR1 AND VAR1>REF(VAR1,1) AND CLOSE<=OPEN AND VAR16,OPEN*0.994,CLOSE*1.006,0.8,0),COLOR0000A8;

STICKLINE(CLOSE<VAR1 AND CLOSE>VAR2 AND CLOSE>=OPEN AND VAR16,OPEN*1.006,CLOSE*0.994,0.8,0),COLORFFFF80;

STICKLINE(CLOSE<VAR1 AND CLOSE>VAR2 AND CLOSE<=OPEN AND VAR16,OPEN*0.994,CLOSE*1.006,0.8,0),COLORFFFF80;

STICKLINE(CLOSE<VAR2 AND CLOSE>=OPEN AND VAR16,OPEN*1.006,CLOSE*0.994,0.8,0),COLOR804000;

STICKLINE(CLOSE<VAR2 AND CLOSE<=OPEN AND VAR16,OPEN*0.994,CLOSE*1.006,0.8,0),COLOR804000;

STICKLINE(CLOSE>VAR1 AND VAR1<VAR2 AND CLOSE>=OPEN AND VAR16,OPEN*1.006,CLOSE*0.994,0.8,0),COLORGRAY;

STICKLINE(CLOSE>VAR1 AND VAR1<VAR2 AND CLOSE<=OPEN AND VAR16,OPEN*0.994,CLOSE*1.006,0.8,0),COLORGRAY;

DRAWNUMBER(VAR13,HIGH*1.03,(CLOSE-VAR4)*100/VAR4)+11,COLORRED;

DRAWNUMBER(VAR16,LOW*0.97,(-(VAR4-CLOSE))*100/VAR4),COLORGREEN;






回复

举报

QQ|

GMT+8, 2024-11-27 16:29

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