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

请老师帮助根据源码编写选股公式

[通达信]
设置
1518 3 南山翁2007 Lv.4 发表于 · 2020-10-16 23:20 举报 显示全部楼层 复制 正序浏览 |
跳转到指定楼层
请老师根据下面源码做2个选股公式:1、当“庄家进场”大于0小于300时选股;2、“黑马级别”大于0小于3时选股;(具体形态可参考附图)

R1:=(CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2));
R2:=(REF(R1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R3:=(REF(R2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R4:=(REF(R3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R5:=(REF(R4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R6:=(REF(R5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R7:=(REF(R6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R8:=(REF(R7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R9:=(REF(R8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
RA:=(REF(R9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
RB:=(REF(RA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
RC:=(REF(RB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
RD:=(CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2));{WWW.55188.com}
RE:=(REF(RD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
RF:=(REF(RE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R10:=(REF(RF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R11:=(REF(R10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R12:=(REF(R11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R13:=(REF(R12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R14:=(REF(R13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R15:=(REF(R14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R16:=(REF(R15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R17:=(REF(R16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R18:=(REF(R17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R19:=REF(RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 OR R18,1) AND R1;
R1A:=((REF(R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,1)) AND RD);
绿底买入:=R19,NODRAW,COLOR00DD00;
棕底离场:=R1A,NODRAW,COLOR2288EE;
红底持股:=R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR
R8 OR R9 OR RA OR RB OR RC,NODRAW,COLOR0000FF;
灰底超跌:=(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*100<-14,COLORBBBBBB,NODRAW;Q1:=CONST(IF(绿底买入,0,IF(棕底离场,180,IF(红底持股,220,IF(灰底超跌,150,100))))),NODRAW;
Q2:=CONST(IF(绿底买入,150,IF(棕底离场,100,IF(红底持股,0,IF(灰底超跌,150,100))))),NODRAW;
Q3:=CONST(IF(绿底买入,0,IF(棕底离场,50,IF(红底持股,50,IF(灰底超跌,150,100))))),NODRAW;

{DRAWGBK(C>0,RGB(Q1,Q2,Q3),RGB(0,50,50),0,' ',0)};

{WWW.55188.com}
AAD:=1501230;
ZGD:=HHV(H,60);
ZGD2:=CONST(ZGD);
ZDD:=LLV(L,60);
ZDD2:=CONST(ZDD);
GJ:=(C+H+L+O)/4;
KOH:=L>REF(H,1);
KOL:=H<REF(L,1);
HIF:=L>REF(H,BARSLAST(KOH)+1);
NHIF:=L<=REF(H,BARSLAST(KOH)+1);
LIF:=H<REF(L,BARSLAST(KOL)+1);
NLIF:=H>=REF(L,BARSLAST(KOL)+1);
下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);
RRRSV:=SMA(下档线,3,1);
KKK:=SMA(RRRSV,3,1);{CC:EMA(MA(AA,4),2),COLORWHITE,LINETHICK2;}
AA:=1501230;
ZJCWL:=MA(WINNER(CLOSE*0.95),8);
RSV:=(((CLOSE - LLV(LOW,21))/(HHV(HIGH,21) - LLV(LOW,21)))*(100));
趋势:=(MA((3)*(SMA(RSV,6,1)) - (2)*(SMA(SMA(RSV,5,1),5,1)),2));
VAR1:=(3)*(SMA(((CLOSE - LLV(LOW,89))/(HHV(HIGH,89) - LLV(LOW,89)))*(100),20,1)) - (2)*(SMA(SMA(((CLOSE - LLV(LOW,89))/(HHV(HIGH,89) - LLV(LOW,89)))*(100),20,1),15,1));
VAR2:=(3)*(SMA(((OPEN - LLV(LOW,89))/(HHV(HIGH,89) - LLV(LOW,89)))*(100),20,1)) - (2)*(SMA(SMA(((OPEN - LLV(LOW,89))/(HHV(HIGH,89) - LLV(LOW,89)))*(100),20,1),15,1));
VAR3:=VAR2 - 100;
VAR4:=VAR1 - 100;
背离:=(FORCAST(((-1))*(VAR3),21));
HMGZT:=(BARSLAST((趋势 < 背离)));
黑马跟踪天数:=IF(DATE<=AA,HMGZT,0)  NODRAW ;
VAR5:=EMA(CLOSE,2)-EMA(CLOSE,90);
VAR6:=EMA(VAR5,100);
VAR7:=2*(VAR5-VAR6);
VAR8:=POW(VAR7,3)*0.1+POW(VAR7,1);
黑马线1:= IF(VAR7>0.1,VAR8,0)*200;SGLD:=黑马线1;
庄家进场:IF(DATE<=AA,SGLD,0),STICK, COLOR0055FF LINETHICK4 ;
STICKLINE(庄家进场,庄家进场,庄家进场,4,3),COLOR0000AA;  
STICKLINE(庄家进场,庄家进场,庄家进场/5,2,0),COLOR0022CC;     
STICKLINE(庄家进场,庄家进场*0.5,庄家进场/2.9,3,1),COLOR0055FF;
HMX:=SUM(黑马线1,1);
HMLDZ:=COUNT(黑马线1>0,90)/COUNT(黑马线1=0,90);
黑马值:=IF(DATE<=AA,HMLDZ,0),COLORLIBLUE  NODRAW;
ZH:=100*(C-REF(C,1))/REF(C,1);
KXKZZ:=COUNT(ZH>5,60);
黑马级别:IF(DATE<=AA  ,KXKZZ,0),COLORGREEN  NODRAW;
ZZGH:=100*(C-REF(C,1))/REF(C,1);
KXZZF:=COUNT(ZZGH>9,13)>=1;
涨停系数:=IF(DATE<=AA,KXZZF,0) COLORRED NODRAW;
KXZZ:=100-((COUNT(ZH<4,90)-COUNT(ZH>4,90)));
活跃度:IF(DATE<=AA  AND BARSCOUNT(C)>30,KXZZ,0) COLORLIGRAY  NODRAW;
获利:=WINNER(C)*100;
换手:=VOL/CAPITAL*100;
CMSDD1:=获利>90 AND 换手<3 , COLORYELLOW LINETHICK2;
开始锁仓:(CMSDD1)*SGLD*0.5,STICK  COLORYELLOW LINETHICK4;
DRAWTEXT(开始锁仓,开始锁仓,'锁'),COLORWHITE;
DRAWICON((CMSDD1)*SGLD/3,庄家进场,0), COLORYELLOW;
长短庄识别:COUNT(庄家进场>0,90),COLORCYAN NODRAW;
ZFFF:=(C-REF(C,120))/REF(C,120)*8;
中线资金流:=MA(ZFFF,11);
背离值:中线资金流-REF(中线资金流,20), NODRAW,COLORWHITE;
DDDDD:=((3 * RRRSV) - (2 * KKK));
JJ12:=(((CLOSE - LLV(LOW,55)) / (HHV(HIGH,55) - LLV(LOW,55))) * 100);
RSV24:=SMA(JJ12,3,1); K24:=SMA(RSV24,3,1);
D24:=((3 * RSV24) - (2 * K24));
压力2:=IF(CROSS(D24,DDDDD),HIGH,REF(HIGH,BARSLAST(CROSS(D24,DDDDD))));
底部:=LLV(HIGH,30),COLOR00FF00;
AAS:=REF(H,8)=HHV(H,2*8+1);  
AA1:=REF(L,8)=LLV(L,2*8+1);{CC:EMA(MA(AA,4),2),COLORWHITE,LINETHICK2;}
QY:=BACKSET(AAS,8+1);  
QY1:=BACKSET(AA1,8+1);
CC:=FILTER(QY,8) AND H=HHV(H,8+1);  
CC1:=FILTER(QY1,8) AND L=LLV(L,8+1);
DDD:=BARSLAST(CC);  
DD1:=BARSLAST(CC1);
GDTS:=IF(CC,CURRBARSCOUNT,0); {CC:EMA(MA(AA,4),2),COLORWHITE,LINETHICK2;}
DDTS:=IF(CC1,CURRBARSCOUNT,0);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);  
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
GDCS1:=CONST(DINGBUTS);  {WWW.55188.com}
DDCS1:=CONST(DDTS1);{CC:EMA(MA(AA,4),2),COLORWHITE,LINETHICK2;}
S13:=CONST(REF(HIGH,GDCS1-1));  
GDCS13:=IF(DATE<AAD,S13,0);
DDCS13:=CONST(REF(L,DDCS1-1));
DINGBUTS1:=REF(DINGBUTS,DDD+1);
S23:=CONST(REF(HIGH,DINGBUTS1-1));
支撑阻力间距值:ABS(S23-S13)*10,  NODRAW,COLORLIGREEN;
SZ:DRAWTEXT(ISLASTBAR=1 AND 活跃度>=38 ,20,'最活跃'),COLORRED;
SZ1:DRAWTEXT(ISLASTBAR=1 AND 活跃度<37.9 AND 活跃度>=30,20,'较活跃')COLORYELLOW;
SZ2:DRAWTEXT(ISLASTBAR=1 AND 活跃度<=29.9 AND 活跃度>=26 ,20,'活跃'),COLORGREEN;
Z3:DRAWTEXT(ISLASTBAR=1 AND 活跃度<=25.9 AND 活跃度>=24  ,20,'开始活跃'),COLORMAGENTA;
Z4:DRAWTEXT(ISLASTBAR=1 AND 活跃度<24 ,20,'不活跃'),COLORWHITE;

附件

QQ图片20201016231650.png

举报

扔鸡蛋(0) 回复

注册111
Lv.6
发表于 2020-10-17 13:26 复制 查看全部楼层
南山翁2007 发表于 2020-10-17 12:38
谢谢你的帮助!第二个选股不能选出创业板,能否修改一下连创业板也能选出来?谢谢!

能选出的。选股范围选择沪深a股。

附件

捕获.PNG

举报

扔鸡蛋(0) 回复

南山翁2007
Lv.4
发表于 2020-10-17 12:38 复制 查看全部楼层
本帖最后由 南山翁2007 于 2020-10-17 12:52 编辑
注册111 发表于 2020-10-17 07:55
1
VAR5:=EMA(CLOSE,2)-EMA(CLOSE,90);
VAR6:=EMA(VAR5,100);


谢谢你的帮助!第二个选股不能选出创业板,能否修改一下连创业板也能选出来?谢谢!

举报

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

注册111
Lv.6
发表于 2020-10-17 07:55 复制 查看全部楼层
本帖最后由 注册111 于 2020-10-17 07:58 编辑

1
VAR5:=EMA(CLOSE,2)-EMA(CLOSE,90);
VAR6:=EMA(VAR5,100);
VAR7:=2*(VAR5-VAR6);
VAR8:=POW(VAR7,3)*0.1+POW(VAR7,1);
黑马线1:=IF(VAR7>0.1,VAR8,0)*200;
BETWEEN(黑马线1,0.1,299.9);

2
ZH:=100*(C-REF(C,1))/REF(C,1);
KXKZZ:=COUNT(ZH>5,60);
BETWEEN(KXKZZ,0.1,2.99);
查看全部打赏
  • 南山翁2007+10理想币 +2共享币 : 理想精神:分享,互助,友善,传递正能量!

举报

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

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

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

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