MACD背离指标通达信

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

{参数:SHORT:12 LONG:26 M:9}
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA : EMA(DIFF,M);
MACD : 2*(DIFF-DEA), COLORSTICK,COLOR5454FF;
DD:=C=HHV(C,180);
EE:=DEA< REF(DEA,1) AND REF(DEA< REF(DEA,1),1)=1;
CC:=C> REF(C,1) AND REF(C> REF(C,1),1)=1;
上升背离:(CC AND EE)*DEA,COLOR00FFFF;
顶背离:(DD AND EE AND DEA< HHV(DEA,180))*DEA,STICK,LINETHICK3,COLORGREEN;
FF:=C=LLV(C,180);
GG:= DEA> REF(DEA,1) AND REF(DEA> REF(DEA,1),1)=1;
LL:=C< REF(C,1) AND REF(C< REF(C,1),1)=1;
下降背离:(LL AND GG)*DEA,COLORMAGENTA;
底背离:(FF AND GG AND DEA> LLV(DEA,180))*DEA,STICK,LINETHICK3,COLORRED;
MM:=IF(MACD< 0,MACD,0);
JJ:=MM> REF(MM,1);
ZZ:=REF(JJ,1)=1;
介入区:(JJ AND ZZ)*DEA,POINTDOT,COLORRED;{MACD蓝柱缩短---指今日比昨天短}
STICKLINE(介入区=DEA,DEA,DIFF,3,0),COLORRED;
DRAWTEXT(CROSS(DIFF,DEA ),0,'金\N叉'),COLORCYAN;
DRAWTEXT(CROSS(DEA,DIFF ),0,'死叉'),COLORGREEN;
主力潜伏
N:=14;
M:=156;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:(TYP-MA(TYP,N))/(0.15*AVEDEV(TYP,N));
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
主力潜伏中:COUNT(MACD<0,10)=10,COLORRED,LINETHICK0;
STICKLINE(主力潜伏中,0,MACD*30,8,0),COLORRED;
100,COLOR1C1C1C;
0,COLOR1C1C1C;
-100,COLOR1C1C1C;
-100,STICK,COLOR1C1C1C;

2.【通达信】资金监控(主力撤、主力撤、趋势线、准备现金)-指标公式源码
V1:=(C*2+H+L)/4*10;
V2:=EMA(V1,13)-EMA(V1,34);
V3:=EMA(V2,5); V4:=2*(V2-V3)*5.5;
主力撤: IF(V4<=0,V4,0),COLORBLUE;
主力进: IF(V4>=0,V4,0),COLORFF00FF;
V5:=(HHV(INDEXH,8)-INDEXC)/(HHV(INDEXH,8)-LLV(INDEXL,8))*8;
V6:=EMA(3*V5-2*SMA(V5,18,1),5);
V7:=(INDEXC-LLV(INDEXL,8))/(HHV(INDEXH,8)-LLV(INDEXL,8))*10;
V8:=(INDEXC*2+INDEXH+INDEXL)/4;
V9:=EMA(V8,13)-EMA(V8,34);
VA:=EMA(V9,3);
VB:=(V9-VA)/2;
大盘资金进场:IF(VB>=0,VB,0),COLORRED;
大盘资金撤走:IF(VB<=0,VB,0),COLORGREEN;
V11:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA(SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1),3,1);
趋势线: EMA(V11,3);
V12:=(趋势线-REF(趋势线,1))/REF(趋势线,1)*100;
准备现金: STICKLINE(趋势线<=13,0,20,5,0),COLORCC9900;
AA:=(趋势线<=13) AND FILTER((趋势线<=13),15);
DRAWTEXT (AA,30,'准备现金'),COLORCC9900;
买入股票: STICKLINE(趋势线<=13 AND V12>13,0,50,5,0),COLOR0099FF;
BB:= (趋势线<=13 AND V12>13) AND FILTER((趋势线<=13 AND V12>13),10) ;
DRAWTEXT (BB,60,'买入股票'),COLOR0099FF;
卖临界: STICKLINE(趋势线>90 AND 趋势线>REF(趋势线,1),100,95,15,1),COLORFFFF00;
见顶清仓:FILTER(趋势线>90 AND 趋势线DRAWTEXT( 见顶清仓,90,'逃顶'),COLORYELLOW;
CC:=(趋势线>=90 AND V12) AND FILTER((趋势线>=90 AND V12),10);
STICKLINE(大盘资金进场 AND 趋势线<13,0,30,10,0),COLORRED;
STICKLINE(大盘资金撤走 AND 趋势线>90,0,30,10,0),COLORGREEN;
STICKLINE(主力进 AND 趋势线<13,0,40,10,0),COLORFF00FF;


STICKLINE(主力撤 AND 趋势线>90,0,40,10,0),COLORBLUE;

3.通达信分时买点指标公式【买卖、主力差、散户差】
A1:=(DVOL/C)/2,NODRAW;A2:=SUM(IF(A1>100 AND CLOSE>REF(CLOSE,1),A1,0),0);A3:=SUM(IF(A1>100 AND CLOSEREF(CLOSE,1),A1,0),0);A5:=SUM(IF(A1<100 AND CLOSE0 AND REF(主力差,1)<=0,C*0.85,'●机构'),COLORRED;DRAWTEXT(主力差<0 AND REF(主力差,1)>=0,-C*0.85,'○机构'),COLORWHITE;DRAWTEXT(散户差>0 AND REF(散户差,1)<=0,C*0.15,'▲散户'),COLORCYAN;DRAWTEXT(散户差<0 AND REF(散户差,1)>=0,-C*0.15,'△散户'),COLORWHITE;

 
4.通达信主力资金分时指标公式【大盘资金进场、准备现金、见顶清仓】
V1:=(C*2+H+L)/4*10;V2:=EMA(V1,13)-EMA(V1,34);V3:=EMA(V2,5); V4:=2*(V2-V3)*5.5;主力撤: IF(V4<=0,V4,0),COLORGREEN;主力进: IF(V4>=0,V4,0);V5:=(HHV(INDEXH,8)-INDEXC)/(HHV(INDEXH,8)-LLV(INDEXL,8))*8;V6:=EMA(3*V5-2*SMA(V5,18,1),5);V7:=(INDEXC-LLV(INDEXL,8))/(HHV(INDEXH,8)-LLV(INDEXL,8))*10;V8:=(INDEXC*2+INDEXH+INDEXL)/4;V9:=EMA(V8,13)-EMA(V8,34);VA:=EMA(V9,3);VB:=(V9-VA)/2;
大盘资金进场:IF(VB>=0,VB,0),COLORYELLOW;
大盘资金撤走:IF(VB<=0,VB,0),COLORRED;V11:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA(SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1),3,1);
趋势线: EMA(V11,3);V12:=(趋势线-REF(趋势线,1))/REF(趋势线,1)*100;
准备现金: STICKLINE(趋势线<=13,0,20,5,0),COLORCC9900;AA:=(趋势线<=13) AND FILTER((趋势线<=13),15);DRAWTEXT (AA,30,'准备现金'),COLORCC9900;买入股票: STICKLINE(趋势线<=13 AND V12>13,0,50,5,0),COLOR0099FF;BB:= (趋势线<=13 AND V12>13) AND FILTER((趋势线<=13 AND V12>13),10) ;DRAWTEXT (BB,60,'买入股票'),COLOR0099FF;
见顶清仓: STICKLINE(趋势线>=90 AND V12,0,30,5,0),COLORRED;CC:=(趋势线>=90 AND V12) AND FILTER((趋势线>=90 AND V12),10);

5.【通达信】主力资金流(买量、卖量)-指标公式源码
AA:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
买量:=IF(CLOSE>OPEN,AA*(HIGH-LOW),IF(CLOSE卖量:=IF(CLOSE>OPEN,0-AA*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE进出量:=买量+卖量,COLOR00FFFF;STICKLINE(进出量<0,0,进出量,1,0),COLORFF6600;
STICKLINE(进出量<0,0,进出量,3,0),COLORFF9900;
STICKLINE(进出量<0,0,进出量,1.5,0),COLORFFCC00;
STICKLINE(进出量<0,0,进出量,0.5,0),COLORCYAN;
STICKLINE(进出量>0,0,进出量,3,0),COLOR000099;
STICKLINE(进出量>0,0,进出量,3,0),COLOR0000CC;
STICKLINE(进出量>0,0,进出量,1.0,0),COLOR0000FF;
STICKLINE(进出量>0,0,进出量,0.5,0),COLORCC66FF;N:=1;QJ0:=(HIGH+LOW+CLOSE)/3;
QJ1:=I

F(HIGH=LOW,1,HIGH-MAX(OPEN,CLOSE));
QJ2:=IF(HIGH=LOW,1,MAX(CLOSE,OPEN)-QJ0);
QJ3:=IF(HIGH=LOW,1,MIN(OPEN,CLOSE)-LOW);
QJ4:=IF(HIGH=LOW,1,QJ0-MIN(CLOSE,OPEN));
QJ5:=VOL/(IF(HIGH=LOW,4,HIGH-LOW));
QJ6:="MACD.DIF">"MACD.DEA" AND "MACD.DEA"<0;
QJ7:="KDJ.K">"KDJ.D" AND "KDJ.D"<30;
QJ8:="MACD.DIF"<"MACD.DEA";
QJ9:="KDJ.K"<"KDJ.D" AND "KDJ.K">80;
特大:QJ4*QJ5,NODRAW;大单:QJ3*QJ5,NODRAW;
中单:QJ1*QJ5,NODRAW;小单:QJ2*QJ5,NODRAW;
W1:=SUM(大单,N)+SUM(特大,N);W2:=SUM(小单,N)+SUM(中单,N);
量振1:=特大>大单 AND 大单>小单;
量振2:=特大<小单 AND 大单<小单;
标振1:=QJ6 AND QJ7;
标振2:=QJ8 AND QJ9;
A:=W1-W2;A0:=IF(A>0,A,0);B0:=IF(A<0,A,0);
STICKLINE(A0,0,A0,1,0),COLOR000044;主力持仓:EMA(100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34)),3),COLORFF00FF;主力筹码集中度:WINNER(C)*100,COLORRED;

6.【通达信】主力资金进入(开始控盘、主力出货、主力吸货)-指标公式源码
VAR2:=(((CLOSE - MA(CLOSE,6)) / MA(CLOSE,6)) * 100);
VAR3:=(((CLOSE - MA(CLOSE,12)) / MA(CLOSE,12)) * 100);
VAR4:=(((CLOSE - MA(CLOSE,24)) / MA(CLOSE,24)) * 100);
VAR5:=(((VAR2 + (2 * VAR3)) + (3 * VAR4)) / 6);
VAR6:=MA(VAR5,3);
开始控盘:=STICKLINE((VAR6 <= (0 - 10)),0,(0 - 20),3.5,0),COLOR00AAFF;
STICKLINE((VAR6 <= (0 - 10)),0,(0 - 20),3.5,0),COLOR0044FF;
STICKLINE((VAR6 <= (0 - 10)),0,(0 - 20),2.5,0),COLOR0088FF;
STICKLINE((VAR6 <= (0 - 10)),0,(0 - 20),3,0),COLOR00AAFF;
VAR1:=EMA(EMA(CLOSE,3),1);
控盘:=(VAR1-REF(VAR1,1))/REF(VAR1,1)*1000;
STICKLINE(控盘<0,控盘,0,3.5,0),COLORFFAA00;
STICKLINE(控盘<0,控盘,0,3.5.2,0),COLORFF4400;
STICKLINE(控盘<0,控盘,0,2.5,0),COLORFF8800;
STICKLINE(控盘<0,控盘,0,0,0),COLORFFAA00;
主力出货:0,COLORFFAA00;
STICKLINE(控盘>REF(控盘,3) AND 控盘>0,控盘,0,3.5,0),COLOR000088;
STICKLINE(控盘>REF(控盘,3) AND 控盘>0,控盘,0,2.5,0),COLOR0000AA;
STICKLINE(控盘>REF(控盘,3) AND 控盘>0,控盘,0,1.5,0),COLOR0000CC;
STICKLINE(控盘>REF(控盘,3) AND 控盘>0,控盘,0,1,0),COLOR0000EE;
主力吸货:0,COLOR0000FF;
STICKLINE(控盘0,控盘,0,3.5,0),COLOR008800;
STICKLINE(控盘0,控盘,0,2.5,0),COLOR00AA00;
STICKLINE(控盘0,控盘,0,1.5,0),COLOR00CC00;
STICKLINE(控盘0,控盘,0,1,0),COLOR00EE00;
STICKLINE(DDX<0,0,DDX,3.5,0),COLOR008800;
STICKLINE(DDX<0,0,DDX,2.5,0),COLOR00AA00;
STICKLINE(DDX<0,0,DDX,1.5,0),COLOR00CC00;
STICKLINE(DDX<0,0,DDX,1,0),COLOR00EE00;
对倒出货洗盘:0,COLOR00FF00;
黄色底部吸货:0,COLORYELLOW;
DRAWTEXT(CROSS(控盘,0),0-3,'买。追'),COLORFF00FF;
DRAWTEXT(CROSS(0,控盘),0-0,'卖'),COLORGREEN;
DATA:=5;
{多头买入} DRAWICON(ZIG(3,DATA)>REF(ZIG(3,DATA),1)
AND REF(ZIG(3,DATA),1)<=REF(ZIG(3,DATA),2)
AND REF(ZIG(3,DATA),2)<=REF(ZIG(3,DATA),3),L*0.98,1);
{多头卖出} DRAWICON(ZIG(3,DATA)AND REF(ZIG(3,DATA),1)>=REF(ZIG(3,DATA),2)
AND REF(ZIG(3,DATA),2)>=REF(Z

IG(3,DATA),3),H*1.02,2);

8.【通达信】主力操盘轨迹(副图)-指标公式源码
RSV:=(CLOSE-LLV(LOW,7))/(HHV(HIGH,7)-LLV(LOW,7))*100;
短K:SMA(RSV,3,1),COLORWHITE;
短D:SMA(短K,3,1),COLORYELLOW;
RSV1:=(CLOSE-LLV(LOW,38))/(HHV(HIGH,38)-LLV(LOW,38))*100;
长K:SMA(RSV1,5,1),COLORRED;
长D:SMA(长K,10,1),COLOR66CC33;
18,COLORWHITE;
85,COLORBLUE;
STICKLINE(短K>短D,短K,短D,6,0),COLORYELLOW;
STICKLINE(短K<=短D,短K,短D,6,0),COLORGREEN;
STICKLINE(长K>长D,长K,长D,6,0),COLORRED;
STICKLINE(长K<=长D,长K,长D,6,0),COLOR669933;

9.【通达信】主力异动(副图)-指标公式源码
HSCOL:VOL/CAPITAL*100,LINETHICK2;
STICKLINE(HSCOL>REF(HSCOL,1),HSCOL ,0,3,0),COLORRED;
STICKLINE(HSCOL>REF(HSCOL,1),HSCOL ,0,1.2,0),COLORF00FF0;
STICKLINE( HSCOL>REF(HSCOL,1),HSCOL,0,0.01,0),COLORWHITE;
STICKLINE(HSCOL<=REF(HSCOL,1),HSCOL,0,3.5,0),COLORBLUE;
STICKLINE(HSCOL<=REF(HSCOL,1),HSCOL,0,1.5,0),COLORBLUE;
STICKLINE(HSCOL<=REF(HSCOL,1),HSCOL ,0,0.8,0),COLORGRAY;
STICKLINE(HSCOL<=REF(HSCOL,1),HSCOL,0,0.01,0),COLORWHITE;
十日累计:SUM(HSCOL,10),NODRAW;
STICKLINE(HSCOL>5,5,HSCOL,0.8,0),COLOR00FFFF;
STICKLINE(HSCOL>17,17,HSCOL,1,0),COLORGREEN;
换手率过5金色:0,NODRAW,COLOR00FFFF;
低位绿庄家进货:0,NODRAW,COLOR0000FF;
高位绿庄家出货:0,NODRAW,COLOR00FF80;

10.【通达信】主力散户资金(游资、散户、游资、警戒线)-指标公式源码
A:=IF((CLOSE>126.32),(AMOUNT)/(100000),VOL);
主力:MA(A,4),LINETHICK0,COLORYELLOW;
游资:MA(A,8),LINETHICK0,COLOR00FF00;
大户:MA(A,16),LINETHICK0,COLORRED;
散户:MA(A,32),LINETHICK0,COLORF0F000;
主比:ABS(((主力)/(主力 + 游资 + 大户 + 散户))*(100)),LINESTICK,COLORYELLOW;
游比:ABS(((游资)/(主力 + 游资 + 大户 + 散户))*(100)),LINESTICK,COLOR00FF00;
大比:ABS(((大户)/(主力 + 游资 + 大户 + 散户))*(100)),LINESTICK,COLORRED;
散比:ABS(((散户)/(主力 + 游资 + 大户 + 散户))*(100)),LINESTICK,COLORF0F000;
警戒线:MA(A,180),COLORFF66FF,LINETHICK1;
STICKLINE((主力 > 0),0,主力,3,0),COLOR009CFF;
STICKLINE((主力 > 0),0,主力,2.8,0),COLOR009CFF;
STICKLINE((主力 > 0),0,主力,2.5,0),COLOR00C0FF;
STICKLINE((主力 > 0),0,主力,1.5,0),COLOR00D1FF;
STICKLINE((主力 > 0),0,主力,1,0),COLOR00EAFF;
STICKLINE((主力 > 0),0,主力,0.7,0),COLORYELLOW;
STICKLINE((游资 > 0),0,游资,3,0),COLOR00C100;
STICKLINE((游资 > 0),0,游资,2.8,0),COLOR00CA00;
STICKLINE((游资 > 0),0,游资,2.5,0),COLOR00D300;
STICKLINE((游资 > 0),0,游资,1.5,0),COLOR00DB00;
STICKLINE((游资 > 0),0,游资,1,0),COLOR00EA00;
STICKLINE((游资 > 0),0,游资,0.7,0),COLORGREEN;
STICKLINE((大户 > 0),0,大户,3,0),COLOR1020AA;
STICKLINE((大户 > 0),0,大户,2.8,0),COLOR1020BB;
STICKLINE((大户 > 0),0,大户,2.5,0),COLOR1020CC;
STICKLINE((大户 > 0),0,大户,1.5,0),COLOR1020DD;
STICKLINE((大户 > 0),0,大户,1,0),COLOR1020EE;
STICKLINE((大户 > 0),0,大户,0.7,0),COLORRED;
STICKLINE((散户

> 0),0,散户,3,0),COLORFF7700;
STICKLINE((散户 > 0),0,散户,2.8,0),COLORFF8800;
STICKLINE((散户 > 0),0,散户,2.5,0),COLORFF9900;
STICKLINE((散户 > 0),0,散户,1.5,0),COLORFFAA00; STICKLINE((散户 > 0),0,散户,1,0),COLORFFBB00;
STICKLINE((散户 > 0),0,散户,0.7,0),COLORLIBLUE

11.【通达信】主力买卖盘(机构买盘、散户买盘)-指标公式源码
A1:=(DVOL/CLOSE)/2;
A2:=SUM(IF(A1>100 AND CLOSE>REF(CLOSE,1),A1,0),0);
A3:=SUM(IF(A1>100 AND CLOSEA4:=SUM(IF(A1<100 AND CLOSE>REF(CLOSE,1),A1,0),0);
A5:=SUM(IF(A1<100 AND CLOSE机构买盘:A2,LINETHICK8,COLOR5555FF;
机构卖盘:A3,LINETHICK8,COLOR55FF55;
散户买盘:A4,COLORFF55FF;
散户卖盘:A5,COLORFFFF55;
内盘:=DYNAINFO(22) ;
外盘:=DYNAINFO(23) ;
外内盘差:(外盘-内盘),NODRAW;
STICKLINE(外内盘差>0,机构买盘,机构卖盘,0.000001,0 ),COLORRED;
STICKLINE( 外内盘差<0,机构买盘,机构卖盘,0.000001,0 ),COLORGREEN;
STICKLINE(外内盘差>0 AND 机构买盘=机构卖盘,散户买盘,散户卖盘,0.000001,0 ),COLORRED;
STICKLINE( 外内盘差<0 AND 机构买盘=机构卖盘,散户买盘,散户卖盘,0.000001,0 ),COLORGREEN;

12.【通达信】主力爆发(低位金叉跟进、锁定筹码、锁定区)-指标公式源码
VAR0:=DYNAINFO(5);
VAR1:=BARSCOUNT(HIGH);
VAR2:=(SMA((HIGH / HHV(CLOSE,120)),3,1) * 100);
低位金叉跟进:=IF((VAR1 > 20),VAR2,0);
VAR11:=IF((HIGH < VAR0),0,IF((LOW > VAR0),1,(((VAR0 - HIGH) + 0.009) / ((LOW - HIGH) + 0.009))));
AAA:=(DMA(VAR11,(VOL /SUM(VOL,90))) * 60);
BBB:=(DMA(VAR11,(VOL / CAPITAL)) * 60);
VAR12:=IF(C>1000,AAA,BBB);
VAR3:=IF((((VAR12 > 0) AND (VAR12 > REF(VAR12,1))) AND (低位金叉跟进 >= 88)),VAR2,0);
VAR4:=((3 * SMA((((CLOSE - HHV(HIGH,27)) / (LLV(LOW,27) - HHV(HIGH,27))) * 100),5,1)) - (2 * SMA(SMA((((HIGH - HHV(HIGH,27)) / (LLV(LOW,27) - HHV(HIGH,27))) * 100),5,1),3,1)));
VAR5:=EMA(VAR4,8);
VAR6:=((3 * SMA((((HIGH - HHV(HIGH,55)) / (LLV(LOW,55) - HHV(HIGH,55))) * 100),5,1)) - (2 * SMA(SMA((((HIGH - HHV(HIGH,55)) / (LLV(LOW,55) - HHV(HIGH,55))) * 100),5,1),3,1)));
VAR7:=(EMA(VAR6,3) - 10);
A:=1.1*C;
B:=0.9*C;
B1:=100*(WINNER(A)-WINNER(B));
C1:=MA(C,13)D1:=IF(C>1000,CROSS(VAR3,22),CROSS(VAR3,24));
锁定筹码:=100-B1,COLOR0084FF;
锁定区:STICKLINE(锁定筹码>70 AND C1,0,锁定筹码-65,8,0),COLOR0000FF;

主力资金:EMA(100*(C-LLV(LOW,34))/(HHV(H,34)-LLV(LOW,34)),3), COLORRED,LINETHICK2;
即将爆发线: 65,COLOR00FF00;
爆发线:80,COLORWHITE,LINETHICK1;
DRAWTEXT(CROSS(主力资金,爆发线),主力资金,'★爆发!') ,COLORYELLOW;
爆发警戒线: 50,COLOR00FF00;
抄底线:20,COLORWHITE,LINETHICK2;
DRAWTEXT(CROSS(主力资金,抄底线),主力资金,'★抄底') ,COLORWHITE;
DRAWTEXT(CROSS(主力资金,爆发警戒线),主力资金,'★加仓') ,COLORWHITE;
DRAWTEXT(CROSS(主力资金,即将爆发线),主力资金,'★加仓') ,COLORWHITE;
DRAWTEXT(CROSS(爆发线,主力资

金),爆发线,'★空仓') ,COLORWHITE;
LC:= REF(C,1);
F1:=ZIG(3,15);
方向:IF((F1> REF(F1,1)),5,105),COLOR00FF00,LINETHICK2;
DRAWTEXT(CROSS(抄底线,方向),抄底线,'★逢低进场!') ,COLORRED;
DRAWTEXT(CROSS(方向,抄底线),方向+20,'★逢高出场!') ,COLORWHITE;

注意:公式中如出现:(( 为:和(( 公式中如出现:D 为:和D

选股公式只是用来缩小分析范围的工具

在选股公式中只允许有一条输出语句,因此在改之前要把所有的STICKLINE语句、DARWICON语句及DARWTEXT语句全部删除。再把所有的画线语句如该公式中的“指导线: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; ”。
最后仅保留所需要的选股语句,如该公式中的“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(买线,卖线);

公式只是工具,出现以下含有未来函数的公式,大家可仅作参考
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)-L

LV(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:= GJTJ4F:=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);

操盘手
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(CROS

S(GJTJ4,GJTJ2));
DQ:=GJTJ3EQ:=BARSLAST(CROSS(GJTJ4,GJTJ3))>3 AND BARSLAST(CROSS(GJTJ1,GJTJ4))<3;
FQ:=GJTJ2AW:=BARSLAST(CROSS(95,GJTJ1))<=2;
BW:=BARSLAST(CROSS(95,GJTJ2))<=2;
EW:= GJTJ4FW:=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));
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



相关文档
最新文档