通达信对应大盘K线源码公式

[复制链接]
查看40 | 回复0 | 2022-7-24 07:39:12 | 显示全部楼层 |阅读模式

{通达信对应大盘K线-BY 舍得快乐}
{自填参数:
P1(0,300,5),P2(0,300,10),P3(0,300,20),P4(0,300,30),P5(0,999,60),P6(0,999,120),P7(0,999,240),P8(0,999,360),N(0,8,4);};
{用法:请在A股基金下使用,指数和其它品种不显示数据。基金、中小、创业、沪、深大盘分显,均线采取飞狐的源码8条均线可调显示根数(N),N为0不显示均线}
创业板:=INBLOCK('创业板'),NODRAW;
中小企业:=INBLOCK('中小企业'),NODRAW;
上证A股:=INBLOCK('上证A股'),NODRAW;
深证A股:=INBLOCK('深证A股'),NODRAW;
交易所基金:=INBLOCK('交易所基金'),NODRAW;
开:IF(中小企业=1,"399101$O",IF(创业板=1,"399102$O",IF(上证A股=1,"999999$O",IF(深证A股=1,"399001$O",IF(交易所基金=1,"399305$O",0))))),NODRAW;
高:IF(中小企业=1,"399101$H",IF(创业板=1,"399102$H",IF(上证A股=1,"999999$H",IF(深证A股=1,"399001$H",IF(交易所基金=1,"399305$H",0))))),NODRAW;
低:IF(中小企业=1,"399101$L",IF(创业板=1,"399102$L",IF(上证A股=1,"999999$L",IF(深证A股=1,"399001$L",IF(交易所基金=1,"399305$L",0))))),NODRAW;
收:IF(中小企业=1,"399101$C",IF(创业板=1,"399102$C",IF(上证A股=1,"999999$C",IF(深证A股=1,"399001$C",IF(交易所基金=1,"399305$C",0))))),NODRAW;
DRAWTEXT(CURRBARSCOUNT=100,CONST(LLV(低,100))*1.03,'创幻论坛の舍得快乐'),COLORFFFFCC;
DRAWKLINE(高,开,低,收);
WX:=MA(C,0);
M1:MA(收,P1)*IF(N<1,WX,1);
M2:MA(收,P2)*IF(N<2,WX,1);
M3:MA(收,P3)*IF(N<3,WX,1);
M4:MA(收,P4)*IF(N<4,WX,1);
M5:MA(收,P5)*IF(N<5,WX,1);
M6:MA(收,P6)*IF(N<6,WX,1);
M7:MA(收,P7)*IF(N<7,WX,1);
M8:MA(收,P8)*IF(N<8,WX,1);
 

83466791.jpg

83466791.jpg

回复

使用道具 举报

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

本版积分规则