【求助老师】将“通达信”分时指标改写成“大智慧”的分时指标和选股公式

查看 64|回复 4
作者:lxhsw   
【求助老师帮忙:把“通达信”分时指标改写成“大智慧”的分时指标和选股公式】   
(以下是通达信分时主图指标源码)
[color=]{参数 N,最小1,最大100,缺省20}
X_1:=CLOSE;
X_2:=ZSTJJ;
X_3:=REF(CLOSE,1);
X_4:=SMA(MAX(CLOSE-X_3,0),14,1)/SMA(ABS(CLOSE-X_3),14,1)*100;
X_5:=CROSS(80,X_4);
X_6:=FILTER(X_5,40) AND CLOSE/X_2>1.03;
DRAWICON(X_6,REF(CLOSE*1.01,1),41);
X_7:=CROSS(X_4,20);
X_8:=FILTER(X_7,40) AND CLOSE/X_2
DRAWICON(X_8,CLOSE*0.997,38);
X_9:=CLOSE>REF(CLOSE,1) AND CLOSE/X_2>1+N/1000;
X_10:=CLOSE
X_11:=CROSS(SUM(X_9,0),0.5);
X_12:=CROSS(SUM(X_10,0),0.5);
X_13:=SUM(X_11,0)*CROSS(COUNT(CLOSE
X_14:=SUM(X_12,0)*CROSS(COUNT(CLOSE>REF(CLOSE,1),BARSLAST(X_12)),0.5);
X1:CONST(SUM(IF(X_13,REF(CLOSE,1),DRAWNULL),0)),DOTLINE,COLORYELLOW;
Z1:CONST(SUM(IF(X_14,REF(CLOSE,1),DRAWNULL),0)),DOTLINE,COLORGREEN;
X_15:=CROSS(SUM(X_9 AND CLOSE>X1*(1+2/100),0),0.5);
X_16:=CROSS(SUM(X_10 AND CLOSE
X_17:=SUM(X_15,0)*CROSS(COUNT(CLOSE
X_18:=SUM(X_16,0)*CROSS(COUNT(CLOSE>REF(CLOSE,1),BARSLAST(X_16)),0.5);
X2:CONST(SUM(IF(X_17,REF(CLOSE,1),DRAWNULL),0)),COLORYELLOW;
Z2:CONST(SUM(IF(X_18,REF(CLOSE,1),DRAWNULL),0)),COLORGREEN;
DRAWICON(X_14,REF(CLOSE*0.995,1),1);
DRAWICON(X_18,REF(CLOSE*0.995,1),34);
DRAWICON(X_13,REF(CLOSE*1.003,1),2);
DRAWICON(X_17,REF(CLOSE*1.002,1),35);
X_19:=CLOSE>REF(CLOSE,1) AND CLOSE>X_2*(1+3/100);
X_20:=CLOSE
X_21:=CROSS(SUM(X_19,0),0.5);
X_22:=CROSS(SUM(X_20,0),0.5);
X_23:=SUM(X_21,0)*CROSS(COUNT(CLOSE
X_24:=SUM(X_22,0)*CROSS(COUNT(CLOSE>REF(CLOSE,1),BARSLAST(X_22)),0.5);
X_25:=CONST(SUM(IF(X_23,REF(CLOSE,1),DRAWNULL),0));
X_26:=CONST(SUM(IF(X_24,REF(CLOSE,1),DRAWNULL),0));
X_27:=CROSS(SUM(X_19 AND CLOSE>X_25*(1+3/100),0),0.5);
X_28:=CROSS(SUM(X_20 AND CLOSE
X_29:=SUM(X_27,0)*CROSS(COUNT(CLOSE
X_30:=SUM(X_28,0)*CROSS(COUNT(CLOSE>REF(CLOSE,1),BARSLAST(X_28)),0.5);
DRAWICON(X_29,CLOSE*1.003,27);
DRAWICON(X_30,CLOSE*0.993,26);
【以下是通达信分时主图效果图】:(备注:大智慧图标比较少不能一一对应通达信的,可用其它图标或文字代替)
[img][/img]

指标, 大智慧

lxhsw
OP
  

有请老师帮帮忙啦
popoleaf   

我是小白,我问的chatgpt
结果如下
# 定义变量
CLOSE:MA(C,1);
ZSTJJ:=REF(CYFJ,1);
C_1:=CLOSE;
C_2:=ZSTJJ;
C_3:=REF(CLOSE,1);
C_4:=SMA(MAX(CLOSE-C_3,0),14,1)/SMA(ABS(CLOSE-C_3),14,1)*100;
C_5:=CROSS(80,C_4);
C_6:=FILTER(C_5,40) AND CLOSE/C_2>1.03;
# 选股条件1
COND1:=CROSS(C_4,20) AND REF(CLOSE,1)/C_2REF(CLOSE,1) AND CLOSE/C_2>1+N/1000;
C_10:=CLOSEREF(C,1),BARSLAST(C_12)),0.5);
# 选股条件3
C_19:=CLOSE>REF(CLOSE,1) AND CLOSE>C_2*(1+3/100);
C_20:=CLOSEREF(C,1),BARSLAST(C_22)),0.5);
# 选股结果
RESULT:=COND1 OR C_6 OR C_13 OR C_14 OR C_23 OR C_24;
popoleaf   

# 定义变量
CLOSE:MA(C,1);
ZSTJJ:=REF(CYFJ,1);
C_1:=CLOSE;
C_2:=ZSTJJ;
C_3:=REF(CLOSE,1);
C_4:=SMA(MAX(CLOSE-C_3,0),14,1)/SMA(ABS(CLOSE-C_3),14,1)*100;
C_5:=CROSS(80,C_4);
C_6:=FILTER(C_5,40) AND CLOSE/C_2>1.03;
# 选股条件1
COND1:=CROSS(C_4,20) AND REF(CLOSE,1)/C_2REF(CLOSE,1) AND CLOSE/C_2>1+N/1000;
C_10:=CLOSEREF(C,1),BARSLAST(C_12)),0.5);
# 选股条件3
C_19:=CLOSE>REF(CLOSE,1) AND CLOSE>C_2*(1+3/100);
C_20:=CLOSEREF(C,1),BARSLAST(C_22)),0.5);
# 选股结果
RESULT:=COND1 OR C_6 OR C_13 OR C_14 OR C_23 OR C_24;
wyx6171   


lxhsw 发表于 2023-4-17 19:00
有请老师帮帮忙啦

看了一下这个指标,准么?
这个指标你是拿来做T的对吧...修饰函数一大堆...
而且,这个指标的逻辑,就我这个水平,似懂非懂的...
我懒得给你理清思路了..你自己慢慢折腾吧...
主要原因就是大智慧没有 DRAWNULL 函数,
比较好的替代是PARTLINE函数...你自己度娘折腾吧...这个太麻烦了....
懒得给你弄,而且这个公式,你多各个涨幅的票...感觉很一般...
您需要登录后才可以回帖 登录 | 立即注册

返回顶部