把好指标组合在一起的方法(源码 副图)介绍
把好指标组合在一起的方法(源码 副图)
我们在使用指标时经常发现自己钟爱的指标有2个或者更多个,舍弃哪个都舍不得,有没有把2个或者更多个指标合并到一个指标中的方法呢?答案是肯定的,方法和要点是:
1、选一个你认为最好又常用的指标作为组合指标,再选2至3个其它指标(最好是短小的或是摘选其最精华的部分语句,比如能发出脉冲或柱型线信号的语句)。
2、观察一下你选中的几个指标的坐标线是否大体一致,如果是就不做调整,不是就需要做相应的调整(多数情况下不一致)。
3、组合在一起的指标有可能语句名称重名,如:有2个或2个以上名为VAR1的语句,有这种情况的就需要改名,没有重名的就不必改动。
好了,了解了以上3个要点,开始动手组合吧!
选一个以组合为主的指标
var6:=(2*CLOSE+HIGH+LOW)/4;
var7:=LLV(LOW,13);
var8:=HHV(HIGH,13);
var9:=EMA((var6-var7)/(var8-var7)*100,13);
varA:=EMA(0.667*REF(var9,1)+0.333*var9,2);
多:var9,COLORRED, LINETHICK0;
空: EMA(0.382*REF(var9,2)+0.618*var9,12),color00ff00;
STICKLINE(var9>varA,var9,varA,4,0), COLORRED;
STICKLINE(var9<=varA,var9,varA,4,0), COLORYELLOW;
再选2至3个指标与上面的指标组合,如选中下面3个:
{专抢反弹}
Var2g:=DMA(EMA(CLOSE,12),SUM(VOL,5)/3/CAPITAL);
Var3g:=(CLOSE-Var2g)/Var2g*100;
专抢反弹:(REF(Var3g,1)<-40 AND Var3g>REF(Var3g,1) AND REF(Var3g,1)<REF(Var3g,2) AND Var3g-REF(Var3g,1)>2.5)*50{1},colorred,linethick2;
{追魂剑}
BIAS1:=(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100;
BIAS2:=HHV((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100,200);
m1:=bias1=bias2 ;
m2:=v>ma(v,5) ;
m3:=ref(bias1,1)<ref(bias2,1) ;
追魂剑:if(m1 and m2 and m3,50{0.60},0),colorffcccc,pointdot;
stickline(追魂剑,0,追魂剑*1{0.56},4{2},0{1}),colorffcccc;
{追涨2}
Var2a:=(EMA(CLOSE,26)-EMA(CLOSE,52))/MA(CLOSE,60)*100;
Var3a:=EMA(Var2a,18);
Var4a:=Var2a<-1;
Var5a:=Var4a AND CROSS(Var2a,Var3a);
追2:=Var5a;
追涨:if(追2>0,50{0.8},0),STICK,COLORYELLOW,linethick2;
把这三个指标复制粘贴到上面的指标里,经过调整和改动,测试通过,四合一指标组合成功.
以组合为主的指标坐标线是0至80之间,组合进去的3个指标的信号调整到坐标线0-50位置,也就是信号的高度为50,使信号在画面上显示的比较融合。改动的地方(大括号{}里面的是原坐标参数)做了保留,供你参考是如何调整和改动的。
下面这11个指标只要起个指标名,就可组成一个至几个指标,也可分拆与其它指标任意组合,试试看!
{黑马剑}
Var1:=ma(CLOSE,5);
Var2:=MA(CLOSE,10);
Var3:=MA(CLOSE,30);
Var4:=MA(CLOSE,60);
VarB:=SUM(CLOSE*VOL*100,28)/SUM(VOL*100,28);
VarC:=INTPART(VarB*100)/100;
VarD:=EMA(CLOSE,5)-EMA(CLOSE,10);
VarE:=EMA(VarD,9);
Var13:=REF(VarE,1);
Var14:=VarE;
Var15:=Var14-Var13;
Var16:=REF(VarD,1);
Var17:=VarD;
Var18:=Var17-Var16;
Var19:=OPEN;
Var1A:=CLOSE;
黑马剑: IF(Var19<=Var1 AND Var19<=Var2 AND Var19<=Var3 AND Var1A>=Var1 AND Var1A>=VarC AND Var15>0 AND Var18>0,0.8,0),LINETHICK3 , Color00FFFF;
STICKLINE(黑马剑,0,黑马剑*0.86,2,1),LINETHICK3 ,Color00FFFF;
DRAWICON(黑马剑>0,黑马剑,1);
{三线粘合剑}
ma1:=eMA(CLOSE,5);
ma2:=eMA(CLOSE,10);
ma3:=EMA(CLOSE,20);
ma4:=EMA(CLOSE,30);
三线粘合剑:cross(MA1,MA2) AND c>o AND c>REF(C,1) AND C/REF(C,1)>=1.018
or cross(MA1,MA4) AND c>o AND c>REF(C,1) AND C/REF(C,1)>=1.018
or cross(MA2,MA3) AND c>o AND c>REF(C,1) AND C/REF(C,1)>=1.018
or cross(MA1,MA3) AND c>o AND c>REF(C,1) AND C/REF(C,1)>=1.018,colorff00ff;
stickline(三线粘合剑,0,三线粘合剑*0.96,2,1),colorff00ff;
drawicon(三线粘合剑>0,三线粘合剑,1);
{追魂剑}
BIAS1:=(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100;
BIAS2:=HHV((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100,200);
m1:=bias1=bias2 ;
m2:=v>ma(v,5) ;
m3:=ref(bias1,1)<ref(bias2,1) ;
追魂剑:if(m1 and m2 and m3,0.60,0),colorffcccc,linethick2;
stickline(追魂剑,0,追魂剑*0.56,2,1),colorffcccc,linethick2;
drawicon(追魂剑>0,追魂剑,1);
{追涨1}
B1:=REF(OPEN,1);
B2:=REF(CLOSE,1);
B3:=IF(B2-B1>0,1,0);
A1:=CLOSE;
A2:=LOW;
A3:=(B2-LOW)/CLOSE;
A4:=IF(A3>=0.035,B3,0);
A5:=IF(CLOSE>=B2,A4,0);
A6:=IF(CLOSE>=OPEN,A5,0);
追涨1:if(A6>0,1,0), STICK,COLORf00ff0,linethick4;
DRAWICON(追涨1>0,1 ,1 );
{追涨2}
Var2a:=(EMA(CLOSE,26)-EMA(CLOSE,52))/MA(CLOSE,60)*100;
Var3a:=EMA(Var2a,18);
Var4a:=Var2a<-1;
Var5a:=Var4a AND CROSS(Var2a,Var3a);
追2:=Var5a;
追涨2:if(追2>0,0.8,0),STICK,COLORYELLOW,linethick4 ;
DRAWICON(追涨2>0,0.85 ,1 );
{抄底追涨}
C1:=HHV(C,115);
C2:=LLV(C,115);
C3:=C1-C2;
C4:=ma((C-C2)/C3-0.5,14)*20;
hh:=REF(hhv(c,66),2);
buy:=cross(c,hh) AND (HHV(C,110)/LLV(C,110)-1)*100<45 AND C4<5.666;
sign:=llv(c4,35)<-8.9 and CROSS(c4,-7.815) and c4<-1.2;
抄底:1*FILTER(SIGN,41),STICK,LINETHICK4,COLOR00EE00;
追涨0:1*filter(buy,41),STICK,LINETHICK4,COLORFF00FF;
{猎庄}
Var1m:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100;
Var2m:=(EMA(CLOSE, 6)-EMA(CLOSE, 12))*100;
猎庄:Var2m<13 AND Var1m>9,stick,ColorFFFFFF,linethick2;
{回调买入}
YD:=(count(c<ref(O,1),13)>=10 OR count(c<ref(c,2),13)>=10) and count(H/L>1.048,13)>=7;
DTJJ:=DMA(c,V/MA(V,13)/13);
XJPL:=c/DTJJ<0.91;
回调买入: YD and XJPL,colorblue,linethick2;
{代号魔鬼}
A11:=CLOSE/MA(CLOSE,40);
A22:=CLOSE/MA(CLOSE,60)*100<71;
代号魔鬼:CROSS(A11,A22),COLORFFB0B0;
{专抢反弹}
Var2g:=DMA(EMA(CLOSE,12),SUM(VOL,5)/3/CAPITAL);
Var3g:=(CLOSE-Var2g)/Var2g*100;
专抢反弹:(REF(Var3g,1)<-40 AND Var3g>REF(Var3g,1) AND REF(Var3g,1)<REF(Var3g,2) AND Var3g-REF(Var3g,1)>2.5)*1,colorred;
gd10895