Cosine, In-Phase & Quadrature IFM [Ehlers]

DasanC Updated   
Yet another method for determining the cycle of a market: this time, you have access to the two fastest and most accurate methods
as well as the option to average these methods together.

The controls are pretty straight forward:

Source lets you select the price data to perform calculations on (close, open, etc..)

Max Period is simply the cap for the algorithm when it's checking the validity of Periods.
-> If you notice your plots have a flat top, then increase this value to accept a wider range of Periods.
-> This setting has a min. value of 8 to reduce noise and a max of 100 to ignore waves from higher time frames.

Average? simply averages the two methods of calculation.
-> You may want to do this if you notice the two plots diverging a lot.
-> Cosine IFM tends to favor shorter periods; I-Q IFM tends to favor longer.

- DasanC
Release Notes:
Updated the preview image.
Release Notes:
Updated to make the code modular.
Now you're able to copy & paste the function into any script to add a method for adaptive period setting.
Simply call:
to get the period.

Need Indicators/Strategies for TradingView? -> t.me/pinescripters_jobs
General questions about Pinescript? -> t.me/pinescripters
My Premium Discord Coming soon!
Open-source script

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.


The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?