GregoryMorse / trendln

Support and Resistance Trend lines Calculator for Financial Analysis
MIT License
663 stars 162 forks source link

unable to get minimaIdxs, maximaIdxs for Lows, Highs #18

Closed tsferro2 closed 3 years ago

tsferro2 commented 3 years ago

I am looking to capture the minimaIdxs, maximaIdxs from separate Low and High series respectively, but the following line (taken from the read me file):

minimaIdxs, maximaIdxs = trendln.get_extrema(df['Low'], df['High'])

throws the following error:

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

also should add that each series contains only numbers, ie no nans/missing values

tsferro2 commented 3 years ago

I figured out my issue, just needed to pass a tuple:

minimaIdxs, maximaIdxs = trendln.get_extrema((df['Low'], df['High']))