通达信自动测幅主图
KG1:=20;
F1:=10;
A1:=10;
A2:=10;
A3:=ZIG(1,A1);
A4:=PEAK(1,A1,1);
A5:=TROUGH(1,A1,1);
CC:=IF((A3 < (REF(A3,1))),A4,A5),LINETHICK2;
A6:=CROSS((A4 - 0.02),A3);
A7:=CROSS(A3,(A5 + 0.02));
A8:=A2 / 100;
A9:=IF((A3 < (REF(A3,1))),A8,REVERSE(A8));
A10:=IF((A3 < (REF(A3,1))),A6,A7);
H1:REF((CC * (1 - (A9 * 1))),BARSLAST(A10)),DOTLINE;
H2:REF((CC * (1 - (A9 * 2))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H3:REF((CC * (1 - (A9 * 3))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H4:REF((CC * (1 - (A9 * 4))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H5:REF((CC * (1 - (A9 * 5))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H6:REF((CC * (1 - (A9 * 6))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H7:REF((CC * (1 - (A9 * 7))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H8:REF((CC * (1 - (A9 * 8))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H9:REF((CC * (1 - (A9 * 9))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H10:REF((CC * (1 - (A9 * 10))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H11:REF((CC * (1 - (A9 * 11))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H12:REF((CC * (1 - (A9 * 12))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H13:REF((CC * (1 - (A9 * 13))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H14:REF((CC * (1 - (A9 * 14))),BARSLAST(A10)),DOTLINE,LINETHICK0;
H15:REF((CC * (1 - (A9 * 15))),BARSLAST(A10)),DOTLINE,LINETHICK0;
A11:=BARSLAST((ISLASTBAR = 1)) + 1;
A12:=HHV(HIGH,100);
A13:=LLV(LOW,100);
A14:=IF((PERIOD = 12),1.00005,(IF((PERIOD < 3),1.0005,1.002)));
STICKLINE(((CC >= A13) AND (CC <= A12)),CC,(CC * A14),10,-1000),COLORRED;
STICKLINE(((CC >= A13) AND (CC <= A12)),H1,H1,5,0),COLORGRAY;
STICKLINE(((H1 > A13) AND (H1 < A12)),H2,H2,5,0),COLORGRAY;
STICKLINE(((H2 > A13) AND (H2 < A12)),H3,H3,5,0),COLORGRAY;
STICKLINE(((H3 > A13) AND (H3 < A12)),H4,H4,5,0),COLORGRAY;
STICKLINE(((H4 > A13) AND (H4 < A12)),H5,H5,5,0),COLORGRAY;
STICKLINE(((H5 > A13) AND (H5 < A12)),H6,H6,5,0),COLORGRAY;
STICKLINE(((H6 > A13) AND (H6 < A12)),H7,H7,5,0),COLORGRAY;
STICKLINE(((H7 > A13) AND (H7 < A12)),H8,H8,5,0),COLORGRAY;
STICKLINE(((H8 > A13) AND (H8 < A12)),H9,H9,5,0),COLORGRAY;
STICKLINE(((H9 > A13) AND (H9 < A12)),H10,H10,5,0),COLORGRAY;
STICKLINE(((H10 > A13) AND (H10 < A12)),H11,H11,5,0),COLORGRAY;
STICKLINE(((H11 > A13) AND (H11 < A12)),H12,H12,5,0),COLORGRAY;
STICKLINE(((H12 > A13) AND (H12 < A12)),H13,H13,5,0),COLORGRAY;
STICKLINE(((H13 > A13) AND (H13 < A12)),H14,H14,5,0),COLORGRAY;
STICKLINE(((H14 > A13) AND (H14 < A12)),H15,H15,5,0),COLORGRAY;
DRAWTEXT(BARSLAST(A10) ,H1,'10' ),COLORC0C0C0;
DRAWTEXT(BARSLAST(A10) ,H2,'20'),COLORC0C0C0;
DRAWTEXT(BARSLAST(A10) ,H3,'30'),COLORC0C0C0;
DRAWTEXT(BARSLAST(A10) ,H4,'40'),COLORC0C0C0;
DRAWTEXT(BARSLAST(A10) ,H5,'50'),COLORC0C0C0;
DRAWTEXT(BARSLAST(A10) ,H6,'60'),COLORC0C0C0;
DRAWTEXT(BARSLAST(A10) ,H7,'70'),COLORC0C0C0;
DRAWTEXT(BARSLAST(A10) ,H8,'80'),COLORC0C0C0;
DRAWTEXT(BARSLAST(A10) ,H9,'90'),COLORC0C0C0;
DRAWTEXT(BARSLAST(A10) ,H10,'100'),COLORC0C0C0;
未来函数检测结果如下:
该公式包含未来函数:ZIG
该公式包含未来函数:PEAK
该公式包含未来函数:TROUGH
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
KG1赋值:20
F1赋值:10
A1赋值:10
A2赋值:10
A3赋值:ZIG(1,A1)
A4赋值:PEAK(1,A1,1)
A5赋值:TROUGH(1,A1,1)
CC赋值:IF((A3 < (1日前的A3)),A4,A5), 线宽为2
A6赋值:CROSS((A4 - 0.02),A3)
A7赋值:CROSS(A3,(A5 + 0.02))
A8赋值:A2 / 100
A9赋值:IF((A3 < (1日前的A3)),A8,A8的相反数)
A10:=IF((A3 < (1日前的A3)),A6,A7)
输出
H1:REF((CC * (1 - (A9 * 1))),上次A10距今天数),DOTLINE
输出
H2:REF((CC * (1 - (A9 * 2))),上次A10距今天数),DOTLINE,LINETHICK0
输出
H3:REF((CC * (1 - (A9 * 3))),上次A10距今天数),DOTLINE,LINETHICK0
输出
H4:REF((CC * (1 - (A9 * 4))),上次A10距今天数),DOTLINE,LINETHICK0
输出
H5:REF((CC * (1 - (A9 * 5))),上次A10距今天数),DOTLINE,LINETHICK0
输出
H6:REF((CC * (1 - (A9 * 6))),上次A10距今天数),DOTLINE,LINETHICK0
输出
H7:REF((CC * (1 - (A9 * 7))),上次A10距今天数),DOTLINE,LINETHICK0
输出
H8:REF((CC * (1 - (A9 * 8))),上次A10距今天数),DOTLINE,LINETHICK0
输出
H9:REF((CC * (1 - (A9 * 9))),上次A10距今天数),DOTLINE,LINETHICK0
H10:REF((CC * (1 - (A9 * 10))),上次A10距今天数),DOTLINE,LINETHICK0
H11:REF((CC * (1 - (A9 * 11))),上次A10距今天数),DOTLINE,LINETHICK0
H12:REF((CC * (1 - (A9 * 12))),上次A10距今天数),DOTLINE,LINETHICK0
H13:REF((CC * (1 - (A9 * 13))),上次A10距今天数),DOTLINE,LINETHICK0
H14:REF((CC * (1 - (A9 * 14))),上次A10距今天数),DOTLINE,LINETHICK0
H15:REF((CC * (1 - (A9 * 15))),上次A10距今天数),DOTLINE,LINETHICK0
A11:=上次(ISLASTBAR = 1距今天数) + 1
A12:=100日内最高价最高值
A13:=100日内最低价最低值
A14:=IF((PERIOD = 12),1.00005,(IF((PERIOD < 3),1.0005,1.002)))
STICKLINE(((CC >= A13) AND (CC <= A12)),CC,(CC * A14),10,-1000),画红色
STICKLINE(((CC >= A13) AND (CC <= A12)),H1,H1,5,0),COLORGRAY
STICKLINE(((H1 > A13) AND (H1 < A12)),H2,H2,5,0),COLORGRAY
STICKLINE(((H2 > A13) AND (H2 < A12)),H3,H3,5,0),COLORGRAY
STICKLINE(((H3 > A13) AND (H3 < A12)),H4,H4,5,0),COLORGRAY
STICKLINE(((H4 > A13) AND (H4 < A12)),H5,H5,5,0),COLORGRAY
STICKLINE(((H5 > A13) AND (H5 < A12)),H6,H6,5,0),COLORGRAY
STICKLINE(((H6 > A13) AND (H6 < A12)),H7,H7,5,0),COLORGRAY
STICKLINE(((H7 > A13) AND (H7 < A12)),H8,H8,5,0),COLORGRAY
STICKLINE(((H8 > A13) AND (H8 < A12)),H9,H9,5,0),COLORGRAY
STICKLINE(((H9 > A13) AND (H9 < A12)),H10,H10,5,0),COLORGRAY
STICKLINE(((H10 > A13) AND (H10 < A12)),H11,H11,5,0),COLORGRAY
STICKLINE(((H11 > A13) AND (H11 < A12)),H12,H12,5,0),COLORGRAY
STICKLINE(((H12 > A13) AND (H12 < A12)),H13,H13,5,0),COLORGRAY
STICKLINE(((H13 > A13) AND (H13 < A12)),H14,H14,5,0),COLORGRAY
STICKLINE(((H14 > A13) AND (H14 < A12)),H15,H15,5,0),COLORGRAY
DRAWTEXT(上次A10距今天数 ,H1,'10' ),COLORC0C0C0
DRAWTEXT(上次A10距今天数 ,H2,'20'),COLORC0C0C0
DRAWTEXT(上次A10距今天数 ,H3,'30'),COLORC0C0C0
DRAWTEXT(上次A10距今天数 ,H4,'40'),COLORC0C0C0
DRAWTEXT(上次A10距今天数 ,H5,'50'),COLORC0C0C0
DRAWTEXT(上次A10距今天数 ,H6,'60'),COLORC0C0C0
DRAWTEXT(上次A10距今天数 ,H7,'70'),COLORC0C0C0
DRAWTEXT(上次A10距今天数 ,H8,'80'),COLORC0C0C0
DRAWTEXT(上次A10距今天数 ,H9,'90'),COLORC0C0C0
DRAWTEXT(上次A10距今天数 ,H10,'100'),COLORC0C0C0