编写条件:
编写方法:
网友求助:
想在k线上加一条16天均线,但我想K线边成以下 ,K线在16天上为红色,下面为绿色
MA20:=MA(CLOSE,16);
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;
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;