通达信k线在动量线0轴上方条件源码是什么?

请提供一段通达信软件的公式代码,用于判断K线是否位于动量线的0轴上方。

1 个回答

fl

```kdj_top:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100; kdj_bottom:=(HHV(HIGH,9)-CLOSE)/(HHV(HIGH,9)-LLV(LOW,9))*100; kdj_macd:=(EMA(CLOSE,12)-EMA(CLOSE,26))/EMA(CLOSE,9)*100; kdj_signal:=EMA(kdj_macd,9); kdj_cross:=(kdj_macd-kdj_signal)>0; kdj_top_cross:=(kdj_top-kdj_bottom)>0; kdj_signal_cross:=(kdj_signal-kdj_bottom)>0; kdj_top_signal_cross:=(kdj_top-kdj_signal)>0; if (kdj_top_cross AND kdj_signal_cross) or (kdj_top_signal_cross AND kdj_signal_cross) then result := 'K线位于动量线0轴上方'; else result := 'K线不在动量线0轴上方'; endif; result```