编写思路黄金期货配资
缠论自动画笔,显示高低点H012 l012和对应的点位,最后一笔标注新高和新低,用于文华财经主图指标
指标源码
N:=20;
HH:=(H>HV(H,N));//笔规则,就是笔指标参数为10;
NH:=(BARSLAST(HH)+1);
LL:=(L<LV(L,N));
NL:=(BARSLAST(LL)+1);
AH:=(BACKSET(COUNT(LL,NH)&&LL,NH));
AL:=(BACKSET(COUNT(HH,NL)&&HH,NL));
DRAWLINE1(CROSS(AH=1,0.5),H,CROSS(AL=1,0.5),L,0),DASHDOTDOT,LINETHICK1,RGB(146,99,1);//画笔
DRAWLINE1(CROSS(AL=1,0.5),L,CROSS(AH=1,0.5),H,0),DASHDOTDOT,LINETHICK1,RGB(143,32,255);
DRAWNUMBER(CROSS(AH=1,0.5),H+0MINPRICE,H-VALUEWHEN(CROSS(AL=1,0.5),L),0,COLORMAGENTA),ALIGN1,VALIGN0,FONTSIZE16;//波段幅度
DRAWNUMBER(CROSS(AL=1,0.5),L-0MINPRICE,L-VALUEWHEN(CROSS(AH=1,0.5),H),0,COLORGREEN),ALIGN1,VALIGN2,FONTSIZE16;
//画当下最后一笔(未完成笔);
HH1:=CROSS(AH=1,0.5);
LL1:=CROSS(AL=1,0.5);
DRAWLINE3(ISLASTBAR&&BARSLAST(HH1)<BARSLAST(LL1),VALUEWHEN(HH1,H),BARSLAST(HH1),1,LLV(L,BARSLAST(HH1)),LLVBARS(L,BARSLAST(HH1)),0),RGB(200,200,0),LINETHICK6;//当下一笔(未完成),向下笔;
DRAWLINE3(ISLASTBAR&&BARSLAST(HH1)>BARSLAST(LL1),VALUEWHEN(LL1,L),BARSLAST(LL1),1,HHV(H,BARSLAST(LL1)),HHVBARS(H,BARSLAST(LL1)),0),RGB(200,200,0),LINETHICK6;//当下最后运行中的一笔(未完成),向上笔;
//2、画倒数1234的笔;
//2.1、倒数第4笔(已完成);
BADS4:=BACKSET(ISLASTBAR黄金期货配资,SUMBARS(CROSS(AL=1,0.5)