I have color coded everything as follows: blue line is the dominant cycle, orange line is the power converted to decibels, and I have marked the other line as red if you should sell or green if you should buy
Let me know if you would like to see me write any other scripts!
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
I can explain more in a call, but my guts tell me that:
-Fourier Series and FFT/DFT are good for guessing the "frequencies", but not so good to estimate the equivalent of a "non constant" mean value.
-somehow we need to remove the "DC" value which is also fluctuating, but we could estimate as a straight line, with a growth coefficient. This could be interesting for a short region only after the current values.
please let me know if you have some time to talk. My programming skills are not so good.