Skip to content

Commit ac8ac2b

Browse files
authored
Add Martin Pring's Special K to documentation. (#283)
# Describe Request Add Martin Pring's Special K to documentation. Fixed # (issue) # Change Type Fix documentation. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - New Features - Added Martin Pring’s Special K momentum indicator, providing an advanced, long- and short-term trend momentum view by combining multiple smoothed rate-of-change components into a single signal. - Available for use in momentum analysis workflows with time-synchronized output. - Documentation - Updated README to include Martin Pring’s Special K in the Momentum Indicators list and added usage details for the new indicator. - Chores - No functional changes outside the new indicator; no breaking changes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent e700988 commit ac8ac2b

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ The following list of indicators are currently supported by this package:
6868
- [Ichimoku Cloud](momentum/README.md#type-ichimokucloud)
6969
- [Percentage Price Oscillator (PPO)](momentum/README.md#type-ppo)
7070
- [Percentage Volume Oscillator (PVO)](momentum/README.md#type-pvo)
71+
- [Martin Pring's Special K](momentum/README.md#PringsSpecialK)
7172
- [Relative Strength Index (RSI)](momentum/README.md#type-rsi)
7273
- [Qstick](momentum/README.md#type-qstick)
7374
- [Stochastic Oscillator](momentum/README.md#type-stochasticoscillator)

momentum/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ The information provided on this project is strictly for informational purposes
4141
- [func NewPpo\[T helper.Number\]\(\) \*Ppo\[T\]](<#NewPpo>)
4242
- [func \(p \*Ppo\[T\]\) Compute\(closings \<\-chan T\) \(\<\-chan T, \<\-chan T, \<\-chan T\)](<#Ppo[T].Compute>)
4343
- [func \(p \*Ppo\[T\]\) IdlePeriod\(\) int](<#Ppo[T].IdlePeriod>)
44+
- [type PringsSpecialK](<#PringsSpecialK>)
45+
- [func NewPringsSpecialK\[T helper.Float\]\(\) \*PringsSpecialK\[T\]](<#NewPringsSpecialK>)
46+
- [func \(p \*PringsSpecialK\[T\]\) Compute\(closings \<\-chan T\) \<\-chan T](<#PringsSpecialK[T].Compute>)
4447
- [type Pvo](<#Pvo>)
4548
- [func NewPvo\[T helper.Number\]\(\) \*Pvo\[T\]](<#NewPvo>)
4649
- [func \(p \*Pvo\[T\]\) Compute\(volumes \<\-chan T\) \(\<\-chan T, \<\-chan T, \<\-chan T\)](<#Pvo[T].Compute>)
@@ -431,6 +434,59 @@ func (p *Ppo[T]) IdlePeriod() int
431434

432435
IdlePeriod is the initial period that Percentage Price Oscillator won't yield any results.
433436

437+
<a name="PringsSpecialK"></a>
438+
## type [PringsSpecialK](<https://github.com/cinar/indicator/blob/master/momentum/prings_special_k.go#L12-L38>)
439+
440+
PringsSpecialK implements Martin Pring's Special K momentum indicator. It composes multiple Rate\-of\-Change \(ROC\) series smoothed by Simple Moving Averages \(SMA\) and outputs a weighted sum aligned to the slowest path so all terms are time\-synchronized. See Compute for the exact composition and weights.
441+
442+
```go
443+
type PringsSpecialK[T helper.Float] struct {
444+
Roc10 *trend.Roc[T]
445+
Roc15 *trend.Roc[T]
446+
Roc20 *trend.Roc[T]
447+
Roc30 *trend.Roc[T]
448+
Roc40 *trend.Roc[T]
449+
Roc65 *trend.Roc[T]
450+
Roc75 *trend.Roc[T]
451+
Roc100 *trend.Roc[T]
452+
Roc195 *trend.Roc[T]
453+
Roc265 *trend.Roc[T]
454+
Roc390 *trend.Roc[T]
455+
Roc530 *trend.Roc[T]
456+
457+
Sma10Roc10 *trend.Sma[T]
458+
Sma10Roc15 *trend.Sma[T]
459+
Sma10Roc20 *trend.Sma[T]
460+
Sma15Roc30 *trend.Sma[T]
461+
Sma50Roc40 *trend.Sma[T]
462+
Sma65Roc65 *trend.Sma[T]
463+
Sma75Roc75 *trend.Sma[T]
464+
Sma100Roc100 *trend.Sma[T]
465+
Sma130Roc195 *trend.Sma[T]
466+
Sma130Roc265 *trend.Sma[T]
467+
Sma130Roc390 *trend.Sma[T]
468+
Sma195Roc530 *trend.Sma[T]
469+
}
470+
```
471+
472+
<a name="NewPringsSpecialK"></a>
473+
### func [NewPringsSpecialK](<https://github.com/cinar/indicator/blob/master/momentum/prings_special_k.go#L41>)
474+
475+
```go
476+
func NewPringsSpecialK[T helper.Float]() *PringsSpecialK[T]
477+
```
478+
479+
NewPringsSpecialK function initializes a new Martin Pring's Special K instance.
480+
481+
<a name="PringsSpecialK[T].Compute"></a>
482+
### func \(\*PringsSpecialK\[T\]\) [Compute](<https://github.com/cinar/indicator/blob/master/momentum/prings_special_k.go#L72>)
483+
484+
```go
485+
func (p *PringsSpecialK[T]) Compute(closings <-chan T) <-chan T
486+
```
487+
488+
Compute function takes a channel of numbers and computes the Prings Special K.
489+
434490
<a name="Pvo"></a>
435491
## type [Pvo](<https://github.com/cinar/indicator/blob/master/momentum/pvo.go#L35-L44>)
436492

0 commit comments

Comments
 (0)