拐点捉妖 通达信副图指标源码
N:=2;M:=30;
DRAWGBK(CURRBARSCOUNT=1 , RGB(0,0,0),RGB(0,0,0),0,'1',0);
gsptcom:(EMA(C,5) * 7 + EMA(C,10) * 3) / 10,LINETHICK2,COLORWHITE;
A1:=(H + L + O + C) / 4;
A2:=EMA(A1,13) - EMA(A1,34);
A3:=EMA(A2,5);
A4:=(A2 - A3) * 5;
A5:=IF(A4 >= 1000,1000,IF(A4 <= A1,A1,A4));
A6:=FORCAST(FORCAST(A5,32),10);
A7:=(C - EMA(C,13)) / EMA(C,13) * (0 - 100);
A8:=EMA(A7 / 10 + EMA(C,13),8);
A9:=EMA(C,3);
A10:=EMA(SLOPE(C,22) * 20 + C,45);
A11:=IF(PERIOD >8 AND PERIOD < 11,MA(A10,1),IF(PERIOD = 8,MA(A10,4),IF(PERIOD = 7,MA(A10,8),IF(PERIOD = 6,MA(A10,16),IF(PERIOD = 5,MA(A10,32),0)))));
A12:=A11 * 0.865;
A13:=IF(A9 > A11,A9,A12);
买卖线:REVERSE(A13) + 2 * A6,LINETHICK1, COLORMAGENTA;
拐点:IF(EMA((1 - C / SMA(C,5,1)) * 100 * C / 100 + EMA(C,13),9) < gsptcom AND gsptcom > 买卖线,EMA((1 - C / SMA(C,5,1)) * 100 * C / 100 + EMA(C,13),9),gsptcom),LINETHICK2, COLORRED;IF(gsptcom <= 买卖线,gsptcom,DRAWNULL),LINETHICK3,COLORGREEN;
A14:=C * V;
A15:=EMA((EMA(A14,3) / EMA(V,3) + EMA(A14,6) / EMA(V,6) + EMA(A14,12) / EMA(V,12) + EMA(A14,24) / EMA(V,24)) / 4,13);
A16:=1.06 * A15;
A17:=(C - REF(C,1)) / REF(C,1) * 100 > 8.5;
A18:=EMA(H,10) * (1 + 5 / 100);
捉妖:CROSS(gsptcom,MA(H,30) * (1 + 13 / 100)) * 10,NODRAW;
A19:=(C - O) / REF(C,1) * 100;
A20:=REF(H,N) = HHV(H,2 * N + 1);
A21:=FILTER(A20,N);
A22:=BACKSET(A21,N + 1);
A23:=FILTER(A22,N);
A24:=REF(L,N) = LLV(L,2 * N + 1);
A25:=FILTER(A24,N);
A26:=BACKSET(A25,N + 1);
A27:=FILTER(A26,N);
A28:=(REF(LLV(L,2 * N),1) + REF(HHV(H,2 * N),1)) / 2;
A29:=(H + L) / 2;
A30:=(A23 AND NOT(A27 AND A28 >= A29)) OR ISLASTBAR OR BARSCOUNT(C) = 1;
A31:=A27 AND NOT(A23 AND A28 < A29);
A32:=REF(BARSLAST(A30),1) + 1;
A33:=BACKSET(A30 AND COUNT(A31,A32) > 0,LLVBARS(IF(A31,L,10000),A32));
A34:=A33 > REF(A33,1);
A35:=BACKSET(A34,2);
A36:=A35 > REF(A35,1);
A37:=A36 OR ISLASTBAR OR BARSCOUNT(C) = 1;
A38:=REF(BARSLAST(A37),1) + 1;A39:=BACKSET(A37 AND COUNT(A23 AND NOT(A27 AND A28 >= A29),A38) > 0,HHVBARS(IF(A23 AND NOT(A27 AND A28 >= A29),H,0),A38));
A40:=A39 > REF(A39,1);
A41:=BACKSET(A40,2);
A42:=A41 > REF(A41,1);
A43:=BACKSET(ISLASTBAR,BARSLAST(A42) + 1);
A44:=A43 > REF(A43,1);
A45:=BACKSET(A44,REF(BARSLAST(A42),1) + 2);
A46:=A45 > REF(A45,1);
短期压力:DRAWLINE(A46,H,A44,H,1),LINETHICK2,COLORBLUE;
STICKLINE(gsptcom >= 买卖线,C,H,0,0),COLORRED;
STICKLINE(gsptcom >= 买卖线 AND C > O,C,O,2.5,1),COLORRED;
STICKLINE(gsptcom >= 买卖线,L,O,0,0),COLORRED;
STICKLINE(gsptcom >= 买卖线 AND C <= O,O,C,3,1),COLORRED;
STICKLINE(gsptcom >= 买卖线 AND C <= O,O,C,1,0),COLORAAAA00;
STICKLINE(gsptcom < 买卖线 AND C <= O,C,O,1.5,0),COLORCYAN;
STICKLINE(gsptcom < 买卖线 AND C <= O,O,H,0,0),COLORCYAN;
STICKLINE(gsptcom < 买卖线 AND C <= O,L,C,0,0),COLORCYAN;
STICKLINE(gsptcom < 买卖线 AND C >= O,L,O,0,0),COLORCYAN;
STICKLINE(gsptcom < 买卖线 AND C >= O,C,H,0,0),COLORCYAN;
STICKLINE(gsptcom < 买卖线 AND C >= O,O,C,2.5,1),COLORCYAN;
STICKLINE(A17 > 0 AND CROSS(MA(C,1),A18) AND CROSS(MA(C,1),A16),(L + H + O) / 3,O,3,0),COLORRED;
STICKLINE(A17 > 0 AND CROSS(MA(C,1),A18) AND CROSS(MA(C,1),A16),(H + O) / 2,C,3,0),COLORYELLOW;STICKLINE(A17 > 0 AND CROSS(MA(C,1),A18) AND CROSS(MA(C,1),A16),(H + O) / 2,(L + H + O) / 3,3,0),COLORFF0000;
STICKLINE(CROSS(gsptcom,MA(H,30) * (1 + 13 / 100)),MA(H,30) * (1 + 13 / 100),MA(H,30) * (1 + 13 / 100) * 1.0052,8,0),COLORYELLOW;
STICKLINE(C >= REF(C,1) * 1.095 AND C = O AND L < C,C,O,5,0),COLORWHITE;
STICKLINE(C >= REF(C,1) * 1.095 AND C = O AND L < C,C,L,0,0),COLORWHITE;
STICKLINE(A19 > 7.5 AND REF(A19,1) < -5 AND C > REF(O,1),H,L,0,0),COLORFF0099;
STICKLINE(A19 > 7.5 AND REF(A19,1) < -5 AND C > REF(O,1),C,O,3,0),COLORFF0099;
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
N赋值:2
M赋值:30
填充背景(CURRBARSCOUNT=1 , RGB(0,0,0),RGB(0,0,0),0,'1',0)
GSPTCO输出M:(C的5日指数移动平均 * 7 + C的10日指数移动平均 * 3) / 10,LINETHICK2,画白色
A1赋值:(H + L + O + C) / 4
A2赋值:A1的13日指数移动平均 - A1的34日指数移动平均
A3赋值:A2的5日指数移动平均
A4赋值:(A2 - A3) * 5
A5赋值:IF(A4 >= 1000,1000,IF(A4 <= A1,A1,A4))
A6赋值:FORCAST(FORCAST(A5,32),10)
A7赋值:(C - C的13日指数移动平均) / C的13日指数移动平均 * (0 - 100)
A8赋值:A7 / 10 + C的13日指数移动平均,8)
A9赋值:C的3日指数移动平均
A10:=EMA(SLOPE(C,22) * 20 + C,45)
A11:=IF(PERIOD >8 AND PERIOD < 11,A10的1日简单移动平均,IF(PERIOD = 8,A10的4日简单移动平均,IF(PERIOD = 7,A10的8日简单移动平均,IF(PERIOD = 6,A10的16日简单移动平均,IF(PERIOD = 5,A10的32日简单移动平均,0)))))
A12:=A11 * 0.865
如果A9 > A11返回A9否则返回A12
输出买卖线:A13的相反数 + 2 * A6,LINETHICK1, COLORMAGENTA
C的5日[1日权重]移动平均
如果GSPTCOM <= 买卖线返回GSPTCOM否则返回DRAWNULL
A14:=C * V
A15:=EMA((EMA(A14,3) / EMA(V,3) + EMA(A14,6) / EMA(V,6) + EMA(A14,12) / EMA(V,12) + EMA(A14,24) / EMA(V,24)) / 4,13)
A16:=1.06 * A15
A17:=(C - 1日前的C) / 1日前的C * 100 > 8.5
A18:=H的10日指数移动平均 * (1 + 5 / 100)
输出捉妖:CROSS(GSPTCOM,H的30日简单移动平均 * (1 + 13 / 100)) * 10,NODRAW
A19:=(C - O) / 1日前的C * 100
A20:=N日前的H = 2 * N + 1日内H最高值
A21:=A20的N过滤
A22:=BACKSET(A21,N + 1)
A23:=A22的N过滤
A24:=N日前的L = 2 * N + 1日内L最低值
A25:=A24的N过滤
A26:=BACKSET(A25,N + 1)
A27:=A26的N过滤
A28:=(REF(2 * N日内L最低值,1) + REF(2 * N日内H最高值,1)) / 2
A29:=(H + L) / 2
A30:=(A23 AND NOT(A27 AND A28 >= A29)) OR ISLASTBAR OR C的有效数据周期数 = 1
A31:=A27 AND NOT(A23 AND A28 < A29)
A32:=REF(上次A30距今天数,1) + 1
如果A31返回L否则返回10000
A34:=A33 > 1日前的A33
A35:=BACKSET(A34,2)
A36:=A35 > 1日前的A35
A37:=A36 OR ISLASTBAR OR C的有效数据周期数 = 1
A38:=REF(上次A37距今天数,1) + 1
A39:=BACKSET(A37 AND COUNT(A23 AND NOT(A27 AND A28 >= A29),A38) > 0,HHVBARS(IF(A23 AND NOT(A27 AND A28 >= A29),H,0),A38))
A40:=A39 > 1日前的A39
A41:=BACKSET(A40,2)
A42:=A41 > 1日前的A41
A43:=BACKSET(ISLASTBAR,上次A42距今天数 + 1)
A44:=A43 > 1日前的A43
A45:=BACKSET(A44,REF(上次A42距今天数,1) + 2)
A46:=A45 > 1日前的A45
输出短期压力:DRAWLINE(A46,H,A44,H,1),LINETHICK2, 画蓝色
当满足条件GSPTCOM >= 买卖线时,在C和H之间画柱状线
当满足条件GSPTCOM >= 买卖线 AND C > O时,在C和O之间画柱状线
当满足条件GSPTCOM >= 买卖线时,在L和O之间画柱状线
当满足条件GSPTCOM >= 买卖线 AND C <= O时,在O和C之间画柱状线
当满足条件GSPTCOM >= 买卖线 AND C <= O时,在O和C之间画柱状线
当满足条件GSPTCOM < 买卖线 AND C <= O时,在C和O之间画柱状线
当满足条件GSPTCOM < 买卖线 AND C <= O时,在O和H之间画柱状线
当满足条件GSPTCOM < 买卖线 AND C <= O时,在L和C之间画柱状线
当满足条件GSPTCOM < 买卖线 AND C >= O时,在L和O之间画柱状线
当满足条件GSPTCOM < 买卖线 AND C >= O时,在C和H之间画柱状线
当满足条件GSPTCOM < 买卖线 AND C >= O时,在O和C之间画柱状线
STICKLINE(A17 > 0 AND CROSS(C的1日简单移动平均,A18) AND CROSS(C的1日简单移动平均,A16),(L + H + O) / 3,O,3,0),画红色
STICKLINE(A17 > 0 AND CROSS(C的1日简单移动平均,A18) AND CROSS(C的1日简单移动平均,A16),(H + O) / 2,C,3,0),画黄色
STICKLINE(A17 > 0 AND CROSS(C的1日简单移动平均,A18) AND CROSS(C的1日简单移动平均,A16),(H + O) / 2,(L + H + O) / 3,3,0),COLORFF0000
STICKLINE(CROSS(GSPTCOM,H的30日简单移动平均 * (1 + 13 / 100)),H的30日简单移动平均 * (1 + 13 / 100),H的30日简单移动平均 * (1 + 13 / 100) * 1.0052,8,0),画黄色
STICKLINE(C >= 1日前的C * 1.095 AND C = O AND L < C,C,O,5,0),画白色
STICKLINE(C >= 1日前的C * 1.095 AND C = O AND L < C,C,L,0,0),画白色
STICKLINE(A19 > 7.5 AND 1日前的A19 < -5 AND C > 1日前的O,H,L,0,0),COLORFF0099
STICKLINE(A19 > 7.5 AND 1日前的A19 < -5 AND C > 1日前的O,C,O,3,0),COLORFF0099