手机版
官方微信
扫描关注:理想财富微信公众号
理想论坛App
扫描下载理想论坛App
RSS

请老师帮助编写个选股公式

[通达信]
设置
1121 6 刘写乐乐 Lv.3 发表于 · 2020-10-16 21:31 举报 显示全部楼层 复制 正序浏览 |
跳转到指定楼层
麻烦老师帮写个选股公式,条件是;1、收盘时候底部出现黄色;2、收盘价大于前三天的实体最高价(前三天中若是上涨红K线,则是收盘价,若是下跌绿K线则是开盘价)。谢谢

源码如下:

VAR1:=C>REF(C,1)AND C>REF(C,2);
VAR2:=REF(VAR1,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR3:=REF(VAR2,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR4:=REF(VAR3,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR5:=REF(VAR4,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR6:=REF(VAR5,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR7:=REF(VAR6,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR8:=REF(VAR7,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR9:=REF(VAR8,1)AND C>=REF(C,1)AND C<=REF(C,2);
VARA:=REF(VAR9,1)AND C<=REF(C,1)AND C>=REF(C,2);
VARB:=REF(VARA,1)AND C>=REF(C,1)AND C<=REF(C,2);
VARC:=REF(VARB,1)AND C<=REF(C,1)AND C>=REF(C,2);
VARD:=C<REF(C,1)AND C<REF(C,2);
VARE:=REF(VARD,1)AND C>=REF(C,1)AND C<=REF(C,2);
VARF:=REF(VARE,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR10:=REF(VARF,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR11:=REF(VAR10,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR12:=REF(VAR11,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR13:=REF(VAR12,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR14:=REF(VAR13,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR15:=REF(VAR14,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR16:=REF(VAR15,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR17:=REF(VAR16,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR18:=REF(VAR17,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR19:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR
VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND VAR1;
VAR1A:=REF(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR
VAR8 OR VAR9 OR VARA OR VARB OR VARC,1) AND VARD;
BTSTS:=BARSLAST(VAR19);{WWW.HJCFW.COM}
红:=VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR
VAR8 OR VAR9 OR VARA OR VARB OR VARC;
STICKLINE(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR
VAR8 OR VAR9 OR VARA OR VARB OR VARC,C,REF(C,1),2,1)COLORRED;{红1}
STICKLINE(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR
VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,C,REF(C,1),2.1,0)COLORCYAN;{青色}
STICKLINE(VAR19,REF(C,1),REF(C,2),2.1,1),COLORYELLOW;{黄色}
STICKLINE(VAR1A,REF(C,1),REF(C,2),2.1,2)COLORCYAN;{青色}
STICKLINE(VAR19,REF(C,1),REF(C,2),2.1,0),COLORYELLOW;{黄色}
STICKLINE(VAR1A,REF(H,1),REF(C,2),2.1,0)COLORBLUE;{蓝色};
STICKLINE(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR
VAR8 OR VAR9 OR VARA OR VARB OR VARC AND
(C/REF(C,1)>1.0985 AND C=H),C,REF(C,1),1,0)COLORMAGENTA;{板红1};


附件

QQ图片20201016212928.png

举报

扔鸡蛋(0) 回复

许昌舍得
Lv.6
发表于 2020-10-22 06:21 复制 查看全部楼层
本帖最后由 许昌舍得 于 2020-10-22 06:28 编辑
刘写乐乐 发表于 2020-10-22 01:04
公式有错误,麻烦老师帮修改一下,谢谢

当前公式 : 分时MACD (画线指标公式)  


供参考自定义NEW条件


NEW:=C;

DIFF:EMA(NEW,5) - EMA(NEW,21);
DIF:EMA(DIFF,5);
DEA:EMA(DIF,5);
ZERO:0;

DRAWBAND(DIF>=REF(DIF,1),RGB(255,0,0),DIF<=REF(DIF,1),RGB(0,255,0));
DRAWBAND(DEA>=REF(DEA,1),RGB(255,0,255),DEA<=REF(DEA,1),RGB(0,255,255));


MB:=DEA-REF(DEA,1);

A1:=BARSLAST(REF(CROSS(MB,0),1));
B1:=REF(NEW,A1+1)>NEW AND REF(DEA,A1+1)<DEA AND CROSS(MB,0) AND DIFF<0;
DRAWTEXT(IF(B1>0,1,0),DEA,'MACD底背'),COLORCYAN;
C1:=BARSLAST(REF(CROSS(0,MB),1));
D1:=REF(NEW,C1+1)<NEW AND REF(DEA,C1+1)>DEA AND CROSS(0,MB) AND DIFF>0;
DRAWTEXT(IF(D1>0,1,0),DEA,'MACD顶背'),COLORMAGENTA;


LC:=REF(NEW,1);
WRSI:=SMA(MAX(NEW-LC,0),9,1)/SMA(ABS(NEW-LC),9,1)*100;
BB:IF(CROSS(20,WRSI),BUYVOL,DRAWNULL),NODRAW;
SS:IF(CROSS(WRSI,80),SELLVOL,DRAWNULL),NODRAW;

附件

tdxjietu1.JPG

举报

点亮(0) 扔鸡蛋(0) 回复

刘写乐乐
Lv.3
发表于 2020-10-22 01:04 复制 查看全部楼层
许昌舍得 发表于 2020-10-19 08:37
VAR1:=C>REF(C,1)AND C>REF(C,2);
VAR2:=REF(VAR1,1)AND C=REF(C,2);
VAR3:=REF(VAR2,1)AND C>=REF(C,1 ...

公式有错误,麻烦老师帮修改一下,谢谢

当前公式 : 分时MACD (画线指标公式)  
错误句 : DIFF:=EMA(NEW,5) - EMA(NEW,21)
详细信息 : 未知字符串 NEW
错误起始位置 : 10 ; 长度: 3

源码如下:

DIFF:=EMA(NEW,5) - EMA(NEW,21);
DIF:=EMA(DIFF,5);
DEA:=EMA(DIF,5);
ZERO:0;

PARTLINE(DIF,DIF>=REF(DIF,1),RGB(255,0,0),DIF<=REF(DIF,1),RGB(0,255,0));
PARTLINE(DEA,DEA>=REF(DEA,1),RGB(255,0,255),DEA<=REF(DEA,1),RGB(0,255,255));


MB:=DEA-REF(DEA,1);

A1:=BARSLAST(REF(CROSS(MB,0),1));
B1:=REF(NEW,A1+1)>NEW AND REF(DEA,A1+1)<DEA AND CROSS(MB,0) AND DIFF<0;
DRAWTEXT(IF(B1>0,1,0),DEA,'MACD底背'),COLORCYAN;
C1:=BARSLAST(REF(CROSS(0,MB),1));
D1:=REF(NEW,C1+1)<NEW AND REF(DEA,C1+1)>DEA AND CROSS(0,MB) AND DIFF>0;
DRAWTEXT(IF(D1>0,1,0),DEA,'MACD顶背'),COLORMAGENTA;


LC=REF(NEW,1);
WRSI=SMA(MAX(NEW-LC,0),9,1)/SMA(ABS(NEW-LC),9,1)*100;
IF (CROSS(20,WRSI))
BUY;
IF (CROSS(WRSI,80))
SELL;

举报

点亮(0) 扔鸡蛋(0) 回复

刘写乐乐
Lv.3
发表于 2020-10-19 19:49 复制 查看全部楼层
许昌舍得 发表于 2020-10-19 08:37
VAR1:=C>REF(C,1)AND C>REF(C,2);
VAR2:=REF(VAR1,1)AND C=REF(C,2);
VAR3:=REF(VAR2,1)AND C>=REF(C,1 ...

预警不出票啊

举报

扔鸡蛋(0) 回复

许昌舍得
Lv.6
发表于 2020-10-19 08:37 复制 查看全部楼层
刘写乐乐 发表于 2020-10-18 22:37
麻烦老师将上面的选股公式和下面这个选股公式合并成一个能选股预警的公式。谢谢

源码:

VAR1:=C>REF(C,1)AND C>REF(C,2);
VAR2:=REF(VAR1,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR3:=REF(VAR2,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR4:=REF(VAR3,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR5:=REF(VAR4,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR6:=REF(VAR5,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR7:=REF(VAR6,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR8:=REF(VAR7,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR9:=REF(VAR8,1)AND C>=REF(C,1)AND C<=REF(C,2);
VARA:=REF(VAR9,1)AND C<=REF(C,1)AND C>=REF(C,2);
VARB:=REF(VARA,1)AND C>=REF(C,1)AND C<=REF(C,2);
VARC:=REF(VARB,1)AND C<=REF(C,1)AND C>=REF(C,2);
VARD:=C<REF(C,1)AND C<REF(C,2);
VARE:=REF(VARD,1)AND C>=REF(C,1)AND C<=REF(C,2);
VARF:=REF(VARE,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR10:=REF(VARF,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR11:=REF(VAR10,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR12:=REF(VAR11,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR13:=REF(VAR12,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR14:=REF(VAR13,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR15:=REF(VAR14,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR16:=REF(VAR15,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR17:=REF(VAR16,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR18:=REF(VAR17,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR19:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR
VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND VAR1;

区间天数:=21;

标记线:=REF(MAX(OPEN,CLOSE),BARSLAST(BACKSET(BARSTATUS=2,REF(HHVBARS(VOL,区间天数),1)+2) AND REF(BACKSET(BARSTATUS=2,REF(HHVBARS(VOL,区间天数),1)+2),1)=0));
突破:=CLOSE>标记线 AND REF(CLOSE<=标记线,1);
ST1:=IF(NAMELIKE('*'),1,0);
ST2:=IF(NAMELIKE('S'),1,0);
去停牌:=DYNAINFO(4)>0;
TJ2:=(突破) AND ST1=0 AND ST2=0 AND 去停牌;
TJ1:=VAR19 AND C>REF(HHV(MAX(C,O),3),1);

XG:TJ1 AND TJ2;

举报

点亮(0) 扔鸡蛋(0) 回复

刘写乐乐
Lv.3
发表于 2020-10-18 22:37 复制 查看全部楼层
许昌舍得 发表于 2020-10-16 21:48
VAR1:=C>REF(C,1)AND C>REF(C,2);
VAR2:=REF(VAR1,1)AND C=REF(C,2);
VAR3:=REF(VAR2,1)AND C>=REF(C,1 ...

麻烦老师将上面的选股公式和下面这个选股公式合并成一个能选股预警的公式。谢谢

源码:

参数;区间天数:1、200、21

标记线:=REF(MAX(OPEN,CLOSE),BARSLAST(BACKSET(BARSTATUS=2,REF(HHVBARS(VOL,区间天数),1)+2) AND REF(BACKSET(BARSTATUS=2,REF(HHVBARS(VOL,区间天数),1)+2),1)=0));
突破:=CLOSE>标记线 AND REF(CLOSE<=标记线,1);
ST1:=IF(NAMELIKE('*'),1,0);
ST2:=IF(NAMELIKE('S'),1,0);
去停牌:=DYNAINFO(4)>0;
(突破) AND ST1=0 AND ST2=0 AND 去停牌;

举报

点亮(0) 扔鸡蛋(0) 回复

许昌舍得
Lv.6
发表于 2020-10-16 21:48 复制 查看全部楼层
VAR1:=C>REF(C,1)AND C>REF(C,2);
VAR2:=REF(VAR1,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR3:=REF(VAR2,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR4:=REF(VAR3,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR5:=REF(VAR4,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR6:=REF(VAR5,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR7:=REF(VAR6,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR8:=REF(VAR7,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR9:=REF(VAR8,1)AND C>=REF(C,1)AND C<=REF(C,2);
VARA:=REF(VAR9,1)AND C<=REF(C,1)AND C>=REF(C,2);
VARB:=REF(VARA,1)AND C>=REF(C,1)AND C<=REF(C,2);
VARC:=REF(VARB,1)AND C<=REF(C,1)AND C>=REF(C,2);
VARD:=C<REF(C,1)AND C<REF(C,2);
VARE:=REF(VARD,1)AND C>=REF(C,1)AND C<=REF(C,2);
VARF:=REF(VARE,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR10:=REF(VARF,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR11:=REF(VAR10,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR12:=REF(VAR11,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR13:=REF(VAR12,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR14:=REF(VAR13,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR15:=REF(VAR14,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR16:=REF(VAR15,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR17:=REF(VAR16,1)AND C<=REF(C,1)AND C>=REF(C,2);
VAR18:=REF(VAR17,1)AND C>=REF(C,1)AND C<=REF(C,2);
VAR19:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR
VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND VAR1;


TJ:VAR19 AND C>REF(HHV(MAX(C,O),3),1);
查看全部打赏
  • 刘写乐乐+20理想币 : 很给力,投资愉快,理想因你而精彩;

举报

扔鸡蛋(0) 回复

您需要登录后才可以回帖 登录

本版积分规则 《理想财富服务协议》《免责声明》

论坛问题
微信扫一扫,添加好友咨询
驿站问题
微信扫一扫,添加好友咨询
广告投放
微信扫一扫,添加好友咨询
回顶部 到页底
快速回复 返回顶部 返回列表