通达信公式改为同花顺提示"行9:缺少;"?请哪位大神帮忙解决,拜谢了!!!?

发布时间:
2024-12-18 18:34
阅读量:
7

// 上轨和下轨使用EMA计算,并且设置了颜色

上轨: EMA(H, 55), COLORGREEN;

下轨: EMA(L, 55), COLORGREEN;


// 使用PLOYLINE(假设是POLYLINE)绘制条件线,并用IF语句选择性显示

A1: POLYLINE(C > 上轨, 上轨);

NOTEXT_A2: IF(C > 上轨, A1, DRAWNULL), COLORRED;


B1: POLYLINE(C > 下轨, 下轨);

NOTEXT_B2: IF(C > 下轨, B1, DRAWNULL), COLORRED;


// MACD相关计算

DIF := (EMA(CLOSE, 12) - EMA(CLOSE, 26)) * 100;

DEA := EMA(DIF, 9);

MACD := (DIF - DEA) * 2;


// 神龙抄底13号逻辑

CDYH := DIF / C < 下偏离值 AND DIF / C < 0; // 注意:这里需要定义"下偏离值"

抄底一号 := MACD > REF(MACD, 1) AND DIF < REF(DIF, 1) * 1.01 AND CDYH, COLORWHITE;

底一号 := 抄底一号 AND REF(抄底一号, 1) = 0, COLORWHITE;

DRAWTEXT(底一号, L * 0.99, '←偏离'), COLORMAGENTA;


JJCC := CROSS(DIF, DEA);


X0ZHH := BARSLAST(CROSS(0, DIF)) + 1;

SCCTS := BARSLAST(CROSS(DEA, DIF)) + 1, NODRAW;


DIFZDZ1 := LLV(DIF, SCCTS), NODRAW;

GJJZDZ := LLV(L, SCCTS), NODRAW;

DIFZDZ2 := LLV(DIF, X0ZHH), NODRAW;


DIFWS0ZZ := HHV(DIF, SCCTS) < -0.08;

LGLJXX := REF(MACD, 1) < 0 AND REF(MACD, 2) < 0;


BLLL := LGLJXX AND DIFWS0ZZ AND (DIFZDZ1 >= REF(DIFZDZ1, SCCTS) OR DIFZDZ1 >= REF(DIFZDZ2, SCCTS)) AND GJJZDZ <= REF(GJJZDZ, SCCTS);


三号 := JJCC AND DIF < 0 AND BLLL, COLORMAGENTA;

DRAWTEXT(三号, L * 0.99, '←背离'), COLORMAGENTA;


// 神龙逃顶13号逻辑

CCDD1 := DIF / C > 上偏离值 AND DIF / C > 0; // 注意:这里需要定义"上偏离值"

逃顶一号 := MACD < REF(MACD, 1) AND DIF > REF(DIF, 1) AND CCDD1, COLORWHITE;

顶一号 := 逃顶一号 AND REF(逃顶一号, 1) = 0, COLORWHITE;

DRAWTEXT(顶一号, H * 1.0, '←偏离'), COLORGREEN;


JJC := CROSS(DEA, DIF);


X0ZHHL := BARSLAST(CROSS(DIF, 0)) + 1;

SCCTSS := BARSLAST(CROSS(DIF, DEA)) + 1, NODRAW;


DIFZDZ11 := HHV(DIF, SCCTSS), NODRAW;

GJJZDZZ := HHV(H, SCCTSS), NODRAW;


DIFWS0ZZZ := HHV(DIF, SCCTSS) > 0.08;

LGLJXXX := REF(MACD, 1) > 0 AND REF(MACD, 2) > 0;


BLLLL := LGLJXXX AND DIFWS0ZZZ AND (DIFZDZ11 <= REF(DIFZDZ11, SCCTSS)) AND GJJZDZZ >= REF(GJJZDZZ, SCCTSS);


顶三号 := JJC AND DIF > 0 AND BLLLL, COLORMAGENTA;

DRAWTEXT(顶三号, H * 1.0, '←背离'), COLORGREEN;



试试看吧,没经过测试。

END