把下面代码加到你的主图代码前面,可同时表现大盘的K线(为不影响原K线,用了较暗的色彩,不满意的话可本身调解)。(见下图)
$ \/ r# [. j/ g# g0 T, X, P7 V7 f' C, e- ]! s N; a
+ {7 S+ x- ? w6 T" b
{主图叠加大盘;}
0 n- C( m( w/ _4 h( | s周期:=120; P5 f! p% [ h5 `( V6 R$ ~
盘1:=CONST(LLV(INDEXL,周期)); 盘差:=CONST(HHV(INDEXH,周期))-盘1;, Y( N% ^) i8 f; F
价1:=CONST(LLV(L,周期)); 价差:=CONST(HHV(H,周期))-价1;" S) ]2 }; [1 J! Q! z0 z2 X
价盘比:= 价差/盘差;
$ A' ]% `( p) C/ |2 ^* r{大盘: 价1+(INDEXC-盘1)*价盘比,COLORAA0077;}: J7 ^; m1 o& ]
CX:=价1+(INDEXC-盘1)*价盘比;
* L3 T( D' K# wHX:=价1+(INDEXH-盘1)*价盘比; ! Y' N4 [) e1 \' ]0 {
LX:=价1+(INDEXL-盘1)*价盘比; 3 ~- R8 {' E( ~! l) @
OX:=价1+(INDEXO-盘1)*价盘比;6 C& x1 q! m" x2 [+ p* p( o/ }- B
STICKLINE(OX=CX,OX,CX,1,1),COLOR8A0000;
1 t w$ V$ I& e6 c# g1 n3 b{重绘K线}
3 b9 {* c9 f' ~9 hDRAWKLINE(HIGH,OPEN,LOW,CLOSE);
/ |7 W. `' w0 Z7 B! n& L{以上代码加到你主图代码的前面}; r( |7 g: Q0 M o' a- |* Y
+ R# v4 ~' L1 `' f5 U" f) z: Z" |{以下是你的主图原码}9 G; e: T7 o/ K' V
{比如:布林线信号}' r {, D& a" t' O
H_L:=价差;0 Q. j, o. b7 f1 M& u% f& h
BOLL:MA(C,20),COLORGREEN;
6 g/ s% c7 G% v) v% f: A# {7 Y" dUPPER:BOLL+2*STD(C,20),COLORMAGENTA; X H! S: p( ^/ Y
LOWER:BOLL-2*STD(C,20),COLORMAGENTA; ] f8 P. Q" M* Q
DRAWICON(CROSS(C,LOWER),L-H_L*0.1,7);{买信号B}+ [( e9 ~2 k5 W8 Y5 U( {
DRAWICON(CROSS(UPPER,C),H+H_L*0.1,8);{卖信号S}; |