如何增加16天K线且线上为红色,线下为绿色_指标公式答疑_000001在线网_Www.000001zx.com
如何增加16天K线且线上为红色,线下为绿色
网友求助:

想在K线上加一条16天均线,但我想K线变成以下 ,K线在16天上为红色,下面为绿色

MA20:=MA(CLOSE,16);{000001ZX.coM};
STICKLINE(O>C AND C>MA20,O,C,2,0),colorred;
STICKLINE(O>C AND C>MA20,L,H,0.5,0),colorred;
STICKLINE(O<C AND C>MA20,O,C,2,0),colorred;
STICKLINE(O<C AND C>MA20,C,H,0.5,0),colorred;
STICKLINE(O<C AND C>MA20,O,L,0.5,0),colorred;
STICKLINE(O=C AND C>MA20,O,C,2,0),colorred;
STICKLINE(O=C AND C>MA20,L,H,0.5,0),colorred;
STICKLINE(O>C AND C<MA20,O,C,2,0),colorblue;
STICKLINE(O>C AND C<MA20,L,H,0.5,0),colorblue;
STICKLINE(O<C AND C<MA20,O,C,2,0),colorblue;
STICKLINE(O<C AND C<MA20,C,H,0.5,0),colorblue;
STICKLINE(O<C AND C<MA20,O,L,0.5,0),colorblue;
STICKLINE(O=C AND C<MA20,O,C,2,0),colorblue;
STICKLINE(O=C AND C<MA20,L,H,0.5,0),colorblue;

解答如下:

MA20:MA(CLOSE,16),COLORGREEN,LINETHICK2;
IF(C>=MA20,MA20,DRAWNULL),COLORRED,LINETHICK2;
STICKLINE(O>C AND C>MA20,O,C,2,0),COLORRED;
STICKLINE(O>C AND C>MA20,L,H,0,0),COLORRED;
STICKLINE(O<C AND C>MA20,O,C,2,0),COLORRED;
STICKLINE(O<C AND C>MA20,C,H,0,0),COLORRED;
STICKLINE(O<C AND C>MA20,O,L,0,0),COLORRED;
STICKLINE(O=C AND C>MA20,O,C,2,0),COLORRED;
STICKLINE(O=C AND C>MA20,L,H,0,0),COLORRED;
STICKLINE(O>C AND C<MA20,O,C,2,0),COLORBLUE;
{000001ZX.coM};STICKLINE(O>C AND C<MA20,L,H,0,0),COLORBLUE;
STICKLINE(O<C AND C<MA20,O,C,2,0),COLORBLUE;
STICKLINE(O<C AND C<MA20,C,H,0,0),COLORBLUE;
STICKLINE(O<C AND C<MA20,O,L,0,0),COLORBLUE;
STICKLINE(O=C AND C<MA20,O,C,2,0),COLORBLUE;
STICKLINE(O=C AND C<MA20,L,H,0,0),COLORBLUE;
{000001在线www.000001zx.com};