您现在的位置:程序化交易>> 股票公式>> 同花顺>> 同花顺公式>>正文内容

同花顺美人开眼公式公式、代码源码[同花顺公式]

相关标签:

 

 

原理解析:

LONG赋值:26
M赋值:9
SHORT赋值:12
DIFF1赋值:收盘价的SHORT日指数移动平均 - 收盘价的LONG日指数移动平均
DEA1赋值:DIFF1的M日指数移动平均
MACD赋值:2*(DIFF1-DEA1)
输出DIFF : 收盘价的SHORT日指数移动平均 - 收盘价的LONG日指数移动平均,COLORFF00FF,线宽为2
输出DEA : DIFF1的M日指数移动平均,画白色,线宽为2
输出AH:55日内DIFF1的最高值,COLOR6600FF,线宽为2
输出AL:55日内DIFF1的最低值,COLOR248A24,线宽为2
输出●60零上金叉:如果DIFF上穿DEAANDDIFF>0,返回0.3,否则返回0,COLOR6600FF,POINTDOT
当满足条件●60零上金叉时,在DIFF和AH位置之间画柱状线,宽度为4,0不为0则画空心柱.,COLOR6600FF
输出■零下金叉:如果DIFF上穿DEAANDDIFF<-0.001,返回0.3,否则返回0,画白色,POINTDOT
当满足条件■零下金叉时,在0.1和0.15位置之间画柱状线,宽度为6,0不为0则画空心柱.,画白色
JCCOUNT赋值:统计上次DEA>=0距今天数日中满足DIFF上穿DEA的天数
输出■二次金叉:如果DIFF上穿DEAANDDEA<0ANDCOUNT(JCCOUNT=2,21)=1,返回0.2,否则返回0,COLOR3C86CC,POINTDOT
当满足条件■二次金叉时,在0.15和0.2位置之间画柱状线,宽度为6,0不为0则画空心柱.,COLOR3C86CC
A3赋值:DIFF上穿DEA AND DEA<0
输出■零下二次金叉:如果统计21日中满足A3的天数=2的10日过滤ANDDEA<0,返回0.05,否则返回0,COLORF58F98,POINTDOT
当满足条件■零下二次金叉时,在0.25和0.3位置之间画柱状线,宽度为6,0不为0则画空心柱.,COLORF58F98
A1赋值:上次1日前的DIFF上穿DEA距今天数
输出■底背离:如果A1+1日前的收盘价>CLOSEANDDIFF>A1+1日前的DIFFANDCROSS(DIFF,DEA),返回0.1,否则返回0,COLORFFFF00
当满足条件A1+1日前的收盘价>CLOSEANDDIFF>A1+1日前的DIFFANDCROSS(DIFF,DEA)时,在0和AL位置之间画柱状线,宽度为4,0不为0则画空心柱.,COLOR00FF00
当满足条件■底背离时,在0.2和0.25位置之间画柱状线,宽度为6,0不为0则画空心柱.,COLORFFFF00
当满足条件A1=0时,在DEA位置画直线起点,当满足条件■底背离时,在DEA位置画直线终点,0表示是否延长.,画黄色
A2赋值:上次1日前的DEA上穿DIFF距今天数
当满足条件A2+1日前的收盘价<CLOSEANDREF(DIFF,A2+1)>DIFFANDCROSS(DEA,DIFF)时,在0和DIFF位置之间画柱状线,宽度为4,0不为0则画空心柱.,画黑色
顶背离赋值:A2+1日前的收盘价<收盘价 AND A2+1日前的DIFF>DIFF AND DEA上穿DIFF
当满足条件A2=0时,在DEA位置画直线起点,当满足条件顶背离时,在DEA位置画直线终点,0表示是否延长.,画绿色
DD赋值:收盘价=100日内收盘价的最高值
EE赋值:DEA1< 1日前的DEA1 AND 1日前的DEA1<1日前的DEA1=1
CC赋值:收盘价> 1日前的收盘价 AND 1日前的收盘价>1日前的收盘价=1
输出上升背离:(CC AND EE)*AH,STICK,线宽为2,COLORFF00FF
输出顶背离:(DD AND EE AND DEA1< 100日内DEA1的最高值)*AH,STICK,线宽为2,画黄色
当满足条件顶背离时,在DEA1/2位置书写文字,ALIGN1,画黄色
FF赋值:收盘价=100日内收盘价的最低值
GG赋值: DEA1> 1日前的DEA1 AND 1日前的DEA1>1日前的DEA1=1
LL赋值:收盘价< 1日前的收盘价 AND 1日前的收盘价<1日前的收盘价=1
输出下降背离:(LL AND GG)*AL,STICK,线宽为2,画白色
输出底背离:(FF AND GG AND DEA1> 100日内DEA1的最低值)*AL,STICK,线宽为2,COLOR6600FF
当满足条件底背离时,在DEA1/2位置书写文字,ALIGN1,COLOR6600FF
输出G1:如果DIFF<0,返回DIFF,否则返回0,COLORFF00FF,线宽为2
输出G2:如果DIFF<0,返回0,否则返回DIFF,画黄色,线宽为2
输出G3:如果DIFF<DEA,返回DIFF,否则返回DEA,COLORFFFF00,线宽为2
输出G4:如果DIFF>DEA,返回DEA,否则返回DEA,画白色,线宽为2
PARTLINE(DEA,DEA>0,自定色),线宽为2
PARTLINE(DEA,DEA<0,自定色),线宽为2
PARTLINE(DIFF,DIFF>0,自定色),线宽为2
PARTLINE(DIFF,DIFF<0,自定色),线宽为2
当满足条件MACD<1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为8,0不为0则画空心柱.,COLOR008800
当满足条件MACD<1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为7,0不为0则画空心柱.,COLOR009900
当满足条件MACD<1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为6,0不为0则画空心柱.,COLOR00AA00
当满足条件MACD<1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为5,0不为0则画空心柱.,COLOR00BB00
当满足条件MACD<1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为4,0不为0则画空心柱.,COLOR00CC00
当满足条件MACD<1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为3,0不为0则画空心柱.,COLOR00DD00
当满足条件MACD<1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为2,0不为0则画空心柱.,COLOR00EE00
当满足条件MACD<1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为1,0不为0则画空心柱.,COLOR00FF00
当满足条件MACD>=1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为8,0不为0则画空心柱.,COLOR000088
当满足条件MACD>=1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为7,0不为0则画空心柱.,COLOR000099
当满足条件MACD>=1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为6,0不为0则画空心柱.,COLOR0000AA
当满足条件MACD>=1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为5,0不为0则画空心柱.,COLOR0000BB
当满足条件MACD>=1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为4,0不为0则画空心柱.,COLOR0000CC
当满足条件MACD>=1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为3,0不为0则画空心柱.,COLOR0000DD
当满足条件MACD>=1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为2,0不为0则画空心柱.,COLOR0000EE
当满足条件MACD>=1日前的MACDANDMACD>0时,在0和MACD位置之间画柱状线,宽度为1,0不为0则画空心柱.,COLOR0000FF
当满足条件MACD>1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为8,0不为0则画空心柱.,COLOR338FDD
当满足条件MACD>1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为7,0不为0则画空心柱.,COLOR339FDD
当满足条件MACD>1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为6,0不为0则画空心柱.,COLOR33AFDD
当满足条件MACD>1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为5,0不为0则画空心柱.,COLOR33BFDD
当满足条件MACD>1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为4,0不为0则画空心柱.,COLOR33CFDD
当满足条件MACD>1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为3,0不为0则画空心柱.,COLOR33DFDD
当满足条件MACD>1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为2,0不为0则画空心柱.,COLOR33EFDD
当满足条件MACD>1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为1,0不为0则画空心柱.,COLOR33FFDD
当满足条件MACD<=1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为8,0不为0则画空心柱.,COLORFF4400
当满足条件MACD<=1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为7,0不为0则画空心柱.,COLORFF6600
当满足条件MACD<=1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为6,0不为0则画空心柱.,COLORFF7700
当满足条件MACD<=1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为5,0不为0则画空心柱.,COLORFF8800
当满足条件MACD<=1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为4,0不为0则画空心柱.,COLORFF9900
当满足条件MACD<=1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为3,0不为0则画空心柱.,COLORFFAA00
当满足条件MACD<=1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为2,0不为0则画空心柱.,COLORFFBB00
当满足条件MACD<=1日前的MACDANDMACD<0时,在0和MACD位置之间画柱状线,宽度为1,0不为0则画空心柱.,COLORFFCC00
VAR1赋值:53日内DEA的最高值
VAR2赋值:30日内DEA的最低值
VAR3赋值:DEA-(DIFF-DEA)
输出UP:如果DIFF>VAR1ANDDEA=VAR1,返回10日内VAR1的最低值和VAR3的较大值,否则返回VAR1,COLORBB9A00,线宽为2
输出DN:如果DIFF<VAR2ANDDEA=VAR2,返回10日内VAR2的最高值和VAR3的较小值,否则返回VAR2,COLORAA00BB,线宽为2
美人开眼赋值:DIFF上穿DEA AND DIFF上穿DN AND DN<0
输出美人开眼A:美人开眼*AL,STICK,线宽为4,COLOR8080FF
当满足条件美人开眼时,在DN位置书写文字,ALIGN1,COLOR8080FF,线宽为2
美人收眼赋值:DEA上穿DIFF AND UP上穿DIFF AND DIFF<UP
输出美人收眼A:美人收眼*AH,STICK,线宽为4,COLOR9CA010
当满足条件美人收眼时,在DN位置书写文字,ALIGN1,COLOR9CA010,线宽为2
 

源码:

 

 

 

long:=26; m:=9; short:=12;
DIFF1:=EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA1:=EMA(DIFF1,M);
MACD:=2*(DIFF1-DEA1);
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),colorff00ff,linethick2;
DEA : EMA(DIFF1,M),colorwhite,linethick2;
AH:HHV(DIFF1,55),COLOR6600ff,linethick2;
AL:LLV(DIFF1,55),COLOR248a24,linethick2;
●60零上金叉:IF(CROSS(DIFF,DEA) AND DIFF>0,0.3,0),COLOR6600ff,POINTDOT;
STICKLINE(●60零上金叉,DIFF,ah,4,0),COLOR6600ff;
■零下金叉:IF(CROSS(DIFF,DEA) AND DIFF<-0.001,0.3,0),colorwhite,POINTDOT;
STICKLINE(■零下金叉,0.1,0.15,6,0),colorwhite;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
■二次金叉:IF(CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1,0.2,0),COLOR3C86CC,POINTDOT;
STICKLINE(■二次金叉,0.15,0.2,6,0),COLOR3C86CC;
A3:=CROSS(DIFF,DEA) AND DEA<0;
■零下二次金叉:IF(FILTER(COUNT(A3,21)=2,10) AND DEA<0,0.05,0),COLORF58F98,POINTDOT;
STICKLINE(■零下二次金叉,0.25,0.3,6,0),COLORF58F98;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
■底背离:IF(REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA),0.1,0),COLORFFFF00;
STICKLINE(REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA),0,AL,4,0),COLOR00FF00;
STICKLINE(■底背离,0.2,0.25,6,0),COLORFFFF00;
DRAWLINE(A1=0,DEA,■底背离,DEA,0),coloryellow;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
STICKLINE(REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF),0,DIFF,4,0),colorblack;
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
DRAWLINE(A2=0,DEA,顶背离,DEA,0),colorgreen;
DD:=C=HHV(C,100);
EE:=DEA1< REF(DEA1,1) AND REF(DEA1< REF(DEA1,1),1)=1;
CC:=C> REF(C,1) AND REF(C> REF(C,1),1)=1;
上升背离:(CC AND EE)*AH,STICK,linethick2,COLORff00FF;
顶背离:(DD AND EE AND DEA1< HHV(DEA1,100))*AH,STICK,LINETHICK2,coloryellow;
DRAWTEXT(顶背离,DEA1/2,'顶背离'),ALIGN1,coloryellow;
FF:=C=LLV(C,100);
GG:= DEA1> REF(DEA1,1) AND REF(DEA1> REF(DEA1,1),1)=1;
LL:=C< REF(C,1) AND REF(C< REF(C,1),1)=1;
下降背离:(LL AND GG)*AL,STICK,linethick2,colorwhite;
底背离:(FF AND GG AND DEA1> LLV(DEA1,100))*AL,STICK,LINETHICK2,COLOR6600ff;
DRAWTEXT(底背离,DEA1/2,'底背离'),ALIGN1,color6600FF;
g1:IF(diff<0,diff,0),colorff00ff,linethick2;
g2:IF(diff<0,0,diff),coloryellow,linethick2;
g3:IF(diff<dea,diff,dea),colorffff00,linethick2;
g4:IF(diff>dea,dea,dea),colorwhite,linethick2;
PARTLINE(DEA,DEA>0,RGB(255,0,255)),LINETHICK2;
PARTLINE(DEA,DEA<0,RGB(255,255,225)),LINETHICK2;
PARTLINE(DIFF,DIFF>0,RGB(255,255,0)),LINETHICK2;
PARTLINE(DIFF,DIFF<0,RGB(0,0,255)),LINETHICK2;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,8,0 ),COLOr008800;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,7,0 ),COLOR009900;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,6,0 ),COLOR00aa00;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,5,0 ),COLOR00bb00;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,4,0 ),COLOR00cc00;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,3,0 ),COLOR00dd00;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR00ee00;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,1,0 ),COLOR00ff00;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,8,0 ),COLOR000088;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,7,0 ),COLOR000099;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,6,0 ),COLOR0000aa;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,5,0 ),COLOR0000bb;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,4,0 ),COLOR0000cc;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,3,0 ),COLOR0000dd;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR0000ee;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,1,0 ),COLOR0000ff;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,8,0 ),COLOR338fdd;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,7,0 ),COLOR339fdd;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,6,0 ),COLOR33afdd;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,5,0 ),COLOR33bfdd;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,4,0 ),COLOR33cfdd;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,3,0 ),COLOR33dfdd;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLOR33efdd;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,1,0 ),COLOR33ffdd;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,8,0 ),COLORFF4400;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,7,0 ),COLORFF6600;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,6,0 ),COLORFF7700;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,5,0 ),COLORFF8800;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,4,0 ),COLORFF9900;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,3,0 ),COLORFFaa00;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORFFbb00;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,1,0 ),COLORFFcc00;
VAR1:=HHV(DEA,53);VAR2:=LLV(DEA,30);VAR3:=DEA-(DIFF-DEA);
UP:IF(DIFF>VAR1 AND DEA=VAR1,MAX(LLV(VAR1,10),VAR3),VAR1),COLORbb9a00,LINETHICK2;
DN:IF(DIFF<VAR2 AND DEA=VAR2,MIN(HHV(VAR2,10),VAR3),VAR2),COLORaa00bb,LINETHICK2;
美人开眼:=CROSS(DIFF ,DEA ) AND CROSS( DIFF,DN ) AND DN<0;
美人开眼a:美人开眼*AL,STICK,linethick4,COLOR8080ff;
DRAWTEXT(美人开眼,dn,'美人开眼'),ALIGN1,COLOR8080FF,linethick2;
美人收眼:=CROSS(DEA ,DIFF ) AND CROSS( UP,DIFF ) AND DIFF<UP;
美人收眼a:美人收眼*ah,STICK,linethick4,COLOR9ca010;
DRAWTEXT(美人收眼,dn,'美人收眼'),ALIGN1,COLOR9ca010,linethick2;

 

公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程

 

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 1145508240  点击这里给我发消息进行 有偿 编写!不贵!点击查看价格!

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容