分享

编辑通达信条件选股及警告公式

 martinstock 2011-02-13
编辑通达信条件选股及预警公式 
我顶 字号:

 

重要的函数运用:

一.STICKLINE

STICKLINE(DIFF<DEA,O,C,3,1),COLORF0F000;

当满足条件DIFF<DEA时,在开盘价和收盘价位置之间画柱状线,宽度为3,1不为0则画空心柱.,COLORF0F000

STICKLINE(TJ,O,C,3,1),COLORRED;

当满足条件TJ时,在开盘价和收盘价位置之间画柱状线,宽度为3,1不为0则画空心柱.,画红色

二.IF

{M1  5  2   1000  
M2   20  2  1000}
MA5:MA(CLOSE,M1);
MA10:MA(CLOSE,M2);
十日叉:IF(CROSS(MA5,MA10),MA5,DRAWNULL),CROSSDOT,COLORFFFFFF,LINETHICK2;

输出MA5:收盘价的M1日简单移动平均
输出MA10:收盘价的M2日简单移动平均
输出十日叉:如果MA5上穿MA10,返回MA5,否则返回无效数,CROSSDOT,COLORFFFFFF,LINETHICK2

 

 

三.DRAWICON

买线:=EMA(C,2);
卖线:=EMA(SLOPE(C,21)*20+C,42); 
BU:=CROSS(买线,卖线);
SEL:=CROSS(卖线,买线);
DRAWICON(BU,L-0.1,1);
DRAWICON(SEL,H+0.1,2);

STICKLINE(买线>=卖线,LOW,HIGH,0.0,1),COLORRED;
STICKLINE(买线>=卖线,CLOSE,OPEN,2,1),COLORRED;
STICKLINE(买线<卖线,LOW,HIGH,0.0,1),COLORGREEN;
STICKLINE(买线<卖线,CLOSE,OPEN,2,1),COLORGREEN;
STICKLINE(BU,OPEN,CLOSE,2,0),COLORYELLOW;
STICKLINE(SEL,OPEN,CLOSE,2,0),COLORBLUE;

买线赋值:收盘价的2日指数移动平均
卖线赋值:收盘价的21日线性回归斜率*20+收盘价的42日指数移动平均
BU赋值:买线上穿卖线
SEL赋值:卖线上穿买线
当满足条件BU时,在最低价-0.1位置画1号图标
当满足条件SEL时,在最高价+0.1位置画2号图标

 当满足条件买线>=卖线时,在最低价和最高价位置之间画柱状线,宽度为0.0,1不为0则画空心柱.,画红色
当满足条件买线>=卖线时,在收盘价和开盘价位置之间画柱状线,宽度为2,1不为0则画空心柱.,画红色
当满足条件买线<卖线时,在最低价和最高价位置之间画柱状线,宽度为0.0,1不为0则画空心柱.,画绿色
当满足条件买线<卖线时,在收盘价和开盘价位置之间画柱状线,宽度为2,1不为0则画空心柱.,画绿色
当满足条件BU时,在开盘价和收盘价位置之间画柱状线,宽度为2,0不为0则画空心柱.,画黄色
当满足条件SEL时,在开盘价和收盘价位置之间画柱状线,宽度为2,0不为0则画空心柱.,画蓝色
输出主力:收盘价的10日指数移动平均,画红色

 

 下面的这种红蓝线与另外的一种红蓝线也有类似的地方,公式源码为

中趋势线:=MA(CLOSE,55),LINETHICK1,COLORGRAY;
短趋势线:MA(CLOSE,25),COLORRED,LINETHICK3;
跌:IF(短趋势线<REF(短趋势线,1),短趋势线,DRAWNULL),COLORGREEN,LINETHICK3;

 DRAWTEXT(CROSS(短趋势线,C) AND INDEXC>MA(INDEXC,13) AND 短趋势线>REF(短趋势线 ,1)
     AND V<REF(V,1) AND 短趋势线>中趋势线 ,L*0.97,'买入'),COLORRED;

 其中的IF函数对应的使用方法仍然为:假如某个条件成立则对应的返回指定的值,否则返回无效数,即:

         IF(条件一,指定值,无效数);

而另外一个函数DRAWTEXT的使用方法为:满足某个条件或多个条件时,在指定的位置写文字或画图标,即:

         DRAWTEXT(条件一,指定位置,画图标或写文字);        其中的条件一既指单一的条件,也可以是组合的条件。

比如:DRAWTEXT((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03)
   OR (CROSS(SK,SD) AND SK<=-0.14 )
   OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2
   OR C/REF(C,1)>0.035)) ,L*0.99,'短线'),COLORFF66FF;

这就是一个组合条件,其中的CROSS(SK,SD)为条件一,

           (C-REF(C,1))/REF(C,1)>=0.03为条件二,

                         (V/MA(V,5)>2 为条件三,
                    C/REF(C,1)>0.035))为条件四,这几个条件又共同组成了一个大的条件为:

    ((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03)
   OR (CROSS(SK,SD) AND SK<=-0.14 )
   OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2
   OR C/REF(C,1)>0.035))    可称之为条件五,,简化后即成为DRAWTEXT(条件五,L*0.99,'短线'),COLORFF66FF;

 

 

 

而STICKLINE函数的使用方法则是当满足某一条件或组合条件时,在指定的价格或数值之间画宽度或高度为某一个值,典型的就是适用于K线的收盘开盘和最高最低之间的宽度高度或者颜色的变化;

即:STICKLINE(DIFF<DEA,O,C,3,1),COLORF0F000;

其格式为:STICKLINE(某条件,O,C,3,1),COLORF0F000;

查看更多精彩图片

 

 

 四:函数的相互嵌入使用

   函数中可以在包括函数,比如:

多:EMA(C,3),COLORYELLOW;
空:EMA(C,5),COLOR00FF00;
均衡:EMA(空,5),COLORWHITE,;
VARF1:=COUNT(CROSS(多,均衡),2)=1;
VARF2:=COUNT(CROSS(空,均衡),2)=1;
ZAI:=FILTER(VARF1 AND VARF2,2);
DRAWTEXT(ZAI,均衡,' →◆●¤主升行情'),COLORFF00FF;
VV2:=REF(CLOSE,1);
VV3:=SMA((CLOSE-VV2),6,1)/SMA(ABS(CLOSE-VV2),6,1)*100;
DRAWICON(REF(VV3,1)>81 AND VV3<80,HIGH,2);
DRAWTEXT(REF(VV3,1)>81 AND VV3<80,HIGH,' →◆●沽空↓'),COLORYELLOW;
VF1:=MA(CLOSE,60)-MA(CLOSE,5)/3.2;
DRAWTEXT(IF(CLOSE<VF1 AND VOL/240>MA(VOL,5)/240 AND CLOSE>=REF(CLOSE,1)*1.08 AND CLOSE<MA(CLOSE,13)*1.3,1,0),LOW,'☆'),COLORRED;

 

在这一段源码中,最后一句满足某条件中包含的IF语句中,(CLOSE<VF1 AND VOL/240>MA(VOL,5)/240 AND CLOSE>=REF(CLOSE,1)*1.08 AND CLOSE<MA(CLOSE,13)*1.3,1,0),四个小的条件用 AND 组合为一个总的条件,如果简化的话,就是:

DRAWTEXT(IF(条件),特定值,符号),颜色;

 

 

 

 

 

下面这是运用均线系统做的红蓝持股线,(主图)

{N=3, 1,  100}
X1:(C*2+L+H+O)/5;
X2:EMA(X1,6);
X3:EMA(X2,5);
DRAWICON(CROSS(X2,X3),L*0.98,7);
DRAWICON(CROSS(X3,X2),H*1.02,8);
STICKLINE(X2>=X3,LOW,HIGH,0,1),COLORRED;
STICKLINE(X2>=X3,CLOSE,OPEN,3,2),COLORRED;

STICKLINE(X2<X3,LOW,HIGH,0,1),COLORGREEN;
STICKLINE(X2<X3,CLOSE,OPEN,3,2),COLORGREEN;
STICKLINE(CROSS(X2,X3),OPEN,CLOSE,3,1),COLORYELLOW;
STICKLINE(CROSS(X3,X2),OPEN,CLOSE,3,1),COLORBLUE;

查看更多精彩图片

 

 漂亮的五彩K线:(红线持股蓝线持币)

成本:(MA(CLOSE,60)+MA(CLOSE,70)+MA(CLOSE,90)+MA(CLOSE,108))/4,COLORRED,LINETHICK2;
二号线:EMA(C,25),COLORWHITE,LINETHICK2;
TYP:=(HIGH + LOW +2* C)/4;
均线:EMA(TYP,3),LINETHICK2,COLORWHITE;
角度:=ATAN((均线/REF(均线,1)-1)*100)*180/3.1416;
STICKLINE(角度>0,O,C,3,0),COLOR000099;{红K线持股};
STICKLINE(角度>0,O,C,2,0),COLOR0000CC;
STICKLINE(角度>0,O,C,1.3,0),COLOR0000FF;
STICKLINE(角度>0,O,C,0.3,0),COLORCC66FF;
STICKLINE(角度<0,O,C,3,0),COLORFF6600;{蓝K线持币};
STICKLINE(角度<0,O,C,2,0),COLORFF9900;
STICKLINE(角度<0,O,C,1.2,0),COLORFFCC00;
STICKLINE(角度<0,O,C,0.2,0),COLORCYAN;
查看更多精彩图片
查看更多精彩图片

 

 

 

拼接的五彩K线及条件选股公式:(正在完善)

五彩买卖信号:

二号线:EMA(C,25),COLORWHITE,LINETHICK2;

DIFF:=EMA(CLOSE,3);   DEA:=EMA(C,13);   MACD:=0.90*(DIFF-DEA);

TJ:=(DIFF>=DEA);
TJ1:=(DIFF>=0);

STICKLINE(TJ1 AND TJ,H,L,0,1),COLORRED;
STICKLINE(TJ1 AND TJ,O,C,3.5,1),COLORRED;
STICKLINE(DIFF<DEA,H,L,0,0),COLORF0F000;
STICKLINE(DIFF<DEA,O,C,3,1),COLORF0F000;

 

或者:

二线:EMA(C,25),COLORWHITE,LINETHICK2;
DIFF:=( EMA(CLOSE,3)-EMA(CLOSE,13)),COLORWHITE;
DEA:=EMA(DIFF,9),COLORF00FF0;
MACD:=0.90*(DIFF-DEA),COLORSTICK;
TJ:=(DIFF>=DEA);
TJ1:=(DIFF>=0);
STICKLINE(TJ,H,L,0,1),COLORRED;
STICKLINE(TJ,O,C,3,1),COLORRED;
STICKLINE(TJ1 AND TJ,H,L,0,1),COLORRED;
STICKLINE(TJ1 AND TJ,O,C,3,1),COLORRED;
STICKLINE(DIFF<DEA,H,L,0,0),COLORF0F000;
STICKLINE(DIFF<DEA,O,C,3,1),COLORF0F000;
VAR1:=(CLOSE*2+HIGH+LOW)/4;
SK:= EMA(VAR1,13)-EMA(VAR1,73);
SD:= EMA(SK,2);
DRAWTEXT((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03)
   OR (CROSS(SK,SD) AND SK<=-0.14 )
   OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2
   OR C/REF(C,1)>0.035)) ,L*0.99,'短线'),COLORFF66FF;
STICKLINE((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03)
   OR (CROSS(SK,SD) AND SK<=-0.14 )
   OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2
   OR C/REF(C,1)>0.035)),H,L,0,0),COLORRED;
STICKLINE((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03)
   OR (CROSS(SK,SD) AND SK<=-0.14 )
   OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2
   OR C/REF(C,1)>0.035)),O,C,3,0),LINETHICK3,COLORRED;

其图中所示为:

查看更多精彩图片
查看更多精彩图片
查看更多精彩图片
查看更多精彩图片
查看更多精彩图片

基本上看起来也很直观,仔细分析,还是以25日均线为分界点,上为持股,下为持币,目前尚存的缺点是在盘整行情中,不能过滤掉小幅波动时候的频繁的买卖点的出现。

其实下面这种指标源码也听简单的:姑且称其为买卖变色线:

VAR11:MA(C,14),COLORRED;
上升通道:IF(VAR11>REF(VAR11,1),VAR11,DRAWNULL),LINETHICK3,COLORRED;
下降通道:IF(VAR11<REF(VAR11,1),VAR11,DRAWNULL),LINETHICK3,COLORGREEN;
DIFF:=( EMA(CLOSE,2)-EMA(CLOSE,25)),COLORWHITE;
DEA:=EMA(DIFF,189),COLORF00FF0;
MACD:=0.90*(DIFF-DEA),COLORSTICK;
TJ:=(DIFF>=DEA);
TJ1:=(DIFF>=0);
STICKLINE(DIFF<DEA,H,L,0,1),COLORF0F000;
STICKLINE(DIFF<DEA,O,C,3,1),COLORF0F000;
STICKLINE(TJ,H,L,0,1),COLORRED;
STICKLINE(TJ,O,C,3,1),COLORRED;

查看更多精彩图片

查看更多精彩图片

 出现的问题仍然是在盘整行情中买卖信号频繁。现在需要讨论的是在源码中引入量能,比如我观察了很多大牛股暴涨启动前当日的成交量突破89日均线而且5日30日均线向上金叉是行情启动的明确信号,现在需要的就是引入此中情况的源码。

 

 


 

 

 

 需要的素材:

1.

一剑封喉:=((CROSS(CLOSE,MA(CLOSE,13)) AND CROSS(CLOSE,MA(CLOSE,34))) AND CROSS(CLOSE,MA(CLOSE,55)));
  A1:=(((CLOSE - LLV(LOW,22)) / (HHV(HIGH,22) - LLV(LOW,22))) * 100);
  A2:=(((CLOSE - LLV(LOW,27)) / (HHV(HIGH,27) - LLV(LOW,27))) * 100);
  A:=((3 * SMA(A1,5,1)) - (2 * SMA(SMA(A2,5,1),3,1)));
  YNGS:=(一剑封喉 AND (A < 30)),LINETHICK0;
  DRAWICON((一剑封喉 AND (A < 30)),(LOW * 0.99),1);
  DRAWTEXT((一剑封喉 AND (A < 30)),(LOW * 0.99),' ←兔子封喉'),COLORYELLOW;

动态翻译的结果为:

一剑封喉赋值:((收盘价上穿收盘价的13日简单移动平均 AND 收盘价上穿收盘价的34日简单移动平均) AND 收盘价上穿收盘价的55日简单移动平均)
A1赋值:(((收盘价 - 22日内最低价的最低值) / (22日内最高价的最高值 - 22日内最低价的最低值)) * 100)
A2赋值:(((收盘价 - 27日内最低价的最低值) / (27日内最高价的最高值 - 27日内最低价的最低值)) * 100)
A赋值:((3 * A1的5日[1日权重]移动平均) - (2 * A2的5日[1日权重]移动平均的3日[1日权重]移动平均))
YNGS赋值:(一剑封喉 AND (A < 30)),LINETHICK0
当满足条件(一剑封喉AND(A<30))时,在(最低价*0.99)位置画1号图标
当满足条件(一剑封喉AND(A<30))时,在(最低价*0.99)位置书写文字,画黄色

查看更多精彩图片

查看更多精彩图片

2.

LC:=REF(CLOSE,1);
RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
DRAWTEXT(EMA(EMA(CLOSE,13),50)>EMA(EMA(CLOSE,13),50*3)
       AND CROSS(84,RSI), HIGH*1.02,'←风险'),COLOR00FF33;
DRAWTEXT(EMA(EMA(CLOSE,13),50)<EMA(EMA(CLOSE,13),50*3)
       AND CROSS(80,RSI), HIGH*1.02,'←风险'),COLOR00FF33;
AAA:=(MA(CLOSE,13)+MA(CLOSE,17))/2;
CCC:=(STD(CLOSE,13)+STD(CLOSE,17))/2;
BBB:=AAA+2.1*CCC;
DDD:=AAA+0.72*CCC;
ZZZ:=IF(CCC>1.88,MA(DDD,3),DDD);
DRAWTEXT(CLOSE>=1.09*REF(CLOSE,1),CLOSE,'涨停啦,'),COLORYELLOW;

LC赋值:昨收
RSI赋值:收盘价-LC和0的较大值的6日[1日权重]移动平均/收盘价-LC的绝对值的6日[1日权重]移动平均*100
当满足条件收盘价的13日指数移动平均的50日指数移动平均>收盘价的13日指数移动平均的50*3日指数移动平均ANDCROSS(84,RSI)时,在最高价*1.02位置书写文字,COLOR00FF33
当满足条件收盘价的13日指数移动平均的50日指数移动平均<收盘价的13日指数移动平均的50*3日指数移动平均ANDCROSS(80,RSI)时,在最高价*1.02位置书写文字,COLOR00FF33
AAA赋值:(收盘价的13日简单移动平均+收盘价的17日简单移动平均)/2
CCC赋值:(收盘价的13日估算标准差+收盘价的17日估算标准差)/2
BBB赋值:AAA+2.1*CCC
DDD赋值:AAA+0.72*CCC
ZZZ赋值:如果CCC>1.88,返回DDD的3日简单移动平均,否则返回DDD
当满足条件收盘价>=1.09*昨收时,在收盘价位置书写文字,画黄色

查看更多精彩图片


 3.

SFF:=HIGH/REF(HIGH,1)<1 AND REF(HIGH,1)/REF(HIGH,2)<1  AND LOW/REF(LOW,1)>1 AND REF(LOW,1)/REF(LOW,2)>1 ;
DRAWTEXT(SFF,LOW*0.90,'金兔子:提醒你关注')COLORRED;

SFF赋值:最高价/昨日最高价<1 AND 昨日最高价/2日前的最高价<1  AND 最低价/昨日最低价>1 AND 昨日最低价/2日前的最低价>1
当满足条件SFF时,在最低价*0.90位置书写文字画红色

查看更多精彩图片

4.启动线

启动线:SUM(EMA((C+L)/2,2),5)/10.158,COLORRED;
平衡线:LLV(SUM( EMA((C+L)/2,2),5)/10.158,4),COLORMAGENTA;
平台线:LLV(SUM( EMA((C+L)/2,2),5)/10.158,10),COLORFFFFFF;
强弱线:EMA(启动线,21),COLORYELLOW;
STICKLINE(平台线<启动线,启动线,平台线,0.1,0),COLORFF972F;
STICKLINE(平衡线<启动线,启动线,平衡线,0.1,0),COLORRED;
M1:=WINNER( MA(CLOSE,1))*200;
M2:=WINNER(MA(CLOSE,20))*200;
VAR1:=(CLOSE-LLV(LOW,80))/(HHV(HIGH,80)-LLV(LOW,80))*200;
VAR2:=SMA(VAR1,3,1);
VAR3:=SMA(VAR2,3,1);
VAR4:=3*VAR2-2*VAR3;
VAR5:=LLV(LOW,5);
VAR6:=HHV(HIGH,5);
VAR7:=EMA((CLOSE-VAR5)/(VAR6-VAR5)*100,4)*2;
VAR8:=EMA(0.667*REF(VAR7,1)+0.333*VAR7,2);
VAR9:=3*VAR7-2*VAR8;
VARA:=POW(MA(CLOSE,5),2)+MA(CLOSE,5);
VARB:=POW(MA(LOW,5),2)+MA(LOW,5);
VARC:=POW(MA(HIGH,5),2)+MA(HIGH,5);
VARD:=(VARA-LLV(VARB,64))/(HHV(VARC,64)-LLV(VARB,64))*150+65-10;
VARE:=SMA(VARD,3,1)*1.5-100;
VARF:=SMA(VARE,3,1);
VAR10:=3*VARE-2*VARF;
VAR11:=(HIGH+LOW+CLOSE*2)/4;
VAR12:=EMA(VAR11,13);
VAR13:=STD(VAR11,13);
VAR14:=(VAR11-VAR12)*100/VAR13;
VAR15:=EMA(VAR14,5);
VAR17:=EMA(VAR15,13)+200-100;
VAR18:=EMA(VAR17,10);
VAR19:=3*VAR17-2*VAR18;
VAR1A:=VAR2+VAR7+VARE+VAR17;
VAR1B:=VAR3+VAR8+VARF+VAR18;
VAR1C:=VAR4+VAR9+VAR10+VAR19;
VAR1D:=(HIGH+LOW+CLOSE)/3;
VAR20:=(VAR1D-MA(VAR1D,34))/(0.015*AVEDEV(VAR1D,34));
VAR21:=DMA(AMOUNT/VOL/100,VOL/CAPITAL);
VAR22:=(HIGH+LOW+CLOSE+VAR1D)/4;
VAR23:=EMA(VAR22,24);
VAR24:=STD(VAR22,24);
VAR25:=(VAR22-VAR23)/VAR24*100;
VAR26:=(VAR1D-MA(VAR1D,24))/(0.015*AVEDEV(VAR1D,24));
VAR27:=EMA(VAR25,5);
VAR2A:=((VAR27+VAR26+VAR20)/3+165)/4;
VAR2B:=(EMA(EMA(EMA(VAR2A,15),10),5)-25)*2+VAR21;
VAR2C:=(VAR1A+VAR1B+VAR1C*30)/32/5-15;
VAR2D:=EMA(VAR2C,13);{13}
VAR2E:=(VAR2A+VAR2C)/2/1.1;    
AA:=EMA(VAR2E,3) ;
AA1:=EMA(AA,5);
AA2:=EMA((VAR2B+VAR2D)/2,2);
HH:=MAX(AA,MAX(AA1,AA2))-MIN(AA,MIN(AA1,AA2));
买:=(CROSS(AA,AA1) AND HH<5 AND AA<2),COLORRED,NODRAW;
DQ:=AA<10 AND AA2<10 AND AA1<10;
买点:=(DQ=1 AND HH>REF(HH,1) AND REF(HH,1)<REF(HH,2)),COLORYELLOW,NODRAW;
STICKLINE(AA<10 AND AA2<10 AND AA1<10,强弱线,平台线,4,1);
STICKLINE(买点=1,强弱线,平台线,3,0),COLORYELLOW;
STICKLINE(买=1,强弱线,平台线,4,0),COLORRED;
查看更多精彩图片

5.极品选股

顶压:HHV(MA(H,11),50),COLOR00FFFF;
短压:HHV(MA(H,11),15),COLOR0090E0;
XL1:=LLV(MA(H,11),1);
趋势:IF(XL1>=短压,短压,XL1),COLORFFFFFF;
X1:=(3*C+H+L+O)/6;
X2:=EMA(X1,10);
X3:=REF(X2,1);
X4:=(REF(HIGH,1)+REF(LOW,1))/2;
X5:=MA(CLOSE,21)+2*STD(CLOSE,21);
X6:=REF(CLOSE,1);{出货}
X7:=SMA(MAX(CLOSE-X6,0),7,1)/SMA(ABS(CLOSE-X6),7,1)*100;
X8:=CROSS(79,X7);
X9:=FILTER(X8,4);{40}
WZ1:=POW(MA(CLOSE,5),2)+MA(CLOSE,5);{减}
WZ2:=POW(MA(LOW,5),2)+MA(LOW,5);
WZ3:=POW(MA(HIGH,5),2)+MA(HIGH,5);
WZ4:=(WZ1-LLV(WZ2,9))/(HHV(WZ3,9)-LLV(WZ2,9))*150+65;
DK:=SMA(WZ4,3,1)*1.5;
DD:=SMA(DK,3,1);
DJ:=3*DK-2*DD;
WZ5:= EMA(CLOSE,12) - EMA(CLOSE,26);
WZ6:= EMA(WZ5,9);
WZ7:= 2*(WZ5-WZ6);{50}
WZ8:= REF(WZ7,1);
WZ9:= CROSS(WZ8,WZ7) AND WZ8>0;
DRAWTEXT(WZ9 AND DJ>250,H,'←减'),COLORBCFF8B;
VAR11:=EMA(CLOSE,8);{起步}
VAR2:=EMA(VAR11,20);
VAR3:=CROSS(VAR11,VAR2);
VAR4:=VAR11<MA(CLOSE,120);
VAR5:=(HHV(HIGH,36)-CLOSE)/(HHV(HIGH,36)-LLV(LOW,36))*100;{逃命}
VAR6:=SMA(VAR5,5,1);
VAR7:=SMA(VAR6,8,1);{60}
VAR8:=CROSS(VAR6,VAR7) AND VAR7<20;
VAR9:=CLOSE>LLV(CLOSE,60)+0.3*LLV(CLOSE,60) AND VAR8;
VARA:=IF(CLOSE>1000,VAR8,VAR9);
起步:= VAR3 AND VAR4;
逃遁:= VARA;
STICKLINE(X2>X3,X2*0.98,X2,6,1),COLOR0000FF,LINETHICK2;
STICKLINE(X2<X3,X2*0.98,X2,6,1),COLORF10011,LINETHICK2;
WW1:= SUM( MA(C,10),9)/10.110,COLORYELLOW;
XX1:=MA(LOW,2)*0.96;
XX2:=MA(LOW,26)*0.85;
XX3:= REF(XX1,1)<XX2 AND REF(XX1,1)<XX1 AND REF(XX1,1)<REF(XX1,2);
VAR1:=INDEXC;
VAR12:=MA(VAR1,6);
VAR13:=MA(VAR1,24);
VAR14:=MA(VAR1,32);
VAR15:=MA(VAR1,62);
VAR16:=MA(VAR1,105);
VAR17:=VAR15<REF(VAR15,1) AND VAR6<REF(VAR16,1) AND VAR15<VAR6*0.98;
VAR18:=VAR14>VAR12*1.11 AND VAR13>VAR12*1.095;
VAR19:=VAR12>VAR1*0.95;
VAR111:=EMA(WINNER(CLOSE)*70,3);
VAR112:=EMA((WINNER(CLOSE*1.1)-WINNER(CLOSE*0.9))*80,3);
VAR113:=CLOSE/MA(CLOSE,40)*100<76;
VAR114:=CLOSE/MA(CLOSE,60)*100<74;
VAR115:=HIGH>LOW*1.051;
VAR116:=VAR115 AND COUNT(VAR15,5)>1;
VAR117:=VAR17 AND VAR8 AND VAR19 AND CLOSE/COST(8)<=0.8 AND (CLOSE>OPEN OR CLOSE<OPEN)
AND (REF(CLOSE,1)>REF(OPEN,1) OR REF(CLOSE,1)<REF(OPEN,1)) AND CLOSE>0.1 OR VAR16
AND (VAR113 OR VAR114) AND VAR112<20 AND VAR111<20
AND (WINNER(CLOSE*125/100)-WINNER(CLOSE))*100<7.5 OR TROUGHBARS(3,15,1)<4
AND CROSS(EMA(CLOSE,21)-EMA(CLOSE,8),EMA(EMA(CLOSE,21)-EMA(CLOSE,8),5));

XL11:=EMA(CLOSE,10)/100;{70}
XL2:= MA((XL11-REF(XL11,10))/REF(XL11,10),3)*100;
XL3:= MA(XL2,3);
XL4:=SMA((CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100,3,1);
DRAWTEXT(IF(CROSS(3*XL4-2*SMA(XL4,3,1),8),87,0) AND X2>X3,L-0.1,'←●反弹'),COLORGREEN;
DRAWTEXT(IF(CROSS((VAR11-LLV(VAR1,4))/(HHV(VAR11,4)-LLV(VAR11,4))*4*25,87.5) AND
VAR1<40,87,0) AND X2>X3,L-0.2,'←●短买'),COLORFFBBD8;
DRAWTEXT(CROSS(VAR1,10) AND X2>X3,L-0.3,'←●买'),COLOR89B2FF;
DRAWTEXT(IF(CROSS(2*(EMA((CLOSE*2+HIGH+LOW)/4,12)-EMA((CLOSE*2+HIGH+LOW)/4,26)-EMA(EMA((CLOSE*2+HIGH+LOW)/
4,12)-EMA((CLOSE*2+HIGH+LOW)/4,26),2))*5.8,0.47),LOW,0) AND X2>X3,L-0.4,'←●加仓'),COLORFF5ED8;{80}
LL1:=(EMA(CLOSE,3) - EMA(CLOSE,13));
LL2:=EMA(LL1,9);
LL3:=BARSLAST(CROSS(LL1,LL2));
LL4:=REF(LL3,LL3+1);
LL5:=LL2<REF(LL2,LL4);
变盘:=CROSS(LL1,LL2) AND LL5;

DRAWTEXT(起步>0,L,'★起步?'),COLOR00FF00;

STICKLINE(起步>0,C*1.05,C,7,0),COLORRED;
DRAWTEXT(逃遁>0,H*1.04,'●←逃'),COLOR7FFFD6;

查看更多精彩图片

6.资金翻番

ZGD2:=CONST(ZGD);
ZDD:=LLV(L,90);
ZDD2:=CONST(ZDD);
{DRAWBAND(ZGD2,RGB(50,50,50),ZDD2,DRAWNULL);}
VAR1:=(CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2));
VAR2:=(REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR3:=(REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR4:=(REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR5:=(REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR6:=(REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR7:=(REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR8:=(REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR9:=(REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VARA:=(REF(VAR9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VARB:=(REF(VARA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VARC:=(REF(VARB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VARD:=(CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2));
VARE:=(REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VARF:=(REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR10:=(REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR11:=(REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR12:=(REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR13:=(REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR14:=(REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR15:=(REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR16:=(REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR17:=(REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR18:=(REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,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);
红色持股:VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR VAR8 OR VAR9 OR VARA OR VARB OR VARC,COLOR0000FF,NODRAW;
青色观望:VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,COLORFFFF00,NODRAW;
短买:VAR19,REF(CLOSE,1),REF(CLOSE,2),COLOR33AACC,NODRAW;
品红离场:VAR1A,REF(CLOSE,1),REF(CLOSE,2),COLORFF99FF,NODRAW;
急速超跌:(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*100<-14,COLORFFFFFF,NODRAW;
上市日期年:REF(YEAR,BARSCOUNT(CLOSE)-1),NODRAW,COLOR0000FF;
月:REF(MONTH,BARSCOUNT(CLOSE)-1),NODRAW,COLORFF00FF;
日:REF(DAY,BARSCOUNT(CLOSE)-1),NODRAW,COLOR00FFFF;
STICKLINE(红色持股,CLOSE,REF(CLOSE,1),5,0),COLOR0000FF;
STICKLINE(青色观望,CLOSE,REF(CLOSE,1),5,0),COLORFFFF00;
STICKLINE(短买,REF(CLOSE,1),REF(CLOSE,2),5,0),COLOR33AACC;
STICKLINE(品红离场,REF(CLOSE,1),REF(CLOSE,2),5,0),COLORFF99FF;
STICKLINE(急速超跌,REF(CLOSE,1),C,5,0),COLORFFFFFF;
STICKLINE(C>=O,L,H,0,0),COLOR0000CC;
STICKLINE(C<O,L,H,0,0),COLOR999900;
STICKLINE(1,C,O,2.5,0),COLOR454500;
STICKLINE(1,C,O,2,0),COLOR555500;
STICKLINE(1,C,O,1.5,0),COLOR656500;
STICKLINE(1,C,O,1,0),COLOR757500;
STICKLINE(1,C,O,0.5,0),COLOR858500;
STICKLINE(C>=O,C,O,2.5,0),COLOR000045;
STICKLINE(C>=O,C,O,2,0),COLOR000085;
STICKLINE(C>=O,C,O,1.5,0),COLOR0000A5;
STICKLINE(C>=O,C,O,1,0),COLOR0000C5;
STICKLINE(C>=O,C,O,0.5,0),COLOR0000E5;
DRAWTEXT(VAR19,REF(CLOSE,1),'←短买'),COLOR33FFCC;
DRAWTEXT(VAR1A,REF(CLOSE,1)+0.1,'←离场'),COLORFF99FF;
MA3:=MA(CLOSE,3);
YTSL:=(3*CLOSE+LOW+OPEN+HIGH)/6;
辰星线:(20*YTSL+19*REF(YTSL,1)+18*REF(YTSL,2)+17*REF(YTSL,3)+16*REF(YTSL,4)+15*REF(YTSL,5)+14*REF(YTSL,6)+13*REF(YTSL,7)+12*REF(YTSL,8)+11*REF(YTSL,9)+10*REF(YTSL,10)+9*REF(YTSL,11)+8*REF(YTSL,12)+7*REF(YTSL,13)+6*REF(YTSL,14)+5*REF(YTSL,15)+4*REF(YTSL,16)+3*REF(YTSL,17)+2*REF(YTSL,18)+REF(YTSL,20))/211,COLOR0000FF;
牵牛线:MA(CLOSE,26),COLORFF00FF;
等待:=IF(MA3>辰星线,辰星线,MA3);
IF(等待>REF(等待,1),等待,DRAWNULL),LINETHICK2,COLOR0000FF;
IF(辰星线>REF(辰星线,1),辰星线,DRAWNULL),LINETHICK2,COLOR0000FF;
IF(辰星线<REF(辰星线,1),辰星线,DRAWNULL),COLOR00FF00;
IF(牵牛线<REF(牵牛线,1),牵牛线,DRAWNULL),COLOR669933;

 查看更多精彩图片

7.三底背离

A:=MA(CLOSE,17)+ABS(MA(CLOSE,17)-REF(MA(CLOSE,17),1));   
B:=MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CLOSE,17),1);   
分水岭:IF(MA(CLOSE,17)<B,B,MA(CLOSE,17)),COLORFF00FF,LINETHICK1;   
PMA:=分水岭;   
DD:=分水岭<REF(分水岭,1);   
IF(DD,分水岭,DRAWNULL),COLOR00FF00,LINETHICK1;   
操作线:分水岭-(EMA(C,3)-分水岭),COLOR00FFFF,LINETHICK1;   
S:=(PMA>操作线);   
IF(S,分水岭,DRAWNULL),COLOR00FF00,POINTDOT,LINETHICK1;   
PM:MA(C,5),COLORFFFFCC,LINETHICK1;   
IF(PM>REF(PM,1),PM,DRAWNULL),COLORRED,LINETHICK1;   
IF(PM=REF(PM,1),PM,DRAWNULL),COLORRED;   
IF(PM<REF(PM,1),PM,DRAWNULL),COLORFF9900,LINETHICK1;   
DRAWTEXT(CROSS(分水岭,操作线),分水岭-0.1,'三底背离');   
A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));   
B1:=REF(C,A1+1)>C AND REF("MACD.DIF",A1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA");   
DRAWTEXT(B1>0,L-0.02,'M底背离'),COLOR00FFFF;   
A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));   
B2:=REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");   
DRAWTEXT(B2,L-0.10,'K底背离'),COLORFF00FF;   
A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));   
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");   
DRAWTEXT(B3>0,L-0.18,'R底背离'),COLOR0000FF;   
C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));   
D1:=REF(C,C1+1)<C AND REF("MACD.DIF",C1+1)>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF");   
DRAWTEXT(D1>0,H+0.16,'M顶背离'),COLOR00FF00;   
C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));   
D2:=REF(C,C2+1)<C AND REF("KDJ.K",C2+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K");   
DRAWTEXT(D2>0,H+0.08,'K顶背离'),COLORFFFFCC;   
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));   
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1");   
DRAWTEXT(D3>0,H+0.04,'R顶背离'),COLORFF9900;

查看更多精彩图片

8.转向抄底

EMA13:=EMA(C,13),COLORWHITE;
EMA21:=EMA(C,21),COLORYELLOW;
EMA34:=EMA(C,34),COLORFF00FF;
EMA60:=MA(C,60),COLORFFCC66;
VAR2:=(2*CLOSE+HIGH+LOW)/4;
VAR3:=IF(YEAR>=2099 AND MONTH>2,0,1);
VAR4:=LLV(LOW,5); VAR5:=HHV(HIGH,4);
散户:=EMA((VAR2-VAR4)/(VAR5-VAR4)*100,4)*VAR3;
庄家:=EMA(0.667*REF(散户,1)+0.333*散户,2)*VAR3;
DRAWTEXT(CROSS(散户,庄家) AND 散户<30,L-0.05,'←低吸'),COLORLIRED;
DRAWTEXT(CROSS(庄家,散户) AND 散户>70,H+0.05,'←高抛'),COLORGREEN;
DRAWICON(CROSS(散户,庄家) AND 散户<30,L-0.05,1);
DRAWICON(CROSS(庄家,散户) AND 散户>70,H+0.05,2);
VAR9:=CLOSE-REF(CLOSE,5);
VARA:=EMA(EMA(VAR9,5),5)/EMA(EMA(ABS(VAR9),5),5);
VARC:=EMA(EMA(VAR9,20),20)/EMA(EMA(ABS(VAR9),20),20);
卖出:=IF(VARA>0 AND CROSS(VARC,VARA),90,100);
DRAWICON(卖出<0,H+0.05,2); 买线:=EMA(CLOSE,2);
卖线:=EMA(SLOPE(CLOSE,21)*20+CLOSE,42);
B1:IF(CROSS(买线,卖线),L-0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORMAGENTA;
S1:IF(CROSS(80,RSI)*30,H+0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORYELLOW;
VC:=((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100+(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100+(CLOSE-MA (CLOSE,32))/MA(CLOSE,32)*100)/3;
S2:=IF(VC>20 AND FILTER(VC< REF(VC,1),5),H+0.02,DRAWNULL),CIRCLEDOT,LINETHICK3,COLORGREEN;
A0:=(L+H+C*2)/4;
A1:EMA(A0,14)COLORBLUE,LINETHICK2;
A2:=EMA(A0,25)COLORLIBLUE,LINETHICK2;
A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW;
A2X:=(A2-REF(A2,1))/REF(A2,1)*100,NODRAW;
看多:IF(A1X>=0 AND BARSLAST(CROSS(A1X,0))>0,REF((C+O)/2,BARSLAST(CROSS(A1X,0))),DRAWNULL),COLORMAGENTA{,LINETHICK2};
逃顶:IF(A1X<0 AND BARSLAST(CROSS(0,A1X))>0,REF((C+O)/2,BARSLAST(CROSS(0,A1X))),DRAWNULL),COLORCYAN,{LINETHICK2};
买入持股:IF(A1X>=0,A1,DRAWNULL)COLORRED,LINETHICK3;
卖出空仓:IF(A1X<0 AND A2X<0,A1,DRAWNULL)COLORGREEN,LINETHICK3;
STICKLINE(CROSS(A1X,0),H,L,0,0 ),COLOR9933FF;
STICKLINE(CROSS(A1X,0),C,O,3,0 ),COLOR0000CC;
STICKLINE(CROSS(A1X,0),C,O,1,0 ),COLOR0033FF;
STICKLINE(CROSS(0,A1X),L,H,0,0 ),COLOR66CC33;
查看更多精彩图片

查看更多精彩图片

 9.绝路航标   (通达信副图)

VAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80;
B:SMA(VAR1,N,1);
VAR2:SMA(B,M,1);
绝路航标:IF(CROSS(B,VAR2) AND B<40,50,0);

N最小2最大100缺省7.        M最小2最大100缺省5.

 查看更多精彩图片

这个指标与涨停板还有一定的关联。

 

10.准备抄底

VAR1:=AMOUNT/VOL/7;
VAR2:=(3*HIGH+LOW+OPEN+2*CLOSE)/7;
VAR3:=SUM(AMOUNT,N)/VAR1/7;
VAR4:=DMA(VAR2,VOL/VAR3);
抄底:(CLOSE-VAR4)/VAR4*100,COLORLIMAGENTA;
DRAWICON(CROSS(-1.65,抄底),抄底,1);

查看更多精彩图片

11.红蓝线   (该指标仍然是按照macd的数据变化出来的,仍然有不能过滤盘整时买卖点频繁出现的现象)

 

二号线:EMA(C,25),COLORWHITE,LINETHICK2;
工作线:EMA(C,14),COLORYELLOW,LINETHICK2;
VAR1:=IF(DATE>=10201201,0,1);
VAR2:=EMA(SLOPE(CLOSE,21)*20+CLOSE,55);
VAR3:=EMA(CLOSE,3);
VAR4:=(2*CLOSE+LOW+HIGH)/4*VAR1;
VAR5:=VAR2-VAR3;
风险线:=EMA(VAR4,45)*1.15;
必卖线:=EMA(VAR4,55)*1.3;
底线:=EMA(VAR4,40)*0.85;
铁底线:=EMA(VAR4,88)*0.7,COLORRED;
成本线:=EMA(VAR4,55),COLORGREEN;
持仓:STICKLINE(VAR5>=0,C,O,3,0),COLORGREEN;
     STICKLINE(VAR5>=0,H,L,0,0),COLORGREEN;
减仓:STICKLINE(VAR5<0,O,C,3,0),LINETHICK2,COLORRED;
STICKLINE(VAR5<0,H,L,0,0),LINETHICK2,COLORRED;
价值中枢:=(成本线+底线)/2,COLORFFFF00;
查看更多精彩图片
查看更多精彩图片


 

 12.单线变双色

 

VAR1:MA(C,10),COLORRED;
上升:IF(VAR1>REF(VAR1,1),VAR1,DRAWNULL),COLORRED;
下降:IF(VAR1<REF(VAR1,1),VAR1,DRAWNULL),COLORGREEN;

 

 

 12.KDJ金叉:

1.低位金叉
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,27);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
CROSS(DIFF,DEA) AND DIFF<-0.1;

2.二次金叉
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;

3.底背离
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);

4.顶背离
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);

第二个公式编写出来的选股公式如下:
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30);
MA60:=MA(CLOSE,60);
MA120:=MA(CLOSE,120);
MA250:=MA(CLOSE,250);
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,8);
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
A2:=BARSLAST(REF(CROSS(K,D),1));
B2:=REF(C,A2+1)>C AND REF(K,A2+1)<K AND CROSS(K,D);
LC:=REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;
A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));
B3:=REF(C,A3+1)>C AND REF(RSI1,A3+1)<RSI1 AND CROSS(RSI1,RSI2);
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
C2:=BARSLAST(REF(CROSS(D,K),1));
D2:=REF(C,C2+1)<C AND REF(K,C2+1)>K AND CROSS(D,K);
C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));
D3:=REF(C,C3+1)<C AND REF(RSI1,C3+1)>RSI1 AND CROSS(RSI2,RSI1);
IF(B1>0,1,0) OR IF(B2>0,1,0) OR IF(B3>0,1,0) OR IF(D1>0,1,0) OR IF(D2>0,1,0) OR IF(D3>0,1,0);

 

13.买卖点提示

庄筹:=WINNER(CLOSE)*100,COLORRED, LINETHICK2;
筹码集中度:EMA(庄筹,20),COLORRED, LINETHICK1;
筹码警戒线:EMA(筹码集中度,5),COLORYELLOW, LINETHICK1;
筹码生命线:EMA(筹码警戒线,5),COLORBLUE, LINETHICK1;

A:=CROSS(筹码集中度,筹码警戒线);
B:=CROSS(筹码警戒线,筹码集中度);
DRAWICON(A,筹码集中度-0.1,10);
DRAWICON(B,筹码集中度+0.1,12);

 14.涨跌停K线

EMA10:EMA(C,10);
EMA20:EMA(C,20);
EMA30:EMA(C,30);
EMA60:EMA(C,60);
EMA120:EMA(C,120);
年线:EMA(C,250),COLORFFCC66;

C2:=REF(C,1);
涨停:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);
STICKLINE(涨停,OPEN,CLOSE,2,0),COLORYELLOW;
STICKLINE(涨停,H,L,0,0),COLORYELLOW;
跌停:=IF((C2-C)*100/C2>=(10-0.01*100/C2),1,0);
STICKLINE(跌停,OPEN,CLOSE,2,0),COLORGREEN;
STICKLINE(跌停,H,L,0,1),COLORGREEN;

15.红财神均线

MA1:MA(CLOSE,M1);
MA2:MA(CLOSE,M2);
MA3:MA(CLOSE,M3);
MA4:MA(CLOSE,M4);
DRAWICON((ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)<=REF(ZIG(3,5),3)),LOW*0.98,1) ;
DRAWICON((ZIG(3,5)<REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)>=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)>=REF(ZIG(3,5),3)),HIGH*1.01,2);

VAR3:=(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100;
VAR4:=(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100;
VAR5:=(CLOSE-MA(CLOSE,32))/MA(CLOSE,32)*100;
VAR6:=(VAR3+VAR4+VAR5)/3;
VAR7:=EMA(VAR6,5);
ZB:=EMA(EMA(VAR3,5),5)*3, COLORSTICK;
VAR8:=IF(VAR6<=-20,10,0);
VAR9:=HHV(VAR8,10);

VARA:=IF(VAR9 AND CROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0);
K:=EMA(VAR7,5)*2, , COLORFF00FF;
D:=EMA(K,5), , COLORWHITE;
J:=K*3-D*2, ,COLORYELLOW;
VARB:=BETWEEN(CLOSE,MA(CLOSE,3),MA(CLOSE,5)) AND J>10;
HS:=VOL/CAPITAL*100, , COLORGREEN;
DRAWTEXT(VAR8=10 AND FILTER(VAR8=10,5),LOW*0.93,'接近底部') COLORMAGENTA;

DRAWTEXT(VARA=20,LOW*0.95,'底部') COLORYELLOW;


VARE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;
VARF:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);
VAR10:=100-3*SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);
VAR11:=VARF<REF(VAR10,1) AND VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1);
DRAWTEXT(VAR11 AND COUNT(VAR11,30)=1,LOW*0.95,'大资金活动'),LINETHICK1,COLORFF00FF;

VAR12:=(HIGH+LOW+CLOSE)/3;
VAR13:=(VAR12-MA(VAR12,14))/(0.015*AVEDEV(VAR12,14));
VAR14:=(VAR12-MA(VAR12,70))/(0.015*AVEDEV(VAR12,70));
VAR15:=IF(VAR13>=150 AND VAR13<200 AND VAR14>=150 AND VAR14<200,10,0);
VAR16:=IF(VAR13<=-150 AND VAR13>-200 AND VAR14<=-150 AND VAR14>-200,-10,VAR15);
VAR17:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;
VAR18:=100-ABS(VAR17);
VAR19:=IF(VAR18<90,VAR18,100);
VAR1A:=IF(VARE>0,VARE,0);
VAR1B:=IF(VAR14>=200 AND VAR13>=150,15,IF(VAR14<=-200 AND VAR13<=-150,-15,VAR16))+60;
VAR1C:=VAR1A>48 AND VAR1B>60 AND VAR19<100;
DRAWTEXT(VAR1C AND COUNT(VAR1C,30)=1,LOW*0.95,'大笔成交') COLORWHITE;

17.操盘线

 N1:=3;
M1:=MA(C,5);
M2:MA(C,20),COLORGREEN;
均线变异:IF(M1>M2,M2,M1),COLOR0000FF;
VAR1:=(HHV(HIGH,21)-CLOSE)/(HHV(HIGH,21)-LLV(LOW,21))*100;
VAR3:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*100;
VAR6:=VAR3-VAR1;
Z:=MA(VAR6,N1);
STICKLINE(Z>=0 {AND ZZ=2},O,C,2,0),COLORRED;
STICKLINE(Z>=0 {AND ZZ=2},H,MAX(O,C),0,1),COLORRED;
STICKLINE(Z>=0 {AND ZZ=2},MIN(O,C),L,0,1),COLORRED;
STICKLINE(Z<0 {AND ZZ=1},O,C,2,1),COLORCYAN;
STICKLINE(Z<0 {AND ZZ=1},H,MAX(O,C),0,1),COLORCYAN;
STICKLINE(Z<0 {AND ZZ=1},MIN(O,C),L,0,1),COLORCYAN;
STICKLINE(Z>=0 AND M2>C,O,C,2,0),COLORBLUE;
STICKLINE(Z>=0 AND M2>C,H,MAX(O,C),0,1),COLORBLUE;
STICKLINE(Z>=0 AND M2>C,MIN(O,C),L,0,1),COLORBLUE;
STICKLINE(Z<0 AND M2<C,O,C,2,1),COLORYELLOW;
STICKLINE(Z<0 AND M2<C,H,MAX(O,C),0,1),COLORYELLOW;
STICKLINE(Z<0 AND M2<C,MIN(O,C),L,0,1),COLORYELLOW;
WW:=(MA(CLOSE,4)+MA(CLOSE,8)+MA(CLOSE,16)+MA(CLOSE,32))/4;
DRAWICON(CROSS(CLOSE,WW),LOW-0.002,1);
DRAWICON(CROSS(WW,CLOSE),HIGH+0.006,2);

18.

 

 

 

 

K线描述:

1.当日收阳   CLOSE>OPEN,            当日收阴    close<open;

2.当天高开   open>ref(close,1);      当天低开    open<ref(close,1);

3.跳空高开   open>ref(high,1);    跳空低开    open<ref(low,1);

4.下影线     (MIN(0,C)-LOW)/LOW*100

5.上影线      (high-max(open,close))/max(open,close)*100

6.K线变色    当涨幅大于5%时,将主图K线的实体的一半变为黄色

             STICKLINE(c/ref(c,1)>1.05,(C+O)/2,10,1),COLORYELLOW

7.收盘价     当收盘价收在7天均线之上,K线都为红色,收盘价收在7天平均下,K线都为绿色

             STICKLINE(C>=MA(C,7),C,O,3,0),COLORRED;
             STICKLINE(C>=MA(C,7),H,L,0,1),COLORRED;
             STICKLINE(C<=MA(C,7),C,O,3,0),COLORGREEN;
             STICKLINE(C<=MA(C,7),H,L,0,0),COLORGREEN;
8.均线多头排列   N  N1  N2  N3 日均线呈多头排列  并且收阳(条件选股公式)

            A1:=MA(CLOSE,N);
            A2:=MA(CLOSE,N1);
            A3:=MA(CLOSE,N2);
            A4:=MA(CLOSE,N3);
       CLOSE>A1 AND A1>A2 AND A2>A3 AND A3>A4 AND CLOSE>OPEN;
    

  或者是:   A1:=MA(CLOSE,N);
            A2:=MA(CLOSE,N1);
            A3:=MA(CLOSE,N2);
            A4:=MA(CLOSE,N3);
COUNT(A1>A2 AND A2>A3 AND A3>A4,3);     

该句的意思:统计3日中满足A1>A2ANDA2>A3ANDA3>A4的天数 

 

9.均线空头排列   (条件选股公式)

            A1:=MA(CLOSE,N);
            A2:=MA(CLOSE,N1);
            A3:=MA(CLOSE,N2);
             A4:=MA(CLOSE,N3);
     CLOSE<A1 AND A1<A2 AND A2<A3 AND A3<A4 AND CLOSE<OPEN;

或者是    A1:=MA(CLOSE,N);
          A2:=MA(CLOSE,N1);
          A3:=MA(CLOSE,N2);
          A4:=MA(CLOSE,N3);
  COUNT(A1<A2 AND A2<A3 AND A3<A4,3);

 

10.均线黏合  

A1:=MA(C,5);
A2:=MA(C,10);
A3:=MA(C,20);
A4:=MA(C,30);
AA:=(A1+A2+A3+A4)/4;
SX:=AA*(N/100)+AA;
XX:=AA-AA*(N/100);
BETWEEN(A1,SX,XX);

其中,A1,A2,A3,A4分别代表不同周期的均线。函数BETWEEN的意思是介于两个数之间。N为黏合度,一般为2或3。也可使用这个公式:

MA1:=MA(C,5);
MA2:=MA(C,10);
MA3:=MA(C,20);
P1:=ABS(MA1-MA2)+ABS(MA2-MA3);
P1/C<M/100 AND MA1>REF(MA1,1) AND MA2>REF(MA2,1);

其中前三句是三根均线,P1是第一根均线减第二根均线的绝对值与第二根均线减第三根均线差的绝对值之和,最后一句是P1与收盘价的比值小于一定比率m%,该比率一般在2%以下,同时前两根均线今日比昨日上翘。

 

11.通用的二次金叉公式

   MACD在零柱线以下二次金叉:

指标线1:="MACD.DIFF";
指标线2:="MACD.DEA";
低位二次金叉:COUNT(CROSS(指标线1,指标线2) AND 指标线2<0,20)>=2 AND CROSS(指标线1,指标线2) AND 指标线2<0;
DRAWTEXT(低位二次金叉,1,"MACD低位二次金叉");

 


          

 

 杀庄主图指标杀庄主图指标主图:白刀进 红刀出    (非常重要,非常好用)

MA6:MA(C,6),COLOR0000FF;
MA18:MA(C,18),COLOR0096FF;
MA30:MA(C,30),COLOR00FF99;
MA60:MA(C,60),COLORFF00FF;
M250:MA(C,250),COLORRED,LINETHICK3;
LC:=REF(CLOSE,1);
RSI:=SMA(MAX(CLOSE-LC,0),4,1)/SMA(ABS(CLOSE-LC),4,1)*100;
VAR27:=REF(CLOSE,1);
VAR28:=SMA(MAX(CLOSE-VAR27,0),5,1)/SMA(ABS(CLOSE-VAR27),6,1)*100;
VARA:=((AMOUNT)/(VOL))/(100);
VARB:=((3)*(HIGH)+LOW+OPEN+(2)*(CLOSE))/(7);
VARC:=((SUM(AMOUNT,7))/(VARA))/(100);
VARD:=DMA(VARB,(VOL)/(VARC));
VARE:=((CLOSE-VARD)/(VARD))*(100);
VARF:=((CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34)))*(100);
VARJ:=MA(VARE,20)+STD(VARE,20);
VARH:=(C+L+H)/3;
VARL:=EMA(VARH,6);
VARG:=EMA(VARL,5);
BIAS18:=((CLOSE-MA(CLOSE,18))/(MA(CLOSE,18)))*(100);
AA:=SMA(VARF,3,1);
VAR1:=ZIG(3,10)<REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)>REF(ZIG(3,10),2);
VAR2:=ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)<REF(ZIG(3,10),2);
STICKLINE(VAR1,H,L,8,0),COLORFF00FF,LINETHICK2;{高位红色}
STICKLINE(VAR1,H,L,3,0),COLORFF00FF,LINETHICK2;{高位红色}
STICKLINE(VAR1,H,L,1,0),COLORFF00FF,LINETHICK2;{高位红色}
STICKLINE(VAR2,H,L,8,0),COLORWHITE,LINETHICK2;{底位白色}
STICKLINE(VAR2,H,L,3,0),COLORWHITE,LINETHICK2;{底位白色};
STICKLINE(CROSS(VARL,VARG),H,L,2,1),COLORYELLOW;  

 

 

 


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多