网友求助:
J线共振指标:
RSV1:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;
K1:=SMA(RSV1,5,1);
D1:=SMA(K1,5,1);
J1:=3*K1-2*D1;
AA1:=EMA(J1,5);
AA2:=REF(AA1,1);
STICKLINE(AA1>AA2,AA1,AA2,4,0),COLOR0055AA;{长J}
STICKLINE(AA1>AA2,AA1,AA2,4,0),COLOR0077CC;
STICKLINE(AA1>AA2,AA1,AA2,2,0),COLOR0099DD;
STICKLINE(AA1>AA2,AA1,AA2,1,0),COLOR01BEE7;
STICKLINE(AA1<=AA2,AA1,AA2,4,0),COLOR006600;
STICKLINE(AA1<=AA2,AA1,AA2,4,0),COLOR009900;
STICKLINE(AA1<=AA2,AA1,AA2,2,0),COLOR00BB00;
STICKLINE(AA1<=AA2,AA1,AA2,1,0),COLOR00CC00;
RSV2:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K2:=SMA(RSV2,3,1);
D2:=SMA(K2,3,1);
J2:=3*K2-2*D2;
BB1:=EMA(J2,5);
BB2:=REF(BB1,1);
STICKLINE(BB1>BB2,BB1,BB2,4,0),COLOR000045;{短J}
STICKLINE(BB1>BB2,BB1,BB2,3,0),COLOR000085;
STICKLINE(BB1>BB2,BB1,BB2,2,0),COLOR0000C5;
STICKLINE(BB1>BB2,BB1,BB2,1,0),COLOR0000E5;
STICKLINE(BB1<=BB2,BB1,BB2,4,0),COLOR353500;
STICKLINE(BB1<=BB2,BB1,BB2,3,0),COLOR555500;
STICKLINE(BB1<=BB2,BB1,BB2,2,0),COLOR757500;
STICKLINE(BB1<=BB2,BB1,BB2,1,0),COLOR858500;
DD:=AA1>AA2 AND BB1>BB2;
注意买入:DD AND NOT(REF(DD,1)) AND (AA1<50 OR BB1<50) ,LINETHICK1;
DRAWICON(注意买入,-5,1);
注意卖出:REF(DD,1)=1 AND NOT(DD),LINETHICK1;
DRAWICON(注意卖出,105,2);
J线共振指标的数值,全部在0轴以上,
MACD指标
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
MACD:(DIF-DEA)*2,COLORSTICK;
而MACD指标的数值,是以0轴为中心,O上O下都有数值的图。
现在请老师帮忙,把MACD图上移到以50为中心的图,与J线共振的图重叠
或者把J线共振的图,下移到以0轴为中心的图,与MACD的图重叠
解答如下:
RSV1:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;
K1:=SMA(RSV1,5,1);
D1:=SMA(K1,5,1);
J1:=3*K1-2*D1;
AA1:=EMA(J1,5);
AA2:=REF(AA1,1);
RSV2:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K2:=SMA(RSV2,3,1);
D2:=SMA(K2,3,1);
J2:=3*K2-2*D2;
BB1:=EMA(J2,5);
BB2:=REF(BB1,1);
DIF:(EMA(CLOSE,12)-EMA(CLOSE,26)),NODRAW;
DEA:EMA(DIF,9),NODRAW;
MACD:(DIF-DEA)*2,COLORSTICK,NODRAW;
STICKLINE(MACD>0,50,MACD*50+50,0.5,0),COLORFF00FF;
STICKLINE(MACD<=0,50,MACD*50+50,0.5,0),COLORFFFF00;
STICKLINE(AA1>AA2,AA1,AA2,3,0),COLOR0055AA;
STICKLINE(AA1>AA2,AA1,AA2,2,0),COLOR0099DD;
STICKLINE(AA1>AA2,AA1,AA2,1,0),COLOR01BEE7;
STICKLINE(AA1<=AA2,AA1,AA2,3,0),COLOR006600;
STICKLINE(AA1<=AA2,AA1,AA2,2,0),COLOR00BB00;
STICKLINE(AA1<=AA2,AA1,AA2,1,0),COLOR00CC00;
STICKLINE(C>0,AA1,AA2,0,0),COLORFFFFFF;
STICKLINE(BB1>BB2,BB1,BB2,2.8,0),COLOR000045;
STICKLINE(BB1>BB2,BB1,BB2,2,0),COLOR0000C5;
STICKLINE(BB1>BB2,BB1,BB2,1,0),COLOR0000E5;
STICKLINE(BB1<=BB2,BB1,BB2,2.8,0),COLOR353500;
STICKLINE(BB1<=BB2,BB1,BB2,2,0),COLOR757500;
STICKLINE(BB1<=BB2,BB1,BB2,1,0),COLOR858500;
STICKLINE(C>0,BB1,BB2,0,0),COLORFFFFFF;
DD:=AA1>AA2 AND BB1>BB2;
注意买入:=DD AND NOT(REF(DD,1)) AND (AA1<50 OR BB1<50) ;
DRAWICON(注意买入,-5,1);
注意卖出:=REF(DD,1)=1 AND NOT(DD),LINETHICK0;
DRAWICON(注意卖出,105,2);
NOTEXTDIF:DIF*50+50,COLORWHITE;
NOTEXTDEA:DEA*50+50,COLORYELLOW;