在线检测未来函数

修改江恩买卖指标

来源:Internet,编辑:股旁网,2012-04-05

编写要求:

股旁网解答:

 网友求助:

江恩买卖指标,在大智慧里能显示各种颜色,而在同花顺不能显示,如:转强不显示COLORYELLOW,持股不显示COLORred,持币不显示COLORffff00,请老师修改。


江恩买卖源代码:
VarA:=BARSCOUNT(CLOSE)*3.142/180;
A2: SIN(VarA*8)*100,linethick2;
A3: COS(VarA*8)*100,linethick2;
X1: 0;
Var1:=MA(CLOSE,5);
Var2:=MA(CLOSE,10);
Var3:=MA(CLOSE,20);
Var4:=MA(CLOSE,30);
Var5:=(Var1+Var2+Var3+Var4)/4;
Var6:=(Var5-REF(Var5,5))/REF(Var5,5)*1500;
Var7:=(Var5-REF(Var5,5))/REF(Var5,5)*1500;
Var8:=EMA(Var6,8);
注意: STICKLINE(Var6>REF(Var6,1) AND Var6<0 AND Var6<Var8,Var6,0,5,0);
转强: STICKLINE(Var8>REF(Var8,1) AND Var6<0 AND Var6>Var8,Var8,0,5,0),COLORYELLOW;
买点: STICKLINE(Var6>REF(Var6,1) AND Var6>0 AND Var8<0,Var6,Var8,10,0);
DRAWICON(FILTER(Var6>REF(Var6,1) AND Var6>0 AND Var8<0,30),-140,4);
DRAWTEXT(FILTER(Var6>REF(Var6,1) AND Var6>0 AND Var8<0,30),-40,\'买点\'),COLORffffff;
持股: STICKLINE(Var8>REF(Var8,1) AND Var8>0,Var6,0,5,0),COLORred;
观望: STICKLINE(Var6<REF(Var6,1) AND Var8>REF(Var8,1) AND Var6>0,Var6,Var8,10,0);
持币: STICKLINE(Var6<REF(Var6,1) AND Var6<Var8,Var6,Var8,5,1),COLORffff00;
VAR9:=TROUGHBARS(3,15,1)<10;
VAR10:=PEAKBARS(3,15,1)<10;
VAR11:=IF(VAR9=1,50,0);
VAR12:=IF(VAR10=1,50,0);
底部:= IF(VAR11=50,50,0);
头部:= IF(VAR12=50,100,0);
a:if( 底部>ref(底部,1),50,0);
aa:if(头部>ref(头部,1),50,0);
DRAWTEXT(a=50,100,\'买\' ),COLORred,linethick2;
DRAWTEXT(aa=50,100,\'卖\'),COLOR00ff00,linethick2;
 

 
解答如下:
DRAWGBKLAST(CLOSE>0,STRIP(RGB(100,70,70),RGB(50,90,50),1));
VarA:=BARSCOUNT(CLOSE)*3.142/180;
A2:= SIN(VarA*8)*100;
A3:= COS(VarA*8)*100;
PARTLINE(a2,a2>=a2[1],RGB(255,0,0),a2<a2[1],RGB(255,255,0)),linethick2;
PARTLINE(a3,a3>=a3[1],RGB(255,155,0),a3<a3[1],RGB(0,255,150)),linethick2;
Var1:=MA(CLOSE,5);
Var2:=MA(CLOSE,10);
Var3:=MA(CLOSE,20);
Var4:=MA(CLOSE,30);
Var5:=(Var1+Var2+Var3+Var4)/4;
Var6:=(Var5-REF(Var5,5))/REF(Var5,5)*1500;
Var7:=(Var5-REF(Var5,5))/REF(Var5,5)*1500;
Var8:=EMA(Var6,8);
STICKLINE(Var6>REF(Var6,1) AND Var6<0 AND Var6<Var8,Var6,0,5,0),COLOR009fff;//注意:
STICKLINE(Var8>REF(Var8,1) AND Var6<0 AND Var6>Var8,Var8,0,5,0),coloryellow;//转强:
STICKLINE(Var6>REF(Var6,1) AND Var6>0 AND Var8<0,Var6,Var8,5,0),COLORff00ff;//买点:
STICKLINE(Var8>REF(Var8,1) AND Var8>0,Var6,0,5,0),colorred;//持股:
STICKLINE(Var6<REF(Var6,1) AND Var8>REF(Var8,1) AND Var6>0,Var6,Var8,5,0);//观望:
STICKLINE(Var6<REF(Var6,1) AND Var6<Var8,Var6,Var8,5,1),COLORffff00;//持币:
DRAWICON(FILTER(Var6>REF(Var6,1) AND Var6>0 AND Var8<0,30),-40,'buy');
DRAWTEXT(FILTER(Var6>REF(Var6,1) AND Var6>0 AND Var8<0,30),-40,'`买点'),COLORffffff;
VAR9:=TROUGHBARS(3,15,1)<10;
VAR10:=PEAKBARS(3,15,1)<10;
VAR11:=IF(VAR9=1,50,0);
VAR12:=IF(VAR10=1,50,0);
底部:= IF(VAR11=50,50,0);
头部:= IF(VAR12=50,100,0);
a:IF( 底部>REF(底部,1),50,0),colorccccff;
aa:IF(头部>REF(头部,1),50,0),color00ff00;
DRAWTEXT(a=50,60,'买' ),colorcccccc;
DRAWTEXT(aa=50,60,'卖'),COLOR00ff00;
DRAWICON(aa=50,70,'sell');
DRAWICON(a=50,50,'buy');
注意底部:0,COLORffffff;
低位转强:0,coloryellow;
坚决持股:0,colorred;
谨慎观望:0,Color009fff;
果段持币:0,COLORffff00;
 

 

相关文章