Var1:=DYNAINFO(4)=O AND DYNAINFO(5)=H AND DYNAINFO(6)=L AND DYNAINFO(7)=C;
Var2:=(1*OPEN+3*HIGH+3*LOW+1*CLOSE)/8;
ZIG趨勢線:ZIG(MA(Var2,3),10),COLOR0000FF,LINETHICK0;
FILLRGN(C>0,ZIG趨勢線,HHV(ZIG趨勢線,248)),COLORFF9A9A;
FILLRGN(ZIG趨勢線>REF(ZIG趨勢線,1),ZIG趨勢線,LLV(H,0)),COLOR1A1A3A;
FILLRGN(ZIG趨勢線<=REF(ZIG趨勢線,1),ZIG趨勢線,LLV(L,0)),COLOR1A3A3A;
STICKLINE(C>O,O,L,1,0),COLOR1199ff;
STICKLINE(C>O,C,H,2,0),COLOR9F006A;
STICKLINE(C>O,O,L,2,0),COLOR6A009F;
STICKLINE(C<=O,O,H,2,1),COLOR9F003C;
STICKLINE(C<=O,C,L,2,1),COLOR3A9F00;
STICKLINE(O>=C,C,O,8,0),COLORAAAAAA;
STICKLINE(O>=C,C,O,5,0),COLORCCCCCC;
STICKLINE(O>=C,C,O,3,0),COLORDDDDDD;
STICKLINE(O>=C,C,O,1,0),COLORFFFFFF;
STICKLINE(C>O,C,O,8,0),COLOR5A5ACC;
STICKLINE(C>O,C,O,5,0),COLOR6C6CDD;
STICKLINE(C>O,C,O,3,0),COLOR7D7DEE;
STICKLINE(C>O,C,O,1,0),COLOR9F9FFF;
上軌:HHV(MA(H,3),21)*1.025,COLOR0000AA,LINETHICK1;
中軌:MA((O+C)*0.5,3),COLOR00AACC,LINETHICK0;
下軌:LLV(MA(L,3),21)*0.975,COLOR00AA00,LINETHICK1;
多頭線:EMA(CLOSE,3),COLOR0000FF,LINETHICK2;
多空均衡線:EMA(CLOSE,8),COLOR0099FF,LINETHICK0;
空頭線:EMA(CLOSE,13),COLOR00FFFF,LINETHICK2;
DRAWTEXT(Var1 AND FILTER(COUNT(CROSS(多空均衡線,多頭線),3)>=1 AND COUNT(CROSS(空頭線,多空均衡線),3)>=1,5),多空均衡線,'↓要跌'),COLOR00FFAA,SHIFT2;
DRAWTEXT(Var1 AND FILTER(COUNT(CROSS(多頭線,多空均衡線),3)>=1 AND COUNT(CROSS(多空均衡線,空頭線),3)>=1,5),多空均衡線,'↑要漲'),COLORAA00FF,SHIFT2;
RSI1:=SMA(MAX(CLOSE-REF(CLOSE,1),0),5,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),5,1)*100;
RSI2:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100;
DRAWICON(Var1 AND RSI1>=80,多空均衡線+0.15,5),ALIGN0;
DRAWTEXT(Var1 AND RSI1>=80,多空均衡線+0.15,'減倉'),COLOR00FF99,SHIFT2;
DRAWICON(Var1 AND RSI1<=20,多空均衡線-0.15,4),ALIGN0;
DRAWTEXT(Var1 AND RSI1<=20,多空均衡線-0.15,'補倉'),COLORFF0099,SHIFT2;
DRAWICON(Var1 AND REF(RSI1,1)>=80 AND RSI1<80,多空均衡線+0.30,7),ALIGN0;
DRAWTEXT(Var1 AND REF(RSI1,1)>=80 AND RSI1<80,多空均衡線+0.30,'空倉'),COLOR99FF00,SHIFT2;
DRAWICON(Var1 AND REF(RSI1,1)<=20 AND RSI1>20,多空均衡線-0.30,6),ALIGN0;
DRAWTEXT(Var1 AND REF(RSI1,1)<=20 AND RSI1>20,多空均衡線-0.30,'滿倉'),COLOR99000FF,SHIFT2;
DRAWTEXT(Var1 AND CROSS(REF(RSI1,1),RSI1) AND RSI1>=75,多空均衡線+0.45,'逃頂!'),COLOR00FF00,SHIFT2;
DRAWTEXT(Var1 AND CROSS(RSI1,REF(RSI1,1)) AND RSI1<=25,多空均衡線-0.45,'炒底!'),COLORFF00FF,SHIFT2;
RSI3:=SMA(MAX(Var2-REF(Var2,1),0),5,1)/SMA(ABS(Var2-REF(Var2,1)),5,1)*100;
RSI4:=SMA(MAX(Var2-REF(Var2,1),0),13,1)/SMA(ABS(Var2-REF(Var2,1)),13,1)*100;
最大強值:=MA(MA(MAX(RSI3-RSI4,0),5),3);
最小弱值:=MA(MA(MIN(RSI3-RSI4,0),5),3);
試買:=IF(最大強值=REF(最大強值,1) AND REF(最大強值,1)=0,1,0),COLORAA00FF,linethick0;
追買:=IF(最大強值>REF(最大強值,1) AND REF(最大強值,1)=0,1,0),COLOR0000FF,linethick0;
止盈:=IF(最小弱值=REF(最小弱值,1) AND REF(最小弱值,1)=0,1,0),COLOR00FFFF,linethick0;
止損:=IF(最小弱值<REF(最小弱值,1) AND REF(最小弱值,1)=0,1,0),COLOR00FFAA,linethick0;
買入:IF(試買 OR 追買,1,0),COLOR0000FF,linethick0;
賣出:IF(止盈 OR 止損,1,0),COLOR00FFFF,linethick0;
DRAWTEXT(Var1 AND 試買,多空均衡線-0.30,'試買'),COLORAA00FF,SHIFT8;
DRAWTEXT(Var1 AND 追買,多空均衡線-0.15,'追買'),COLOR0000FF,SHIFT8;
DRAWTEXT(Var1 AND 止盈,多空均衡線+0.30,'止盈'),COLOR00FFFF,SHIFT8;
DRAWTEXT(Var1 AND 止損,多空均衡線+0.15,'止損'),COLOR00FFAA,SHIFT8;
DRAWTEXT(Var1 AND 買入,多空均衡線-0.45,'買入'),COLOR0000FF,SHIFT8;
DRAWTEXT(Var1 AND 賣出,多空均衡線+0.45,'賣出'),COLOR00FFFF,SHIFT8;
DIFF:=(EMA(CLOSE,5)-EMA(CLOSE,13))*100;
DEA:=EMA(DIFF,5);
MACD:=(DIFF-DEA)*2;
ROC1:=(CLOSE-REF(CLOSE,5))/REF(CLOSE,5)*100;
ROC2:=(CLOSE-REF(CLOSE,13))/REF(CLOSE,13)*100;
BIAS1:=(CLOSE-MA(CLOSE,5))/MA(CLOSE,5)*100;
BIAS2:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;
Var5:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100;
Var6:=(CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))*100;
RSV:=(5*Var5+3*Var6)/8;
K:=SMA(RSV,5,1);
D:=SMA(K,3,1);
KDJ:=3*K-2*D;
Var7:=IF(KDJ>=80 AND RSI1>=75 AND RSI3>=70 AND MACD>0 AND ROC1>0 AND BIAS1>0,1,0);
Var8:=IF(KDJ<=20 AND RSI1<=25 AND RSI3<=30 AND MACD<0 AND ROC1<0 AND BIAS1<0,1,0);
DRAWTEXT(Var1 AND Var7,多空均衡線,'共振頂!'),COLOR00FFAA,SHIFT8;
DRAWTEXT(Var1 AND Var8,多空均衡線,'共振底!'),COLORAA00FF,SHIFT8;
本公式說明:本公式不同于其他公式,必須有行情時對符合條件的參數(shù),才顯示文字提示,指導你操作。否則無任何顯示。此外,本公式只是本人所有公式中一個簡化了的公式,只是為了有興趣的同行參考我編寫公式的思路。如果有興趣的同行需要公式更多的、符合條件的解盤說明,請與本人聯(lián)系。
likangbao@hotmail.com/likangbao@163.net 陳楨