Skip to content

Instantly share code, notes, and snippets.

@joeng03
Created May 4, 2021 10:14
Show Gist options
  • Save joeng03/f24a5ee76fea9ec4f379010c4ef1e195 to your computer and use it in GitHub Desktop.
Save joeng03/f24a5ee76fea9ec4f379010c4ef1e195 to your computer and use it in GitHub Desktop.
local_min_idx=argrelextrema(prices_low,np.less)[0]
local_max_idx=argrelextrema(prices_high,np.greater)[0]
local_min_idx=np.array(local_min_idx)
local_max_idx=np.array(local_max_idx)
local_min=[]
local_max=[]
for loc in local_min_idx:
local_min.append(prices_low[loc])
for loc in local_max_idx:
local_max.append(prices_high[loc])
local_min=np.array(local_min)
local_max=np.array(local_max)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment