【主图】
M:=14;Q:=6;N:=20;
MM:=IF(PERIOD=1,M,IF(PERIOD=2,M,IF(PERIOD=3,M,IF(PERIOD=4,M,IF(PERIOD=5,M,IF(PERIOD=6,Q,IF(PERIOD=7,Q,IF(PERIOD=8,Q,0))))))));
AVG:=(HIGH+LOW+CLOSE)/3;
CCIA:=(AVG-MA(AVG,MM))/(0.015*AVEDEV(AVG,MM));
WCCI:=CCIA,LINETHICK2,COLORWHITE;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
CCI1:=(TYP-MA(TYP,20))/(0.015*AVEDEV(TYP,20));
VAR1:=(H+L)/2;
AO:=SMA(VAR1,5,1)-SMA(VAR1,34,1),COLOR6699CC;
AC:=SMA((AO-SMA(AO,5,1)),5,1),COLOR6699CC;
X1:=AO>REF(AO,1) AND AC>REF(AC,1);
X2:=AO<REF(AO,1) AND AC<REF(AC,1);
Y:=(H+L)/2;
RED:=SMA(Y,8,1);
R2:=REF(RED,5);
KU1:=IF(H=HHV(H,3),1,0);
KD1:=IF(L=LLV(L,3),1,0);
UL:=IF(REF(KU1,2)=1 AND REF(KU1,1)=0 AND KU1=0,REF(H,2),REF(H,2+BARSLAST(REF(KU1,2)=1 AND REF(KU1,1)=0 AND KU1=0)));
DL:=IF(REF(KD1,2)=1 AND REF(KD1,1)=0 AND KD1=0,REF(L,2),REF(L,2+BARSLAST(REF(KD1,2)=1 AND REF(KD1,1)=0 AND KD1=0)));
①:SMA(Y,13,1),COLORBLUE;
②:SMA(Y,5,1),COLORRED;
③:SMA(Y,3,1),COLORGREEN;
DRAWTEXT(CROSS(-100,CCI) AND CCI<REF(CCI,1),L*1.020,'■ ̄ ̄ ̄ ̄手里有货跳动卖出 ̄ ̄ ̄ ̄ ̄ ̄'),COLOR7F00FF,LINETHICK3;
DRAWTEXT(CROSS(-100,CCI) AND CCI<REF(CCI,1),L,'■股价上线同时CCI大于0方可买入'),COLORYELLOW;
DRAWTEXT(CROSS(200,CCI) AND CCI<REF(CCI,1),L,'◆------强势反转,破位止盈------'),COLORYELLOW,LINETHICK3;
【附图】
M:=14;Q:=6;N:=20;
MM:=IF(PERIOD=1,M,IF(PERIOD=2,M,IF(PERIOD=3,M,IF(PERIOD=4,M,IF(PERIOD=5,M,IF(PERIOD=6,Q,IF(PERIOD=7,Q,IF(PERIOD=8,Q,0))))))));
AVG:=(HIGH+LOW+CLOSE)/3;
CCI:=(AVG-MA(AVG,MM))/(0.015*AVEDEV(AVG,MM));
DIF:CCI-REF(CCI,1),LINETHICK0,COLOR00FF00;
前差值:ABS(REF(CCI,1)-REF(CCI,2)),NODRAW;
差值20:IF(DIF>15 AND DIF<120,DIF,0),NODRAW,COLOR0000FF;
PI:=ATAN(1)*4;
PERIODS:=30;
HIGHHIGH:=HHV(HIGH,PERIODS);
LOWLOW:=LLV(LOW,PERIODS);
RANGEV:=25/(HIGHHIGH-LOWLOW)*LOWLOW;
EMA34:=EMA(CLOSE,34);
X1_EMA34:=0;
X2_EMA34:=1;
Y1_EMA34:=0;
Y2_EMA34:=(REF(EMA34,1)-EMA34)/AVG*RANGEV;
C_EMA34:=SQRT((X2_EMA34-X1_EMA34)*(X2_EMA34-X1_EMA34)+(Y2_EMA34-Y1_EMA34)*(Y2_EMA34-Y1_EMA34));
ANGLE_EMA34V:=ROUND(ABS(180*ACOS((X2_EMA34-X1_EMA34)/C_EMA34)/PI));
ANGLE_EMA34:=IF(Y2_EMA34>0,-ANGLE_EMA34V,ANGLE_EMA34V);
LSMA25:=FORCAST(CLOSE,25);
X1_LSMA25:=0;
X2_LSMA25:=1;
Y1_LSMA25:=0;
Y2_LSMA25:=(REF(LSMA25,1)-LSMA25)/AVG*RANGEV;
C_LSMA25:=SQRT((X2_LSMA25-X1_LSMA25)*(X2_LSMA25-X1_LSMA25)+(Y2_LSMA25-Y1_LSMA25)*(Y2_LSMA25-Y1_LSMA25));
ANGLE_LSMA25V:=ROUND(ABS(180*ACOS((X2_LSMA25-X1_LSMA25)/C_LSMA25)/PI));
ANGLE_LSMA25:=IF(Y2_LSMA25>0,-ANGLE_LSMA25V,ANGLE_LSMA25V);
ARRAY:=CCI;
HIGHBARS:=BARSLAST(NOT(ARRAY>0));
LOWBARS:=BARSLAST(NOT(ARRAY<0));
UPCONDITION:=BARSLAST(HIGHBARS>=6 AND SUM(ARRAY>100,5)>0);
DNCONDITION:=BARSLAST(LOWBARS>=6 AND SUM(ARRAY<-100,5)>0);
UPTREND:=ARRAY>0 AND UPCONDITION<DNCONDITION;
DNTREND:=ARRAY<0 AND UPCONDITION>DNCONDITION;
TRTREND:=HIGHBARS>=5 AND NOT(UPTREND) OR LOWBARS>=5 AND NOT(DNTREND);
STICKLINE(UPTREND,0,CCI,1,0),COLORFF0000;
STICKLINE(DNTREND,0,CCI,1,0),COLOR0000FF;
STICKLINE(TRTREND,0,CCI,1,0),COLOR00FFFF;
STICKLINE(NOT(UPTREND OR DNTREND OR TRTREND),0,CCI,1,0),COLOR808080;
WCCI:CCI,LINETHICK2,COLORWHITE;
TCCI:(AVG-MA(AVG,N))/(0.015*AVEDEV(AVG,N)),COLOR7F00FF,LINETHICK1;
STICKLINE(ANGLE_EMA34>=5,-301,-321,2,0),COLORD0E040;
STICKLINE(ANGLE_EMA34<5 AND ANGLE_EMA34>=3.57,-301,-321,2,0),COLOR006400;
STICKLINE(ANGLE_EMA34<3.57 AND ANGLE_EMA34>=2.14,-301,-321,2,0),COLOR98FB98;
STICKLINE(ANGLE_EMA34<2.14 AND ANGLE_EMA34>=0.71,-301,-321,2,0),COLOR00FF00;
STICKLINE(ANGLE_EMA34<0.71 AND ANGLE_EMA34>-0.71,-301,-321,2,0),COLOR00FFFF;
STICKLINE(ANGLE_EMA34<=-0.71 AND ANGLE_EMA34>-2.14,-301,-321,2,0),COLORE0FFFF;
STICKLINE(ANGLE_EMA34<=-2.14 AND ANGLE_EMA34>-3.57,-301,-321,2,0),COLOR00A5FF;
STICKLINE(ANGLE_EMA34<=-3.57 AND ANGLE_EMA34>-5,-301,-321,2,0),COLOR0000FF;
STICKLINE(ANGLE_EMA34<=-5,-301,-321,2,0),COLOR00008B;
SW:=IF(ABS(ANGLE_EMA34)>=15 AND ABS(ANGLE_EMA34+ANGLE_LSMA25)>=50,IF(ANGLE_LSMA25>0,2,-2),IF(ABS(ANGLE_EMA34)>=0 AND (ANGLE_EMA34>=0 AND ANGLE_LSMA25>=0 OR ANGLE_EMA34<=0 AND ANGLE_LSMA25<=0) AND ABS(ANGLE_EMA34+ANGLE_LSMA25)>=5,IF(ANGLE_LSMA25>0,1,-1),0));
STICKLINE(ABS(SW)=2,301,321,2,0),COLOR00FF00;
STICKLINE(ABS(SW)=1,301,321,2,0),COLOR00FFFF;
STICKLINE(ABS(SW)=0,301,321,2,0),COLOR0000FF;
IF(CLOSE>LSMA25,0,DRAWNULL),LINETHICK3,COLOR00FF00;
IF(CLOSE<LSMA25,0,DRAWNULL),LINETHICK3,COLOR0000FF;
IF(CLOSE=LSMA25,0,DRAWNULL),LINETHICK3,COLOR00FFFF;
DRAWICON(ABS(CCI)>=200,CCI,12);
STICKLINE(C,200,200,1.5,0),COLORFFFF00;
STICKLINE(C,-200,-200,1.5,0),COLORFFFF00;
STICKLINE(C,100,100,1.5,0),COLORFFFF00;
STICKLINE(C,-100,-100,1.5,0),COLORFFFF00;
DRAWTEXT(CROSS(CCI,0) AND CCI>REF(CCI,1),H*1.51,'◆上主图线买入点'),COLORYELLOW;
【讲解】
关于cci指标在股票当中的运用
cci指标其实是一个循环理论的基础应用。在woodies cci中,我们应该很容易找到股票的底部。当然,这个底部可能会是阶段的低点,也就是所谓的下跌浪的反弹低点。在下跌浪中,有时候就涉及到止损。在交易中,只涉及买、卖。但是买卖的动作就是一个循环的过程,买卖的时机应该切合循环点。我们无法保证交易99.99%都是盈利。只要我们知道两个点,就完全可以获得利润,把亏损压缩。
那么哪两个点是我们进入的必要精素,1:当cci过0轴,这个时候表示走强。当然是第二个交易日也在0上,因为woodies cci在交易理论中有一个模型叫0轴拒绝。相对于股票而言,是双向的,可以是上去后到0轴再次反身向上,向下亦是如此,所以,为了规避下跌趋势的0轴拒绝,就必须要等到上0轴的第二天。有人会问:如果买入后的下一个交易日,也就是第三天下到0一下怎么办?好,就一条,止损,这个止损有条件的。就是下一次cci下破100的时候。
高点和低点是相对的。当图中的那根横线跳动的时候,就表示你手里的筹码应该松动了。
这个交易原则不属于左侧也不属于右侧交易。这应该算折中交易,也就是ZLR交易。关于这套ZLR我还要解释一下。cci指标属于现行指标,但是没有kdj那么提前,也不想macd那么滞后。在提前与滞后之间,当然算折中交易。
在使用这套简单的指标时候,你可以用60分钟或是30分钟交易,再短就不行了,这和大陆A股的规则有关,时间短,一天里买卖信号同时发出,你是根本无法完成卖出操作的,它是T+1。
|