Skip to content

Commit

Permalink
Documenting the RsiPeriod function. (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
cinar authored May 21, 2022
1 parent 7e5365e commit 098a42b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion momentum_indicators.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func Rsi(closing []float64) ([]float64, []float64) {
}

// RsiPeriod allows to calculate the RSI indicator with a non-standard period.

func RsiPeriod(period int, closing []float64) ([]float64, []float64) {
gains := make([]float64, len(closing))
losses := make([]float64, len(closing))
Expand Down
5 changes: 5 additions & 0 deletions momentum_indicators.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ RSI = 100 - (100 / (1 + RS))
```Golang
rs, rsi := indicator.Rsi(closing)
```
The [RsiPeriod](https://pkg.go.dev/github.com/cinar/indicator#RsiPeriod) allows to calculate the RSI indicator with a non-standard period.

```Golang
rs, rsi := indicator.RsiPeriod(period, closing)
```

#### Stochastic Oscillator

Expand Down

0 comments on commit 098a42b

Please sign in to comment.