I haven't had the chance to type in the code and test it yet. But Ehlers's book - Rocket Science for Traders - has a chapter on making indicators adaptive to what he calls Homodyne Discriminator. Supposedly, it is an instantaneous cycle period. He includes code for RSI, Stochastic, and CCI. The book does have a lot of EL code. allister