DIF:=EMA(CLOSE,9)-EMA(CLOSE,26);
DEA:=EMA(DIF,12);
MACD:=(DIF-DEA)*2,COLORSTICK;
T1:=BARSLAST(CROSS(DIF,0)=1);
T2:=BARSLAST(CROSS(0,DIF)=1);
LLV1:=LLV(L,T2);
HHV1:=HHV(H,T1);
UP:=IF(DATE<=1160601,DRAWLINE(L=LLV1,LLV1,H=HHV1,HHV1,0),DRAWNULL),COLORLIRED;
DN:=IF(DATE<=1160601,DRAWLINE(H=HHV1,HHV1,L=LLV1,LLV1,0),DRAWNULL),COLORGREEN;
低點:=REF(L,BARSLAST(L=DN));
高點:=REF(H,BARSLAST(H=UP));
本低:=IF(DATE<=1160601,低點,DRAWNULL),LINETHICK0;
本高:=IF(DATE<=1160601,高點,DRAWNULL),LINETHICK0;
低點位置:=本低>0&&REF(本高,1)>0&&DN=本低;
高點位置:=本高>0&&REF(本低,1)>0&&本高=UP;
上低:=IF(DATE<=1160601,REF(低點,T2+1),DRAWNULL),LINETHICK0;
上高:=IF(DATE<=1160601,REF(高點,T1+1),DRAWNULL),LINETHICK0;
SZ:=上低<本低;{www.stoview.com}
XD:=上高>本高&&上低>本低;
PZ:=(SZ!=1&&XD!=1);
VAR1:=LLV(LOW,21);
VAR2:=HHV(HIGH,21);
AK1:=EMA((((CLOSE - VAR1) /
(VAR2 - VAR1)) * 100),5),NODRAW;
AK:=EMA((((CLOSE - VAR1) / (VAR2 - VAR1)) *
50),13);
DD:=EMA(((0.667*REF(AK1,1))+(0.333*AK1)),2);
CC:=AK1>=DD;
KC:=AK1<DD;
DRAWTEXT_FIX(CURRBARSCOUNT=1&&XD=1,0.55,0.1,0,'趨勢下跌');
DRAWTEXT_FIX(CURRBARSCOUNT=1&&SZ=1,0.55,0.1,0,'趨勢上漲');
DRAWTEXT_FIX(CURRBARSCOUNT=1&&PZ=1,0.55,0.1,0,'趨勢盤整');
DRAWTEXT_FIX(CURRBARSCOUNT=1&&KC=1,0.8,0.1,0,'
策略:減倉50%');
DRAWTEXT_FIX(CURRBARSCOUNT=1&&CC=1&&SZ=1,0.8,0.1,0,'
策略:滿倉輪動');
DRAWTEXT_FIX(CURRBARSCOUNT=1&&CC=1&&PZ=1,0.8,0.1,0,'
策略:半倉輪動');
DRAWTEXT_FIX(CURRBARSCOUNT=1&&CC=1&&XD=1,0.8,0.1,0,'
策略:二成輪動');
MC:=IF(CC=1&&SZ=1,1,0);
BC:=IF(CC=1&&PZ=1,0.5,0);
ER:=IF(CC=1&&XD=1,0.2,0);
持倉倉位:MC+BC+ER,NODRAW;
STICKLINE(C>0,0,(MC+BC+ER),1,1);
T低:=BARSLAST(AK1<20),NODRAW;
T高:=BARSLAST(AK1>80),NODRAW;
超跌:=IF(T低<T高&&LLV(AK1,T高)<20,1,0),NODRAW;
超買:=IF(T低>T高&&HHV(AK1,T低)>80,1,0),NODRAW;
DRAWTEXT_FIX(CURRBARSCOUNT=1&&AK1<80&&AK1>20&&超跌=1,0.65,0.1,0,'
機會:待漲');
DRAWTEXT_FIX(CURRBARSCOUNT=1&&AK1>20&&AK1<80&&超跌=0,0.65,0.1,0,'
機會:超短');
DRAWTEXT_FIX(CURRBARSCOUNT=1&&AK1<20,0.65,0.1,0,' 機會:波段建倉');
DRAWTEXT_FIX(CURRBARSCOUNT=1&& AK1>80,0.65,0.1,0,' 機會:短線');
風(fēng)險估值:INTPART(AK1)/100,COLORRED;
DRAWTEXT_FIX(1,0.0,0.0,0,'
策略由程序產(chǎn)生,僅作參考,2016年6月1日后可能不能正常顯示,更多交流聯(lián)系作者QQ520125576'),COLORRED;