我最初设定主图买卖信号时恨不得让许多设计出许多信号,希望这些编制的信号都在同一个爆发点之前出现。经过反复琢磨,发现愿望与现实是有距离的。
于是在许多买卖信号中开始筛选——留下信号少,距离爆发点最近的指标信号。
在下面的图中首先编制了变色均线(最初是10日变色线,后来改成5日变色均线)其作用一目了然不多赘述。
由于我追求的是左侧交易,编制的信号出现位置就要提前。最后买到了一条下插线Y1,利用Y1与5日均线交叉,经过反复调整参数才确定为源码中的数值。编入信号小房子,又加上提示起涨二字。于是在大牛股出现前或拉升初始阶段基本能在较低的价咯买入。
有了买点,又加入卖点——逃跑的逃字。
{波段主图,有未来函数}
买线:=ZIG(3,10);
卖线:=MA(买线,2);
BU:=CROSS(买线,卖线);
SEL:=CROSS(卖线,买线);
VAR1:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),25);
VAR2:=HIGH-REF(HIGH,1);
VAR3:=REF(LOW,1)-LOW;
VAR4:=SUM(IF(VAR2>0 AND VAR2>VAR3,VAR2,0),25);
VAR5:=SUM(IF(VAR3>0 AND VAR3>VAR2,VAR3,0),25);
VAR6:=VAR4*100/VAR1;
VAR7:=VAR5*100/VAR1;
{分析家公式网www.fxjgsw.com}
VAR8:=MA(ABS(VAR7-VAR6)/(VAR7+VAR6)*100,15);
VAR9:=(VAR8+REF(VAR8,15))/2;
BUYA:=ZIG(3,10);
SELLA:=MA(BUYA,2);
AK:=DRAWICON(CROSS(BUYA,SELLA),L-0.2,26);
BK:=DRAWICON(CROSS(SELLA,BUYA),H+0.2,27);
STICKLINE(BUYA>SELLA AND O>=C,C,O,-1,0),COLORRED;
STICKLINE(BUYA>SELLA AND O>=C,L,H,0,0),COLORRED;
STICKLINE(BUYA<SELLA AND O<=C,O,C,-1,1),COLORCYAN;
STICKLINE(BUYA<SELLA AND O<=C,O,L,0,1),COLORCYAN;
STICKLINE(BUYA<SELLA AND O<=C,C,H,0,1),COLORCYAN;
VAR11:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
VAR12:=SMA(VAR11,3,1);
VAR13:=SMA(VAR12,3,1);
VAR14:=VAR13 AND VAR13<20;
LJB:=1/WINNER(CLOSE);
BB:=STICKLINE(LJB>10,L-0.45,L-0.4,-1,1),COLORYELLOW;
平均:=(L+H)/2;
KB:=ZIG(平均,10);
KS:=MA(KB,2);
买1:=BU;
买2:=BU;
卖1:=SEL;
S:=IF(卖1>0,HIGH*1.01,DRAWNULL),CROSSDOT,LINETHICK3,COLORGREEN;
DRAWTEXT(卖1>0,HIGH*1.03,'卖'),COLORYELLOW;
{黑马通道并非完整源码,有未来函数}
EXP1:=EXPMA(CLOSE,10),COLORRED,LINETHICK2;
EXP2:=EXPMA(CLOSE,60),COLORCYAN,LINETHICK2;
AA1:="AQWE.AQWE#DAY";
BB1:="SQWE.SQWE#DAY";
VARB1:=(C+H+O+L)/4;
峰顶线:=AA1,COLORRED,LINETHICK1;
谷底线:=BB1,COLORGREEN,LINETHICK1;
风险:=100*(L-BB1)/BB1,NODRAW;
幅度:=100*(AA1-BB1)/BB1,NODRAW;
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
X:=LLV(J,2)=LLV(J,8);
{买字出现后要等五日线变红后逢低买进.有未来}
DRAWTEXT(CROSS(J,REF(J+0.01,1)) AND X AND J<20 AND C<谷底线,LOW,'↖★买'),COLORCYAN;
STICKLINE(AA1<LOW,OPEN,CLOSE,0.8,0),COLORBLUE;
{马道出下轨后的出黄sK线}
STICKLINE(BB1>LOW AND BB1<HIGH,BB1,MIN(MIN(OPEN,CLOSE),BB1),5,0),COLORYELLOW;
STICKLINE(BB1>MIN(C,O) AND BB1<MAX(C,O),BB1,MIN(OPEN,CLOSE),5,0),COLORYELLOW;
STICKLINE(BB1>HIGH,OPEN,CLOSE,5,0),COLORYELLOW;
STICKLINE(BB1>HIGH,HIGH,LOW,5,0),COLORYELLOW;
{长操作线Y1,无未来函数}
AN1:=MA(C,5);
AN2:=MA(C,21);
AN3:=(AN1+AN2)/2;
BOLLN2:=MA(CLOSE,13);
UBN2:=BOLLN2+2*STD(CLOSE,13);
LBN2:=BOLLN2-2*STD(CLOSE,13);
BN1:=MA(CLOSE,34)+MA(CLOSE,34)-REF(MA(CLOSE,34),1);
分水岭N1:=IF(MA(CLOSE,120)<BN1,BN1,MA(CLOSE,120)),LINETHICK0;
Y1:分水岭N1-(EMA(C,2)-分水岭N1),COLORBLUE,LINETHICK3;
IF(Y1>AN3,Y1,DRAWNULL),NODRAW;
{5日变色线}
M5:MA(C,5),COLORRED,LINETHICK5;
M10:=MA(C,10),COLORWHITE,LINETHICK2;
M20:MA(C,20),COLORMAGENTA,LINETHICK1;
M30:=MA(C,30),COLORWHITE,LINETHICK1;
M60:MA(C,60),COLORYELLOW,LINETHICK2;
M88:=MA(C,88),COLORLIGRAY,LINETHICK1;
M120:=MA(C,120),COLORWHITE,LINETHICK1;
M144:=MA(C,144),COLORWHITE,LINETHICK1;
M240:=MA(C,240),COLORBLUE,LINETHICK1;
BB5:=ATAN((M5/REF(M5,1)-1)*100)*180/3.1416;
IF(BB5>30 AND M5>REF(M5,1), M5,DRAWNULL),LINETHICK1,COLORRED;
BB10:=ATAN((M10/REF(M10,1)-1)*100)*180/3.1416;
IF(BB5<0 AND M5<REF(M5,1), M5,DRAWNULL),LINETHICK5,COLORCYAN;
V1:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);
V2:=(1-7/100)*(DMA(CLOSE,V1));
{5日均线AN1上穿Y1.出买入信号红房子22,无未来函数}
OUT1:=CROSS(AN1,Y1);
DRAWICON(OUT1,L*0.90,22);
DRAWTEXT(OUT1,L*0.88,'↖起涨'),COLORYELLOW;
{逃}
LCC:=REF(CLOSE,1);
RSIC:=SMA(MAX(CLOSE-LCC,0),6,1)/SMA(ABS(CLOSE-LCC),6,1)*100;
DRAWTEXT(CROSS(84,RSIC) , HIGH*1.03,'逃'),COLORYELLOW;
买卖都有了还缺一个起涨预警信号:
AN1:=MA(C,5);{5日均线}
AN2:=MA(C,21);
{www.fxjgsw.com}
AN3:=(AN1+AN2)/2;
BOLLN2:=MA(CLOSE,13);
UBN2:=BOLLN2+2*STD(CLOSE,13);
LBN2:=BOLLN2-2*STD(CLOSE,13);
BN1:=MA(CLOSE,34)+MA(CLOSE,34)-REF(MA(CLOSE,34),1);
分水岭N1:=IF(MA(CLOSE,120)<BN1,BN1,MA(CLOSE,120)),LINETHICK0;
Y1:=分水岭N1-(EMA(C,2)-分水岭N1),COLORBLUE,LINETHICK3;
{AN1上穿Y1,出小房子22}
OUT:CROSS(AN1,Y1);
主图起涨预警跳出来,还缺一个辅助研判该不该买的附图。于是我把经典助涨助跌指标DMI当做最终研判指标——只要PDI在数值20附近上叉MDI,随后ADX上叉ADXR。主图K线图处于低位、且前面没出现过大幅拉高。同时出现起涨信号小房子,大胆买进!(很重要!请切记!切记!) |