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

同花顺源码精选:博士策略,抄底高抛低吸组合,顺势而为

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

1、博士策略

DIFF:=100*(EMA(CLOSE,12)-EMA(CLOSE,26)),NODRAW;

DEA:=EMA(DIFF,9),NODRAW;
MACD:=(DIFF-DEA)*2,NODRAW;
死叉:=CROSS(DEA,DIFF);
N1:=BARSLAST(死叉);
N2:=REF(BARSLAST(死叉),N1+1);
N3:=REF(BARSLAST(死叉),N2+N1+2);
CL1:=LLV(LOW,N1+1);
DIFL1:=LLV(DIFF,N1+1);
CL2:=REF(CL1,N1+1);
DIFL2:=REF(DIFL1,N1+1);
CL3:=REF(CL2,N1+1);
DIFL3:=REF(DIFL2,N1+1);
PDIFL2:=IF(DIFL2>0,INTPART(LOG(DIFL2))-1,INTPART(LOG(-DIFL2))-1);
MDIFL2:=INTPART(DIFL2/POW(10,PDIFL2));
PDIFL3:=IF(DIFL3>0,INTPART(LOG(DIFL3))-1,INTPART(LOG(-DIFL3))-1);
MDIFL3:=INTPART(DIFL3/POW(10,PDIFL3));
MDIFB2:=INTPART(DIFF/POW(10,PDIFL2));
MDIFB3:=INTPART(DIFF/POW(10,PDIFL3));
直接底部结构:=(CL1<CL2 ) AND (MDIFB2>MDIFL2) AND DIFF<0 AND (MACD<0 AND REF(MACD,1)<0) AND MDIFB2<=REF(MDIFB2,0);
隔峰底部结构:=(CL1<CL3 AND CL3<CL2 ) AND (MDIFB3>MDIFL3) AND (MACD<0 AND REF(MACD,1)<0) AND MDIFB3<=REF(MDIFB3,0);
BG:=((MDIFB2>REF(MDIFB2,1))*REF(直接底部结构,2)) OR ((MDIFB3>REF(MDIFB3,2))*REF(隔峰底部结构,2)),NODRAW;
P:=CROSS(DIFF,DEA);
DRAWTEXT(FILTER(BG AND P,MACD>0),L*0.99,'●底部结构'),colormagenta;
金叉:=CROSS(DIFF,DEA);
M1:=BARSLAST(金叉);
M2:=REF(BARSLAST(金叉),M1+1);
M3:=REF(BARSLAST(金叉),M2+M1+2);
CH1:=HHV(HIGH,M1+1);
DIFH1:=HHV(DIFF,M1+1);
CH2:=REF(CH1,M1+1);
DIFH2:=REF(DIFH1,M1+1);
CH3:=REF(CH2,M1+1);
DIFH3:=REF(DIFH2,M1+1);
PDIFH2:=IF(DIFH2>0,INTPART(LOG(DIFH2))-1,INTPART(LOG(-DIFH2))-1);
MDIFH2:=INTPART(DIFH2/POW(10,PDIFH2));
PDIFH3:=IF(DIFH3>0,INTPART(LOG(DIFH3))-1,INTPART(LOG(-DIFH3))-1);
MDIFH3:=INTPART(DIFH3/POW(10,PDIFH3));
MDIFT2:=INTPART(DIFF/POW(10,PDIFH2));
MDIFT3:=INTPART(DIFF/POW(10,PDIFH3));
直接顶部结构:=(CH1>CH2 ) AND (MDIFT2<MDIFH2) AND DIFF>0 AND (MACD>0 AND REF(MACD,1)>0) AND MDIFT2>=REF(MDIFT2,0);
隔峰顶部结构:=(CH1>CH3 AND CH3>CH2 ) AND (MDIFT3<MDIFH3) AND (MACD>0 AND REF(MACD,1)>0) AND MDIFT3>=REF(MDIFT3,0);
TG:=((MDIFT2<REF(MDIFT2,1))*REF(直接顶部结构,2)) OR ((MDIFT3<REF(MDIFT3,2))*REF(隔峰顶部结构,2)),NODRAW;
Q:=CROSS(DEA,DIFF);
DRAWTEXT(FILTER(TG AND Q,MACD<0),H*1.02,'●顶部结构'),colorgreen;
W1:=FILTER(IF(HHVBARS(HIGH,13),0,1),13);
DRAWTEXT(W1 AND STRFIND(PERIODNAME,'日线'),H*1.01,'时间'),coloryellow;
W2:=FILTER(IF(LLVBARS(LOW,13),0,1),13);
DRAWTEXT(W2 AND STRFIND(PERIODNAME,'日线'),H*1.01,'时间'),coloryellow;
A1:=C>REF(C,4);
NT:=BARSLASTCOUNT(A1);
TJ11:=NT=9;
TJ13:=ISLASTBAR AND BETWEEN(NT,5,8);
AY:=(BACKSET(TJ11>0,9) OR BACKSET(TJ13>0,NT))*NT;
DRAWTEXT(NT=9,H*1.007,'▲高点'),colorgreen;
K1:=REF(C,0)>REF(C,13);
K2:=REF(NT=9,13);
DRAWTEXT(K1 AND K2 AND STRFIND(PERIODNAME,'日线'),H*1.007,'■顶'),colorred;
B1:=C<REF(C,4);
NT0:=BARSLASTCOUNT(B1);
TJ21:=NT0=9 ;
TJ23:=ISLASTBAR AND BETWEEN(NT0,5,8);
AY1:=(BACKSET(TJ21>0,9) OR BACKSET(TJ23>0,NT0))*NT0;
DRAWTEXT(NT0=9,L*0.994,'▲低点'),colorred;
T1:=REF(C,0)<REF(C,13);
T2:=REF(NT0=9,13);
DRAWTEXT(T1 AND T2 AND STRFIND(PERIODNAME,'日线'),L*0.994,'■底'),colorgreen;
A1A:=EMA(CLOSE, 9);
A1B:=((A1A - EMA(CLOSE, 5)) < 0);
A1C:=((A1A - EMA(CLOSE, 5)) > 0);
A1D:=BARSLAST(A1B);
A1E:=BARSLAST(A1C);
A1F:=IF((A1E > 0),(CLOSE - REF(CLOSE, 1)) / REF(CLOSE, 1) * 100,0);
A20:=SUM(A1F,0);
A21:=IF((A1D > 0),(0 - 2),0);
A22:=IF((A1E > 0),SUM((CLOSE - REF(CLOSE, 1)) / REF(CLOSE, 1) * 100,A1E),0);
A23:=A22 / A1E;
A25:=EMA(EMA(EMA(CLOSE, 3), 3), 3);
上升通道:((A25 - REF(A25, 1)) + A25),colorred;
反转通道:MA(上升通道, 15),colorgreen;
DRAWTEXT(CROSS(C,反转通道) AND STRFIND(PERIODNAME,"日线"),L*0.994,'↑多头'),colorlired;
DRAWTEXT(CROSS(反转通道,C) AND STRFIND(PERIODNAME,"日线"),H*1.01,'↓空头'),colorblue;



2、抄底高抛低吸组合

VAR1:=REF(OPEN,1);

VAR2:=SMA(MAX(OPEN-VAR1,0),6,1)/SMA(ABS(OPEN-VAR1),6,1)*100;
VAR3:=REF(CLOSE,1);
VAR4:=SMA(MAX(CLOSE-VAR3,0),6,1)/SMA(ABS(CLOSE-VAR3),6,1)*100;
VAR5:=REF(HIGH,1);
VAR6:=SMA(MAX(HIGH-VAR5,0),6,1)/SMA(ABS(HIGH-VAR5),6,1)*100;
VAR7:=REF(LOW,1);
VAR8:=SMA(MAX(LOW-VAR7,0),6,1)/SMA(ABS(LOW-VAR7),6,1)*100;
STICKLINE(VAR4<VAR2,VAR2,VAR4,8,0),colorgreen , ;
STICKLINE(VAR4>VAR2,VAR2,VAR4,8,0),colorred , ;
STICKLINE(VAR4>VAR2 AND VAR6>VAR8 AND VAR8>VAR4,VAR4,VAR6,0.5,1),colorred , ;
V1:=STICKLINE(VAR4>VAR2 AND VAR6>VAR8 AND VAR8<VAR4,VAR4,VAR6,0.5,1),colorred ,;
V2:=STICKLINE(VAR4>VAR2 AND VAR6<VAR8 AND VAR6>VAR4,VAR4,VAR8,0.5,1),colorred , ;
V3:=STICKLINE(VAR4>VAR2 AND VAR6>VAR8 AND VAR6<VAR2,VAR2,VAR8,0.5,1),colorred , ;
V4:=STICKLINE(VAR4>VAR2 AND VAR6>VAR8 AND VAR6>VAR2,VAR2,VAR8,0.5,1),colorred , ;
V5:=STICKLINE(VAR4>VAR2 AND VAR6<VAR8 AND VAR8<VAR2,VAR2,VAR6,0.5,1),colorred , ;
STICKLINE(VAR4>VAR2 AND VAR6<VAR8 AND VAR8>VAR2,VAR2,VAR6,0.5,1),colorred , ;
STICKLINE(VAR4<VAR2 AND VAR6>VAR8 AND VAR6<VAR4,VAR4,VAR8,0.5,1),colorgreen , ;
V6:=STICKLINE(VAR4<VAR2 AND VAR6<VAR8 AND VAR8<VAR4,VAR4,VAR6,0.5,1),colorgreen , ;
V7:=STICKLINE(VAR4<VAR2 AND VAR6<VAR8 AND VAR6>VAR4,VAR4,VAR8,0.5,1),colorgreen , ;
V8:=STICKLINE(VAR4<VAR2 AND VAR6>VAR8 AND VAR6<VAR4,VAR2,VAR8,0.5,1),colorgreen ,;
V9:=STICKLINE(VAR4<VAR2 AND VAR6>VAR8 AND VAR6>VAR4,VAR2,VAR8,0.5,1),colorgreen , ;
V10:=STICKLINE(VAR4<VAR2 AND VAR6<VAR8 AND VAR8<VAR2,VAR2,VAR6,0.5,1), colorgreen , ;
STICKLINE(VAR4<VAR2 AND VAR6<VAR8 AND VAR8>VAR2,VAR2,VAR6,0.5,1),colorgreen , ;
RSI1:=SMA(MAX(CLOSE-REF(C,1),0),6,1)/SMA(ABS(CLOSE-REF(C,1)),6,1)*100;
RSI2:=SMA(MAX(CLOSE-REF(C,1),0),12,1)/SMA(ABS(CLOSE-REF(C,1)),12,1)*100;
顶部线:80,coloryellow;
底部线:20,colormagenta;
中部线:50;
股价趋势: 3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);
底部警戒: 10;
买入信号: IF(CROSS(股价趋势,底部警戒),20,0),STICK,LINETHICK6,colormagenta;顶部警戒: 90;
5,coloryellow;
生命指数: EMA(100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34)),3)/4;
23.16,colorgreen;
顶:IF(生命指数>23.16,20,23.16),colorgreen;
底:IF(生命指数<2,10,5),coloryellow;
买入时间: IF(CROSS(生命指数,底),10,0);



3、顺势而为( 股 民 学 院 : http://www.58188.net )

VAR1:=(C-REF(C,1))/REF(C,1);

VAR2:=(INDEXC-REF(INDEXC,1))/REF(INDEXC,1);
个股:=EMA(SUM(VAR1,20),5);
大盘:=EMA(SUM(VAR2,20),5);
领涨:=(个股-大盘)>=0;
VAR3:=(C-LLV(L,125))/(HHV(H,125)-LLV(L,125))*100;
VAR4:=SMA(VAR3,72,1);
VAR5:=SMA(VAR4,34,1);
中线趋势:=3*VAR4-2*VAR5;
中线趋势升:=(中线趋势-REF(中线趋势,1))>=0;
均五升:=(MA(C,5)-REF(MA(C,5),1))>=0;
均十升:=(MA(C,10)-REF(MA(C,10),1))>=0;
STICKLINE(均五升 AND 均十升 AND 中线趋势升,0+0.5,0-0.5,6,1),COLORFFFF00,LINETHICK1;
VAR6:=(2*C+H+L)/4;
VAR7:=LLV(L,27);
VAR8:=HHV(H,27);
操纵:EMA((VAR6-VAR7)/(VAR8-VAR7)*100,13)-50,LINETHICK1,coloryellow;
趋势:EMA(0.618*REF(操纵,1)+0.382*操纵,3),colorgreen,LINETHICK1;
STICKLINE(操纵>趋势 AND 操纵>=REF(操纵,1),操纵+5,趋势-1,3.5,0),colorred,LINETHICK2;
STICKLINE(操纵>=趋势,趋势,趋势,3.5,0),coloryellow,LINETHICK2;
STICKLINE(操纵<趋势,趋势+0.5,趋势-0.5,3.5,0),COLORFFFF00,LINETHICK2;
强弱界:0,colorwhite;
STICKLINE(操纵>=趋势 AND 均五升 AND 均十升 AND 中线趋势升,趋势-3,趋势-7,4,0),COLOR64A0E6;
举动:=IF(操纵>=趋势 AND 均五升 AND 均十升 AND 中线趋势升 AND 趋势<0,1,0);
BIAS1:=(C-MA(C,6))/MA(C,6)*100;
BIAS2:=(C-MA(C,12))/MA(C,12)*100;
BIAS3:=(C-MA(C,24))/MA(C,24)*100;
BIAS:=(BIAS1+2*BIAS2+3*BIAS3)/6;
乖离:=MA(BIAS,3);
HUA2:=SMA(MAX(CLOSE-REF(CLOSE,1),0),16,2)/SMA(ABS(CLOSE/REF(CLOSE,1)),16,2)*100;
XIAN:=SMA(HUA2,3,1);
NV3:=SMA(XIAN,3,1);
XINV:=3*XIAN-2*NV3;
买入条件:=CROSS(XINV,NV3),colorwhite;
DRAWICON(买入条件,-0.1,222),colorwhite;
抄底: IF(TROUGHBARS(2,5,1)=0 AND HIGH>LOW+0.01,20.80,0),coloryellow ,LINETHICK2 ;
DRAWTEXT(抄底=20.80,20.90,'抄底'),colorred;
RR81:=MA(CLOSE,5);
RR91:=(CLOSE-RR81)/RR81*100;
RR8:=MA(CLOSE,27);
RR9:=(CLOSE-RR8)/RR8*100;
超跌买点:IF(MA(RR9,2)<-20 AND BARSLAST(CROSS(-10,MA(RR9,2))=1)>3 AND CROSS(MA(RR9,2)-REF(MA(RR9,2),1),0),-14.45,0);
RRA:=MA(RR9,2);
RRB:=BARSLAST(CROSS(-10,RRA)=1);
RRD:=RRA<-10 AND RRB>3;
黄金坑:IF(RRD,-14.40,0),coloryellow,LINETHICK2;
VARC:=(ZIG(3,8)>REF(ZIG(3,8),1)) AND (REF(ZIG(3,8),1)<=REF(ZIG(3,8),2)) AND (REF(ZIG(3,8),2)<=REF(ZIG(3,8),3));
STICKLINE((VARC=1),40.60,0,8,1),colormagenta;
DRAWTEXT((VARC=1),0.30,''),colorwhite;

上一篇:同花顺源码:抄底专用指标,主散筹码斜率,无极DMI

下一篇:同花顺源码精选:落日地平,趋势黄金操盘,分时T十O