The talib.MACDEXT()
function is used to calculate MACD with controllable MA type.
The return value of the talib.MACDEXT()
function is a two-dimensional array.
array
talib.MACDEXT(inReal) talib.MACDEXT(inReal, optInFastPeriod) talib.MACDEXT(inReal, optInFastPeriod, optInFastMAType) talib.MACDEXT(inReal, optInFastPeriod, optInFastMAType, optInSlowPeriod) talib.MACDEXT(inReal, optInFastPeriod, optInFastMAType, optInSlowPeriod, optInSlowMAType) talib.MACDEXT(inReal, optInFastPeriod, optInFastMAType, optInSlowPeriod, optInSlowMAType, optInSignalPeriod) talib.MACDEXT(inReal, optInFastPeriod, optInFastMAType, optInSlowPeriod, optInSlowMAType, optInSignalPeriod, optInSignalMAType)
The inReal
parameter is used to specify the K-line data.
inReal
true
{@struct/Record Record} structure arrays, numeric arrays
The optInFastPeriod
parameter is used to set the fast period, the default value is 12.
optInFastPeriod
false
number
The optInFastMAType
parameter is used to set the fast average type, the default value is 0.
optInFastMAType
false
number
The optInSlowPeriod
parameter is used to set the slow period, the default value is 26.
optInSlowPeriod
false
number
The optInSlowMAType
parameter is used to set the slow mean type, the default value is 0.
optInSlowMAType
false
number
The optInSignalPeriod
parameter is used to set the signal period, the default value is 9.
optInSignalPeriod
false
number
The optInSignalMAType
parameter is used to set the signal mean type, the default value is 0.
optInSignalMAType
false
number
function main() {
var records = exchange.GetRecords()
var ret = talib.MACDEXT(records)
Log(ret)
}
import talib
def main():
records = exchange.GetRecords()
ret = talib.MACDEXT(records.Close)
Log(ret)
void main() {
auto records = exchange.GetRecords();
auto ret = talib.MACDEXT(records);
Log(ret);
}
The MACDEXT()
function is described in the talib library documentation as: MACDEXT(Records[Close],Fast Period = 12,Fast MA = 0,Slow Period = 26,Slow MA = 0,Signal Period = 9,Signal MA = 0) = [Array(outMACD),Array(outMACDSignal),Array(outMACDHist)]