YG波段指标
YG波段指标
本指标只适合于波段走势的股票,阴跌或缓涨的不适宜
LC := REF(CLOSE,1);//前一日收盘价;
RSI$1:=SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;
RSI$2:=SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100;
RSI$3:=SMA(MAX(CLOSE-LC,0),N3,1)/SMA(ABS(CLOSE-LC),N3,1)*100;
相对强弱:=0.5*RSI$1+0.31*RSI$2+0.19*RSI$3;
wave$1:=SMA(100*(CLOSE-LLV(LOW,M))/(HHV(HIGH,M)-LLV(LOW,M)),N1,1);
wave$2:=SMA(100*(CLOSE-LLV(LOW,M))/(HHV(HIGH,M)-LLV(LOW,M)),N2,1);
wave$3:=SMA(100*(CLOSE-LLV(LOW,M))/(HHV(HIGH,M)-LLV(LOW,M)),N3,1);
短线波段:=0.5*wave$1+0.31*wave$2+0.19*wave$3;
超跌:20,POINTDOT,colorgreen;
超买:80,POINTDOT,colorred;
YG波段:0.5*相对强弱+0.5*短线波段,coloryellow;
//STICKLINE(相对强弱-短线波段>0,相对强弱,短线波段,8,0),colorred;
//STICKLINE(相对强弱-短线波段<0,相对强弱,短线波段,8,0),COLOR00FF0F;
//买入条件;
sb1:=IF(YG波段<20 AND CLOSE>OPEN,1,0);//波段小于20,股价翻红;
sb2:=IF(YG波段<20 AND LOW>=REF(LOW,1) AND CLOSE>LOW,1,0);//波段小于20,股价未翻红,但未创新低;
sb3:=IF(REF(YG波段,1)<20 AND YG波段>REF(YG波段,1),1,0);//前一日波段小于20,今日转向;
bug1:=IF((REF(sb1,1)=1 AND sb1=1) OR (REF(sb1,1)=1 AND sb2=1) OR (REF(sb1,1)=1 AND sb3=1),0,1);//信号不同时出现1;
bug2:=IF((REF(sb2,1)=1 AND sb1=1) OR (REF(sb2,1)=1 AND sb2=1) OR (REF(sb2,1)=1 AND sb3=1),0,1);//信号不同时出现2;
bug3:=IF((REF(sb3,1)=1 AND sb1=1) OR (REF(sb3,1)=1 AND sb2=1) OR (REF(sb3,1)=1 AND sb3=1),0,1);//信号不同时出现3;
DRAWICON((sb1=1 OR sb2=1 OR sb3=1) AND bug1=1 AND bug2=1 AND bug3=1,超跌,"buy");
//卖出条件;
ss1:=IF(YG波段>80 AND CLOSE<OPEN,1,0);//波段大于80,股价翻绿;
ss2:=IF(YG波段>80 AND HIGH<=REF(HIGH,1) AND CLOSE<HIGH,1,0);//波段大于80,股价未翻绿,但未创新高;
ss3:=IF(REF(YG波段,1)>80 AND YG波段<REF(YG波段,1),1,0);//前一日波段大于80,今日转向;
bug4:=IF((REF(ss1,1)=1 AND ss1=1) OR (REF(ss1,1)=1 AND ss2=1) OR (REF(ss1,1)=1 AND ss3=1),0,1);//信号不同时出现1;
bug5:=IF((REF(ss2,1)=1 AND ss1=1) OR (REF(ss2,1)=1 AND ss2=1) OR (REF(ss2,1)=1 AND ss3=1),0,1);//信号不同时出现2;
bug6:=IF((REF(ss3,1)=1 AND ss1=1) OR (REF(ss3,1)=1 AND ss2=1) OR (REF(ss3,1)=1 AND ss3=1),0,1);//信号不同时出现3;
DRAWICON((ss1=1 OR ss2=1 OR ss3=1) AND bug4 AND bug5 AND bug6,超买,"sell");