当前位置: 网站首页 > 股票软件公式 > 同花顺公式 > 文章 当前位置: 同花顺公式 > 文章

同花顺源码精选:大牛因子主图,多空判断,高位逃顶

点击: 次    来源:顶尖财经    作者:股市狙击 - 小 + 大

1、大牛因子主图

指标主要由均线、k线、macd、boll中数据构成,继而成为大牛因子

N:=26;
P:=2;
LONG:=26;
SHORT:=12;
M:=9;
 
MA5:=EMA(C,168);
MA51:=EMA(C,160);
MID : = MA(CLOSE,N);
MID1:=EMA(MID,2);
MID2:=EMA(MID,5);
UPPER: MID + P*STD(CLOSE,N);
LOWER:MID - P*STD(CLOSE,N);
DIFF := EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA  := EMA(DIFF,M);
MACD := 3*(DIFF-DEA);
A:=IF((C>MID AND DIFF>DEA AND DIFF>REF(DIFF,1)),1,0);
B:=IF(C<MID AND DIFF<DEA AND DIFF<REF(DIFF,1),2,0);
STICKLINE(B=0 AND C>MA5,MID1,MID2,25,0),colorwhite;
STICKLINE(B=0 AND C<MA5,MID1,MID2,25,0),colorwhite;
STICKLINE(A=0 AND C>MA5,MID1,MID2,25,0),colorwhite;
STICKLINE(A=0 AND C<MA5,MID1,MID2,25,0),colorwhite;
STICKLINE(A=1 AND C>MA5,MID1,MID2,25,0),colorred;
STICKLINE(A=1 AND C<MA5,MID1,MID2,25,0),colormagenta;
STICKLINE(B=2 AND C<MA5,MID1,MID2,25,0),colorgreen;
STICKLINE(B=2 AND C>MA5,MID1,MID2,25,0),colorcyan;
分界线点位:=EMA(C,168),colorblack;
分界线点位1:=EMA(C,160),colorblack;
STICKLINE(C>分界线点位,分界线点位,分界线点位1,25,0),colorred;
STICKLINE(C<分界线点位,分界线点位,分界线点位1,25,0),colorgreen;
//本代码仅供学习参考只用,因本指标系统提示产生的交易盈亏责任自负。



2、多空判断的很好的辅助工具

VAR6:=(CLOSE+HIGH+LOW)/3;
VAR7:=EMA(VAR6,10);
VAR8:=REF(VAR7,1);
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
上穿:SMA(RSV,3,1),colorred;
下穿:SMA(上穿,3,1),colorgreen;
空方:100*(1-WINNER(CLOSE)),colorred;
AA:=(O+H+L+C)/4;
BB:=MA(AA,3);
CC:=SUM(IF(AA>REF(AA,1),AA*VOL,0),4)/SUM(IF(AA<REF(AA,1),AA*VOL,0),4);
DD:=REF(100-(100/(1+CC)),1);
a1:=HHV(AA,10);
a2:=LLV(AA,30);
a3:=a1-a2;
a4:=EMA((AA-a2)/a3,1)*100;
b1:=HHV(AA,16);
b2:=LLV(AA,90);
b3:=b1-b2;
b4:=EMA((AA-b2)/b3,1)*100;
C1:=HHV(AA,30);
C2:=LLV(AA,240);
C3:=C1-C2;
C4:=EMA((AA-C2)/C3,1)*100;
多方:b4,colormagenta;
STICKLINE(上穿>80,86,94,10,0),coloryellow;
//STICKLINE(CROSS(空方,多方),0,8,10,0),colorgreen,LINETHICK2;
//股民学院 www.58188.com
//爆发线: 90,colorred;
AAA:=(O+H+L+C)/4;
AA1:=HHV(AAA,15);
AA2:=LLV(AAA,15);
AA3:=AA1-AA2;
AA4:=EMA((AAA-AA2)/AA3,2)*100;
BB1:=HHV(AAA,60);
BB2:=LLV(AAA,60);
BB3:=BB1-BB2;
BB4:=EMA((AAA-BB2)/BB3,2)*100;
STICKLINE(AA4<5 AND BB4<30,0,8,10,0),colorblack,LINETHICK2;
VAR1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);
VAR2:=SMA(ABS(LOW-VAR1),13,1)/SMA(MAX(LOW-VAR1,0),10,1);
VAR3:=EMA(VAR2,10);
VAR4:=LLV(LOW,33);
VAR5:=EMA(IF(LOW<=VAR4,VAR3,0),3);
主力进场:=IF(VAR5>REF(VAR5,1),VAR5,0),colorred;
STICKLINE(VAR5>REF(VAR5,1),0,VAR5,3,0),colorred;
VARA1:=(6*CLOSE+HIGH+LOW)/4;
VARA2:=EMA(EMA(EMA(VARA1,3),3),3);
VARA1:=(6*CLOSE+HIGH+LOW)/4;
VARA2:=EMA(EMA(EMA(VARA1,3),3),3);
J:=(VARA2-REF(VARA2,1))/REF(VARA2,1)*100, COLORSTICK;
Q:=MA(J,3),coloryellow;
P:=MA(J,1),colorff00ff;
ma5:=MA(C,5);
ma13:=MA(C,13);
ma21:=MA(C,21);
ma34:=MA(C,34);
ma55:=MA(C,55);
ma89:=MA(C,89);
ma144:=MA(C,144);
ma233:=MA(C,233);
tmp1:=IF(C>ma5,1,0);
tmp2:=IF(C>ma13,1,0);
tmp3:=IF(C>ma21,1,0);
tmp4:=IF(C>ma34,1,0);
tmp5:=IF(C>ma55,1,0);
tmp6:=IF(C>ma89,1,0);
tmp7:=IF(C>ma144,1,0);
tmp8:=IF(C>ma233,1,0);
强弱线:=tmp1+tmp2+tmp3+tmp4+tmp5+tmp6+tmp7+tmp8+-3.8;
STICKLINE(CROSS(上穿,下穿) AND P>Q,0,8,10,0),colorred,LINETHICK2;
STICKLINE(b4=100 OR 强弱线=4.2,0,8,10,0),coloryellow,LINETHICK2;
 


3、高位逃顶

N:=5;
VAR1:4*SMA((CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100,5,1)-
3*SMA(SMA((CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100,5,1),3.2,1),colorred,LINETHICK0;
VAR3:2*SMA((CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100,5,1)-
1*SMA(SMA((CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100,5,1),5.2,1),colorgreen,LINETHICK0;
顶线:100,colorwhite,DOTLINETHICK0;
VARO5:=LLV(LOW,27);
VARO6:=HHV(HIGH,34);
VARO7:=EMA((CLOSE-VARO5)/(VARO6-VARO5)*4,4)*25;
高压线: IF((VARO7<10),-20,120),LINETHICK2,colorgreen;
买: IF(CROSS(VAR1,VAR3),55,0),STICK,colorblue,LINETHICK3;
卖: IF(CROSS(VAR3,VAR1),70,0),STICK,colorblue,LINETHICK0;
DRAWTEXT(CROSS(VAR1,VAR3),30,'★★买'),colorred;
DRAWTEXT(CROSS(VAR3,VAR1),30,'★★卖'),colorgreen;
DRAWTEXT(CROSS(VAR3,VAR1),75,'★★终'),colorred;
DRAWTEXT(VAR1<10AND VAR1>=0,VAR1,'个'),COLOR00FFFF;
DRAWTEXT(VAR1<0,VAR1,'负'),colorred;
DRAWTEXT(VAR1>=10AND VAR1<20,VAR1,'1'),COLOR00FFFF;
DRAWTEXT(VAR1>=20AND VAR1<30,VAR1,'2'),COLOR00FFFF;
DRAWTEXT(VAR1>=30AND VAR1<40,VAR1,'3'),COLOR00FFFF;
DRAWTEXT(VAR1>=40AND VAR1<50,VAR1,'4'),COLOR00FFFF;
DRAWTEXT(VAR1>=50AND VAR1<60,VAR1,'5'),COLOR00FFFF;
DRAWTEXT(VAR1>=60AND VAR1<70,VAR1,'6'),COLOR00FFFF;
DRAWTEXT(VAR1>=70AND VAR1<80,VAR1,'7'),COLOR00FFFF;
DRAWTEXT(VAR1>=80AND VAR1<90,VAR1,'8'),COLOR00FFFF;
DRAWTEXT(VAR1>=90AND VAR1<100,VAR1,'9'),COLOR00FFFF;
DRAWTEXT(VAR1>=100,VAR1,'0'),COLOR00FFFF;

上一篇:同花顺源码精选:加仓减仓,热狗香肠,定海神针

下一篇:没有了