没想到大家和我一样喜欢MACD实站指标,非常感谢,再把我改的飞狐特SE主图鳄鱼-线献给大家,有不完美的地方,希望老师帮修改一下,如上影线和下影线粗,我没改过来,圆点应为箭头。
公式用法:该指标是根据【浑沌操作法】一书的原理编写而来。
指标中的红箭头,并非买入信号,而是股价向上突破前一个碎型高点。
指标中的绿箭头,并非卖出信号,而是股价向下突破前一个碎型低点。
指标里的红、绿、蓝三线走势如鳄鱼,因此称之为『鳄鱼线』。
当该三条线多头排列时,指标解盘中称之为“鳄鱼线向上张口”为多头趋势。
当该三条线空头排列时,指标解盘中称之为“鳄鱼线向下张口”为空头趋势。
当指标不断出现红箭头,说明多头趋势在延续,指标不断出现绿箭头时,说明空头趋势在延续,当之前持续出红箭头后,再出现绿箭头时,谨防趋势反转,反之亦然。
公式源码:
Y:=((HIGH + LOW) / 2);
BLUE:=SMA(Y,13,1);
RED:=SMA(Y,8,1);
GREEN:=SMA(Y,5,1);
B2:=REF(BLUE,8);
R2:=REF(RED,5);
G2:=REF(GREEN,3);
KU1:=IF((HIGH = HHV(HIGH,3)),1,0);
KD1:=IF((LOW = LLV(LOW,3)),1,0);
UL:=IF((((REF(KU1,2) = 1) AND (REF(KU1,1) = 0)) AND (KU1 = 0)),REF(HIGH,2),REF(HIGH,(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(LOW,2),REF(LOW,(2 + BARSLAST((((REF(KD1,2) = 1) AND (REF(KD1,1) = 0)) AND (KD1 = 0))))));
KU:=IF((((CLOSE > B2) AND (CLOSE > R2)) AND (CLOSE > G2)),1,0);
KD:=IF((((CLOSE < B2) AND (CLOSE < R2)) AND (CLOSE < G2)),(0 - 1),0);
KK:=IF((BARSLAST(((KU = 1) AND (REF(KU,1) = 0))) < BARSLAST(((KD = (0 - 1)) AND (REF(KD,1) = 0)))),1,(0 - 1));
AO:=(MA(Y,5) - MA(Y,34));
AC:=MA((AO - MA(AO,5)),5);
AC1:=REF(AC,1);
AO1:=REF(AO,1);
KAC:=IF(((AC > AC1) AND (AO > AO1)),1,0);
KAO:=IF(((AC < AC1) AND (AO < AO1)),(0 - 1),0);
蓝:SMA(REF(Y,8),13,1),COLORFF0000;
红:SMA(REF(Y,5),8,1),COLOR0000FF;
绿:SMA(REF(Y,3),5,1),COLOR00FF00;
上碎型:IF((HIGH >= R2),UL,REF(UL,BARSLAST((HIGH > R2)))),POINTDOT,COLORFF00FF,LINETHICK2;
下碎型:IF((LOW <= R2),DL,REF(DL,BARSLAST((LOW <= R2)))),POINTDOT,COLOR00FFFF,LINETHICK2;
STICKLINE((BARSLAST(ABS((上碎型 - REF(上碎型,1)))) < BARSLAST(((CLOSE > 上碎型) AND (REF(CLOSE,1) < REF(上碎型,1))))),上碎型,上碎型,3,1),COLORFF00FF;
STICKLINE((BARSLAST(ABS((下碎型 - REF(下碎型,1)))) < BARSLAST(((CLOSE < 下碎型) AND (REF(CLOSE,1) > REF(下碎型,1))))),下碎型,下碎型,3,1),COLOR00FFFF;
H1:=REF(HIGH,4);
H2:=REF(HIGH,3);
H3:=REF(HIGH,2);
H4:=REF(HIGH,1);
H5:=HIGH;
L1:=REF(LOW,4);
L2:=REF(LOW,3);
L3:=REF(LOW,2);
L4:=REF(LOW,1);
L5:=LOW;
‖:=((((H3 > H2) AND (H3 > H1)) AND (H3 > H4)) AND (H3 > H5));
‖FRACTAL:=IF(‖,1,0);
‖VAR1:=BACKSET(‖FRACTAL,3);
‖VAR2:=FILTER(‖VAR1,2);
‖VAR3:=BACKSET(‖FRACTAL,5);
∣:=((((L3 < L2) AND (L3 < L1)) AND (L3 < L4)) AND (L3 < L5));
∣FRACTAL:=IF(∣,1,0);
∣VAR1:=BACKSET(∣FRACTAL,3);
∣VAR2:=FILTER(∣VAR1,2);
∣VAR3:=BACKSET(∣FRACTAL,5);
DRAWTEXT(‖VAR2,(HIGH +0.15),'●'),COLORRED;
DRAWTEXT(∣VAR2,LOW-0.05,'●'),COLORFF0000;
DRAWTEXT(((CLOSE > 上碎型) AND (REF(CLOSE,1) < REF(上碎型,1))),(HIGH +0.15),'↑'),COLORRED;
DRAWTEXT(((CLOSE < 下碎型) AND (REF(CLOSE,1) > REF(下碎型,1))),(LOW * 0.99),'↓'),COLOR33FF33;
DRAWTEXT((((KU = 1) AND (REF(KU,1) = 0)) AND (CLOSE < 0)),LOW* 0.99,'↑'),COLORRED;
DRAWTEXT((((KD = (0 - 1)) AND (REF(KD,1) = 0)) AND (CLOSE < 0)),(HIGH * 1.01),'↓'),COLOR33FF33;
DRAWTEXT((((KU = 0) AND (REF(KU,1) = 1)) AND (CLOSE < 0)),(HIGH * 1.01),'▼'),COLOR33FF33;
DRAWTEXT((((KD = 0) AND (REF(KD,1) = (0 - 1))) AND (CLOSE < 0)),LOW,'△'),COLORRED;
STICKLINE(((KAC = 1) AND (CLOSE >= OPEN)),OPEN,CLOSE,3,1),COLOR0000FF;
STICKLINE(((KAO = (0 - 1)) AND (CLOSE >= OPEN)),OPEN,CLOSE,3,1),COLOR33FF33;
STICKLINE((((KAO = 0) AND (KAC = 0)) AND (CLOSE >= OPEN)),OPEN,CLOSE,3,1),COLOR808080;
STICKLINE((CLOSE >= OPEN),HIGH,CLOSE,0.3,1),COLOR0000FF;
STICKLINE((CLOSE >= OPEN),OPEN,LOW,0.3,1),COLOR0000FF;
STICKLINE(((KAC = 1) AND (CLOSE < OPEN)),OPEN,CLOSE,3,0),COLOR0000FF;
STICKLINE(((KAO = (0 - 1)) AND (CLOSE < OPEN)),OPEN,CLOSE,3,0),COLOR33FF33;
STICKLINE((((KAO = 0) AND (KAC = 0)) AND (CLOSE < OPEN)),OPEN,CLOSE,3,0),COLOR808080;
STICKLINE((OPEN > CLOSE),HIGH,OPEN,0.3,0 ),COLORFFFF00;
STICKLINE((OPEN > CLOSE),CLOSE,LOW,0.3,0 ),COLORFFFF00;
|