Skip to content

Commit

Permalink
docs: Update docs for v1.3.0 (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeDongGeon1996 authored May 6, 2024
1 parent bd24d59 commit b5fa2f2
Show file tree
Hide file tree
Showing 79 changed files with 447 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/_indicators/Adl.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ADLResults[ADLResult]
### Utilities

- ~~[.to_quotes()]({{site.baseurl}}/utilities#convert-to-quotes)~~ <code style='color: #d32f2f; important'>[deprecated]</code>
- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)

Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Adx.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ADXResults[ADXResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Alligator.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ AlligatorResults[AlligatorResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Alma.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ ALMAResults[ALMAResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Aroon.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ AroonResults[AroonResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Atr.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ ATRResults[ATRResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
96 changes: 96 additions & 0 deletions docs/_indicators/AtrStop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
title: ATR Trailing Stop
description: Created by Welles Wilder, the ATR Trailing Stop indicator attempts to determine the primary trend of financial market prices by using Average True Range (ATR) band thresholds. It can indicate a buy/sell signal or a trailing stop when the trend changes.
permalink: /indicators/AtrStop/
type: price-trend
layout: indicator
---

# {{ page.title }}

><span class="indicator-syntax">**get_atr_stop**(*quotes, lookback_periods=21, multiplier=3, end_type=EndType.CLOSE*)</span>
## Parameters

| name | type | notes
| -- |-- |--
| `quotes` | Iterable[Quote] | Iterable of the [Quote class]({{site.baseurl}}/guide/#historical-quotes) or [its sub-class]({{site.baseurl}}/guide/#using-custom-quote-classes). <br><span class='qna-dataframe'> • [See here]({{site.baseurl}}/guide/#using-pandasdataframe) for usage with pandas.DataFrame</span>
| `lookback_periods` | int, *default 21* | Number of periods (`N`) for the ATR evaluation. Must be greater than 1.
| `multiplier` | float, *default 3* | Multiplier sets the ATR band width. Must be greater than 0 and is usually set around 2 to 3.
| `end_type` | EndType, *default EndType.Close* | Determines whether `Close` or `High/Low` is used as basis for stop offset. See [EndType options](#endtype-options) below.

### Historical quotes requirements

You must have at least `N+100` periods of `quotes` to cover the convergence periods. Since this uses a smoothing technique, we recommend you use at least `N+250` periods prior to the intended usage date for optimal precision.

`quotes` is an `Iterable[Quote]` collection of historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See [the Guide]({{site.baseurl}}/guide/#historical-quotes) for more information.

### EndType options

```python
from stock_indicators.indicators.common.enums import EndType
```

| type | description
|-- |--
| `CLOSE` | Stop offset from `Close` price (default)
| `HIGH_LOW` | Stop offset from `High` or `Low` price

## Returns

```python
AtrStopResults[AtrStopResult]
```

- This method returns a time series of all available indicator values for the `quotes` provided.
- `AtrStopResults` is just a list of `AtrStopResult`.
- It always returns the same number of elements as there are in the historical quotes.
- It does not return a single incremental indicator value.
- The first `N` periods will have `None` AtrStop values since there's not enough data to calculate.

>&#9886; **Convergence warning**: the line segment before the first reversal and the first `N+100` periods are unreliable due to an initial guess of trend direction and precision convergence for the underlying ATR values.
### AtrStopResult

| name | type | notes
| -- |-- |--
| `date` | datetime | Date
| `atr_stop` | Decimal, Optional | ATR Trailing Stop line contains both Upper and Lower segments
| `buy_stop` | Decimal, Optional | Upper band only (green)
| `sell_stop` | Decimal, Optional | Lower band only (red)

`buy_stop` and `sell_stop` values are provided to differentiate buy vs sell stop lines and to clearly demark trend reversal. `atr_stop` is the contiguous combination of both upper and lower line data.

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)

See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information.

## Example

```python
from stock_indicators import indicators

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")

# calculate 21-period ATR Stop
results = indicators.get_atr_stop(quotes)
```

## About {{ page.title }}

Created by Welles Wilder, the ATR Trailing Stop indicator attempts to determine the primary trend of Close prices by using [Average True Range (ATR)]({{site.baseurl}}/indicators/Atr/#content) band thresholds. It can indicate a buy/sell signal or a trailing stop when the trend changes.
[[Discuss] &#128172;]({{site.dotnet.repo}}/discussions/724 "Community discussion about this indicator")

![chart for {{page.title}}]({{site.dotnet.charts}}/AtrStop.png)


### Sources

- [C# core]({{site.dotnet.src}}/a-d/AtrStop/AtrStop.Series.cs)
- [Python wrapper]({{site.python.src}}/atr_stop.py)
1 change: 1 addition & 0 deletions docs/_indicators/Awesome.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ AwesomeResults[AwesomeResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Beta.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ BetaResults[BetaResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/BollingerBands.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ BollingerBandsResults[BollingerBandsResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Bop.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ BOPResults[BOPResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Cci.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ CCIResults[CCIResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/ChaikinOsc.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ ChaikinOscResults[ChaikinOscResult]
### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Chandelier.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ChandelierResults[ChandelierResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Chop.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ChopResults[ChopResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Cmf.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ CMFResults[CMFResult]
### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
75 changes: 75 additions & 0 deletions docs/_indicators/Cmo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: Chande Momentum Oscillator (CMO)
description: The Chande Momentum Oscillator is a momentum indicator depicting the weighted percent of higher prices in financial markets.
permalink: /indicators/Cmo/
type: oscillator
layout: indicator
---

# {{ page.title }}

><span class="indicator-syntax">**get_cmo**(*quotes, lookback_periods*)</span>
## Parameters

| name | type | notes
| -- | -- | --
| `quotes` | Iterable[Quote] | Iterable of the [Quote class]({{site.baseurl}}/guide/#historical-quotes) or [its sub-class]({{site.baseurl}}/guide/#using-custom-quote-classes). <br><span class='qna-dataframe'> • [See here]({{site.baseurl}}/guide/#using-pandasdataframe) for usage with pandas.DataFrame</span>
| `lookback_periods` | int | Number of periods (`N`) in the lookback window. Must be greater than 0.

### Historical quotes requirements

You must have at least `N+1` periods of `quotes` to cover the warmup periods.

`quotes` is an `Iterable[Quote]` collection of historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See [the Guide]({{site.baseurl}}/guide/#historical-quotes) for more information.

## Returns

```python
CMOResults[CMOResult]
```

- This method returns a time series of all available indicator values for the `quotes` provided.
- `CMOResults` is just a list of `CMOResult`.
- It always returns the same number of elements as there are in the historical quotes.
- It does not return a single incremental indicator value.
- The first `N` periods will have `None` values for CMO since there's not enough data to calculate.

### CmoResult

| name | type | notes
| -- |-- |--
| `date` | datetime | Date
| `cmo` | float, Optional | Chande Momentum Oscillator

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)

See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information.

## Example

```python
from stock_indicators import indicators

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")

results = indicators.get_cmo(quotes, lookback_periods)
```

## About {{ page.title }}

Created by Tushar Chande, the [Chande Momentum Oscillator](https://www.investopedia.com/terms/c/chandemomentumoscillator.asp) is a weighted percent of higher prices over a lookback window.
[[Discuss] &#128172;]({{site.dotnet.repo}}/discussions/892 "Community discussion about this indicator")

![chart for {{page.title}}]({{site.dotnet.charts}}/Cmo.png)

### Sources

- [C# core]({{site.dotnet.src}}/a-d/Cmo/Cmo.Series.cs)
- [Python wrapper]({{site.python.src}}/cmo.py)
1 change: 1 addition & 0 deletions docs/_indicators/ConnorsRsi.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ ConnorsRSIResults[ConnorsRSIResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Correlation.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ CorrelationResults[CorrelationResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Dema.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ DEMAResults[DEMAResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
1 change: 1 addition & 0 deletions docs/_indicators/Donchian.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ DonchianResults[DonchianResult]

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Dpo.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ DPOResults[DPOResult]

### Utilities

- ~~[.to_quotes()]({{site.baseurl}}/utilities#convert-to-quotes)~~ <code style='color: #d32f2f; important'>[deprecated]</code>
- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)

Expand Down
Loading

0 comments on commit b5fa2f2

Please sign in to comment.