Nov-01-2022, 08:22 PM
(This post was last modified: Nov-01-2022, 08:22 PM by deanhystad.)
From your latest post it looks like there is another loop that you are not showing (index). Is all the code from your last post inside another loop? If so, there is no need to make fibo a function. It will update each time the loop executes.
cma = 0 for index in range(whatever): fibo = (max_close - (3853.5)) / (max_close - cma) # Will use current cma value, not always zero. sumvolfibo = sm / fibo() foundIndex = 0 som = 0 for i in range(index,810): som += vol_list[i] if som >= sumvolfibo: foundIndex = i break # do something that calculates a new cma value