登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

来生缘

上邪!我欲与君相知长命无绝衰.山无陵江水为竭,冬雷震震夏雨雪,天地合,乃敢与君绝

 
 
 

日志

 
 

通达信选股公式集合+选股公式改写方法  

2012-02-08 18:05:52|  分类: 蝶入梦中 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

  通达信选股公式集合+选股公式改写方法 
一、选股公式编辑注意事项
   1、只是用来缩小分析范围的工具。
   公式中如出现:(( 为:和((          公式中如出现:D 为:和D
   2、在选股公式中只允许有一条输出语句,因此在改之前要把所有的STICKLINE语句、DARWICON语句及DARWTEXT语句全部删除。
   3、再把所有的画线语句如该公式中的“指导线:EMA((EMA(CLOSE,4)+EMA(CLOSE,6)+EMA(CLOSE,12)+EMA(CLOSE,24))/4,2),,COLORFFFFFF;”要加上“=”号即改成:“指导线:=EMA((EMA(CLOSE,4)+EMA(CLOSE,6)+EMA(CLOSE,12)+EMA(CLOSE,24))/4,2),,COLORFFFFFF; ”。
    4、最后仅保留所需要的选股语句,如该公式中的“B买:IF(CROSS(指导线,界) OR CROSS(买线,卖线),C,DRAWNULL),COLORMAGENTA,NODRAW;”但这条语句是一个选择语句要改一下,变成:“B买:(CROSS(指导线,界) OR CROSS(买线,卖线);”就是说仅留下这个语句中的条件部分就可以了。整个公式就成了如下的样子:
买线:=EMA(C,2); 
卖线:=EMA(SLOPE(C,21)*20+C,42); 
指导线:=EMA((EMA(CLOSE,4)+EMA(CLOSE,6)+EMA(CLOSE,12)+EMA(CLOSE,24))/4,2),,COLORFFFFFF; 
界:=MA(CLOSE,27),COLOR00FFFF; 
B买:CROSS(指导线,界) OR CROSS(买线,卖线);
 
二、图标、字、颜色的选股公式改写方法
     在通达信中是允许系统图标、写字、if、单独条件等语句作为选股或者预警指标的,如:笑脸、带颜色的竖杠、《买》字等在满足某个或几个条件后,按要求显示。因此通达信中按下面处理即可,如果其他软件不允许图标、写字类做选股指标,可参考第二条,只拿出条件和其相关语句即可:
1、一般笑脸、系统图标格式:(自己将符合下面条件的语句及DRAWICON语句挑出来作为选股公式,加入条件选股指标,可作为预警、选股用)
DRAWICON(条件,位置,图标编号);
例如:(条件选股或预警只能有一个条件,因此在DRAWICON语句前的所有都以赋值形式即加了英文=)
CSAR:=SAR(10,2,20);
持股:=IF(CSAR<=L,CSAR,0);
涅磐:=EMA(SLOPE(C,21)*20+C,42);
宝瓶:=EMA(C,2.5);
般若:=EMA(C,5);
菩提:=XMA(H,20);
开悟:=IF(般若>=REF(般若,1),般若,DRAWNULL);
DRAWICON(CROSS(L,CSAR) AND 开悟>0  AND H<菩提 AND 持股>0 AND H>涅磐,(LOW * 0.93),5); 
2、带色的竖杠一般是STICKLINE语句,其构成如下:(我们需要提取括号中和条件相关的语句,并只单独列出条件即可)
STICKLINE(条件,位置1,位置2,线宽,线型),颜色;
还以上面指标为例:
A:修改前:
CSAR:=SAR(10,2,20);
持股:=IF(CSAR<=L,CSAR,0);
涅磐:=EMA(SLOPE(C,21)*20+C,42);
宝瓶:=EMA(C,2.5);
般若:=EMA(C,5);
菩提:=XMA(H,20);
开悟:=IF(般若>=REF(般若,1),般若,DRAWNULL);
STICKLINE(CROSS(L,CSAR) AND 开悟>0  AND H<菩提 AND 持股>0 AND H>涅磐,CLOSE,LOW * 0.93,5,0),COLORRED; 
B:修改后:(仅留下和条件相关的语句及条件,其余去掉即可)
CSAR:=SAR(10,2,20);
持股:=IF(CSAR<=L,CSAR,0);
涅磐:=EMA(SLOPE(C,21)*20+C,42);
宝瓶:=EMA(C,2.5);
般若:=EMA(C,5);
菩提:=XMA(H,20);
开悟:=IF(般若>=REF(般若,1),般若,DRAWNULL);
CROSS(L,CSAR) AND 开悟>0  AND H<菩提 AND 持股>0 AND H>涅磐; 
3、《买》字等非系统图标一般以DRAWTEXT语句表述,其格式为:
DRAWTEXT(条件,位置,'字或者图形'),颜色;
继续以上面指标为例:(仅留下和条件相关的语句及条件即可,如软件不支持DRAWTEXT语句选股,参考上面2列出单一条件即可) 
CSAR:=SAR(10,2,20);
持股:=IF(CSAR<=L,CSAR,0);
涅磐:=EMA(SLOPE(C,21)*20+C,42);
宝瓶:=EMA(C,2.5);
般若:=EMA(C,5);
菩提:=XMA(H,20);
开悟:=IF(般若>=REF(般若,1),般若,DRAWNULL);
DRAWTEXT(CROSS(L,CSAR) AND 开悟>0  AND H<菩提 AND 持股>0 AND H>涅磐,LOW * 0.93,'切一块肉'),COLORRED;
三、公式只是工具,出现以下含有未来函数的公式,大家可仅作参考
ZIG
PEAK
PEAKBARS
TROUGH
TROUGHBARS
FLATZIG
FLATZIGA
PEAKA
PEAKBARSA
TROUGHA
ZIGA
FFT
BACKSET
WINNER
LWINNER
COST
 
短线追涨
GJTJ1:=100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5));
GJTJ2:=100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10));
GJTJ3:=100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20));
GJTJ4:=100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30));
A:=BARSLAST(CROSS(97,GJTJ1))<=1 AND BARSLAST(CROSS(GJTJ1,85))<=1;
B:=BARSLAST(CROSS(97,GJTJ2))<=1 AND BARSLAST(CROSS(GJTJ2,85))<=1;
A1:=A AND B;
AA:=BARSLAST(CROSS(97,GJTJ1))<=2 AND BARSLAST(CROSS(GJTJ1,85))<=1;
BA:=BARSLAST(CROSS(97,GJTJ2))<=2 AND BARSLAST(CROSS(GJTJ2,85))<=1;
A2:=AA AND BA ;
AAA:=BARSLAST(CROSS(97,GJTJ1))<=3 AND BARSLAST(CROSS(GJTJ1,85))<=1;
BAA:=BARSLAST(CROSS(97,GJTJ2))<=3 AND BARSLAST(CROSS(GJTJ2,85))<=1;
A3:=AAA AND BAA ;
B1:=REF(A1,1);
B2:=REF(A2,1);
B3:=REF(A3,1);
D1:=GJTJ1=100 AND GJTJ2=100  AND A1;
D2:=GJTJ1=100 AND GJTJ2=100  AND A2;
D3:=GJTJ1=100 AND GJTJ2=100  AND A3;
ENTERLONG: D1 OR D2 OR D3;
 
白金点灯
GJTJ1:=100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5));
GJTJ2:=100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10));
GJTJ3:=100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20));
GJTJ4:=100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30));
A:=BARSLAST(CROSS(30,GJTJ1))<2 AND BARSLAST(CROSS(GJTJ1,50))<2;
B:=BARSLAST(CROSS(GJTJ4,GJTJ1))<2 AND GJTJ1>GJTJ4;
E:=GJTJ1>60 AND GJTJ4>70;
ENTERLONG:A AND B  AND E;
 
黄金点灯
GJTJ1:=100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5));
GJTJ2:=100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10));
GJTJ3:=100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20));
GJTJ4:=100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30));
A:=BARSLAST(CROSS(50,GJTJ1))<3 AND BARSLAST(CROSS(GJTJ1,50))<3;
B:=BARSLAST(CROSS(GJTJ4,GJTJ1))<2 AND GJTJ1>GJTJ4;
ENTERLONG:A AND B;
 
起涨首日
GJTJ1:=100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5));
GJTJ2:=100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10));
GJTJ3:=100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20));
GJTJ4:=100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30));
A:=BARSLAST(CROSS(95,GJTJ1))<=2;
B:=BARSLAST(CROSS(95,GJTJ2))<=2;
E:= GJTJ4<GJTJ1 AND GJTJ1<GJTJ2 AND GJTJ1<GJTJ3;
F:=GJTJ2>50 AND GJTJ3>50;
G:=GJTJ1=100 AND GJTJ2=100;
TX:=COUNT(G,2)=1;
ENTERLONG:A AND B AND E AND F AND TX;
 
波启前兆
GJTJ1:=100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5));
GJTJ2:=100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10));
GJTJ3:=100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20));
GJTJ4:=100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30));
A:=GJTJ3=100;
B:=GJTJ4<90;
ENTERLONG:COUNT(A,2) = 2 AND B;
 
黄金三角
GJTJ1:=100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5));
GJTJ2:=100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10));
GJTJ3:=100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20));
GJTJ4:=100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30));
BAIJIN1:=BARSLAST(CROSS(30,GJTJ1))<2 AND BARSLAST(CROSS(GJTJ1,50))<2;
BAIJIN2:=BARSLAST(CROSS(GJTJ4,GJTJ1))<2 AND GJTJ1>GJTJ4;
BAIJIN3:=GJTJ1>60 AND GJTJ4>70;
M1:=BAIJIN1 AND BAIJIN2 AND BAIJIN3;
HUANGJIN1:=BARSLAST(CROSS(50,GJTJ1))<3 AND BARSLAST(CROSS(GJTJ1,50))<3;
HUANGJIN2:=BARSLAST(CROSS(GJTJ4,GJTJ1))<2 AND GJTJ1>GJTJ4;
M2:=HUANGJIN1 AND HUANGJIN2;
XG:=BARSLAST(CROSS(GJTJ4,GJTJ1))<5  AND GJTJ1>GJTJ4;
M3:=COUNT(XG,3)=1 AND XG AND C>MA(C,20);
 
操盘手: M1 OR M2 OR M3;
操盘手
GJTJ1:=100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5));
GJTJ2:=100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10));
GJTJ3:=100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20));
GJTJ4:=100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30));
BAIJIN1:=BARSLAST(CROSS(30,GJTJ1))<2 AND BARSLAST(CROSS(GJTJ1,50))<2;
BAIJIN2:=BARSLAST(CROSS(GJTJ4,GJTJ1))<2 AND GJTJ1>GJTJ4;
BAIJIN3:=GJTJ1>60 AND GJTJ4>70;
M1:=BAIJIN1 AND BAIJIN2 AND BAIJIN3;
HUANGJIN1:=BARSLAST(CROSS(50,GJTJ1))<3 AND BARSLAST(CROSS(GJTJ1,50))<3;
HUANGJIN2:=BARSLAST(CROSS(GJTJ4,GJTJ1))<2 AND GJTJ1>GJTJ4;
M2:=HUANGJIN1 AND HUANGJIN2;
XG:=BARSLAST(CROSS(GJTJ4,GJTJ1))<5  AND GJTJ1>GJTJ4;
M3:=COUNT(XG,3)=1 AND XG AND C>MA(C,20);
A:=BARSLAST(CROSS(97,GJTJ1))<=1 AND BARSLAST(CROSS(GJTJ1,85))<=1;
B:=BARSLAST(CROSS(97,GJTJ2))<=1 AND BARSLAST(CROSS(GJTJ2,85))<=1;
A1:=A AND B;
AA:=BARSLAST(CROSS(97,GJTJ1))<=2 AND BARSLAST(CROSS(GJTJ1,85))<=1;
BA:=BARSLAST(CROSS(97,GJTJ2))<=2 AND BARSLAST(CROSS(GJTJ2,85))<=1;
A2:=AA AND BA ;
AAA:=BARSLAST(CROSS(97,GJTJ1))<=3 AND BARSLAST(CROSS(GJTJ1,85))<=1;
BAA:=BARSLAST(CROSS(97,GJTJ2))<=3 AND BARSLAST(CROSS(GJTJ2,85))<=1;
A3:=AAA AND BAA ;
B1:=REF(A1,1);
B2:=REF(A2,1);
B3:=REF(A3,1);
D1:=GJTJ1=100 AND GJTJ2=100  AND A1;
D2:=GJTJ1=100 AND GJTJ2=100  AND A2;
D3:=GJTJ1=100 AND GJTJ2=100  AND A3;
AQ:=BARSLAST(CROSS(GJTJ4,GJTJ1))>3 AND BARSLAST(CROSS(GJTJ1,GJTJ4))<3;
BQ:=BARSLAST(CROSS(GJTJ4,GJTJ2));
DQ:=GJTJ3<GJTJ4 AND GJTJ2<GJTJ4;
EQ:=BARSLAST(CROSS(GJTJ4,GJTJ3))>3 AND BARSLAST(CROSS(GJTJ1,GJTJ4))<3;
FQ:=GJTJ2<GJTJ3 AND GJTJ2<GJTJ4 AND GJTJ2<GJTJ1 AND GJTJ1=100;
AW:=BARSLAST(CROSS(95,GJTJ1))<=2;
BW:=BARSLAST(CROSS(95,GJTJ2))<=2;
EW:= GJTJ4<GJTJ1 AND GJTJ1<GJTJ2 AND GJTJ1<GJTJ3;
FW:=GJTJ2>50 AND GJTJ3>50;
G:=GJTJ1=100 AND GJTJ2=100;
TX:=COUNT(G,2)=1;
AE:=GJTJ3=100;
BE:=GJTJ4<90;
 
操盘手: M1 OR M2 OR M3 OR D1 OR D2 OR D3 OR (AQ AND BQ AND DQ AND EQ AND FQ) OR (AW AND BW AND EW 
AND FW AND TX) OR (COUNT(AE,2) = 2 AND BE);
加码
LC:=REF(CLOSE,1);
RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
TR:=MAX(MAX((HIGH - LOW),ABS(REF(CLOSE,1) - HIGH)),ABS(REF(CLOSE,1) - LOW));
ATR:=MA(TR,14);
AA:=(HHV(HIGH,20) - (2 * ATR));
BB:=CROSS(CLOSE,REF(HHV(HIGH,55),1));
SSS:=CROSS(MIN(MA(CLOSE,13),AA),CLOSE);
BBB:=BARSLAST(BB);
SSSB:=BARSLAST(SSS);
B1:=((BBB = 0) AND (REF(SSSB,1) < REF(BBB,1)));
B1B:=BARSLAST(B1);
B2:=((((BB = 1) AND (B1B < SSSB)) AND (B1B > 0)) AND (COUNT(BB,SSSB) < 3));
B2B:=BARSLAST(B2);
B3:=((((BB = 1) AND (B2B < B1B)) AND (COUNT(BB,SSSB) < 4)) AND (COUNT(BB,SSSB) > 2));
GG:B2=1;;
 
底跟上
买线:=EMA(C,2);
卖线:=EMA(SLOPE(C,21)*20+C,42);  
BU:=CROSS(买线,卖线);
FF:=EMA(CLOSE,3);
MA15:=EMA(CLOSE,21);
EE:=CROSS(FF,MA15);
TR:=MAX(MAX((HIGH - LOW),ABS(REF(CLOSE,1) - HIGH)),ABS(REF(CLOSE,1) - LOW));
ATR:=MA(TR,14);
AA:=(HHV(HIGH,20) - (2 * ATR));
BB:=CROSS(CLOSE,REF(HHV(HIGH,55),1));
SSS:=CROSS(MIN(MA(CLOSE,13),AA),CLOSE);
BBB:=BARSLAST(BB);
SSSB:=BARSLAST(SSS);
B1:=((BBB = 0) AND (REF(SSSB,1) < REF(BBB,1)));
B1B:=BARSLAST(B1);
B2:=((((BB = 1) AND (B1B < SSSB)) AND (B1B > 0)) AND (COUNT(BB,SSSB) < 3));
 
黑牛均线:BU OR B1=1 OR B2=2 OR EE;
黑牛均线
买线:=EMA(C,2);
卖线:=EMA(SLOPE(C,21)*20+C,42);  
BU:=CROSS(买线,卖线);
FF:=EMA(CLOSE,3);
MA15:=EMA(CLOSE,21);
EE:=CROSS(FF,MA15);
TR:=MAX(MAX((HIGH - LOW),ABS(REF(CLOSE,1) - HIGH)),ABS(REF(CLOSE,1) - LOW));
ATR:=MA(TR,14);
AA:=(HHV(HIGH,20) - (2 * ATR));
BB:=CROSS(CLOSE,REF(HHV(HIGH,55),1));
SSS:=CROSS(MIN(MA(CLOSE,13),AA),CLOSE);
BBB:=BARSLAST(BB);
SSSB:=BARSLAST(SSS);
B1:=((BBB = 0) AND (REF(SSSB,1) < REF(BBB,1)));
B1B:=BARSLAST(B1);
B2:=((((BB = 1) AND (B1B < SSSB)) AND (B1B > 0)) AND (COUNT(BB,SSSB) < 3));
LC:=REF(CLOSE,1);
RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
B2B:=BARSLAST(B2);
B3:=((((BB = 1) AND (B2B < B1B)) AND (COUNT(BB,SSSB) < 4)) AND (COUNT(BB,SSSB) > 2));
 
黑牛均线:BU OR B1=1 OR B2=2 OR EE OR B2=1;
追涨选股
DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26))*30;
DEA:=EMA(DIF,9);
VAR4:=(HHV(HIGH,60)-CLOSE)/(HHV(HIGH,60)-LLV(LOW,60))*100;
VAR5:=SMA(VAR4,3,1);
VAR2:=SMA(VAR5,4,1)-90;
CROSS(DIF,VAR2)AND VAR2<REF(VAR2,1);

 

  评论这张
 
阅读(535)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018