I'm new to Python, and don't understand this IDE error if the TA-Lib function is supposed to return a scalar, presumably a float. 'Close' is a NumPy array of close pricing, and represents resampled pricing data that is expected to be complete by this exchange time stamp. Does the Q IDE interpret MACDValue to be an array?
MACDValue = 0
MACDValue = ta.EMA(Close, MACDShtLen) - ta.EMA(Close, MACDLngLen)
if math.isnan(MACDValue) :
MACDValue = 0
TypeError: only length-1 arrays can be converted to Python scalars
USER ALGORITHM:875, in handle_data
if math.isnan(MACDValue) :