资源加载中... loading...

TA.KDJ

TA.KDJ()函数用于计算随机指标

TA.KDJ()函数的返回值为二维数组,结构为:[K, D, J]。 array

TA.KDJ(inReal) TA.KDJ(inReal, period, kPeriod, dPeriod)

inReal参数用于指定K线数据。 inReal true {@struct/Record Record}结构数组、数值数组 period参数用于设置周期1。 period false number kPeriod参数用于设置周期2。 kPeriod false number dPeriod参数用于设置周期3。 dPeriod false number

function main(){
    var records = exchange.GetRecords(PERIOD_M15)
    var kdj = TA.KDJ(records, 9, 3, 3)
    Log("k:", kdj[0], "d:", kdj[1], "j:", kdj[2])
}
def main():
    r = exchange.GetRecords(PERIOD_M15)
    kdj = TA.KDJ(r, 9, 3, 3)
    Log("k:", kdj[0], "d:", kdj[1], "j:", kdj[2])
void main() {
    auto r = exchange.GetRecords();
    auto kdj = TA.KDJ(r, 9, 3, 3);
    Log("k:", kdj[0], "d:", kdj[1], "j:", kdj[2]);
}

测试TA.KDJ()函数:

TA.KDJ()函数的periodkPerioddPeriod参数的默认值为:933

{@fun/TA/TA.MACD TA.MACD}, {@fun/TA/TA.RSI TA.RSI}, {@fun/TA/TA.ATR TA.ATR}, {@fun/TA/TA.OBV TA.OBV}, {@fun/TA/TA.MA TA.MA}, {@fun/TA/TA.EMA TA.EMA}, {@fun/TA/TA.BOLL TA.BOLL}, {@fun/TA/TA.Alligator TA.Alligator}, {@fun/TA/TA.CMF TA.CMF}, {@fun/TA/TA.Highest TA.Highest}, {@fun/TA/TA.Lowest TA.Lowest}

TA.MACD TA.RSI