通达信如何在中实现均线指标变换
以下是大智慧的公式,实现切换日线和周线周期时,K线图的指标也跟着变化,在通达信中如何实现?
谢了
IF datatype=8 then begin
MA(C,13),colorred;
MA(C,34),colorgreen;
MA(C,55),colorblue;
{MA(C,89),DOTLINE;
MA(C,133),DOTLINE;}
DRAWTEXTREL(220,20,'日线:(13,34,55) '), colorbbffff;
end
if datatype=7 then begin
MA(c,3),colorred;
MA(C,8),colorgreen;
MA(C,18),colorblue;
MA(C,220),DOTLINE;
ma(c,18)-ref(ma(c,18),1),LINETHICK0;
DRAWICON(TIME=103000,LOW,11),ALIGN1;
DRAWTEXTREL(220,20,'60周期:(3,8,18,220) '), colorbbffff;
end
内容解答
第一种方法
N:=IF(PERIOD==4,3,IF(PERIOD==5,13,DRAWNULL));
M:=IF(PERIOD==4,8,IF(PERIOD==5,34,DRAWNULL));
K:=IF(PERIOD==4,18,IF(PERIOD==5,55,DRAWNULL));
Z:=IF(PERIOD==4,220,IF(PERIOD==5,0,DRAWNULL));
MA(C,N),COLORRED;
MA(C,M),COLORGREEN;
MA(C,K),COLORBLUE;
MA(C,Z),DOTLINE;
第二种方法
日MA13:IF(PERIOD=5,MA(C,13),DRAWNULL)COLORRED;
日MA34:IF(PERIOD=5,MA(C,34),DRAWNULL)COLORGREEN;
日MA55:IF(PERIOD=5,MA(C,55),DRAWNULL)COLORBLUE;
时MA3:IF(PERIOD=4,MA(C,3),DRAWNULL)COLORRED;
时MA8:IF(PERIOD=4,MA(C,8),DRAWNULL)COLORGREEN;
时MA18:IF(PERIOD=4,MA(C,18),DRAWNULL)COLORBLUE;
时MA220:IF(PERIOD=4,MA(C,220),DRAWNULL)DOTLINE;
上一篇:通达信分时量比曲线支持历史分时图 下一篇:通达信【股票之友S理论】—S理论K组