Skip to content

Cycle


Even Better SineWave

This indicator attempts to quantify market cycles using a low pass filter.

Sources

Parameters:

Name Type Description Default
close Series

close Series

required
length int

Max cycle/trend period. Values between 40-48 work as expected with minimum value: 39. Default: 40

None
bars int

Period of low pass filtering. Default: 10

None
offset int

Post shift. Default: 0

None

Other Parameters:

Name Type Description
fillna value

Replaces na's with value.

Returns:

Type Description
Series

1 column

Note

The default is more cycle oriented and seems to be less whipsaw-prune. The older version might offer earlier signals at medium and stronger reversals. Compared to TradingView, returns very close results but appears to be one bar earlier.


NOTICE

Thanks to all those that have sponsored and dontated to the library in the past! Your support has been greatly appreciated! 🙏

However, future releases are on definite hold until 100+ donations of $150+ have been received via Buy Me a Coffee.

Help keep this library and application the best in it's class!




Reflex

This cycle indicator, by John F. Ehlers, attempts to reduce lag.

Sources

Parameters:

Name Type Description Default
close Series

close Series

required
length int

The period. Default: 20

None
smooth int

SuperSmoother period. Default: 20

None
alpha float

Alpha weight of Difference Sums. Default: 0.04

None
pi float

Ehlers's truncated value: 3.14159. Default: 3.14159

None
sqrt2 float

Ehlers's truncated value: 1.414. Default: 1.414

None
offset int

Post shift. Default: 0

None

Other Parameters:

Name Type Description
fillna value

Replaces na's with value.

Returns:

Type Description
Series

1 column

Tip

This implementation has a separate control parameter for the internal applied SuperSmoother.

Note

John F. Ehlers introduced two indicators within the article "Reflex: A New Zero-Lag Indicator” in February 2020, TASC magazine. One of which is Reflex, a lag reduced cycle indicator. Both indicators (Reflex/Trendflex) are oscillators that complement each other with the focus for cycle and trend.


"Buy Me A Coffee"

ko-fi