Casey Percent C

All functions · nseries package

CaseyPercentC

func (s Series) CaseyPercentC(lookback int, smoothLen int) Series

CaseyPercentC implements Ali Casey’s C% oscillator.

The output is on a 0 to 100 scale. Bar 0’s return is taken as 0, so bars 0 to lookback-1 are 0 and the first valid index is lookback, the first bar whose lookback window holds only real returns. From there the smoother runs as if the series started at bar lookback, so its own pass-through bars follow; the simple average’s first full window ends at bar lookback+smoothLen-1. 0 also comes from a flat window. Releases before this change kept bar 0’s zero return in the windows and used expanding windows before bar lookback, so early values were often 0 or 100.

CaseyPercentCSuperSmoother

func (s Series) CaseyPercentCSuperSmoother(lookback int, smoothLen int) Series

CaseyPercentCSuperSmoother implements Ali Casey’s C% oscillator but with Ehlers’ Super Smoother rather than SMA.

The warm-up is CaseyPercentC’s: bars 0 to lookback-1 are 0 and the smoother starts at bar lookback, passing its own seed bars through.

CaseyPercentCUltimateSmoother

func (s Series) CaseyPercentCUltimateSmoother(lookback int, smoothLen int) Series

CaseyPercentCUltimateSmoother implements Ali Casey’s C% oscillator but with Ehlers’ Ultimate Smoother rather than SMA.

The warm-up is CaseyPercentC’s: bars 0 to lookback-1 are 0 and the smoother starts at bar lookback, passing its own seed bars through.

CaseyPercentCXAverage

func (s Series) CaseyPercentCXAverage(lookback int, smoothLen int) Series

CaseyPercentCXAverage implements Ali Casey’s C% oscillator but with an EMA rather than SMA.

The warm-up is CaseyPercentC’s: bars 0 to lookback-1 are 0 and the smoother starts at bar lookback, passing its own seed bars through.