咨询内容: 在1分钟K线上可否叠加分时均价黄线,,如何叠加,
技术人员:
分时图中的均价黄色线无法直接提取,您可以通过SETTLE函数近似取得。SETTLE计算开盘以来至今用量进行加权计算的价格均值。
源码如下:
M:=EMA(REF(SETTLE,1),1);
A:=M-REF(M,1);
B:=REFX(A,1);
AB:=IFELSE(SETTLE>=M,1,-1);
DRAWSL(REFX(AB,1)=1,M,B,1,0,COLORMAGENTA);
DRAWSL(REFX(AB,1)=-1,M,B,1,0,COLORGREEN);
www.GSZB.com:C,NODRAW; DRAWLINE(SETTLE<C&&C>O,H,SETTLE<C&&C>O,C,COLORRED);
DRAWLINE(SETTLE<C&&C>O,L,SETTLE<C&&C>O,O,COLORRED);
DRAWLINE(SETTLE<C&&C<O,H,SETTLE<C&&C<O,O,COLORRED);
DRAWLINE(SETTLE<C&&C<O,L,SETTLE<C&&C<O,C,COLORRED);
DRAWLINE(SETTLE<C&&C=O,L,SETTLE<C&&C=O,C,COLORRED);
DRAWLINE(SETTLE<C&&C=O,H,SETTLE<C&&C=O,C,COLORRED);
DRAWLINE(SETTLE>C&&C>O,H,SETTLE>C&&C>O,C,COLORLIGHTGREEN);
DRAWLINE(SETTLE>C&&C>O,L,SETTLE>C&&C>O,O,COLORLIGHTGREEN);
DRAWLINE(SETTLE>C&&C<O,H,SETTLE>C&&C<O,O,COLORLIGHTGREEN);
DRAWLINE(SETTLE>C&&C<O,L,SETTLE>C&&C<O,C,COLORLIGHTGREEN);
DRAWLINE(SETTLE>C&&C=O,L,SETTLE>C&&C=O,C,COLORLIGHTGREEN);
DRAWLINE(SETTLE>C&&C=O,H,SETTLE>C&&C=O,C,COLORLIGHTGREEN);
STICKLINE(SETTLE<=C&&C>=O,C,O,COLORRED,1);
STICKLINE(SETTLE<C&&C<O,C,O,COLORRED,0);
STICKLINE(SETTLE>C&&C>=O,C,O,COLORLIGHTGREEN,1);
STICKLINE(SETTLE>=C&&C<=O,C,O,COLORLIGHTGREEN,0);
评论(0)