Вот где current_pat определен в коде.
current_idx = idx[-6:]
current_pat = price[current_idx]
XA = current_pat[1] - current_pat[0]
AB = current_pat[2] - current_pat[1]
BC = current_pat[3] - current_pat[2]
CD = current_pat[4] - current_pat[3]
XD = np.arange(current_pat[0],current_pat[4])
AC = np.arange(current_pat[1],current_pat[3])
XD_range = np.array([np.mean(XD,dtype=int) - err_allowedHAS, np.mean(XD,dtype=int) + err_allowedHAS])
AC_range = np.array([np.mean(AC,dtype=int) - err_allowedHAS, np.mean(AC,dtype=int) + err_allowedHAS])
здесь моя ошибка. Я, честно говоря, не уверен, почему это произошло
File "C:\Users\Owner\Desktop\TradingAlgorithm\TraditionalFunctions.py", line 30, in isHeadAndShoulders
XD = np.arange(current_pat[0],current_pat[4])
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()