The TA.KDJ()
function is used to calculate stochastic indicators.
The return value of the TA.KDJ()
function is a two-dimensional array with the structure: [K, D, J]
.
array
TA.KDJ(inReal) TA.KDJ(inReal, period, kPeriod, dPeriod)
The inReal
parameter is used to specify the K-line data.
inReal
true
{@struct/Record Record} structure arrays, numeric arrays
The period
parameter is used to set period 1.
period
false
number
The kPeriod
parameter is used to set period 2.
kPeriod
false
number
The dPeriod
parameter is used to set period 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]);
}
The default values for the period
, kPeriod
, and dPeriod
parameters of the TA.KDJ()
function are: 9
, 3
, and 3
.
{@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